Tue 5 Feb 2008
WTF/M - best code review stat ever
Posted by dkaz under Programming
No Comments

So damn funny, yet so damn true.
Tue 5 Feb 2008
Posted by dkaz under Programming
No Comments

So damn funny, yet so damn true.
Thu 1 Nov 2007
Posted by dkaz under Programming
[3] Comments
Found in Apache logs…on a domain that doesn’t even have MySQL installed…
85.17.155.21 “GET /phpmyadmin/main.php HTTP/1.0″ 404 - “-” “-”
85.17.155.21 “GET /admin/main.php HTTP/1.0″ 404 - “-” “-”
85.17.155.21 “GET /myadmin/main.php HTTP/1.0″ 404 - “-” “-”
85.17.155.21 “GET /phpMyAdmin/main.php HTTP/1.0″ 404 - “-” “-”
85.17.155.21 “GET /PMA/main.php HTTP/1.0″ 404 - “-” “-”
85.17.155.21 “GET /admin/phpmyadmin/main.php HTTP/1.0″ 404 - “-” “-”
85.17.155.21 “GET /admin/phpMyAdmin/main.php HTTP/1.0″ 404 - “-” “-”
85.17.155.21 “GET /admin/sysadmin/main.php HTTP/1.0″ 404 - “-” “-”
85.17.155.21 “GET /admin/sqladmin/main.php HTTP/1.0″ 404 - “-” “-”
85.17.155.21 “GET /admin/db/main.php HTTP/1.0″ 404 - “-” “-”
85.17.155.21 “GET /admin/web/main.php HTTP/1.0″ 404 - “-” “-”
85.17.155.21 “GET /admin/pMA/main.php HTTP/1.0″ 404 - “-” “-”
85.17.155.21 “GET /admin/main.php HTTP/1.0″ 404 - “-” “-”
85.17.155.21 “GET /admin/mysql/main.php HTTP/1.0″ 404 - “-” “-”
85.17.155.21 “GET /admin/myadmin/main.php HTTP/1.0″ 404 - “-” “-”
85.17.155.21 “GET /admin/webadmin/main.php HTTP/1.0″ 404 - “-” “-”
85.17.155.21 “GET /admin/mysqladmin/main.php HTTP/1.0″ 404 - “-” “-”
85.17.155.21 “GET /admin/phpmyadmin2/main.php HTTP/1.0″ 404 - “-” “-”
85.17.155.21 “GET /admin/phpMyAdmin-2.2.3/main.php HTTP/1.0″ 404 - “-” “-”
85.17.155.21 “GET /admin/phpMyAdmin-2.2.6/main.php HTTP/1.0″ 404 - “-” “-”
85.17.155.21 “GET /admin/phpMyAdmin-2.5.1/main.php HTTP/1.0″ 404 - “-” “-”
85.17.155.21 “GET /admin/phpMyAdmin-2.5.4/main.php HTTP/1.0″ 404 - “-” “-”
85.17.155.21 “GET /admin/phpMyAdmin-2.5.6/main.php HTTP/1.0″ 404 - “-” “-”
85.17.155.21 “GET /admin/phpMyAdmin-2.6.0/main.php HTTP/1.0″ 404 - “-” “-”
85.17.155.21 “GET /admin/phpMyAdmin-2.6.0-pl1/main.php HTTP/1.0″ 404 - “-” “-”
85.17.155.21 “GET /admin/phpMyAdmin-2.6.2-rc1/main.php HTTP/1.0″ 404 - “-” “-”
85.17.155.21 “GET /admin/phpMyAdmin-2.6.3/main.php HTTP/1.0″ 404 - “-” “-”
85.17.155.21 “GET /admin/phpMyAdmin-2.6.3-pl1/main.php HTTP/1.0″ 404 - “-” “-”
85.17.155.21 “GET /admin/phpMyAdmin-2.6.3-rc1/main.php HTTP/1.0″ 404 - “-” “-”
85.17.155.21 “GET /db/main.php HTTP/1.0″ 404 - “-” “-”
85.17.155.21 “GET /web/main.php HTTP/1.0″ 404 - “-” “-”
85.17.155.21 “GET /PMA/main.php HTTP/1.0″ 404 - “-” “-”
85.17.155.21 “GET /admin/main.php HTTP/1.0″ 404 - “-” “-”
85.17.155.21 “GET /mysql/main.php HTTP/1.0″ 404 - “-” “-”
85.17.155.21 “GET /myadmin/main.php HTTP/1.0″ 404 - “-” “-”
85.17.155.21 “GET /mysqladmin/main.php HTTP/1.0″ 404 - “-” “-”
85.17.155.21 “GET /mysql-admin/main.php HTTP/1.0″ 404 - “-” “-”
85.17.155.21 “GET /phpmyadmin2/main.php HTTP/1.0″ 404 - “-” “-”
85.17.155.21 “GET /phpMyAdmin-2.2.3/main.php HTTP/1.0″ 404 - “-” “-”
85.17.155.21 “GET /phpMyAdmin-2.2.6/main.php HTTP/1.0″ 404 - “-” “-”
85.17.155.21 “GET /phpMyAdmin-2.5.1/main.php HTTP/1.0″ 404 - “-” “-”
85.17.155.21 “GET /phpMyAdmin-2.5.4/main.php HTTP/1.0″ 404 - “-” “-”
85.17.155.21 “GET /phpMyAdmin-2.5.6/main.php HTTP/1.0″ 404 - “-” “-”
85.17.155.21 “GET /phpMyAdmin-2.6.0/main.php HTTP/1.0″ 404 - “-” “-”
85.17.155.21 “GET /phpMyAdmin-2.6.0-pl1/main.php HTTP/1.0″ 404 - “-” “-”
85.17.155.21 “GET /phpMyAdmin-2.6.2-rc1/main.php HTTP/1.0″ 404 - “-” “-”
85.17.155.21 “GET /phpMyAdmin-2.6.3/main.php HTTP/1.0″ 404 - “-” “-”
85.17.155.21 “GET /phpMyAdmin-2.6.3-pl1/main.php HTTP/1.0″ 404 - “-” “-”
85.17.155.21 “GET /phpMyAdmin-2.6.3-rc1/main.php HTTP/1.0″ 404 - “-” “-”
Thu 24 May 2007
Posted by dkaz under Linux, Programming
No Comments
Little know seq (sequence) utility is a great way to loop on a range of numbers in Linux. It came in very handy today and will hopefully stick in my brain in the future.
for i in `seq 1 10`
do
..
done
Wed 16 May 2007
Posted by dkaz under Java, Programming
1 Comment
Amusing use of the ternary from our codebase..
log.debug( ( randomize ? "R" : "Not r" ) + "andomizing content" );
:)
Mon 12 Mar 2007
Posted by dkaz under Linux, Programming
No Comments
I discovered a large gap in my bash kung fun today - I had no idea how to loop on lines of data in a file.
It turns out that “while data” pulls off this trick quite nicely:
while read myline
do $myline
done < inputfile
Fri 26 Jan 2007
Posted by dkaz under Java, Programming
No Comments
I haven’t been using “traditional” singletons for a couple of years now (Spring craze and all), so the Initialization On Demand Holder idiom, which allows for lazy instantiation of singletons, has escaped me until now.
private static class LazySomethingHolder {
public static Something something = new Something();
}public static Something getInstance() {
return LazySomethingHolder.something;
}
Here’s the explanation, courtesy of Bill Pugh, Brian Goetz and friends.
Found via TheServerSide.
Wed 17 Jan 2007
Posted by dkaz under Linux, Programming
No Comments
I was sick of typing in username/password for each login (I’m currently working on XP, deploying to a Linux-only env), so I finally went through the pain of following the steps here and set up PuTTY/Peagant public key authentication.
It was a relatively painless setup process, but here are a couple of things to keep in mind when going through it:
Thu 21 Dec 2006
Posted by dkaz under Java, Programming, Windows
1 Comment
I was writing a multi-line batch script with multiple call-outs to Ant and I was confused when it kept exiting after the first call-out.
I’m proud to be rusty at batch scripting, so I’m not ashamed to share the (obvious) fix…
To run a batch program from within the current batch program, use the call command followed by the name of the batch program you wish to run. After the second program is finished, it will return to the command which follows the call command.
If you invoke a batch file without using the call command (from within a batch file that is), control passes over to the new batch program and does not return.
Wed 13 Dec 2006
Posted by dkaz under Programming
No Comments
One of my favorite Trac features is the ease with which you can link from Tickets to Changesets and from Changesets to Tickets.
Text input of [256] is interpreted by Trac as a link to Changeset 256, while text input of #256 is interpreted as a link to Ticket 256 - one can’t ask for anything easier to remember.
My only wish would be that linking from Changesets to Tickets would also trigger a Ticket update about a related Changeset commit. I guess I’ll be forced to write that as a Subversion trigger unless I get lucky Googling for prior art.
Tue 12 Dec 2006
Posted by dkaz under Technology, Programming
No Comments
Tue 26 Sep 2006
Posted by dkaz under Python, Programming
1 Comment
I found myself questioning why others are looping using xrange, while I’ve been using the boring, non-x range.
Gotta love the fact that I was able to use the built-in in “help” module in Python to answer this quickly.
>>> help(xrange)
Help on class xrange in module __builtin__:class xrange(object)
| xrange([start,] stop[, step]) -> xrange object
|
| Like range(), but instead of returning a list, returns an object that
| generates the numbers in the range on demand. For looping, this is
| slightly faster than range() and more memory efficient.
Sun 3 Sep 2006
Posted by dkaz under Programming
No Comments
I checked out my SVN codebase from a Linux box this morning and I realized that I’ve been committing everything with ^M line endings.
I absolutely hate when others do that, so I had to take immediate steps to remedy the issue. Following directions, lifted from Celtix ESB Wiki made sure that I won’t be guilty of this offense in the near future.
TortoiseSVN settings fix:
In the Windows explorer, highlight any directory and right click. Select the TortoiseSVN > Settings menu item; this opens the TortoiseSVN Settings window.
Highlight the General entry in the left-hand listing and click on the Edit command button adjacent to the Subversion configuration file: label.
Under the miscellany tag, uncomment the last line, which turns on the auto properties functionality.
### Set enable-auto-props to ‘yes’ to enable automatic properties
### for ’svn add’ and ’svn import’, it defaults to ‘no’.
### Automatic properties are defined in the section ‘auto-props’.
enable-auto-props = yes
At the end of the file under the auto_props tag, add the following properties, then save the file and close the TortoiseSVN Settings window.
*.java = svn:eol-style=native
*.properties = svn:mime-type=text/plain;svn:eol-style=native
*.xml = svn:mime-type=text/xml;svn:eol-style=native
*.xsl = svn:mime-type=text/xml;svn:eol-style=native
*.xsd = svn:mime-type=text/xml;svn:eol-style=native
*.wsdl = svn:mime-type=text/xml;svn:eol-style=native
*.txt = svn:eol-style=native;svn:mime-type=text/plain
*.pl = svn:eol-style=native
*.py = svn:eol-style=native
*.cmd = svn:eol-style=native
*.bat = svn:eol-style=native
*.htm* = svn:eol-style=native;svn:mime-type=text/html
*.css = svn:eol-style=native
*.js = svn:eol-style=native
README* = svn:eol-style=native;svn:mime-type=text/plain
LICENSE* = svn:eol-style=native;svn:mime-type=text/plain
ChangeLog = svn:eol-style=native;svn:mime-type=text/plain
*.png = svn:mime-type=image/png
*.jpg = svn:mime-type=image/jpeg
*.gif = svn:mime-type=image/gif