Archive for category Software

A look back: Roughly 9 years of email behavior analyzed

In passing I have seen several plugins/apps/sites that offer to retrieve your email history and present some sort of analysis. My wife mentioned this recently and I thought this idea sounded like fun so I did a little processing on my own email. I have email records going back to late 2003 – just about the time I started undergrad. So with some grep/java/gnuplot magic I present to you a graph of the timestamps for every email I have sent since then. I just processed sent emails because my behavior should be more evident than in received.

Analysis

The graph contains a red dataset – my personal emails and a green dataset – emails sent from my university account. The Y axis is time of day and the X axis is the date. Each dot is an email sent at that time on the given day.

Region-by-region

  • The first region that you see is before I started logging school email. It just has personal emails… spanning all times of day/night. Seriously? I sent more email from 0000-0800 then 1600-2400???
  • Second region introduces university emails. During this time I also worked for the university part-time 0900-1800. Nothing too surprising here.
  • Third region is what I call early grad school. A general increase in both of my email volumes.
  • Fourth region – the ASSERT period. The ASSERT project was a massive 2-2.5 year research lab project with a lot of people working on it and a lot of work. Check out the huge increase in school emails. I bet you could spot deadlines in there too.
  • Fifth region – Summer internship
  • Sixth region – Late grad school. Post-quals, post-course work, post-ASSERT, just relaxed set my own schedule time
  • Final region – Real Job. Strict no-email hours, waking up early, less email, yup, that’s real life for ya.

Global observations

  • Maybe I imagine it but I swear you see that the time that I start sending emails in the morning gradually becomes later and later — same for cease time. What/who is to blame? Grad school or my GF/fiance/wife?
  • I sent more school email than personal: 5,164 messages to 4,849 messages
  • You can vaguely spot summer breaks. Look for swaths of lower green density bordered by bursts.
  • Sadly you can’t really spot certain events like: marriage, quals, proposal or defense.

Statistics

Number of emails sent per year:

Year Personal Count School Count
2003 57
2004 145 310
2005 412 310
2006 474 354
2007 728 815
2008 831 1,378
2009 804 1,140
2010 893 438
2011 438 464
2012 – to May 68 59

Cross Compile libmysql

The key to cross-compiling libmysql is to google “cmake cross compile” instead of “libmysql cross compile”.  Took me a bit to think of this but it makes sense because cmake is the build system for libmysql.

My How-To

My how-to assumes you have a Linux system with standard development tools and compilers installed as well as GNU cross-compilers for the target platform.

  1. Download libmysql source: In the drop down box change to source. Otherwise you will be presented with pre-compiled binaries.
  2. Extract libmysql: tar -xzf mysql-connector-c-x.y.z.tar.gz
  3. run: cd mysql-connector-c-x.y.z
  4. Create a toolchain.cmake file (See section below)
  5. run: cmake -G “Unix Makefiles” -DCMAKE_INSTALL_PREFIX=`pwd`/install -DCMAKE_TOOLCHAIN_FILE=toolchain-arm-linux.cmake
  6. run: make
  7. run: make install
  8. Your libs are in `pwd`/install/lib

Toolchain file

The toolchain file sets a few parameters for the cmake system to override the default behavior of searching for the system compilers. I modified a sample from vtk.org CMake wiki. Here is my modified sample that cross-compiles for an ARM processor running Linux.

# this one is important
SET(CMAKE_SYSTEM_NAME Linux)
#this one not so much
SET(CMAKE_SYSTEM_VERSION 1)
# specify the cross compiler
SET(CMAKE_C_COMPILER   /usr/local/bin/arm-linux-gcc)
SET(CMAKE_CXX_COMPILER /usr/local/bin/arm-linux-g++)
# where is the target environment
#SET(CMAKE_FIND_ROOT_PATH  /opt/eldk-2007-01-19/ppc_74xx /home/alex/eldk-ppc74xx-inst)
# search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

Enable OpenGL hardware acceleration for Java 2D

For a couple years now I have been disappointed that one of my 2D Java programs had HORRIBLE performance on my laptop. I noticed the problem got horrible when I upgraded to Vista and didn’t get fixed with my upgrade to Windows 7. The program is a 2D graphing application that draws multiple data streams as scrolling waveforms on the screen in real-time. It is written using Java Swing libraries and the Graphics2D API. On my laptop I was getting less than 1 update per second. On my work computer I was exceeding 200!

Over the last couple years I tried everything to no avail. Finally today I stumbled across this article that describes several unsupported Java system properties that affect the 2D graphics system.

I tried adding the following line to my program and voila! Awesome performance. Problem solved.

System.setProperty("sun.java2d.opengl","True");