I hereby claim:
- I am samuelfvlcastro on github.
- I am samuelfvlcastro (https://keybase.io/samuelfvlcastro) on keybase.
- I have a public key ASDEU6_VGCo5tntWBjKJckmp1hhr30nOGtCw1pRHY67afAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
Q: pointers vs values (in general) ?
A:
Don't pass pointers as function arguments just to save a few bytes.
Don't pass a pointer to a string (*string) or a pointer to an interface value (*io.Reader). In both cases the value itself is a fixed size and can be passed directly.
Use pointes on large structs, or even small structs that might grow.
-- Variables | |
v1, v2, v3 = 3, 2, 1 | |
print(v1,v2,v3, v4 --[[by default it's nil]]) | |
v5, v6, v7 = true, 1, 0 -- Are all "true" values | |
v8, v9 = false, nil -- Are the only "false" values | |
--[[ Operators | |
1 - The logical AND, OR, and NOT | |
2 - The inequality operator is ~= instead of !=. |
var blocks = ["A","A","A","A","A","A","A","A","A","A","A","A","B","B","A","C","C","C","C","D","D","D","D","A","A","E","E","E","A"]; | |
function Encode(input){ | |
var segmentLength = blocks.length; | |
var run = 0, current = '', last = '', encoded = ''; | |
current = last = blocks[0]; | |
for(var i = 1; i <= segmentLength; i++){ | |
if(current !== last){ |
function logBinary(number){ | |
console.log((number >>> 0).toString(2).replace(/(.{8})/g, " ")); | |
} | |
var startBit = 8; | |
var bitsToGet = 8; | |
var alpha = 45; | |
var red = 187; | |
var green = 255; | |
var blue = 56; |