I got hit by a car today!

I just wanted to give a shout out to all of the people who don’t look to their right when making a right hand turn! I was out riding my bike this morning and went to cross in front of a car at a stop sign. She had stopped and there was a pack of cars coming. I stopped and stared for a second, she inched up and then stopped again. I assumed she was going to wait for the cars so I went … and then so did she! Mistake : Never assume the other guy is paying attention!

The good news is I walked away clean. I was clipped into my pedals so when her car hit me, I just fell over onto her hood and the bike held me up. I left a righteous “Ed Print” in her hood before I slid down and hit my elbow on the pavement. I got some pretty good road rash from that one. :) The bike survived with just a minor hit as well, I had to get the wheel trued up and change the tube, but I was able to ride the bike home so not having to walk the mile carrying the bike was a plus!

Funny how you react when this stuff happens. Everything happened in slow motion and I thought to myself “I can’t believe i’m actually getting hit by a car!”

Anyway, the moral of this story, look to your left AND YOUR RIGHT when you’re turning… there could be a biker there. ;)

, ,

No Comments

Gun Control … this pretty much sums up my feelings on it.

Yeah, this will do nicely.

pic20799

, , , ,

No Comments

Not cuil guys, not cuil at all…

Here I sit, broken hearted… my photo gallery is down. I happened to click the link this morning and the gallery was down with a 500 internal server error. I hit the logs and what do I see, i’m being spidered and it’s beating my web server down. There’s a new search engine on the block called Cuil (pronounced ‘cool’), and apparently it’s not very nice to the small web server owner. They advertise themselves and brag about how many pages they crawl and such… well, thanks for killing my damned web server jackasses. Your mega crawler just blasted my web server into oblivion. Now I have a robots.txt in place and hopefully that will shut this crap down. Funny, i’ve never had problems with Googlebot or any other search engine’s crawler until now.

Another fun day on the web. :)

, , ,

No Comments

Prolific USB to Serial Adapters

What’s the deal with these things? It seems like no matter how hard I try, I can never get one to actually work with the device that i’m using. I’ve successfully managed to make it work with an old serial swipe card reader, but that’s about it!

It also seems like completely uninstalling the Windows drivers is an impossibility. I have three different USB to Serial adapters, all made by different vendors, all using the same Prolific PL2303 chipset. The installed drivers work for ONE of them. No amount of deleting ghosted devices or clearing USB IDs out of the registry can make the other two work correctly. I’ve even tried forcing them onto the older versions of the drivers with no luck. It’s just disaster after disaster with these things, yet it seems like everyone is using this same chip set.

Yet another piece of terrible driver software accompanied by bad hardware. Any recommendations for a good USB to Serial adapter would certainly be appreciated! If anyone is into the aquarium scene and has used one with an Aquatronica controller, that would be even more helpful. Sad irony, Aquatronica sells a PL2303 based USB to Serial adapter and i’d say success rates are abysmal. I see LOTS of people complaining about them not working. At least i’m not alone!

, , , ,

No Comments

10 points

One day, he’s going to get tired of the abuse… until then, enjoy. :)

(11:26:05 PM) Chris: in RTSes i generally have the same basic approach all the time
(11:26:15 PM) Ed: Yeah, suck ass and die a lot. :D
(11:26:19 PM) Chris: hahahahahahahahah
(11:26:39 PM) Chris: very nice
(11:26:40 PM) Chris: 10 points
(11:26:41 PM) Chris: lol

, ,

No Comments

Adobe Flex, BlazeDS, and TIBCO EMS

I’ve searched high and low and can’t really find a good walk through on how to configure TIBCO EMS and BlazeDS. The documentation can also be a little gray on how to correctly use the JMS adapter so i’ve taken the liberty of putting together this little pictorial on how it’s done.

First things first, get yourself a fresh copy of Eclipse. For this setup, I used Eclipse Ganymede (3.4, J2EE Edition) on Windows. You’ll need the Java stuff in addition to Flex Builder because we’re going to launch our own tomcat inside of Eclipse instead of using BlazeDS Turnkey or any of those. Also, if you want to add in Java remoting later you’ll appreciate having the components already there.

