Archive for the ‘work’ Category

Worst parts of my new job

February 8th, 2010 by Brian | 6 Comments | Filed in work

Worst parts of my new job:

  1. No more personal bathroom
  2. Coordinating my attire
  3. Not being able to pick through leftovers for lunch
  4. I can’t (easily) hit the gym at say 11am.
  5. No laptop, no cell phone
  6. No one cared if I had bad breath when working from home!

Best parts of my new job:

  1. The people – incredibly smart, and unbelievable willing to take time out of their day to explain how something works or why something was done a certain way. The openness is infectious.
  2. Pair programming with really smart people, like David Black
  3. No email. OK not ZERO email, but with everyone working in the same place, email is rarely used.
  4. No conference calls. Literally none. I had one on my first day which was a “Welcome to Boeing” deal, but zero since.
  5. Ruby & Rails – No more Java, no more WebSphere Portal :)
  6. No laptop, no cell phone. My day is now done when I walk out the door. I can VPN in to check my mail, but see #3

It comes as no surprise to me that the toughest things am dealing with so far are all related to no longer working from home. I’m not completely over the fact that I now get up at 6 & get into the office at 7:30, but I think I am getting used to it. I feel like an old man sometimes going to bed before 10, but I could be doing worse.

Of course the title of this post was written to make you want to read it. I’m really enjoying the new job but need gimmicks to get people to come read my stuff  :)

New year, new job

January 8th, 2010 by Brian | 4 Comments | Filed in work

A few weeks ago, after 10 fun years at IBM I left and took a new job with Skarven Enterprises, a Boeing Company. I call my years at IBM “fun”, because they were – I really did enjoy my time there. Tons of great projects, always playing with new technologies, building applications that targeted all 300,000 IBMers, and most of all, making so many good friends along the way.

At IBM I did a lot of development, in what I now realize was in a non-traditional environment, for better or worse at times. Skaven is hardcore into Agile. It’s actually a fairly thin layer on top of what I was most doing at IBM (other people are worrying more about the semantics of Agile right now), but it adds enough structure & reporting to make me feel like management is aware of what’s going on. It’s kinda cool to be learning about Agile at the same time as a Sprint is already in progress – it’s a great way to pick up on things quickly.

In my new position I’m going to be doing Ruby on Rails development, which means I have to actually learn it! I’m currently going through lotsa of learning: the system, the development environment, Agile, scrum… and the roads to get there! I’m really psyched, and I can’t wait to contribute some real work. That should be coming in the next few weeks after I “pass the Qualifications Board”.

I’m going to start trying to blog more as I figure out exactly what I’m doing  :)

Tags: , ,

Game console idea

August 30th, 2009 by Brian | 1 Comment | Filed in work

I love being able to install games to by Xbox 360. It makes playing much quieter & stuff seems to load faster. Unfortunately, like PC games I’ve played in the past, playing a game from the hard drive requires the disc to be in the player. Makes sense, as it proves that I didn’t copy it from my buddy & pass it around.

Here’s the thing…. it sucks!

I’m no more lazy than the next person, but come on! I mean, I can turn the console on & off with the wireless remote. I change the turner on my TV with my remote & I’m off & playing .. as long as the game is in the console.

So here’s what we do:  I usually keep my games close by my console anyway (for easy access – cuz they need to be in to play) so why not install some kind of RFID or wireless thing-a-ma-bob that is part of the game case. The console can just check if it’s in range – and preseto – I don’t have to get off my lazy butt to play!

Tags: , ,

Proper timeout handling with Apache HttpClient

August 24th, 2009 by Brian | 5 Comments | Filed in work

I’ve seen some really bad things happen when developers don’t code in proper timeout handling. Occasionally I’ve been asked what the best way to handle timeouts is – so I thought I’d share my take on it:

MultiThreadedHttpConnectionManager connectionManager =  new MultiThreadedHttpConnectionManager();
HttpConnectionManagerParams params = connectionManager.getParams();

params.setConnectionTimeout(connectiontimeout); //set connection timeout (how long it takes to connect to remote host)
params.setSoTimeout(sotimeout); //set socket timeout (how long it takes to retrieve data from remote host)

HttpMethodBase baseMethod = null;

