Installing Adobe Air and TweetDeck on 64-Bit Ubuntu

1

I recently managed to break my Adobe Air install on Ubuntu when trying to fix TweetDeck (for the record, if you ever have any problems with TweetDeck, try and nuke the TweetDeck* directory inside ~/.appdata). It had been running fine all along, but when I needed to re-install it there didn’t seem to be a way to re-install it because there’s no official 64-bit support for it. Adobe has a long article on installing it but it didn’t work for me and was convoluted, so I decided to try myself. As it had run before, I assumed I had 32-bit compat libraries, so just decided to force install it by downloading the Adobe Air 2.2 .deb package from here and installing it using

dpkg -i --force-architecture AdobeAir.deb

This worked fine, and I was now able to install TweetDeck through its website. However, after I did this I was getting reports about broken dependencies saying TweetDeck depends on the unavailable adobeair package. After double checking it was indeed installed, I concluded it must be some sort of architecture mismatch. After trying a few different things, I decided I don’t need package management for Air apps and removed the TweetDeck info from the /var/lib/dpkg/status file and all was well again.

Disclaimer: Editing the dpkg status file by hand is a bit of a last resort and can break your system, make a backup of it and don’t touch it if you don’t know what you’re doing. I wont be held responsible for anyone damaging/breaking their system or losing productive time by trying the steps outlined here.

Real Time Remote Log File Viewing for Windows Mobile

0

For a few years now I’ve been trying to find a remote log viewer so that I can see log files as they update while I’m debugging .NET Compact Framework applications from my PC. Visual Studio comes with a number of remote apps, but none of these are capable of updating in real time, and I didn’t have the time or energy to write one myself. Then one day while browsing through Log4net documentation when I came across the TelnetAppender.

Stick this in your log4net config file:

<appender name="tnet" type="log4net.Appender.TelnetAppender">
  <port value="23" />
  <layout type="log4net.Layout.PatternLayout">
    <conversionPattern value="%-5p [%t]: %m%n" />
  </layout>
</appender>

then add the appender to your <root> element, and you can telnet into your handheld device and monitor the log file as it comes in in realtime!

Simple CSV Merge Script

0

Merges CSV files using only the header of the first file.

Usage:

./mergecsv.pl filename filename > outfile

Code:

#!/usr/bin/perl -w

my $headers = '';
while (<>) {
  if($headers eq ''){
      $headers = $_;
      print $_;
  }
  if($headers ne $_){
    print $_;
  }
}

Optimising Compact Framework Applications

1

My C# application has recently started exhibiting random crashes immediately after loading large amounts of data and opening up a new Windows form, so I decided to for the first time dive into some memory optimisations in Compact Framework. As of version 3.5, the compact framework supports the CLR Profiler which was previously only available for the full framework.

Unfortunately, due to device restrictions, I’m stuck with CF 2 SP1, which complicates things a bit. After some googling, I found this helpful blog post about using the Remote Performance Monitor to check out memory usage. After following the instructions and setting up the monitor, I noticed that I had a consistent memory usage after loading the data of about 24MB. Using RPM’s heap viewer, I was able to determine which objects had the most instances and which used the most memory.

Reducing Memory Usage

I managed to reduce my application’s memory footprint by over 20% just by making a few small changes:

  • Obvious as this may seem, only load data that you need. My application gets data from an xml file, and I  was storing everything I could get, including historical data. I only ever used the four most recent pieces of historical data, but was storing the rest. Removing what I didn’t need saved me nearly 4MB in memory usage.
  • Don’t duplicate data! If each instance of a class has a reference to another object, see if you can’t share these objects, rather than instantiate one for each. Using a Dictionary object, I stored identical objects and re-used them, cutting the amount of instances of the class from over 8,000 to 5. That’s a big saving for a simple change.
Go to Top