- 博客(14)
- 资源 (1)
- 收藏
- 关注
原创 Hello SSVM: 利用 SSVM + wasm 实现万花尺图案的绘制
最近看到写 Rust 函数,免费树莓派的活动,便了解了一下SSVM, 对我来说 ssvmup 与 wasm-pack 相比最方便的一点是: 除了在 Rust 和 JavaScript 之间传递字符串值外,ssvmup 工具还支持以下数据类型。 Rust 调用的参数可以是i32,String,&str,Vec<u8>和&[u8]的任意组合 返回值可以是i32或String或Vec<u8> 对于像结构这样的复杂数据类型,可以使用 JSON 字符串传递数据 ...
2020-07-30 21:05:58 1280
原创 google/gops源码分析
原文地址https://github.com/XanthusL/blog-gen/blob/master/content/post/gops.md 发现了一个很实用的工具:gops gops is a command to list and diagnose Go processes currently running on your system. 觉得判断一个进程是否是go程序挺有意思,不妨
2017-11-13 19:00:56 512
原创 不再傻傻分不清:atoi, itoa, iota
atoiArray to Integer 字符数组(字符串)转化为整数。golang标准库与C++标准库均有itoaInteger to Array 整数转化为字符串。golang标准库与C++标准库均有iota希腊字母。golang中定义常量经常用的iota关键字,C艹中用于Store increasing sequence。 emmmmm, 都是递增
2017-11-09 20:50:05 2918 1
原创 Redis中zset的golang实现
zset初衷是在不用Redis的前提下实现排行榜 项目地址https://github.com/XanthusL/zsetInstallationgo get -u github.com/XanthusL/zsetUsageRemoved RWLock in the SortedSet. Just implement it yourself if you need.s := zset.New(
2017-10-27 17:50:17 1743
原创 golang笔记:游戏中排行榜的实现
原文地址https://github.com/XanthusL/blog-gen 游戏开发中排行榜经常出现,接触过的排行榜有两种。一种是由玩家挑战排名比自己靠前的其他玩家,胜利后交换位置;另一种是根据玩家的某特性对所有玩家进行排序。第一种只涉及到两个玩家数据的变化,实现起来比较简单,因此只记录第二种情况。需求 排行榜内容是有序的所有玩家信息(以等级为例) 玩家等级变化后,更新排行榜 根据玩家id获取
2017-09-27 19:56:27 2800
原创 git笔记(reflog)
原文地址https://github.com/XanthusL/blog-gen 不熟悉git,差点翻车 一如既往,在项目中添加某特性后愉快地提交git commit -m "Feature add: blablabla" -- a.go b.go c.gogit push前习惯性地git status 于是发现了漏网的:On branch develop Your branch is up-
2017-09-27 19:44:45 249
原创 23. Merge k Sorted Lists
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. /** * Definition for singly-linked list. * type ListNode struct { * Val int * Next *ListNo
2017-07-05 14:34:48 180
原创 10. Regular Expression Matching
Implement regular expression matching with support for ‘.’ and ‘*’. ‘.’ Matches any single character. ‘*’ Matches zero or more of the preceding element. The matching should cove
2017-07-05 14:32:01 172
原创 149. Max Points on a Line
Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. Solution:/** * Definition for a point. * type Point struct { * X int * Y int * } */ fun
2017-07-05 14:28:55 208
原创 2. Add Two Numbers
You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it
2017-03-08 16:16:19 235
原创 4. Median of Two Sorted Arrays
There are two sorted arrays nums1 and nums2 of size m and n respectively.Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).Example 1:nums1 = [1, 3] nums2
2017-03-08 16:07:02 209
原创 6. ZigZag Conversion
The string “PAYPALISHIRING” is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)P A H N A P L S I I G Y
2017-03-08 16:01:06 218
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人