<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
<channel>
  <title>Codeboxer by Krister Axel</title>
  <link>http://codeboxer.com/</link>
  <description>The latest blog posts from Codeboxer.com.</description>
  <language>en-us</language>
  <pubDate>Thu, 24 May 2012 17:46:11 +0000</pubDate>
  <lastBuildDate>Thu, 24 May 2012 17:46:11 +0000</lastBuildDate>
  <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Codeboxer" /><feedburner:info uri="codeboxer" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
    <title>a proof of concept maze game for ipad made with codea</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/9YrV8rSk7nA/</link>
    <description>&lt;br&gt;&lt;br&gt;
I've been playing with &lt;strong&gt;Codea&lt;/strong&gt;, a Lua-based iPad app that allows you to make your own iPad games. My game currently takes about 8 seconds to win, which is not much, but really I'm just messing around with things until I get the hang of it. I like Codea because Lua is a really simple scripting language with decidedly few curly brackets - thumbs up for that - and it ships with a bunch of sprites you can use. It's also pretty easy to get the Lua files off your iPad (using iExplore) for backup, and you can add your own png sprites by just putting them in a directory with a pinfo file and uploading them to your iPad. Sweet!

[video src="http://blog.kristeraxel.com/wp-content/uploads/2012/05/IMG_0027.mov"]&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/9YrV8rSk7nA" height="1" width="1"/&gt;</description>
    <pubDate>Thu, 10 May 2012 18:48:48 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2012/05/a-proof-of-concept-maze-game-for-ipad-made-with-codea/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2012/05/a-proof-of-concept-maze-game-for-ipad-made-with-codea/</feedburner:origLink></item>
  <item>
    <title>ruby find dup hash on key in array</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/OeJfjKpA2is/</link>
    <description>&lt;br&gt;&lt;br&gt;
&lt;em&gt;Ruby&lt;/em&gt; I love you.

&lt;script src="https://gist.github.com/2363441.js?file=ruby_find_dup_hash_on_key_in_array.rb"&gt;&lt;/script&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/OeJfjKpA2is" height="1" width="1"/&gt;</description>
    <pubDate>Wed, 11 Apr 2012 23:26:54 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2012/04/ruby-find-dup-hash-on-key-in-array/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2012/04/ruby-find-dup-hash-on-key-in-array/</feedburner:origLink></item>
  <item>
    <title>impersonating a MySQL split function</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/_4PpApM_Evs/</link>
    <description>&lt;br&gt;&lt;br&gt;

There is no string split in MySQL. How sad. Here is how I used INSTR, SUBSTRING_INDEX and LEFT to pull month day and year out of the original date field which was in the YYYY-MM-DD format - which is my favorite because it orders chronologically.

linked here: &lt;a href="https://gist.github.com/1981662" title="mysql-split.sql"&gt;mysql-split.sql&lt;/a&gt;

&lt;script src="https://gist.github.com/1981662.js?file=mysql-split.sql"&gt;&lt;/script&gt; &lt;br&gt;&lt;br&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/_4PpApM_Evs" height="1" width="1"/&gt;</description>
    <pubDate>Mon, 05 Mar 2012 22:42:29 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2012/03/impersonating-a-mysql-split-function/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2012/03/impersonating-a-mysql-split-function/</feedburner:origLink></item>
  <item>
    <title>getting windows 7 to play nice with a mac airport express</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/cbdvzyS9QDQ/</link>
    <description>&lt;br&gt;&lt;br&gt;
Something about iPv4 vs. 6 and correct DHCP authentication, I had a lot of trouble getting my windows 7 box to connect - via ethernet - to the Airport Express that I have 'extending' my mac-based network. The error message I kept getting was: 



&lt;blockquote&gt;"Local Area Connection" doesn't have a valid IP configuration&lt;/blockquote&gt;



I finally got it working:



&lt;blockquote&gt;
1- unplug you LAN cable and wireless connection. Go to  "Ethernet Adapter local area connection 2" properties.&lt;br&gt;

2- select "Internet Protocol Version 4 (TCP/IPv4)"&lt;br&gt;

3- press Properties button&lt;br&gt;

4- select "Use the following IP address:" option and set this ips:&lt;br&gt;

 IP=&lt;strong&gt;192.168.1.105&lt;/strong&gt;&lt;br&gt;

 subnet mask=&lt;strong&gt;255.255.255.0&lt;/strong&gt;&lt;br&gt;

default gateway = your router ip address such as &lt;strong&gt;192.168.1.1&lt;/strong&gt;&lt;br&gt;

5- from second section select "Use the following DNS server addresses:"&lt;br&gt;

set "PreferAlternate DNS server:" your router default ip, for example &lt;strong&gt;192.168.1.1&lt;/strong&gt;&lt;br&gt;

6-press ok and try to connect through lan then wireless&lt;br&gt;
&lt;/blockquote&gt;

&lt;strong&gt;After those steps, I also had to click through for Windows to auto-fix the problem it found that DHCP was not enabled.&lt;/strong&gt;&lt;br&gt;
&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/cbdvzyS9QDQ" height="1" width="1"/&gt;</description>
    <pubDate>Sun, 12 Feb 2012 08:26:20 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2012/02/getting-windows-7-to-play-nice-with-a-mac-airport-express/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2012/02/getting-windows-7-to-play-nice-with-a-mac-airport-express/</feedburner:origLink></item>
  <item>
    <title>thumbs up for express js and sideways for quo vadis</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/3tZx7_UaoM0/</link>
    <description>&lt;br&gt;&lt;br&gt;&lt;p&gt;
I've just been checking out some stuff lately and have been dying to try out &lt;a href="http://axel.me/5m" target="_blank"&gt;express.js&lt;/a&gt;, which is built on the &lt;a href="http://nodejs.org/" target="_blank"&gt;node.js&lt;/a&gt; framework. It is easy to use, super fast, and very cool. I highly recommend it for a lightweight and snappy front-end.&lt;/p&gt;

&lt;p&gt;
Also, I am finally making the jump to Rails 3.2, and for that reason am porting my entire &lt;strong&gt;gmgpulse&lt;/strong&gt; app, complete with new auth layer and switching from prototype to jQuery. It's a lot of work but will pay many dividends. Essentially I am paying off some existing technical debt and moving the whole enterprise back into the black! I am trying out a very simple and effective auth gem called &lt;a href="http://axel.me/7l" target="_blank"&gt;'quo_vadis'&lt;/a&gt; but currently it has a problem with the 3.2 release so I am crossing my fingers that the guy who manages the gem will merge the pull request soon - it has already been fixed. I figure since I have about 30-60 days before it needs to work, I may be all right.
&lt;/p&gt;


&lt;p&gt;
UPDATE: The gem owner has merged the pull request, and quo vadis is back to 100% functional with Rails 3.2 (as of gem v1.1.2). I give it a full thumbs up now as well - simple, straightforward, easy set up, everything you want in a simple password auth system. There is no support for outside services - FB, or google, or open id, etc. - but sometimes you don't need that and it just creates unneeded complexity.
&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/3tZx7_UaoM0" height="1" width="1"/&gt;</description>
    <pubDate>Thu, 02 Feb 2012 21:11:19 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2012/02/thumbs-up-for-express-js-and-sideways-for-quo-vadis/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2012/02/thumbs-up-for-express-js-and-sideways-for-quo-vadis/</feedburner:origLink></item>
  <item>
    <title>strange delete syntax with join for mysql</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/rPJ5NYvAO-s/</link>
    <description>&lt;br/&gt;&lt;br/&gt;


With MySQL 5, there are two rules if you need to join to another table in order to delete records from somewhere.
&lt;ul&gt;
	&lt;li&gt;Rule 1: no aliases allowed. Refer only to tables as themselves - better hope the names aren't very long!&lt;/li&gt;
        &lt;li&gt;Rule 2: specify table name from which to delete &lt;em&gt;before&lt;/em&gt; the FROM clause. &lt;/li&gt;
&lt;/ul&gt;

Like so:

&lt;pre&gt;
  DELETE sales from sales
    JOIN retailers on sales.retailer_id = retailers.id
   WHERE retailers.merchant in ('Test Merchant', 
                                'Other merchants that should not be here')
&lt;/pre&gt;


&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/rPJ5NYvAO-s" height="1" width="1"/&gt;</description>
    <pubDate>Tue, 13 Dec 2011 22:14:33 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2011/12/strange-delete-syntax-with-join-for-mysql/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2011/12/strange-delete-syntax-with-join-for-mysql/</feedburner:origLink></item>
  <item>
    <title>Epigrams in programming</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/71GMQYZXmwc/</link>
    <description>&lt;br&gt;
An ode to Alan Perlis, &lt;a href="http://www.cs.yale.edu/quotes.html" target="_blank"&gt;copied from Yale&lt;/a&gt;:&lt;br&gt;&lt;br&gt;

1. One man's constant is another man's variable.
&lt;br&gt;
2. Functions delay binding; data structures induce binding. Moral: Structure data late in the programming process.
&lt;br&gt;
3. Syntactic sugar causes cancer of the semicolon.
&lt;br&gt;
4. Every program is a part of some other program and rarely fits.
&lt;br&gt;
5. If a program manipulates a large amount of data, it does so in a small number of ways.
&lt;br&gt;
6. Symmetry is a complexity-reducing concept (co-routines include subroutines); seek it everywhere.
&lt;br&gt;
7. It is easier to write an incorrect program than understand a correct one.
&lt;br&gt;
8. A programming language is low level when its programs require attention to the irrelevant.
&lt;br&gt;
9. It is better to have 100 functions operate on one data structure than 10 functions on 10 data structures.
&lt;br&gt;
10. Get into a rut early: Do the same process the same way. Accumulate idioms. Standardize. The only difference(!) between Shakespeare and you was the size of his idiom list - not the size of his vocabulary.
&lt;br&gt;
11. If you have a procedure with ten parameters, you probably missed some.
&lt;br&gt;
12. Recursion is the root of computation since it trades description for time.
&lt;br&gt;
13. If two people write exactly the same program, each should be put into microcode and then they certainly won't be the same.
&lt;br&gt;
14. In the long run every program becomes rococo - then rubble.
&lt;br&gt;
15. Everything should be built top-down, except the first time.
&lt;br&gt;
16. Every program has (at least) two purposes: the one for which it was written, and another for which it wasn't.
&lt;br&gt;
17. If a listener nods his head when you're explaining your program, wake him up.
&lt;br&gt;
18. A program without a loop and a structured variable isn't worth writing.
&lt;br&gt;
19. A language that doesn't affect the way you think about programming, is not worth knowing.
&lt;br&gt;
20. Wherever there is modularity there is the potential for misunderstanding: Hiding information implies a need to check communication.
&lt;br&gt;
21. Optimization hinders evolution.
&lt;br&gt;
22. A good system can't have a weak command language.
&lt;br&gt;
23. To understand a program you must become both the machine and the program.
&lt;br&gt;
24. Perhaps if we wrote programs from childhood on, as adults we'd be able to read them.
&lt;br&gt;
25. One can only display complex information in the mind. Like seeing, movement or flow or alteration of view is more important than the static picture, no matter how lovely.
&lt;br&gt;
26. There will always be things we wish to say in our programs that in all known languages can only be said poorly.
&lt;br&gt;
27. Once you understand how to write a program get someone else to write it.
&lt;br&gt;
28. Around computers it is difficult to find the correct unit of time to measure progress. Some cathedrals took a century to complete. Can you imagine the grandeur and scope of a program that would take as long?
&lt;br&gt;
29. For systems, the analogue of a face-lift is to add to the control graph an edge that creates a cycle, not just an additional node.
&lt;br&gt;
30. In programming, everything we do is a special case of something more general -- and often we know it too quickly.
&lt;br&gt;
31. Simplicity does not precede complexity, but follows it.
&lt;br&gt;
32. Programmers are not to be measured by their ingenuity and their logic but by the completeness of their case analysis.
&lt;br&gt;
33. The eleventh commandment was "Thou Shalt Compute" or "Thou Shalt Not Compute" - I forget which.
&lt;br&gt;
34. The string is a stark data structure and everywhere it is passed there is much duplication of process. It is a perfect vehicle for hiding information.
&lt;br&gt;
35. Everyone can be taught to sculpt: Michelangelo would have had to be taught not to. So it is with great programmers.
&lt;br&gt;
36. The use of a program to prove the 4-color theorem will not change mathematics - it merely demonstrates that the theorem, a challenge for a century, is probably not important to mathematics.
&lt;br&gt;
37. The most important computer is the one that rages in our skulls and ever seeks that satisfactory external emulator. The standarization of real computers would be a disaster - and so it probably won't happen.
&lt;br&gt;
38. Structured Programming supports the law of the excluded muddle.
&lt;br&gt;
39. Re graphics: A picture is worth 10K words - but only those to describe the picture. Hardly any sets of 10K words can be adequately described with pictures.
&lt;br&gt;
40. There are two ways to write error-free programs; only the third one works.
&lt;br&gt;
41. Some programming languages manage to absorb change, but withstand progress.
&lt;br&gt;
42. You can measure a programmer's perspective by noting his attitude on the continuing vitality of FORTRAN.
&lt;br&gt;
43. In software systems, it is often the early bird that makes the worm.
&lt;br&gt;
44.Sometimes I think the only universal in the computing field is the fetch-execute cycle.
&lt;br&gt;
45. The goal of computation is the emulation of our synthetic abilities, not the understanding of our analytic ones.
&lt;br&gt;
46. Like punning, programming is a play on words.
&lt;br&gt;
47. As Will Rogers would have said, "There is no such thing as a free variable."
&lt;br&gt;
48. The best book on programming for the layman is "Alice in Wonderland"; but that's because it's the best book on anything for the layman.
&lt;br&gt;
49. Giving up on assembly language was the apple in our Garden of Eden: Languages whose use squanders machine cycles are sinful. The LISP machine now permits LISP programmers to abandon bra and fig-leaf.
&lt;br&gt;
50. When we understand knowledge-based systems, it will be as before -- except our fingertips will have been singed.
&lt;br&gt;
51. Bringing computers into the home won't change either one, but may revitalize the corner saloon.
&lt;br&gt;
52. Systems have sub-systems and sub-systems have sub- systems and so on ad infinitum - which is why we're always starting over.
&lt;br&gt;
53. So many good ideas are never heard from again once they embark in a voyage on the semantic gulf.
&lt;br&gt;
54. Beware of the Turing tar-pit in which everything is possible but nothing of interest is easy.
&lt;br&gt;
55. A LISP programmer knows the value of everything, but the cost of nothing.
&lt;br&gt;
56. Software is under a constant tension. Being symbolic it is arbitrarily perfectible; but also it is arbitrarily changeable.
&lt;br&gt;
57. It is easier to change the specification to fit the program than vice versa.
&lt;br&gt;
58. Fools ignore complexity. Pragmatists suffer it. Some can avoid it. Geniuses remove it.
&lt;br&gt;
59. In English every word can be verbed. Would that it were so in our programming languages.
&lt;br&gt;
60. In seeking the unattainable, simplicity only gets in the way.
&lt;br&gt;
61. In programming, as in everything else, to be in error is to be reborn.
&lt;br&gt;
62. In computing, invariants are ephemeral.
&lt;br&gt;
63. When we write programs that "learn", it turns out that we do and they don't.
&lt;br&gt;
64. Often it is the means that justify the ends: Goals advance technique and technique survives even when goal structures crumble.
&lt;br&gt;
65. Make no mistake about it: Computers process numbers - not symbols. We measure our understanding (and control) by the extent to which we can arithmetize an activity.
&lt;br&gt;
66. Making something variable is easy. Controlling duration of constancy is the trick.
&lt;br&gt;
67. Think of all the psychic energy expended in seeking a fundamental distinction between "algorithm" and "program".
&lt;br&gt;
68. If we believe in data structures, we must believe in independent (hence simultaneous) processing. For why else would we collect items within a structure? Why do we tolerate languages that give us the one without the other?
&lt;br&gt;
69. In a 5 year period we get one superb programming language. Only we can't control when the 5 year period will be.
&lt;br&gt;
70. Over the centuries the Indians developed sign language for communicating phenomena of interest. Programmers from different tribes (FORTRAN, LISP, ALGOL, SNOBOL, etc.) could use one that doesn't require them to carry a blackboard on their ponies.
&lt;br&gt;
71. Documentation is like term insurance: It satisfies because almost no one who subscribes to it depends on its benefits.
&lt;br&gt;
72. An adequate bootstrap is a contradiction in terms.
&lt;br&gt;
73. It is not a language's weakness but its strengths that control the gradient of its change: Alas, a language never escapes its embryonic sac.
&lt;br&gt;
74. Is it possible that software is not like anything else, that it is meant to be discarded: that the whole point is to see it as a soap bubble?
&lt;br&gt;
75. Because of its vitality, the computing field is always in desperate need of new cliches: Banality soothes our nerves.
&lt;br&gt;
76. It is the user who should parameterize procedures, not their creators.
&lt;br&gt;
77. The cybernetic exchange between man, computer and algorithm is like a game of musical chairs: The frantic search for balance always leaves one of the three standing ill at ease.
&lt;br&gt;
78. If your computer speaks English, it was probably made in Japan.
&lt;br&gt;
79. A year spent in artificial intelligence is enough to make one believe in God.
&lt;br&gt;
80. Prolonged contact with the computer turns mathematicians into clerks and vice versa.
&lt;br&gt;
81. In computing, turning the obvious into the useful is a living definition of the word "frustration".
&lt;br&gt;
82. We are on the verge: Today our program proved Fermat's next-to-last theorem.
&lt;br&gt;
83. What is the difference between a Turing machine and the modern computer? It's the same as that between Hillary's ascent of Everest and the establishment of a Hilton hotel on its peak.
&lt;br&gt;
84. Motto for a research laboratory: What we work on today, others will first think of tomorrow.
&lt;br&gt;
85. Though the Chinese should adore APL, it's FORTRAN they put their money on.
&lt;br&gt;
86. We kid ourselves if we think that the ratio of procedure to data in an active data-base system can be made arbitrarily small or even kept small.
&lt;br&gt;
87. We have the mini and the micro computer. In what semantic niche would the pico computer fall?
&lt;br&gt;
88. It is not the computer's fault that Maxwell's equations are not adequate to design the electric motor.
&lt;br&gt;
89. One does not learn computing by using a hand calculator, but one can forget arithmetic.
&lt;br&gt;
90. Computation has made the tree flower.
&lt;br&gt;
91. The computer reminds one of Lon Chaney -- it is the machine of a thousand faces.
&lt;br&gt;
92. The computer is the ultimate polluter: its feces are indistinguish- able from the food it produces.
&lt;br&gt;
93. When someone says "I want a programming language in which I need only say what I wish done," give him a lollipop.
&lt;br&gt;
94. Interfaces keep things tidy, but don't accelerate growth: Functions do.
&lt;br&gt;
95. Don't have good ideas if you aren't willing to be responsible for them.
&lt;br&gt;
96. Computers don't introduce order anywhere as much as they expose opportunities.
&lt;br&gt;
97. When a professor insists computer science is X but not Y, have compassion for his graduate students.
&lt;br&gt;
98. In computing, the mean time to failure keeps getting shorter.
&lt;br&gt;
99. In man-machine symbiosis, it is man who must adjust: The machines can't.
&lt;br&gt;
100. We will never run out of things to program as long as there is a single program around.
&lt;br&gt;
101. Dealing with failure is easy: Work hard to improve. Success is also easy to handle: You've solved the wrong problem. Work hard to improve.
&lt;br&gt;
102. One can't proceed from the informal to the formal by formal means.
&lt;br&gt;
103. Purely applicative languages are poorly applicable.
&lt;br&gt;
104. The proof of a system's value is its existence.
&lt;br&gt;
105. You can't communicate complexity, only an awareness of it.
&lt;br&gt;
106. It's difficult to extract sense from strings, but they're the only communication coin we can count on.
&lt;br&gt;
107. The debate rages on: is PL/I Bachtrian or Dromedary?
&lt;br&gt;
108. Whenever two programmers meet to criticize their programs, both are silent.
&lt;br&gt;
109. Think of it! With VLSI we can pack 100 ENIACS in 1 sq. cm.
&lt;br&gt;
110. Editing is a rewording activity.
&lt;br&gt;
111. Why did the Roman Empire collapse? What is Latin for office automation?
&lt;br&gt;
112. Computer Science is embarrassed by the computer.
&lt;br&gt;
113. The only constructive theory connecting neuroscience and psychology will arise from the study of software.
&lt;br&gt;
114. Within a computer natural language is unnatural.
&lt;br&gt;
115. Most people find the concept of programming obvious, but the doing impossible.
&lt;br&gt;
116. You think you know when you can learn, are more sure when you can write, even more when you can teach, but certain when you can program.
&lt;br&gt;
117. It goes against the grain of modern education to teach children to program. What fun is there in making plans, acquiring discipline in organizing thoughts, devoting attention to detail and learning to be self-critical?
&lt;br&gt;
118. If you can imagine a society in which the computer- robot is the only menial, you can imagine anything.
&lt;br&gt;
119. Programming is an unnatural act.
&lt;br&gt;
120. Adapting old programs to fit new machines usually means adapting new machines to behave like old ones.&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/71GMQYZXmwc" height="1" width="1"/&gt;</description>
    <pubDate>Tue, 15 Nov 2011 07:20:13 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2011/11/epigrams-in-programming/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2011/11/epigrams-in-programming/</feedburner:origLink></item>
  <item>
    <title>Yahoo geocoder is gone</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/9MY9uHqs3c4/</link>
    <description>&lt;br&gt;
Yahoo quietly discontinued it's geocoding feature in September. I kept getting 503 errors until I looked at the &lt;a href="http://developer.yahoo.com/maps/" target="_blank"&gt;Yahoo developer maps page&lt;/a&gt;. I wonder if they were just using google maps on the backend and couldn't afford the new pricing structure.

Bummer, because I used it for almost everything I do with calculating latitude and longitude values on the fly. I am now refactoring to use &lt;a href="http://code.google.com/apis/maps/faq.html" target="_blank"&gt;google maps&lt;/a&gt; instead. One might argue that I should have done that to start with.&lt;br&gt;


&lt;a href="http://blog.kristeraxel.com/wp-content/uploads/2011/11/Screen-shot-2011-11-02-at-10.51.10-AM.png"&gt;&lt;img src="http://blog.kristeraxel.com/wp-content/uploads/2011/11/Screen-shot-2011-11-02-at-10.51.10-AM-300x69.png" alt="" title="Screen shot 2011-11-02 at 10.51.10 AM" width="300" height="69" class="aligncenter size-medium wp-image-1428" /&gt;&lt;/a&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/9MY9uHqs3c4" height="1" width="1"/&gt;</description>
    <pubDate>Wed, 02 Nov 2011 19:06:04 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2011/11/yahoo-geocoder-is-gone/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2011/11/yahoo-geocoder-is-gone/</feedburner:origLink></item>
  <item>
    <title>the fizzbuzz problem</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/SlJreOoxlm4/</link>
    <description>&lt;br&gt;

I got the idea to try this from &lt;a href="http://www.codinghorror.com/blog/2007/02/why-cant-programmers-program.html" target="_blank"&gt;this article&lt;/a&gt; after reading &lt;a href="http://www.kalzumeus.com/2011/10/28/dont-call-yourself-a-programmer/" target="_blank"&gt;this article&lt;/a&gt;.

I stumbled a little on the mod function, I thought you could write 'mod' instead of using the '%' operator. So it took me just under 4 minutes. Hopefully that puts me somewhere above the middle of the pack.


&lt;script src="https://gist.github.com/1325022.js?file=fizzbuzz.rb"&gt;&lt;/script&gt;



Also, for the record I built a directory for the script and made sure it ran correctly within those three minutes. I saw a guy who says he did it in C in 30 seconds, and I'm pretty sure he didn't compile or run it in that time. Cheater!


&lt;pre&gt;
AirAxel:fizzbuzz pi$ ruby testfb.rb 
1
2
fizz
4
buzz
fizz
7
8
fizz
buzz
11
fizz
13
14
fizzbuzz
16
17
fizz
19
buzz
fizz
22
23
fizz
buzz
26
fizz
28
29
fizzbuzz
31
32
fizz
34
buzz
fizz
37
38
fizz
buzz
41
fizz
43
44
fizzbuzz
46
47
fizz
49
buzz
fizz
52
53
fizz
buzz
56
fizz
58
59
fizzbuzz
61
62
fizz
64
buzz
fizz
67
68
fizz
buzz
71
fizz
73
74
fizzbuzz
76
77
fizz
79
buzz
fizz
82
83
fizz
buzz
86
fizz
88
89
fizzbuzz
91
92
fizz
94
buzz
fizz
97
98
fizz
buzz
AirAxel:fizzbuzz pi$
&lt;/pre&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/SlJreOoxlm4" height="1" width="1"/&gt;</description>
    <pubDate>Sat, 29 Oct 2011 20:16:52 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2011/10/the-fizzbuzz-problem/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2011/10/the-fizzbuzz-problem/</feedburner:origLink></item>
  <item>
    <title>if it were not for Steve</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/Mnxc7jsQqfg/</link>
    <description>&lt;br/&gt;
&lt;strong&gt;If it were not for Steve:&lt;/strong&gt;
&lt;ul&gt;
  &lt;li&gt;I would probably still be a Windows developer.&lt;/li&gt;
  &lt;li&gt;My laptop would be a lot uglier.&lt;/li&gt;
  &lt;li&gt;I would probably still have a cable TV subscription.&lt;/li&gt;
  &lt;li&gt;I wouldn't love to hate iTunes so much.&lt;/li&gt;
  &lt;li&gt;I wouldn't be tempted every day to buy an iPhone.&lt;/li&gt;
  &lt;li&gt;I wouldn't be tempted every day to buy an iPad.&lt;/li&gt;
  &lt;li&gt;The software development community would probably be very different and certainly for the worse.&lt;/li&gt;
  &lt;li&gt;&lt;em&gt;Finding Nemo&lt;/em&gt; would never have made me cry.&lt;/li&gt;
  &lt;li&gt;Today would not be such a sad day.&lt;/li&gt;
&lt;/ul&gt;


Rest in peace, great man.&lt;br&gt;


&lt;a href="http://blog.kristeraxel.com/wp-content/uploads/2011/10/t_hero.png"&gt;&lt;img src="http://blog.kristeraxel.com/wp-content/uploads/2011/10/t_hero-300x273.png" alt="" title="Steve Jobs" width="300" height="273" class="aligncenter size-medium wp-image-1300" /&gt;&lt;/a&gt;

&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;

This is also cool - the simple but unprecedented &lt;a href="http://google.com"&gt;Google&lt;/a&gt; tribute:

&lt;a href="http://blog.kristeraxel.com/wp-content/uploads/2011/10/google-tribute.png"&gt;&lt;img src="http://blog.kristeraxel.com/wp-content/uploads/2011/10/google-tribute-300x188.png" alt="" title="google-tribute" width="300" height="188" class="aligncenter size-medium wp-image-1306" /&gt;&lt;/a&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/Mnxc7jsQqfg" height="1" width="1"/&gt;</description>
    <pubDate>Thu, 06 Oct 2011 01:16:05 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2011/10/if-it-were-not-for-steve/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2011/10/if-it-were-not-for-steve/</feedburner:origLink></item>
  <item>
    <title>get rid of the patch gem_dependency.rb:119 error</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/zcTvz_pvpFc/</link>
    <description>Hate this error?

&lt;pre&gt;
fix version_requirements is deprecated &lt;br&gt;
and will be removed on or after August 2010. &lt;br&gt;
Use #requirement
&lt;/pre&gt;&lt;br&gt;&lt;br&gt;

Use this:&lt;br&gt;&lt;br&gt;

&lt;script src="https://gist.github.com/1143138.js?file=gistfile1.txt"&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;

copied from &lt;a href="http://www.mattvsworld.com/blog/2010/03/version_requirements-deprecated-warning-in-rails/"&gt;here&lt;/a&gt;&lt;br&gt;&lt;br&gt;

Just remember to switch out the directory after -d with wherever gem_dependency.rb lives on your system (it’s in the warning message). It is probably bad practice to patch your system gems, but to get rid of this warning we can make an exception...

If something goes wrong, reverse the patch with: &lt;br&gt;&lt;br&gt;


&lt;script src="https://gist.github.com/1143140.js?file=gistfile1.txt"&gt;&lt;/script&gt;

&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/zcTvz_pvpFc" height="1" width="1"/&gt;</description>
    <pubDate>Tue, 02 Aug 2011 23:20:03 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2011/08/get-rid-of-the-patch-gem_dependency-rb119-error/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2011/08/get-rid-of-the-patch-gem_dependency-rb119-error/</feedburner:origLink></item>
  <item>
    <title>setting up a MacBook Air 2011</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/r6hUs4-KD9Q/</link>
    <description>&lt;br&gt;This was copied from &lt;a href="http://www.frederico-araujo.com/2010/08/19/installing-rails-enviroment-on-snow-leopard-with-macports-mysql-and-modrails-passenger/"&gt;this great post&lt;/a&gt; by Frederico Araujo, with some small modifications for my own use case.

