<?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:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-20715940</atom:id><lastBuildDate>Fri, 10 May 2013 08:11:11 +0000</lastBuildDate><category>cooking</category><category>javascript</category><category>funny</category><category>swing</category><category>C</category><category>perl</category><category>how to</category><category>UI</category><category>tomcat</category><category>teamsite</category><category>cookbook</category><category>solutions</category><category>note to self</category><category>algorithms</category><category>firefox</category><category>grails</category><category>linkage</category><category>tcsh</category><category>css</category><category>python</category><category>websphere</category><category>spring</category><category>nginx</category><category>xpath</category><category>freebsd</category><category>eclipse</category><category>webdev</category><category>cron</category><category>solaris</category><category>greasemonkey</category><category>ibatis</category><category>xml</category><category>hibernate</category><category>ant</category><category>fucking hp</category><category>catman</category><category>java</category><category>internet explorer</category><category>shameless plug</category><category>jsp</category><category>lucene</category><category>music</category><category>intellij</category><category>note to self books</category><category>RMI</category><category>oracle</category><category>tellurium</category><category>regex</category><category>jquery</category><category>infusion</category><category>sql</category><category>groovy</category><category>unix</category><category>subversion</category><title>Note to self</title><description>Code, cooking, catman</description><link>http://notetodogself.blogspot.com/</link><managingEditor>noreply@blogger.com (Mikhail Koryak)</managingEditor><generator>Blogger</generator><openSearch:totalResults>205</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/blogspot/notetoself" /><feedburner:info uri="blogspot/notetoself" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item><guid isPermaLink="false">tag:blogger.com,1999:blog-20715940.post-7404036622814545881</guid><pubDate>Tue, 25 Sep 2012 20:45:00 +0000</pubDate><atom:updated>2012-09-25T16:46:23.699-04:00</atom:updated><title>vertically center content in bootstrap</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
This is how you vertically center stuff in bootstrap:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;script class="brush: html" type='syntaxhighlighter'&gt;

html, body {
   height:100%;
   width:100%;
}

.container {
   background-color:red;
   height:100%;
   display:table;
   #main-container {
       display:table-cell;
       vertical-align:middle;
   }
}

&lt;/script&gt;

