tisdag 15 december 2009
<=> The spaceship operator
The comparison operator in Ruby <=> (also called the spaceship operator) returns -1, 0, or +1 depending on whether the first value is less, equal or greater than the second value.
tisdag 8 december 2009
DebugView
DebugView is an application that lets you monitor debug output on your local system, or any computer on the network that you can reach via TCP/IP.
http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx
http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx
fredag 27 november 2009
onsdag 25 november 2009
Ruby 1.8 Encoding
def utf8tolatin2(s)
begin
#conv = Iconv.new("ISO-8859-2", "UTF-8")
conv = Iconv.new("CP1250", "UTF-8") #Using Windows latin2 instead of iso
out = conv.iconv(s)
conv.close
rescue
#conv = Iconv.new("ISO-8859-2", "ISO-8859-2")
conv = Iconv.new("CP1250", "CP1250") #Using Windows latin2 instead of iso
out = conv.iconv(s)
conv.close
end
return out
end
begin
#conv = Iconv.new("ISO-8859-2", "UTF-8")
conv = Iconv.new("CP1250", "UTF-8") #Using Windows latin2 instead of iso
out = conv.iconv(s)
conv.close
rescue
#conv = Iconv.new("ISO-8859-2", "ISO-8859-2")
conv = Iconv.new("CP1250", "CP1250") #Using Windows latin2 instead of iso
out = conv.iconv(s)
conv.close
end
return out
end
onsdag 18 november 2009
tisdag 17 november 2009
Stack Overflow
Interesting topic:
http://stackoverflow.com/questions/1722373/how-to-be-a-quality-programmer-in-a-programming-team
http://stackoverflow.com/questions/1722373/how-to-be-a-quality-programmer-in-a-programming-team
torsdag 12 november 2009
tisdag 10 november 2009
Google Maps
To display a location on the map, just enter the coordinates with a space in between.
52.255642 21.172998
http://maps.google.se/
52.255642 21.172998
http://maps.google.se/
torsdag 5 november 2009
Ragel State Machine Compiler
http://www.complang.org/ragel/
Ragel can be used for generating state charts and source code in Ruby, C, C++, Objective-C, D and Java.
Ragel can be used for generating state charts and source code in Ruby, C, C++, Objective-C, D and Java.
fredag 25 september 2009
Search for files in subdirs
How to search for all Nant build files in sub directories:
>dir /s /b *.build
>dir /s /b *.build
torsdag 24 september 2009
VisualWx - IDE for WxWindows
http://visualwx.altervista.org/
Can be used for generating code in several languages. Among them Ruby.
Can be used for generating code in several languages. Among them Ruby.
måndag 21 september 2009
onsdag 16 september 2009
Emacs commands
Search on current word, accumulates search text current word under cursor:
C-s C-w C-w
Cut current word:
M-d
C-s C-w C-w
Cut current word:
M-d
måndag 14 september 2009
CTAGS för Emacs
A tool for creating TAGS files used by Emacs to quickly orientate in source code: http://ctags.sourceforge.net/
Change name of binary from ctags.exe to etags.exe. Now it will generate proper tags for Ruby. Execute by: "etags.exe *rb".
Commands in Emacs:
M-. [TAG]
Find the first definition of TAG. The default tag is the identifier under the cursor.
M-*
Pop back to where you previously invoked "M-.".
C-u M-.
Find the next definition for the last tag.
Change name of binary from ctags.exe to etags.exe. Now it will generate proper tags for Ruby. Execute by: "etags.exe *rb".
Commands in Emacs:
M-. [TAG]
Find the first definition of TAG. The default tag is the identifier under the cursor.
M-*
Pop back to where you previously invoked "M-.".
C-u M-.
Find the next definition for the last tag.
Prenumerera på:
Inlägg (Atom)