MacPorts is still a smart way to go, I tried Homebrew first and ended up in Ruby gem hell.

Also, read all the way to the bottom before you start (you may need to add wget via MacPorts before step 3).

&lt;div class="textcontent"&gt;
&lt;h3&gt;Requirements:&lt;/h3&gt; 
&lt;ul&gt; 
&lt;li&gt; Snow Leopard 10.6.4 or greater&lt;/li&gt; 
&lt;li&gt; Xcode 3.2.3, 2.4.1 or greater&lt;/li&gt; 
&lt;li&gt; Admin privileges on your mac.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;h3&gt;Software preliminary:&lt;/h3&gt; 
&lt;ul&gt; 
&lt;li&gt; Mysql 5.1.49 (macports)&lt;/li&gt; 
&lt;li&gt; Ruby 1.8.7 (macports)&lt;/li&gt; 
&lt;li&gt; Rubygems (download)&lt;/li&gt; 
&lt;/ul&gt; 
&lt;h3&gt;1. Preparing System&lt;/h3&gt; 
&lt;p&gt;If you are upgrading from Leopard to Snow Leopard, I recommend you delete your old installation.&lt;/p&gt; 
&lt;pre class="command"&gt;sudo rm -rf \
    /opt/local \
    /Applications/DarwinPorts \
    /Applications/MacPorts \
    /Library/LaunchDaemons/org.macports.* \
    /Library/Receipts/DarwinPorts*.pkg \
    /Library/Receipts/MacPorts*.pkg \
    /Library/StartupItems/DarwinPortsStartup \
    /Library/Tcl/darwinports1.0 \
    /Library/Tcl/macports1.0 \
    ~/.macports
&lt;/pre&gt;
Note: I was setting up a new MacBook Air, so I didn't need to do this, but I left it here for reference.

&lt;h4&gt;1.1 Prepare PATH environment:&lt;/h4&gt; 
&lt;pre class="command"&gt;$vim ~/.bash_profile
&lt;/pre&gt; 
&lt;p&gt;Edit your ~/.bash_profile file and add these 2 lines.&lt;br /&gt; 
Check if they are not there already.&lt;/p&gt; 
&lt;pre&gt;export PATH=/opt/local/bin:/opt/local/sbin:$PATH
export MANPATH=/opt/local/share/man:$MANPATH
&lt;/pre&gt; 
&lt;h4&gt;1.2 Download and Install Xcode&lt;/h4&gt; 
&lt;p&gt;&lt;a href="http://developer.apple.com/technologies/xcode.html" onclick="javascript:_gaq.push(['_trackEvent','outbound-article','developer.apple.com/technologies/xcode.html']);"&gt;http://developer.apple.com/technologies/xcode.html&lt;/a&gt;&lt;p&gt;
Here I used the XCode install from my Snow Leopard disc, the above link is from the original post. The link includes the XCode SDK, I think, so it's a bigger download (4gb) whereas the Snow Leopard XCode install is only 2.7gb which is all you need for just Rails stuff and with a smallish hard drive, every gb counts. Also, I did the install via driveshare from my other MacBook Pro.&lt;/p&gt;
&lt;/p&gt; 
&lt;h4&gt;1.3 Download Macports and install&lt;/h4&gt; 
&lt;p&gt;Download Page: &lt;a href="http://www.macports.org/install.php" onclick="javascript:_gaq.push(['_trackEvent','outbound-article','www.macports.org/install.php']);"&gt;http://www.macports.org/install.php&lt;/a&gt;&lt;/p&gt; 
&lt;p&gt;Download Direct Link: &lt;a href="http://distfiles.macports.org/MacPorts/MacPorts-1.9.2-10.6-SnowLeopard.dmg" onclick="javascript:_gaq.push(['_trackEvent','outbound-article','distfiles.macports.org/MacPorts/MacPorts-1.9.2-10.6-SnowLeopard.dmg']);"&gt;http://distfiles.macports.org/MacPorts/MacPorts-1.9.2-10.6-SnowLeopard.dmg&lt;/a&gt;&lt;/p&gt; 
&lt;p&gt;You might use this guide for installing Macports:&lt;/p&gt; 
&lt;p&gt;Full Install Guide: http://guide.macports.org/#installing&lt;/p&gt; 
&lt;h4&gt;1.3.1 Update macports&lt;/h4&gt; 
&lt;pre class="command"&gt;sudo port -v selfupdate&lt;/pre&gt; 
&lt;h3&gt;2. Mysql&lt;/h3&gt; 
&lt;h4&gt;2.1 Install Mysql&lt;/h4&gt; 
&lt;pre class="command"&gt;sudo port -v install mysql5-server mysql5&lt;/pre&gt; 
&lt;h4&gt;2.2 Make mysql autoload on startup&lt;/h4&gt; 
&lt;pre class="command"&gt;sudo port load mysql5-server
sudo -u mysql mysql_install_db5
&lt;/pre&gt; 
&lt;h3&gt;3. Ruby, Rubygems, Rails, other gems&lt;/h3&gt; 
&lt;p&gt;3.1 Install Ruby from macports&lt;/p&gt; 
&lt;pre class="command"&gt;sudo port -v install ruby&lt;/pre&gt; 
&lt;pre class="command"&gt;$ ruby -v
ruby 1.8.7 (2010-08-08 patchlevel 302) [x86_64-darwin10]
&lt;/pre&gt; 
&lt;h4&gt;3.2 download rubygems from http://rubygems.org/pages/download&lt;/h4&gt; 
&lt;pre class="command"&gt;cd /tmp
wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz
tar xpf rubygems-1.3.7.tgz
cd rubygems-1.3.7
sudo ruby setup.rb
&lt;/pre&gt; 
&lt;h4&gt;3.3 Install rails, rake, rspec etc.&lt;/h4&gt; 
You may want a lot of other gems, I added xml-simple, fastercsv, calendar_helper, etc., so add gems as needed, especially the mysql gem which you will need - but do that as specified in the next step.
&lt;pre class="command"&gt;sudo gem install rake rails ruby-debug&lt;/pre&gt;
&lt;h4&gt;3.4 install mysql gem&lt;/h4&gt; 
&lt;pre class="command"&gt;sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- \ 
--with-mysql-config=/opt/local/lib/mysql5/bin/mysql_config
&lt;/pre&gt;

DO THIS BEFORE step 3:

I had to run
&lt;pre&gt;sudo port install wget&lt;/pre&gt;

before I was able to get the RubyGems install package (wget does not ship with Snow Leopard).

Other things I had to do:
&lt;p&gt;I had to install git from a package &lt;a href="http://code.google.com/p/git-osx-installer/"&gt;here&lt;/a&gt;.&lt;/p&gt;

good luck!

&lt;/div&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/r6hUs4-KD9Q" height="1" width="1"/&gt;</description>
    <pubDate>Tue, 21 Jun 2011 00:07:57 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2011/06/setting-up-a-macbook-air-2011/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2011/06/setting-up-a-macbook-air-2011/</feedburner:origLink></item>
  <item>
    <title>prawn for Rails</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/Mp67td2vk3g/</link>
    <description>&lt;br/&gt;
I had a question from &lt;a href="http://twitter.com/#!/rcstolle"&gt;@rcstolle&lt;/a&gt; on how to use Prawn, so here is a short primer. There are two ways to go - Prawn gives a pretty good amount of control via the built-in methods, so if your layout is static enough you can just build a report with what amounts to something of a cursor. Somehow it feels vaguely like Crystal Reports for those dinosaurs like me who actually used to use that once upon a time.

&lt;script src="https://gist.github.com/895622.js?file=printable_drug_record.rb"&gt;&lt;/script&gt;

You set the fill color, you build the table, you move to cursor down a few pixels, et cetera. Everything is pixel based and although it feels pretty solid, you don't get any CSS, you can't float anything, and in the end the use-cases are sort of limited. The other route is to use the grid-based option, which allows greater control and flexibility but also forces you to delve a little deeper into the Prawn object model. Here are some code samples to show how the Prawn::Document::Grid class can be used in practice.

Starting with the document class:

&lt;script src="https://gist.github.com/938422.js?file=document.rb"&gt;&lt;/script&gt;

the page:

&lt;script src="https://gist.github.com/938424.js?file=page.rb"&gt;&lt;/script&gt;

the section:

&lt;script src="https://gist.github.com/938425.js?file=section.rb"&gt;&lt;/script&gt;

and the supporting classes:

&lt;script src="https://gist.github.com/938421.js?file=gistfile1.rb"&gt;&lt;/script&gt;

&lt;script src="https://gist.github.com/938419.js?file=gistfile1.rb"&gt;&lt;/script&gt;

&lt;script src="https://gist.github.com/938418.js?file=gistfile1.rb"&gt;&lt;/script&gt;

which leans heavily on the &lt;a href="http://corelib.rubyonrails.org/classes/Forwardable.html"&gt;Forwardable&lt;/a&gt; module.

Here, although you are still working very much with pixel values, you also are specifying rows which can help with complex layouts. If you need some reference for the Prawn Grid module it is &lt;a href="http://prawn.majesticseacreature.com/docs/0.11.1/Prawn/Document/Grid.html"&gt;here&lt;/a&gt;.

So, the bottom line is that Prawn can handle whatever you throw at it. It is a very powerful tool and I don't know of anything that even comes close in terms of pure Ruby solutions to writing PDF reports.&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/Mp67td2vk3g" height="1" width="1"/&gt;</description>
    <pubDate>Sat, 23 Apr 2011 07:02:43 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2011/04/prawn-for-rails/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2011/04/prawn-for-rails/</feedburner:origLink></item>
  <item>
    <title>The change you wanted was rejected.</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/OWU7udpQQSw/</link>
    <description>&lt;blockquote&gt;Maybe you tried to change something you didn't have access to.&lt;/blockquote&gt;

&lt;a href="http://blog.kristeraxel.com/wp-content/uploads/2011/04/fb-error.png"&gt;&lt;img src="http://blog.kristeraxel.com/wp-content/uploads/2011/04/fb-error-300x111.png" alt="" title="fb-error" width="300" height="111" class="aligncenter size-medium wp-image-995" /&gt;&lt;/a&gt;&lt;br/&gt;
If you see this on your Rails-based Facebook app, try disabling 'protect_from_forgery' in your ApplicationController. Facebook uses signed_request that you can decode and use to verify that the request actually comes from Facebook, so protect_from_forgery is unnecessary for applications that are accessible through the facebook canvas only.&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/OWU7udpQQSw" height="1" width="1"/&gt;</description>
    <pubDate>Thu, 07 Apr 2011 19:32:57 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2011/04/the-change-you-wanted-was-rejected/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2011/04/the-change-you-wanted-was-rejected/</feedburner:origLink></item>
  <item>
    <title>reverse string function</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/1MsuuA8vQiE/</link>
    <description>&lt;BR/&gt;
Good times.

&lt;script src="https://gist.github.com/876814.js?file=reverse_string.rb"&gt;&lt;/script&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/1MsuuA8vQiE" height="1" width="1"/&gt;</description>
    <pubDate>Fri, 18 Mar 2011 20:53:25 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2011/03/reverse-string-function/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2011/03/reverse-string-function/</feedburner:origLink></item>
  <item>
    <title>checking JRE and JDK versions on a mac 10.6</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/t37rjtYbSew/</link>
    <description>&lt;p&gt;I know it&amp;#039;s not rocket science, but it is worth explaining.&lt;/p&gt;
&lt;p&gt;In a terminal:&lt;/p&gt;
&lt;pre&gt;
  java -version
&lt;/pre&gt;&lt;p&gt;
will check the JRE version;&lt;/p&gt;
&lt;p&gt;whereas&lt;/p&gt;
&lt;pre&gt;
  javac -version
&lt;/pre&gt;&lt;p&gt;
will check the JDK version.&lt;/p&gt;
&lt;p&gt;like so:&lt;/p&gt;
&lt;pre&gt;

zeta:rockstaralley kaxel$ java -version
java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04-307-10M3261)
Java HotSpot(TM) 64-Bit Server VM (build 17.1-b03-307, mixed mode)
zeta:rockstaralley kaxel$ javac -version
javac 1.6.0_22

