Feb 07 2010

live blogging the superbowl

Published by jfrank under food

7:00 Etrade’s babies are creepy and not cool anymore. chunky.com is for soup.

6:48 Gold wins based on valor.

6:46 Imminent gatorade splashage

6:40 Blue leader just can’t do it! Gold holds them off right at the target!

6:38 Godaddy proves again that domains make women hot. Chickens scream again.

6:36 Blue leader is trying again. He is serious this time. Throws all the way down the green.

6:34 Announcer says “When moments are critical in a game, you go with what you do” Stupid men will even sit through a book club to get Bud Lite.

6:32 Doritos are worth killing for.

6:30 Gold took Blue leaders ball and ran it all the way down the field!!!

6:26 Green dystopia prosecutes the non green for using plastic and incandescent bulbs. Unles you own a green car! Barkley raps taco bell.

6:24 Blue leader has angry eyes!!!

6:22 Small digital squirrels love cars. Chickens scream like people, so we are supposed to want to eat them. So unappetizing.

6:20 Gold has a challenge about some kind of tricky play. They win it and for cunning get 2 points.

6:16 There is a hell emulator as a game. Bulls and horses are friends.

6:12 Gold scores again. There is much valor!

6:10 Gold ruins Blue’s day, and now they are pushing back the other way.

6:06 Emerald nuts are crazy, producing unbelievable feats of athletics.

6:02 Blue is moving down the green.

5:58 Comcast wants you to know how much HD they have, their HD is way WAY bigger than satellite’s

5:56 CBS wants you to watch the ads more

5:54 Roundup is creepy. It will kill things even after its done killing things.

5:48 A bad tape job can ruin a man.

5:44 A man sleepwalks through Africa facing dangers but eventually gets a Coke. Babies are creepy.

5:42 A man with hearing loss would trade his wife for his awesome tires.

5:40 Men are really good exercisers and they drink michelob ultra

5:38 The Blue leader is so upset that he is driving down the field for revenge! And he gets it!

5:30 Girls post pictures of themselves on the internet, and men everywhere get in trouble for looking at them.

5:28 Gold ones score a quick win.

5:23 Gold ones did some tricky move on the kick off. They got their own ball.

5:22 JayZ wins the superbowl… ? At least he has the trophy, and he runs this town. Good luck with that one. It is a full on brawl on the field.

5:20 Ford vehicles are literally made of water, and are self assembling.

5:16 Gold has 6 and Blue has 10. tv.com wants to be hulu. Toyota is now safe and trusts you.

5:15 Lots of new tv shows. “From the guy who brought you all those boring CSI knockoffs”.

5:02 The half time band is a bunch of old guys, who are reminding the world about an archaic game called pinball! A more timely message could not be found for the United States. But it turns out it is a medley.

5:00 Halftime report is awesome. Five guys with stick mics yelling incoherently at each other. It is almost as if if they had head mics they wouldn’t know what to do with their hands.

4:56 30 minutes of play, in merely two hours!

4:52 Fred Meyer’s has the single worst commercials… ever. (Billboards too)

4:49 Robots can’t handle derisive opinions. Intel has robot employees.

4:47 Women eviscerate men, and remove their spine. But if men have a portable tv, they regain their spine.

4:46 Harry Freaking Potter is a real place.

4:42 Little people commercials back to back. Little people 2010!

4:38 They are putting one of those crime dramas in space. CIS Moon will be next.

4:36 Men have a terrible life because of the things they put up with and do for their women. But they use it to negotiate with their spouses to buy an expensive car.

4:32 Gold does a good job getting down the green.

4:26 Women have good ideas, but men find the beer and everyone loves them better because they are easy going. If you succeed at being a man you can use some dove specialty soaps.

4:23 Back to back pantsless commercials. Pants are out in 2010!

4:22 A dude has a message for women. He thinks they are important if they watch football. And wants them to know their heart attacks are different.

4:18 Nothing rallies a town like beer. People will form a human bridge to get the truck through!

4:14 Gold makes some serious forward motion with much valor. Perhaps points are in order?

4:09 A good bachelor party requires an endangered species (in this case a killer whale).

