Happy new year and stuff.
I’ve been:
- Working hard at ECR Software
- Running (I’m running a half-marathon on May 4th)
- Enjoying Rockbox on my new Sansa Clip Zip
- Happy I switched from Pandora Radio to Spotify
- Loving Python (cerberus, messing with Django)
Happy new year and stuff.
I’ve been:
So, turns out my experiment with Spark + StringTemplate is not going so well. The combination of the two projects is nice but not for what I need. The templates I’m trying to design are a little too complex and require too much Java code to manage and build the views. I’m going to rewrite everything I have so far in GWT, which is a framework I know quite a bit better than both Spark and StringTemplate. What I have converted so far can only be run in DevMode from within Eclipse. I’ll update later when the project is runnable. Code is at my GitHub.
I had some time to work on uPaste quite a bit today. I converted the entire view system to a composite pattern. I was having trouble using StringTemplate for multi-level views. i.e. the parent templates had to know about the child views’ parameters; this was not work for me. I need completely modular templates.
Below is a screen-shot of a new view along with some new styles…
I really don’t like where the "Home | Browse | About" is located. That’s going to change.
Development should go much faster now that I’ve redone the view system. It was really the only thing delaying me before.
I’ve been working on a little project again. My goals this time are:
- learn more about Tomcat
- learn Spark, a Java webapp micro-framework
- learn String Template (which is awesome! )
- continue learning about JPA, this time I’m using the EclipseLink implementation
- create a website similar to PasteBin, but with a feature that allows anyone to download a single file that is executable. That file hosts the exact same pasting website but on their LAN. This is very useful for developers in a corporate environment that don’t want to share code on a publicly visible website.
- my final and usual goal is to have some fun
Check out the project over at my GitHub. At this point it’s usable but lacking some important features like browsing all pasted items, pasting images, and overriding the syntax highlighter (right now it’s just automatic). Its also pretty ugly right now.
This little snippet of code is useful when you’re trying to use pagination with a Hibernate Criteria query. Basically, you pass this method your history of Projection[s] and ResultTransformer because these must be overwritten in order to get the total row count of a query.
The original Projection will be overwritten with the rowCount Projection. The ResultTransformer will be implicitly overwritten when setting the Projection.
|
1 2 3 4 5 6 7 8 9 |
public Number criteriaCount(Criteria c, Projection proj, ResultTransformer transformer) { c.setProjection(Projections.rowCount()); Number count = (Number) c.uniqueResult(); c.setProjection(proj); c.setResultTransformer(transformer); return count; } |
Intense video footage ON boosters falling from a space shuttle…all the way back down to Earth.
back. Server has been moved.
Sometimes at work I’ll be chatting with someone using our messenger service and I’ll tell them that I’ll come see them (in person) in 10 minutes. Usually because I have to finish up a block of code or something. Every one in a while, I’ll be pretty busy or really into my work and I’ll forget to actually go see them.
I made this quick reminder website last night to make quick reminders. I usually don’t want to take the time to create a Google Calendar event and I haven’t found a simple reminder program to run on my desktop. They’re all just too complex.
Here it is: remind.bostrt.net
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
(defun rotate-windows () "Rotate your windows" (interactive) (cond ((not (> (count-windows) 1)) (message "You can't rotate a sinlge window!")) (t (setq i 1) (setq numWindows (count-windows)) (while (< i numWindows) (let* ( (w1 (elt (window-list) i)) (w2 (elt (window-list) (+ (% i numWindows) 1))) (b1 (window-buffer w1)) (b2 (window-buffer w2)) (s1 (window-start w1)) (s2 (window-start w2)) ) (set-window-buffer w1 b2) (set-window-buffer w2 b1) (set-window-start w1 s2) (set-window-start w2 s1) (setq i (1+ i))))))) (global-set-key (kbd "C-c C-r") 'rotate-windows) |
This is a neat little function that I wrote a few years ago and had left on the student server at school. I found a backup of my files from that student server…found this file.
It rotates windows in an Emacs frame. It’s useful if you use horizontal/vertical frame splitting in Emacs.