&lt;/pre&gt;&lt;p&gt;
The JRE ships with the Mac OS (or so I&amp;#039;m told) but the JDK installs with the XCode package.&lt;/p&gt;
&lt;p&gt;you&amp;#039;re welcome!&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/t37rjtYbSew" height="1" width="1"/&gt;</description>
    <pubDate>Mon, 28 Feb 2011 23:24:01 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2011/02/checking-jre-and-jdk-versions-on-a-mac-10-6/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2011/02/checking-jre-and-jdk-versions-on-a-mac-10-6/</feedburner:origLink></item>
  <item>
    <title>one column liquid layout</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/T1U6ZyQOwqE/</link>
    <description>&lt;p&gt;I am using this for the Android app I&amp;#039;m working on, and it is spot on.&lt;/p&gt;
&lt;p&gt;HTML found here: &lt;a href="http://www.maxdesign.com.au/articles/css-layouts/one-liquid/" title="http://www.maxdesign.com.au/articles/css-layouts/one-liquid/"&gt;http://www.maxdesign.com.au/articles/css-layouts/one-liquid/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;and the css (which I have added to a little bit compared to the original):&lt;/p&gt;
&lt;pre&gt;

#container
{
	margin: 0 30px;
	background: #fff;
}

#header
{
	background: #ccc;
	padding: 20px;
}

#header h1 { margin: 0; text-align: center;}

#navigation
{
	float: left;
	width: 100%;
	background: #333;
}

#navigation ul
{
	margin: 0;
	padding: 0;
}

#navigation ul li
{
	list-style-type: none;
	display: inline;
}

#navigation li a
{
	display: block;
	float: left;
	padding: 5px 10px;
	color: #fff;
	text-decoration: none;
	border-right: 1px solid #fff;
}

#navigation li a:hover { background: #383; }

#content
{
	clear: left;
	padding: 20px;
}

#message
{
	background-color: #ccc;
	padding: 10px;
}

.field
{
	border-left: 4px solid red;
	padding-left: 20px;
}

.username {font-weight: bold;}

#content h2
{
	color: #000;
	font-size: 160%;
	margin: 0 0 .5em;
}

#footer
{
	background: #ccc;
	text-align: right;
	padding: 20px;
	height: 1%;
}

&lt;/pre&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/T1U6ZyQOwqE" height="1" width="1"/&gt;</description>
    <pubDate>Mon, 28 Feb 2011 08:40:15 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2011/02/one-column-liquid-layout/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2011/02/one-column-liquid-layout/</feedburner:origLink></item>
  <item>
    <title>quick and dirty rake ci script</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/BTO67YJyJ3k/</link>
    <description>&lt;p&gt;I know, it doesn&amp;#039;t have all the bells and whistles; you need to add the files to git by hand; and you can move right through with unstaged changes with nary a peep in protest. But it still does the trick and makes my life easier - so here it is: my quick and dirty rake ci script -&lt;/p&gt;

&lt;script src="https://gist.github.com/860995.js?file=checkin.rake"&gt;&lt;/script&gt;

&lt;p&gt;
save it in a rake file called whatever you like and do all your checkins, after doing a &amp;#039;git add .&amp;#039; or what have you - like this:&lt;/p&gt;
&lt;pre&gt;
rake ci
&lt;/pre&gt;&lt;p&gt;
Done!&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/BTO67YJyJ3k" height="1" width="1"/&gt;</description>
    <pubDate>Sun, 27 Feb 2011 20:51:49 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2011/02/quick-and-dirty-rake-ci-script/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2011/02/quick-and-dirty-rake-ci-script/</feedburner:origLink></item>
  <item>
    <title>new routes in rails 3.1</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/s4kx0iuiPSI/</link>
    <description>&lt;p&gt;explained here:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.engineyard.com/blog/2010/the-lowdown-on-routes-in-rails-3/" title="http://www.engineyard.com/blog/2010/the-lowdown-on-routes-in-rails-3/"&gt;http://www.engineyard.com/blog/2010/the-lowdown-on-routes-in-rails-3/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I was already on 3.0.3, so it basically amounted to removing the |map| from&lt;/p&gt;
&lt;pre&gt;
Rockstaralley::Application.routes.draw do |map|
  #routes are mapped here
end
&lt;/pre&gt;&lt;p&gt;
which was fine with me.&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/s4kx0iuiPSI" height="1" width="1"/&gt;</description>
    <pubDate>Wed, 02 Feb 2011 06:50:45 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2011/02/new-routes-in-rails-3-1/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2011/02/new-routes-in-rails-3-1/</feedburner:origLink></item>
  <item>
    <title>update your Gemfile with one line</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/47CIrPfiJFY/</link>
    <description>&lt;pre&gt;
rm -rf .bundle &amp;&amp; bundle install &amp;&amp; 
    git add Gemfile.lock &amp;&amp; git commit -m "Added Gemfile.lock"
&lt;/pre&gt;&lt;p&gt;
Good times.&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/47CIrPfiJFY" height="1" width="1"/&gt;</description>
    <pubDate>Mon, 31 Jan 2011 16:30:20 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2011/01/update-your-gemfile-with-one-line/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2011/01/update-your-gemfile-with-one-line/</feedburner:origLink></item>
  <item>
    <title>FTPS for dummies</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/nMGxzn9Mces/</link>
    <description>&lt;p&gt;Yah, I know it&amp;#039;s been a while, but I&amp;#039;ve been busy. Work, family, vacation, video games - it&amp;#039;s a long list.&lt;/p&gt;
&lt;p&gt;Anyway, for my first post of the year, I am posting code that I found here:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blog.behindlogic.com/2009/03/ruby-ftps-implicit-ssl.html" title="http://blog.behindlogic.com/2009/03/ruby-ftps-implicit-ssl.html"&gt;http://blog.behindlogic.com/2009/03/ruby-ftps-implicit-ssl.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;written by a nice gentleman named Daniel Parker, who basically got to it first.&lt;/p&gt;
&lt;p&gt;I have long known that the standard FTP class that rolls with Rails has no knowledge of or familiarity with FTPS, which is FTP with implicit ssl which is a new standard by our &amp;#039;friends&amp;#039; at Microsoft, who never met a party they didn&amp;#039;t want to piss on (true story).&lt;/p&gt;
&lt;p&gt;Anyway, the bullet finally found me and  from now on I will have to learn to make my Rails 2.3.5 app play nice with IIS. First step - connecting via FTPS to pull files down - we used to use SFTP but I guess that was either too simple and/or functional for the Microsoft team to get on board.&lt;/p&gt;
&lt;p&gt;I found the above post by Mr. Parker, and it helped a lot. Here is the code:&lt;/p&gt;

&lt;script src="https://gist.github.com/860690.js?file=ftps.rb"&gt;&lt;/script&gt;

&lt;p&gt;
Use it just as you would the FTP class.&lt;/p&gt;
&lt;p&gt;Here it is in a rake test task (because I don&amp;#039;t like my test suite to actually connect to live servers):&lt;/p&gt;

&lt;script src="https://gist.github.com/860998.js?file=ftps_rake_test.rake"&gt;&lt;/script&gt;

&lt;p&gt;
Got it?&lt;/p&gt;
&lt;p&gt;also many thanks to Daniel Parker for making my life a little easier and posting the code so generously.&lt;/p&gt;
&lt;/&gt;&lt;/pre&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/nMGxzn9Mces" height="1" width="1"/&gt;</description>
    <pubDate>Fri, 28 Jan 2011 01:29:35 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2011/01/ftps-for-dummies/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2011/01/ftps-for-dummies/</feedburner:origLink></item>
  <item>
    <title>custom wordpress css</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/HweAU10tdu8/</link>
    <description>&lt;p&gt;This is my Wordpress css tweak code and I may need it again later.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&lt;br /&gt;
  div .content {font-style: italic;}&lt;br /&gt;
  div .entry-content {font-style: normal !important;}&lt;br /&gt;
  .entry .content {font-style: normal !important;}&lt;br /&gt;
  #searchlabel {display: none;}&lt;br /&gt;
  a img {border: none; }&lt;br /&gt;
&lt;/code&gt;&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/HweAU10tdu8" height="1" width="1"/&gt;</description>
    <pubDate>Sat, 04 Dec 2010 07:25:29 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2010/12/custom-wordpress-css/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2010/12/custom-wordpress-css/</feedburner:origLink></item>
  <item>
    <title>shipping your LX20</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/GGPh3qmE5RY/</link>
    <description>&lt;p&gt;If you are shipping your XT, LX-20 or XT-20, put it in this "shipping mode." It will secure the transport for safer shipping:&lt;/p&gt;
&lt;p&gt;WITH NO TAPE in the deck, power up the machine while holding down the "record ready/arm" buttons for tracks 1 and 7.&lt;br /&gt;
Display will read "0 SHiP *".&lt;br /&gt;
Press "play" and you will hear the transport engaging as if there was a tape in it. Give it a few seconds to complete.&lt;br /&gt;
Display will read "SHiP rdY". (Ship Ready)&lt;br /&gt;
Power down the deck. When it is powered up again, the transport will reset to normal mode. Allow a few seconds for this to complete before inserting a tape.&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/GGPh3qmE5RY" height="1" width="1"/&gt;</description>
    <pubDate>Sat, 20 Nov 2010 01:40:02 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2010/11/shipping-your-lx20/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2010/11/shipping-your-lx20/</feedburner:origLink></item>
  <item>
    <title>CSV IllegalFormatError</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/y6tp7K_U8RI/</link>
    <description>&lt;p&gt;&lt;code&gt;&lt;br /&gt;
  CSV::IllegalFormatError&lt;br /&gt;
&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;If you all of a sudden are getting this error in your tests and you just upgraded your version of Rails. say to 2.3.5 or above, never fear.&lt;/p&gt;
&lt;p&gt;You just have to change all of your old csv test fixtures to yaml.&lt;/p&gt;
&lt;p&gt;Have fun with that!&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/y6tp7K_U8RI" height="1" width="1"/&gt;</description>
    <pubDate>Wed, 10 Nov 2010 21:32:22 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2010/11/csv-illegalformaterror/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2010/11/csv-illegalformaterror/</feedburner:origLink></item>
  <item>
    <title>javascript for fun and profit</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/Q8UYwcAObSY/</link>
    <description>&lt;script src="https://gist.github.com/860699.js?file=unique-check.js"&gt;&lt;/script&gt;

&lt;p&gt;
usage:&lt;/p&gt;
&lt;pre&gt;
  arr = [1, 2, 2, 3];
  var u = unique(arr);
  
  u.length == 3   # TRUE
&lt;/pre&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/Q8UYwcAObSY" height="1" width="1"/&gt;</description>
    <pubDate>Fri, 13 Aug 2010 19:19:16 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2010/08/javascript-for-fun-and-profit/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2010/08/javascript-for-fun-and-profit/</feedburner:origLink></item>
  <item>
    <title>the mars rover assignment</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/CtMeNw5dpqg/</link>
    <description>&lt;p&gt;Who rocked the Mars rover assignment? I did. I have seen a bunch of submissions now and I have seen nothing close to as good or as thorough as the one I submitted.&lt;/p&gt;

&lt;a href='http://blog.kristeraxel.com/wp-content/uploads/2010/08/mars_rover.zip'&gt;mars_rover&lt;/a&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/CtMeNw5dpqg" height="1" width="1"/&gt;</description>
    <pubDate>Tue, 03 Aug 2010 21:11:13 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2010/08/the-mars-rover-assignment/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2010/08/the-mars-rover-assignment/</feedburner:origLink></item>
  <item>
    <title>simple blog class for displaying tweets</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/fWC8N-VQ9Ao/</link>
    <description>&lt;p&gt;This is used in a rails 3.0 project.&lt;/p&gt;

&lt;script src="https://gist.github.com/860724.js?file=blog.rb"&gt;&lt;/script&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/fWC8N-VQ9Ao" height="1" width="1"/&gt;</description>
    <pubDate>Sat, 31 Jul 2010 19:49:56 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2010/07/simple-blog-class-for-displaying-tweets/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2010/07/simple-blog-class-for-displaying-tweets/</feedburner:origLink></item>
  <item>
    <title>Precision in speech based communications</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/PdeREZhXaas/</link>
    <description>&lt;p&gt;Precision in speech-based communications&lt;/p&gt;
&lt;p&gt;I will start with a quote, which is ostensibly a technical communication. Sure it is from a &amp;#039;message board&amp;#039;, which is more or less an informal medium, but that does not mean that universal rules of logic will not apply. Besides, it is a work message board (Campfire), and is used extensively as a measure of our internal communications. I think at the root of it that all communications should and for the most part will be judged mainly in terms of how effective they are, and to a smaller extent in terms of the economy of effort involved with understanding them. So here&amp;#039;s the quote:&lt;/p&gt;
&lt;p&gt;&lt;b&gt;"the fix that fixes the workflow tests no longer applies, so 2 of the 3 will still be broken - FYI"&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;This is from a small team of developers working together on a single code base, with a set of automated tests that are maintained collectively. The expectations here are as stated above, namely that the message be effective and succinct. What Is Being Said?, as well as How long Does It Take Me To Understand It? should be the two questions in mind when assessing the inherent value of this message.&lt;/p&gt;
&lt;p&gt;What Is Being Said?&lt;/p&gt;
&lt;p&gt;In essence, we have a simple logical statement here - premise, conclusion. This is so, so that is so. Let&amp;#039;s examine the first part, the premise.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;the fix that fixes the workflow tests no longer applies&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;There are many potential meanings here, which one might call an ambiguous premise. First, the word &amp;#039;fix&amp;#039; is used as both a subject and a verb, which is bad form. It would be better to replace one or the other with a valid synonym, just to avoid confusion. The &amp;#039;fix that addresses the workflow tests&amp;#039;, perhaps.&lt;br /&gt;
Next, we can see that &amp;#039;the workflow tests&amp;#039; are referred to collectively, which is a mistake in specificity. The employee here knows very well that there are only 3 specific tests that are affected - the 3 that are mentioned in the conclusion - but they prefer to describe as little as possible, essentially missing two chances to actually specify them. Of course, brevity is king, but it would be as easy as saying the &amp;#039;fix that addresses the drug_name workflow tests&amp;#039; which is only one extra word but helps us get much closer to a specific and limited subject from which to subsequently draw a conclusion. Finally, the last glaring problem here is that the phrase &amp;#039;no longer applies&amp;#039; is badly worded because it implies another question, namely &amp;#039;why does it no longer apply?&amp;#039;. It is also interesting that the employee goes to a certain length to be non-explicit - vagueness also at the expense of brevity. Did the tests break? Is it true that the &amp;#039;fix&amp;#039; still &amp;#039;fixes&amp;#039; the tests, if it &amp;#039;no longer applies&amp;#039;? The premise itself borders on the nonsensical. Better to say &amp;#039;the drug_name workflow tests are broken&amp;#039;, or maybe &amp;#039;the drug_name workflow tests are no longer needed&amp;#039;, or &amp;#039;the drug_name workflow tests need to be refactored&amp;#039;. All 3 of those different scenarios are perhaps referenced by this statement but we don&amp;#039;t know which.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;so 2 of the 3 will still be broken - FYI&lt;/b&gt;&lt;br /&gt;
Stemming from an ambiguous premise, this is hard to parse, but we can see a few simple problems with the form again.&lt;/p&gt;
&lt;p&gt;First, &amp;#039;2 of the 3&amp;#039; - which three? Using &amp;#039;the&amp;#039; here implies that we know which 3 to which the speaker refers, but this is the first time we hear of that number. So, in essence the reader is forced to conclude that the number 3 refers to the collective statement about workflow tests in the premise, but that is by no means explicit and fails one or both our expectations, depending on how generous you are - either it communicates ineffectively AND takes more time than necessary to understand, or it just takes more time than necessary to understand.&lt;/p&gt;
&lt;p&gt;And yet again, the phraseology &amp;#039;will still be broken&amp;#039; implies that we know already that they are broken and are being informed simply that they will remain so, another mistake in the reference chain, if you will. We were never actually told that anything was already broken - if you remember, we were told just that &amp;#039;the fix...no longer applies&amp;#039;, so this conclusion leaves us, among other things, wondering if we were supposed to have had some information in the premise that was never forthcoming.&lt;/p&gt;
&lt;p&gt;So, to conclude, we have no conclusion. We are left with more questions than answers. As I just mentioned, we are not sure if we missed something in the premise; we don&amp;#039;t know why whatever just happened only applies to &amp;#039;2 of the 3&amp;#039;; and we have absolutely no expectation for the future which is usually what statements like these are used for. We don&amp;#039;t know if this is a surprise, if someone should be working on it or perhaps already is, if this is a temporary state that will resolve itself somehow; so the usage of FYI is both unfortunate and supremely ironic, because of all the thing we have here, information is not one of them.&lt;/p&gt;
&lt;p&gt;So please - be specific. Every time someone misses the opportunity to communicate effectively the whole world gets a little bit dumber.&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/PdeREZhXaas" height="1" width="1"/&gt;</description>
    <pubDate>Thu, 29 Jul 2010 22:38:34 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2010/07/precision-in-speech-based-communications/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2010/07/precision-in-speech-based-communications/</feedburner:origLink></item>
  <item>
    <title>you need this to run rails on ubuntu</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/m6CIYwxEmDc/</link>
    <description>&lt;pre&gt;
sudo apt-get install libopenssl-ruby
&lt;/pre&gt;&lt;p&gt;
in order to combat this error:&lt;/p&gt;
&lt;pre&gt;
no such file to load -- openssl
&lt;/pre&gt;&lt;p&gt;
be forewarned.&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/m6CIYwxEmDc" height="1" width="1"/&gt;</description>
    <pubDate>Fri, 23 Jul 2010 05:29:18 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2010/07/you-need-this-to-run-rails-on-ubuntu/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2010/07/you-need-this-to-run-rails-on-ubuntu/</feedburner:origLink></item>
  <item>
    <title>the Law of Demeter</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/Jnb4UHEILeM/</link>
    <description>&lt;p&gt;More formally, the Law of Demeter for functions requires that a method M of an object O may only invoke the methods of the following kinds of objects:&lt;/p&gt;
&lt;p&gt;   1. O itself&lt;br /&gt;
   2. M&amp;#039;s parameters&lt;br /&gt;
   3. any objects created/instantiated within M&lt;br /&gt;
   4. O&amp;#039;s direct component objects&lt;br /&gt;
   5. a global variable, accessible by O, in the scope of M&lt;/p&gt;
&lt;p&gt;&lt;a href="http://en.wikipedia.org/wiki/Law_of_Demeter" title="http://en.wikipedia.org/wiki/Law_of_Demeter"&gt;http://en.wikipedia.org/wiki/Law_of_Demeter&lt;/a&gt;&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/Jnb4UHEILeM" height="1" width="1"/&gt;</description>
    <pubDate>Tue, 20 Jul 2010 19:15:30 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2010/07/the-law-of-demeter/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2010/07/the-law-of-demeter/</feedburner:origLink></item>
  <item>
    <title>Silly Dev jokes</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/E8nS6kdRKG8/</link>
    <description>&lt;p&gt;copied from: &lt;a href="http://blogs.adobe.com/charles/2010/05/ill_trade_you_a_joke_for_a_book.html#comments" title="http://blogs.adobe.com/charles/2010/05/ill_trade_you_a_joke_for_a_book.html#comments"&gt;http://blogs.adobe.com/charles/2010/05/ill_trade_you_a_joke_for_a_book.h...&lt;/a&gt;&lt;/p&gt;
&lt;ul class="commentlist"&gt;
&lt;li class="comment even thread-even depth-1" id="li-comment-3"&gt;
&lt;p&gt;         By Jeremy      - 6:01 PM on May 20, 2010 &amp;nbsp;&lt;/p&gt;
&lt;p&gt;            There are only 10 types of people in the world: those who understand binary and those who don’t.&lt;/p&gt;
&lt;/li&gt;
&lt;li class="comment odd alt thread-odd thread-alt depth-1" id="li-comment-4"&gt;
&lt;p&gt;         By Richie      - 12:34 AM on May 24, 2010 &amp;nbsp;&lt;/p&gt;
&lt;p&gt;            A programmers high-school girlfriend is like the square root of -2…irrational and imaginary.&lt;/p&gt;
&lt;/li&gt;
&lt;li class="comment even thread-even depth-1" id="li-comment-5"&gt;
&lt;p&gt;         By gem_reader      - 4:29 PM on May 26, 2010 &amp;nbsp;&lt;/p&gt;
&lt;p&gt;            “Knock, knock.”&lt;br /&gt;
“Who’s there?”&lt;br /&gt;
very long pause…..&lt;br /&gt;
“Java.”&lt;/p&gt;
&lt;/li&gt;
&lt;li class="comment odd alt thread-odd thread-alt depth-1" id="li-comment-6"&gt;
&lt;p&gt;         By &lt;a href="http://www.borber.com/" rel="external nofollow" class="url"&gt;Borek Bernard&lt;/a&gt;      - 2:32 AM on May 27, 2010 &amp;nbsp;&lt;/p&gt;
&lt;p&gt;            Rather a geek joke but a good one:&lt;br /&gt;
Schrodinger’s cat walks into a bar…and doesn’t&lt;/p&gt;
&lt;/li&gt;
&lt;li class="comment even thread-even depth-1" id="li-comment-7"&gt;
&lt;p&gt;         By codeabonde      - 12:27 PM on June 1, 2010 &amp;nbsp;&lt;/p&gt;
&lt;p&gt;            In C we had to code our own bugs. In C++ we can inherit them.&lt;/p&gt;
&lt;/li&gt;
&lt;li class="comment odd alt thread-odd thread-alt depth-1" id="li-comment-8"&gt;
&lt;p&gt;         By Yazbar      - 1:11 PM on June 3, 2010 &amp;nbsp;&lt;/p&gt;
&lt;p&gt;            Q: How many programmers does it take to change a light bulb?&lt;br /&gt;
A: None.  That’s a hardware problem.&lt;/p&gt;
&lt;/li&gt;
&lt;li class="comment even thread-even depth-1" id="li-comment-9"&gt;
&lt;p&gt;         By Hoover      - 1:20 PM on June 4, 2010 &amp;nbsp;&lt;/p&gt;
&lt;p&gt;            My other car is a CDR&lt;/p&gt;
&lt;/li&gt;
&lt;li class="comment odd alt thread-odd thread-alt depth-1" id="li-comment-10"&gt;
&lt;p&gt;         By mastersson      - 9:12 AM on June 8, 2010 &amp;nbsp;&lt;/p&gt;
&lt;p&gt;            Q: How many IBM Processors does it take to execute a job?&lt;br /&gt;
A: Four. Three to hold it down, and one to rip it’s head off.&lt;/p&gt;
&lt;/li&gt;
&lt;li class="comment even thread-even depth-1" id="li-comment-11"&gt;
&lt;p&gt;         By Penny      - 8:15 PM on July 12, 2010 &amp;nbsp;&lt;/p&gt;
&lt;p&gt;            Why do programmers always mix up Halloween and Christmas?&lt;br /&gt;
Because Oct 31 equals Dec 25.&lt;/p&gt;
&lt;/li&gt;
&lt;li class="comment odd alt thread-odd thread-alt depth-1" id="li-comment-12"&gt;
&lt;p&gt;         By &lt;a href="http://www.imjameshall.com" rel="external nofollow" class="url"&gt;James hall&lt;/a&gt;      - 10:23 PM on July 14, 2010 &amp;nbsp;&lt;/p&gt;
&lt;p&gt;            a sql query walks into a bar and sees two tables.  He walks up and says “can i join you?”&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/E8nS6kdRKG8" height="1" width="1"/&gt;</description>
    <pubDate>Wed, 14 Jul 2010 23:22:56 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2010/07/silly-dev-jokes/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2010/07/silly-dev-jokes/</feedburner:origLink></item>
  <item>
    <title>fun with closures</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/54adWLUYtHc/</link>
    <description>&lt;p&gt;I got burned by not being able to answer the question -&amp;#039;what are closures?" with much of anything. It was pretty embarrassing, seeing as I use them all day. :)&lt;/p&gt;
&lt;p&gt;I had a decent enough explanation about passing code blocks around, but what I forgot to mention was the &amp;#039;yield&amp;#039; keyword (which is a bit like talking about soup and forgetting to mention that you have to add water).&lt;/p&gt;
&lt;p&gt;Also, I started trying to write up an example (like I have seen Brian Guthrie do so many times) and couldn&amp;#039;t come up with a good one fast enough. &lt;/p&gt;
&lt;p&gt;Anyway, I am decidedly a pragmatist and I don&amp;#039;t get as academic as some of my more CS-based brethren, but I decided then to starting boning up on good examples of what closure is so I can do myself justice next time someone asks me that question.&lt;/p&gt;
&lt;p&gt;so I found this (by some dude named Paul):&lt;/p&gt;

&lt;script src="https://gist.github.com/860727.js?file=closures_test.rb"&gt;&lt;/script&gt;

&lt;p&gt;
ask me again, Aslan!&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/54adWLUYtHc" height="1" width="1"/&gt;</description>
    <pubDate>Fri, 09 Jul 2010 00:20:28 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2010/07/fun-with-closures/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2010/07/fun-with-closures/</feedburner:origLink></item>
  <item>
    <title>the ago function for writing on a whiteboard</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/9-FEi5Givog/</link>
    <description>&lt;p&gt;So, if you are ever somewhere where they ask you to write code on the wall with dry-erase marker, then you are covered.&lt;/p&gt;
&lt;p&gt;Me, I never realized how much I love using a keyboard and watching the letters I type appear on the screen. Writing by hand is for suckers and/or poets.&lt;/p&gt;
&lt;script src="https://gist.github.com/860734.js?file=mod-class.rb"&gt;&lt;/script&gt;&lt;p&gt;
and the tests:&lt;/p&gt;
&lt;script src="https://gist.github.com/860737.js?file=test_mod-class.rb"&gt;&lt;/script&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/9-FEi5Givog" height="1" width="1"/&gt;</description>
    <pubDate>Thu, 01 Jul 2010 23:08:08 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2010/07/the-ago-function-for-writing-on-a-whiteboard/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2010/07/the-ago-function-for-writing-on-a-whiteboard/</feedburner:origLink></item>
  <item>
    <title>ruby to_boolean function</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/pawIYNrWhCM/</link>
    <description>&lt;br&gt;&lt;br&gt;

&lt;script src="https://gist.github.com/860759.js?file=to_bool.rb"&gt;&lt;/script&gt;

UPDATE:

Erik points out that we are changing the input parameter, which is true. Point well taken. New version below:

&lt;script src="https://gist.github.com/2552946.js?file=to_bool2.rb"&gt;&lt;/script&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/pawIYNrWhCM" height="1" width="1"/&gt;</description>
    <pubDate>Fri, 18 Jun 2010 22:49:11 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2010/06/ruby-to_boolean-function/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2010/06/ruby-to_boolean-function/</feedburner:origLink></item>
  <item>
    <title>paginator class</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/x4nICH1sHuk/</link>
    <description>&lt;script src="https://gist.github.com/860760.js?file=paginator.rb"&gt;&lt;/script&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/x4nICH1sHuk" height="1" width="1"/&gt;</description>
    <pubDate>Thu, 17 Jun 2010 16:58:07 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2010/06/paginator-class/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2010/06/paginator-class/</feedburner:origLink></item>
  <item>
    <title>push your git tags</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/bsOgyrXo0to/</link>
    <description>&lt;p&gt;like so:&lt;/p&gt;
&lt;pre&gt;
  git push origin --tags
&lt;/pre&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/bsOgyrXo0to" height="1" width="1"/&gt;</description>
    <pubDate>Mon, 14 Jun 2010 21:57:02 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2010/06/push-your-git-tags/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2010/06/push-your-git-tags/</feedburner:origLink></item>
  <item>
    <title>hobbits in holes and chipmunks in a phonebooth</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/3zM9aTwsEQM/</link>
    <description>&lt;p&gt;When writing unit tests, for unit/quantity measurements it is important to do the right thing. The rule is that you must test against either hobbits or chipmunks, in their appropriate quantities.&lt;/p&gt;
&lt;p&gt;Also, there is such a thing as shaving yaks. I do it all day. :)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://en.wiktionary.org/wiki/yak_shaving" title="http://en.wiktionary.org/wiki/yak_shaving"&gt;http://en.wiktionary.org/wiki/yak_shaving&lt;/a&gt;&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/3zM9aTwsEQM" height="1" width="1"/&gt;</description>
    <pubDate>Fri, 21 May 2010 18:01:38 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2010/05/hobbits-in-holes-and-chipmunks-in-a-phonebooth/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2010/05/hobbits-in-holes-and-chipmunks-in-a-phonebooth/</feedburner:origLink></item>
  <item>
    <title>gitosis: how to add new repository</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/f1a-jRQrf5U/</link>
    <description>&lt;p&gt;gitosis: how to add new repository&lt;/p&gt;
&lt;p&gt;I assume that you already have your gitosis-admin repository working (this is described elsewhere).&lt;/p&gt;
&lt;p&gt;   1. cd gitosis-admin &amp;amp;&amp; git pull – enter your gitosis administrative repository and ensure it is up-to-date&lt;br /&gt;
   2. $EDITOR gitosis.conf&lt;br /&gt;
   3. add [group newreponame] section (newreponame is the name of your new repository being added); add yourself with members = yourlogin@yourhost line; also add writable = newreponame line:&lt;/p&gt;
&lt;pre&gt;
          [group newreponame]
          members = yourlogin@yourhost
          writable = newreponame
&lt;/pre&gt;&lt;p&gt;   4. based on my assumption of a correctly setup gitosis-admin repository, you should already have the appropriate public key in the keydir directory, but if not – copy your user’s ssh public key to keydir in the form of &lt;a href="mailto:yourlogin@yourhostname.pub"&gt;yourlogin@yourhostname.pub&lt;/a&gt;, then do git add keydir/yourlogin@yourhostname.pub&lt;br /&gt;
   5. git commit -am ‘new repository: newreponame’; git push;&lt;br /&gt;
   6. now that you have the new repo permissions configured, let’s actually create it. Navigate to the directory holding the files of your project (e.g. cd ~/newreponame), and do git init; git add . – this initializes empty git repository, and then adds all the files to it.&lt;br /&gt;
   7. git commit -m ‘initial commit’&lt;br /&gt;
   8. git remote add origin ssh://gitosis@yourGitosisServerName/newreponame.git&lt;br /&gt;
   9. git push ––all&lt;br /&gt;
  10. final thing: git config ––add branch.master.remote origin &amp;amp;&amp; git config ––add branch.master.merge refs/heads/master; alternatively, cd .git &amp;amp;&amp; $EDITOR config, and then add these lines:&lt;/p&gt;
&lt;pre&gt;
          [branch "master"]
          remote = origin
          merge = refs/heads/master
&lt;/pre&gt;&lt;p&gt;      Without these lines, you won’t be able to git pull.&lt;/p&gt;
&lt;p&gt;      copied from: &lt;a href="http://bogdan.org.ua/2009/02/20/gitosis-how-to-add-new-repository.html" title="http://bogdan.org.ua/2009/02/20/gitosis-how-to-add-new-repository.html"&gt;http://bogdan.org.ua/2009/02/20/gitosis-how-to-add-new-repository.html&lt;/a&gt;&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/f1a-jRQrf5U" height="1" width="1"/&gt;</description>
    <pubDate>Fri, 21 May 2010 17:41:35 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2010/05/gitosis-how-to-add-new-repository/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2010/05/gitosis-how-to-add-new-repository/</feedburner:origLink></item>
  <item>
    <title>boot rb for rails 3 on heroku</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/o-OK-g0PIH0/</link>
    <description>&lt;p&gt;copied from someone awesome at &lt;a href="http://gist.github.com/368681" title="http://gist.github.com/368681"&gt;http://gist.github.com/368681&lt;/a&gt;&lt;/p&gt;


&lt;script src="https://gist.github.com/368681.js?file=boot.rb"&gt;&lt;/script&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/o-OK-g0PIH0" height="1" width="1"/&gt;</description>
    <pubDate>Thu, 20 May 2010 07:43:55 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2010/05/boot-rb-for-rails-3-on-heroku/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2010/05/boot-rb-for-rails-3-on-heroku/</feedburner:origLink></item>
  <item>
    <title>418 means I am a teapot</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/u8-NJHs-9FE/</link>
    <description>&lt;div&gt;
&lt;p&gt;HTTP Error 418 - I&amp;#039;m a teapot&lt;/p&gt;
&lt;table border="0" cellpadding="5"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
			&lt;strong&gt;418 Status Code Explained&lt;/strong&gt;&lt;br /&gt;
&lt;p&gt;The HTCPCP server is a teapot. The responding entity may be short and stout.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;br /&gt;
			&lt;strong&gt;Why it occurs&lt;/strong&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;This code was defined as one of the traditional IETF April Fools&amp;#039; jokes, in RFC 2324, Hyper Text Coffee Pot Control Protocol, and is not expected to be implemented by actual HTTP servers. &lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;			&lt;strong&gt;Fixing 418 Error Code&lt;/strong&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;This is a type of a http error and If you are monitoring your website by 100pulse, we will intimate whenever you encounter 418 status code error through e-mail or Short message service.  &lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/u8-NJHs-9FE" height="1" width="1"/&gt;</description>
    <pubDate>Tue, 18 May 2010 22:58:42 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2010/05/418-means-i-am-a-teapot/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2010/05/418-means-i-am-a-teapot/</feedburner:origLink></item>
  <item>
    <title>use rails revision as directory for amazon S3 asset upload</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/E4wmM3In8iU/</link>
    <description>&lt;p&gt;copied from this excellent video - &lt;a href="http://www.bestechvideos.com/2009/06/26/sd-ruby-episode-63-earning-an-a-in-yslow" title="http://www.bestechvideos.com/2009/06/26/sd-ruby-episode-63-earning-an-a-in-yslow"&gt;http://www.bestechvideos.com/2009/06/26/sd-ruby-episode-63-earning-an-a-...&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Use this script to upload all your assets to S3 using REVISION to auto expire assets on a new deploy.&lt;/p&gt;

&lt;script src="https://gist.github.com/860764.js?file=amazon-s3-upload.rb"&gt;&lt;/script&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/E4wmM3In8iU" height="1" width="1"/&gt;</description>
    <pubDate>Tue, 18 May 2010 21:51:56 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2010/05/use-rails-revision-as-directory-for-amazon-s3-asset-upload/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2010/05/use-rails-revision-as-directory-for-amazon-s3-asset-upload/</feedburner:origLink></item>
  <item>
    <title>etags sample for rails app</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/5aPDjvLGeTc/</link>
    <description>&lt;pre&gt;
def show
  @article = Article.find(params[:id]) 
  
  if stale?(:etag =&gt; @article, :last_modified =&gt; @article.created_at.utc)
    @statistics = @article.really_expensive_call
    respond_to do |format|
      #etc
    end
  end
end
&lt;/pre&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/5aPDjvLGeTc" height="1" width="1"/&gt;</description>
    <pubDate>Tue, 18 May 2010 21:24:25 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2010/05/etags-sample-for-rails-app/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2010/05/etags-sample-for-rails-app/</feedburner:origLink></item>
  <item>
    <title>gzip for dummies</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/FkIsDbyMb-0/</link>
    <description>&lt;p&gt;GZIP To Compress Files:&lt;/p&gt;
&lt;p&gt;The syntax for Gzip is&lt;/p&gt;
&lt;p&gt;gzip filename&lt;br /&gt;
The resulting file will be filename.gz - notice the .gz file extension. If you were compressing a tar file for example, the resulting file would be filename.tar.gz, and so on.&lt;/p&gt;
&lt;p&gt;To achieve better compression, you can use the -9 option. (i.e. gzip -9 filename) This will take a little longer, but will result in your compressed file taking up less space.&lt;/p&gt;
&lt;p&gt;GUNZIP To Expand Files:&lt;/p&gt;
&lt;p&gt;To uncompress a file, the sister to Gzip is Gunzip. To uncompress a file, simply type&lt;/p&gt;
&lt;p&gt;gunzip filename&lt;/p&gt;
&lt;p&gt;Just like any UNIX program, full usage instructions for Gzip can be found using the man tool. Simply type man gzipat the prompt for full instructions.&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/FkIsDbyMb-0" height="1" width="1"/&gt;</description>
    <pubDate>Tue, 18 May 2010 21:13:00 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2010/05/gzip-for-dummies/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2010/05/gzip-for-dummies/</feedburner:origLink></item>
  <item>
    <title>get your git here</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/UaIu11Lbknc/</link>
    <description>&lt;p&gt;&lt;a href="http://code.google.com/p/git-osx-installer/" title="http://code.google.com/p/git-osx-installer/"&gt;http://code.google.com/p/git-osx-installer/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Run the git-1.6.4.4-intel-leopard.pkg (A basic installer. Note: You’ll need administrative privileges.)&lt;/p&gt;
&lt;p&gt;Complete the Installation&lt;/p&gt;
&lt;p&gt;Open up a terminal&lt;/p&gt;
&lt;p&gt;Change directories to the mounted image&lt;/p&gt;
&lt;p&gt;bash$ cd /Volumes/Git\ 1.6.4.4\ Intel\ Leopard/&lt;br /&gt;
bash$ ls&lt;br /&gt;
README.txt                    setup git PATH for non-terminal programs.sh&lt;br /&gt;
git-1.6.4.4-intel-leopard.pkg            uninstall.sh&lt;/p&gt;
&lt;p&gt;bash$ ./setup\ git\ PATH\ for\ non-terminal\ programs.sh&lt;/p&gt;
&lt;p&gt;Run the shell script (last line above)&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/UaIu11Lbknc" height="1" width="1"/&gt;</description>
    <pubDate>Mon, 17 May 2010 22:46:55 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2010/05/get-your-git-here/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2010/05/get-your-git-here/</feedburner:origLink></item>
  <item>
    <title>compiling mysql and getting the gem installed correctly</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/1H75czEKmW0/</link>
    <description>&lt;p&gt;Download your preferred MYSQL version from the community download site. If you’re on Snow Leopard, you may want to install the 64-bit version.&lt;/p&gt;
&lt;p&gt;Install mysql via dmg or compile it from source.&lt;/p&gt;
&lt;p&gt;Type ‘which mysql_config’ on the terminal to locate said config. Take note of this location as we’ll use it on the next step.&lt;/p&gt;
&lt;p&gt;Install the mysql gem with the command below. If the location for your mysql config is different with the one below, use that instead.&lt;/p&gt;
&lt;pre&gt;
sudo env ARCHFLAGS="-Os -arch x86_64 -fno-common" \
gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
&lt;/pre&gt;&lt;p&gt;
worked for me!&lt;/p&gt;
&lt;p&gt;thanks to &lt;a href="http://www.sylv3rblade.com/2010/04/installing-the-mysql-gem-on-os-x-10-6-snow-leopard/" title="http://www.sylv3rblade.com/2010/04/installing-the-mysql-gem-on-os-x-10-6-snow-leopard/"&gt;http://www.sylv3rblade.com/2010/04/installing-the-mysql-gem-on-os-x-10-6...&lt;/a&gt;&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/1H75czEKmW0" height="1" width="1"/&gt;</description>
    <pubDate>Mon, 17 May 2010 22:45:06 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2010/05/compiling-mysql-and-getting-the-gem-installed-correctly/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2010/05/compiling-mysql-and-getting-the-gem-installed-correctly/</feedburner:origLink></item>
  <item>
    <title>custom terminal colors</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/ZjpDywTykHk/</link>
    <description>&lt;p&gt;copied from &lt;a href="http://y-draw.com/blog/articles/2009/11/20/mac-os-x-terminal-configuration/" title="http://y-draw.com/blog/articles/2009/11/20/mac-os-x-terminal-configuration/"&gt;http://y-draw.com/blog/articles/2009/11/20/mac-os-x-terminal-configuration/&lt;/a&gt;&lt;/p&gt;
&lt;script src="https://gist.github.com/860767.js?file=bash-colors.sh"&gt;&lt;/script&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/ZjpDywTykHk" height="1" width="1"/&gt;</description>
    <pubDate>Mon, 17 May 2010 19:42:19 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2010/05/custom-terminal-colors/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2010/05/custom-terminal-colors/</feedburner:origLink></item>
  <item>
    <title>make sqlite work with snow leopard</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/ijPb5J3UeTw/</link>
    <description>&lt;script src="https://gist.github.com/860770.js?file=snow-leopard-sqlite.sh"&gt;&lt;/script&gt;&lt;p&gt;
copied from:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://support.mozilla.com/tiki-view_forum_thread.php?locale=nl&amp;amp;forumId=1&amp;amp;comments_parentId=432894" title="http://support.mozilla.com/tiki-view_forum_thread.php?locale=nl&amp;amp;forumId=1&amp;amp;comments_parentId=432894"&gt;http://support.mozilla.com/tiki-view_forum_thread.php?locale=nl&amp;amp;forumId=...&lt;/a&gt;&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/ijPb5J3UeTw" height="1" width="1"/&gt;</description>
    <pubDate>Mon, 29 Mar 2010 18:14:01 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2010/03/make-sqlite-work-with-snow-leopard/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2010/03/make-sqlite-work-with-snow-leopard/</feedburner:origLink></item>
  <item>
    <title>mac osx screenshots</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/wiqpKR4iuQg/</link>
    <description>&lt;p&gt;Taking Screenshots in Mac OS X&lt;/p&gt;
&lt;p&gt;Shortcuts&lt;/p&gt;
&lt;p&gt;    * Command-Shift-3: Take a screenshot of the screen, and save it as a file on the desktop&lt;br /&gt;
    * Command-Shift-4, then select an area: Take a screenshot of an area and save it as a file on the desktop&lt;br /&gt;
    * Command-Shift-4, then space, then click a window: Take a screenshot of a window and save it as a file on the desktop&lt;br /&gt;
    * Command-Control-Shift-3: Take a screenshot of the screen, and save it to the clipboard&lt;br /&gt;
    * Command-Control-Shift-4, then select an area: Take a screenshot of an area and save it to the clipboard&lt;br /&gt;
    * Command-Control-Shift-4, then space, then click a window: Take a screenshot of a window and save it to the clipboard &lt;/p&gt;
&lt;p&gt;In Leopard, the following keys can be held down while selecting an area (via Command-Shift-4 or Command-Control-Shift-4):&lt;/p&gt;
&lt;p&gt;    * Space, to lock the size of the selected region and instead move it when the mouse moves&lt;br /&gt;
    * Shift, to resize only one edge of the selected region&lt;br /&gt;
    * Option, to resize the selected region with its center as the anchor point&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/wiqpKR4iuQg" height="1" width="1"/&gt;</description>
    <pubDate>Thu, 18 Mar 2010 23:33:48 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2010/03/mac-osx-screenshots/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2010/03/mac-osx-screenshots/</feedburner:origLink></item>
  <item>
    <title>fun with jquery</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/ENlMb7EmjfU/</link>
    <description>&lt;script src="https://gist.github.com/860775.js?file=approval-statuses.js"&gt;&lt;/script&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/ENlMb7EmjfU" height="1" width="1"/&gt;</description>
    <pubDate>Mon, 08 Mar 2010 23:46:51 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2010/03/fun-with-jquery/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2010/03/fun-with-jquery/</feedburner:origLink></item>
  <item>
    <title>more on status codes</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/BHSWmdWTQ8c/</link>
    <description>&lt;p&gt;Status Codes&lt;/p&gt;
&lt;p&gt;Full detail: &lt;a href="http://en.wikipedia.org/wiki/List_of_HTTP_status_codes" title="http://en.wikipedia.org/wiki/List_of_HTTP_status_codes"&gt;http://en.wikipedia.org/wiki/List_of_HTTP_status_codes&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;    * 100 - Continue&lt;br /&gt;
    * 101 - Switching Protocols&lt;br /&gt;
    * 200 - OK&lt;br /&gt;
    * 201 - Created&lt;br /&gt;
    * 202 - Accepted&lt;br /&gt;
    * 203 - Non-Authoritative Information&lt;br /&gt;
    * 204 - No Content&lt;br /&gt;
    * 205 - Reset Content&lt;br /&gt;
    * 206 - Partial Content&lt;br /&gt;
    * 300 - Multiple Choices&lt;br /&gt;
    * 301 - Moved Permanently&lt;br /&gt;
    * 302 - Found&lt;br /&gt;
    * 303 - See Other&lt;br /&gt;
    * 304 - Not Modified&lt;br /&gt;
    * 305 - Use Proxy&lt;br /&gt;
    * 306 - No Longer Used&lt;br /&gt;
    * 307 - Temporary Redirect&lt;br /&gt;
    * 400 - Bad Request&lt;br /&gt;
    * 401 - Not Authorised&lt;br /&gt;
    * 402 - Payment Required&lt;br /&gt;
    * 403 - Forbidden&lt;br /&gt;
    * 404 - Not Found&lt;br /&gt;
    * 405 - Method Not Allowed&lt;br /&gt;
    * 406 - Not Acceptable&lt;br /&gt;
    * 407 - Proxy Authentication Required&lt;br /&gt;
    * 408 - Request Timeout&lt;br /&gt;
    * 409 - Conflict&lt;br /&gt;
    * 410 - Gone&lt;br /&gt;
    * 411 - Length Required&lt;br /&gt;
    * 412 - Precondition Failed&lt;br /&gt;
    * 413 - Request Entity Too Large&lt;br /&gt;
    * 414 - Request URI Too Long&lt;br /&gt;
    * 415 - Unsupported Media Type&lt;br /&gt;
    * 416 - Requested Range Not Satisfiable&lt;br /&gt;
    * 417 - Expectation Failed&lt;br /&gt;
    * 500 - Internal Server Error&lt;br /&gt;
    * 501 - Not Implemented&lt;br /&gt;
    * 502 - Bad Gateway&lt;br /&gt;
    * 503 - Service Unavailable&lt;br /&gt;
    * 504 - Gateway Timeout&lt;br /&gt;
    * 505 - HTTP Version Not Supported&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/BHSWmdWTQ8c" height="1" width="1"/&gt;</description>
    <pubDate>Thu, 04 Mar 2010 18:54:52 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2010/03/more-on-status-codes/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2010/03/more-on-status-codes/</feedburner:origLink></item>
  <item>
    <title>get your ip from rails console</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/yYTLmQNeO4s/</link>
    <description>&lt;pre&gt;
`ifconfig -m en1`.scan(/inet[\s]([\d]+\.[\d]+\.[\d]+\.[\d]+)/).flatten.first

&lt;/pre&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/yYTLmQNeO4s" height="1" width="1"/&gt;</description>
    <pubDate>Fri, 26 Feb 2010 18:13:22 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2010/02/get-your-ip-from-rails-console/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2010/02/get-your-ip-from-rails-console/</feedburner:origLink></item>
  <item>
    <title>my stacker class</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/Z51wIvgRt1U/</link>
    <description>&lt;p&gt;For anyone that uses FusionCharts, this little class may be very helpful.&lt;/p&gt;
&lt;p&gt;It is for building xml files to feed FusionCharts &amp;#039;Stacked&amp;#039; charts, and it has already saved my ass.&lt;/p&gt;

&lt;script src="https://gist.github.com/860786.js?file=stacker.rb"&gt;&lt;/script&gt;

&lt;p&gt;
The only kicker is that you need your own &amp;#039;pad_month&amp;#039; function to add a pad zero to any single digits in your day.&lt;/p&gt;
&lt;p&gt;So get rid of the Utils module and stick in this pad_month method and you should be golden.&lt;/p&gt;
&lt;pre&gt;
def pad_month(this)
  if this.to_i &amp;lt; 10
    return "0#{this}"
  else
    return "#{this}"
  end
end
&lt;/pre&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/Z51wIvgRt1U" height="1" width="1"/&gt;</description>
    <pubDate>Thu, 28 Jan 2010 23:21:52 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2010/01/my-stacker-class/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2010/01/my-stacker-class/</feedburner:origLink></item>
  <item>
    <title>my little geocoder class for Ruby on Rails</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/TvOOT2GDqXo/</link>
    <description>&lt;p&gt;works like a charm.&lt;/p&gt;
&lt;script src="https://gist.github.com/860798.js?file=geocoder.rb"&gt;&lt;/script&gt;&lt;p&gt;
and is used like this:&lt;/p&gt;
&lt;pre&gt;

ll = GetLatLong.new
ll.address=address_value
ll.city=city_value
ll.state=state_value
ll.zip=zip_value
puts ll.run
send_this[6]=ll.latitude
send_this[7]=ll.longitude

&lt;/pre&gt;&lt;p&gt;
Nice and easy.&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/TvOOT2GDqXo" height="1" width="1"/&gt;</description>
    <pubDate>Thu, 17 Dec 2009 18:20:33 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2009/12/my-little-geocoder-class-for-ruby-on-rails/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2009/12/my-little-geocoder-class-for-ruby-on-rails/</feedburner:origLink></item>
  <item>
    <title>I had to check in today</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/R6Pw-t1_iv0/</link>
    <description>&lt;p&gt;What an end of the year it has been. Highs and lows. Mostly highs, I guess. :)&lt;/p&gt;