Next, install the Flex plugin for Eclipse and update according. I downloaded and installed the Flex 3.3 SDK and changed my default SDK in the preferences. Once the eclipse platform is installed, updated, and configured the way you like it, let’s make a new project.

Note: Click any one of these images for the full size version.
Step 1 - Create a new Project of type "Other"

Step 1 - Create a new Project of type "Other"

Step 2 - Expand the Server category and then select Server

Step 2 - Expand the Server category and then select Server

Step 3 - Create an Apache Tomcat v6.0 Server on Localhost

Step 3 - Create an Apache Tomcat v6.0 Server on Localhost

Step 4 - Set Installation Directory and JRE, Install if Necessary

Step 4 - Set Installation Directory and JRE, Install if Necessary

Step 5 - No projects yet, just hit Finish

Step 5 - No projects yet, just hit Finish

Step 6 - Create another new project of type "Other"

Step 6 - Create another new project of type "Other"

Step 7 - Now expand the Flex Builder category and select "Flex Project"

Step 7 - Now expand the Flex Builder category and select "Flex Project"

Step 8 - Set it for a J2EE application server and enable the combined Java/Flex project using WTP

Step 8 - Set it for a J2EE application server and enable the combined Java/Flex project using WTP

Step 9 - Connect the project to your Tomcat server and select the blazeds.war that you downloaded from Adobe

Step 9 - Connect the project to your Tomcat server and select the blazeds.war that you downloaded from Adobe

Step 10 - Everything should be good here

Step 10 - Everything should be good here

Step 11 - If everything went well, you should see have the following files available

Step 11 - If everything went well, you should see have the following files available

Step 12 - Open the web.xml, messaging-config.xml, and services-config.xml

Step 12 - Open the web.xml, messaging-config.xml, and services-config.xml