&lt;br /&gt;
This doesnt work in IE8 or less.&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/notetoself/~4/Mn0pa6mcKGk" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/notetoself/~3/Mn0pa6mcKGk/vertically-center-content-in-bootstrap.html</link><author>noreply@blogger.com (Mikhail Koryak)</author><thr:total>0</thr:total><feedburner:origLink>http://notetodogself.blogspot.com/2012/09/vertically-center-content-in-bootstrap.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-20715940.post-455827129954312593</guid><pubDate>Mon, 24 Sep 2012 15:18:00 +0000</pubDate><atom:updated>2012-09-24T11:22:48.208-04:00</atom:updated><title>install syntax highlighter 3.x on blogger</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
To install syntax highligher on blogger here what you need to do:&lt;br /&gt;
&lt;br /&gt;
Edit raw template html and put this after the HEAD tag:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;script class="brush: html" type="syntaxhighlighter"&gt;&lt;![CDATA[

&lt;link href='http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css' rel='stylesheet' type='text/css'/&gt;
&lt;script src='https://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js' type='text/javascript'/&gt;
&lt;script src='http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js' type='text/javascript'/&gt;
&lt;script src='http://alexgorbatchev.com/pub/sh/current/scripts/shAutoloader.js' type='text/javascript'/&gt;
&lt;style type='text/css'&gt;

pre {
    background-color: #F5F5F5;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 4px 4px 4px 4px;
    display: block;
    font-size: 13px;
    line-height: 20px;
    margin: 0 0 10px;
    padding: 9.5px;
    white-space: pre-wrap;
    word-break: break-all;
    word-wrap: break-word;
}
code, pre {
    border-radius: 3px 3px 3px 3px;
    color: #333333;
    font-family: Monaco,Menlo,Consolas,&amp;quot;Courier New&amp;quot;,monospace;
    font-size: 12px;
    padding: 0 3px 2px;
}

&lt;/style&gt;
]
&lt;/script&gt;&lt;/div&gt;
and put this at the bottom of the template before the closing HTML tag:


&lt;script class="brush: html" type="syntaxhighlighter"&gt;&lt;![CDATA[

&lt;script type='text/javascript'&gt;
$(function () {


SyntaxHighlighter.config.bloggerMode = true;


function syntaxFile()
{
  var args = arguments,
      result = [];
       
  for(var i = 0; i &lt; args.length; i++)
      result.push(args[i].replace(&amp;quot;@&amp;quot;, &amp;quot;http://alexgorbatchev.com/pub/sh/current/scripts/&amp;quot;));
       
  return result
};
 
SyntaxHighlighter.autoloader.apply(null, syntaxFile(
  &amp;quot;applescript            @shBrushAppleScript.js&amp;quot;,
  &amp;quot;actionscript3 as3      @shBrushAS3.js&amp;quot;,
  &amp;quot;bash shell             @shBrushBash.js&amp;quot;,
  &amp;quot;coldfusion cf          @shBrushColdFusion.js&amp;quot;,
  &amp;quot;cpp c                  @shBrushCpp.js&amp;quot;,
  &amp;quot;c# c-sharp csharp      @shBrushCSharp.js&amp;quot;,
  &amp;quot;css                    @shBrushCss.js&amp;quot;,
  &amp;quot;delphi pascal          @shBrushDelphi.js&amp;quot;,
  &amp;quot;diff patch pas         @shBrushDiff.js&amp;quot;,
  &amp;quot;erl erlang             @shBrushErlang.js&amp;quot;,
  &amp;quot;groovy                 @shBrushGroovy.js&amp;quot;,
  &amp;quot;java                   @shBrushJava.js&amp;quot;,
  &amp;quot;jfx javafx             @shBrushJavaFX.js&amp;quot;,
  &amp;quot;js jscript javascript  @shBrushJScript.js&amp;quot;,
  &amp;quot;perl pl                @shBrushPerl.js&amp;quot;,
  &amp;quot;php                    @shBrushPhp.js&amp;quot;,
  &amp;quot;text plain             @shBrushPlain.js&amp;quot;,
  &amp;quot;py python              @shBrushPython.js&amp;quot;,
  &amp;quot;ruby rails ror rb      @shBrushRuby.js&amp;quot;,
  &amp;quot;sass scss              @shBrushSass.js&amp;quot;,
  &amp;quot;scala                  @shBrushScala.js&amp;quot;,
  &amp;quot;sql                    @shBrushSql.js&amp;quot;,
  &amp;quot;vb vbnet               @shBrushVb.js&amp;quot;,
  &amp;quot;xml xhtml xslt html    @shBrushXml.js&amp;quot;
));

SyntaxHighlighter.all();


});
&lt;/script&gt;]
&lt;/script&gt;

&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
NOTE:&lt;br /&gt;
If the javascript snippet above you must escape all html entities. They are shown as non-escaped becase of limitations of blogger. You will have to replace all of ' with&amp;nbsp;@quot; and &amp;lt; with &amp;lt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/notetoself/~4/x5xRuDZn1RI" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/notetoself/~3/x5xRuDZn1RI/install-syntax-highlighter-3x-on-blogger.html</link><author>noreply@blogger.com (Mikhail Koryak)</author><thr:total>0</thr:total><feedburner:origLink>http://notetodogself.blogspot.com/2012/09/install-syntax-highlighter-3x-on-blogger.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-20715940.post-668731591883465539</guid><pubDate>Mon, 17 Sep 2012 21:56:00 +0000</pubDate><atom:updated>2012-09-21T13:43:24.165-04:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">nginx</category><title>A/B Testing with nginx via rewrite </title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Here is how you can setup 50% of your users to see a different homepage via nginx.&lt;br /&gt;
&lt;br /&gt;
We split them based on the last digit of their IP address:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;
location / {
    if ($remote_addr ~ "[02468]$") {
        rewrite ^(.+)$ /a$1 last;
    }
    rewrite ^(.+)$ /b$1 last;
}
location /a {
    alias   /Users/dogself/site;
    index  index.html index.htm;
    ssi    on;
}
location /b {
    alias   /Users/dogself/site;
    index  index2.html index2.htm;
    ssi    on;
}
&lt;/pre&gt;
&lt;br /&gt;
The trick here is that instead of using the root directive you should use the alias directive. Using alias means that you dont need to create an 'a' and 'b' directories on your server for this to work.&lt;br /&gt;
&lt;br /&gt;
The downside is that now you have /a/ and /b/ in your path. If you know a way around that, let me know!&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/notetoself/~4/Jka7C8Clw7o" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/notetoself/~3/Jka7C8Clw7o/ab-testing-with-nginx-via-rewrite.html</link><author>noreply@blogger.com (Mikhail Koryak)</author><thr:total>0</thr:total><feedburner:origLink>http://notetodogself.blogspot.com/2012/09/ab-testing-with-nginx-via-rewrite.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-20715940.post-8170555912183736445</guid><pubDate>Mon, 17 Sep 2012 16:42:00 +0000</pubDate><atom:updated>2012-09-17T12:42:48.563-04:00</atom:updated><title>How To Install Node.js on RasberryPi </title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
This will let you install the latest version of &lt;a href="http://nodejs.org/"&gt;node.js&lt;/a&gt; on a Raspberry Pi running &lt;a href="http://learn.adafruit.com/adafruit-raspberry-pi-educational-linux-distro/occidentalis-v0-dot-2"&gt;occidentalis 0.2&lt;/a&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
git clone https://github.com/joyent/node.git&lt;br /&gt;
cd node&lt;br /&gt;
export GYP_DEFINES="armv7=0"&lt;br /&gt;
export CXXFLAGS='-march=armv6 -mfpu=vfp -mfloat-abi=hard -DUSE_EABI_HARDFLOAT'&lt;br /&gt;
export CCFLAGS='-march=armv6 -mfpu=vfp -mfloat-abi=hard -DUSE_EABI_HARDFLOAT'&lt;br /&gt;
./configure --shared-openssl --without-snapshot&lt;br /&gt;
make&lt;br /&gt;
make install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Compiling node will take about 4-5 hours.&lt;br /&gt;
&lt;br /&gt;
but at the end you will be rewarded with:&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;pi@raspberrypi ~ $ node --version&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;v0.9.2-pre&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/notetoself/~4/qgk6YEIFU_o" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/notetoself/~3/qgk6YEIFU_o/how-to-install-nodejs-on-rasberrypi.html</link><author>noreply@blogger.com (Mikhail Koryak)</author><thr:total>1</thr:total><feedburner:origLink>http://notetodogself.blogspot.com/2012/09/how-to-install-nodejs-on-rasberrypi.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-20715940.post-5910882767383200981</guid><pubDate>Wed, 15 Aug 2012 15:02:00 +0000</pubDate><atom:updated>2012-09-21T13:24:37.334-04:00</atom:updated><title>Instrument javascript functions with before and after hooks</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;b&gt;Use-Case:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
I have a javascript class that i want to intrument in an aspect oriented programming (AOP) style by adding before and after hooks to every method in the class. I want to do this generically.&lt;br /&gt;
&lt;br /&gt;
The before function should take the same arguments as the instrumented function and return a set of modified (or not) arguments for the instrumented function.&lt;br /&gt;
&lt;br /&gt;
The after function should take the same arguments as the arguments passed to the instrumented function.&lt;br /&gt;
&lt;br /&gt;
You can also do other things, for example the before function could abort the call to the instrumented function and the after function could munge the returned value.&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;Solution:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
I decided to add the before and after functions as properties of the instrumented function. Remember, in javascript functions are also objects and can have properties added just like any javascript object. &lt;br /&gt;
&lt;br /&gt;
Once my class's functions are instrumented the code that uses the class remains the same, but new code can now define the new before and after functions:&lt;br /&gt;
MyClass.someMethod.before = function(...) { ... }&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Code:&lt;/b&gt;&lt;br /&gt;
Note: This code makes use of &lt;a href="http://underscorejs.org/"&gt;underscore.js&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;script class="brush: js" type="syntaxhighlighter"&gt;

var instrumentFunctions = function(obj){ //add 'before' and 'after' functions to each public function in the behavior. 'before' function can optionally return an array of the modified arguments
    _.each(obj, function(func, funcName){
        if(_.isFunction(func)){
            obj[funcName] = _.wrap(func, function(fn){
                var wrappedArgs = _.toArray(arguments).slice(1);
                wrappedArgs = obj[funcName].before &amp;&amp; obj[funcName].before.apply(this, wrappedArgs) || wrappedArgs;
                var ret = fn.apply(this, wrappedArgs);
                obj[funcName].after &amp;&amp; obj[funcName].after.apply(this, wrappedArgs);
                return ret;
            }); 
        }
    });
    return obj;
};

var obj = instrumentFunctions({test: function(x){ return x * 2; }, 'name': 'double' });
var result = obj.test(2);
console.log('result', result); 
//after this call the following is printed to console:
//result 4

obj.test.before = function(x) { return x + 3; };
obj.test.after  = function(x) { console.log('finished test'); };
 
var result = obj.test(2);
console.log('result', result); 
//after this call the following is printed to console:
//result 10
//finished test
&lt;/script&gt;

&lt;b&gt;Final Thoughts:&lt;/b&gt;&lt;br /&gt;
The code as it stands now does not allow the programmer to define multiple before and after functions, only a single one can exist at one time. In the future I may consider supporting binding multiple functions.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/notetoself/~4/q54uG3FoxOc" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/notetoself/~3/q54uG3FoxOc/instrument-javascript-functions-with.html</link><author>noreply@blogger.com (Mikhail Koryak)</author><thr:total>0</thr:total><feedburner:origLink>http://notetodogself.blogspot.com/2012/08/instrument-javascript-functions-with.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-20715940.post-4690716539488085617</guid><pubDate>Wed, 25 Jul 2012 20:07:00 +0000</pubDate><atom:updated>2012-09-21T13:45:12.673-04:00</atom:updated><title>get table sizes of MySQL database</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;pre&gt;mysql&amp;gt; SELECT count(*) tables,
    -&amp;gt;   concat(round(sum(table_rows)/1000000,2),'M') rows,
    -&amp;gt;   concat(round(sum(data_length)/(1024*1024*1024),2),'G') data,
    -&amp;gt;   concat(round(sum(index_length)/(1024*1024*1024),2),'G') idx,
    -&amp;gt;   concat(round(sum(data_length+index_length)/(1024*1024*1024),2),'G') total_size,
    -&amp;gt;   round(sum(index_length)/sum(data_length),2) idxfrac
    -&amp;gt; FROM information_schema.TABLES;
+--------+---------+--------+--------+------------+---------+
| tables | rows    | data   | idx    | total_size | idxfrac |
+--------+---------+--------+--------+------------+---------+
|    389 | 325.92M | 74.15G | 26.63G | 100.78G    |    0.36 |
+--------+---------+--------+--------+------------+---------+
1 row in set, 14 warnings (15.45 sec)
&lt;/pre&gt;
&lt;br /&gt;
To get the details for one table, using something like:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;
mysql&amp;gt; SELECT count(*) tables,
    -&amp;gt;        concat(round(sum(table_rows)/1000000,2),'M') rows,
    -&amp;gt;        concat(round(sum(data_length)/(1024*1024*1024),2),'G') data,
    -&amp;gt;        concat(round(sum(index_length)/(1024*1024*1024),2),'G') idx,
    -&amp;gt;        concat(round(sum(data_length+index_length)/(1024*1024*1024),2),'G') total_size,
    -&amp;gt;        round(sum(index_length)/sum(data_length),2) idxfrac
    -&amp;gt;        FROM information_schema.TABLES
    -&amp;gt;        WHERE  table_name like "users";
+--------+-------+-------+-------+------------+---------+
| tables | rows  | data  | idx   | total_size | idxfrac |
+--------+-------+-------+-------+------------+---------+
|      1 | 3.47M | 0.58G | 0.21G | 0.78G      |    0.36 |
+--------+-------+-------+-------+------------+---------+
1 row in set (0.27 sec)
&lt;/pre&gt;
&lt;br /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/notetoself/~4/e3AZzzF3yec" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/notetoself/~3/e3AZzzF3yec/get-table-sizes-of-mysql-database.html</link><author>noreply@blogger.com (Mikhail Koryak)</author><thr:total>0</thr:total><feedburner:origLink>http://notetodogself.blogspot.com/2012/07/get-table-sizes-of-mysql-database.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-20715940.post-6236607228660529827</guid><pubDate>Sat, 03 Dec 2011 22:20:00 +0000</pubDate><atom:updated>2011-12-03T17:20:21.326-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">solutions</category><category domain="http://www.blogger.com/atom/ns#">how to</category><title>configure boxee to work as a second monitor with sound over hdmi</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;My HTPC setup is simple:&lt;br /&gt;
I ran a 40 foot HDMI cable from my computer room into my bedroom through the basement. I hooked up my TV in the bedroom to be the 2nd monitor on my PC and set boxee to run on that monitor. &lt;br /&gt;
&lt;br /&gt;
The problem:&lt;br /&gt;
I wanted to have Boxee use sound over hdmi, but also be able to listen to to music and play games on my computer as usual without the sound coming from the bedroom TV.&lt;br /&gt;
&lt;br /&gt;
Solution:&lt;br /&gt;
In your windows sound prefs set:&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;&lt;li&gt;"Speakers" as your default audio device&lt;/li&gt;
&lt;li&gt;"HDMI digital output" as your default communication device&lt;/li&gt;
&lt;/ul&gt;In boxee sound config set:&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;&lt;li&gt; primary soundcard: HDMI digial sound&lt;/li&gt;
&lt;/ul&gt;restart boxee. Now you should be able to hear HDMI sound only on the TV, and all other sound will come from your speakers.&amp;nbsp; &lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/notetoself/~4/USPXlB5gPSY" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/notetoself/~3/USPXlB5gPSY/configure-boxee-to-work-as-second.html</link><author>noreply@blogger.com (Mikhail Koryak)</author><thr:total>0</thr:total><feedburner:origLink>http://notetodogself.blogspot.com/2011/12/configure-boxee-to-work-as-second.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-20715940.post-1483245347085981877</guid><pubDate>Wed, 19 Oct 2011 03:03:00 +0000</pubDate><atom:updated>2011-10-18T23:03:19.315-04:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">fucking hp</category><title>Photosmart CN216 no LCD or power lights</title><description>I have a brand new (POS) HP Photosmart CN216 all in one print/scan/copy/web printer.&lt;br /&gt;
The only trouble is that sometimes it will power on, but no lights come on. The power light is not not blue, and the LCD is off. At the same time, the printer is on because its making the normal noises.&lt;br /&gt;
&lt;br /&gt;
I was about to return it to HP since once this happens no amount of pressing the power button will "turn it back on". I found a solution:&lt;br /&gt;
&lt;br /&gt;
The fix is to open the printer as if you were about to replace the ink cartridges, then SLAM it shut. It helps if you are are angry, but you will be when your brand new 100$ wireless printer doesnt work. This will cause it to turn on properly. &lt;br /&gt;
&lt;br /&gt;
The downside to this solution is that it cannot be done at night when people are sleeping&lt;img src="http://feeds.feedburner.com/~r/blogspot/notetoself/~4/kx-ShvtNpsc" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/notetoself/~3/kx-ShvtNpsc/photosmart-cn216-no-lcd-or-power-lights.html</link><author>noreply@blogger.com (Mikhail Koryak)</author><thr:total>0</thr:total><feedburner:origLink>http://notetodogself.blogspot.com/2011/10/photosmart-cn216-no-lcd-or-power-lights.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-20715940.post-4810085324801929530</guid><pubDate>Thu, 29 Sep 2011 15:18:00 +0000</pubDate><atom:updated>2011-09-29T11:18:00.236-04:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">sql</category><title>mysql function example</title><description>delimiter //&lt;br /&gt;
create function mytest ()  returns char(50) deterministic&lt;br /&gt;
begin&lt;br /&gt;
declare c int;&lt;br /&gt;
select count(*) into c from table;&lt;br /&gt;
return c;&lt;br /&gt;
end&lt;br /&gt;
//&lt;br /&gt;
delimiter ;&lt;img src="http://feeds.feedburner.com/~r/blogspot/notetoself/~4/SRsAFCAoGi0" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/notetoself/~3/SRsAFCAoGi0/mysql-function-example.html</link><author>noreply@blogger.com (Mikhail Koryak)</author><thr:total>1</thr:total><feedburner:origLink>http://notetodogself.blogspot.com/2011/09/mysql-function-example.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-20715940.post-2174018467114007588</guid><pubDate>Fri, 08 Jul 2011 18:24:00 +0000</pubDate><atom:updated>2011-07-08T14:31:30.373-04:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">python</category><category domain="http://www.blogger.com/atom/ns#">how to</category><title>Python: remove some entries from a dict</title><description>&lt;b&gt;Problem&lt;/b&gt;: &lt;br /&gt;
Remove a bunch of entries from a dict in an elegant way&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Solution 1&lt;/b&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;map(lambda name: dict.pop(name, None), ['some_key', 'some_other_key', 'bleee'])&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Solution 2&lt;/b&gt;:&lt;br /&gt;
My coworker &lt;a href="http://ohthehugemanatee.net/"&gt;Dave&lt;/a&gt; came up with an even better way to do this thing:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;map(dict.pop, ['some_key', 'some_other_key', 'bleee'], [])&lt;/b&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/notetoself/~4/PoHkvC1RQd8" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/notetoself/~3/PoHkvC1RQd8/python-remove-some-entries-from-dict.html</link><author>noreply@blogger.com (Mikhail Koryak)</author><thr:total>0</thr:total><feedburner:origLink>http://notetodogself.blogspot.com/2011/07/python-remove-some-entries-from-dict.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-20715940.post-4737666585483595386</guid><pubDate>Thu, 07 Apr 2011 03:36:00 +0000</pubDate><atom:updated>2011-05-17T09:03:25.300-04:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">how to</category><category domain="http://www.blogger.com/atom/ns#">grails</category><title>Grails: Securing CKEditor URLs</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;b&gt;Problem:&lt;/b&gt;&lt;br /&gt;
I am using the grails &lt;a href="http://grails.org/plugin/ckeditor"&gt;CKEditor plugin&lt;/a&gt;&lt;b&gt; &lt;/b&gt;and i wanted to secure the file manager urls to be accessed only by a site admin. I am using the &lt;a href="http://www.grails.org/plugin/spring-security-core"&gt;Spring Security Core&lt;/a&gt; plugin for site security, but i was already using annotations elsewhere on my site, so using a &lt;span class="Apple-style-span" style="border-collapse: separate; color: black; font-family: 'Times New Roman'; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: monospace; font-size: 12px;"&gt;InterceptUrlMap &lt;/span&gt;&lt;/span&gt;was not an option.&lt;br /&gt;
&lt;br /&gt;
So, how to keep using annotations and secure a plugin's urls?&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Solution:&lt;/b&gt;&lt;br /&gt;
The trick is properly using the controllerAnnotations.staticRules (which really isnt that hard if you pay attention to the docs).&lt;br /&gt;
Here is the mapping that works for ANY url mapping you define to CKEditor:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="border-collapse: separate; color: black; font-family: 'Times New Roman'; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="border-collapse: separate; color: black; font-family: 'Times New Roman'; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: courier,'courier new',monospace; font-size: 12px; line-height: 12px; white-space: pre;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;script class="brush: java" type="syntaxhighlighter"&gt;
grails.plugins.springsecurity.controllerAnnotations.staticRules = [
   '/openFileManagerConnector/show': ['IS_AUTHENTICATED_ANONYMOUSLY'],
   '/standardFileManagerConnector/show': ['IS_AUTHENTICATED_ANONYMOUSLY'],
   '/openFileManagerConnector/**': ['ROLE_ADMIN'],
   '/standardFileManagerConnector/**': ['ROLE_ADMIN'],
]
&lt;/script&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/notetoself/~4/nHh_kRaoz9E" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/notetoself/~3/nHh_kRaoz9E/grails-securing-ckeditor-urls.html</link><author>noreply@blogger.com (Mikhail Koryak)</author><thr:total>0</thr:total><feedburner:origLink>http://notetodogself.blogspot.com/2011/04/grails-securing-ckeditor-urls.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-20715940.post-1933003684659774376</guid><pubDate>Fri, 25 Mar 2011 02:51:00 +0000</pubDate><atom:updated>2011-03-24T22:51:20.283-04:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">solutions</category><category domain="http://www.blogger.com/atom/ns#">grails</category><category domain="http://www.blogger.com/atom/ns#">groovy</category><title>manually set id of grails domain object</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;b&gt;Problem:&lt;/b&gt;&lt;br /&gt;
if you create a new domain object and set its id in the constructor like this:&lt;br /&gt;
&lt;i&gt;Cat catman = new Cat(id:1000, name: "catman", kind: "domestic short haired")&lt;/i&gt;&lt;br /&gt;
later, if you look at the object the id will be null. what gives?!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Solution:&lt;/b&gt;&lt;br /&gt;
Its madness, but it works to assign the id after the object is made. Just add&lt;br /&gt;
&lt;i&gt;catman.setId(1000);&lt;/i&gt;&lt;br /&gt;
and you are in business.&lt;br /&gt;
&lt;br /&gt;
Note: if you want to save the object into db after doing this, you must set the id generator to 'assigned'&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/notetoself/~4/SKY-01cQT98" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/notetoself/~3/SKY-01cQT98/manually-set-id-of-grails-domain-object.html</link><author>noreply@blogger.com (Mikhail Koryak)</author><thr:total>4</thr:total><feedburner:origLink>http://notetodogself.blogspot.com/2011/03/manually-set-id-of-grails-domain-object.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-20715940.post-8201952337843734091</guid><pubDate>Mon, 14 Mar 2011 01:58:00 +0000</pubDate><atom:updated>2011-03-13T21:58:26.360-04:00</atom:updated><title>lg cdma usb modem driver</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;The lg mobile phone driver is hard to find. i am using it to make bitpim work with my phone.&lt;br /&gt;
&lt;br /&gt;
It will work with all LG VX-something phones and also is sometimes called this:&lt;br /&gt;
&lt;br /&gt;
Prolific USB-to-Serial Comm Port Driver&lt;br /&gt;
LGE CDMA Composite USB Device Driver&lt;br /&gt;
LGE CDMA USB Modem Driver&lt;br /&gt;
LGE CDMA USB Modem Diagnostic Serial Port Driver&lt;br /&gt;
LGE CDMA USB Modem (VCOMM) Driver&lt;br /&gt;
LGE CDMA USB Modem Diagnostic Serial Port (VCOMM) Driver&lt;br /&gt;
LGE CDMA USB Serial Port Driver&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
get it here:&lt;br /&gt;
&lt;a href="http://programmingdrunk.com/random-stuff/LGUSBModemDriver_4.6_WHQL.zip"&gt;http://programmingdrunk.com/random-stuff/LGUSBModemDriver_4.6_WHQL.zip&lt;/a&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/notetoself/~4/DvuPFHV_73I" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/notetoself/~3/DvuPFHV_73I/lg-cdma-usb-modem-driver.html</link><author>noreply@blogger.com (Mikhail Koryak)</author><thr:total>11</thr:total><feedburner:origLink>http://notetodogself.blogspot.com/2011/03/lg-cdma-usb-modem-driver.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-20715940.post-8507826242680524980</guid><pubDate>Mon, 21 Feb 2011 17:11:00 +0000</pubDate><atom:updated>2011-02-21T12:11:17.852-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">solutions</category><category domain="http://www.blogger.com/atom/ns#">ant</category><title>Class needed by SvnTask cannot be found</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;b&gt;problem:&lt;/b&gt;&lt;br /&gt;
getting this error when trying to build:&lt;br /&gt;
&lt;br /&gt;
taskdef A class needed by class org.tigris.subversion.svnant.SvnTask cannot be found: org/tigris/subversion/svnclientadapter/SVNClientException&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;solution:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
I didnt unzip all libs that came with svnant into my lib folder. Only unzipped svnant.jar. need to put them all in there.&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/notetoself/~4/0PaSIfkofwU" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/notetoself/~3/0PaSIfkofwU/class-needed-by-svntask-cannot-be-found.html</link><author>noreply@blogger.com (Mikhail Koryak)</author><thr:total>0</thr:total><feedburner:origLink>http://notetodogself.blogspot.com/2011/02/class-needed-by-svntask-cannot-be-found.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-20715940.post-6823252007773280377</guid><pubDate>Mon, 07 Feb 2011 04:05:00 +0000</pubDate><atom:updated>2011-02-21T11:54:06.693-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">how to</category><category domain="http://www.blogger.com/atom/ns#">tomcat</category><title>Multiple domains with tomcat behind apache</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;This is how you would host multiple domains/webapps on a single tomcat behind apache via mod-jk.&lt;br /&gt;
&lt;br /&gt;
first &lt;a href="http://notetodogself.blogspot.com/2011/02/linode-how-to-install-modjk-tomcat.html"&gt;setup tomcat behind apache&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
I am setting up a new domain called dogself.com:&lt;br /&gt;
&lt;br /&gt;
in &lt;i&gt;server.xml&lt;/i&gt; add this under last host:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&amp;lt;Host name="dogself.com"  appBase="webapps-dogself"
  unpackWARs="true" autoDeploy="true"
  xmlValidation="false" xmlNamespaceAware="false"&amp;gt;
&amp;lt;alias&amp;gt;www.dogself.com&amp;lt;alias&amp;gt;
&amp;lt;/Host&amp;gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;and also add another connector port:&lt;/pre&gt;&lt;pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;pre&gt;&amp;lt;Connector port="8010" protocol="AJP/1.3" redirectPort="8443" /&amp;gt; &lt;/pre&gt;&lt;/pre&gt;&lt;br /&gt;
create a &lt;i&gt;webapps-dogself&lt;/i&gt; directory next to &lt;i&gt;webapps &lt;/i&gt;and give it the same permissions&lt;br /&gt;
&lt;br /&gt;
in your virtualhost apache config:&lt;br /&gt;
&lt;pre&gt;ServerName dogself.com 
JkMount  /* dogself&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;in workers.properties add dogself worker to list:&lt;br /&gt;
&lt;pre&gt;worker.list=another,dogself

# Define dogself
worker.dogself.port=8010&lt;/pre&gt;&lt;pre&gt;worker.dogself.host=dogself.com
worker.dogself.type=ajp13&amp;nbsp;&lt;/pre&gt;&lt;br /&gt;
If you want the manager app to work on the domain you need to: &lt;br /&gt;
&lt;pre&gt;mkdir /etc/tomcat6/Catalina/dogself.com &lt;/pre&gt;&lt;br /&gt;
and copy the manager.xml into it from &lt;i&gt;/etc/tomcat6/Catalina/localhost&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
in &lt;i&gt;/var/lib/tomcat6&lt;/i&gt; create a &lt;i&gt;webapps-dogself&lt;/i&gt; dir and give it 0775 perms and chown it to tomcat:tomcat&lt;br /&gt;
&lt;br /&gt;
restart tomcat and apache&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Troubleshooting:&lt;/b&gt;&lt;br /&gt;
if you get error:&lt;br /&gt;
&lt;i&gt;worker dogself can't resolve tomcat address dogself.com&lt;/i&gt;&lt;br /&gt;
Check that your dns a/aaaa records point to your ip. Comment out the worker in workers.properties and see if you can get to the apache vhost. &lt;br /&gt;
&lt;br /&gt;
if any of the domains seems to point to another domain, ie the war that is running on one domain is incorrect. check if you are in the www.domain and if you have aliased the www both in tomcat and in apache. if you dont alias the www correctly tomcat will send you the the defaultDomain as defined in server.xml&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/notetoself/~4/77sDTmqLjdk" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/notetoself/~3/77sDTmqLjdk/multiple-domains-with-tomcat-behind.html</link><author>noreply@blogger.com (Mikhail Koryak)</author><thr:total>1</thr:total><feedburner:origLink>http://notetodogself.blogspot.com/2011/02/multiple-domains-with-tomcat-behind.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-20715940.post-6477436830164866767</guid><pubDate>Fri, 04 Feb 2011 03:35:00 +0000</pubDate><atom:updated>2011-02-03T22:35:01.659-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">how to</category><category domain="http://www.blogger.com/atom/ns#">tomcat</category><title>Linode: how to install mod_jk, tomcat behind apache</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div&gt;This "tutorial" is for Ubuntu 10.04 LTS (Lucid).&lt;br /&gt;
This is how you would set up Tomcat6 behind Apache2 via mod_jk&lt;br /&gt;
&lt;br /&gt;
I am assuming that you have &lt;a href="http://library.linode.com/lamp-guides/ubuntu-10.04-lucid/"&gt;apache2 installed&lt;/a&gt; and tomcat6 installed. I also assume you have deployed and can find your tomcat app possibly on port 8080 of your linode.&lt;br /&gt;
&lt;br /&gt;
&lt;ol style="text-align: left;"&gt;&lt;li&gt;Install mod_jk: &lt;span class="Apple-style-span" style="border-collapse: separate; color: black; font-family: 'Times New Roman'; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span class="Apple-style-span" style="color: #333333; font-family: helvetica,verdana,tahoma,arial,sans-serif; font-size: 15px; line-height: 20px;"&gt;&lt;pre class="literal-block" style="background-color: #122312; border: 1px solid rgb(160, 160, 160); color: white; font-family: Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif; font-size: 12.5px; line-height: 15px; overflow: auto; padding: 10px;"&gt;apt-get install libapache2-mod-jk&lt;/pre&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Create workers.properties in &lt;i&gt;/etc/apache2/&lt;/i&gt; and add the following into it:&lt;pre&gt;# this lives in /etc/apache2/workers.properties
# workers.properties - ajp13
#
# List workers
worker.list=worker1

# Define worker1
worker.worker1.port=8009
worker.worker1.host=localhost
worker.worker1.type=ajp13
&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;Edit your apache2 config in &lt;i&gt;/etc/apache2/apache2.conf&lt;/i&gt; and add this to the end:&lt;br /&gt;
&lt;pre&gt;# tomcat connector stuff:
JkWorkersFile /etc/apache2/workers.properties
# Where to put jk shared memory
JkShmFile     /var/log/apache2/mod_jk.shm
# Where to put jk logs
JkLogFile     /var/log/apache2/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel    info
# Select the timestamp log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] 
&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;In your &lt;i&gt;/etc/apache2/sites-enabled/&lt;/i&gt; dir find the vhost you want to use tomcat and edit it, at the end of the vhost declaration put:&lt;br /&gt;
&lt;pre&gt;#Everything under root goes to tomcat
JkMount  /* worker1
#html files should be served by apache2
JkUnMount /*.html worker1
&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Edit &lt;i&gt;/etc/tomcat6/server.xml&lt;/i&gt; and make sure that the ajp connector is uncommented:&lt;br /&gt;
&lt;pre&gt;&amp;lt;connector port="8009" protocol="AJP/1.3" redirectport="8443" /&amp;gt;
&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;restart tomcat: &lt;i&gt;/etc/init.d/tomcat6 restart&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;restart apache: &lt;i&gt;/etc/init.d/apache2 restart&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;navigate to yourdomain.com/ and you should be all tomcatted&lt;br /&gt;
&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/notetoself/~4/XXzdMAB79MM" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/notetoself/~3/XXzdMAB79MM/linode-how-to-install-modjk-tomcat.html</link><author>noreply@blogger.com (Mikhail Koryak)</author><thr:total>9</thr:total><feedburner:origLink>http://notetodogself.blogspot.com/2011/02/linode-how-to-install-modjk-tomcat.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-20715940.post-2331870143146180346</guid><pubDate>Wed, 26 Jan 2011 16:14:00 +0000</pubDate><atom:updated>2011-01-26T11:14:13.459-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">how to</category><title>How to make your bed for engineers</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Being an engineer I am always looking for more efficient ways to do all manner of household tasks. &lt;br /&gt;
Making the bed has never been my strong point. My wife makes the bed faster than me, and it always looks better. I have long given up trying to figure out her technique, she probably just has many more years of experience than me. She is a principal bed maker while i am just a bed maker intern.&lt;br /&gt;
&lt;br /&gt;
Yesterday a friend of mine shared a bed making technique with me that has improved the tidiness and speed of bed making. I would like to share this technique with you!&lt;br /&gt;
&lt;br /&gt;
The secret to making large beds efficiently is to make the bed while you are in it! Being in the middle of the bed gives you maximum reach to both sides, where you can straighten out the covers. You no longer need to make several passes from one side of the bed to the other. After you get the bed looking nice, carefully roll out. Chances are that you will need just one more pass to fix the wrinkles in the covers.&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/notetoself/~4/_sAY972KNFo" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/notetoself/~3/_sAY972KNFo/how-to-make-your-bed-for-engineers.html</link><author>noreply@blogger.com (Mikhail Koryak)</author><thr:total>0</thr:total><feedburner:origLink>http://notetodogself.blogspot.com/2011/01/how-to-make-your-bed-for-engineers.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-20715940.post-4726917336245093059</guid><pubDate>Thu, 23 Dec 2010 22:18:00 +0000</pubDate><atom:updated>2010-12-23T17:18:18.438-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">javascript</category><title>after a request, page reloads 2 times and contains very little html</title><description>I just fixed a very strange issue in our application.&lt;br /&gt;
&lt;br /&gt;
It went something like this:&lt;br /&gt;
User would click on a link that opened another page. This page would flash for a second, then another page would open containing just the string "2010".&lt;br /&gt;
&lt;br /&gt;
The bug came from QA as being a regression related to recent development, so i started debugging in the code. There was &lt;b&gt;nothing&lt;/b&gt; in the logs. &lt;br /&gt;
&lt;br /&gt;
Then i opened firebug, went into "net" mode and persisted it. I saw my original request made, along with headers, and then another request made, this one had no headers at all.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Solution:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
document.write is evil. There was recently a change to the code which attempted to make the copyright year dynamic by replacing it with&lt;br /&gt;
&lt;i&gt;document.write(new Date().getFullYear());&lt;/i&gt;&lt;br /&gt;
inside of a script tag. This alone wouldn't cause the issue, but document.write only works correctly if its called when the page is being rendered. If the page is rendered, it will overwrite the entire page with whatever its writing out. The issue was the the page the user was going to next, was gotten via ajax, and thus the script was called &lt;b&gt;after &lt;/b&gt;the page was loaded, overwriting the entire page. &lt;br /&gt;
&lt;br /&gt;
Oh the glory of being a programmer.&lt;img src="http://feeds.feedburner.com/~r/blogspot/notetoself/~4/TdpnkiLGFVc" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/notetoself/~3/TdpnkiLGFVc/after-request-page-reloads-2-times-and.html</link><author>noreply@blogger.com (Mikhail Koryak)</author><thr:total>0</thr:total><feedburner:origLink>http://notetodogself.blogspot.com/2010/12/after-request-page-reloads-2-times-and.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-20715940.post-3801247530116608246</guid><pubDate>Mon, 13 Dec 2010 18:20:00 +0000</pubDate><atom:updated>2010-12-13T13:20:46.430-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">linkage</category><title>batch script to delete cvs files</title><description>for /f "tokens=*" %%i in ('dir /b/a/s CVS*') do @rmdir /q /s "%%i"&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
source: &lt;a href="http://www.danieltome.com/blog/2007/01/13/delete-cvs-files/"&gt;http://www.danieltome.com/blog/2007/01/13/delete-cvs-files/&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/notetoself/~4/vd8QN1SgWzE" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/notetoself/~3/vd8QN1SgWzE/batch-script-to-delete-cvs-files.html</link><author>noreply@blogger.com (Mikhail Koryak)</author><thr:total>0</thr:total><feedburner:origLink>http://notetodogself.blogspot.com/2010/12/batch-script-to-delete-cvs-files.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-20715940.post-8350185307940606626</guid><pubDate>Sun, 05 Dec 2010 03:38:00 +0000</pubDate><atom:updated>2010-12-05T00:08:56.151-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">groovy</category><title>Convert map to object in groovy</title><description>You need to convert a map into an object in groovy. There must be a better way then iterating through the map and setting all the properties in the object via reflection or otherwise. There is:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;script class="brush: java" type="syntaxhighlighter"&gt;

def MyObject mapToObject(def map){
   new MyObject( map.findAll { k, v -&gt; k in MyObject.metaClass.properties*.name})
}

&lt;/script&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/notetoself/~4/PtpUIvz4rfk" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/notetoself/~3/PtpUIvz4rfk/convert-map-to-object-in-groovy.html</link><author>noreply@blogger.com (Mikhail Koryak)</author><thr:total>1</thr:total><feedburner:origLink>http://notetodogself.blogspot.com/2010/12/convert-map-to-object-in-groovy.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-20715940.post-5030544915883898306</guid><pubDate>Sun, 05 Dec 2010 03:34:00 +0000</pubDate><atom:updated>2010-12-04T22:35:13.015-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">how to</category><title>posting with syntaxhighlighter</title><description>I always forget the markup for posting syntax highlighted code. here it is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script class="brush: java" type="syntaxhighlighter"&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
thank me later&lt;img src="http://feeds.feedburner.com/~r/blogspot/notetoself/~4/3LeXtJNll-0" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/notetoself/~3/3LeXtJNll-0/posting-with-syntaxhighlighter.html</link><author>noreply@blogger.com (Mikhail Koryak)</author><thr:total>0</thr:total><feedburner:origLink>http://notetodogself.blogspot.com/2010/12/posting-with-syntaxhighlighter.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-20715940.post-7452434373576676503</guid><pubDate>Thu, 02 Dec 2010 04:48:00 +0000</pubDate><atom:updated>2010-12-01T23:48:25.097-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">linkage</category><title>Image size shrinking tool</title><description>I always forget what this is called:&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.smushit.com/ysmush.it/"&gt;http://www.smushit.com/ysmush.it/&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/notetoself/~4/Vd3lpAMXU1Q" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/notetoself/~3/Vd3lpAMXU1Q/image-size-shrinking-tool.html</link><author>noreply@blogger.com (Mikhail Koryak)</author><thr:total>0</thr:total><feedburner:origLink>http://notetodogself.blogspot.com/2010/12/image-size-shrinking-tool.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-20715940.post-468573947468134077</guid><pubDate>Tue, 30 Nov 2010 00:27:00 +0000</pubDate><atom:updated>2010-11-29T19:27:24.123-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">solutions</category><title>fixing java.lang.NoClassDefFoundError: javax/el/ELContext error</title><description>I got the error &lt;b&gt;java.lang.NoClassDefFoundError: javax/el/ELContext&amp;nbsp; &lt;/b&gt;when i was trying to run a unit test.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Solution:&lt;/b&gt;&lt;br /&gt;
el-api.jar needs to be in your class path. This is usually found in the tomcat/lib dir. I usually add everything in the tomcat lib to my classpath&lt;img src="http://feeds.feedburner.com/~r/blogspot/notetoself/~4/TXe_b02VrrM" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/notetoself/~3/TXe_b02VrrM/fixing-javalangnoclassdeffounderror.html</link><author>noreply@blogger.com (Mikhail Koryak)</author><thr:total>0</thr:total><feedburner:origLink>http://notetodogself.blogspot.com/2010/11/fixing-javalangnoclassdeffounderror.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-20715940.post-8596692902140784608</guid><pubDate>Mon, 29 Nov 2010 18:04:00 +0000</pubDate><atom:updated>2010-11-29T13:04:46.219-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">sql</category><title>select from two tables into a single column</title><description>delete from user where id not in (select a.id from person a UNION select b.id from merchant b)&lt;img src="http://feeds.feedburner.com/~r/blogspot/notetoself/~4/u3IzsvglGgc" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/notetoself/~3/u3IzsvglGgc/select-from-two-tables-into-single.html</link><author>noreply@blogger.com (Mikhail Koryak)</author><thr:total>0</thr:total><feedburner:origLink>http://notetodogself.blogspot.com/2010/11/select-from-two-tables-into-single.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-20715940.post-5758219765318985526</guid><pubDate>Wed, 10 Nov 2010 15:49:00 +0000</pubDate><atom:updated>2010-11-10T10:49:12.586-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">sql</category><title>Test mysql connection</title><description>mysql -u user -p -h 10.0.0.0&lt;img src="http://feeds.feedburner.com/~r/blogspot/notetoself/~4/2VaIsjLFWp4" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/notetoself/~3/2VaIsjLFWp4/test-mysql-connection.html</link><author>noreply@blogger.com (Mikhail Koryak)</author><thr:total>0</thr:total><feedburner:origLink>http://notetodogself.blogspot.com/2010/11/test-mysql-connection.html</feedburner:origLink></item></channel></rss>