try {
  HttpClient httpClient = new HttpClient(connectionManager);
  httpClient.getParams().setParameter("http.connection-manager.timeout", poolTimeout); //set timeout on how long we’ll wait for a connection from the pool

  baseMethod = new GetMethod();
  int statusCode = httpClient.executeMethod();

  …
}
catch (ConnectTimeoutException cte ){
  //Took too long to connect to remote host
}
catch (SocketTimeoutException ste){
  //Remote host didn’t respond in time
}
catch (Exception se){
  //Some other error occurred
}
finally {
  if (baseMethod != null)
    baseMethod.releaseConnection();
}

Tags: , , ,

Subversion keeps changing permissions of my files [FIX]

August 4th, 2009 by Brian | No Comments | Filed in work

On my Unix machine whenever I did an “svn update” and files were actually updated, the permissions would change, rendering them inaccessible to the httpd process, therefore 403 Forbidden errors in the browser.

After much searching that yielded a lot of results about storing executable flags in SVN using propset. This didn’t help as I didn’t want it to be executable, just world readable. Turns out the problem was in my .profile, my umask setting was 077. Changing it to 012 solved it for me. Note: 012 makes files you create group writable.

Snippet from my .profile

#umask 077
umask 012
export SVN_SSH="ssh -l olore"
export EDITOR="/usr/bin/vi"

Read more about umask on Wikipedia

Tags: , , ,

Dojo 1.1 and 1.3 on the same page

June 16th, 2009 by Brian | 3 Comments | Filed in work

Today I dug into the deep dark world of running multiple versions of Dojo on the same page. Turns out, it’s not all that dark! Working with some pages as my guide I was able to get 1.1 & 1.3 working in the same page.

This is a step towards running multiple versions withing WebSphere Portal, which I’ll likely be dealing with in the near future.

<html>
<head>
<title>Dojo 1.1 and Dojo 1.3 together on the same page </title>

<!– Bring in Dojo 1.1.x –>
<script type="text/javascript">
  djConfig = {
    parseOnLoad: true,
    baseUrl: "dojo11/dojo/"
  }
</script>
<script type="text/javascript" src="dojo11/dojo/dojo.js"></script>

<!–
redefine djConfig (allowed in 1.1+)
create namespaced dojo, dijit &amp; dojox
–>
<script type="text/javascript">
  djConfig = {
    isDebug: true,
    baseRelativePath: "dojo13/dojo",
    scopeMap: [
      ["dojo", "dojo13"],
      ["dijit", "dijit13"],
      ["dojox", "dojox13"]
   ]
}
</script>
<script type="text/javascript" src="dojo13/dojo/dojo.js"></script>

<!– test it –>
<script type="text/javascript">
  dojo.addOnLoad(function(){
    alert(dojo.version);
  });
  dojo13.addOnLoad(function(){
    alert(dojo13.version);
 });
</script>
</head>

<body>
Dojo 1.1 and Dojo 1.3 together on the same page
</body>

</html>

Tags:

Websphere Portal theme navigation context menus

May 1st, 2009 by Brian | 2 Comments | Filed in work

I spend a lot of my day working with WebSphere Portal server, and as of late, spending more time (than I’d like!) with themes & skins. I am currently working with Portal v6.1, but the information below should be useful for previous versions as well.WebSphere software

Our portal is pretty open, we want people to come in & customize it as much as they’d like. One feature that we allow is for the user to come in & create new pages. We are running our own theme policy which is a copy of the DoubleTopNav policy. Our theme displays these 2 levels of navigation at the top, and we have no side navigation.

The hurdle I ran into was – how do I prevent the “New Page” option from appearing in the portlet menu for pages in the second level of navigation? The way the out-of-the-box Portal theme works is that when you create a new page, it is created as a child of the page that you are on. This works fine for top level pages, but there no policy or rule that can be set to prevent the “New Page” option from appearing in the portlet menu for second level pages.

The solution, proposed by a member of the Portal team was to create an alternate pageContextMenu.jsp which simply didn’t have a “New Page” option. Since the call the that JSP is done via AJAX, prior to the call we can determine what navigation level we are on and call the appropriate version of pageContextMenu.jsp.

Piece of cake, right? Eh .. maybe not cake, but not all that difficult. After creating the new pageContextMenu2.jsp & removing the “New Page” option, the next place to go is head_inlineJS.jspf. Below is the code I have added/modified to the head_inlineJS.jspf.

