Archive for September, 2011

30
Sep
11

v-diet day 3


Compared to yesterday, today was very easy. I barely felt any hunger, but I have to admit, the craving for any food is big. The hunger is very little, but the difference in taste. No headaches, no pain anywhere.
Weight update in the morning.
Weight update:76.5

30
Sep
11

git svn fetch on windows


For some reason, my git svn fetch only brings a few revisions before stopping. So, I wrote a script to continue fetching until the string for a certain revision hasn’t been seen:


limit = "rXXXX" # pull until you see this string somewhere
stop = false
pull_number = 0
process = nil

trap("SIGINT") do 
  puts "Interrupt requested"
  stop = true
  Process.kill("KILL",process.pid) if process
end


loop do
	pull_number += 1
	break if stop
	process = IO.popen("git svn fetch")
	puts "pull number #{pull_number}"
	
	process.each_line do |line|
		puts line
		if line=~/#{limit}/i
			stop = true
		end
	end	
end

30
Sep
11

validate an xml using xmllint and a xsd


Here’s how:


xmllint.exe --schema some_schema.xsd some.xml

29
Sep
11

v-diet day 2


This day was brutal. I ate 4 shakes, and I had a headache all day long. When I got back home I was so tired, I had to sleep for about 2 hours. After that, it was better. I will post a weight update in the morning. I think today was a decisive point in the diet. I think I did a good job.
Weight update:77.3 kg

29
Sep
11

v-diet day 1


I started at 78.3 kg. First day wasn’t fully “pure”, as I had eaten a pretzel thingy in the morning ( the supplement store only opened at 14 ). All in all, the day wasn’t very hard, probably because I still had a lot of carbs in my system.

25
Sep
11

rake aborted! missing :action


I kept receiving:


rake aborted!
missing :action

After I added a member route to:


member do
  get "/custom_member_action"
end

The solution was removing the / from the custom_member_action:


member do
  get "custom_member_action"
end

23
Sep
11

sqlite3 db dump


Let’s say your db is in the file named my.db. Here’s how you get a dump:


echo .dump | sqlite3 my.db > dump.sql

To recreate it, do:


cat dump.sql | sqlite3 my.db




Blog Stats

  • 216,787 hits