Follow the $: Verizon iPhone != LTE

Posted July 19th, 2010 in Commentary by jayshao

The perennial Verizon iphone rumors keep ticking by, with speculation about contract dates, terms, projections, and the usual interview of some guy in line at the apple store who says “I’d switch today”.

A recent thread seems to be in a lot of these stories: “Verizon iPhone will use LTE (4G)”. While I have just as little actual information as most of these analysts, I think it’s unlikely based on Apple’s core competencies and past behavior, and market/situational facts.

Continue Reading »

Perf4j+Maven+AspectJ CTW

Posted June 29th, 2010 in Commentary by jayshao

Recently I’ve incorporated Perf4j for runtime performance statistics on a number of projects, combined with our in-house counters and other standard libs (actually I quite like the annotation-style logging of perf-stats, and the tag-name rollup conventions, and will probably retrofit both into our existing collection tools). I had a bit of difficulay initially getting AspectJ to do CTW for the collection (and in retrospect, very much want to investivate the agent-based LTW approach, since it’d give us the ability to flip on/off recording, while it should be basically just as fast except on object creation – which for Spring/Singleton instantiated services (most of our performance code) is not significant.

Anyhow, the meat, plugin config below:

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
<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>aspectj-maven-plugin</artifactId>
    <version>1.3</version>
    <configuration>
        <showWeaveInfo>true</showWeaveInfo>
        <source>1.6</source>
        <weaveDependencies>
            <dependency>
                <groupId>org.perf4j</groupId>
                <artifactId>perf4j</artifactId>
            </dependency>
        </weaveDependencies>
    </configuration>
    <executions>
        <execution>
            <goals>
                <goal>compile</goal>
                <!-- use this goal to weave all your main classes -->
                <goal>test-compile</goal>
                <!-- use this goal to weave all your test classes -->
            </goals>
        </execution>
    </executions>
</plugin>

Also dependencies (we use Log4j, though we’re looking at Logback as well):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<dependency>
    <groupId>org.aspectj</groupId>
    <artifactId>aspectjrt</artifactId>
    <version>1.6.7</version>
</dependency>
<dependency>
    <groupId>org.perf4j</groupId>
    <artifactId>perf4j</artifactId>
    <version>0.9.13</version>
    <classifier>log4jonly</classifier>
</dependency>
<dependency>
    <groupId>commons-jexl</groupId>
    <artifactId>commons-jexl</artifactId>
    <version>1.1</version>
</dependency>

Performance note: We did some unit testing of methods which were instrumented/non-instrumented (our unit test basically spewed out a couple thousand garbage string+ints in a loop, which was instrumented or not)

We saw something like 3x the number of minor GCs (though GC was still fast) – no additional major GCs after adding Perf4j. Overall execution time was higher as well, though not by the same degree.

Facebook -> Chainletter NG

Posted June 29th, 2010 in Commentary by jayshao

Looking through my friends streams – I saw a big blurb for:

http://www.subwayfootlongspromo.com/ (notice the comment box isn’t real…)

Which convinces me – Facebook Like Pages are the new Chainletter. And, even better than Chainletter (costs a lot) or Chainletter 2.0 (fills up email boxes), Chainletter NG allows you to check the progression of your meme in real-time, using all the tooling provided by Facebook. As the Facebook comment and like boxes become even more recognizeable, I’d expect this situation will action only increase.

This does seem to help make the case for verifiable identity for widgets – e.g. how do I socially, recognizably mark my widget as genuine for users when they can’t just check the URL bar to see what site they’re on? Unfortunately, it’s hard to come up with some pattern that’s not going to involve browser support, though what the banks have been doing with personalized site access images, and the social networks w/gravatar/avatar style repetition might be helpful (e.g. train users to only submit if they see their picture, and if you don’t know what you look like ask the guy next to you…

Neat Intellij Tricks

Posted June 28th, 2010 in Commentary by jayshao
This entry is part 4 of 4 in the series Eclipse2Intellij

So, after a few months of working almost exclusively in Intellij, I have to say I think it is a better IDE, and I miss it when I go back to Eclipse. There’s significant talk about us adopting it, though the usual questions about retraining, etc. rear their ugly head. Neat tidbits that have come up:

  • Automatic, pre-commit static code-analysis – including your own bug definitions: http://jetbrains.dzone.com/articles/find-your-very-own-bugs
  • Great SVN change-list support for keeping multiple flows of changes sorted out – even shows up properly in svn status
  • One-click threadlocal refactor: http://blogs.jetbrains.com/idea/2009/10/threadlocal-in-one-click/
  • Settings sync online w/IDEA Server Plugin
  • Glassfish integration works, deploy & really nice console mapping (e.g. tail arbitrary log files) – have to leave username/password blank
  • Maven support: true main vs. test scope isolation, hierarchical module support
  • Language Injection: specify that certain methods take SQL, Groovy, REGEX, CSS, JS, and get working sytax completion, etc.

OutOfMemory PermGen Errors

Posted June 23rd, 2010 in Commentary by jayshao

In the past I’ve gone to the good old reliable “-XX:MaxPermSize=256m” (or 384m, 512m, etc.) to try to get redeploys in webapp containers like Tomcat and Glassfish to allow numerous hot-redeploys. I figured I’d invest a little time in sorting this out to see if there’s a better solution – unfortunately it doesn’t look like it.

http://www.jroller.com/agileanswers/entry/preventing_java_s_java_lang

had some useful sounding suggestions:

  • Move to JRockit – which is free for deployment (minus the nice management console) and does look very impressive, and seems to use a different memory scheme that doesn’t rely on PermGen, but could conceivably still suffer from class/memory leaks
  • Try these flags: -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled – this seems not to work, at least when tested against JDK 6, Glassfish 3, with a Spring-based application with a moderate amount of open-soruce tooling (Spring, Log4j, Drools, the like) – with PermGen set to 256m I still get out of Memory, and jvisualvm shows PermGen slowly filling up: permgen filling up

In the end, I have to agree with: http://my.opera.com/karmazilla/blog/2007/03/13/good-riddance-permgen-outofmemoryerror – it looks like we’re stuck with this, at least I haven’t found a sane solution beyond restarting between deploys. At least embedded servers like jetty or embedded glassfish startup quicker…

Juniper VPN Mac Setup

Posted April 23rd, 2010 in Commentary by jayshao

It took me almost an hour of troubleshooting before I found this KB entry describing how to fix the applet install for Juniper VPN on Mac OSX.

http://kb.juniper.net/index?page=content&id=KB16134&actp=LIST

Bad iPhone/Droid Sales Comparison

Posted March 17th, 2010 in Commentary by jayshao

A number of news sources seem to be publishing comparisons between initial sales numbers for the Apple iPhone, Motorola Droid, and Google Nexus One.

Some quick comparisons are being made trying to compare the DROID & iPhone numbers head on, but I’m surprised not to see any sidebars noting that the original iPhone launched at 499/599 – whereas the DROID has been fully subsidized from the get go.

Spring wiring private init-method

Posted March 16th, 2010 in ContextWeb, Work by jayshao
This entry is part 1 of 1 in the series Springframework Tricks

While adding some unit tests to older Spring code, I noticed that the production Spring configuration was wiring together some pretty simple Factory objects that had private init() methods (took a few minutes to figure out why I kept getting wavy lines), that looked like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
private void init(){
try {
StringBuilder sb = new StringBuilder();
for(String server : servers){
sb.append(server.trim());
sb.append(BLANK_SPACE_DELIMITER);
}

memCacheClient = new MemcachedClient(AddrUtil.getAddresses(sb.toString()));
} catch (IOException e) {
log.error("Unable to Connect to memCache " ,e);
throw new RuntimeException("Unable to Connect to memCache " , e);
}
}

It turns out that AbstractAutowireCapableBeanFactory does a bit of reflection when processing ‘init-method’ to allow it to invoke private methods (assuming you don’t have any SecurityMangers running, which you probably don’t)

1
2
3
4
ReflectionUtils.makeAccessible(initMethod);
try {
initMethod.invoke(bean, (Object[]) null);
}

So… magic…

IntelliJ and JRebel

Posted March 10th, 2010 in ContextWeb, Work by jayshao
This entry is part 3 of 4 in the series Eclipse2Intellij

So, after enduring some abuse from colleagues who miss VisualStudio (I have to admit – that feature to move the program counter does look really cool) I spent a bit of time the other day setting up with a trail-run of JRebel. So far the experience has been pretty fantastic – I can use maven to jetty:run a project, hit ctrl+F9 to recompile, and F5 in the browser and see changes reflected – even with changed method sigs and the other goodies. It’s nice for test run, though I do admit, it makes it harder for me to force myself to write unit tests (not necessarily good)

I started with a couple internet tutorials:

One oddity I had to workaround w/hard coded paths – in Ubuntu I setup /etc/environment with refs to the JREBEL_HOME and to add it to MAVEN_OPTS, but when I run from IntelliJ it doesn’t seem to do the variable substitution, I get errors about not being able to run $JREBEL_HOME as a class – for the time being have just hard-coded paths and moved on, and it’s been great.

[Fixed] IntelliJ Ubuntu Launcher Problem

Posted March 4th, 2010 in ContextWeb, Work by jayshao
This entry is part 2 of 4 in the series Eclipse2Intellij

http://ubuntuforums.org/showthread.php?t=224100I had a bunch of trouble getting a GNOME launcher to successfully execute (interestingly enough, the Eclipse/STS launchers mostly worked fine) – turned out it was related to JDK_HOME not being recognized by GNOME. I’d gotten accustomed to setting up my environment variables in ~/.bashrc and sourcing that into .profile – apparently GNOME looks in /etc/environment.

Will write up some more thoughts based on a few days usage in a bit. All better for now. Links: