ClickOnChris

Christopher G Johnson: programmer, entrepreneur, gamer

Archive for the ‘Programming’ Category

JPA Annotation Cheatsheet

with one comment

Whenever I need need help configuring JPA annotations I turn to google, and I always find it difficult to find a good cheatsheet.

Well here is my favorite JPA annotation cheatsheet.  Even though it says Oracle and Toplink it applies to any Spring/JPA/Hibernate technology stack:

http://www.oracle.com/technetwork/middleware/ias/toplink-jpa-annotations-096251.html

Oh yeah, and here’s my tip on using cascades: Never use CascadeType.ALL!  Use MERGE, PERSIST, and maybe REMOVE if you want to cascade your deletes.  CascadeType.ALL will result in poor performance and unintended consequences.

Post to Twitter

Fork me on GitHub

Written by clickonchris

August 31st, 2010 at 7:51 am

Posted in Java,Programming

Configuring Jetty, Maven, and Eclipse together with Hot Swap

with 2 comments

This tutorial will show you how to setup Jetty in embedded mode, and using Eclipse, attach a debugger to enable True Hot Deployment of code onto your Jetty server.

Click to continue reading “Configuring Jetty, Maven, and Eclipse together with Hot Swap”

Post to Twitter

Written by clickonchris

May 27th, 2010 at 11:06 pm

Posted in Databases,Java,Programming

Tagged with

And… We’re Back

without comments

I blame wp-supercache.  I knew something was funny when the twitter posts on the front page were from many many moths ago.  I figured its like your web browser – just delete the cache and you’ll be all set.  Well when I deleted wp-supercache’s cache, my site went down, and it took me a couple of days to bring it back up

The fix?

1 -Disable plugins via the database:

http://codex.wordpress.org/FAQ_Troubleshooting#How_to_deactivate_all_plugins_when_not_able_to_access_the_administrative_menus.3F

2 – Modify  .htaccess to comment out or remove the section relating to wp-supercache.

wp-supercache has always caused some oddities.  I will no longer be using it.

Post to Twitter

Written by clickonchris

April 30th, 2010 at 10:47 pm

Posted in Programming

Tagged with ,

Tutorial: Palm Pre SDK

with 65 comments

The Palm Pre SDK, named Mojo, is not supposed to be available to the general public of developers for a few months.  Apparently it was leaked on the internets last night.  I was able to get a Hello World program running on the emulator.  Here is how I did it.

Environment:
Windows XP
Java JDK 1.6.0_11 (any 1.6 probably works)
Any modern CPU should work.  Mine is 32 bit – not sure about 64 bit.
The emulator takes ~300MB of memory so you’ll probably want at least 1GB.I’ve got 2GB

