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
if x | |
... | |
elsif y | |
... | |
else | |
puts "You screwed up." | |
end |
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
pdlua.c:244:16: warning: unused parameter ‘L’ [-Wunused-parameter] | |
lua_State *L, /**< Lua interpreter state. */ | |
^ | |
pdlua.c: In function ‘pdlua_popatomtable’: | |
pdlua.c:1059:9: warning: implicit declaration of function ‘lua_objlen’ [-Wimplicit-function-declaration] | |
*count = lua_objlen(L, -1); | |
^ | |
pdlua.c: In function ‘pdlua_dofile’: | |
pdlua.c:1558:17: error: too few arguments to function ‘lua_load’ | |
if (lua_load(L, pdlua_reader, &reader, filename)) |
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
make -C /home/biorails/Downloads/pd-extended/externals/loaders/pdlua/src PD_PATH=/home/biorails/Downloads/pd-extended/pd CFLAGS="-DPD -DHAVE_G_CANVAS_H -DZEXY_LIBRARY -I/home/biorails/Downloads/pd-extended/pd/src -Wall -W -ggdb -I/home/biorails/Downloads/pd-extended/externals/Gem -I/home/biorails/Downloads/pd-extended/externals/pdp/include -DUNIX -Dunix -DDL_OPEN -fPIC" | |
make[3]: Entering directory `/home/biorails/Downloads/pd-extended/externals/loaders/pdlua/src' | |
compiling pdlua version 0.6 | |
cflags are -DPD -DHAVE_G_CANVAS_H -DZEXY_LIBRARY -I/home/biorails/Downloads/pd-extended/pd/src -Wall -W -ggdb -I/home/biorails/Downloads/pd-extended/externals/Gem -I/home/biorails/Downloads/pd-extended/externals/pdp/include -DUNIX -Dunix -DDL_OPEN -fPIC | |
optcflags are -O3 -funroll-loops -march=k8 -msse -msse2 -msse3 -mfpmath=sse -ftree-vectorize -ftree-vectorizer-verbose=1 | |
luacflags are -DVERSION='0.6' -I/usr/include/lua | |
ldflags are -Wl,--export-dynamic -shared -fPIC | |
libs are -llua -lc | |
cc -DPD -DHAVE_G_CANVAS_H -DZEXY_ |
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
i = 0 | |
r = 0.0 | |
g = 255.0 | |
101.times do | |
puts <<-TEXT | |
.heat-map-#{i} { |
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
ajfaraday@scaled-up:/opt/scaled_up$ pd-extended -open pd/test-tones.pd -alsa -listdev -nogui | |
audio input devices: | |
1. HDA NVidia (hardware) | |
2. HDA NVidia (plug-in) | |
audio output devices: | |
1. HDA NVidia (hardware) | |
2. HDA NVidia (plug-in) | |
API number 1 | |
no midi input devices found |
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
order_table = Order.arel_table | |
arel = Order.where(order_table[:id].not_in([])) | |
sql = arel.to_sql | |
puts sql | |
#=> SELECT "ORDERS".* FROM "ORDERS" WHERE ("ORDERS"."ID" NOT IN (NULL)) |
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
def test_method | |
@var = 'a' | |
else | |
@var = 'b' | |
end | |
test_method | |
@var #=> 'b' |
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
irb(main):024:0> Benchmark.measure{1_000_000.times{'hello'}} | |
=> 0.210000 0.000000 0.210000 ( 0.202565) | |
irb(main):025:0> Benchmark.measure{1_000_000.times{:hello}} | |
=> 0.050000 0.000000 0.050000 ( 0.046498) | |
irb(main):026:0> Benchmark.measure{10_000_000.times{'hello'}} | |
=> 1.500000 0.000000 1.500000 ( 1.499443) | |
irb(main):027:0> Benchmark.measure{10_000_000.times{:hello}} |
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
irb(main):024:0> Benchmark.measure{1_000_000.times{'hello'}} | |
=> 0.210000 0.000000 0.210000 ( 0.202565) | |
irb(main):025:0> Benchmark.measure{1_000_000.times{:hello}} | |
=> 0.050000 0.000000 0.050000 ( 0.046498) | |
irb(main):026:0> Benchmark.measure{10_000_000.times{'hello'}} | |
=> 1.500000 0.000000 1.500000 ( 1.499443) | |
irb(main):027:0> Benchmark.measure{10_000_000.times{:hello}} |
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
# gsub! doesn't return anything when no changes are made | |
irb(main):006:0> 'abc'.gsub('c','d') | |
=> "abd" | |
irb(main):007:0> 'abc'.gsub!('c','d') | |
=> "abd" | |
irb(main):008:0> 'abc'.gsub!('d','c') | |
=> nil | |
# It's usual usage pattern (working on an existing object) still works |
OlderNewer