4:06 Bud Lite makes you sound like TPain, women get the groceries and you just have to party!

4:04 Domain names excite women!

4:03 We should be kind to mean rich people when they lose their money.

4:02 Its not looking good for gold.

3:58 Somewhere in the past the blue ones were awarded three points for cunning and valor.

3:54 The blue ones have many tricky moves.

3:50 Slapping people on the back of the head is so cool.

3:46 Boost moble scares the !!!!! out of me. Dogs hurt people.

3:44 Focus on the Family hurts women. But they are really ok!?

3:42 The oldest man ever just kicked the ball.  Snickers hurts old people.

3:38 The blue ones seem pretty good at throwing, while the gold ones scurry about.

3:34 The gold ones had the ball, but now the blue ones have it.

3:31 Broadcast is also in Spanish.

3:29 The Hundai Sonata is less than 20k. You can quote them on that.

3:36 Modern NBA players don’t know who Larry Bird is.

3:34 Wife says snarky comments should go to the Internet not her. Rogain is gross.

3:21 PST Lots of sound problems so far. Queen Latifa had to take out her ear monitor. The intro videos for each team had a lot of mumbling.

One response so far

Jan 19 2010

Magnolia and Railo, Together at Last

Published by jfrank under coldfusion, magnolia, open source

Railo and Magnolia CMS are finally together. It’s been a bit of a bumpy road, what with issues arising immediately when they first met. A casual observer might think the relationship was doomed. But a funny thing happened over the course of the last year, Railo changed for the better and for that matter so did Magnolia. I’m proud to say they’ve even moved in to the same bulding at JBoss (in a matter of speaking). From what I hear the landlord thinks the world of both of them but they have still led separate lives.

Until now.

This will be the first in a series of magnolia-railo merged app tutorials. Part one will walk through the merging of the two web apps into one. Part two will show how to enable Railo templating and explore the interaction between Magnolia and Railo. Part three is about the dark side, potential problems and workarounds.

Before we dive in, I will address the question “why should these two technologies be merged?” It is simple really. Magnolia is a superior CMS to anything offered in the CFML world, and has amazing interoperability with other technologies. Railo on the other hand, blows the pants off any of the native templating options available in Magnolia and its rapid and powerful tag based language easily unlocks the power of Magnolia’s Jackrabbit JCR. In short, they were made for each other.

