tag:blogger.com,1999:blog-90978336563838436412024-03-13T13:05:34.178-07:00tech-nickelFor those with a love of all things computerrobottawayhttp://www.blogger.com/profile/16898889765420671029noreply@blogger.comBlogger29125tag:blogger.com,1999:blog-9097833656383843641.post-88137573871493465432009-07-23T12:08:00.000-07:002009-07-24T16:21:53.051-07:00Running Pylons with Jython for BeginnersWell I'm sure someone out there besides me is interested in Pylons running on the JVM. Jython is a project working to bring Python to the JVM. If you are a Java user, and also a Pylons user you may be interested in the following.<br /><br />To get started you need to install Jython. You can visit the <a href="http://www.jython.org/">Jython Site</a> or get the <a href="http://downloads.sourceforge.net/jython/jython_installer-2.5.0.jar">2.5.0 release here</a>. You will need a version >= 2.5.0. The download is a jar based installer. You will need to run this as an application. On some platforms you can run the installer by double clicking the jar file (worked on OS X). On others you may need to go to the command line and issue this command "java -jar <jarname>".<br /><br />Once Jython is installed setup easy_install for jython. Get ez_setup.py (<a href="http://peak.telecommunity.com/dist/ez_setup.py">find it here</a>). Once you have ez_setup.py downloaded run it using "jython ez_setup.py". This will install easy_install in Jython's bin folder.<br /><br />Now if you work with Python you'll probably want to create an alias for this easy_install. I did. I just put the following in my .profile (note I also am aliasing virutualenv):<br /><blockquote>alias jeasy_install="$JYTHON_HME/bin/easy_install"<br />alias jeasy_install2.5="$JYTHON_HME/bin/easy_install-2.5"<br />alias jvirtualenv="$JYTHON_HME/bin/virtualenv"</blockquote>Another note, don't use JYTHON_HOME in your bash env if you want virtualenv to work. I substituted JYTHON_HME. If you wan't to see why you can't use JYTHON_HOME check out the jython script. This needs to use JYTHON_HOME to configure the java classpath and run the Jython application.<br /><br />Get virtualenv installed for Jython. Just type "jeasy_install virtualenv". Once that finishes you should have a 'virtualenv' tool in the Jython installation's bin folder. Note I have an example above of aliasing this to jvirtualenv, so that I can use the Python based version too.<br /><br />Ok now you are ready for Pylons. You'll download the go-pylons script from <a href="http://www.pylonshq.com/">PylonsHQ</a> get this script here. Once it's downloaded run it using "jython go-pylons.py jylons<scriptname>". This will create all the virtual environment where we can install packages specific to our app that we do not want polluting the Jython site-packages.<br /><br />Alright getting closer... Activate your new env. On *nix this is as easy as "source jylons/bin/activate" on Windows "jylons\bin\activate.bat". For more info on virtualenv <a href="http://pypi.python.org/pypi/virtualenv">see here</a>.<br /><br />You should now be using the 'jylons' virtual environment. We are close. Type "paster create --t pylons". A script will now guide you through creating your Pylons app. For this part I advise you follow the "getting started" <a href="http://www.pylonshq.com/docs/en/0.9.7/gettingstarted/#getting-started">guide from PylonsHQ here</a>.<br /><br />You'll now need to get the bleeding edge SQLAlchemy, which supports the Jython DBAPI implementation 'zxJDBC'. <a href="http://svn.sqlalchemy.org/sqlalchemy/branches/rel_0_6">Use this URL</a> to check it out. Once that is done make sure your jylons virtualenv is activated, if not activate it now. Change dir to the checked out project. Run the setup.py file like so: "jython setup.py install". This will install the trunk version of SQLAlchemy under the 'jylons' virtualenv.<br /><br />Before I go I want to make sure that you can connect to your database. In my case Postgres is the database of choice. You could just as well use MySQL. As far as I can tell no integration exists for sqlite, so when you create a new Pylons project that uses SQLAlchemy it won't start up right away; due to errors stemming from sqlite being the configured database. Just switch to MySQL or Postgres.<br /><br />In the development.ini file you'll want to set the sqlalchemy URL like so:<br /><br />sqlalchemy.url = postgresql+zxjdbc://<username>:<password>@localhost:5432/<dbname><br /><br />Note the '+zxjdbc'. This is what SQLAlchemy 0.6 is using to designate a Jython zxJDBC based DBAPI. If you are interested check the source code for <a href="http://www.sqlalchemy.org/trac/browser/sqlalchemy/branches/rel_0_6/lib/sqlalchemy/engine/url.py">sqlalchemy.engine.url</a>. This will in turn require the Postgres JDBC driver is on the classpath. I hacked it on by updating the jython script to add the driver. Not an optimal solution but workable for now. I'm hoping for a better mechanism to add jar files to Jython's class path at some point.<br /><br />You should be ready to go. You can now create tables and such in SA. Have fun!<br /><br /></scriptname>robottawayhttp://www.blogger.com/profile/16898889765420671029noreply@blogger.com2tag:blogger.com,1999:blog-9097833656383843641.post-18582661099449725872009-06-04T10:53:00.000-07:002009-06-04T10:57:11.539-07:00OS X Terminal Send Function Keys to TerminalYikes this one took me a bit of time to figure out. I was installing an image remotely from my Mac, and the image installation edtior used the function keys to save, quit etc. Well on my OS X the function keys first are overridden to do specific things. Ok well just press the 'fn' key while pressing the function key. Oh now they are overridden for Expose and so forth.<br /><br />Ok well what you are goign to want to do here is press the <span style="color: rgb(255, 0, 0);">'fn' key, the command key, and then the F# key</span> you want sent to the Terminal.robottawayhttp://www.blogger.com/profile/16898889765420671029noreply@blogger.com2tag:blogger.com,1999:blog-9097833656383843641.post-16075646874528945452009-02-26T21:55:00.000-08:002009-02-28T18:09:10.516-08:00Mercurial "case-folding collision" More Explanation on the fixI've run into this error now a few times. What happens is you rename a file, changing only the case of one or more characters in the file name. This causes confusion. Now you can read <a href="http://fader.co.uk/post/Fixing-case-folding-collision-errors-in-mercurial.aspx">here</a> and <a href="http://www.selenic.com/mercurial/wiki/index.cgi/FixingCaseCollisions">here</a> about the fix to this problem. I'm going to give a little more info on how to make this work, just because it might not be crystal clear reading those two sources.<br /><br />You got this error either by checking out the project, or pulling changesets into your project and trying the 'update' command. So run these commands:<br /><br />hg debugsetparents <revision><revision><br /><br />The revision should be the one you are attempting to update to.<br /><br />hg debugrebuildstate<br /><br />now you want to remove all the files in error, you can use 'hg manifest tip' to check for the files in error. I've had more than one before after doing numerous renames that camel cased a number of files. use:<br /><br />hg rm -A <filename><filename><br /><br />to remove files, you can list multiple files to delete using spaces between each.<br /><br />Once you've removed the files you should commit the changes:<br /><br />hg ci -m "Fixed case problems"<br /><br />Then do a clean check out the tip revision:<br /><br />hg co -C tip<br /><br />thats it, hope this helps to shed a little extra light on the process.</filename></revision>robottawayhttp://www.blogger.com/profile/16898889765420671029noreply@blogger.com3tag:blogger.com,1999:blog-9097833656383843641.post-79551656492930778832009-02-24T15:49:00.000-08:002009-02-25T07:48:21.678-08:00Using sort and uniq to find duplicate lines in a fileI love my Mac, mostly because I can run all those great Unix utilities that make tasks easy. Today I want to point out a pair of tools that come in handy often. They are sort and uniq.<br /><br />sort can be used to sort the lines in a given file. A simple use would be<br /><br />echo -e "c\na\nb" | sort<br /><br />which produces:<br /><br />a<br />b<br />c<br /><br />Sweet! Now lets look at the sort program:<br /><br />echo -e "a\na\nb\nc\nb" | uniq<br /><br />gives:<br /><br />a<br />b<br />c<br />b<br /><br />Removing the duplicate a, but not the b! The tool only removes any consecutive duplicate lines. So what if you want to remove all duplicates? Easy:<br /><br />echo -e "a\na\nb\nc\nb" | sort | uniq<br /><br />gives:<br /><br />a<br />b<br />c<br /><br />Taa Dah! Thats easy!<br /><br />Now this duo can be used in very many useful ways. Just the other day I needed to find two XML elements that had the same value. I used 'sed' to pull out all the values in the given element, sort to put these values in lexographically sorted order, and uniq to tell me the duplicates found:<br /><br />sed -n 's/.*<tag><tag>\(.*\)<\/tag>/\1/p' <file> | sort | uniq -d<br /><br />For the 'sed' part you could put any tag name in there you need to find duplicate value for. <file> should be the name of the file you are using. Notice that each XML element was on it's own line, so this wouldn't work for documents that are not formatted nicely (for that see xmllint :).<br /></file></file></tag>robottawayhttp://www.blogger.com/profile/16898889765420671029noreply@blogger.com0tag:blogger.com,1999:blog-9097833656383843641.post-87860058312785969672009-02-20T16:10:00.000-08:002009-02-20T16:27:48.146-08:00Memory settings when using Jetty inside of EclipseIf you like to debug and run your webapps inside of Eclipse you've got two options. First there is <a href="http://tomcat.apache.org/">Tomcat</a>, which running will require a plugin like <a href="http://www.eclipsetotale.com/tomcatPlugin.html">Sysdeo</a>. Second, you can write a simple class to start up your web application using <a href="http://www.mortbay.org/jetty/">Jetty</a>. I like to use Jetty rather than the old school Sysdeo Tomcat plugin. I've found that it is simpler to configure the application to run in a test or stage mode this way inside of Eclipse.<br /><br />If you run Jetty inside of Eclipse you may need to increase the memory being used by the process (Jetty is fast to start up and doesn't requires much memory, but your web app may!). So if you have a process to start your web app in Eclipse you'll have a run configuration. If you open this (click the item menu drop down to the right of the green circle w/ a triangle in it) configuration in the right pane select the 'Arguments' tab.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_713t16V0cpQ/SZ9IrwYOgWI/AAAAAAAAAB0/7UHh_KVdGXI/s1600-h/Picture+2.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 262px;" src="http://3.bp.blogspot.com/_713t16V0cpQ/SZ9IrwYOgWI/AAAAAAAAAB0/7UHh_KVdGXI/s320/Picture+2.png" alt="" id="BLOGGER_PHOTO_ID_5305038802623824226" border="0" /></a>As you can see in the image above you then will want to fill in the VM arguments to contain the needed memory settings. In the above configuration I've added settings to increase the minimum heap to 256 mb and the max heap to 512 mb. Thats all I needed for my webapp to run smoothly, you may require more or less.robottawayhttp://www.blogger.com/profile/16898889765420671029noreply@blogger.com0tag:blogger.com,1999:blog-9097833656383843641.post-44700552788043641812009-02-19T13:29:00.000-08:002009-02-19T13:33:58.670-08:00OAuth Library for Java & GroovyI've released a latest version of a simple OAuth client I developed. You can find version 1.1 of the jar <a href="http://www.blueleftistconstructor.com/mvnrepo/releases/com/blueleftistconstructor/OAuth/1.1/">here</a>. Also the site for the project is <a href="http://www.blueleftistconstructor.com/projects/oauth/">here</a>, and finally the source is <a href="https://www.blueleftistconstructor.com/hg/oauth/">here</a>. I should have some documentation on basic usage up later.<br /><br />So far the library only supports the HMAC-SHA1 method of signing, and is using query parameters to send the OAuth information. Soon I'll add support for using headers and POST data to send the OAuth information.robottawayhttp://www.blogger.com/profile/16898889765420671029noreply@blogger.com2tag:blogger.com,1999:blog-9097833656383843641.post-11884145633317405792009-02-19T00:18:00.000-08:002009-02-20T16:05:37.944-08:00Maven and Mercurial: tips on performing a releaseIf you are using Maven 2 and have a project in source control via Mercurial then you might need this tip. If you do a 'mvn release:prepare' then Maven will try and push the changes and will need auth. Use the sys properties -Dusername=<your> -Dpassword=<your>' to get authenticated. I don't think this is very secure because the properties seem to be plaintext, but eh what can you do?</your></your>robottawayhttp://www.blogger.com/profile/16898889765420671029noreply@blogger.com0tag:blogger.com,1999:blog-9097833656383843641.post-73055428366298075402009-01-20T11:21:00.000-08:002009-01-20T11:47:30.260-08:00Java on Mac OS X: try Soy LatteIf you are working with Java on OS X then you probably should be trying out <a href="http://landonf.bikemonkey.org/static/soylatte/">SoyLatte</a>. SoyLatte is a port of BSD Java for OS X, it is also part of the <a href="http://openjdk.java.net/">OpenJDK</a> initiative. It can help you work around the many issues you'll likely have with the 1.6 Java SDK supported by Apple (I couldn't get Woodstox working with RelaxNG schema support).<br /><br />First off download it. Then you'll probably want to install it somewhere (/usr/local/soylate-xxx should work). Then make sure you have a JAVA_HOME shell var pointing to this folder. Make sure also you add the bin folder to the path.<br /><br />Getting Eclipse running on SoyLatte is cake. Open the preferences, select "Java > installed JREs", click the 'add' button select the 'MacOS X VM' option and next. You'll now want to point to the SoyLatte folder and finish things off. Select the SoyLatte JRE and close the preferences.<br /><br />Last thing I'd like to point out. I use CXF to do web services, and found there was an issue with SoyLatte using JAXB 2.0 when I need JAXB 2.1. To solve this I just downloaded the jaxb-api-2.1.jar and jaxws-api-xx.jar and put them into the soylatte/jre/endorsed folder.robottawayhttp://www.blogger.com/profile/16898889765420671029noreply@blogger.com0tag:blogger.com,1999:blog-9097833656383843641.post-84485415549988882492009-01-13T13:26:00.000-08:002009-01-13T16:14:51.457-08:00Potion: Installing and RunningNew to the computer language scene is <a href="http://github.com/why/potion/tree/master">Potion</a>. This language is the work of Why (or Why the luck stiff if you like typing) a guy who created a <a href="http://poignantguide.net/ruby/">wonderful guide</a> to learning the Ruby programming language.<br /><br />Potion is a very 'small' language in both terms of lines of code to implement and the tools and API of the language itself. Batteries are not included as they are in well established languages such as Python. NO SWEAT, this of course is why you are interested.<br /><br />First things first you'll need to have <a href="http://git-scm.com/">Git</a> installed. Git is source control software. I am on Ubuntu and so I just typed in the command 'sudo apt-get install git-core'. That should do it... oh not on Ubuntu well then go <a href="http://git-scm.com/download">here</a> and figure it out.<br /><br />Second you are going to need <a href="http://www.complang.org/ragel/">Ragel</a>. Ragel is a state machine compiler. Potion uses it to create the source code tokenizer. Again I used apt-get: 'sudo apt-get install ragel' and voila I had myself some Ragel. You might need to go <a href="http://www.complang.org/ragel/">here</a> and download it or something.<br /><br />Lastly you need the Potion source. Using Git you will download this. You should be able to type<br /><blockquote>git clone git://github.com/why/potion.git potion</blockquote>and you'll now have the folder 'potion' containing the sources.<br /><br />Now you'll want to change to the 'potion' folder. Type 'make' to start the process of building Potion.<br /><br />Once finished copy the potion executable create in the make step into your local bin folder. For me that is '/home/rob/bin'. Make sure this folder is on the path. Now you can run potion anywhere. test it out using the command 'potion examples/fib.pn'. This will run the simple fibonacci app in the example folder.<br /><br />Now you are ready to build a great program!robottawayhttp://www.blogger.com/profile/16898889765420671029noreply@blogger.com0tag:blogger.com,1999:blog-9097833656383843641.post-79118643034207499902009-01-03T16:10:00.000-08:002009-01-03T16:19:03.770-08:00MySQL and UnicodeI just wanted to point out. MySQL STILL uses ISO-Latin-1 as the default encoding. LAME!!! I ran into again the problem today of having to set up my production database to use UTF-8. Not a difficult thing, but a hassle none the less. The thing is in these days everyone is using UTF-8, I mean i18n and l13n are two big deals. Some web programming frameworks make it a huge point of how well they handle the two.<br /><br />Well anyway what to do? I had already created the database and tables, in the default ISO-Latin-1 encoding, and there was a few months of data in them. Therefore I had to start by fixing the encoding on the database and tables. Here are the commands that can make this happen:<br /><blockquote>alter table xxx character set = utf8;<br />alter database xxx character set = utf8;</blockquote>Of course insert your table and database names. Now any new tables created in the database will have utf8 encoding. You probably WANT to make sure that everything in your database is UTF-8. The best way I know of doing this is my setting the proper values in the my.cnf file in /etc. If the file is not in /etc then you probably will need to create it. If someone else admins the machine and installed mysql there is a possibility also that the file is in another castle, er sorry location.<br /><br />So crack open the my.cnf and insert this line:<br /><blockquote>default-character-set=utf8</blockquote>Thats it, restart MySQL. To test this out create a new database, then a table in the database. Issue the 'show create table xxx' where xxx is the table name, you should see some text indicating it has UTF-8 as the encoding.robottawayhttp://www.blogger.com/profile/16898889765420671029noreply@blogger.com0tag:blogger.com,1999:blog-9097833656383843641.post-15128790209471218082009-01-03T15:39:00.000-08:002009-01-03T15:50:21.009-08:00URL Encoding in TomcatI'm working on a new feature at <a href="http://www.blueleftistconstructor.com/">blueleftistconstructor</a> (BLC) that is sorta like <a href="http://del.icio.us">del.icio.us</a>. The gist is this feature allows a member to create 'bookmarks' in their account on the site. Bookmarks can then be accessed from anywhere one can access BLC.<br /><br />I created a bookmarklet that when invoked from any webpage will redirect to BLC and save the page as a bookmark. This is pretty clutch as it makes bookmarking a lot easier. I coded up this bookmarklet awhile ago but found a bug just the other day. Any site that had a title containing Unicode characters would cause the title to freak out. In the save bookmark form the characters where getting butchered.<br /><br />Well it took a hour or so to troubleshoot the problem. It ends up that Tomcat (the Java webserver I host the site app in) uses ISO-Latin-1 (ISO-8859-1) when decoding URLs. Well that makes sense of why the Unicode characters where lost. As luck would have it I kinda guessed this was the issue and found <a href="http://confluence.atlassian.com/display/DOC/Configuring+Tomcat%27s+URI+encoding">this great post</a>. If you are experiencing such issues just follow the directions in the post and you'll be fine.robottawayhttp://www.blogger.com/profile/16898889765420671029noreply@blogger.com0tag:blogger.com,1999:blog-9097833656383843641.post-52197028898313441612008-10-28T22:25:00.000-07:002008-10-28T22:32:28.506-07:00Openssl, when checking a digest...I've been working on my own implementation of SHA-1 hashing function. In the bigger picture I've put together a mostly working OAuth client using Groovy, and part of that is using HMAC-SHA1 to compute a secret value. Well I started by using the built in Java version but decided i would create my own... this is good exercise.<br /><br />So first thing I did was write some unit tests. I needed SHA1 hashes to start with to make sure that my algorithm implementation works. The obvious choices are either sha1sum or openssl. I'm on a iMac running Leopard, and by default openssl is installed. I used that to compute some hash values. Unfortunately for me I spent a lot of time trying to get my algorithm working when it was already working. The problem was I computed the values wrong with openssl. I used the following:<br /><br />echo "the quick fox jumps the brown dog" | openssl sha1<br /><br />Which gave me a incorrect value. Why you ask? Well I didn't remember the -n flag and a newline character was being included in the string passed to openssl. Ooops! Well once I added the -n flag everything was fine and I now have a number of hash values to use in my tests.robottawayhttp://www.blogger.com/profile/16898889765420671029noreply@blogger.com0tag:blogger.com,1999:blog-9097833656383843641.post-30701766220735102842008-10-16T21:20:00.000-07:002008-10-16T21:56:21.697-07:00Eclipse, Tomcat, Sysdeo and the DevLoader (and a little Maven)If you are developing a webapp in Eclipse there is a very good chance you are using Sysdeo. If you are not there is a very good chance you have not yet learned a proper way to debug a Java web application (or maybe you are using Jetty?). Sysdeo is really the only good open source, free Eclipse plugin for developing with Tomcat. It allows a simple way to debug your code in Eclipse while it runs in Tomkitty, a very nice thing.<br /><br />Now the problem with the plugin out right is your project must be laid out like an exploded war... YUCK! This is because Sysdeo will be looking for the lib files under WEB-INF/lib and such. Often I've seen this lead to some truly horrible project organization, where jsp and Ant build files co-mingle in the same folder!?!<br /><br />Most of us use a sane Ant or Maven project layout that is standardized across all our Java projects. If you want to continue doing so and leverage the benefits of Sysdeo then you will need the DevLoader installed.<br /><br />If you haven't downloaded and installed the Sysdeo plugin do so now, I will wait ;)<br /><br /><a href="http://www.eclipsetotale.com/tomcatPlugin.html">Go here to get Sysdeo!</a><br /><br />Ok once installed you should see 3 icons under the Eclipse menu bar that look very familiar (they are Tomcats!). The first icon starts Tomcat, the second stops it and the third restarts. Now open the Eclipse preferences menu. You should see the "Tomcat" entry. Open it and configure the plugin based on your Tomcat installation. You will want the "Context Declaration mode" to be "context" in my experience. It just makes things a lot cleaner if you use Tomcat for other projects/apps, where they each have individual files rather being crammed in server.xml. That should be about all you need to know. Oh the sub-menu 'Source path' is for adding the source files used in debugging, so make sure your project is in there if you want to be able to see the files while debugging.<br /><br />Next up the DevLoader. It came with the Sysdeo plugin when you download it! You should find a zip file in the the Sysdeo zip aptly named Devloader.zip. Unzip it. It will create an org folder, within lies some classes. Jar this sucker up:<br /><pre><br /> jar cf devloader.jar org/<br /></pre><br />This should create a jar for the DevLoader. Now throw this in your Tomcat instance's lib folder.<br /><br />Great now you have almost everything you need to get started. Lets go over an example of a Maven project being used.<br /><br />In Maven the webapp files go in src/main/webapp by convention, and sources go in src/main/java, and the resource files (xml, properties) go into src/main/resources. For your Maven project you would right click the project and select properties. You should now notice a 'Tomcat' entry in the config options. Select this. <br /><br />Enable the "Is a Tomcat Project" checkbox. For the 'context name' use whatever sane value you prefer. Near the bottom area you will want to enter 'src/main/webapp' for the app root. This is where most jsp, html, javascrpt, css and whatnot will be. You will be able to update these and see the result. Now the last thing we need to do is activate the devloader. Here is a picture of what that looks like:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_713t16V0cpQ/SPgWaYxquqI/AAAAAAAAABk/O7rPmGgvBtg/s1600-h/devloader.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/_713t16V0cpQ/SPgWaYxquqI/AAAAAAAAABk/O7rPmGgvBtg/s320/devloader.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5257977207538236066" /></a><br />So really all you do is add the jar files needed. Thats it. Now save. If you are not going to create a context file yourself, and you enabled 'can update context definition' in the projects tomcat properties you can right click the project and select "tomcat project > update context definition". This will automatically create the proper context file for Tomcat, so that it uses the DevLoader and your project. You almost certainly will want to do this. Note you can further alter the automatically created context file afterwards.robottawayhttp://www.blogger.com/profile/16898889765420671029noreply@blogger.com1tag:blogger.com,1999:blog-9097833656383843641.post-56095545345271978302008-10-13T08:31:00.000-07:002008-10-13T08:52:29.592-07:00Sorting using HaskellLast Friday night I had some fun writing sorts in Haskell. Yes thats right I spent my Friday night working on some rudimentary algorithms in an obscure computer language. Lets just say I'm in to that kinda thing. Oh well it beats being addicted to cough syrup.<br /><br />So Haskell is fun. There I said it. It is the kinda language which lends much balance to ones style, is one is a imperitive/OO language flunky. The ideas in Haskell seem bizarre at first but become beautiful as they sink in. Sink they do, lets look at the first sort, the almighty BUBBLE SORT<br /><br /><pre><br />-- Implementation of a bubble sort in Haskell<br />bubbleSort :: (Ord t) => [t] -> [t] -- signature<br />bubbleSort a = loop (length a) bubble a<br /><br />bubble :: (Ord t) => [t] -> [t] <br />bubble (a:b:c) | a < b = a : bubble (b:c)<br /> | otherwise = b : bubble (a:c)<br />bubble (a:[]) = [a] <br />bubble [] = []<br /><br />loop :: (Num a, Ord a) => a -> (t -> t) -> t -> t<br />loop num f x | num > 0 = loop (num-1) f x'<br /> | otherwise = x<br /> where x' = f x<br /></pre><br /><br />I imagine that looks weird. Well it should, if you are unaccustomed to Haskell. The syntax is much different than any OO language. I've had people tell me Python is too weird looking. Well this would just frighten those types of people silly. Lets talk about this code<br /><br />The first thing to point out is the signature. In leyman's terms this says "take a list of something and return a list of something". The last [t] is going to be what is returned. The '(Ord t)' says that t must be of the typeclass 'Ord' as in 'Ordinality' which is related to being able to compare values. Don't worry too much about that for now, just know it allows us to do things like '>', '<', '==' and so on.<br /><br />The rest is easy to explain. The bubbleSort function will loop x times, x being the length of the list to be sorted. For a list of 10 elements we loop 10 times. Each time we loop we call bubble. See the loop function takes a number (a) and a function (t -> t), and finally a value (t). What we end up doing here is calling loop again with the number decremented by one. We call bubble on the value, then passing the result right back into bubble IF the number is greater than 0.<br /><br />This bubble function will go through the list comparing each pair elements, starting with the first and second, and swapping them if the first is greater than the second. This causes the largest value to 'bubble up' to the top of the list.robottawayhttp://www.blogger.com/profile/16898889765420671029noreply@blogger.com4tag:blogger.com,1999:blog-9097833656383843641.post-74479446697663106822008-09-02T22:13:00.000-07:002008-09-02T22:19:34.537-07:00LanguagesThis is a quick post about some great learning options for a pair of functional languages. You may be interested in seeing a functional approach to computer languages. I recommend Haskell or Erlang. For Haskell I recommend the book "<a href="http://book.realworldhaskell.org/read/index.html">Real World Haskell</a>". You can read it online; it will also be published by <a href="http://www.oreilly.com/">O'Reilly</a>. For Erlang check out "<a href="http://www.erlang.org/doc/getting_started/part_frame.html">Getting Started with Erlang</a>", also free. Once you've wet your feet with Erlang you can check <a href="http://www.erlang.org/doc/reference_manual/part_frame.html">read the manual</a> whenever you need a refresher.robottawayhttp://www.blogger.com/profile/16898889765420671029noreply@blogger.com0tag:blogger.com,1999:blog-9097833656383843641.post-36363565638861091292008-08-24T10:22:00.000-07:002008-08-24T11:05:11.466-07:00Hacking Eclipse plugin configurations<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ua8ZHwuzV6E/SLGbrC9vqhI/AAAAAAAAAAo/turbuSlEd_g/s1600-h/IT-stamp-of-approval.png"><img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://3.bp.blogspot.com/_ua8ZHwuzV6E/SLGbrC9vqhI/AAAAAAAAAAo/turbuSlEd_g/s200/IT-stamp-of-approval.png" alt="" id="BLOGGER_PHOTO_ID_5238139005441124882" border="0" /></a><br /><div style="text-align: left;"><span style="font-family: verdana;">Reading Neal Ford's generally excellent book </span><a style="font-family: verdana;" href="http://oreilly.com/catalog/9780596519780/">The Productive Programmer</a><span style="font-family: verdana;">, I experimented with his multiple plugin configuration hack. In short, creating multiple plugin configurations in a single eclipse install allows for a team to keep their plugin configurations in version control, so everyone has exactly the same configurations as anyone else on the team. No more "works on my machine but not on yours" weirdness. You can even manage them on a project-by-project basis, which is good.</span><br /><br /><span style="font-family: verdana;">But there are two aspects of working with multiple plugin configurations that are strange: specifically, creating and deleting them. In order to create an additional plugin configuration, you have to:</span><br /><ol style="font-family: verdana;"><li>Create a folder to hold the configuration. It <span style="font-style: italic;">must</span> be named "eclipse" and it <span style="font-style: italic;">must not</span> be in Eclipse's directory structure. </li><li>Within your "eclipse" folder, you have to make an empty file called <span style="font-style: italic;">.eclipseextension</span>, and two empty folders, <span style="font-style: italic;">features</span> and <span style="font-style: italic;">plugins</span>.</li></ol><span style="font-family: verdana;">As Ford points out, Eclipse (inexplicably) won't do this for you. You have to do this by hand. It's not hard, just strange. At least this way you have more control over where the folders and files are located. (As I have multiple Eclipse installs, I used nesting to keep track of everything. I created a top-level folder called "eclipse-configurations"... under that, I made another folder for each of my named installs, and under each of those, I placed the "eclipse" folder as mentioned above. So, the versioned configuration for my "xquery" install of Eclipse is at /Users/haren/eclipse-configurations/xquery/eclipse.)</span><br /><br /><span style="font-family: verdana;">From there, you can go to Help -> Software Updates -> Manage Configuration and add your configuration location(s). Then it's a simple matter of installing your plugins to the config locations desired. You can then enable and disable multiple plugins as a group, switch between versions, etc. It's very handy.</span><br /><br /><span style="font-family: verdana;">But I'd mentioned that there were two strange things about the process. Creating additional configuration locations was one, deleting them was the second. Just as Eclipse gives you no love in creating them, it makes it even harder to get rid of them.</span><br /><br /><span style="font-family: verdana;">Let's say, for example, that you've added your new location as an extension not to the top-level list, but as an extension to an extension. (Yes, you can do this.) But let's also say that's not what you wanted. Well, you can disable your extension-within-an-extension, but you can't get Eclipse to ignore its existence entirely. If you then try to add it to the top level, Eclipse won't let you, complaining that you've already added it elsewhere. Arg.</span><br /><br /><span style="font-family: verdana;">Well, there's a way around that, too (but Ford doesn't mention it). Under <span style="font-family: courier new;">${ECLIPSE_HOME}/configuration/org.eclipse.update</span> there's a file called platform.xml. Up at the top there are "<span style="font-family: courier new;">site</span>" nodes, and one of those will be your offender. Delete the bad guy and restart Eclipse. Now you can place your configuration elsewhere. (Or, you can just change the path in the node). </span><br /><br /><span style="font-family: verdana;">Anyway, as noted, there's a lot to gain by using multiple plugin configuarations, once you get around Eclipse's strange reluctance to make it intuitive. Happy hacking!</span><br /></div>John Harenhttp://www.blogger.com/profile/01924045396299610430noreply@blogger.com0tag:blogger.com,1999:blog-9097833656383843641.post-34754890236727015602008-08-19T12:27:00.000-07:002008-08-19T12:29:37.841-07:00Windoze tools - Infra RecorderIf you somehow find yourself on a Windows machine and need to burn an image (iso) to a cd or dvd then I recommend <a href="http://infrarecorder.sourceforge.net/">Infra Recorder</a>. I've used it a year or two ago, but found it again today and have to say it is looking and working good.robottawayhttp://www.blogger.com/profile/16898889765420671029noreply@blogger.com0tag:blogger.com,1999:blog-9097833656383843641.post-51792323525856015922008-08-19T10:21:00.000-07:002008-08-19T10:28:38.586-07:00Mojave Experiment - an open insult to Windows usersIf you haven't heard of Microsoft's newest advertising venture called <a href="http://www.mojaveexperiment.com/?WT.srch=1">Mojave Experiment</a> let me fill you in. It is an 'experiment' (their words not mine) in which Windows XP users are asked to test out a cutting edge new M$ OS. Well it turns out this is just Vista. The punchline is users loveVista, just give it a chance all you mean naysayers. Well I think users don't like Vista and for good reasons. That is why it has not caught fire like M$ thinks it should have. Well I feel safe saying the execs up in Redwood must have lost their shit, having drunk their own Kool-Aid far too long. For a thorough examination <a href="http://wilshipley.com/blog/2008/07/mojave-experiment-bad-science-bad.html">check out this article</a>. Peace!robottawayhttp://www.blogger.com/profile/16898889765420671029noreply@blogger.com0tag:blogger.com,1999:blog-9097833656383843641.post-5052791550144255862008-08-04T09:02:00.001-07:002008-08-04T09:47:47.931-07:00Installing CouchDB on GentooSo I recently installed CouchDB on Gentoo at work and I figured for others sake I would post clear concise directions.<br /><br /><span style="font-weight: bold;">Portage setup</span><br /><br />You are going to want a <a href="http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=1">Portage</a> overlay in which to put your own ebuild scripts. Having such a place will keep separation between the core Gentoo ebuilds and stuff you dabble with. Lets start with adding your <a href="http://gentoo-wiki.com/HOWTO_Installing_3rd_Party_Ebuilds">Portage overlay</a>: 'sudo mkdir -p /usr/local/portage'. This is where we are going to put your custom ebuilds. If you are interested, look in '/usr/portage'. Here you will see a lot of ebuilds that come via Gentoo's network.<br /><br />To notify Gentoo (more specifically Portage) of this new overlay you will want to add the following line into the '/etc/make.conf' file:<br /><blockquote>PORTDIR_OVERLAY="/usr/local/portage"</blockquote>Next up we need to have a category. Categories separate ebuilds by function and or purpose. For instance the web Server Apache is found in the 'www-servers' category. You can maybe find it @ '/usr/portage/www-servers' on your machine. You can pick any category name you like for this exercise. I'm going to be using 'ottaway'. For the category create a folder in '/usr/local/portage', in my case I do 'sudo mkdir /usr/local/portage/ottaway'. Substitute 'ottaway' for the name of your category.<br /><br />To make Portage aware of this new category I add the line 'ottaway' to the '/etc/portage/categories' file.<br /><br /><span style="font-weight: bold;">Getting CouchDB</span><br /><br />You will need to get the ebuild script for CouchDB. It is found as an attachment <a href="https://bugs.gentoo.org/show_bug.cgi?id=197176">on this page</a>. I used the following to download the script:<br /><blockquote>curl https://bugs.gentoo.org/attachment.cgi?id=159315 > couchdb-0.8.0.ebuild</blockquote>You could pretty easily use wget also. I put this in my Portage overlay in my custom category @ '/usr/local/portage/ottaway', you must do the same for your category.<br /><br />Next up you are going to have to tell Gentoo that you are ok with certain development ebuilds being installed. I did this by adding the following lines to the '/usr/portage/package.keywords' file:<br /><blockquote># couchdb stuff<br />dev-lang/erlang<br />dev-util/svn2cl<br />dev-lang/spidermonkey<br />ottaway/couchdb ~x86</blockquote>You can put those lines anywhere in the file. If you used a category name other than 'ottaway' change the value in the last line of the example above.<br /><br />Next up I was ready to install the whole thing. You can do so using:<br /><blockquote>sudo emerge =<yourcategory><yourcategory>/couchdb-0.8.0</yourcategory></blockquote>Where <yourcategory><yourcategory> is the name you gave your category you created earlier. Once this starts moving you can sit back and relax. When it finishes you can use "sudo -u couchdb couchdb" to get things started. When you see the "time to relax" pop onto the screen go ahead and hit your instance @ http://<yourdomain><yourdomain>:5984/_utils/index.html, where <yourdomain><yourdomain> is the network name of the machine CouchDB is running on.</yourdomain></yourdomain></yourcategory>robottawayhttp://www.blogger.com/profile/16898889765420671029noreply@blogger.com4tag:blogger.com,1999:blog-9097833656383843641.post-10004588482238628042008-08-01T12:45:00.000-07:002008-08-01T14:05:22.631-07:00Hurting the CouchDB<span style="font-weight: bold;">The needs of many</span><br /><br />These days companies have a lot of records floating around. At the last eCommerce company I worked for there where many millions of records floating around our Oracle database. I feel as you get into that sort of situation two things happen: your have very small lines of inter connectivity between the records, as they are spread across all those tables, and secondly you find yourself yielding more and more to the whims of the database system. I've started toying with CouchDB (which is itself only a toy at this point).<br /><br />I've thrown in over 12k documents to CouchDB so far. I've taken my companies whole product catalog and serialized it from simple XML to even simpler JSON. Each document was about roughly 300kb. Each document contains things like product data, many records which make up the production history of the product, and just about anything related to a product. Performance is good, with 12k docs in the system I notice no difference in request times from 10 documents. It appears that CouchDB doesn't care about how many documents you are storing, it simply is relying on the underlying system to provide the space on disk.<br /><br /><span style="font-weight: bold;">It Handles lots of documents</span><br /><br />Thats great and all but how big can these documents get? I'm looking to move from relational to document based which means for a customer document you have order history, purchased items and many other things. Rather than have the summation of a customer, the most important business entity, spread out all over the DB system why not put their 'story' into one document? Yes some of this data could end up being redundant, but that's the point. <span style="font-weight: bold;">Don't worry </span>too much about the small stuff, worry about the stuff that really hurts later down the road like being able to provide a correct SQL statement to put together a Customer model! At my big eCommerce company that was damn near impossible, with many people having separate interpretations! Ouch! A document can be self describing, a big plus when the data model gets complex.<br /><br />To keep perspective going forward I will use the metric of WAP (or "War and Peace"). This is an epic document written by the Russian author Leo Tolstoy. Here it is over at <a href="http://en.wikipedia.org/wiki/War_and_Peace">Wikipedia</a>, yes it is huge. I feel this makes a good metric because it is so big. YOU will never write your own "War and Peace". In the real world this book is a freak of nature, say the Andre the Giant of books. I downloaded a free version off the net, and the size was 3.2 MB, keep this number in mind.<br /><br />So we need to determine if documents could get to these really large sizes without worries. I mean we can think up a reasonable size to which now document will ever grow. I asked myself "Could my companies product records increase in size by 100x and still CouchDB serves em up?". At this size would the client even be able to parse and hold the object in memory? Does that matter? Can I use views (in the CouchDB sense) to pare down a document to just the parts the client needs?<br /><br />Well I started by simply increasing the size of a larger product document by 3600x. Yeah I'm shooting for the moon here. The documents size was ~46Mb, or ~15 WAP. Well on POST of the document to CouchDB things looked good but after a minute CouchDB crashed:<br /><br /><span style="font-style: italic;">eheap_alloc: Cannot allocate 729810240 bytes of memory (of type "heap").</span><br /><span style="font-style: italic;">Aborted</span><br /><br />I'm sorry CouchDB... not! I am running the db on a virtual slice that doesn't have too much memory available. Still it doesn't have to deal with multiple clients making requests. So maybe there needs to be a feature where documents of certain size are handled differently due to their size. I'm guessing that currently the whole document is parsed into memory, probably not a great idea for large documents, but good for performance overall.<br /><br />Next I tried halving the document's size, from 3600x to 1800x, with a relative size of 7 WAP. Again this blew up with problems allocating memory. Ok next up 900x... hey it worked! Using my unoptimized vanilla install on a Gentoo slice I can upload a document that is 3.5-4 WAP in size. That is a lot of reading :) I now ask myself "so at that size what can you expect from clients?".<br /><br /><span style="font-weight: bold;">Clients the other white meat</span><br /><br />Right off, no current browser can handle this 900x document. Just too freaking big. Requesting such a doc wouldn't make much sense in most cases. Really, what kind of web pages need all that data at once? Take into consideration that the browser will have to pass it onto a Javascript engine and allow it to parse the content. Parsing always takes time. Depending on the Javascript engine being used this time could range from slow to really slow.<br /><br />If we could get just the pieces that are needed from the document a client would be much better off. Think of lazy fetching in SQLAlchemy or Hibernate, where the ORM layer doesn't load everything at once, but can get things when asked for. Well I think that the CouchDB view feature will allow you to cut down the size of a document, maybe for a customer document you get just the order history, or contact info. Then you update that doc and merge it back into the document.<br /><br />I put a 200x document into the DB. Using the metric this is about 0.7 WAP, still very large. Fire Fox 3 loaded the structure in 32-33 seconds in <a href="http://wiki.apache.org/couchdb/GettingStartedWithFuton">Futon</a>. At this size the request took 1-2 seconds when using cUrl via the command line to request the object. Using <a href="http://code.google.com/p/couchdb-python/">this CouchDB Python library</a> it took 4-5 seconds to get the 200x doc from CouchDb. Not bad if you really needed to parse that much data. To again put things in perspective this is 0.7 War and Peace books. Thats pretty big.<br /><br />So, are there even applications for document that get so big? I can think of a certain historical report that really could use all this info to generate a complete history of who changed what and when, how things changed (more in a minute), give the all the data surrounding a product, who has what access and more.<br /><br /><span style="font-weight: bold;">On keeping track</span><br /><br />Now I haven't spoke of it yet but there is also a feature built into CouchDB where a document's changes can be tracked. Basically you can review the changes over time. I'm not going to do any testing of performance in history, I'll save that for later. I just wanted to point out that this feature is very cool and useful.<br /><br /><span style="font-weight: bold;">What I need to do</span><br /><br />I need to actually build and maintain something using CouchDB. I've looked and listened for stories on using CouchDB and have found little. I can relate though to using Mark Logic, a XML database which is therefore document based, and having good results. The site SafariU (maybe gone by now) used mostly XQuery to manage documents that contained things such as user info like subscriptions. It worked pretty good. You did end up replacing SQL for XQuery, but XQuery was a much better tool I feel than SQL was. Anyway, I will be toying around and will post more on CouchDB if and when I find something more out.robottawayhttp://www.blogger.com/profile/16898889765420671029noreply@blogger.com2tag:blogger.com,1999:blog-9097833656383843641.post-46892484123355536932008-07-30T22:43:00.000-07:002008-07-30T22:59:51.482-07:00couchdb is the popeyes chicken of cool new ideas...... by that I mean it is f**king awsome. <a href="http://incubator.apache.org/couchdb/">I mean it give it a look</a>. I love the fact that it uses <a href="http://www.mozilla.org/js/spidermonkey/">Spidermonkey</a> so that I can define map-reduce views of large collections of data. I love that it uses HTTP as the protocol for operating on the data. I like the idea of documents being the central worry of my persistance layer, being that almost every web app I have every written cares about documents, not bean counting which relational databases have been so suited to. My hat is off to <a href="http://incubator.apache.org/couchdb/community/committers.html">the commiters</a> on this project. It is truely something that I feels is needed for us common software commandos. I'm a bit worried about modelling real world entities such as products, people and such using a old fashion relational db. I understand there are cases where such a system just works. But I would like a chance to further explore a more restful approach to data models.robottawayhttp://www.blogger.com/profile/16898889765420671029noreply@blogger.com3tag:blogger.com,1999:blog-9097833656383843641.post-6058401021937857712008-05-02T16:52:00.000-07:002008-05-02T17:53:52.123-07:00Perl how you offend me (sometimes)I've been fishing around with Perl over the last month. Got a big legacy PIM application to deal with. Oh my! This app is running on Apache and mod_perl. These are some old school technologies. I'm sure there are lots of burnt out mod_perl programmers out there who are much more qualified to work on this shit. I bet they don't bother to put this stuff on their resume, not as long as they have money in the bank, and/or a roof over their head. Scratch that maybe even without those... having gotten acquainted to this stuff homelessness may be preferable. Sad sad. I don't dislike Perl. It has it's charms and especially evokes finer feelings of classic-ness. It's the language that helped build the net into what it is... a giant commercial cesspool slash platform for extremists of the opinionated sort and trans-generational masturbatory aid. Wow what a legacy.<br /><br />So there it is. Why should I respect something merely because it's author has a rad mustache and sweet Hawaiian shirt collection? Perl in my very humble opinion is too prickly for the newer generation (which I kinda am in). It has nice features: hashes real nice.. lists real nice... CPAN amazing... come on though, for each thing it does right it does numerous things wrong or in poor taste. Arguments to functions blah, references why are you so lousy looking and overly complicated? And strict, dumbest vestigial lousy feature ever. Classes are disgustingly complicated to pick up... bless?!? Lots of sharp edges. Dispite all this Perl has lit the way for many. I've met people that are now programmers because they found Perl. Lets face it though, languages have severely changed since Perl's founding. Most people who program Perl have changed too.<br /><br />I recently read Perl is not dead, sure I agree, it is just legacy. Cobol and Fortran are not REALLY dead either. But you couldn't lure me into doing either, not with a six pack of Micky's and a Snickers bar. There are few things golden left for those of great Perl skills to be looked forward to. All the cool kids have moved onto Python and Ruby, even Java I may argue. These people of skill would have little difficulty picking up another language. The true hacker/scholar/intellectual will thrive on a new language, enjoying the diversity of human creation. They also should have little holding them back from trying something new. I wager those who make the effort will quickly make the transition to the new language and never look back. This may include a change of job.<br /><br />To wrap it up Perl is like the obnoxious slob at a party to which you want to avoid. Difficult to deal, disheveled and unkempt, but also sometimes fun. If you are learning to program, or have done a bit of programming learn Python (or maybe Ruby). Stay away from Perl. Also don't go near PHP, please!robottawayhttp://www.blogger.com/profile/16898889765420671029noreply@blogger.com0tag:blogger.com,1999:blog-9097833656383843641.post-39134359115777098812007-12-16T20:34:00.001-08:002007-12-16T21:02:59.487-08:00Book Notes: Spam KingsThe web is now been around in its commercial form for about ten years. What I mean by commercial is eBay, Amazon and the like. With it I also acknowledge the many lay persons of the web have increased exponentially in that amount of time, who of course buy all that stuff (ergo commerce!). Previously the web consisted mostly of a group of people who are more 'underground' by todays standards. This includes those wild figures such as news group posters, researchers, software pirates, tech geeks, etc. etc. I picked up a book at work called "Spam Kings". It was published by O'Reilly which I happen to work for (thanks for the freebies, heres some publicity ;).<br /><br />I've read the first 50 pages, and so far its an entertaining story. The book follows a host of characters in a 3rd person narration. The writing is not tough to follow, it almost feels like I am reading an article from a magazine such as Time or News Week. Maybe a newspaper even. Nothing written so far has been what I would consider too terse for a reader who is unfamiliar with the concepts of the book. Layman's terms are used to explain the various concepts to the reader; while I've found myself (a reader experienced in the books domains) not bored to death. Thats a feat in itself.<br /><br />I would recommend this book to any person interested in the political and social underground of the web. While reading my interest holds steady in part due to the activities of each individual which seem to shape and influence the landscape of the web. The book was published back in 2004. I'm guessing you could find a copy on the chep at a used bookstore. It should make for an interesting, quick read.robottawayhttp://www.blogger.com/profile/16898889765420671029noreply@blogger.com0tag:blogger.com,1999:blog-9097833656383843641.post-1675257988832201682007-11-04T18:50:00.000-08:002007-11-04T19:20:12.694-08:00Super Cheap Functioning LaptopsMany people have heard of the "<a href="http://www.laptop.org/">One Laptop Per Child</a>" (OLPC) program (Please excuse the terrible site. Here is the <a href="http://en.wikipedia.org/wiki/Olpc">wiki</a>, much better ;). The gist of OLPC is many companies have banded together to create a sub $200 laptop geared towards school children. It is expected the developing nations of the world will buy these units up in large numbers. They then will use them to increase the quality of education by giving the children a chance to experience the "greatness" of the internet, the word processor, the spreadsheet program, the mp3 yada yada yada... So anyway some guy over at Asustek, the maker of Asus brand computers decided "hey, lets build a ultra cheap laptop that is geared towards the Adult demographic". Great idea guy. <a href="http://eeepc.asus.com/en/index.htm">Check out the EEE pc</a>.<br /><br />I had some hands on time with the OLPC at the OSCON convention last July. It was neat in the sense of how far technology has come. It seems to work, which is an accomplishment considering the nature of the project, and conference attendees all seemed genuinely impressed. My deal though is this: it is a laptop geared towards a 8 to 10 year old boy. The color scheme and user interface all scream to this effect. I would not buy one of these and lug it into a coffee shop. Guys like me already have enough trouble making acquaintances without hauling a "hello kitty" lunch box everywhere we go. So in comes the Asus EEE pc. Seems to look good enough. The interface is simple. See <a href="http://honeypothack.com/eee/internet.htm">mock up here</a>. It also includes all the applications a person such as my mother, god mother, or wife need. Its perfect for Facebooking, instant messaging, video conferencing, writing email, browsing the web, plus the rest of the top 20. If it provides a seemless enough experience I think soon we will be seeing many more of these types of machines around.<br /><br />Now the crazy thing is both the EEE pc and OLPC are Linux based. Why you ask? Duh, because a copy of Windows is a few hundred bucks. The computer itself will likely cost less than a copy of Windows Vista Professional! Oh oh M$, your days may soon be the slightest bit darker. As an aside I read somewhere, not saying I believe it, but M$ got scared that Windows would not be running on the EEE and so are giving Asus a chance to offer XP at $40 dollers as an upgrade. How many will spring for this? Not a single person I know. When you figure that the Linux based OS is tailored to the EEE it would be hard to beat it. Not to mention but the EEE runs on a very small amount of disk space. This disk space is all flash memory and clocks in at 4 to 8 gigs. Windows will suck up your whole disk!robottawayhttp://www.blogger.com/profile/16898889765420671029noreply@blogger.com0tag:blogger.com,1999:blog-9097833656383843641.post-45202820570046538572007-10-20T20:59:00.000-07:002007-10-20T22:54:58.940-07:00Resumes, Hiring, Yada Yada YadaI'm sitting in my comfy chair, found in my little piece of wine country heaven. I'm sipping from a delicious can of "Peter's Brand Dutch Classics" Pilsner style ale. I just want to kick out some thoughts on hiring, resumes and what not. I work with computers, being that I attained a degree in computer science from a four year university. Now in the short time I have actually been in the "industry" I have seen curious things related to employment in general.<br /><br />First I will start with resumes. These are strange to me. I mean when it comes to computer work, specifically software engineering, how can a piece of paper accurately describe what you are capable of doing or what you are worth? Maybe it can, maybe it can't. Given a resume I will immediately have the mindset that this document is unlikely to provide any solid information. With out even taking a look at it. I've seen many resumes already in my field that for lack of better term "SUCK". Mine included... You can write in detail about projects you have worked on; but the hard problems you have faced and conquered, those that test your mind and patience, rarely come to light. It feels awkward to write a story in a resume, and for good reason. The story is often bland and not telling of concrete achievements. The reader, after reading paragraphs of story, will know you created some product such as "Shopping cart for my last employers website". But where is the actual difficulty in creating said product?<br /><br />If you really want to give the reader the understanding of your real worth you must show them you can do things, amazing things, and that you have beaten hard times before and finished with good results. How can you do this? I have some tips, but by no means am I an expert. Just a guy with some interest in this dilemma. A resume should be thorough but brief. Next time you are working on a resume try this: list the places where you have worked in the last five to ten years. For each place of employment list out the three hardest problems you had to solve while employed at respective places. Now write up these problems as simple problem, action, results format. This data should be top to listing all the "words" you know.<br /><br />On "words": Most software engineer resumes have boat loads of words that are supposed to give the reader the idea you know x y z. These words do not actually give the reader any real idea of what you are capable of. I mean anybody can become a J2EE Python Ruby Rails Hibernate Struts master, without actually having solved a real problem.<br /><br />For the graduate: If you do not have experience in anything, meaning you have not really solved any problems then you are probably not worth much. Now this is not likely to be the case. During my collegiate schooling I solved many interesting and difficult problems. If you are graduating use the hard problems you had to solve in school projects to your advantage. In my case I could have listed "Created AI for solving mine sweeper using computer learning" and "Created scheduling algorithm for safe and timely operation of multiple elevators". These are not easy problems, and giving a brief and thorough treatment of these problems should allow the resume reader to see you in a proper light.<br /><br />In taking this "problem solver" approach to resume writing you will not need to write long stories about projects you worked on. You will high light the problems that lied within some project(s) and how you were able to solve them. This will help the reader so much more than "Created SOAP layer to ecommerce business object layer, using XFire and Hibernate with all content encoded in UTF-8", or worse "Java J2EE Struts Hibernate Ruby on Rails XML ...".<br /><br />Now on to my second deal, hiring. This one is tricky. You need good people, and there are never enough of them. Regardless of what it is your company does in the software engineering field you will never be able to get enough people that have exactly that experience needed for the task at hand. Think round peg and square hole, now scale that up to every shape possibly imaginable. Each company only has a small set of unique holes and each possible job candidate has a certain 'peg' shape. You end up often making hires of pegs that do not fit your companies holes, but in hopes that they will be able to fit at some point. The sooner the better. So for that peg to change its shape it should be highly adaptable. You should be sure of this quality in a peg/candidate this when making the hire.<br /><br />I think the best way to be adaptable is to have the basic and intermediate knowledge of your field down pat. For me this is being able to identify the best algorithms and data structures to use in a given situation, or when to choose the usage of a MVC web framework over simple Servlets. Things such as fonts and encodings are very important, especially in these days of i18n. Being able to describe and properly use HTTP, TCP/IP and other ubiquitous protocols is very important. The ability to pick up new languages quickly and effectively is something that speaks volumes about your understanding of your field. Recursion, why do you not understand this? There is no good answer if you do not. Object oriented languages are here to stay, so you should be able to give reasons why you would use an interface rather than an abstract class, or describe what delegation is.<br /><br />Once you have that peg which fits said hole, do not ever let them leave. I know this is not really possible, at least not in a country like the US of A, but you should be doing whatever it takes to ensure that these people stay. Turnover kills in our industry, like few others. The knowledge gained by a software engineer is akin to that of a powerful business type. The business type knows all the contacts, all the players in his industry and if he leaves you may have to kiss good bye to some of those important relations (or contracts) that keep your company afloat. Now the software engineer (or IT Programmer Analyst or whatever) knows all the business systems, the software that keeps your company running. If that person leaves you are losing the person that knows how to get what is needed from the software for your business to run. Yes you can replace him, but you will need time and money to get those "contacts" back, and have things running in proper order again. There is nothing you can do to alleviate this problem. It is possible you will quickly find someone to replace the person, someone with exactly the knowledge needed to do what that person did. Not likely though... most software used in a company is purposefully altered to do things particular to the company of example. It is not an exact match to any other software running in any other place.<br /><br />So what can you do to keep people. I can't even begin. Some people get bored. Some people don't like their co-workers. Some need more money. Some have personal problems and just can't keep working. One thing I can suggest is honesty. If your company is one that is openly honest, meaning that employees can always be honest about themselves and others, you have a good chance of doing well. Honest companies will address problems pro actively. Honest people/companies are self conscious in not taking on more than they can finish. Honest people/companies make thorough assessments. The honest farmer does not sow 15 acres when he knows he can only reap 5, the honest framer does not begin building a barn when he knows he only has supplies enough for a shed.robottawayhttp://www.blogger.com/profile/16898889765420671029noreply@blogger.com0