- http://www.libspark.org/wiki/scratchbrain/AverageColor | AverageColor | A util-class to calculate the average between 2 colors (Hex, RGB or HSB format).
- http://www.libspark.org/wiki/nutsu/Frocessing/en | Frocessing | AS3 drawing library similar to Processing.
- http://www.libspark.org/wiki/gunyarapaint | gunyarapaint | Painting component for picture blog.
- http://www.libspark.org/wiki/trick7/TeraFire | TeraFire | Fire effect, useful to render animated candles or stoves.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://code.openark.org/blog/mysql/merging-tables-with-insert-on-duplicate-key-update | |
Had a case recently where I had to merge data from two identically structured tables containing nearly identical data. | |
"Nearly identical" meaning most table data is identical in both; sometimes a row is missing from one of the tables; sometimes same row (according to PK) appears in both, but some columns are NULL is one tables (while others can be NULL in the second). | |
Otherwise no contradicting data: it was not possible for some data to be "3" in one table and "4" in the other. | |
How do you create a merge of the tables, such that all missing rows are completed, and NULLs replaced by actual values when possible? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%%%------------------------------------------------------------------- | |
%%% @author Fernando Benavides <[email protected]> | |
%%% @copyright (C) 2011 Inaka Networks S.R.L. | |
%%% @doc It listens and just repeats... | |
%%% @end | |
%%%------------------------------------------------------------------- | |
-module(gen_event_repeater). | |
-author('Fernando Benavides <[email protected]>'). | |
-behaviour(gen_event). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%%% @author Sergey Prokhorov <[email protected]> | |
%%% @copyright (C) 2013, Sergey Prokhorov | |
%%% @doc | |
%%% Walker alias method - efficient random selection with defined probabilities. | |
%%% <http://en.wikipedia.org/wiki/Alias_method> | |
%%% | |
%%% > ProbabilityValueList = [{10, a}, {20, b}, {30, c}, {40, d}], | |
%%% > WalkerVectors = walker_alias:build(ProbabilityValueList), | |
%%% > RandomValue = walker_alias:choice(WalkerVectors). | |
%%% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (var j:int = 0; j < lengthItem; j++) { | |
sumItem += items[i].qty; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Screen Options ## | |
shell bash # Tell screen your default shell | |
startup_message off # Turn off start message | |
defscrollback = 5000 | |
shelltitle '$ |bash' # Dynamic window titled for running program | |
msgwait 1 # Set messages timeout to one second | |
nethack on # Turn on nethack error messages | |
backtick 0 0 0 whoami # Set "%0`" to equal the output of "whoami" | |
escape ^Oo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# `host` is where aria2c is running on | |
host='localhost' | |
dir="/home/hassan/Downloads" | |
# cleanup_policy | |
# avalible options are | |
# "clean_got": clean downloads with mark as got | |
# "space_usage: clean got downloads on space usage upper than cleanup_percent | |
cleanup-policy="clean_got" | |
cleanup-percent="90%" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"20091020 | |
let mapleader=";" | |
" " " 映射 | |
" " 页面操作 | |
" 一次移动5行 | |
noremap j 5j | |
noremap k 5k | |
" 上下滚动 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 删除字符串中的空格和制表符 | |
function delSpaceTxt(txt) | |
local chr = txt | |
local chr_new = "" | |
local len_chr = chr:len() | |
local cur_char | |
for i = 1 , len_chr do | |
cur_char = chr:sub(i,i) | |
if cur_char ~= " " and cur_char ~= "\t" then | |
chr_new = chr_new..cur_char |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
leon@ws-svr:~/lab/nim4c$ gcc -o m -Inimcache -I/home/leon/opt/nim/lib nimcache/*.c mth.c | |
nimcache/system.c: In function ‘allocinv_34409’: | |
nimcache/system.c:7867:10: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘NI’ [-Wformat=] | |
printf("%ld %p\012", (*it).Zerofield, it); | |
^ | |
nimcache/system.c: In function ‘writecell_49018’: | |
nimcache/system.c:8330:2: warning: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘NI’ [-Wformat=] | |
fprintf(stdout, "[GC] %s: %p %d rc=%ld; color=%ld\012", msg, c, kind, (NI)((NU64)((*c).Refcount) >> (NU64)(3)), (NI)((*c).Refcount & 3)); | |
^ | |
nimcache/system.c:8330:2: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 6 has type ‘long long int’ [-Wformat=] |
OlderNewer