Fri 13 Nov 2009
Use fo:region-body column-count=2, or column-count=whatever you want.
Fri 13 Nov 2009
Use fo:region-body column-count=2, or column-count=whatever you want.
Sun 25 Oct 2009
I had an intuition today when looking at a small doodle I had drawn - the doodle was of a cartoon bad guy face - the kind of villain’s face that might have starred in a Christmas cartoon I may have watched growing up - like the bad guy in Frosty the snowman.
Anyway - wanted to get this intuition down on e-paper so I wouldn’t forget -
The idea I had was that humans may have an in built set of structures we impose on the world rather than vice-versa. Not exactly ground shaking - but in the context of a culture where corporations are our current villains- and how they manipulate people and steal their dreams and use up their lives and spit them back out at the end - how this may not in fact be the needed, true or chosen role of corporations, but might instead be the inevitable characterization humans paint across their broadside, the vessel of an older pre-built archetype rather than fully the soul sucking current and recently devised evil we all feel them to be.
Just a thought.
Sun 25 Oct 2009
After a long day, I’ve settled down at 11 pm to do some work on ‘the company’ - and I put on my I-pod for inspiration, and amazingly Harvester Of Sorrow - the Metallica song - comes on - and its just perfect. It perfectly describes what some of the work on the company really is - its the fruits of sorrow - of extra work, of converting not wanting to do something into doing it anyway. Of course there are many times when working on the company is fun, its not always sunshine and rainbows - and being able to convert the negative energy into positive effort is a big help. Thanks Metallica.
Sat 18 Jul 2009
This is probably a duh for most people but it took me over an hour to realize it.
I was trying to secure our upload site to run in https, and just could not get it to work. It runs with merb and apache2, so I was googling “merb cannot connect SSL” in vain. I could see the SSL starting in the apache logs, but I couldn’t see the https requests hitting the apache access logs.
So thankfully Matt Darby posted the solution. Thanks Matt.
So you need to do:
ec2-authorize default -p 443
Just in case someone else runs into this.
Mon 22 Jun 2009
When you upload a file in ruby, from IE, you get the full path when you do temp_file.original_filename or filename. You are supposed to be able to use File.basename(filename) from ruby to strip that out - but it doesn’t really work b/c if you are running in linux and someone from windows uploads a file in I.e. (a highly likely scenario) - the path delimiters for linux don’t jive with the path delimiters for windows, and so - it doesn’t work.
I ended up using Rick Olson’s attachement_fu code instead.
The relevant bit here:
def sanitize_filename(filename)
returning filename.strip do |name|
# NOTE: File.basename doesn't work right with Windows paths on Unix
# get only the filename, not the whole path
name.gsub! /^.*(\\|\/)/, ''
# Finally, replace all non alphanumeric, underscore or periods with underscore
name.gsub! /[^\w\.\-]/, '_'
end
end
Sat 23 May 2009
Upgraded Rails recently and my sessions stopped working. I had the old Stefan Kaes roll your own mysql session store but it wasn’t playing nice. So - I decided to try and use memcached sessions instead - but I got this odd error:
ArgumentError (key too long “rack:session:900980980980sd98f0saddklqjhsdkjh123e09u2f90u1o2dhqwj,dhqkwhd9182ye102ue1pojdlkasjd0291u8409120r8h120ie120e102dh1029eu1900980980980sd98f0saddklqjhsdkjh123e09u2f90u1o2dhqwj,dhqkwhd9182ye102ue1pojdlkasjd0291u8409120r8h120ie120e102dh1029eu1900980980980sd98f0saddklqjhsdkjh123e09u2f90u1o2dhqwj,dhqkwhd9182ye102ue1pojdlkasjd0291u8409120r8h120ie120e102dh1029eu1900980980980sd98f0saddklqjhsdkjh123e09u2f90u1o2dhqwj,dhqkwhd9182ye102ue1pojdlkasjd0291u8409120r8h120ie120e102dh1029eu1900980980980sd98f0saddklqjhsdkjh123e09u2f90u1o2dhqwj,dhqkwhd9182ye102ue1pojdlkasjd0291u8409120r8h120ie120e102dh1029eu1900980980980sd98f0saddklqjhsdkjh123e09u2f90u1o2dhqwj,dhqkwhd9182ye102ue1pojdlkasjd0291u8409120r8h120ie120e102dh1029eu1900980980980sd98f0saddklqjhsdkjh123e09u2f90u1o2dhqwj,dhqkwhd9182ye102ue1pojdlkasjd0291u8409120r8h120ie120e102dh1029eu1900980980980sd98f0saddklqjhsdkjh123e09u2f90u1o2dhqwj,dhqkwhd9182ye102ue1pojdlkasjd0291u8409120r8h120ie120e102dh1029eu1900980980980sd98f0saddklqjhsdkjh123e09u2f90u1o2dhqwj,dhqkwhd9182ye102ue1pojdlkasjd0291u8409120r8h120ie120e102dh1029eu1900980980980sd98f0saddklqjhsdkjh123e09u2f90u1o2dhqwj,dhqkwhd9182ye102ue1pojdlkasjd0291u8409120r8h120ie120e102dh1029eu1900980980980sd98f0saddklqjhsdkjh123e09u2f90u1o2dhqwj,dhqkwhd9182ye102ue1pojdlkasjd0291u8409120r8h120ie120e102dh1029eu1900980980980sd98f0saddklqjhsdkjh123e09u2f90u1o2dhqwj,dhqkwhd9182ye102ue1pojdlkasjd0291u8409120r8h120ie120e102dh1029eu1900980980980sd98f0saddklqjhsdkjh123e09u2f90u1o2dhqwj,dhqkwhd9182ye102ue1pojdlkasjd0291u8409120r8h120ie120e102dh1029eu1900980980980sd98f0saddklqjhsdkjh123e09u2f90u1o2dhqwj,dhqkwhd9182ye102ue1pojdlkasjd0291u8409120r8h120ie120e102dh1029eu1900980980980sd98f0saddklqjhsdkjh123e09u2f90u1o2dhqwj,dhqkwhd9182ye102ue1pojdlkasjd0291u8409120r8h120ie120e102dh1029eu1900980980980sd98f0saddklqjhsdkjh123e09u2f90u1o2dhqwj,dhqkwhd9182ye102ue1pojdlkasjd0291u8409120r8h120ie120e102dh1029eu1900980980980sd98f0saddklqjhsdkjh123e09u2f90u1o2dhqwj,dhqkwhd9182ye102ue1pojdlkasjd0291u8409120r8h120ie120e102dh1029eu1900980980980sd98f0saddklqjhsdkjh123e09u2f90u1o2dhqwj,dhqkwhd9182ye102ue1pojdlkasjd0291u8409120r8h120ie120e102dh1029eu1900980980980sd98f0saddklqjhsdkjh123e09u2f90u1o2dhqwj,dhqkwhd9182ye102ue1pojdlkasjd0291u8409120r8h120ie120e102dh1029eu1900980980980sd98f0saddklqjhsdkjh123e09u2f90u1o2dhqwj,dhqkwhd9182ye102ue1pojdlkasjd0291u8409120r8h120ie120e102dh1029eu1900980980980sd98f0saddklqjhsdkjh123e09u2f90u1o2dhqwj,dhqkwhd9182ye102ue1pojdlkasjd0291u8409120r8h120ie120e102dh1029eu1900980980980sd98f0saddklqjhsdkjh123e09u2f90u1o2dhqwj,dhqkwhd9182ye102ue1pojdlkasjd0291u8409120r8h120ie120e102dh1029eu1900980980980sd98f0saddklqjhsdkjh123e09u2f90u1o2dhqwj,dhqkwhd9182ye102ue1pojdlkasjd0291u8409120r8h120ie120e102dh1029eu1900980980980sd98f0saddklqjhsdkjh123e09u2f90u1o2dhqwj,dhqkwhd9182ye102ue1pojdlkasjd0291u8409120r8h120ie120e102dh1029eu1900980980980sd98f0saddklqjhsdkjh123e09u2f90u1o2dhqwj,dhqkwhd9182ye102ue1pojdlkasjd0291u8409120r8h120ie120e102dh1029eu1900980980980sd98f0saddklqjhsdkjh123e09u2f90u1o2dhqwj,dhqkwhd9182ye102ue1pojdlkasjd0291u8409120r8h120ie120e102dh1029eu1900980980980sd98f0saddklqjhsdkjh123e09u2f90u1o2dhqwj,dhqkwhd9182ye102ue1pojdlkasjd0291u8409120r8h120ie120e102dh1029eu1900980980980sd98f0saddklqjhsdkjh123e09u2f90u1o2dhqwj,dhqkwhd9182ye102ue1pojdlkasjd0291u8409120r8h120ie120e102dh1029eu1900980980980sd98f0saddklqjhsdkjh123e09u2f90u1o2dhqwj,dhqkwhd9182ye102ue1pojdlkasjd0291u8409120r8h120ie120e102dh1029eu1900980980980sd98f0saddklqjhsdkjh123e09u2f90u1o2dhqwj,dhqkwhd9182ye102ue1pojdlkasjd0291u8409120r8h120ie120e102dh1029eu1900980980980sd98f0saddklqjhsdkjh123e09u2f90u1o2dhqwj,dhqkwhd9182ye102ue1pojdlkasjd0291u8409120r8h120ie120e102dh1029eu1900980980980sd98f0saddklqjhsdkjh123e09u2f90u1o2dhqwj,dhqkwhd9182ye102ue1pojdlkasjd0291u8409120r8h120ie120e102dh1029eu1sdfwerffqwd23t34t23qwe”):
So I tried to switch back to ActiveRecord sessions - the old kind - but sessions weren’t working. Everytime I set a value and then redirected the values I set weren’t there. I found someone noting similar behavior here and reading the thread saw that there was supposed to be an initializers folder. I didn’t have one - my app is old and I’ve been upgrading over time - this is a jump from 2.0X to 2.3.2.
So - I generated a new rails app - copied over the config/initializers folder, and it started to work. Looking in this file - session_store.rb, there is a line that initializes the session key. Aha! Without that key in there rails tried to use some other value - not sure where it got the value above from (I changed it from the one that is local, but its the same size) - but that one is too big.
Oh well - 2 hours I’ll never get back - wait, I guess I am giving back 2 hours of productivity boosts that Rails gave me for free. I think I’m still ahead.
Still not sure why ActiveRecord sessions isn’t working - but it probably has something to do with how intrusive Kaes’s solution was - maybe I need to just pull that one out by the roots and see if it works.
Sat 2 May 2009
Make sure you right click the .exe and on the configuration tab select run as administrator. Otherwise I kept getting ‘failed to start service’
Tue 21 Apr 2009
In the unlikely event that someone else has this problem - just putting it out there.
I’ve been using Java Service Wrapper - its great - to wrap a java loop that is polling SQS. It was working on my local Linux distro - Ubuntu (8.10)- in dev. But it was time to get it out to the Prod server - which is also Ubuntu - though the version is different - its the one that EC2 on Rails is built on (8.04 I believe)- I kept getting Segmentation Faults.
After beating my head against the wall for a couple of hours I decided to use another version. So I uploaded 3.2.3 instead of 3.3.3 and it worked.
Anyway, go figure, it seems to be working now.
Wed 15 Apr 2009
Picking up Flow again - Mihaly Csikszentmihalyi’s book about optimal experience - and reading through it tonight, I happened on this passage which made me think of the postmodern condition
Anomie - literally, “lack of rules” - is the name the French sociologist Emile Durkheim gave to a condition in society in which the norms of behavior had become muddled. When it is no longer clear what is permitted and what is not, when it is uncertain what public opinion values, behavior becomes erratic and meaningless. People who depend on the rules of society to give order to their consciousness become anxious.
Thinking about this in the context of games. Games are not fun without rules.
Tue 10 Mar 2009
What is the airspeed velocity of an unladen swallow?