2013-01-01から1年間の記事一覧

Gitではまる

osx installer でapt-getが使えなかった。そこで色々なinstallerを使用してapt-getのインストールを試してみる。 osx Mavericks bash環境 ・apt-get notfound ・yum notfound ・port install apt-get notfoundapt-getをinstallしたい理由としてgitでbootstra…

Title

Visual Lisp Dictionary

Comment block button ctrl+E+C Extentions load command (vl-load-com) Check by expression (dictserch(namedobject)"VARS-NUMERA") Data is adding (vlax-ldata-put) Data is retrieve (vl-ax-ldata-get)

Blocks

iterator

puts "express gratitude tree times" 3.times{puts "thank you!"} #Express gratitude three times data=1,2,3 puts "print each element x of data=1,2,3" data.each{|x| puts x} #print each element x of data puts "compute squares of array elements[…

loop expression

puts "how_many_message" def how_many_messages(n) "You have "+n.to_s+(n==1 ? "message." : "messages.") end puts "while loop\n" x=10 while x >=0 do puts x x=x-1 endputs "until loop\n" x=0 until x>10 do puts x x=x+1 endputs "while modifier" x…

Control Structures

x=ARGV[0].to_f #Convert first argument to a number y=ARGV[1].to_f #convert second argument to a number sum=x+y #Add the arguments puts sum #Print the sum#if x is less than 10, increment it #same simple conditional x=1 while x if x x+=1 put…

x,y=1 #x=[]; y=1

x,y,*z=1,*[2,3,4] #x=1;y=2;z=[3,4];

x,y=1,2 #x=[1]; y=2

x,y=1,2,3 #x=[1,2]; y=3

x,y=1 #x=[]; y=1

x,y=1,2 #x=[1]; y=2

x,y=1,2,3 #x=[1,2]; y=3

x,y=1 #x=[]; y=1

x,y=1,2 #x=[1]; y=2

x,y=1,2,3 #x=[1,2]; y=3

x,y=1 #x=[]; y=1

x,y,*z=1,*[2,3,4] #x=1;y=2;z=[3,4];#operator puts (0b1011 puts (0b10110 >> 2).to_s(2) #101 puts 11 puts 22>>2 #5message="hello" messages=[] message messages

x,y=1,2 #x=[1]; y=2

x,y=1,2,3 #x=[1,2]; y=3

x,y=1 #x=[]; y=1

x,y,*z=1,*[2,3,4] #x=1;y=2;z=[3,4];#operator puts (0b1011 puts (0b10110 >> 2).to_s(2) #101 puts 11 puts 22>>2 #5message="hello" messages=[] message messages

x,y=1,2 #x=[1]; y=2

x,y=1,2,3 #x=[1,2]; y=3

x,y=1 #x=[]; y=1

x,y,*z=1,*[2,3,4] #x=1;y=2;z=[3,4];#operator puts (0b1011 puts (0b10110 >> 2).to_s(2) #101 puts 11 puts 22>>2 #5

x,y=1,2 #x=[1]; y=2

x,y=1,2,3 #x=[1,2]; y=3

x,y=1 #x=[]; y=1

x,y,*z=1,*[2,3,4] #x=1;y=2;z=[3,4];puts (0b1011 puts (0b10110 >> 2).to_s(2) #101 puts 11 puts 22>>2 #5

x,y=1,2 #x=[1]; y=2

x,y=1,2,3 #x=[1,2]; y=3

x,y=1 #x=[]; y=1

x,y,*z=1,*[2,3,4] #x=1;y=2;z=[3,4];#operator puts (0b1011 puts (0b10110 >> 2).to_s(2) #101 puts 11 puts 22>>2 #5message="hello" messages=[] message messages

x,y=1,2 #x=[1]; y=2