Search   Feed   Browse   Add
Feed items 1 - 6 of 6 for June 2008

loopkid

sad songs make me happy

read file with one line of code - June 30, 2008

There are probably at least a have a dozen ways to print the contents of a file in Ruby, here I will present four ways of doing it. The first method is rather verbose. Assign a file object and iterate on the file object with the each_line method and then close the file. f = open('file.txt') f.each_line do line puts line end f.close The second method still assigns a file object, but then uses the more compact readlines instance method and closes the file. f = open('file.txt') puts...
http://loopkid.net/articles/2008/07/01/read-file-with-one-line-of-code

the awful bar - June 29, 2008

So schnell ich die neue Version des Firefox auf der Festplatte hatte, so schnell habe ich sie auch wieder gelscht. Das KO-Kriterium: Die &8220;smart location bar&8221; auch genannt &8220;awesome bar&8221;. Ein absolutes Usability-Desaster und gutes Beispiel fr gut gemeint, aber nicht gut gemacht. Nehmen wir an der Browser-Cache ist leer und ich gebe eine Adresse in die Adressezeile ein. Danach gebe ich dann jeweils den Anfang von der Subdomain, der Domain und des Seitentitels ein und vergleiche.
http://loopkid.net/articles/2008/06/30/the-awful-bar

the beauty of ruby 1.9 - June 28, 2008

Let&8217;s say we have a string and three arrays string = "672" java = ruby18 = ruby19 = Now you want to convert the string to an array of integers. If you were writing Ruby in javastyle you would probably write something like i=0 digits = string.split() while i < digits.size do java << digitsi.to_i i+=1 end but since we&8217;re we&8217;re doing Ruby in rubystyle it looks more like string.split().each digit ruby18 << digit.to_i which looks much nicer, but still..
http://loopkid.net/articles/2008/06/28/the-beauty-of-ruby-1-9

beautiful network monitoring - June 27, 2008

Monitoring networks with tcpdump works fine, but even in quiet mode tcpdump outputs too much information if you&8217;re interested in application layer protocols like HTTP or IMAP. A nice alternative on the command line is ngrep which has a much more readable output. ngrep filters all tcp packets with an empty data part and strips the header of non-empty tcp packets. The only beauty flaw in my eyes is the dot ngrep inserts for every tab and for every carriage return. In my opinion it should...
http://loopkid.net/articles/2008/06/27/beautiful-network-monitoring

force unmount on mac os x - June 26, 2008

When using Mac OS X you might have encountered this message. The disk "foobar" is in use and could not be ejected. Try quitting appplications and try again. This message may occur even if you have all closed all programs. The guilty party for this behavious may be Leopard&8217;s FSEvents, which sometimes has a lock on a volume. To force the unmount of a volume just open a Terminal and use umount. sudo umount -f VolumesFooBar
http://loopkid.net/articles/2008/06/27/force-unmount-on-mac-os-x

tcpdump: packets dropped by kernel - June 25, 2008

tcpdump is a really nice tool, but it may render useless with it&8217;s default settings. $ sudo tcpdump -i en1 In my case led to 80 packets captured 7705 packets received by filter 6794 packets dropped by kernel To solve the issue I had to turn off address translation. $ sudo tcpdump -i en1 -n Now the results look as expected. 6941 packets captured 7011 packets received by filter 0 packets dropped by kernel
http://loopkid.net/articles/2008/06/25/tcpdump-packets-dropped-by-kernel
Available Archives
- June (6 items)
- July (4 items)
Sponsored Links
© 2008 FeedCapsule.com  |  Contact