<%– START – see if we are in 2nd level of navigation –%>
<%
String pageContextMenuJSP = "pageContextMenu";
%>
<portal-navigation:navigation startLevel="2" stopLevel="3">
  <portal-navigation:navigationLoop>
    <portal-logic:if nodeInSelectionPath="yes">
    <%
      //it’s in selection path &amp; it’s selected (this is the page we are on!
      if (wpsSelectionModel.isNodeSelected(wpsNavNode)){
        int level = wpsNavLevel.intValue();
        if (level == 2) {
          pageContextMenuJSP = "pageContextMenu2";
        }
      }
    %>
    </portal-logic:if>
  </portal-navigation:navigationLoop>
</portal-navigation:navigation>
<%– END – see if we are in 2nd level of navigation –%>

<%– Context Menu Initialization –%>
<c-rt:set var="pageNoActionsText" ><portal-fmt:text bundle=‘nls.engine’ key=‘info.emptymenu’ /></c-rt:set>
(function(){

var pageMenuURL = ‘<portal-navigation:url themeTemplate="<%=pageContextMenuJSP%>" />’;
<%– OLD var pageMenuURL = ‘<portal-navigation:url themeTemplate="pageContextMenu" />’; –%>

Now that you’ve got that taken care of, touch head.jspf && touch Default.jsp, reload your page and you should no longer see “New Page” as an option in the page drop down for pages in the 2nd level of your navigation.

That worked and was a thing of beauty .. well, almost. I wasn’t a big fan of looping through the entire navigation model, but I didn’t know any other way. I ran the code past my colleague from the Portal team and he pointed me at the navigationSelectionModel. The code below is smaller & faster. Best of all – it works :)

<%– 2009.05.04 OLORE – see if we are in 2nd level of navigation –%>
<%
String pageContextMenuJSP = "pageContextMenu";

int level_count = 0;
for (java.util.Iterator i = nsm.iterator(); i.hasNext(); ) {
  NavigationNode node = (NavigationNode) i.next();
    level_count++;
}
if (level_count >= 4) { // level 4 == our 2nd level of top navigation (shouldn’t ever be >)
  pageContextMenuJSP = "pageContextMenu2";
}

%>
<%– 2009.05.04 OLORE – see if we are in 2nd level of navigation –%>

<%– Context Menu Initialization –%>
<c-rt:set var="pageNoActionsText" ><portal-fmt:text bundle=‘nls.engine’ key=‘info.emptymenu’ /></c-rt:set>
(function(){

  <%– 2009.05.01 OLORE – use pageContextMenu2 if we are in 2nd level nav –%>
  var pageMenuURL = ‘<portal-navigation:url themeTemplate="<%=pageContextMenuJSP%>" />’;
  <%– 2009.05.01 OLORE – use pageContextMenu2 if we are in 2nd level nav –%>

Tags: , , ,

Needed: Better HTTP debugging on Linux

March 3rd, 2009 by Brian | 4 Comments | Filed in work

I’ve been running Linux as my only OS for the last year and a half. I’ve recently switched over to Ubuntu 8.10 (from RHEL5) and am enjoying it since January.  The biggest difference between the two thus far has been the more-up-to-date versions of things and the ease of finding & installing codecs and proproetary drivers (NVIDIA).

There is one thing that’s missing from my old Windows days – Fiddler. Fiddler is a (Windows only) HTTP Debugging Proxy which logs all HTTP traffic between your computer and the Internet. Invaluable for debugging cookies, headers and other HTTP specifics. The killer feature for me is the UI which lays out, line by line, each of the HTTP requests which you can glance at for quick infomation, or click on to get a detailed view of just about everything you could imagine. A geek’s dream :)

I’m dying for something like this on Linux. I’ve tried Live HTTP Headers, Firebug, Wireshark and a combo of all three. Each of these captures all the data I need (and in some cases much more), but each falls short in one way or another:

Live HTTP Headers
The Good: Firefox plugin, keeps running list of requests, good filtering (especially if you dream in regex like myself!)
The Bad: The user interface – BLAH! It’s just one big long list of requests. Sure you can copy & paste, but rich data like this needs better treatment

Firebug
The Good: Firebug isn’t as good as everyone says it is .. it’s better. If you are doing web development and not using this tool you aren’t a true web developer. You’ve been notified. The Net panel is fantastic, especially the colors and bars they’ve added in recent versions.
The Bad: The Net panel is almost what I need, but here are the problems:  the panel reloads on every page load, blowing away any previous data (argh!), it’s next to impossible to be looking at the details of one request and quickly jump to another request because the UI is so cluttered – a dedicated details pane would help considerably here.

Wireshark
The Good: Fantastic network analyzation of all types, not just HTTP. If you want to sniff traffic and watch your family’s network traffic on your home … wait .. who would ever do that ;)
The Bad: Slightly more difficult to install and use. Not being HTTP specific, it rather generically handles and displays the details of HTTP requests.

I hate to sound like a Fiddler fanboy, but I think that their user interface layout really makes examination of the requests simple and painless. For all it’s greatness, I think Firebug falls short here, but I also think it’s got the best chance to be modified to suit my needs.

… and I just might take a stab at it…

Tags: , , , , , , , ,

Firefox – View Source

February 3rd, 2009 by Brian | 1 Comment | Filed in work

Everyone knows about “View – Page Source” in Firefox & it’s counterparts in other browsers , but have you ever hit a web page that returns JSON or XML or some other text and have Firefox prompt you to choose an application to open it ? So annoying! Why can’t Firefox just display it?!??!

I stumbled across a great workaround while clicking around the Project Zero forums: view-source:

It’s used like this:

view-source:http://www.projectzero.org/

That’s it … just prepend view-source: to any URL and it will display the source… so handy for those pesky JSON URLs!

Credit to dieselchrist for his post on the Project Zero forum
Note: brandon suggesting using the Firefox Poster plugin … definitely worth a look as well.

Tags: , , ,

Aptana on Ubuntu 8.10

February 2nd, 2009 by Brian | No Comments | Filed in work

I was having a problem getting Aptana to run on my fresh install of Ubuntu 8.10

I lost the original error message, but it was something like

[ERROR] Invalid key
java.security.InvalidKeyException: Invalid AES key length: 26 bytes


Even though I’m running 32-bit, the solution to include an older version of xulrunner and reference it in a startup script worked like a charm.

In case this page ever dies, the trick is to install xulrunner-1.8.1.3 and use a script similar to this to start Aptana

#!/bin/sh
MOZILLA_FIVE_HOME=/usr/lib/xulrunner-1.8.1.3
if [ $LD_LIBRARY_PATH ]; then
LD_LIBRARY_PATH=$MOZILLA_FIVE_HOME:$LD_LIBRARY_PATH
else
LD_LIBRARY_PATH=$MOZILLA_FIVE_HOME
fi
export MOZILLA_FIVE_HOME LD_LIBRARY_PATH
~/aptana/AptanaStudio -vm /usr/lib/jvm/ia32-java-6-sun/jre/bin/java

For reference, I am running IBM Java 1.6

#!/bin/sh
MOZILLA_FIVE_HOME=/usr/lib/xulrunner-1.8.1.3
if [ $LD_LIBRARY_PATH ]; then
LD_LIBRARY_PATH=$MOZILLA_FIVE_HOME:$LD_LIBRARY_PATH
else
LD_LIBRARY_PATH=$MOZILLA_FIVE_HOME
fi
export MOZILLA_FIVE_HOME LD_LIBRARY_PATH
~/aptana/AptanaStudio -vm /usr/lib/jvm/ia32-java-6-sun/jre/bin/java

Tags: , , , ,

My Lotusphere session

November 20th, 2008 by Brian | No Comments | Filed in work

Come check me out at Lotusphere 2009.

Session Title: Innovation with Integration: IBM’s “Next Generation” Intranet Portal
Session Track: ID503
Track Three: Planning and Managing Your Collaboration Infrastructure

Continuous innovation of IBM’s enterprise portal, in a rapid, non-disruptive, evolutionary manner is a major goal of the “ODW Next” project. The On Demand Workplace (ODW) is IBM’s single point of entry for employee intranet access (w3.ibm.com). It serves as the “front door” to IBM’s internal transformation activities, providing a personalized work environment for more than 350,000 employees, in over 100 countries. The approach of ODW Next is to couple a live innovation platform – a “perpetual beta” – alongside the production environment, to obtain the maximum benefits of live usage and continuous feedback from a statistically significant number of global employees, while minimizing risk to the steady state production systems.

Tags: , , , ,