1 – Download and install VirtualBox
(http://www.virtualbox.org/wiki/Downloads).  I am using version 2.2.4

2 – Download and install the SDK.
Palm has the SDK available for free download.  I think registration is required.
link: http://developer.palm.com/index.php?option=com_content&view=article&layout=page&id=1788

3 – Start the Emulator.
When the SDK finishes installing you should see a “Palm Emulator” icon on your desktop.  Open it.

The emulator should start up and it should look like this:

Linux kernel starting

Starting Linux

Click to continue reading “Tutorial: Palm Pre SDK”

Post to Twitter

Written by clickonchris

June 27th, 2009 at 4:29 pm

Posted in Pre,Programming

A Better Window.onLoad with jQuery

without comments

I have recently come to discover the javascript library jQuery. My favorite feature is the window.onLoad replacement, which is actually faster than window.onLoad and can be used multiple times in one document.

<span style="color: #008000;">  $(document).ready(function(){
    // Your code here...
  });</span>

Any code in the Your code here.. block will execute as soon as the page is loaded. This is useful for referencing DOM elements which would have been “undefined” before the page was fully loaded by the browser.

Post to Twitter

Written by clickonchris

December 23rd, 2008 at 9:02 pm

ASP.NET isn’t so bad

without comments

Previous to my new job it had been a long time since I did any programming in asp. That would have been around 2003 when working on the Augustana College marketing club webapp. I was soured on it then, convinced that PHP was the superior language. To be fair, asp.net is more of a set of tools for creating a webapp (since you can use any .net language you want), where as classic asp was really its own language.

Lots of things have changed since then and I’m finding myself enjoying building apps in asp.net as opposed to PHP or Java. I will still maintain that Java lends itself better to large, scalable webapps because of ejb and its built-in transaction handling. However, if your goal is to make a complex UI and make it quickly, I’d lean towards asp.net

Post to Twitter

Written by clickonchris

June 28th, 2008 at 9:19 pm

Posted in .Net,Programming

Rails 2.0 killed my site

without comments

My website has been down for the last 2+ days. The reason: Dreamhost upgraded to Rails 2.0 without any warning. Since some of my code was not 2.0 compliant – BAM! down goes my site.

In case I can help anyone else out of a bind, or avoid this horrible fate, here are the steps I had to take to get my website back up and running with Rails 2.0:

  1. Add a config.actioncontroller.session entry to my environments.rb file. I added it within the Rails::Initializer block. This was in response to the following error I found in my production.log file:
    A secret is required to generate an integrity hash for cookie session data. Use config.action_controller.session = { :session_key => “_myapp_session”, :secret => “some secret phrase of at least 30 characters” } in config/environment.rb
    Luckily the error tells you exactly what to do
  1. Next, I had to fix this error:
    undefined method ‘paginate’
    I fixed it by installing the plugin ‘classic_pagination’. To do this you simply have to run
    “script/plugin install svn://errtheblog.com/svn/plugins/classic_pagination” from your project root.
    Apparently they took out built-in pagination support from Rails 2.0. This will_paginate plugin is supposed to be better, but I didn’t care to figure out how to work it right now.
  1. Finally, I had to fix all of my start_form_tag entries.

There was a good demo of how to do this in the what’s new in Rails2? slideshow

Post to Twitter

Written by clickonchris

June 6th, 2008 at 8:11 pm

ClickOnChris is Web 2.0!

without comments

 have implemented AJAX style comments system. If you click on the ‘Add Comment’ button below you can see it. The difference is that now you are presented with a comments form appears within the existing page instead of a comments form being on a new page, as was the previous behavior. This is AJAX, and it is the technology that people are calling Web 2.0. 
What’s the big deal you ask? By having the ability to only update parts of a web page instead of updating the whole page every time you invoke some function, it makes the browser act more like a desktop application than a web page. The end result is more robust applications served over the web. Think google maps or facebook.

Post to Twitter

Written by clickonchris

May 9th, 2008 at 9:23 pm

Posted in Ruby on Rails

Axishost lackluster Rails support

with one comment

As I get more comfortable with Ruby on Rails development, I have been looking to take advantage of Subversion and FastCGI – tools that are vitally important to any halfway decent rails environment. Subversion (with Capistrano) helps automate deployment, while FastCGI helps your rails web pages load quickly. At the moment, my website seems sluggish at best.

My hosting provider, Axishost , does not seem concerned about providing either of these tools to its customers. When I asked about subversion support, I got the following response:

Thanks but no thanks guys. I picked this host specifically because it advertised that it supports Ruby on Rails (and its 99.9% uptime guarantee is pretty nice). The reality seems that Axishost only partially supports Ruby on Rails. This environment is not good enough for any Rails application worth a damn.

Hi Chris, At this point there are no plans to add subversion to the servers, nor is it on schedule for the near future. If the demand increases it may become a more viable option, but at this point it is not.

Please let us know if there is anything else we can do for you!

It was the same story regarding FastCGI

FastCGI is not installed.

Get it together Axishost

Post to Twitter

Written by clickonchris

October 13th, 2006 at 12:15 am

Posted in Ruby on Rails

Twitter links powered by Tweet This v1.8.2, a WordPress plugin for Twitter.

Switch to our mobile site