&lt;p&gt;I have been married now for 6 months, and it feels great. I think I am more inspired than ever to create a smart, sustainable and above all creative life for myself along with my awesome partner Lavinia. I have been really digging in with Rails over the last few months. This brings me to my 3rd year straight of Ruby on Rails all the time.&lt;/p&gt;
&lt;p&gt;After a career that was at one point exclusively contract for a number of years, I have been a full-time Director of Engineering for almost 2 consecutive years and in that time I have built a best-in-class Rails app for tracking digital pre-paid card sales that has literally changed the landscape in our class of business. Now that we are almost out of beta, it is time for me to start looking for new challenges.&lt;/p&gt;
&lt;p&gt;Let&amp;#039;s hope the next few weeks find me a great new company that is either near Santa Monica or ready to let me work from home. My life is Ruby and I won&amp;#039;t disappoint!&lt;/p&gt;
&lt;p&gt;thanks&lt;/p&gt;
&lt;p&gt;krister&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/R6Pw-t1_iv0" height="1" width="1"/&gt;</description>
    <pubDate>Mon, 14 Dec 2009 19:45:43 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2009/12/i-had-to-check-in-today/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2009/12/i-had-to-check-in-today/</feedburner:origLink></item>
  <item>
    <title>copy your rsa.pub key</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/tHeQBbakFZQ/</link>
    <description>&lt;p&gt;cat .ssh/id_rsa.pub | pbcopy &lt;/p&gt;
&lt;p&gt;from ~/.&lt;/p&gt;
&lt;p&gt;I was looking for this today.&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/tHeQBbakFZQ" height="1" width="1"/&gt;</description>
    <pubDate>Mon, 30 Nov 2009 20:31:37 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2009/11/copy-your-rsa-pub-key/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2009/11/copy-your-rsa-pub-key/</feedburner:origLink></item>
  <item>
    <title>netbooks with SSD</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/bOOzObe51Rg/</link>
    <description>&lt;p&gt;zareason sells netbooks with ssd.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.zareason.com/" title="http://www.zareason.com/"&gt;http://www.zareason.com/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;sweet!&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/bOOzObe51Rg" height="1" width="1"/&gt;</description>
    <pubDate>Sun, 25 Oct 2009 18:17:45 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2009/10/netbooks-with-ssd/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2009/10/netbooks-with-ssd/</feedburner:origLink></item>
  <item>
    <title>the thundering herd and the dining philosophers</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/25XAGVY4990/</link>
    <description>&lt;p&gt;The &amp;#039;Thundering Herd&amp;#039;:&lt;/p&gt;