First, let’s edit web.xml. This file should be okay out of the box. Here’s mine as a reference.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" 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">
	<display-name>blaze1</display-name>
 
	<context-param>
		<param-name>flex.class.path</param-name>
		<param-value>/WEB-INF/flex/hotfixes,/WEB-INF/flex/jars</param-value>
	</context-param>
 
	<!-- Http Flex Session attribute and binding listener support -->
	<listener>
		<listener-class>flex.messaging.HttpFlexSession</listener-class>
	</listener>
 
	<!-- MessageBroker Servlet -->
	<servlet>
		<servlet-name>MessageBrokerServlet</servlet-name>
		<servlet-class>flex.messaging.MessageBrokerServlet</servlet-class>
		<init-param>
			<param-name>services.configuration.file</param-name>
			<param-value>/WEB-INF/flex/services-config.xml</param-value>
		</init-param>
		<init-param>
			<param-name>flex.write.path</param-name>
			<param-value>/WEB-INF/flex</param-value>
		</init-param>
		<load-on-startup>1</load-on-startup>
	</servlet>
 
	<servlet-mapping>
		<servlet-name>MessageBrokerServlet</servlet-name>
		<url-pattern>/messagebroker/*</url-pattern>
	</servlet-mapping>
	<welcome-file-list>
		<welcome-file>index.html</welcome-file>
		<welcome-file>index.htm</welcome-file>
		<welcome-file>index.jsp</welcome-file>
		<welcome-file>default.html</welcome-file>
		<welcome-file>default.htm</welcome-file>
		<welcome-file>default.jsp</welcome-file>
	</welcome-file-list>
 
	<!-- for WebSphere deployment, please uncomment -->
	<!--
		<resource-ref>
		<description>Flex Messaging WorkManager</description>
		<res-ref-name>wm/MessagingWorkManager</res-ref-name>
		<res-type>com.ibm.websphere.asynchbeans.WorkManager</res-type>
		<res-auth>Container</res-auth>
		<res-sharing-scope>Shareable</res-sharing-scope>
	</resource-ref>
	-->
</web-app>

Now let’s edit services-config.xml. Key things to note here is that i’ve disabled the inclusion of the remoting-config.xml and the proxy-config.xml since i’m not using them. I’ve also changed the default AMF channel from “my-amf” to “AmfChannel1″ and updated the endpoint URL. Everything else is pretty much the same.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?xml version="1.0" encoding="UTF-8"?>
<services-config>
 
    <services>
    	<!--
        <service-include file-path="remoting-config.xml" />
        <service-include file-path="proxy-config.xml" />
        -->
        <service-include file-path="messaging-config.xml" />        
    </services>
 
    <security>
        <login-command class="flex.messaging.security.TomcatLoginCommand" server="Tomcat"/>
        <!-- Uncomment the correct app server
        <login-command class="flex.messaging.security.TomcatLoginCommand" server="JBoss">
		<login-command class="flex.messaging.security.JRunLoginCommand" server="JRun"/>        
        <login-command class="flex.messaging.security.WeblogicLoginCommand" server="Weblogic"/>
        <login-command class="flex.messaging.security.WebSphereLoginCommand" server="WebSphere"/>
        -->
 
        <!-- 
        <security-constraint id="basic-read-access">
            <auth-method>Basic</auth-method>
            <roles>
                <role>guests</role>
                <role>accountants</role>
                <role>employees</role>
                <role>managers</role>
            </roles>
        </security-constraint>
         -->
    </security>
 
    <channels>
        <channel-definition id="AmfChannel1" class="mx.messaging.channels.AMFChannel">
            <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/AmfChannel1" class="flex.messaging.endpoints.AMFEndpoint"/>
        </channel-definition>
    </channels>
 
    <logging>
        <target class="flex.messaging.log.ConsoleTarget" level="Error">
            <properties>
                <prefix>[BlazeDS] </prefix>
                <includeDate>false</includeDate>
                <includeTime>false</includeTime>
                <includeLevel>false</includeLevel>
                <includeCategory>false</includeCategory>
            </properties>
            <filters>
                <pattern>Endpoint.*</pattern>
                <pattern>Service.*</pattern>
                <pattern>Configuration</pattern>
            </filters>
        </target>
    </logging>
 
    <system>
        <redeploy>
            <enabled>false</enabled>
            <!-- 
            <watch-interval>20</watch-interval>
            <watch-file>{context.root}/WEB-INF/flex/services-config.xml</watch-file>
            <watch-file>{context.root}/WEB-INF/flex/proxy-config.xml</watch-file>
            <watch-file>{context.root}/WEB-INF/flex/remoting-config.xml</watch-file>
            <watch-file>{context.root}/WEB-INF/flex/messaging-config.xml</watch-file>
            <watch-file>{context.root}/WEB-INF/flex/data-management-config.xml</watch-file>
            <touch-file>{context.root}/WEB-INF/web.xml</touch-file>
             -->
        </redeploy>
    </system>
 
</services-config>

And last but not least, messaging-config.xml. This file is where the JMS connection is made to the TIBCO EMS server. And no, you do not have to put anything in context.xml when you’re doing it this way. :)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?xml version="1.0" encoding="UTF-8"?>
<service id="message-service" 
    class="flex.messaging.services.MessageService">
 
    <adapters>
        <adapter-definition id="actionscript" class="flex.messaging.services.messaging.adapters.ActionScriptAdapter" default="true" />
        <adapter-definition id="jms" class="flex.messaging.services.messaging.adapters.JMSAdapter"/>
    </adapters>
 
    <default-channels>
        <channel ref="AmfChannel1"/>
    </default-channels>
 
	<destination id="jmsDest1">
		<properties>
			<jms>
				<!-- topic/queue -->
				<destination-type>topic</destination-type>
				<!-- What type of message we expect -->
				<message-type>javax.jms.TextMessage</message-type>
				<!-- This is the JNDI name of the topic/queue connection factory on the server -->
				<connection-factory>TopicConnectionFactory</connection-factory>
				<!-- This is the JNDI name of the topic/queue on the server -->
				<destination-jndi-name>testTopic</destination-jndi-name>
				<!-- Keep JMS headers when the message is delivered to Flex -->
				<preserve-jms-headers>true</preserve-jms-headers>
				<!-- If we're producing on this destination, what parameters should be used -->				
				<delivery-mode>NON_PERSISTENT</delivery-mode>
				<message-priority>DEFAULT_PRIORITY</message-priority>
				<acknowledge-mode>AUTO_ACKNOWLEDGE</acknowledge-mode>
				<!-- The following lines are for the JNDI connection -->
				<initial-context-environment>
					<property>
						<name>Context.INITIAL_CONTEXT_FACTORY</name>
						<value>com.tibco.tibjms.naming.TibjmsInitialContextFactory</value>             
					</property>
					<property>
						<name>Context.PROVIDER_URL</name>
						<value>tcp://localhost:7222</value>             
					</property>
					<property>
						<name>Context.SECURITY_PRINCIPAL</name>
						<value>admin</value>
					</property>
					<!-- Uncomment if you have a password
					<property>
						<name>Context.SECURITY_CREDENTIALS</name>
						<value>password</value>
					</property>
					-->
				</initial-context-environment>
			</jms>
		</properties>
		<channels>
			<channel ref="AmfChannel1"/>
		</channels>
		<adapter ref="jms"/>
	</destination>
 
</service>

Now we have our Tomcat instance set up, time to import some class libraries.

Step 13 - Right Click the lib directory under WebContent/WEB-INF/lib select Import

Step 13 - Right Click the lib directory under WebContent/WEB-INF/lib select Import

Step 14 - Select General and then File System

Step 14 - Select General and then File System

Step 15 - Select the TIBCO EMS 5.x library directory and select all of the .jar files (There are more than what is pictured here)

Step 15 - Select the TIBCO EMS 5.x library directory and select all of the .jar files (There are more than what is pictured here)

Step 16 - Open up the server view by selecting Window -> Show View -> Other

Step 16 - Open up the server view by selecting Window -> Show View -> Other

Step 17 - Select the Server category and select Servers

Step 17 - Select the Server category and select Servers

Step 18 - Click the Servers tab that appeared at the bottom, highlight the Tomcat Server and click the Debug icon

Step 18 - Click the Servers tab that appeared at the bottom, highlight the Tomcat Server and click the Debug icon

Step 19 - Start the EMS Server instance

Step 19 - Start the EMS Server instance

Step 20 - Create the topic that was referenced in the messaging-config.xml file

Step 20 - Create the topic that was referenced in the messaging-config.xml file

Now jump back into Eclipse and set up the application. I started with a base form, added a text area and called it a day. Here’s the code to add in the message consumer, channel configuration, and event handlers.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
	applicationComplete="messageConsumer.subscribe()">
	<mx:Script>
		<![CDATA[
			// Import the required namespaces
			import mx.messaging.events.MessageEvent;
			import mx.messaging.events.ChannelEvent;
			import mx.messaging.messages.AsyncMessage;
 
			private function incomingMessageHandler(event:MessageEvent):void
			{
				logArea.text += (event.message.body + "\r");
			}
 
			private function connectEventHandler(event:ChannelEvent):void
			{
				logArea.text += (event.channel.endpoint + " is now connected.\r");
			}
 
			private function disconnectEventHandler(event:ChannelEvent):void
			{
				logArea.text += (event.channel.endpoint + " is now disconnected.\r");
			}
		]]>
	</mx:Script>
	<mx:TextArea id="logArea" editable="false" width="95%" height="95%"/>
	<mx:Consumer id="messageConsumer"
		destination="jmsDest1"
		message="incomingMessageHandler(event)"
		channelConnect="connectEventHandler(event)"
		channelDisconnect="disconnectEventHandler(event)">
		<mx:channelSet>
			<mx:ChannelSet>
				<mx:channels>
					<mx:AMFChannel
						url="http://localhost:8080/blaze1/messagebroker/AmfChannel1"/>
				</mx:channels>
			</mx:ChannelSet>
		</mx:channelSet>		
	</mx:Consumer>
</mx:Application>

That should do it for the code work … now for the fun stuff. :)

Step 21 - Fire up the debugger (use the dropdown next to the button)

Step 21 - Fire up the debugger (use the dropdown next to the button)

Step 22 - Select Debug As, then Debug on Server

Step 22 - Select Debug As, then Debug on Server

Step 23 - Select the installed Tomcat image

Step 23 - Select the installed Tomcat image

Step 24 - The project should appear on the right, press Finish

Step 24 - The project should appear on the right, press Finish

Note : The first debug attempt will fail because Eclipse doesn’t correctly deploy the application. What I haven’t figured out is how to correctly associate the project without using the Debug or Run options. If you know a better way, leave a comment. :)
Step 25 - Hit Debug As again and hit the "Flex Application" choice

Step 25 - Hit Debug As again and hit the "Flex Application" choice

Step 26 - If everything worked, you should now be staring at the application and should have a message that the channel has connected.

Step 26 - If everything worked, you should now be staring at the application and should have a message that the channel has connected.

Step 27 - Now send a text message to the JMS topic using your favorite JMS client and enjoy the result!

Step 27 - Now send a text message to the JMS topic using your favorite JMS client and enjoy the result!

That should do it! Enjoy your new found JMS happiness. As a reference, a Channel is what the Flex application uses to communicate with BlazeDS and can be HTTP or AMF. A Destination is where you send the messages to and from. A lot of the examples i’ve found don’t show you how to declare what channel you’re talking to as it’s supposed to be handled automatically, i’ve found this to be unreliable and once I started specifying the channel everything started working flawlessly so i’m staying with it. Also, you can do multiple channels for redundancy and such, but that’s a lesson for another day. ;)

, , , , , , , , , , , ,

1 Comment

Some Motivation Required – More madness from the guys at shirt.woot

I love shirt.woot.com. I must seeing as I keep giving them my money. Behold … “Some Motivation Required”.

some_motivation_requiredu2sdetail

Exercise - Some motivation required

Click the image to see a larger version or click here to get one for yourself.

, , ,

No Comments

Pirate Exercise

A special thanks to my best friend Mister House for sending me a late night text message telling me to head over to Woot and check out the shirts. I had to have this one to go with my Scurvy and my Penguin shirts. Check this thing out…

Pirate Exercises

Pirate Exercises

If you’d like one of your own, check out the forum post here.

, ,

No Comments

Linksys WRT610N and IPv6

Thanks to the shoddy job that Linksys did with the WRT300N, I grudgingly purchased a new Linksys WRT610N. What a pleasant surprise! Finally another decent product from Linksys. Not that i’ve ever expected much from the bargain networking gear, but the WRT300N was very, very bad. Several of the features didn’t work consistently, new firmware was no where in sight, and the 802.11n was abysmal. The WRT300N made me regret ever upgrading from the WRT54GS, which was one of the best routers on the market and still is in the 802.11g game.

Fortunately the new WRT610N solves most of those problems. The simultaneous 2.4/5ghz radios make life really nice and performance is good. I’m now able to run all of my 802.11n gear on 5ghz while 802.11g stays on 2.4ghz. Each radio can also be restricted accordingly. Very handy. Well done Linksys. The updated features of the firmware are always welcome as well. More granular control over the system for those who need it definitely helps. And then there are those surprise features that we get from time to time.

I’ve recently started running IPv6 on my home network for the enhanced features that are offered. Things that were extensions in v4 are part of the standard in v6 and can make life nice, especially in high throughput situations. Imagine my surprise when I was updating my Ubuntu box and noticed that the WINE mirrors’ IP address was a v6 one! So apparently, the WRT610N does IPv6, it just doesn’t tell you! This is some scary stuff folks, imagine that modern operating systems come with IPv6 enabled and people go and buy this router, not knowing that their doors are now open via a whole new protocol. Granted, most home users will never know, but I seriously wonder if the firewall in the 610N has v6 support.

Let’s hope that Linksys is one step ahead of us here or a lot of users are about to get their horizons broadened when the hackers start coming in via IPv6. :(

For those who are unfamiliar with IPv6 and would like to know more, Ars Technica has a nice primer. Read more here.

, , , , , , ,

10 Comments

Writing a song with Guitar Hero players in mind …

Here’s a bit from XKCD that’s great if you’ve ever played Guitar Hero/Rock Band.

If you’re up for a little geek humor, check out XKCD.

, ,

No Comments