Lets put these two together:

  1. Download the latest railo custom all os war, extract to /merge-target. I’ll refer to this directory as the location of our new merged app, however you can name it what you wish.
  2. Delete these files from /merge-target/WEB-INF/lib These files overlap with magnolia’s jars.
    1. apache-jakarta-commons-codec.jar
    2. apache-jakarta-commons-collections.jar
    3. apache-jakarta-commons-fileupload.jar
    4. apache-jakarta-commons-httpclient.jar
    5. apache-jakarta-commons-io.jar
    6. apache-jakarta-commons-lang.jar
    7. apache-jakarta-oro.jar
    8. apache-lucene.jar
    9. backport-util-concurrent.jar
    10. concurrent.jar
    11. PDFBox.jar
  3. Download the latest railo patch (currently 3.1.2.006.rc). Put it in /merge-target/WEB-INF/lib/railo-server/patches/
  4. Download Magnolia Community Edition war extract to /magnolia-temp
  5. Copy /magnolia-temp/WEB-INF/lib/* to /merge-target/WEB-INF/lib/* There should be no file name conflicts.
  6. Copy /magnolia-temp/WEB-INF/config to /merge-target/WEB-INF/config
  7. Merge web.xmls. Use Magnolia’s xml header with namespaces! It doesn’t like anything else, because it reads it in at runtime. Here is the one I created:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
      <description>Magnolia</description>
      <display-name>magnolia</display-name>
    
      <distributable/>
      <filter>
        <display-name>Magnolia global filters</display-name>
        <filter-name>magnoliaFilterChain</filter-name>
        <filter-class>info.magnolia.cms.filters.MgnlMainFilter</filter-class>
      </filter>
      <filter-mapping>
        <filter-name>magnoliaFilterChain</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>ERROR</dispatcher>
      </filter-mapping>
      <listener>
        <listener-class>info.magnolia.cms.servlets.MgnlServletContextListener</listener-class>
      </listener>
    
    	<servlet>
    		<servlet-name>CFMLServlet</servlet-name>
    		<description>CFML runtime Engine</description>
    		<servlet-class>railo.loader.servlet.CFMLServlet</servlet-class>
    		<init-param>
    	      <param-name>configuration</param-name>
    	      <param-value>/WEB-INF/railo/</param-value>
    	      <description>Configuraton directory</description>
    	    </init-param>
    		<!-- init-param>
    	      <param-name>railo-server-root</param-name>
    	      <param-value>.</param-value>
    	      <description>directory where railo root directory is stored</description>
    	    </init-param -->
    		<load-on-startup>1</load-on-startup>
    	</servlet>
    	<servlet>
    		<servlet-name>AMFServlet</servlet-name>
    		<description>AMF Servlet for flash remoting</description>
    		<servlet-class>railo.loader.servlet.AMFServlet</servlet-class>
    		<load-on-startup>1</load-on-startup>
    	</servlet>
    	<servlet>
    		<servlet-name>FileServlet</servlet-name>
    		<description>File Servlet for simple files</description>
    		<servlet-class>railo.loader.servlet.FileServlet</servlet-class>
    		<load-on-startup>2</load-on-startup>
    	</servlet>	 
    
    	<servlet-mapping>
    		<servlet-name>CFMLServlet</servlet-name>
    		<url-pattern>*.cfm</url-pattern>
    	</servlet-mapping>
    	<servlet-mapping>
    		<servlet-name>CFMLServlet</servlet-name>
    		<url-pattern>*.cfml</url-pattern>
    	</servlet-mapping>
    	<servlet-mapping>
    		<servlet-name>CFMLServlet</servlet-name>
    		<url-pattern>*.cfc</url-pattern>
    	</servlet-mapping>
    	<servlet-mapping>
    		<servlet-name>AMFServlet</servlet-name>
    		<url-pattern>/flashservices/gateway/*</url-pattern>
    	</servlet-mapping>
    	<servlet-mapping>
    		<servlet-name>FileServlet</servlet-name>
    		<url-pattern>/</url-pattern>
    	</servlet-mapping> 
    
    <welcome-file-list>
    	  <welcome-file>index.cfm</welcome-file>
    	<welcome-file>index.cfml</welcome-file>
    </welcome-file-list>
    
    </web-app>
  8. Create file /merge-target/WEB-INF/bootstrap/common/config.server.filters.bypasses.railo.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <sv:node sv:name="railo" xmlns:sv="http://www.jcp.org/jcr/sv/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <sv:property sv:name="jcr:primaryType" sv:type="Name">
        <sv:value>mgnl:contentNode</sv:value>
      </sv:property>
      <sv:property sv:name="jcr:uuid" sv:type="String">
        <sv:value>11577b1a-3123-4cae-80a9-96c1cd5c27ad</sv:value>
      </sv:property>
      <sv:property sv:name="class" sv:type="String">
        <sv:value>info.magnolia.voting.voters.URIStartsWithVoter</sv:value>
      </sv:property>
      <sv:property sv:name="pattern" sv:type="String">
        <sv:value>/railo-context</sv:value>
      </sv:property>
      <sv:node sv:name="MetaData">
        <sv:property sv:name="jcr:primaryType" sv:type="Name">
          <sv:value>mgnl:metaData</sv:value>
        </sv:property>
        <sv:property sv:name="mgnl:activated" sv:type="Boolean">
          <sv:value>false</sv:value>
        </sv:property>
        <sv:property sv:name="mgnl:activatorid" sv:type="String">
          <sv:value>superuser</sv:value>
        </sv:property>
        <sv:property sv:name="mgnl:authorid" sv:type="String">
          <sv:value>superuser</sv:value>
        </sv:property>
        <sv:property sv:name="mgnl:creationdate" sv:type="Date">
          <sv:value>2007-04-25T18:23:31.784+02:00</sv:value>
        </sv:property>
        <sv:property sv:name="mgnl:lastaction" sv:type="Date">
          <sv:value>2007-05-02T17:00:15.025+02:00</sv:value>
        </sv:property>
        <sv:property sv:name="mgnl:lastmodified" sv:type="Date">
          <sv:value>2010-01-14T15:46:52.318-08:00</sv:value>
        </sv:property>
      </sv:node>
    </sv:node>
    
  9. Set magnolia.update.auto=true in /WEB-INF/config/default/magnolia.properties
  10. Start your container such as tomcat.
  11. Go to /.magnolia, login superuser/superuser
  12. Navigate to Configuration. server->filters->bypasses. You will see the railo node appears, in the configuration bypasses. If you inspect it you will see it is a uriStartsWithVoter that is configured with /railo-context. This node gives you bypassing of magnolia filters for any url starting with /railo-context.
  13. Because of this you can hit /railo-context/admin/index.cfm and setup railo.

The bypass rule is required because Magnolia controls the url space with its chain of filters. You can right click on it and copy it to make another arbitrary bypass that is applied immediately. The filters are configurable and this gives you flexibility in fronting CFML apps with arbitrary urls configurable at runtime. At this point you can build anything you want using Magnolia’s built in templating. The bypasses allow you to run standalone CFML apps in the same JVM, under specified url paths (/myapp/*).

That is it for part one. The next article will highlight how your templates and paragraphs can be built in standard CFML, and the interaction between Magnolia and Railo.

No responses yet

Aug 06 2009

earl grey ice cream

Published by jfrank under food

Earl Grey Ice Cream

  • larger ziploc bag (1 gallon or 1 quart)
  • smaller ziploc bag (1 pint or 1 quart)
  • ice
  • salt (rock preferred)
  • 2 earl grey tea bags
  • 1/2 cup water
  • 1/4 cup whipping cream
  • 1/4 cup whole milk
  • 1 tablespoon sugar

Heat the water to boiling, pull it off the heat and put in the tea bags. Let it steep for a few minutes, pull out the tea bags. Squeeze the teabags and attempt to get all the flavour out into the liquid, it should be dark brown.

Put the concentrated tea, sugar, cream and milk in to the smaller bag and seal it.

Pack the larger bag 1/3 full of ice and salt, place the smaller sealed bag into the larger bag, place more ice and salt on top. The goal is to completely surround the smaller bag with ice.

Shake for about 10 minutes or until inner bag is ice cream.

Eat the best ice cream in the world!

No responses yet

Jul 07 2009

svnant 1.3

Published by jfrank under svnant

You’ve been waiting for it! You’ve been porting to other solutions! But wait! here it is!

svnant 1.3 with subversion 1.6.X support.

Tigris happens to be doing maintainence now but it will be up there soon too.

9 responses so far

Mar 18 2009

how to count connections on windows command line

Published by jfrank under Uncategorized

At work I am troubleshooting apache/tomcat/coldfusion/magnolia stack on windows. It is the most fun thing you can imagine. I was messing with apache’s configuration on mod_proxy_balancer and I needed to a way to test if my settings were having the desired effect.

I ran into a *nix shell script that did this, but not one for windows. This is super simple way to count connections against your localhost’s port 80, web server. It shows established and waiting connections.

Save this as a  .bat file and it will output them. It could be optimized in a number of ways, but who cares!


echo port 80:
netstat -a -n | find "TCP 127.0.0.1:80 " | find /C "ESTAB"
netstat -a -n | find "TCP 127.0.0.1:80 " | find /C "TIME_WAIT"

No responses yet

Jan 26 2009

util vs utils

Published by jfrank under open source

Dear open source software community,

Utilities are an important part of programming packages. It is commonly held that a utility class be one with static methods; the association that they may hold may be as simple as the type they operate on. 

A utility for manipulating strings may be called StringUtil or StringUtils. There is no consensus on this in the community.

If you hold that each method in the class IS a utility, you would probably assume the class should be named StringUtils. (like apache lucene, apache commons, spring)

If you hold that the class itself is the utility, bound together by its common association. Each method is simply that, a method in the utility that operates on strings, you would probably assume the class should be named StringUtil. (like apache lucene, apache poi or jetty)

Thats right, in lucene they can’t even decide within the same project…

They have packages named util and utils, and utilities name SUBJECTutil and SUBJECTutils.

Kind of like my codebase at work… As soon as you decide.. can you let me know?

- Joshua

Update: At my work developer poll ”util” has it. Three to one with one abstaining.

 

Util 3 Utils 1 Abstain 1

One response so far

Jan 04 2009

my router has a default editor

Published by jfrank under home network

My home network gateway is a busybox (linux) based openWRT router running on linksys wrt54g hardware. I’ve been playing with its many built in and package based features, via ssh and a web based portal. For my next version I think I can dump the web based portal and go strait for the pure ssh only distribution.

My router is actually not a router at all anymore, it is an embedded computer with a wireless adapter (or two?) and a fully configurable switch, set up in client mode, using its wireless adapter to search for open wifi nodes and connect. Then it nats up a wired network (which my 800 foot condo has 14 ports) for the rest of my computers.

I realized just how cool it was when I was adding a crontab entry to do connection detection and reconnect and it opened up vi. I don’t get vi, and don’t care to understand it. I had to go look up how to exit it. I’m not ashamed to say so, its a horrible, horrible invention. Ok so not a horrible invention, but like the telegraph it has served its purpose. Can we move on?

So I cracked open the global profile in zile (light emacs clone) and changed the default editor.

That is when I realized, this is cool. I have not one, but multiple editors on my router. Other packages that are available are traffic shaping, upnp, various kinds of vpn, torrent clients among other things.

Next I am going to move on to my home backup/file server/torrent machine which will probably be an openwrt box as well. This time its running on a 1 watt solid state linksys NSLU2, spinning up a hard drive when I want to stream or backup something, but mostly relying on a large usb flash drive for torrenting. The NSLU2 and the router combined will be a super low power ‘always on’ computer for my home. Yay!

No responses yet

Dec 02 2008

a groovy google calendar

Published by jfrank under groovy

I pushed some buttons and opened up part of my svn repository to share the code from my earlier example:

https://www.joshuafrankamp.com/svn/incubator/simpleGroovyCalendar/src/

I read up on groovy’s site, about google data support but I actually couldn’t find the referenced code anywhere… I’d like to learn more about ‘use’ and other aop/mixin techniques.

No responses yet

Nov 30 2008

svnant 1.2.1 released

Published by jfrank under svnant

I fixed a few bugs in this release. One was dealing with remote info requests against files. A couple others were from updated subversion 1.5, and new svnant dependencies. I added a cleanup task, contributed to Oleg Byelkin.  Writing the tests for that was a little bit of a trick due to the fact that cleanup (in order to be succesful) needs to have a messed up working copy… so I settled for writing a lock file to the .svn/ and calling it succesful if it removed it.

svnant-1.2.1.zip

2 responses so far

Nov 29 2008

groovy code needs viagra (it keeps shrinking)

Published by jfrank under groovy

The other day I was talking to some coworkers about a groovy method that I had refactored. It was one that I had pulled the guts out because I needed two forms of the same data. So I added getDaySizeList which contains most of the logic, but I still needed to get a rollup sum from getDuration for another part of the application.

I knew groovy collections supported an “each” function that takes a closure. Groovy syntax allows for omission of parentheses when there is at least one argument, so it can look like this:

myCollection.each{ closure } not myCollection.each({ closure })

it would also allow you do things like:

myCollection.add object  (look no parens!)

which creeps me out right now, so I’m not going to think about it.

I digress… Here is my method, that I thought was a short implementation:

int getDuration(){
	int hours = 0;
	getDaySizeList().each{dayHourMap -> hours += dayHourMap.hours}
	return hours
}

I was excited, no visible loop, just something to do “each” for the members of the collection, drilling down into the hours property of the map in each collection item, summing them into a waiting “hours” int, then returning it. Slick.

Barney then replied that I should have (duh) used the sum closure-taking builtin in groovy… which turns the above method into this:

int getDuration(){
	return getDaySizeList().sum{it.hours}
}

“it” is the default single argument to the closure.  You can see I only kept the end of the closure, to the right of the former +=.

Magic.

One response so far

Next »