&lt;p&gt;The thundering herd problem occurs when a large number of processes waiting for an event are awoken when that event occurs, but only one process is able to proceed at a time. After the processes wake up, they all demand the resource and a decision must be made as to which process can continue. After the decision is made the remaining processes are put back to sleep, only to wake up again to request access to the resource.&lt;/p&gt;
&lt;p&gt;(from &lt;a href="http://en.wikipedia.org/wiki/Thundering_herd_problem" title="http://en.wikipedia.org/wiki/Thundering_herd_problem"&gt;http://en.wikipedia.org/wiki/Thundering_herd_problem&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;The &amp;#039;Dining Philosophers&amp;#039;:&lt;/p&gt;
&lt;p&gt;The dining philosophers problem is summarized as five philosophers sitting at a table doing one of two things: eating or thinking. While eating, they are not thinking, and while thinking, they are not eating. The five philosophers sit at a circular table with a large bowl of spaghetti in the center. A fork is placed in between each pair of adjacent philosophers, and as such, each philosopher has one fork to his left and one fork to his right. As spaghetti is difficult to serve and eat with a single fork, it is assumed that a philosopher must eat with two forks. Each philosopher can only use the forks on his immediate left and immediate right.&lt;/p&gt;
&lt;p&gt;(from &lt;a href="http://en.wikipedia.org/wiki/Dining_philosophers_problem" title="http://en.wikipedia.org/wiki/Dining_philosophers_problem"&gt;http://en.wikipedia.org/wiki/Dining_philosophers_problem&lt;/a&gt;)&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/25XAGVY4990" height="1" width="1"/&gt;</description>
    <pubDate>Fri, 18 Sep 2009 19:25:31 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2009/09/the-thundering-herd-and-the-dining-philosophers/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2009/09/the-thundering-herd-and-the-dining-philosophers/</feedburner:origLink></item>
  <item>
    <title>round to function for ruby float class</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/ZGuKXbx_7f4/</link>
    <description>&lt;p&gt;I found this on a blog post somewhere, and it works really well. If you need to round your decimals to precision, this is your friend. It&amp;#039;s a method extension for the standard float class in Ruby on Rails. Just save it into your lib/ folder as whatever you want, and &amp;#039;require&amp;#039; it in as needed - like so:&lt;/p&gt;
&lt;pre&gt;
  require &amp;#039;float_helper&amp;#039;
&lt;/pre&gt;&lt;p&gt;
I called it &amp;#039;float_helper.rb&amp;#039;.&lt;/p&gt;
&lt;p&gt;Behold:&lt;/p&gt;
&lt;script src="https://gist.github.com/860803.js?file=float_helper.rb"&gt;&lt;/script&gt;&lt;p&gt;
used here to great effect as a simple round to integer:&lt;/p&gt;
&lt;pre&gt;
  unaccounted_sales = x["value"].to_f.round_to(0)
&lt;/pre&gt;&lt;p&gt;
but you can specify the precision as you like.&lt;/p&gt;
&lt;p&gt;Enjoy!&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/ZGuKXbx_7f4" height="1" width="1"/&gt;</description>
    <pubDate>Thu, 17 Sep 2009 22:25:10 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2009/09/round-to-function-for-ruby-float-class/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2009/09/round-to-function-for-ruby-float-class/</feedburner:origLink></item>
  <item>
    <title>a little scraper rake task</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/vjte1u903UY/</link>
    <description>&lt;p&gt;Written for no good reason, mostly just to play with hpricot. Good times.&lt;/p&gt;
&lt;script src="https://gist.github.com/860806.js?file=scraper.rb"&gt;&lt;/script&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/vjte1u903UY" height="1" width="1"/&gt;</description>
    <pubDate>Thu, 20 Aug 2009 20:16:20 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2009/08/a-little-scraper-rake-task/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2009/08/a-little-scraper-rake-task/</feedburner:origLink></item>
  <item>
    <title>the hackingtosh</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/9CYykv0veiQ/</link>
    <description>&lt;p&gt;I am always intrigued by new slang terms, especially ones that apply to tech.&lt;/p&gt;
&lt;p&gt;Behold the new hackingtosh, linked here: &lt;a href="http://lifehacker.com/software/hack-attack/build-a-hackintosh-mac-for-under-800-321913.php" title="http://lifehacker.com/software/hack-attack/build-a-hackintosh-mac-for-under-800-321913.php"&gt;http://lifehacker.com/software/hack-attack/build-a-hackintosh-mac-for-un...&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Which is really just the concept of putting Mac OSX on a laptop that was not originally an Apple. I already have my MacBook Pro which is more or less awesome, but I do plan on picking up an Ubuntu (Linux) netbook eventually as a travel laptop, and I have my eye on this one:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://system76.com/product_info.php?cPath=28&amp;amp;products_id=92&amp;amp;osCsid=d482c4780269251459fbb9911194405a" title="http://system76.com/product_info.php?cPath=28&amp;amp;products_id=92&amp;amp;osCsid=d482c4780269251459fbb9911194405a"&gt;http://system76.com/product_info.php?cPath=28&amp;amp;products_id=92&amp;amp;osCsid=d482...&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Holy lowered price point, Batman!&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/9CYykv0veiQ" height="1" width="1"/&gt;</description>
    <pubDate>Thu, 20 Aug 2009 19:01:16 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2009/08/the-hackingtosh/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2009/08/the-hackingtosh/</feedburner:origLink></item>
  <item>
    <title>status codes 101</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/-uYwH1IizMA/</link>
    <description>&lt;p&gt;Ah, the old http status code. Very nice. I recently built my first pro-grade web service and had some problems figuring out the status codes. Here are some tips from my friend happyfrenchy2:&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;
Usually I write my rest service so that a problem with the parameters (wrong ID, not enough params, etc) returns a 400 (bad request), a auth failure (wrong signature) returns a 403 (forbidden) and an internal problem (couldn’t access DB for instance) returns a 503 (server error). Return code 500 should be when the error happens before your code was even reached (like the server or web-server is down).&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;Very helpful. This is what that looks like, in the create method of the /installs web service:&lt;/p&gt;

&lt;script src="https://gist.github.com/860812.js?file=web_service_sample.rb"&gt;&lt;/script&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/-uYwH1IizMA" height="1" width="1"/&gt;</description>
    <pubDate>Fri, 19 Jun 2009 01:47:54 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2009/06/status-codes-101/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2009/06/status-codes-101/</feedburner:origLink></item>
  <item>
    <title>sudo port command not found</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/GNPgQ9QbyWA/</link>
    <description>&lt;p&gt;sudo: port: command not found&lt;/p&gt;
&lt;p&gt;are you getting this error? Add the below to your ~/.bash_profile -&lt;/p&gt;
&lt;p&gt;export PATH=$PATH:/opt/local/bin&lt;br /&gt;
export MANPATH=$MANPATH:/opt/local/share/man&lt;br /&gt;
export INFOPATH=$INFOPATH:/opt/local/share/info&lt;/p&gt;
&lt;p&gt;and then run&lt;/p&gt;
&lt;p&gt;sudo port -d selfupdate&lt;/p&gt;
&lt;p&gt;you should be fine (for Mac Leopard 10.5)&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/GNPgQ9QbyWA" height="1" width="1"/&gt;</description>
    <pubDate>Tue, 02 Jun 2009 02:32:17 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2009/06/sudo-port-command-not-found/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2009/06/sudo-port-command-not-found/</feedburner:origLink></item>
  <item>
    <title>this worked for me</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/_5t6tqhey0A/</link>
    <description>&lt;p&gt;recursevly remove .svn files from an existing repo.&lt;/p&gt;
&lt;p&gt;If you need to take a project out of scm, you can run this bash script from the top folder - and it will remove all .svn folders recursively.&lt;/p&gt;
&lt;p&gt;Works well for&lt;br /&gt;
- changing an svn checkout into and svn export&lt;br /&gt;
- switching from svn to git&lt;/p&gt;
&lt;p&gt;find . -type d -name &amp;#039;.svn&amp;#039; -exec rm -rf {} \;&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/_5t6tqhey0A" height="1" width="1"/&gt;</description>
    <pubDate>Fri, 01 May 2009 18:56:59 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2009/05/this-worked-for-me/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2009/05/this-worked-for-me/</feedburner:origLink></item>
  <item>
    <title>tunnel of love</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/Hm_TihivB9s/</link>
    <description>&lt;p&gt;This little puppy is my tunnel of love. Connecting to SQL databases just keeps getting more complicated. :)&lt;/p&gt;
&lt;p&gt;ssh -L 8888:localhost:3306 &lt;a href="mailto:rails@staging.gmgdev.railsmachina.com"&gt;rails@staging.gmgdev.railsmachina.com&lt;/a&gt;&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/Hm_TihivB9s" height="1" width="1"/&gt;</description>
    <pubDate>Thu, 23 Apr 2009 21:43:53 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2009/04/tunnel-of-love/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2009/04/tunnel-of-love/</feedburner:origLink></item>
  <item>
    <title>good stuff on remote rsync</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/ohXxiDILIH0/</link>
    <description>&lt;p&gt;Making remote copies&lt;/p&gt;
&lt;p&gt;What if you want to copy files offsite to a remote host? No problem -- all you need to do is add the host and user information. So, for instance, if you want to copy the same directory to a remote host, you&amp;#039;d use:&lt;/p&gt;
&lt;p&gt;rsync -avhe ssh --delete /home/user/dir/ user@remote.host.com:dir/&lt;/p&gt;
&lt;p&gt;If you want to know how fast the transfer is going, and how much remains to be copied, add the --progress option:&lt;/p&gt;
&lt;p&gt;rsync --progress -avhe ssh --delete /home/user/dir/ user@remote.host.com:dir/&lt;/p&gt;
&lt;p&gt;If you don&amp;#039;t want to be prompted for a password each time rsync makes a connection -- and you don&amp;#039;t -- make sure that you have rsync set up to log in using an SSH key rather than a password. To do this, create an SSH key on the local machine using ssh-keygen -t dsa, and press Enter when prompted for a passphrase. After the key is created, use ssh-copy-id -i .ssh/id_dsa.pub &lt;a href="mailto:user@remote.host.com"&gt;user@remote.host.com&lt;/a&gt; to copy the public key to the remote host.&lt;/p&gt;
&lt;p&gt;What if you need to bring back some of the files you copied using rsync? Use the following syntax:&lt;/p&gt;
&lt;p&gt;rsync -avze ssh remote.host.com:/home/user/dir/ /local/path/&lt;/p&gt;
&lt;p&gt;The z option compresses data during the transfer. If the file you are copying exists on the local host, then rsync will just leave it alone -- the same as if you were copying files to a remote host.&lt;br /&gt;
Wrapping it up with a script&lt;/p&gt;
&lt;p&gt;Once you&amp;#039;ve figured out what directory or directories you want to sync up, and you&amp;#039;ve gotten the commands you need to sync everything, it&amp;#039;s easy to wrap it all up with a simple script. Here&amp;#039;s a short sample:&lt;/p&gt;
&lt;p&gt;rsync --progress -avze ssh --delete /home/user/bin/ user@remote.host.com:bin/&lt;br /&gt;
rsync --progress -avze ssh --delete /home/user/local/data/ user@remote.host.com:local/data/&lt;br /&gt;
rsync --progress -avze ssh --delete /home/user/.tomboy/ user@remote.host.com:/.tomboy/&lt;/p&gt;
&lt;p&gt;also remember to to use the --dry-run option with your commands&lt;/p&gt;
&lt;p&gt;** good stuff on remote rsync **&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/ohXxiDILIH0" height="1" width="1"/&gt;</description>
    <pubDate>Thu, 23 Apr 2009 01:15:58 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2009/04/good-stuff-on-remote-rsync/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2009/04/good-stuff-on-remote-rsync/</feedburner:origLink></item>
  <item>
    <title>add textmate to your Mac 10.5 path</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/Oiz3JLMQWxM/</link>
    <description>&lt;p&gt;This is the puppy that worked for me:&lt;/p&gt;
&lt;p&gt;sudo ln -s /Applications/TextMate.app/Contents/Resources/mate /bin/mate&lt;/p&gt;
&lt;p&gt;** add textmate to your Mac 10.5 path **&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/Oiz3JLMQWxM" height="1" width="1"/&gt;</description>
    <pubDate>Wed, 22 Apr 2009 18:49:02 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2009/04/add-textmate-to-your-mac-10-5-path/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2009/04/add-textmate-to-your-mac-10-5-path/</feedburner:origLink></item>
  <item>
    <title>this site rocks</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/4Agpv04tOGU/</link>
    <description>&lt;p&gt;&lt;a href="http://layouts.ironmyers.com/"&gt;http://layouts.ironmyers.com/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Awesome free css layouts? Ok!&lt;/p&gt;
&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/4Agpv04tOGU" height="1" width="1"/&gt;</description>
    <pubDate>Mon, 30 Mar 2009 10:40:05 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2009/03/this-site-rocks/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2009/03/this-site-rocks/</feedburner:origLink></item>
  <item>
    <title>i missed writing sql</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/uu0vFMmJ47E/</link>
    <description>&lt;p&gt;Here is the first stored procedure that I have written in long time, fully finished. This puppy runs like a charm.&lt;/p&gt;
&lt;script src="https://gist.github.com/860823.js?file=sp_generate_forecast.sql"&gt;&lt;/script&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/uu0vFMmJ47E" height="1" width="1"/&gt;</description>
    <pubDate>Wed, 25 Mar 2009 07:17:04 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2009/03/i-missed-writing-sql/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2009/03/i-missed-writing-sql/</feedburner:origLink></item>
  <item>
    <title>Top 5 sql query with other included</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/C2gBZtrba6E/</link>
    <description>&lt;p&gt;Top 5 sql query&lt;/p&gt;
&lt;p&gt;This week has been all about the SQL. Here is some fun I had with it. This is dynamic sql, and you are seeing the end product - this was originally built as a find_by_sql call, and of course had bind variables that you don&amp;#039;t see here - but you get the idea.&lt;/p&gt;
&lt;script src="https://gist.github.com/860832.js?file=TOP_5.sql"&gt;&lt;/script&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/C2gBZtrba6E" height="1" width="1"/&gt;</description>
    <pubDate>Fri, 20 Mar 2009 23:25:13 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2009/03/top-5-sql-query-with-other-included/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2009/03/top-5-sql-query-with-other-included/</feedburner:origLink></item>
  <item>
    <title>an old pivot table report procedure</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/XVgN5Dkbcq8/</link>
    <description>&lt;p&gt;Back in the day, I wrote reports for Rupert himself at FOX IT. Here is an old query from those days (written in T-SQL for .NET Reporting Services):&lt;/p&gt;

&lt;script src="https://gist.github.com/860840.js?file=dbo-PR_T09.sql"&gt;&lt;/script&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/XVgN5Dkbcq8" height="1" width="1"/&gt;</description>
    <pubDate>Thu, 26 Feb 2009 18:24:53 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2009/02/an-old-pivot-table-report-procedure/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2009/02/an-old-pivot-table-report-procedure/</feedburner:origLink></item>
  <item>
    <title>git ftw</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/pfUfkS-TxOY/</link>
    <description>&lt;p&gt;copied from:&lt;br /&gt;
			&lt;a href="http://www.simplisticcomplexity.com/2008/03/05/cleanly-migrate-your-subversion-repository-to-a-git-repository/" rel="bookmark" title="Permanent Link to Cleanly Migrate Your Subversion Repository To a GIT Repository"&gt;Cleanly Migrate Your Subversion Repository To a GIT Repository&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The first thing we need to do is create a &lt;em&gt;users&lt;/em&gt; file that maps all your SVN users to your GIT users. Just make a file on your Desktop named &amp;#039;users.txt&amp;#039;. Map the users using this format:&lt;/p&gt;
&lt;p&gt;jmaddox = Jon Maddox&lt;br /&gt;
bigpappa = Brian Biggs &lt;/p&gt;
&lt;p&gt;Simple. Now here are the commands you&amp;#039;ll run. I&amp;#039;ll explain them below.&lt;/p&gt;
&lt;p&gt;mkdir my_blog_tmp&lt;br /&gt;
cd my_blog_tmp&lt;br /&gt;
git-svn init &lt;a href="http://code.yoursite.net/my_blog/trunk/"&gt;http://code.yoursite.net/my_blog/trunk/&lt;/a&gt; --no-metadata&lt;br /&gt;
git config svn.authorsfile ~/Desktop/users.txt&lt;br /&gt;
git-svn fetch&lt;/p&gt;
&lt;p&gt;The first two are self explanatory, we&amp;#039;re making a new directory for the temporary repository. The second command initializes the directory as a git-svn hybrid thing and points the origin at your SVN repository. The flag, --no-metadata, tells GIT to leave all the SVN details behind (not the commit log). The fourth command tells GIT to remap all the SVN users to GIT users when it sucks down the source and history. The last command actually does the fetching.&lt;/p&gt;
&lt;p&gt;Ok, so now after a few LONG minutes, your source is all there. Do a git log to see that your users have been mapped. Sweet!&lt;/p&gt;
&lt;p&gt;Now you just have one last step. You need to clone this repository. Why do we do this? When doing a normal git clone it will take everything we want from the temporary repository, while leaving behind all the SVN cruft that was there to support the git-svn stuff.&lt;/p&gt;
&lt;p&gt;git clone my_blog_tmp my_blog&lt;/p&gt;
&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/pfUfkS-TxOY" height="1" width="1"/&gt;</description>
    <pubDate>Thu, 19 Feb 2009 23:00:18 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2009/02/git-ftw/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2009/02/git-ftw/</feedburner:origLink></item>
  <item>
    <title>gem install id3lib ruby mac command</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/sWNo0mXFf2k/</link>
    <description>&lt;p&gt;you need this to install the ruby id3lib library under mac if you installed the  actual id3lib library with MacPorts:&lt;/p&gt;
&lt;p&gt; ARCHFLAGS="-arch i386" gem install id3lib-ruby -- --build-flags --with-opt-dir=/opt/local&lt;br /&gt;
&lt;a href="http://www.digbox.net/index.php/news/gem-install-id3lib-ruby-mac-command"&gt;Original post&lt;/a&gt; blogged on &lt;a href="http://codeboxer.com"&gt;codeboxer.com&lt;/a&gt;.&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/sWNo0mXFf2k" height="1" width="1"/&gt;</description>
    <pubDate>Wed, 18 Feb 2009 01:37:32 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2009/02/gem-install-id3lib-ruby-mac-command/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2009/02/gem-install-id3lib-ruby-mac-command/</feedburner:origLink></item>
  <item>
    <title>Yetii we love it</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/zZ2S5_r1PK8/</link>
    <description>&lt;p&gt;&lt;a href="http://www.kminek.pl/lab/yetii/"&gt;http://www.kminek.pl/lab/yetii/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It rocks. No nonsense, full-featured, light, single js file. Follow the instructions. Remember to instantiate your object in the &amp;#039;view&amp;#039; file - like so:&lt;/p&gt;


&lt;script src="https://gist.github.com/860846.js?file=yetii-sample.html"&gt;&lt;/script&gt;


&lt;p&gt;where you can actually set the &amp;#039;active&amp;#039; tab. Neat!&lt;/p&gt;

&lt;p&gt;For all your html-based tab / dynamic page needs.&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/zZ2S5_r1PK8" height="1" width="1"/&gt;</description>
    <pubDate>Mon, 09 Feb 2009 23:45:12 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2009/02/yetii-we-love-it/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2009/02/yetii-we-love-it/</feedburner:origLink></item>
  <item>
    <title>Streamclip we love it</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/IThmnIeMUDU/</link>
    <description>&lt;p&gt;&lt;a href="http://en.wikipedia.org/wiki/MPEG_Streamclip"&gt;http://en.wikipedia.org/wiki/MPEG_Streamclip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I needed to rip an old live dvd from about 5 years ago with an archaic encryption and this little puppy did it - on my Intel MacBook Pro. I also had to buy the &lt;a href="http://www.apple.com/quicktime/mpeg2/"&gt;http://www.apple.com/quicktime/mpeg2/&lt;/a&gt; Quicktime encoder. Leave it to QT to fleece you every change they get. The streamclip utility works really well and will allow to you crop video - something QT would be happy to charge you another $30 for (Quicktime &amp;#039;Pro&amp;#039;). Don&amp;#039;t do it. You need the mpeg2 encoder but don&amp;#039;t buy the Quicktime Pro - it is more or less worthless.&lt;/p&gt;
&lt;p&gt;more info for streamclip - &lt;a href="http://www.squared5.com/"&gt;http://www.squared5.com/&lt;/a&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/IThmnIeMUDU" height="1" width="1"/&gt;</description>
    <pubDate>Sun, 08 Feb 2009 20:49:13 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2009/02/streamclip-we-love-it/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2009/02/streamclip-we-love-it/</feedburner:origLink></item>
  <item>
    <title>Mac vs PC oy the controversy</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/ARkWDnh3ZDU/</link>
    <description>&lt;p&gt;I stumbled across this ( &lt;a href="http://tech.yahoo.com/blogs/null/116923"&gt;http://tech.yahoo.com/blogs/null/116923&lt;/a&gt; ) story today, and as is increasingly the case, the comments are far more interesting than the article. It seems that people have very strong opinions about Microsoft and Vista. The general consensus - most people HATE Vista. I am one of those people, not so much because I know too much about it - other than it is a resource hog, is very slow, and was basically conceived of in order to sell more &amp;#039;stuff&amp;#039; - as opposed to meeting any sort of concrete need.&lt;/p&gt;
&lt;p&gt;Anyway, here it is in a nutshell - if you want user-friendly, totally reliable, works right out of the box, get a Mac. I couldn&amp;#039;t possibly use anything other than my MacBook Pro for the software development I do. Linux is a relatively close second. Windows is way behind the pack.&lt;/p&gt;
&lt;p&gt;So that&amp;#039;s my two cents - Microsoft? Mostly just a piece of sh1t.&lt;/p&gt;
&lt;p&gt;I always tell this story at work - basically a few years back I wrote reports for Fox IT and I had to install the whole .NET stack - information server (IS), the .NET platform, and then Reporting Services platform (a branch of Visual Studio). It literally took me a week. After about 6 attempted installs that went wrong for one reason or another - adding patches in wrong order, finding the right MS subscription disc for the newest RS install, wrestling the right admin privileges from the network admins, etc. A whole week.&lt;/p&gt;
&lt;p&gt;You can walk into an Apple store, buy a MacBook off the shelf, download the latest Ruby/Rails stack and be up and running by maybe right after lunch time. There is just no comparison. Of course you have to write your own reports (as there is no real reporting platform yet for Rails) but there WILL be, and for now writing reports with rails is already pretty easy.&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/ARkWDnh3ZDU" height="1" width="1"/&gt;</description>
    <pubDate>Thu, 05 Feb 2009 23:33:08 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2009/02/mac-vs-pc-oy-the-controversy/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2009/02/mac-vs-pc-oy-the-controversy/</feedburner:origLink></item>
  <item>
    <title>mysql 5.0 syntax for the UPDATE SELECT</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/axhiKJ_EH8E/</link>
    <description>&lt;p&gt;It&amp;#039;s pretty funky stuff. The trick is to alias the table you are updating.&lt;/p&gt;
&lt;script src="https://gist.github.com/860852.js?file=update_select_sample.sql"&gt;&lt;/script&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/axhiKJ_EH8E" height="1" width="1"/&gt;</description>
    <pubDate>Wed, 28 Jan 2009 20:36:25 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2009/01/mysql-5-0-syntax-for-the-update-select/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2009/01/mysql-5-0-syntax-for-the-update-select/</feedburner:origLink></item>
  <item>
    <title>minor league pivot query</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/MSOVZRaPnlo/</link>
    <description>&lt;p&gt;This would be a pivot query 101 kind of snippet. They teach this in SQL kindergarten - I only imagine, of course, because I never went. &lt;/p&gt;
&lt;p&gt;The use case: it&amp;#039;s a single table, with values grouped by partner_id and two enums for revplan_type. You need a variance report. What do you do?&lt;/p&gt;
&lt;script src="https://gist.github.com/860857.js?file=minor_league_pivot_query.sql"&gt;&lt;/script&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/MSOVZRaPnlo" height="1" width="1"/&gt;</description>
    <pubDate>Wed, 28 Jan 2009 06:33:23 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2009/01/minor-league-pivot-query/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2009/01/minor-league-pivot-query/</feedburner:origLink></item>
  <item>
    <title>how to call a stored routine from Rails</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/aU8X7yd0Vs0/</link>
    <description>&lt;p&gt;So you wanna call your own stored routine, eh?&lt;br /&gt;
Here ya go - the right syntax. I read on a blog somewhere that you send any command to the database through a .find_by_sql command, but that turned out to be a load of baloney. Is there anything Ruby + ActiveRecord can&amp;#039;t do?&lt;/p&gt;
&lt;script src="https://gist.github.com/860862.js?file=call_stored_routine.rb"&gt;&lt;/script&gt;
&lt;p&gt;Clothing, I mean transaction support is optional.&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/aU8X7yd0Vs0" height="1" width="1"/&gt;</description>
    <pubDate>Wed, 28 Jan 2009 05:43:41 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2009/01/how-to-call-a-stored-routine-from-rails/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2009/01/how-to-call-a-stored-routine-from-rails/</feedburner:origLink></item>
  <item>
    <title>MySQL 5.0 SP with Cursor Logic</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/51qKh4rPxyw/</link>
    <description>&lt;p&gt;I have written a bunch of SPs over the years (stored procedure, as I learned it, but MySQL calls them Stored Routines - SRs?). I even have my best/largest/most complicated SP ever linked here at &lt;a href='http://blog.kristeraxel.com/wp-content/uploads/2009/01/migration189.txt'&gt;migration189&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;That one was of course written in PL/SQL, and I have now officially moved out of the world of Oracle and into the world of MySQL 5.0 - which is sort of like moving from New York City to San Jose (weather notwithstanding).&lt;/p&gt;
&lt;p&gt;Anyway, I found precious little RECENT coverage on how MySQL implemented it&amp;#039;s &amp;#039;stored routines&amp;#039;, and I got to tell ya it took some digging - never mind trying to figure out how cursors work. MySQL, btw, has an ok documentation section but it is mediocre at best, somehow following in the fragmented example of the Rails community in what seems to be the curse of the open-source ADD.&lt;/p&gt;
&lt;p&gt;So in the spirit of this site which has always been to keep pieces of code lying around that I may use later - here is my very first MySQL sp, which does nothing really useful except use a cursor to insert values into a table. Come back next week for the syntax needed to use parameters, lol.&lt;/p&gt;
&lt;p&gt;Other things to notice - you have to declare a separate handler for pulling out of a cursor loop when you run out of records (does anyone else remember fondly how easy ADO recordsets were to use?) but other than that things look all right in MySQL land. Bye Oracle!&lt;/p&gt;

&lt;script src="https://gist.github.com/860870.js?file=cursor_sample.sql"&gt;&lt;/script&gt;

&lt;p&gt;ps, gotta give a shout out to &lt;a href="http://www.razorsql.com/"&gt;http://www.razorsql.com/&lt;/a&gt; which so far has been easy to use and has served as stand-in IDE for Toad, which is what I was used to.&lt;/p&gt;

UPDATE: I now use SEQUEL PRO. (MAR 2011)&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/51qKh4rPxyw" height="1" width="1"/&gt;</description>
    <pubDate>Fri, 23 Jan 2009 19:43:27 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2009/01/mysql-5-0-sp-with-cursor-logic/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2009/01/mysql-5-0-sp-with-cursor-logic/</feedburner:origLink></item>
  <item>
    <title>Perl linux and database backups</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/0znlay4y8ps/</link>
    <description>&lt;p&gt;I got to tell ya, most of the greatest people don&amp;#039;t get the recognition they deserve. Open Source is all about everyone putting in what they got. So mosey on over to &lt;a href="http://worldcommunity.com/opensource/"&gt;http://worldcommunity.com/opensource/&lt;/a&gt; and tell Peter Brown that his Perl-based mysql backup script works like a charm.&lt;/p&gt;
&lt;p&gt;It is very easy to set up, so I won&amp;#039;t go too far into it - just download and follow the instructions. I also opted in to for the ftp push, so after the script dumps out a mysql txt file for every table, it will tar it, zip it, and push it to the ftp server of your choice. Cool.&lt;/p&gt;
&lt;p&gt;This is where it gets tricky - I pulled this little gem out of a comment on Peter Brown&amp;#039;s site. This script leaves you with a directory of txt files - most of us are used to the single .sql file of the whole db, so getting at a full restore from a bunch of txt files does not sound fun - until linux jumps in for the rescue.&lt;/p&gt;
&lt;p&gt;Get this, just untar it:&lt;/p&gt;
&lt;p&gt;  tar -xf bak.mysql.2009-01-20_14.55.30_.tar.gz&lt;/p&gt;
&lt;p&gt;Move into that directory:&lt;/p&gt;
&lt;p&gt;  cd bak.mysql.2009-01-20_14.55.30&lt;/p&gt;
&lt;p&gt;and hit it with the cat xargs combo, shooting it right into mysql:&lt;/p&gt;
&lt;p&gt;  find . -name "*.txt" -print | xargs -t --replace cat {} | mysql your_db_name -u your_db_user -p -h subdir.yoursite.com&lt;/p&gt;
&lt;p&gt;and you&amp;#039;re done! sweet, huh?&lt;/p&gt;
&lt;p&gt;p.s. - the -h switch at the end (-h subdir.yoursite.com) is not always necessary, if it is localhost you can leave it out.&lt;a href="http://www.digbox.net/index.php/dba/mysql/perl-linux-and-database-backups"&gt;Original post&lt;/a&gt; blogged on &lt;a href="http://codeboxer.com"&gt;codeboxer.com&lt;/a&gt;.&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/0znlay4y8ps" height="1" width="1"/&gt;</description>
    <pubDate>Thu, 22 Jan 2009 00:52:42 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2009/01/perl-linux-and-database-backups/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2009/01/perl-linux-and-database-backups/</feedburner:origLink></item>
  <item>
    <title>right joins versus the subquery</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/aPlTrkaN9sE/</link>
    <description>&lt;p&gt;If you&amp;#039;re anything like me, you are a serious pragmatist. I like to get at the problem immediately, and if there are shortcuts, then we have to weight short-term versus long-term gain before we can choose sides.&lt;/p&gt;
&lt;p&gt;Here is a great SQL example of this principle.&lt;/p&gt;
&lt;p&gt;The old-school way to write this query would be with the subquery, like so:&lt;/p&gt;

&lt;script src="https://gist.github.com/860884.js?file=right_join_sample1.sql"&gt;&lt;/script&gt;


&lt;p&gt;I am simply trying to verify that I have not seen sales for the &amp;#039;Ralphs&amp;#039; retailer come in yet, despite that &amp;#039;merchant&amp;#039; value already being present in the retailers table.&lt;/p&gt;
&lt;p&gt;I know, it&amp;#039;s a little confusing, but bear with me.&lt;/p&gt;
&lt;p&gt;One might also write:&lt;/p&gt;

&lt;script src="https://gist.github.com/860890.js?file=right_join_sample2.sql"&gt;&lt;/script&gt;


&lt;p&gt;Neither of these run very well. Without some added indexing, the first query won&amp;#039;t return anything at all before it times out, and the second one runs ok but it is about 3 to 4 times slower than the right join (below).&lt;/p&gt;

&lt;script src="https://gist.github.com/860896.js?file=right_join_sample3.sql"&gt;&lt;/script&gt;

&lt;p&gt;There you have it - right joins FTW.&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/aPlTrkaN9sE" height="1" width="1"/&gt;</description>
    <pubDate>Thu, 15 Jan 2009 00:37:38 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2009/01/right-joins-versus-the-subquery/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2009/01/right-joins-versus-the-subquery/</feedburner:origLink></item>
  <item>
    <title>scoping for dummies</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/kwPhzHWHfpU/</link>
    <description>&lt;p&gt;I hope I don&amp;#039;t have to explain what scoping is. It is sort of analogous to the &amp;#039;parameterized&amp;#039; in &amp;#039;parameterized query&amp;#039;. Basically, once you start getting all hot and heavy with active record, you don&amp;#039;t want to have write a specific model based routine to match EVERY query use-case, so enter scoping.&lt;/p&gt;
&lt;p&gt;Here is an example:&lt;/p&gt;

&lt;script src="https://gist.github.com/860903.js?file=scoping_sample.rb"&gt;&lt;/script&gt;

&lt;p&gt;Go nuts, people! The possibilities are endless.&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/kwPhzHWHfpU" height="1" width="1"/&gt;</description>
    <pubDate>Wed, 07 Jan 2009 01:30:39 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2009/01/scoping-for-dummies/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2009/01/scoping-for-dummies/</feedburner:origLink></item>
  <item>
    <title>Sample class with a unit test</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/EWTmYDb48ds/</link>
    <description>&lt;p&gt;Also from a job interview a while back.&lt;/p&gt;
&lt;p&gt;Here is the class that they gave me, which I extended -&lt;/p&gt;
&lt;script src="https://gist.github.com/860916.js?file=ypset.rb"&gt;&lt;/script&gt;
&lt;p&gt;And the unit test I wrote for it -&lt;/p&gt;
&lt;script src="https://gist.github.com/860922.js?file=test_ypset.rb"&gt;&lt;/script&gt;
&lt;p&gt;Good times!&lt;/p&gt;

UPDATE: There is a small issue with the original class, so it does not work out of the box. There is a problem with the partition method, so feel free to fork and fix it.&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/EWTmYDb48ds" height="1" width="1"/&gt;</description>
    <pubDate>Fri, 12 Dec 2008 18:40:15 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2008/12/sample-class-with-a-unit-test/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2008/12/sample-class-with-a-unit-test/</feedburner:origLink></item>
  <item>
    <title>Do the Alexa Dance aka a review of Alexa reviews</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/uyZcFWb78hE/</link>
    <description>&lt;p&gt;I won&amp;#039;t name names, or link links as it were, but ever since I discovered my own Alexa ranking(s) I have been obsessed with understanding how to optimize them - and as a matter of course I have read quite a few blogs about it. Without succumbing to the cliche of promising &amp;#039;20 Ways to Game Your Ranking&amp;#039;, I will share what I know.&lt;/p&gt;
&lt;p&gt;The only people that matter are the users that have installed the Alexa toolbar from &lt;a href="http://www.alexa.com/site/download"&gt;http://www.alexa.com/site/download&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The traffic to your site of these users with the &lt;a href="http://www.alexa.com/site/download"&gt;toolbar&lt;/a&gt; installed over the last 3 months is what determines your rank. So at the most basic level, the logical thing to do is bump up marketing (really?) and hope that a good percentage of those new clicks are Alexa users. This may be effective, but it is also wasteful to some degree.&lt;/p&gt;
&lt;p&gt;It is also worth noting that the Alexa user base reputedly skews very much towards webmasters, so another good way to attract a stronger percentage of Alexa users relative to your total user base is to target content towards webmasters, like a laser. You zap in their clicks with post titles like &amp;#039;20 Sure Fire Tips on How to Be An Alexa Jedi&amp;#039; or &amp;#039;I Made It Into the Alexa Top 1000 - In Only 10 Minutes!&amp;#039;. Of course you also need to have real stuff for them to read, or else the Jedi jokes can get your Force cut off. Anyway, my angle is that I work with Ruby on Rails, I post about Ruby On Rails, and I am a webmaster - so there&amp;#039;s your targeted audience. &lt;/p&gt;
&lt;p&gt;That being said, I have started a new category (&lt;a href="http://www.digbox.net/index.php/alexa/" title="http://www.digbox.net/index.php/alexa/"&gt;http://www.digbox.net/index.php/alexa/&lt;/a&gt;) to track my newfound obsession. And if you are reading this and haven&amp;#039;t already installed your very own &lt;a href="http://www.alexa.com/site/download"&gt;toolbar&lt;/a&gt; then you don&amp;#039;t deserve to be reading this, and I&amp;#039;ll probably cry myself to sleep tonight. I hope you&amp;#039;re happy.&lt;/p&gt;
&lt;p&gt;Tune in next week for more observations.&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/uyZcFWb78hE" height="1" width="1"/&gt;</description>
    <pubDate>Wed, 10 Dec 2008 22:22:10 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2008/12/do-the-alexa-dance-aka-a-review-of-alexa-reviews/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2008/12/do-the-alexa-dance-aka-a-review-of-alexa-reviews/</feedburner:origLink></item>
  <item>
    <title>polymorphic user list class part II</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/loLL_STXHpg/</link>
    <description>&lt;p&gt;This is part II of a series.&lt;br /&gt;
start here: &lt;a href="http://blog.kristeraxel.com/2008/12/polymorphic-user-list-class/"&gt;http://blog.kristeraxel.com/2008/12/polymorphic-user-list-class/&lt;/a&gt;&lt;/p&gt;


&lt;script src="https://gist.github.com/860933.js?file=polymorphic_user_list2.rb"&gt;&lt;/script&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/loLL_STXHpg" height="1" width="1"/&gt;</description>
    <pubDate>Wed, 10 Dec 2008 01:41:23 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2008/12/polymorphic-user-list-class-part-ii/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2008/12/polymorphic-user-list-class-part-ii/</feedburner:origLink></item>
  <item>
    <title>add aggregates to a group by</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/egABIqLUyDQ/</link>
    <description>&lt;p&gt;Pull in YTD aggregates, along with the numbers grouped by month - good example of a self-join as well as a &amp;#039;derived table&amp;#039; which in this example is called &amp;#039;counted&amp;#039;.&lt;/p&gt;
&lt;p&gt;select s.product, count(s.serial_number) number_sold, year(s.item_date) y, month(s.item_date) m, counted.units&lt;br /&gt;
from sales s&lt;br /&gt;
join (select product, count(serial_number) units from sales group by product) counted on s.product = counted.product&lt;br /&gt;
      group by s.product, year(s.item_date), month(s.item_date)&lt;br /&gt;
      order by s.product, year(s.item_date), month(s.item_date)&lt;br /&gt;
&lt;a href="http://www.digbox.net/index.php/SQL/add-aggregates-to-a-group-by"&gt;Original post&lt;/a&gt; blogged on &lt;a href="http://codeboxer.com"&gt;codeboxer.com&lt;/a&gt;.&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/egABIqLUyDQ" height="1" width="1"/&gt;</description>
    <pubDate>Tue, 09 Dec 2008 23:02:08 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2008/12/add-aggregates-to-a-group-by/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2008/12/add-aggregates-to-a-group-by/</feedburner:origLink></item>
  <item>
    <title>Tableless models and a checkbox collection</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/tI36HyGSP4E/</link>
    <description>&lt;p&gt;I have always loved the sound of a table-less model. It feels so dirty. Here is one from the school of hard knocks, known as the Merchant model:&lt;/p&gt;
&lt;p&gt;class Merchant &amp;lt; ActiveRecord::Base&lt;br /&gt;
  def self.columns() @columns ||= []; end&lt;/p&gt;
&lt;p&gt;  def self.column(name, sql_type = nil, default = nil, null = true)&lt;br /&gt;
    columns &amp;lt;&amp;lt; ActiveRecord::ConnectionAdapters::Column.new(name.to_s, default, sql_type.to_s, null)&lt;br /&gt;
  end&lt;/p&gt;
&lt;p&gt;  column :merchant, :string&lt;br /&gt;
  validates_presence_of :merchant&lt;/p&gt;
&lt;p&gt;  def self.get_edit_values(page_id)&lt;br /&gt;
    new_arr = []&lt;br /&gt;
    Summary.find_by_sql(["&lt;br /&gt;
      SELECT merchant, CASE LENGTH(selected) &amp;gt; 0 WHEN TRUE THEN 1 ELSE 0 END value FROM&lt;br /&gt;
        (SELECT value merchant, merchant selected&lt;br /&gt;
        FROM&lt;br /&gt;
          (SELECT merchant from merchant_pages where page_id=?) signed_up&lt;br /&gt;
            RIGHT JOIN (SELECT DISTINCT MERCHANT value FROM retailers) distinct_m&lt;br /&gt;
                    ON distinct_m. value = signed_up. merchant) new_alias&lt;br /&gt;
    ORDER BY merchant&lt;br /&gt;
      ", page_id.to_i]).each do |x|&lt;br /&gt;
                    new_arr &amp;lt;&amp;lt; [x.merchant, x.value]&lt;br /&gt;
                  end&lt;br /&gt;
                  new_arr&lt;br /&gt;
  end&lt;/p&gt;
&lt;p&gt;  def self.get_values&lt;br /&gt;
    Summary.find_by_sql(["&lt;br /&gt;
      SELECT DISTINCT MERCHANT value FROM retailers order by merchant&lt;br /&gt;
      "]).each do |x|&lt;br /&gt;
      @columns &amp;lt;&amp;lt; x.value&lt;br /&gt;
    end&lt;br /&gt;
    @columns&lt;br /&gt;
  end&lt;/p&gt;
&lt;p&gt;end&lt;/p&gt;
&lt;p&gt;Of course, it does hit the database, but there is no Merchants table, per se, there is just this model. What returns from a &amp;#039;SELECT * FROM MERCHANTS&amp;#039; is the distinct selection for the value of &amp;#039;merchant&amp;#039; from the Retailers table. These come in from the partners, and they are very consistent. I can&amp;#039;t tell you how helpful this is. The system auto-magically created a Target.com that showed up immediately alongside it&amp;#039;s older bother, Target. Watch out, however, for cache-ing concerns that will necessarily stem from this approach in terms of scale - in this case, that was not a concern because we have a very small (but highly lucrative) user base.&lt;/p&gt;
&lt;p&gt;This is the corresponding controller code. This is from the pages_controller, because there is no direct merchants_controller.&lt;/p&gt;
&lt;p&gt; 	  def update&lt;br /&gt;
 	    @page = Page.find(params[:id])&lt;/p&gt;
&lt;p&gt; 	    if @page.update_attributes(params[:page])&lt;br /&gt;
 	      if dump_all_merchant_pages(@page.id)&lt;br /&gt;
 	        params[:merchants].each do |p|&lt;br /&gt;
 	          create_or_update_merchant_page(p[0].to_s, @page.id, true)&lt;br /&gt;
 	        end&lt;br /&gt;
 	      end&lt;br /&gt;
 	      flash[:notice] = &amp;#039;Page was successfully updated.&amp;#039;&lt;br /&gt;
 	      redirect_to pages_path&lt;br /&gt;
 	    else&lt;br /&gt;
 	      render :action =&amp;gt; &amp;#039;edit&amp;#039;&lt;br /&gt;
 	    end&lt;br /&gt;
 	  end&lt;/p&gt;
&lt;p&gt;the functions, from the bottom of the page:&lt;/p&gt;
&lt;p&gt; 	private&lt;br /&gt;
 	  def dump_all_merchant_pages(page_id)&lt;br /&gt;
 	    Page.find(page_id).merchant_pages.each do |x|&lt;br /&gt;
 	      x.destroy&lt;br /&gt;
 	    end&lt;br /&gt;
 	    true&lt;br /&gt;
 	  end&lt;/p&gt;
&lt;p&gt; 	  def create_or_update_merchant_page(m, p, val)&lt;br /&gt;
 	    x = MerchantPage.find_by_sql(["SELECT merchant&lt;br /&gt;
                                             FROM merchant_pages&lt;br /&gt;
                                            WHERE merchant = ?&lt;br /&gt;
                                              AND page_id = ? LIMIT 1", m, p])&lt;br /&gt;
 	    if !x.first&lt;br /&gt;
 	      x = MerchantPage.new(:merchant =&amp;gt; m, :page_id =&amp;gt; p)&lt;br /&gt;
 	      x.save&lt;br /&gt;
 	    else&lt;br /&gt;
 	      if !val&lt;br /&gt;
 	        x.destroy&lt;br /&gt;
 	      end&lt;br /&gt;
 	      true&lt;br /&gt;
 	    end&lt;br /&gt;
 	  end&lt;/p&gt;
&lt;p&gt;Finally, the _page partial:&lt;/p&gt;
&lt;p&gt;form_for ([@page]) do |f|&lt;br /&gt;
  Page Name&lt;br /&gt;
    f.text_field :title, :size =&amp;gt; 60&lt;br /&gt;
    Main Content&lt;br /&gt;
    f.text_area :page_body, :cols =&amp;gt; 100&lt;br /&gt;
    Locator Footer (Link back to Partner homepage)&lt;br /&gt;
    f.text_area :page_footer, :cols =&amp;gt; 100, :rows =&amp;gt; 5&lt;br /&gt;
  Merchants&lt;br /&gt;
  ul class="Merchant-list"&lt;br /&gt;
	  if button_name=="Save Changes"&lt;br /&gt;
	    @merchants.each do |m|&lt;br /&gt;
	        li INPUT type="checkbox" name="merchants[&amp;lt;=m[0]%&amp;gt;][]" &amp;lt;=m[1]=="1" ? "checked" : "" label m[0].to_s /label&lt;br /&gt;
	    end&lt;br /&gt;
	  else&lt;br /&gt;
	    @merchants.each do |m|&lt;br /&gt;
	      li INPUT type="checkbox" name="merchants[&amp;lt;=m&amp;gt;][]"/&amp;gt; &amp;lt;=m.to_s /label&lt;br /&gt;
	    end&lt;br /&gt;
	  end&lt;br /&gt;
    /ul&lt;br /&gt;
    f.submit button_name&lt;br /&gt;
  end&lt;a href="http://www.digbox.net/index.php/RoR/tableless-models-and-a-checkbox-collecti"&gt;Original post&lt;/a&gt; blogged on &lt;a href="http://codeboxer.com"&gt;codeboxer.com&lt;/a&gt;.&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/tI36HyGSP4E" height="1" width="1"/&gt;</description>
    <pubDate>Fri, 05 Dec 2008 01:44:01 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2008/12/tableless-models-and-a-checkbox-collection/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2008/12/tableless-models-and-a-checkbox-collection/</feedburner:origLink></item>
  <item>
    <title>The old INSERT SELECT syntax example</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/Wn6fq4YXees/</link>
    <description>&lt;p&gt;A good example of SQL&amp;#039;s favorite timesaver.&lt;/p&gt;
&lt;p&gt;INSERT INTO `evo_bloggroups`&lt;br /&gt;
SELECT &amp;#039;4&amp;#039;,&lt;br /&gt;
bloggroup_group_ID,&lt;br /&gt;
bloggroup_ismember,&lt;br /&gt;
bloggroup_perm_poststatuses,&lt;br /&gt;
bloggroup_perm_edit,&lt;br /&gt;
bloggroup_perm_delpost,&lt;br /&gt;
bloggroup_perm_comments,&lt;br /&gt;
bloggroup_perm_cats,&lt;br /&gt;
bloggroup_perm_properties,&lt;br /&gt;
bloggroup_perm_admin,&lt;br /&gt;
bloggroup_perm_media_upload,&lt;br /&gt;
bloggroup_perm_media_browse,&lt;br /&gt;
bloggroup_perm_media_change&lt;br /&gt;
FROM `evo_bloggroups`&lt;br /&gt;
WHERE bloggroup_blog_ID = 1&lt;br /&gt;
&lt;a href="http://www.digbox.net/index.php/SQL/the-old-insert-select"&gt;Original post&lt;/a&gt; blogged on &lt;a href="http://codeboxer.com"&gt;codeboxer.com&lt;/a&gt;.&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/Wn6fq4YXees" height="1" width="1"/&gt;</description>
    <pubDate>Thu, 04 Dec 2008 10:29:37 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2008/12/the-old-insert-select-syntax-example/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2008/12/the-old-insert-select-syntax-example/</feedburner:origLink></item>
  <item>
    <title>polymorphic user list class</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/mT8t7zpajlI/</link>
    <description>&lt;p&gt;I wrote this for a job interview that never panned out. Tune in next week for the matching User class (linked &lt;a href="http://blog.kristeraxel.com/2008/12/polymorphic-user-list-class-part-ii/"&gt;here&lt;/a&gt;).&lt;br /&gt;
Question: why do interviewers often admit to not being very technical, yet continue on to ask complicated questions and become bewildered as a consequence? &lt;/p&gt;
&lt;p&gt;And furthermore, how good is the guy they hire if no one knows how to talk to him? Ah well, it is almost Christmas.&lt;/p&gt;

&lt;script src="https://gist.github.com/860941.js?file=polymorphic_user_list.rb"&gt;&lt;/script&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/mT8t7zpajlI" height="1" width="1"/&gt;</description>
    <pubDate>Thu, 04 Dec 2008 10:15:08 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2008/12/polymorphic-user-list-class/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2008/12/polymorphic-user-list-class/</feedburner:origLink></item>
  <item>
    <title>Ruby find_by_sql and a select statement</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/feSvJ8de5tA/</link>
    <description>&lt;p&gt;This is how I still do things. I don&amp;#039;t think it&amp;#039;s terribly old-fashioned. Databases are still faster than web servers, aren&amp;#039;t they?&lt;/p&gt;
&lt;p&gt;  Summary.find_by_sql(["&lt;br /&gt;
    (select &amp;#039;GMG&amp;#039; name, 0 id, 1 orderby&lt;br /&gt;
       from partners where 1=1)&lt;br /&gt;
      union&lt;br /&gt;
    (select display_val name, p.id, 2 orderby&lt;br /&gt;
       from partners p where active = 1)&lt;br /&gt;
   order by orderby, name, id"&lt;br /&gt;
          ])&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.digbox.net/index.php/SQL/ruby-find_by_sql-and-a-select-statement"&gt;Original post&lt;/a&gt; blogged on &lt;a href="http://codeboxer.com"&gt;codeboxer.com&lt;/a&gt;.&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/feSvJ8de5tA" height="1" width="1"/&gt;</description>
    <pubDate>Thu, 04 Dec 2008 10:05:03 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2008/12/ruby-find_by_sql-and-a-select-statement/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2008/12/ruby-find_by_sql-and-a-select-statement/</feedburner:origLink></item>
  <item>
    <title>DREAMHOST Worst host evar</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/I2_Y1ThpBGg/</link>
    <description>&lt;p&gt;Dreamhost is also pretty crappy, if you need Ruby on Rails support. Why does everyone advertise RoR and then not support it?&lt;/p&gt;
&lt;p&gt;It looks like a decent Hostmonster style host, with a snazzy interface, but at the end of it here were the problems:&lt;/p&gt;
&lt;p&gt;Terrible SVN support; let me say that again - SVN kind of sucks already, but I ended up with a bunch of 500 errors, and I don&amp;#039;t need anyone to help SVN suck more than it already does.&lt;/p&gt;
&lt;p&gt;SOME good wiki stuff, but it was out of date, was NOT supported (see above), so I got frustratingly 80% close to a real capistrano deploy and then could not finish because were server compatibility issues (an old Ruby version) and without direct shell access I was fecocked. Then my SVN got corrupted. Fun!&lt;/p&gt;
&lt;p&gt;With Dreamhost, if you aren&amp;#039;t paying for a hosting service, you can&amp;#039;t even manage your domain forwarding.&lt;/p&gt;
&lt;p&gt;So I am still on the lookout for a good Ruby host and I am not any closer.&lt;/p&gt;
&lt;p&gt;As a recap - DREAMHOST is the worst Ruby on Rails hosting service EVER! They are, of course, right there next to Joyent, who also has a large home in Crapistan.&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/I2_Y1ThpBGg" height="1" width="1"/&gt;</description>
    <pubDate>Wed, 03 Dec 2008 11:24:05 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2008/12/dreamhost-worst-host-evar/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2008/12/dreamhost-worst-host-evar/</feedburner:origLink></item>
  <item>
    <title>JOYENT IS THE WORST</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/frbW6QImMEc/</link>
    <description>&lt;p&gt;CONTRARY TO ANYTHING I HAVE SAID PREVIOUSLY, Joyent offers some of the worst customer service around. JOYENT has no idea what is going on. They don&amp;#039;t even read the support tickets, their documentation is old and useless. They are a dinosaur.&lt;br /&gt;
I imagine their clients are all catching on right now and starting to jump off of that sinking ship. I pulled my last account off of this horrible Rails hosting service this year, I will NEVER go back.&lt;/p&gt;
&lt;p&gt;I hate bad service. Bad value, too.&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/frbW6QImMEc" height="1" width="1"/&gt;</description>
    <pubDate>Wed, 03 Dec 2008 05:16:35 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2008/12/joyent-is-the-worst/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2008/12/joyent-is-the-worst/</feedburner:origLink></item>
  <item>
    <title>asynchronous javascript FTW</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/C60-7lGnkWc/</link>
    <description>&lt;p&gt;link_to_remote(name, options = {}, html_options = {})&lt;/p&gt;
&lt;p&gt;Returns a link to a remote action defined by options[:url] (using the url_for format) that&amp;#039;s called in the background using XMLHttpRequest. The result of that request can then be inserted into a DOM object whose id can be specified with options[:update]. Usually, the result would be a partial prepared by the controller with either render_partial or render_partial_collection.&lt;/p&gt;
&lt;p&gt;Examples:&lt;/p&gt;
&lt;p&gt;link_to_remote "Delete this post", :update =&amp;gt; "posts", :url =&amp;gt; { :action =&amp;gt; "destroy", :id =&amp;gt; post.id }&lt;br /&gt;
link_to_remote(image_tag("refresh"), :update =&amp;gt; "emails", :url =&amp;gt; { :action =&amp;gt; "list_emails" })&lt;br /&gt;
You can also specify a hash for options[:update] to allow for easy redirection of output to an other DOM element if a server-side error occurs:&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;p&gt;  link_to_remote "Delete this post",&lt;br /&gt;
     :url =&amp;gt; { :action =&amp;gt; "destroy", :id =&amp;gt; post.id },&lt;br /&gt;
     :update =&amp;gt; { :success =&amp;gt; "posts", :failure =&amp;gt; "error" }&lt;/p&gt;
&lt;p&gt;Optionally, you can use the options[: position] parameter to influence how the target DOM element is updated. It must be one of :before, :top, :bottom, or :after.&lt;/p&gt;
&lt;p&gt;By default, these remote requests are processed asynchronously during which various JavaScript callbacks can be triggered (for progress indicators and the likes). All callbacks get access to the request object, which holds the underlying XMLHttpRequest.&lt;/p&gt;
&lt;p&gt;To access the server response, use request.responseText, to find out the HTTP status, use request.status.&lt;/p&gt;
&lt;p&gt;Example:&lt;br /&gt;
  link_to_remote word,&lt;br /&gt;
      :url =&amp;gt; { :action =&amp;gt; "undo", :n =&amp;gt; word_counter },&lt;br /&gt;
      :complete =&amp;gt; "undoRequestCompleted(request)"&lt;/p&gt;
&lt;p&gt;The callbacks that may be specified are (in order):&lt;br /&gt;
:loading:	Called when the remote document is being loaded with data by the browser.&lt;br /&gt;
:loaded:	Called when the browser has finished loading the remote document.&lt;br /&gt;
:interactive:	Called when the user can interact with the remote document, even though it has not finished loading.&lt;br /&gt;
:success:	Called when the XMLHttpRequest is completed, and the HTTP status code is in the 2XX range.&lt;br /&gt;
:failure:	Called when the XMLHttpRequest is completed, and the HTTP status code is not in the 2XX range.&lt;br /&gt;
:complete:	Called when the XMLHttpRequest is complete (fires after success/failure if they are present).&lt;/p&gt;
&lt;p&gt;You can further refine :success and :failure by adding additional callbacks for specific status codes:&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;p&gt;  link_to_remote word,&lt;br /&gt;
      :url =&amp;gt; { :action =&amp;gt; "action" },&lt;br /&gt;
      404 =&amp;gt; "alert(&amp;#039;Not found...? Wrong URL...?&amp;#039;)",&lt;br /&gt;
      :failure =&amp;gt; "alert(&amp;#039;HTTP Error &amp;#039; + request.status + &amp;#039;!&amp;#039;)"&lt;/p&gt;
&lt;p&gt;A status code callback overrides the success/failure handlers if present.&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/C60-7lGnkWc" height="1" width="1"/&gt;</description>
    <pubDate>Tue, 18 Nov 2008 10:54:39 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2008/11/asynchronous-javascript-ftw/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2008/11/asynchronous-javascript-ftw/</feedburner:origLink></item>
  <item>
    <title>Lighthouse API integration in 10 minutes or less</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/lYrppLssL6Q/</link>
    <description>&lt;p&gt;As a second part in this series, I am going to talk about Lighthouse for a second. They rock. I built up a calendar app based on their API and the Ruby  &lt;a href="http://digbox.net/index.php/2008/11/15/ruby_calendar_helper_for_dummies"&gt;calendar_helper&lt;/a&gt;, and it barely took me a day. True story. I ended up using an API token, and I learned a lot about a lib/ based connection object, very interesting.&lt;/p&gt;
&lt;p&gt;Here are a few caveats:&lt;br /&gt;
Don&amp;#039;t mess with the root class too much. It was not really necessary for most of what I had to do. This is actually one of the cases where it makes sense to load the logic into the controller (a little bit). Plus there isn&amp;#039;t much more meat on the bone, so to speak, the root class covers 100% of a ludicrously simple back-end.&lt;br /&gt;
All Lighthouse database objects are not created equal. Tickets are king, and everything else is nothing. I will explain more later - just don&amp;#039;t try to get picky with your call for Milestones. All I have ever been able to do is return a simple dump.&lt;/p&gt;
&lt;p&gt;Installation: all I had to do was click through to the &lt;a href="http://github.com/Caged/lighthouse-api/tree/master"&gt;GIT repository&lt;/a&gt;. From there click lib/, and then lighthouse.rb. Cut and paste the code you see into a lighthouse.rb file in your lib/ folder. Everything you need is right there.&lt;/p&gt;
&lt;p&gt;code snippet from my controller action:&lt;/p&gt;
&lt;p&gt;    if @project&lt;br /&gt;
      #calculate i differential&lt;br /&gt;
      month_now = Time.now.month&lt;br /&gt;
      year_now = Time.now.year&lt;br /&gt;
      i = ((@year - year_now)*12)+ (@month - month_now).abs&lt;br /&gt;
      if i == 1&lt;br /&gt;
        @tickets = @project.tickets(:q =&amp;gt; "created:&amp;#039;before #{Time.now.day} day#{Time.now.day&amp;gt;1 ? &amp;#039;s&amp;#039; : &amp;#039;&amp;#039;} ago&amp;#039;")&lt;br /&gt;
      elsif i &amp;gt; 1&lt;br /&gt;
        @tickets = @project.tickets(:q =&amp;gt; "created:&amp;#039;before #{i-1} months ago&amp;#039;")&lt;br /&gt;
      else&lt;br /&gt;
        @tickets = @project.tickets(:q =&amp;gt; "created:&amp;#039;since 1 month ago&amp;#039;")&lt;br /&gt;
      end&lt;br /&gt;
      @milestones = @project.milestones(:q =&amp;gt; "due_on:&amp;#039;#{@month}/#{@year}&amp;#039;")&lt;br /&gt;
    else&lt;br /&gt;
      false&lt;br /&gt;
    end&lt;/p&gt;
&lt;p&gt;Thankfully, you can get picky with your call for Tickets. That is where the meat of the API is. The text based date searching is pretty cool, because you get a hard limit of 30 rows returned from your query, so you need to be granular enough to catch only what you want.&lt;/p&gt;
&lt;p&gt;This is a remote controller action that I use to get info about a particular ticket:&lt;/p&gt;
&lt;p&gt;  def ticket_body&lt;br /&gt;
    ticket_id = params[:id]&lt;br /&gt;
    @project = Lighthouse::Project.find(:first)&lt;br /&gt;
    ticket = Lighthouse::Ticket.find ticket_id, :params =&amp;gt; {:project_id =&amp;gt; @project.id}&lt;br /&gt;
    out_string = ""&lt;br /&gt;
    #counter = 0&lt;br /&gt;
    ticket.versions.each do |version|&lt;br /&gt;
      this_body = version.body_html&lt;br /&gt;
      out_string &amp;lt;&amp;lt; "on #{(version.created_at - (60 * 60 * 8)).strftime("%m/%d at %I:%M%p")} #{get_owner_name(version.user_id)} said: #{this_body ? this_body : "status change"}"&lt;br /&gt;
    end&lt;br /&gt;
    render :text =&amp;gt; out_string&lt;br /&gt;
  end&lt;/p&gt;
&lt;p&gt;Notice the 8 hour time differential from UTC code, and that you have to iterate through the ticket.versions to pull out the notes (thanks to Lighthouse help staff for that one).&lt;/p&gt;
&lt;p&gt;And then, of course, I have this at the top of my controller:&lt;/p&gt;
&lt;p&gt;  def initialize&lt;br /&gt;
    Lighthouse.account = &amp;#039;xxx&amp;#039;&lt;br /&gt;
    Lighthouse.token = &amp;#039;1111919192384584XXXXXXXXXXX&amp;#039;&lt;br /&gt;
    @project = Lighthouse::Project.find(:first)&lt;br /&gt;
  end&lt;/p&gt;
&lt;p&gt;like I said before, somehow the @project.milestones method won&amp;#039;t take a :q argument, so you&amp;#039;re stuck with just a simple &amp;#039;select *&amp;#039; query for your @milestones recordset. Maybe they will change this soon.&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/lYrppLssL6Q" height="1" width="1"/&gt;</description>
    <pubDate>Sat, 15 Nov 2008 10:45:06 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2008/11/lighthouse-api-integration-in-10-minutes-or-less/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2008/11/lighthouse-api-integration-in-10-minutes-or-less/</feedburner:origLink></item>
  <item>
    <title>Ruby export to excel walkthrough</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/GfibGg5PfZQ/</link>
    <description>&lt;p&gt;Just write the headers, pull up the xml by report_id, and slurp it out. Piece of cake.&lt;/p&gt;
&lt;p&gt;    def export&lt;br /&gt;
      headers[&amp;#039;Content-Type&amp;#039;] = "application/vnd.ms-excel"&lt;br /&gt;
      headers[&amp;#039;Content-Disposition&amp;#039;] = "attachment; filename=&amp;#039;report.xls&amp;#039;"&lt;br /&gt;
      headers[&amp;#039;Cache-Control&amp;#039;] = &amp;#039;&amp;#039;&lt;br /&gt;
      s = UserReport.find(params[:report_id])&lt;br /&gt;
      col2 = s.col2&lt;br /&gt;
      @records = XmlSimple.xml_in(s.xml_val)&lt;br /&gt;
      movedir = "public/delivery/"&lt;br /&gt;
      x_axis = "Timeline"&lt;br /&gt;
      y_axis = @records["yAxisName"] ? @records["yAxisName"] : "$$$"&lt;br /&gt;
      f_name = s.file_name&lt;br /&gt;
      File.open(f_name, &amp;#039;w&amp;#039;) do |f|&lt;br /&gt;
        if current_user.is_test?&lt;br /&gt;
          f.puts "Test Data"&lt;br /&gt;
        else&lt;br /&gt;
          f.puts "#{s.caption}"&lt;br /&gt;
        end&lt;br /&gt;
        f.puts "#{s.date_range}"&lt;br /&gt;
        if s.sub_caption then f.puts "#{s.sub_caption}" end&lt;br /&gt;
        f.puts "#{s.col1}#{s.col2}"&lt;br /&gt;
        @records["set"].each do |x|&lt;br /&gt;
          f.puts "#{clean_col(x["label"])}#{parse_report_value(x["value"], col2)}"&lt;br /&gt;
        end&lt;br /&gt;
        f.puts "#{s.filter_info}"&lt;br /&gt;
        f.puts ""&lt;br /&gt;
        f.puts ""&lt;br /&gt;
      end&lt;br /&gt;
      small_export ="delivery/#{f_name}"&lt;br /&gt;
      export_link = "#{movedir}/#{f_name}"&lt;br /&gt;
      FileUtils.mkpath(movedir)&lt;br /&gt;
      FileUtils.mv f_name, export_link&lt;br /&gt;
      small_export&lt;br /&gt;
    end&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/GfibGg5PfZQ" height="1" width="1"/&gt;</description>
    <pubDate>Wed, 29 Oct 2008 09:42:59 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2008/10/ruby-export-to-excel-walkthrough/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2008/10/ruby-export-to-excel-walkthrough/</feedburner:origLink></item>
  <item>
    <title>Rails Playground a short review</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/H4e5ohNPVs4/</link>
    <description>&lt;p&gt;This will be quick. I just had to put in a few words about Rails Playground.&lt;/p&gt;
&lt;p&gt;A little background: I have been hosting my sites with Joyent up until now, and this last week I was just having some serious mongrel problems, and it started not being fun. I started looking for alternatives, and I found Rails Playground (RP) and it has a pretty cool angle.&lt;/p&gt;
&lt;p&gt;Joyent is ok, but their whole thing is that they are empowering you to do everything yourself. They are just giving you a sandbox, basically, which is great unless you start having problems that you don&amp;#039;t know how to fix yourself. Then you have to wait for their relatively slow customer service.&lt;/p&gt;
&lt;p&gt;RP, on the other hand, will give you unlimited, much faster service for comparable rates and they will set a lot of it up for you. I gave them my svn info, paid the bill, and they set me up with capistrano, added the capistano files to my svn account, set up the proxy, and configured mod_rails to run with passenger.&lt;br /&gt;
Done!&lt;/p&gt;
&lt;p&gt;I have never had a deployment go so easily.&lt;/p&gt;
&lt;p&gt;Anyway that&amp;#039;s my 2 cents.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://railsplayground.com"&gt;link to their site&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Disclosure: I am not benefiting from this review at all. I asked them for a deal and they turned me down!&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/H4e5ohNPVs4" height="1" width="1"/&gt;</description>
    <pubDate>Tue, 29 Jul 2008 08:06:10 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2008/07/rails-playground-a-short-review/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2008/07/rails-playground-a-short-review/</feedburner:origLink></item>
  <item>
    <title>MySQL 5.0 Table Record Count By Month Pivot Query</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/LGQaDUXCuD4/</link>
    <description>&lt;p&gt;So there I was, hanging out at work on my birthday. I had a little time, so I decided to answer some Ruby forum questions (&lt;a href="http://railsforum.com/" title="http://railsforum.com/"&gt;http://railsforum.com/&lt;/a&gt;). I went through a few on them, and ended up writing a pivot query for someone, out of nostalgia for my last job where I did a lot more straight SQL programming - not like I miss it too much, but it felt good. Anyway, only once I was done did it occur to me that I could use this same query for a lot of things. It&amp;#039;s a very multi-purpose pivot query - it pivots record counts on a single table by month, so one really fast query returns all of the record counts by month of whatever table you are curious about. The original guy on the forum needed it to turn menu buttons on and off according to whether there were records in the table for a given month (as in blog records).&lt;br /&gt;
I recommend setting it up as a parameterized view with a single year parameter, because it won&amp;#039;t distinguish by year otherwise. Map your parameter to where it says &amp;#039;2008&amp;#039; and you will be home free.&lt;/p&gt;
&lt;p&gt;Instructions:&lt;br /&gt;
1 - replace YOURTABLE with your table name.&lt;br /&gt;
2 - replace all instances of &amp;#039;created_at&amp;#039; with a different (date) field name only if you want to use a different field to aggregate by. It will work fine as is with &amp;#039;created_at&amp;#039; because most Ruby tables have this field by default.&lt;br /&gt;
&lt;/p&gt;

&lt;script src="https://gist.github.com/860968.js?file=by_month_pivot.sql"&gt;&lt;/script&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/LGQaDUXCuD4" height="1" width="1"/&gt;</description>
    <pubDate>Thu, 15 May 2008 07:44:59 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2008/05/mysql-5-0-table-record-count-by-month-pivot-query/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2008/05/mysql-5-0-table-record-count-by-month-pivot-query/</feedburner:origLink></item>
  <item>
    <title>a little periodic love</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/1c0jpVuozM8/</link>
    <description>&lt;p&gt;Although I didn&amp;#039;t actually end up using it, this little snippet did work like a charm.&lt;/p&gt;
&lt;p&gt;&amp;lt;%= periodically_call_remote(:update =&amp;gt; "preview",:frequency =&amp;gt; 3, :url =&amp;gt; {:controller =&amp;gt; &amp;#039;resource&amp;#039;, :action =&amp;gt; &amp;#039;highlights&amp;#039;, :id =&amp;gt; @facebook_id }) %&amp;gt;&lt;/p&gt;
&lt;p&gt;Just put it in a view somewhere, and it will call your remote function and update whatever you want at a given interval.&lt;/p&gt;
&lt;p&gt;Sweet.&lt;a href="http://www.digbox.net/index.php/RoR/a-little-periodic-love"&gt;Original post&lt;/a&gt; blogged on &lt;a href="http://codeboxer.com"&gt;codeboxer.com&lt;/a&gt;.&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/1c0jpVuozM8" height="1" width="1"/&gt;</description>
    <pubDate>Thu, 03 Apr 2008 07:18:32 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2008/04/a-little-periodic-love/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2008/04/a-little-periodic-love/</feedburner:origLink></item>
  <item>
    <title>Ruby snippet for a .collect call instead of .each</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/q_Eitxy3ygY/</link>
    <description>&lt;p&gt;This works great. This is the best replacement for a &amp;#039;For&amp;#039; loop or one of those .each calls. This dumps out a &amp;#039;br&amp;#039; separated list of links for all the sub-industries in each category. I set up the model call to return a recordset, tie it to @tv_sub in the controller, and this is all it takes to get those links set up in the view:&lt;/p&gt;
&lt;p&gt;&amp;lt;% if @tv_sub -%&amp;gt;&lt;br /&gt;
  &amp;lt;%= @tv_sub.collect{|si|&lt;br /&gt;
      link_to (si.name, url_for(:action =&amp;gt; &amp;#039;browse&amp;#039;, :category =&amp;gt; &amp;#039;tv&amp;#039;, :sub_industry=&amp;gt;si.name))&lt;br /&gt;
	              }.join(&amp;#039;&amp;#039;)&lt;br /&gt;
	      -%&amp;gt;&lt;br /&gt;
&amp;lt;% end -%&amp;gt;&lt;/p&gt;
&lt;p&gt;And this is the model call:&lt;/p&gt;
&lt;p&gt;def self.find_sub_tv&lt;br /&gt;
  SubIndustry.find(:all, :order=&amp;gt;&amp;#039;name&amp;#039;, :conditions =&amp;gt; ["industry_id = ?", TV_ID])&lt;br /&gt;
end&lt;br /&gt;
&lt;a href="http://www.digbox.net/index.php/RoR/ruby-snippet"&gt;Original post&lt;/a&gt; blogged on &lt;a href="http://codeboxer.com"&gt;codeboxer.com&lt;/a&gt;.&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/q_Eitxy3ygY" height="1" width="1"/&gt;</description>
    <pubDate>Thu, 27 Mar 2008 07:14:09 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2008/03/ruby-snippet-for-a-collect-call-instead-of-each/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2008/03/ruby-snippet-for-a-collect-call-instead-of-each/</feedburner:origLink></item>
  <item>
    <title>A Ruby Rake Task</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/IFDILylcSkc/</link>
    <description>&lt;p&gt;namespace :db do&lt;br /&gt;
  desc "Loads a schema.rb file into the database and then loads the initial database fixtures."&lt;br /&gt;
  task :bootstrap =&amp;gt; [&amp;#039;db:schema:load&amp;#039;, &amp;#039;db:bootstrap:import&amp;#039;]&lt;/p&gt;
&lt;p&gt;  # bootstrap namespace based on Rick Olson&amp;#039;s bootstrap rake task.&lt;br /&gt;
  namespace :bootstrap do&lt;br /&gt;
    desc "Load database fixtures (in db/fixtures//*.{yml,csv}) into the current environment&amp;#039;s database.  Load specific folder using FOLDER=db/foo. Load specific fixtures using FIXTURES=x,y"&lt;br /&gt;
    task :import =&amp;gt; :environment do&lt;br /&gt;
      require &amp;#039;active_record/fixtures&amp;#039;&lt;br /&gt;
      #require &amp;#039;fastercsv&amp;#039;&lt;/p&gt;
&lt;p&gt;      import_folder = ENV[&amp;#039;FOLDER&amp;#039;] || "db/fixtures/#{RAILS_ENV}/"&lt;br /&gt;
      import_folder += &amp;#039;/&amp;#039; unless import_folder.slice(-1..-1).eql?(&amp;#039;/&amp;#039;)&lt;/p&gt;
&lt;p&gt;      rake_start_time = Time.now&lt;br /&gt;
      file_count = 0&lt;br /&gt;
      ActiveRecord::Base.establish_connection(RAILS_ENV.to_sym)&lt;br /&gt;
      (ENV[&amp;#039;FIXTURES&amp;#039;] ? ENV[&amp;#039;FIXTURES&amp;#039;].split(/,/) : Dir.glob(File.join(RAILS_ROOT,import_folder, &amp;#039;*.{yml,csv}&amp;#039;))).each do |fixture_file|&lt;br /&gt;
        table_start_time = Time.now&lt;br /&gt;
        puts "Loading #{fixture_file}"&lt;br /&gt;
        Fixtures.create_fixtures(import_folder, File.basename(fixture_file, &amp;#039;.*&amp;#039;))&lt;br /&gt;
        table_end_time = Time.now&lt;br /&gt;
        puts "   -&amp;gt; #{(table_end_time - table_start_time).to_s}s"&lt;br /&gt;
        file_count += 1&lt;br /&gt;
      end&lt;/p&gt;
&lt;p&gt;      rake_end_time = Time.now&lt;br /&gt;
      puts "-- total files: #{file_count}"&lt;br /&gt;
      puts "   -&amp;gt; #{(rake_end_time - rake_start_time).to_s}s"&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;/p&gt;
&lt;p&gt;  desc "Run cron tasks."&lt;br /&gt;
  task :scheduling =&amp;gt; [&amp;#039;db:scheduling:daily&amp;#039;, &amp;#039;db:scheduling:hourly&amp;#039; ]&lt;/p&gt;
&lt;p&gt;  namespace :scheduling do&lt;br /&gt;
    desc "Daily cron run."&lt;br /&gt;
    task :daily =&amp;gt; :environment do&lt;br /&gt;
      for a in Actor.find(:all)&lt;br /&gt;
        #calc savings - if logged in over last 3 weeks&lt;br /&gt;
          puts a.name&lt;br /&gt;
          expires_on = (a.updated_at + 21)&lt;br /&gt;
        if expires_on &amp;gt;=  Time.now.to_date&lt;br /&gt;
          message1 = a.calc_savings!&lt;br /&gt;
          if message1 == ""&lt;br /&gt;
            puts "No savings."&lt;br /&gt;
          else&lt;br /&gt;
            puts message1&lt;br /&gt;
            a.log &amp;lt;&amp;lt; message1&lt;br /&gt;
            a.save&lt;br /&gt;
          end&lt;br /&gt;
          u = User.find_by_id(a.user_id)&lt;br /&gt;
          s = State.find_by_user_id(u.id)&lt;br /&gt;
          s.reset_enthuse!&lt;br /&gt;
          s.save&lt;br /&gt;
        else&lt;br /&gt;
          puts "hasn&amp;#039;t been around."&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    desc "Hourly cron run."&lt;br /&gt;
    task :hourly =&amp;gt; :environment do&lt;br /&gt;
      #increment enthusiasm&lt;br /&gt;
      #pay wages if recently logged in - within last 1 hour&lt;br /&gt;
      for a in Actor.find(:all)&lt;br /&gt;
          puts a.name&lt;br /&gt;
          expires_on = (a.updated_at + 1.day)&lt;br /&gt;
        if DateTime.now &amp;lt;= expires_on&lt;br /&gt;
          #other logic - last_pay_date + consecutive_work_hours&lt;br /&gt;
            if a.consecutive_work_hours &amp;lt; 8&lt;br /&gt;
              #calc wages&lt;br /&gt;
              message2 = a.calc_wages!&lt;br /&gt;
              if message2 == ""&lt;br /&gt;
                puts "No wages."&lt;br /&gt;
              else&lt;br /&gt;
                puts message2&lt;br /&gt;
                a.log &amp;lt;&amp;lt; message2&lt;br /&gt;
                a.save&lt;br /&gt;
              end&lt;br /&gt;
            end&lt;br /&gt;
        else&lt;br /&gt;
          #look for shelter&lt;br /&gt;
          if a.has_box &amp;gt; 0&lt;br /&gt;
            s = State.find_by_user_id(u.id)&lt;br /&gt;
            s.take_shelter!&lt;br /&gt;
            a.log &amp;lt;&amp;lt; "#{a.name} takes refuge in a shantie. "&lt;br /&gt;
          else&lt;br /&gt;
            puts "No shantie."&lt;br /&gt;
          end&lt;br /&gt;
          a.consecutive_work_hours = 0&lt;br /&gt;
          a.save&lt;br /&gt;
          puts "hasn&amp;#039;t been around."&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
end&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.digbox.net/index.php/RoR/a-ruby-rake-task"&gt;Original post&lt;/a&gt; blogged on &lt;a href="http://codeboxer.com"&gt;codeboxer.com&lt;/a&gt;.&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/IFDILylcSkc" height="1" width="1"/&gt;</description>
    <pubDate>Tue, 04 Mar 2008 08:00:37 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2008/03/a-ruby-rake-task/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2008/03/a-ruby-rake-task/</feedburner:origLink></item>
  <item>
    <title>A Ruby controller</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/YD8hhx6K8NQ/</link>
    <description>&lt;p&gt;class GameController &amp;lt; ApplicationController&lt;br /&gt;
  scaffold :state&lt;br /&gt;
  before_filter :validate, :except =&amp;gt; :create&lt;/p&gt;
&lt;p&gt;  def validate&lt;br /&gt;
    @state = State.find_by_user_id(current_user.id)&lt;br /&gt;
    if @state == nil&lt;br /&gt;
      if logged_in?&lt;br /&gt;
        flash[:notice] = "Please set up your Rockstar."&lt;br /&gt;
        redirect_to(:controller =&amp;gt; &amp;#039;/actor&amp;#039;, :action =&amp;gt; &amp;#039;create&amp;#039;)&lt;br /&gt;
      else&lt;br /&gt;
        flash[:notice] = "Please Log In."&lt;br /&gt;
        redirect_to(:controller =&amp;gt; &amp;#039;home&amp;#039;)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;/p&gt;
&lt;p&gt;  def create&lt;br /&gt;
    #find previous game&lt;br /&gt;
    @state = State.new&lt;br /&gt;
    @state.user_id = current_user.id&lt;br /&gt;
    @state.save&lt;br /&gt;
    redirect_to(:action =&amp;gt; &amp;#039;play&amp;#039;)&lt;br /&gt;
  end&lt;/p&gt;
&lt;p&gt;  def return&lt;br /&gt;
    session[:override] = "Welcome back."&lt;br /&gt;
    redirect_to(:action =&amp;gt; &amp;#039;play&amp;#039;)&lt;br /&gt;
  end&lt;/p&gt;
&lt;p&gt;  def list&lt;br /&gt;
    @state = State.find_by_user_id(current_user.id)&lt;br /&gt;
    if @state == nil&lt;br /&gt;
      redirect_to(:controller =&amp;gt; &amp;#039;/account&amp;#039;, :action =&amp;gt; &amp;#039;index&amp;#039;)&lt;br /&gt;
    end&lt;br /&gt;
    @state_pages, @states = paginate :states, :per_page =&amp;gt; 10&lt;br /&gt;
    @thisguy=Actor.find_by_user_id(current_user)&lt;br /&gt;
    @location = Location.find(@state.location_id)&lt;br /&gt;
  end&lt;/p&gt;
&lt;p&gt;  def move&lt;br /&gt;
      @state = State.find_by_user_id(current_user.id)&lt;br /&gt;
      @thisguy=Actor.find_by_user_id(current_user.id)&lt;br /&gt;
      if params[:id] then&lt;br /&gt;
        @state.change_location!(params[:id])&lt;br /&gt;
      end&lt;br /&gt;
      @state.save&lt;br /&gt;
      session[:option_name] = ""&lt;br /&gt;
      redirect_back_or_default(:action =&amp;gt; &amp;#039;play&amp;#039;)&lt;br /&gt;
  end&lt;br /&gt;
  def jog&lt;br /&gt;
      @state = State.find_by_user_id(current_user.id)&lt;br /&gt;
      @thisguy=Actor.find_by_user_id(current_user.id)&lt;br /&gt;
      if @state.current_enthusiasm &amp;gt;= 3 then&lt;br /&gt;
        @state.lose_enthuse!(3)&lt;br /&gt;
        @thisguy.exercise!&lt;br /&gt;
        @state.save&lt;br /&gt;
        @thisguy.save&lt;br /&gt;
      else&lt;br /&gt;
        flash[:notice] = "You are too tired to jog."&lt;br /&gt;
      end&lt;br /&gt;
      #round it by hand&lt;br /&gt;
      myfloat = (((@thisguy.looks * 1000).to_i).to_f)/1000&lt;br /&gt;
      render_text myfloat.to_s&lt;br /&gt;
  end&lt;br /&gt;
  def reset_enthusiasm&lt;br /&gt;
      @state = State.find_by_user_id(current_user.id)&lt;br /&gt;
      @thisguy=Actor.find_by_user_id(current_user.id)&lt;br /&gt;
      if @state.current_enthusiasm &amp;lt; 100 then&lt;br /&gt;
        @state.reset_enthuse!&lt;br /&gt;
        @state.save&lt;br /&gt;
        @thisguy.lose_burger!&lt;br /&gt;
        @thisguy.save&lt;br /&gt;
        render_text @state.current_enthusiasm.to_s&lt;br /&gt;
      else&lt;br /&gt;
        render_text nil&lt;br /&gt;
      end&lt;br /&gt;
  end&lt;/p&gt;
&lt;p&gt;  def refresh_enthuse&lt;br /&gt;
      @state = State.find_by_user_id(current_user.id)&lt;br /&gt;
      render_text @state.current_enthusiasm.to_s&lt;br /&gt;
  end&lt;/p&gt;
&lt;p&gt;  def move_hood&lt;br /&gt;
      @state = State.find_by_user_id(current_user.id)&lt;br /&gt;
      @thisguy=Actor.find_by_user_id(current_user.id)&lt;br /&gt;
      if @state.current_enthusiasm &amp;gt;= 10 then&lt;br /&gt;
        @state.lose_enthuse!(10)&lt;br /&gt;
        if params[:id] then&lt;br /&gt;
          @state.change_hood!(params[:id])&lt;br /&gt;
          flash[:notice]="You are tired from the journey."&lt;br /&gt;
        end&lt;br /&gt;
        session[:option_name] = ""&lt;br /&gt;
        @state.save&lt;br /&gt;
        @thisguy.save&lt;br /&gt;
      else&lt;br /&gt;
        flash[:notice]="You are too tired to make it to #{Hood.find(params[:id]).name}. Maybe you should eat a burger."&lt;br /&gt;
      end&lt;/p&gt;
&lt;p&gt;      redirect_back_or_default(:controller =&amp;gt; &amp;#039;/game&amp;#039;, :action =&amp;gt; &amp;#039;play&amp;#039;)&lt;br /&gt;
  end&lt;/p&gt;
&lt;p&gt;  def set_option&lt;br /&gt;
      @state = State.find_by_user_id(current_user.id)&lt;br /&gt;
      @state.set_option!(params[:id])&lt;br /&gt;
      @state.save&lt;br /&gt;
      session[:option_name] = Option.find(params[:id]).name&lt;br /&gt;
      #render_text Option.find(params[:id]).name&lt;br /&gt;
      render_text ""&lt;br /&gt;
  end&lt;/p&gt;
&lt;p&gt;  def busk&lt;br /&gt;
      @state = State.find_by_user_id(current_user.id)&lt;br /&gt;
      @thisguy=Actor.find_by_user_id(current_user.id)&lt;br /&gt;
      if @state.current_enthusiasm &amp;gt;= 3 then&lt;br /&gt;
        @state.lose_enthuse!(3)&lt;br /&gt;
        @thisguy.learn!&lt;br /&gt;
        @state.save&lt;br /&gt;
        @thisguy.save&lt;br /&gt;
      end&lt;br /&gt;
      #round it by hand&lt;br /&gt;
      myfloat = (((@thisguy.skill * 1000).to_i).to_f)/1000&lt;br /&gt;
      render_text myfloat.to_s&lt;br /&gt;
  end&lt;/p&gt;
&lt;p&gt;  def flirt&lt;br /&gt;
      @state = State.find_by_user_id(current_user.id)&lt;br /&gt;
      @thisguy=Actor.find_by_user_id(current_user.id)&lt;br /&gt;
      if @state.current_enthusiasm &amp;gt;= 3 then&lt;br /&gt;
        @state.lose_enthuse!(3)&lt;br /&gt;
        @thisguy.flirt!&lt;br /&gt;
        @state.save&lt;br /&gt;
        @thisguy.save&lt;br /&gt;
      end&lt;br /&gt;
      #round it by hand&lt;br /&gt;
      myfloat = (((@thisguy.charisma * 1000).to_i).to_f)/1000&lt;br /&gt;
      render_text myfloat.to_s&lt;br /&gt;
  end&lt;/p&gt;
&lt;p&gt;  def pavement&lt;br /&gt;
      @state = State.find_by_user_id(current_user.id)&lt;br /&gt;
      @thisguy=Actor.find_by_user_id(current_user.id)&lt;br /&gt;
      if @state.current_enthusiasm &amp;gt;= 5 then&lt;br /&gt;
        @state.lose_enthuse!(5)&lt;br /&gt;
        @thisguy.pavement!&lt;br /&gt;
        @state.save&lt;br /&gt;
        @thisguy.save&lt;br /&gt;
      end&lt;br /&gt;
      #round it by hand&lt;br /&gt;
      myfloat = (((@thisguy.savvy * 1000).to_i).to_f)/1000&lt;br /&gt;
      render_text myfloat.to_s&lt;br /&gt;
  end&lt;/p&gt;
&lt;p&gt;  def play&lt;br /&gt;
    if not logged_in? then&lt;br /&gt;
      redirect_to(:controller =&amp;gt; &amp;#039;/session&amp;#039;)&lt;br /&gt;
    end&lt;br /&gt;
    @thisguy=Actor.find_by_user_id(current_user.id)&lt;br /&gt;
    if not defined? @thisguy&lt;br /&gt;
      redirect_to(:controller =&amp;gt; &amp;#039;/actor&amp;#039;, :action =&amp;gt; &amp;#039;create&amp;#039;)&lt;br /&gt;
    end&lt;br /&gt;
    session[:option_name] = nil&lt;br /&gt;
    @state_pages, @states = paginate :states, :per_page =&amp;gt; 10&lt;br /&gt;
    @state = State.find_by_user_id(current_user.id)&lt;br /&gt;
    @state.option_id = 999&lt;br /&gt;
    @location = Location.find(@state.location_id)&lt;br /&gt;
    @hood = Hood.find(@state.hood_id)&lt;br /&gt;
    @options = @location.options&lt;/p&gt;
&lt;p&gt;  end&lt;/p&gt;
&lt;p&gt;  def get_saved_name&lt;br /&gt;
    if session[:option_name] == nil then&lt;br /&gt;
      render_text ""&lt;br /&gt;
    else&lt;br /&gt;
      render_text session[:option_name]&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;/p&gt;
&lt;p&gt;  def get_nothing&lt;br /&gt;
    render_text " "&lt;br /&gt;
  end&lt;/p&gt;
&lt;p&gt;  def optin&lt;br /&gt;
    @state = State.find_by_user_id(current_user.id)&lt;br /&gt;
    if @state.choose_option? then&lt;br /&gt;
      @state.process_option!&lt;br /&gt;
      flash[:notice] = @state.return_message&lt;br /&gt;
      redirect_back_or_default(:controller =&amp;gt; &amp;#039;/game&amp;#039;, :action =&amp;gt; &amp;#039;play&amp;#039;)&lt;br /&gt;
    else&lt;br /&gt;
      flash[:notice] = @state.return_message&lt;br /&gt;
      redirect_back_or_default(:controller =&amp;gt; &amp;#039;/game&amp;#039;, :action =&amp;gt; &amp;#039;play&amp;#039;)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;/p&gt;
&lt;p&gt;  def option_name&lt;br /&gt;
    @state = State.find_by_user_id(current_user.id)&lt;br /&gt;
    @option = Option.find_by_id(params[:id])&lt;br /&gt;
    render_text @option.name&lt;br /&gt;
  end&lt;/p&gt;
&lt;p&gt;end&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.digbox.net/index.php/RoR/a-ruby-controller"&gt;Original post&lt;/a&gt; blogged on &lt;a href="http://codeboxer.com"&gt;codeboxer.com&lt;/a&gt;.&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/YD8hhx6K8NQ" height="1" width="1"/&gt;</description>
    <pubDate>Sat, 01 Mar 2008 07:49:19 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2008/03/a-ruby-controller/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2008/03/a-ruby-controller/</feedburner:origLink></item>
  <item>
    <title>solr shell scripting for fun and profit</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/VGXlVyMzGMo/</link>
    <description>&lt;p&gt;We love Solr. Yes we do.&lt;/p&gt;
&lt;p&gt;#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# Shell script to clean up backups of a Solr Lucene collection.&lt;/p&gt;
&lt;p&gt;orig_dir=$(pwd)&lt;br /&gt;
cd ${0%/*}/..&lt;br /&gt;
solr_root=$(pwd)&lt;br /&gt;
cd ${orig_dir}&lt;/p&gt;
&lt;p&gt;unset days num data_dir user verbose debug&lt;br /&gt;
. ${solr_root}/bin/scripts-util&lt;/p&gt;
&lt;p&gt;# set up variables&lt;br /&gt;
prog=${0##*/}&lt;br /&gt;
log=${solr_root}/logs/${prog}.log&lt;/p&gt;
&lt;p&gt;# define usage string&lt;br /&gt;
USAGE="\&lt;br /&gt;
usage: $prog -D  | -N  [-d dir] [-u username] [-v]&lt;br /&gt;
       -D    cleanup backups more than  days old&lt;br /&gt;
       -N     keep the most recent  number of backups and&lt;br /&gt;
                   cleanup up the remaining ones that are not being pulled&lt;br /&gt;
       -d          specify directory holding index data&lt;br /&gt;
       -u          specify user to sudo to before running script&lt;br /&gt;
       -v          increase verbosity&lt;br /&gt;
       -V          output debugging info&lt;br /&gt;
"&lt;/p&gt;
&lt;p&gt;# parse args&lt;br /&gt;
while getopts D:N:d:u:vV OPTION&lt;br /&gt;
do&lt;br /&gt;
    case $OPTION in&lt;br /&gt;
    D)&lt;br /&gt;
        days="$OPTARG"&lt;br /&gt;
        ;;&lt;br /&gt;
    N)&lt;br /&gt;
        num="$OPTARG"&lt;br /&gt;
        ;;&lt;br /&gt;
    d)&lt;br /&gt;
        data_dir="$OPTARG"&lt;br /&gt;
        ;;&lt;br /&gt;
    u)&lt;br /&gt;
        user="$OPTARG"&lt;br /&gt;
        ;;&lt;br /&gt;
    v)&lt;br /&gt;
        verbose="v"&lt;br /&gt;
        ;;&lt;br /&gt;
    V)&lt;br /&gt;
        debug="V"&lt;br /&gt;
        ;;&lt;br /&gt;
    *)&lt;br /&gt;
        echo "$USAGE"&lt;br /&gt;
        exit 1&lt;br /&gt;
    esac&lt;br /&gt;
done&lt;/p&gt;
&lt;p&gt;[[ -n $debug ]] &amp;amp;&amp;amp; set -x&lt;/p&gt;
&lt;p&gt;if [[ -z ${days} &amp;amp;&amp;amp; -z ${num} ]]&lt;br /&gt;
then&lt;br /&gt;
    echo "$USAGE"&lt;br /&gt;
    exit 1&lt;br /&gt;
fi&lt;/p&gt;
&lt;p&gt;fixUser "$@"&lt;/p&gt;
&lt;p&gt;# use default value for data_dir if not specified&lt;br /&gt;
# relative path starts at ${solr_root}&lt;br /&gt;
if [[ -z ${data_dir} ]]&lt;br /&gt;
then&lt;br /&gt;
    data_dir=${solr_root}/data&lt;br /&gt;
elif [[ "`echo ${data_dir}|cut -c1`" != "/" ]]&lt;br /&gt;
then&lt;br /&gt;
    data_dir=${solr_root}/${data_dir}&lt;br /&gt;
fi&lt;/p&gt;
&lt;p&gt;function remove&lt;br /&gt;
{&lt;br /&gt;
    logMessage removing backup $1&lt;br /&gt;
    /bin/rm -rf $1&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;start=`date +"%s"`&lt;/p&gt;
&lt;p&gt;logMessage started by $oldwhoami&lt;br /&gt;
logMessage command: $0 $@&lt;/p&gt;
&lt;p&gt;# trap control-c&lt;br /&gt;
trap &amp;#039;echo "caught INT/TERM, exiting now but partial cleanup may have already occured";logExit aborted 13&amp;#039; INT TERM&lt;/p&gt;
&lt;p&gt;if [[ -n ${days} ]]&lt;br /&gt;
then&lt;br /&gt;
    #is maxdepth supported?&lt;br /&gt;
    find ${data_dir} -maxdepth 0 -name foobar &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
    if [ $? = 0 ]; then&lt;br /&gt;
      maxdepth="-maxdepth 1"&lt;br /&gt;
    else&lt;br /&gt;
      unset maxdepth&lt;br /&gt;
    fi&lt;/p&gt;
&lt;p&gt;    logMessage cleaning up backups more than ${days} days old&lt;br /&gt;
    for i in `find ${data_dir} ${maxdepth} -name &amp;#039;backup.*&amp;#039; -mtime +${days} -print`&lt;br /&gt;
    do&lt;br /&gt;
        remove $i&lt;br /&gt;
    done&lt;br /&gt;
elif [[ -n ${num} ]]&lt;br /&gt;
then&lt;br /&gt;
    logMessage cleaning up all backups except for the most recent ${num} ones&lt;br /&gt;
    unset backups count&lt;br /&gt;
    backups=`ls -cd ${data_dir}/backup.* 2&amp;gt;/dev/null`&lt;br /&gt;
    if [[ $? == 0 ]]&lt;br /&gt;
    then&lt;br /&gt;
        count=`echo $backups|wc -w`&lt;br /&gt;
        startpos=`expr $num + 1`&lt;br /&gt;
        if [[ $count -gt $num ]]&lt;br /&gt;
        then&lt;br /&gt;
            for i in `echo $backups|cut -f${startpos}- -d" "`&lt;br /&gt;
            do&lt;br /&gt;
	        remove $i&lt;br /&gt;
	    done&lt;br /&gt;
        fi&lt;br /&gt;
    fi&lt;br /&gt;
fi&lt;/p&gt;
&lt;p&gt;logExit ended 0&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.digbox.net/index.php/RoR/solr-shell-scripting-for-fun-and-profit"&gt;Original post&lt;/a&gt; blogged on &lt;a href="http://codeboxer.com"&gt;codeboxer.com&lt;/a&gt;.&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/VGXlVyMzGMo" height="1" width="1"/&gt;</description>
    <pubDate>Wed, 27 Feb 2008 08:02:34 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2008/02/solr-shell-scripting-for-fun-and-profit/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2008/02/solr-shell-scripting-for-fun-and-profit/</feedburner:origLink></item>
  <item>
    <title>A Ruby View using AJAX</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/jYt8Ha3IC58/</link>
    <description>&lt;p&gt;There is a lot going on here, perhaps too much, but this serves as a nice example.&lt;/p&gt;
&lt;p&gt;&amp;lt;% i=0 %&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;% for l in @hood.locations %&amp;gt;&lt;/p&gt;
&lt;p&gt;		&amp;lt;% i=i+1 %&amp;gt;&lt;br /&gt;
		&amp;lt;% if l == @location then %&amp;gt;&lt;br /&gt;
		  &amp;lt;% lmain = l.name %&amp;gt;&lt;br /&gt;
		  &amp;lt;%= image_tag("http://www.noonchild.com/art/rockstaralley2_41.png") %&amp;gt;&lt;br /&gt;
		&amp;lt;% else %&amp;gt;&lt;br /&gt;
          &amp;lt;%= link_to image_tag("#{l.graflink}", :border=&amp;gt;0, :title =&amp;gt; l.name), :action =&amp;gt; &amp;#039;move&amp;#039;, :id =&amp;gt; l %&amp;gt;&lt;br /&gt;
		&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&amp;lt;%= lmain %&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;% for o in @options -%&amp;gt;&lt;br /&gt;
	&amp;lt;%= link_to_remote( image_tag("#{o.graflink}", :border =&amp;gt; 0, :title =&amp;gt; o.description), {&lt;br /&gt;
	    :update =&amp;gt; "current_message",&lt;br /&gt;
	    :url =&amp;gt;{ :action =&amp;gt; o.link, :controller =&amp;gt; o.controller },&lt;br /&gt;
	    :complete =&amp;gt; {"document.getElementById(&amp;#039;message_answer&amp;#039;).style.display = &amp;#039;block&amp;#039;; document.getElementById(&amp;#039;current_message&amp;#039;).style.display = &amp;#039;block&amp;#039;;Element.update(&amp;#039;option_message&amp;#039;,&amp;#039;#{o.name}&amp;#039;);",&lt;br /&gt;
	    remote_function(:update =&amp;gt; &amp;#039;x&amp;#039;,&lt;br /&gt;
				 :url =&amp;gt; { :action =&amp;gt; :set_option, :id =&amp;gt; o })}&lt;br /&gt;
		         },{&lt;br /&gt;
		:onmouseover =&amp;gt; {"Element.update(&amp;#039;option_preview&amp;#039;,&amp;#039;#{o.name}&amp;#039;);&lt;br /&gt;
                    document.getElementById(&amp;#039;option_message&amp;#039;).style.display = &amp;#039;none&amp;#039;; ",&lt;br /&gt;
                    visual_effect(:fade,"flashmessage", :duration =&amp;gt; 2.5 )},&lt;br /&gt;
		:onmouseout =&amp;gt; "Element.update(&amp;#039;option_preview&amp;#039;,&amp;#039;&amp;#039;);document.getElementById(&amp;#039;option_message&amp;#039;).style.display = &amp;#039;block&amp;#039;;"		}&lt;br /&gt;
		) -%&amp;gt;&lt;br /&gt;
&amp;lt;% end -%&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;% start_form_tag :action =&amp;gt; &amp;#039;optin&amp;#039; do |f| -%&amp;gt;&lt;br /&gt;
&amp;lt;%= submit_tag &amp;#039;Say yes.&amp;#039;, :onclick =&amp;gt; "document.getElementById(&amp;#039;ajaxsubmit&amp;#039;).style.display = &amp;#039;inline&amp;#039;;"  %&amp;gt;&lt;br /&gt;
	&amp;lt;% end_form_tag %&amp;gt;&amp;lt;%= image_tag("http://digbox.net/art/ajax-loader.gif", :border=&amp;gt;0) %&amp;gt;&lt;br /&gt;
&amp;lt;% end -%&amp;gt;&lt;br /&gt;
&amp;lt;%= image_tag("http://digbox.net/art/ajax-loader.gif", :border=&amp;gt;0) %&amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Places to go, things to do&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;    &amp;lt;% for h in Hood.find(:all) %&amp;gt;&lt;br /&gt;
      &amp;lt;% if h != @hood then %&amp;gt;&lt;br /&gt;
        &amp;lt;%= link_to image_tag("#{h.graflink}", :border=&amp;gt;0), {:action =&amp;gt; &amp;#039;move_hood&amp;#039;, :id =&amp;gt; h}, :onclick =&amp;gt; visual_effect(:Fade,"enthusiasm") %&amp;gt;&lt;/p&gt;
&lt;p&gt;        &amp;lt;%= h.name %&amp;gt;&lt;br /&gt;
	  &amp;lt;% end %&amp;gt;&lt;br /&gt;
	&amp;lt;% end %&amp;gt;&lt;/p&gt;
&lt;p&gt;	    &amp;lt;%= render :partial =&amp;gt; &amp;#039;form&amp;#039; %&amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.digbox.net/index.php/RoR/a-ruby-view-using-ajax"&gt;Original post&lt;/a&gt; blogged on &lt;a href="http://codeboxer.com"&gt;codeboxer.com&lt;/a&gt;.&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/jYt8Ha3IC58" height="1" width="1"/&gt;</description>
    <pubDate>Sun, 24 Feb 2008 07:52:19 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2008/02/a-ruby-view-using-ajax/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2008/02/a-ruby-view-using-ajax/</feedburner:origLink></item>
  <item>
    <title>Another Ruby model</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/ZzO6LosgZd4/</link>
    <description>&lt;p&gt;class State &amp;lt; ActiveRecord::Base&lt;br /&gt;
  has_one :location&lt;br /&gt;
  has_one :user&lt;br /&gt;
  has_one :hood&lt;br /&gt;
  has_one :option&lt;/p&gt;
&lt;p&gt;  attr_reader :return_message&lt;br /&gt;
  PRICE_OF_UNIFORM = 22&lt;br /&gt;
  BURGER_LIMIT = 5&lt;/p&gt;
&lt;p&gt;  def isactive?&lt;br /&gt;
    (self.current_enthusiasm &amp;gt; 0)&lt;br /&gt;
  end&lt;/p&gt;
&lt;p&gt;  def lose_enthuse!(factor = 1)&lt;br /&gt;
    self.current_enthusiasm -= (1 * factor)&lt;br /&gt;
    self.name = "You are visiting"&lt;br /&gt;
  end&lt;/p&gt;
&lt;p&gt;  def change_location!(location)&lt;br /&gt;
    self.location_id = location&lt;br /&gt;
  end&lt;/p&gt;
&lt;p&gt;  def reset_enthuse!&lt;br /&gt;
    self.current_enthusiasm = 100&lt;br /&gt;
  end&lt;/p&gt;
&lt;p&gt;  def change_hood!(hood)&lt;br /&gt;
    self.hood_id = hood&lt;br /&gt;
    self.location_id = 1&lt;br /&gt;
    self.name = "Please choose somewhere to visit:"&lt;br /&gt;
  end&lt;/p&gt;
&lt;p&gt;  def set_option!(id)&lt;br /&gt;
    self.option_id = id&lt;br /&gt;
  end&lt;/p&gt;
&lt;p&gt;  def choose_option?&lt;br /&gt;
    s=""&lt;br /&gt;
    @option = Option.find_by_id(self.option_id)&lt;br /&gt;
    @thisguy=Actor.find_by_user_id(self.user_id)&lt;br /&gt;
    if @thisguy.cash &amp;lt; @option.cash_price then&lt;br /&gt;
      s= s &amp;lt;&amp;lt; "You need at least $#{@option.cash_price}. "&lt;br /&gt;
    end&lt;br /&gt;
    if self.current_enthusiasm &amp;lt; @option.enthuse_price then&lt;br /&gt;
      s= s &amp;lt;&amp;lt; "You need at least #{@option.enthuse_price} enthusiasm points. "&lt;br /&gt;
    end&lt;br /&gt;
    if (@thisguy.has_uniform &amp;lt; @option.uniform_needed) and (@option.give_uniform &amp;lt; 1) then&lt;br /&gt;
      s= s &amp;lt;&amp;lt; "You need a uniform for this and you can&amp;#039;t get one here. "&lt;br /&gt;
    end&lt;br /&gt;
    if (@thisguy.has_uniform &amp;lt; @option.uniform_needed) and (@option.give_uniform == 1) and (@thisguy.cash &amp;lt; PRICE_OF_UNIFORM) then&lt;br /&gt;
      s= s &amp;lt;&amp;lt; "You need a uniform for this and you can&amp;#039;t afford one - you are short $#{PRICE_OF_UNIFORM - @thisguy.cash}. "&lt;br /&gt;
    end&lt;br /&gt;
    if (@thisguy.has_job &amp;gt;= @option.give_job) and (@option.give_job &amp;gt; 0) then&lt;br /&gt;
      s= s &amp;lt;&amp;lt; "You already have a job. "&lt;br /&gt;
    end&lt;br /&gt;
    if @thisguy.charisma &amp;lt; @option.charisma_needed then&lt;br /&gt;
      s= s &amp;lt;&amp;lt; "You need at least #{@option.charisma_needed} charisma points. "&lt;br /&gt;
    end&lt;br /&gt;
    if @thisguy.skill &amp;lt; @option.skill_needed then&lt;br /&gt;
      s= s &amp;lt;&amp;lt; "You need at least #{@option.skill_needed} skill points. "&lt;br /&gt;
    end&lt;br /&gt;
    if @thisguy.savvy &amp;lt; @option.savvy_needed then&lt;br /&gt;
      s= s &amp;lt;&amp;lt; "You need at least #{@option.savvy_needed} savvy points. "&lt;br /&gt;
    end&lt;br /&gt;
    if @thisguy.looks &amp;lt; @option.looks_needed then&lt;br /&gt;
      s= s &amp;lt;&amp;lt; "You need at least #{@option.looks_needed} looks points. "&lt;br /&gt;
    end&lt;br /&gt;
    if @option.take_point &amp;gt; 0 and ( @thisguy.savvy &amp;lt; 1 and @thisguy.charisma &amp;lt; 1 and @thisguy.skill &amp;lt; 1 and @thisguy.looks &amp;lt; 1 )&lt;br /&gt;
      s= s &amp;lt;&amp;lt; "You have no points left to sell, you masochist. "&lt;br /&gt;
    end&lt;br /&gt;
    if @thisguy.fans &amp;lt; @option.fans_needed then&lt;br /&gt;
      s= s &amp;lt;&amp;lt; "You need at least #{@option.fans_needed} fans. "&lt;br /&gt;
    end&lt;br /&gt;
    if @option.give_charity_bar &amp;gt; 0 and @thisguy.charity_bar &amp;gt; 1&lt;br /&gt;
      s= s &amp;lt;&amp;lt; "You already have #{@thisguy.charity_bar==1 ? "1 box" : "2 boxes"} of candy bars. "&lt;br /&gt;
    end&lt;br /&gt;
    if @option.charity_bar_price &amp;gt; 0 and @thisguy.charity_bar &amp;lt; 1&lt;br /&gt;
      s= s &amp;lt;&amp;lt; "You can&amp;#039;t sell candy bars that you don&amp;#039;t have. "&lt;br /&gt;
    end&lt;br /&gt;
    #BURGER CHECK&lt;br /&gt;
    if @option.give_burger == 2&lt;br /&gt;
      if (@thisguy.burgers + 2) &amp;gt; BURGER_LIMIT&lt;br /&gt;
        s= s &amp;lt;&amp;lt; "You can&amp;#039;t carry any more burgers. "&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;/p&gt;
&lt;p&gt;    if @thisguy.has_car &amp;lt; @option.car_needed then&lt;br /&gt;
      if @thisguy.has_car &amp;gt; 0 then&lt;br /&gt;
        nicer = " nicer"&lt;br /&gt;
      end&lt;br /&gt;
      s= s &amp;lt;&amp;lt; "You need a #{nicer} car. "&lt;br /&gt;
    end&lt;br /&gt;
    if (s.strip) == "" then&lt;br /&gt;
      true&lt;br /&gt;
    else&lt;br /&gt;
      r = rand(5)&lt;br /&gt;
      if r==1 then&lt;br /&gt;
        @return_message="Sorry #{@thisguy.name}, you can&amp;#039;t #{@option.name.upcase} Apparently you are not good enough right now. #{s}"&lt;br /&gt;
      elsif r==2&lt;br /&gt;
        @return_message="Sorry #{@thisguy.name}, you can&amp;#039;t #{@option.name.upcase} It&amp;#039;s not working out for you. #{s}"&lt;br /&gt;
      elsif r==3&lt;br /&gt;
        @return_message="Sorry #{@thisguy.name}, you can&amp;#039;t #{@option.name.upcase} Maybe next time. #{s}"&lt;br /&gt;
      elsif r==4&lt;br /&gt;
        @return_message="Sorry #{@thisguy.name}, you can&amp;#039;t #{@option.name.upcase} What a shame. #{s}"&lt;br /&gt;
      else&lt;br /&gt;
        @return_message="Sorry #{@thisguy.name}, you can&amp;#039;t #{@option.name.upcase} You are coming up a little short. #{s}"&lt;br /&gt;
      end&lt;br /&gt;
      false&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;/p&gt;
&lt;p&gt;  def process_option!&lt;br /&gt;
    @option = Option.find_by_id(self.option_id)&lt;br /&gt;
    @thisguy=Actor.find_by_user_id(self.user_id)&lt;br /&gt;
    @thisguy.cash -= @option.cash_price.to_i&lt;br /&gt;
    self.current_enthusiasm -= @option.enthuse_price.to_i&lt;br /&gt;
    @thisguy.cash+=@option.cash_payout&lt;br /&gt;
    self.current_enthusiasm = (self.current_enthusiasm + @option.enthuse_payout)&amp;gt;100 ? 100 : self.current_enthusiasm + @option.enthuse_payout&lt;br /&gt;
    @thisguy.charisma = @thisguy.charisma + (@thisguy.charisma*(@option.charisma_quotient*0.001))&lt;br /&gt;
    @thisguy.skill = @thisguy.skill + (@thisguy.skill*(@option.skill_quotient*0.001))&lt;br /&gt;
    @thisguy.savvy = @thisguy.savvy + (@thisguy.savvy*(@option.savvy_quotient*0.001))&lt;br /&gt;
    @thisguy.looks = @thisguy.looks + (@thisguy.looks*(@option.looks_quotient*0.001))&lt;br /&gt;
    if @option.cash_price &amp;gt; 0 then&lt;br /&gt;
      s="You spent $#{@option.cash_price}. "&lt;br /&gt;
    else&lt;br /&gt;
      s=""&lt;br /&gt;
    end&lt;br /&gt;
    if @option.cash_payout &amp;gt; 0 then&lt;br /&gt;
      s= s &amp;lt;&amp;lt; "You made $#{@option.cash_payout}. "&lt;br /&gt;
    end&lt;br /&gt;
    if @option.enthuse_payout &amp;gt; 0 then&lt;br /&gt;
      s= s &amp;lt;&amp;lt; "You feel better. "&lt;br /&gt;
    end&lt;br /&gt;
    if @option.charisma_quotient &amp;gt; 0 then&lt;br /&gt;
      s= s &amp;lt;&amp;lt; "Your mojo is off the hook. "&lt;br /&gt;
    end&lt;br /&gt;
    if @option.skill_quotient &amp;gt; 0 then&lt;br /&gt;
      s= s &amp;lt;&amp;lt; "Your skill went up a bit. "&lt;br /&gt;
    end&lt;br /&gt;
    if @option.savvy_quotient &amp;gt; 0 then&lt;br /&gt;
      s= s &amp;lt;&amp;lt; "Your savvy has improved. "&lt;br /&gt;
    end&lt;br /&gt;
    if @option.looks_quotient &amp;gt; 0 then&lt;br /&gt;
      s= s &amp;lt;&amp;lt; "You just got prettier. "&lt;br /&gt;
    end&lt;br /&gt;
    if @option.give_car &amp;gt; 0 then&lt;br /&gt;
      @thisguy.has_car = @option.give_car&lt;br /&gt;
      s= s &amp;lt;&amp;lt; "You got wheels. "&lt;br /&gt;
    end&lt;br /&gt;
    if @option.give_pet &amp;gt; 0 then&lt;br /&gt;
      @thisguy.has_pet = @option.give_pet&lt;br /&gt;
      s= s &amp;lt;&amp;lt; "Your new pet loves you. "&lt;br /&gt;
    end&lt;br /&gt;
    if (@option.give_uniform == 1) and (@thisguy.has_uniform &amp;lt; 1) then&lt;br /&gt;
      @thisguy.cash -= PRICE_OF_UNIFORM&lt;br /&gt;
      @thisguy.has_uniform = 1&lt;br /&gt;
      s= s &amp;lt;&amp;lt; "You paid $#{PRICE_OF_UNIFORM} for your uniform. "&lt;br /&gt;
    end&lt;br /&gt;
    if @option.give_box &amp;gt; 0 then&lt;br /&gt;
      @thisguy.has_box = @option.give_box&lt;br /&gt;
      s= s &amp;lt;&amp;lt; "You now have somewhere to live. "&lt;br /&gt;
    end&lt;br /&gt;
    if @option.give_job &amp;gt; 0 then&lt;br /&gt;
      @thisguy.has_job = @option.give_job&lt;br /&gt;
      @thisguy.works_at = @option.location_id&lt;br /&gt;
      @thisguy.last_pay_date = Time.now&lt;br /&gt;
      s= s &amp;lt;&amp;lt; "You just got hired. "&lt;br /&gt;
    end&lt;br /&gt;
    if @option.take_point &amp;gt; 0&lt;br /&gt;
      whichever = rand(4)&lt;br /&gt;
      if whichever == 1&lt;br /&gt;
        @thisguy.skill -= 1&lt;br /&gt;
        name = "skill"&lt;br /&gt;
      elsif whichever == 2&lt;br /&gt;
        @thisguy.charisma -= 1&lt;br /&gt;
        name = "charisma"&lt;br /&gt;
      elsif whichever == 3&lt;br /&gt;
        @thisguy.savvy -= 1&lt;br /&gt;
        name = "savvy"&lt;br /&gt;
      else&lt;br /&gt;
        @thisguy.looks -= 1&lt;br /&gt;
        name = "looks"&lt;br /&gt;
      end&lt;br /&gt;
      s= s &amp;lt;&amp;lt; "You lost a point of #{name}. "&lt;br /&gt;
    end&lt;br /&gt;
    if @option.give_point &amp;gt; 0&lt;br /&gt;
      if @option.give_point == 1&lt;br /&gt;
        quant = "1 point"&lt;br /&gt;
      else&lt;br /&gt;
        quant = "#{@option.give_point} points"&lt;br /&gt;
      end&lt;br /&gt;
      @thisguy.points_to_give += @option.give_point&lt;br /&gt;
      s= s &amp;lt;&amp;lt; "You gained #{quant} to use however you wish. Just click on the the PDA icon by your burgers."&lt;br /&gt;
    end&lt;br /&gt;
    if @option.take_job &amp;gt; 0&lt;br /&gt;
      s= s &amp;lt;&amp;lt; ((@thisguy.has_job&amp;gt;0) ? "You lost your job. " : "You got arrested for no reason. ")&lt;br /&gt;
      @thisguy.has_job = 0&lt;br /&gt;
    end&lt;br /&gt;
    if @option.give_guitar &amp;gt; 0 then&lt;br /&gt;
      @thisguy.has_guitar = @option.give_guitar&lt;br /&gt;
      s= s &amp;lt;&amp;lt; "You bought the guitar. "&lt;br /&gt;
    end&lt;br /&gt;
    if @option.charity_bar_price &amp;gt; 0&lt;br /&gt;
      @thisguy.charity_bar -= 1&lt;br /&gt;
      s= s &amp;lt;&amp;lt; "You sold a box of candy bars. "&lt;br /&gt;
    end&lt;br /&gt;
    if @option.give_acct &amp;gt; 0 then&lt;br /&gt;
      @thisguy.has_acct = @option.give_acct&lt;br /&gt;
      s= s &amp;lt;&amp;lt; "You will be earning #{@option.give_acct * $SAVINGS_QUOTIENT}% interest. "&lt;br /&gt;
    end&lt;br /&gt;
    if @option.give_burger &amp;gt; 0 then&lt;br /&gt;
      if @option.give_burger == 1 then&lt;br /&gt;
        burger_count = " 1 burger "&lt;br /&gt;
      else&lt;br /&gt;
        burger_count = " #{@option.give_burger} burgers "&lt;br /&gt;
      end&lt;br /&gt;
      if (@option.give_burger == 1) and (@thisguy.burgers == BURGER_LIMIT)&lt;br /&gt;
        s= s &amp;lt;&amp;lt; "You took a burger with you but it fell out of your pocket. "&lt;br /&gt;
      else&lt;/p&gt;
&lt;p&gt;        @thisguy.burgers += @option.give_burger&lt;br /&gt;
        s= s &amp;lt;&amp;lt; "You wrapped up#{burger_count} to put in your pocket. "&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    if @option.random_money &amp;gt; 0 then&lt;br /&gt;
      r = rand(100)&lt;br /&gt;
      if @option.random_money &amp;gt; (r - (@option.random_money/2)) then&lt;br /&gt;
        x = (@option.random_money * (r/1.6) + @option.random_money + (r * @option.random_money))&lt;br /&gt;
        @thisguy.cash += x&lt;br /&gt;
        s= s &amp;lt;&amp;lt; "You got lucky for an extra $#{(x).to_i}. "&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    if @option.random_pet &amp;gt; 0 then&lt;br /&gt;
      r = rand(100)&lt;br /&gt;
      if (@option.random_pet &amp;gt;= r) then&lt;br /&gt;
        @thisguy.has_pet += 1&lt;br /&gt;
        s= s &amp;lt;&amp;lt; "You seduced a stray puppie with your charm. "&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    #straight given fan&lt;br /&gt;
    if @option.give_fan &amp;gt; 0&lt;br /&gt;
      netgain = @option.give_fan&lt;br /&gt;
        if netgain &amp;gt; 1 then&lt;br /&gt;
          s_suffix = "s"&lt;br /&gt;
        else&lt;br /&gt;
          s_suffix = ""&lt;br /&gt;
        end&lt;br /&gt;
        @thisguy.fans += netgain&lt;br /&gt;
        s= s &amp;lt;&amp;lt; "#{netgain} new fan#{s_suffix} came up to you after the show. "&lt;br /&gt;
    end&lt;br /&gt;
    #random fan&lt;br /&gt;
    if @option.random_fan &amp;gt; 0&lt;br /&gt;
      netgain = 0&lt;br /&gt;
      r = rand(90)&lt;br /&gt;
      if @option.random_fan &amp;gt;= r then&lt;br /&gt;
        random_factor = 0&lt;br /&gt;
        for i in &lt;a href="http://www.digbox.netmailto:r..@option.random_fan"&gt;r..@option.random_fan&lt;/a&gt;&lt;br /&gt;
          random_factor = (random_factor + i)&lt;br /&gt;
        end&lt;br /&gt;
        netgain = random_factor&lt;br /&gt;
      end&lt;br /&gt;
      if netgain &amp;gt; 0 then&lt;br /&gt;
        if netgain &amp;gt; 1 then&lt;br /&gt;
          s_suffix = "s"&lt;br /&gt;
        else&lt;br /&gt;
          s_suffix = ""&lt;br /&gt;
        end&lt;br /&gt;
        @thisguy.fans += netgain&lt;br /&gt;
        s= s &amp;lt;&amp;lt; "#{netgain} new fan#{s_suffix} came to your website. "&lt;br /&gt;
      end&lt;br /&gt;
    end if&lt;br /&gt;
    if @option.give_charity_bar &amp;gt; 0&lt;br /&gt;
      @thisguy.charity_bar += 1&lt;br /&gt;
    end&lt;br /&gt;
    @return_message = s&lt;br /&gt;
    @thisguy.save&lt;br /&gt;
    self.save&lt;br /&gt;
  end&lt;/p&gt;
&lt;p&gt;  def return_message&lt;br /&gt;
    @return_message&lt;br /&gt;
  end&lt;/p&gt;
&lt;p&gt;  def return_message=(val)&lt;br /&gt;
    @return_message = val&lt;br /&gt;
  end&lt;br /&gt;
  def take_shelter!&lt;br /&gt;
    x = self.current_enthusiasm += 50&lt;br /&gt;
    if x &amp;gt; 100&lt;br /&gt;
      x = 100&lt;br /&gt;
    end&lt;br /&gt;
    self.current_enthusiasm = x&lt;br /&gt;
  end&lt;/p&gt;
&lt;p&gt;end&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.digbox.net/index.php/RoR/another-ruby-model"&gt;Original post&lt;/a&gt; blogged on &lt;a href="http://codeboxer.com"&gt;codeboxer.com&lt;/a&gt;.&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/ZzO6LosgZd4" height="1" width="1"/&gt;</description>
    <pubDate>Thu, 07 Feb 2008 07:47:03 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2008/02/another-ruby-model/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2008/02/another-ruby-model/</feedburner:origLink></item>
  <item>
    <title>A simple Ruby model</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/X6p_U-oolbo/</link>
    <description>&lt;p&gt;class Actor &amp;lt; ActiveRecord::Base&lt;br /&gt;
  validates_presence_of :name&lt;br /&gt;
  validates_uniqueness_of :name&lt;br /&gt;
  validates_length_of :name, :maximum =&amp;gt; 26, :message =&amp;gt; "The name you have chosen is too long. You are allowed up to 26 characters."&lt;/p&gt;
&lt;p&gt;  belongs_to :user&lt;br /&gt;
  REGULAR_LEVEL = 1.004&lt;br /&gt;
  RAISED_LEVEL1 = 1.014&lt;br /&gt;
  $SAVINGS_QUOTIENT = 2&lt;br /&gt;
  WAGES_QUOTIENT = 9&lt;/p&gt;
&lt;p&gt;  attr_reader :hasjob&lt;/p&gt;
&lt;p&gt;  def exercise!&lt;br /&gt;
    self.looks *= REGULAR_LEVEL&lt;br /&gt;
  end&lt;br /&gt;
  def learn!&lt;br /&gt;
    self.skill *= REGULAR_LEVEL&lt;br /&gt;
  end&lt;br /&gt;
  def lose_burger!&lt;br /&gt;
    self.burgers -= 1&lt;br /&gt;
  end&lt;br /&gt;
  def flirt!&lt;br /&gt;
    self.charisma *= REGULAR_LEVEL&lt;br /&gt;
  end&lt;br /&gt;
  def pavement!&lt;br /&gt;
    self.savvy *= RAISED_LEVEL1&lt;br /&gt;
  end&lt;br /&gt;
  def add_looks!&lt;br /&gt;
    self.looks += 1&lt;br /&gt;
    lose_point&lt;br /&gt;
  end&lt;br /&gt;
  def add_charisma!&lt;br /&gt;
    self.charisma += 1&lt;br /&gt;
    lose_point&lt;br /&gt;
  end&lt;br /&gt;
  def add_skill!&lt;br /&gt;
    self.skill += 1&lt;br /&gt;
    lose_point&lt;br /&gt;
  end&lt;br /&gt;
  def add_savvy!&lt;br /&gt;
    self.savvy += 1&lt;br /&gt;
    lose_point&lt;br /&gt;
  end&lt;/p&gt;
&lt;p&gt;  def lose_point&lt;br /&gt;
    self.points_to_give -= 1&lt;br /&gt;
  end&lt;/p&gt;
&lt;p&gt;  def haspoints?&lt;br /&gt;
    (self.points_to_give &amp;gt; 0)&lt;br /&gt;
  end&lt;/p&gt;
&lt;p&gt;  def hasjob?&lt;br /&gt;
    (self.works_at&amp;gt;0)&lt;br /&gt;
  end&lt;/p&gt;
&lt;p&gt;  def has_state?&lt;br /&gt;
    @state = State.find_by_user_id(current_user.id)&lt;br /&gt;
    defined? @state&lt;br /&gt;
  end&lt;/p&gt;
&lt;p&gt;  def name_of_job&lt;br /&gt;
    Location.find(self.works_at).name&lt;br /&gt;
  end&lt;/p&gt;
&lt;p&gt;  def gorandom!&lt;br /&gt;
    while self.points_to_give &amp;gt; 5&lt;br /&gt;
      i = rand(90)&lt;br /&gt;
      i %= 5&lt;br /&gt;
      if i == 1 then&lt;br /&gt;
        self.add_skill!&lt;br /&gt;
      end&lt;br /&gt;
      if i == 2 then&lt;br /&gt;
        self.add_charisma!&lt;br /&gt;
      end&lt;br /&gt;
      if i == 3 then&lt;br /&gt;
        self.add_looks!&lt;br /&gt;
      end&lt;br /&gt;
      if i == 4 then&lt;br /&gt;
        self.add_savvy!&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    #self.save&lt;br /&gt;
  end&lt;br /&gt;
  def calc_savings!&lt;br /&gt;
    #call this first&lt;br /&gt;
    if self.has_acct &amp;gt; 0 and self.cash &amp;gt; 0&lt;br /&gt;
      cash_on_hand = self.cash&lt;br /&gt;
      percentage = ($SAVINGS_QUOTIENT*self.has_acct)&lt;br /&gt;
      added_cash = ((cash_on_hand*percentage).to_i)/100&lt;br /&gt;
      self.cash += added_cash&lt;br /&gt;
      "You made $#{added_cash} in interest on your account. "&lt;br /&gt;
    else&lt;br /&gt;
      ""&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  def clear_log!&lt;br /&gt;
    self.log = "Ok. "&lt;br /&gt;
  end&lt;br /&gt;
  def calc_wages!&lt;br /&gt;
    if self.has_job &amp;gt; 0&lt;br /&gt;
      cash_wages = self.has_job * WAGES_QUOTIENT&lt;br /&gt;
      self.cash += cash_wages&lt;br /&gt;
      self.consecutive_work_hours += 1&lt;br /&gt;
      self.last_pay_date = Time.now&lt;br /&gt;
      "You made $#{cash_wages} working at #{Location.find(self.works_at).name}, hour ##{self.consecutive_work_hours}. "&lt;br /&gt;
    else&lt;br /&gt;
      ""&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
#end class&lt;a href="http://www.digbox.net/index.php/RoR/a-simple-ruby-model"&gt;Original post&lt;/a&gt; blogged on &lt;a href="http://codeboxer.com"&gt;codeboxer.com&lt;/a&gt;.&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/X6p_U-oolbo" height="1" width="1"/&gt;</description>
    <pubDate>Tue, 05 Feb 2008 07:44:23 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2008/02/a-simple-ruby-model/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2008/02/a-simple-ruby-model/</feedburner:origLink></item>
  <item>
    <title>the Monstertrak migration</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/v_AdKKES8ug/</link>
    <description>&lt;p&gt;After over 9 months, literally the last 4 weeks non-stop, every day, I bring you - the migration. In effect. 5000 + lines of PL/SQL sexiness. This little puppy brought about a million company records and 300,000 student records over into the new Ruby on Rails schema which were then written into over 8 million contact, user, address, and account records.&lt;/p&gt;

&lt;a href='http://blog.kristeraxel.com/wp-content/uploads/2009/01/migration189.txt'&gt;migration189&lt;/a&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/v_AdKKES8ug" height="1" width="1"/&gt;</description>
    <pubDate>Sat, 02 Feb 2008 07:37:37 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2008/02/the-monstertrak-migration/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2008/02/the-monstertrak-migration/</feedburner:origLink></item>
  <item>
    <title>PL SQL split function</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/RR1JCus-444/</link>
    <description>&lt;script src="https://gist.github.com/860981.js?file=pl_sql_split.sql"&gt;&lt;/script&gt;

&lt;p&gt;--this is how you would use it in a cursor statement:&lt;/p&gt;

&lt;script src="https://gist.github.com/860989.js?file=cursor_pl_sql_split_sample.sql"&gt;&lt;/script&gt;

&lt;p&gt;--copied from &lt;a href="http://articles.techrepublic.com.com/5100-9592-5259821.html"&gt;http://articles.techrepublic.com.com/5100-9592-5259821.html&lt;/a&gt;&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/RR1JCus-444" height="1" width="1"/&gt;</description>
    <pubDate>Sat, 12 Jan 2008 07:29:26 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2008/01/pl-sql-split-function/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2008/01/pl-sql-split-function/</feedburner:origLink></item>
  <item>
    <title>Inexpensive MAX queries in PL SQL</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/KZkwdu5QfUw/</link>
    <description>&lt;p&gt;This was a trick that one of our contractors showed me here at Monstertrak today. Basically, here&amp;#039;s the gist. you&amp;#039;ve got a join that you need to make, but you only ever want one record to return - you need to restrict the join to return one - and only one - sister record.&lt;br /&gt;
Common logic would have you doing a group by query against said table as a derived table, on the primary key and whatever other field encompasses the info you need to enforce your logic, and doing a self-join against that same table to pull in the rest of the fields you need, and then joining that back against the table you needed to join to in the first place.&lt;/p&gt;
&lt;p&gt;Here&amp;#039;s what that looks like -&lt;/p&gt;
&lt;p&gt;SELECT MAIN_TABLE.*, JOIN_TABLE.*&lt;br /&gt;
FROM MAIN_TABLE&lt;br /&gt;
     ,JOIN_TABLE&lt;br /&gt;
     ,(SELECT MAX(ID) ID, USERNAME FROM JOIN_TABLE GROUP BY ID, USERNAME) JOIN_TABLE_GROUP_BY&lt;br /&gt;
WHERE MAIN_TABLE.ID = JOIN_TABLE.FOREIGN_KEY&lt;br /&gt;
AND JOIN_TABLE.ID = JOIN_TABLE_GROUP_BY.ID&lt;/p&gt;
&lt;p&gt;There is a better way. You can save yourself the self-join by concatenating all of your needed fields into one calculated field, and doing the MAX() calculation with only ONE field in the GROUP BY. You put your criteria field far left, pad it enough to not chop any digits, concatenate in the rest of what you want, and then SUBSTR it back out in the end. Genius.&lt;/p&gt;
&lt;p&gt;select c.id,&lt;br /&gt;
c.email,&lt;br /&gt;
trim(substr(v.val,13,10)) eaid,&lt;br /&gt;
trim(substr(v.val,23)) username&lt;br /&gt;
from MAIN_TABLE c,&lt;br /&gt;
(select max(rpad(company_id,12)||rpad(id,10)||username) val from JOIN_TABLE ea&lt;br /&gt;
where ea.LAST_LOGIN &amp;gt; &amp;#039;1-JAN-2006&amp;#039;&lt;br /&gt;
group by ea.company_id) v&lt;br /&gt;
where c.id = trim(substr(v.val,1,12))&lt;br /&gt;
and length(c.email) &amp;gt; 3&lt;br /&gt;
order by c.email asc, c.id desc;&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/KZkwdu5QfUw" height="1" width="1"/&gt;</description>
    <pubDate>Tue, 04 Dec 2007 07:24:28 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2007/12/inexpensive-max-queries-in-pl-sql/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2007/12/inexpensive-max-queries-in-pl-sql/</feedburner:origLink></item>
  <item>
    <title>A really clean dynamic insert proc for PL SQL ETL packages</title>
    <link>http://feedproxy.google.com/~r/Codeboxer/~3/4MCfBfAC7Jc/</link>
    <description>&lt;p&gt;A really clean dynamic insert proc for PL/SQL ETL packages. Pass in the table name, an array of field names and an array of values. Done.&lt;/p&gt;
&lt;p&gt;PROCEDURE insert_row( p_tblname in varchar2, p_colname in v_array, p_value in v_array)&lt;br /&gt;
IS&lt;br /&gt;
--This procedure dynamically builds an insert string and executes.&lt;br /&gt;
v_stmt clob;&lt;br /&gt;
v_ret  number;&lt;br /&gt;
v_cntflag number := 1; --default start counter&lt;br /&gt;
no_parse_error exception;&lt;br /&gt;
pragma exception_init(no_parse_error,-1003); -- no parse error&lt;/p&gt;
&lt;p&gt;BEGIN&lt;/p&gt;
&lt;p&gt;-- VALIDATION CHECK&lt;br /&gt;
 IF p_tblname IS NULL THEN RETURN;&lt;br /&gt;
 ELSIF p_colname IS NULL OR p_colname.COUNT = 0 THEN RETURN;&lt;br /&gt;
 END IF;&lt;/p&gt;
&lt;p&gt;--Build SQL statement for insert&lt;br /&gt;
v_stmt := &amp;#039;insert into &amp;#039; || p_tblname ||&amp;#039;@optional_dblink.server.xxx&amp;#039;|| &amp;#039; ( &amp;#039; || p_colname(1);&lt;/p&gt;
&lt;p&gt;    for i in 2 .. p_colname.count&lt;br /&gt;
    loop&lt;br /&gt;
      v_stmt := v_stmt || &amp;#039;, &amp;#039; || p_colname(i);&lt;br /&gt;
    end loop;&lt;/p&gt;
&lt;p&gt;if upper(p_colname(1)) = &amp;#039;ID&amp;#039; and p_value(1) = &amp;#039;-999&amp;#039; then&lt;br /&gt;
  v_cntflag := 2;&lt;br /&gt;
  v_stmt := v_stmt || &amp;#039;) values (&amp;#039;||p_tblname||&amp;#039;_SEQ.NEXTVAL@optional_dblink.server.xxx&amp;#039;;&lt;br /&gt;
else&lt;br /&gt;
  v_cntflag := 1;&lt;br /&gt;
  v_stmt := v_stmt || &amp;#039;) values ( :bv1&amp;#039;;&lt;br /&gt;
end if;&lt;/p&gt;
&lt;p&gt;    for i in 2 .. p_colname.count&lt;br /&gt;
    loop&lt;br /&gt;
      v_stmt := v_stmt || &amp;#039;, :bv&amp;#039; || i;&lt;br /&gt;
    end loop;&lt;/p&gt;
&lt;p&gt;v_stmt := v_stmt || &amp;#039;)&amp;#039;;&lt;br /&gt;
--dbms_output.put_line(v_stmt);&lt;/p&gt;
&lt;p&gt;        -- this check is done to ensure that there is no hard parse by storing previously&lt;br /&gt;
        -- parsed queries into a global array variable within this session&lt;br /&gt;
        -- Using dbms_sql instead of execute immediate because the number of bind variables is unknown.&lt;br /&gt;
        p_cursor := parse_tbl.first;&lt;br /&gt;
        while ( p_cursor IS NOT NULL and (parse_tbl(p_cursor) != v_stmt) )&lt;br /&gt;
        loop&lt;br /&gt;
            p_cursor := parse_tbl.next(p_cursor);&lt;br /&gt;
        end loop;&lt;/p&gt;
&lt;p&gt;        if ( p_cursor IS NULL or (parse_tbl(p_cursor) != v_stmt) )&lt;br /&gt;
        then&lt;br /&gt;
            p_cursor := dbms_sql.open_cursor;&lt;br /&gt;
            dbms_sql.parse(  p_cursor, v_stmt, dbms_sql.native );&lt;br /&gt;
            parse_tbl(p_cursor) := v_stmt;&lt;br /&gt;
        end if;&lt;/p&gt;
&lt;p&gt;    for i in v_cntflag .. p_value.count&lt;br /&gt;
    loop&lt;br /&gt;
      --dbms_output.put_line(&amp;#039;val&amp;#039;||i||&amp;#039;-&amp;#039;||p_value(i));&lt;br /&gt;
      dbms_sql.bind_variable( p_cursor, &amp;#039;:bv&amp;#039; || i, p_value(i) );&lt;br /&gt;
    end loop;&lt;/p&gt;
&lt;p&gt;    v_ret := dbms_sql.execute( p_cursor );&lt;/p&gt;
&lt;p&gt;EXCEPTION&lt;br /&gt;
WHEN no_parse_error then&lt;br /&gt;
            p_cursor := dbms_sql.open_cursor;&lt;br /&gt;
            dbms_sql.parse(p_cursor, v_stmt, dbms_sql.native );&lt;br /&gt;
            parse_tbl(p_cursor) := v_stmt;&lt;br /&gt;
            for i in v_cntflag .. p_value.count&lt;br /&gt;
            loop&lt;br /&gt;
              dbms_sql.bind_variable( p_cursor, &amp;#039;:bv&amp;#039; || i, p_value(i) );&lt;br /&gt;
            end loop;&lt;br /&gt;
            v_ret := dbms_sql.execute( p_cursor );&lt;/p&gt;
&lt;p&gt;WHEN OTHERS THEN&lt;br /&gt;
log_exception(&amp;#039;insert_row:&amp;#039; || p_tblname,   p_tblname,   SQLCODE || sqlerrm,   SUBSTR(query_text,   1,   400));&lt;br /&gt;
END insert_row;&lt;br /&gt;
&lt;/p&gt;&lt;br/&gt;&lt;img src="http://feeds.feedburner.com/~r/Codeboxer/~4/4MCfBfAC7Jc" height="1" width="1"/&gt;</description>
    <pubDate>Mon, 19 Nov 2007 07:01:59 +0000</pubDate>
    <guid isPermaLink="false">http://blog.kristeraxel.com/2007/11/a-really-clean-dynamic-insert-proc-for-pl-sql-etl-packages/</guid>
  <feedburner:origLink>http://blog.kristeraxel.com/2007/11/a-really-clean-dynamic-insert-proc-for-pl-sql-etl-packages/</feedburner:origLink></item>
</channel>
</rss>

