How Do I Know What Ubuntu Version Number I Have?

lsb_release -a

Posted in Linux, Technology | Leave a comment

Console2 and Cygwin with Solarized Color Palette

If you want to use Ethan Schoonover’s Solarized color palette with Console2 and Cygwin, here’s how:

  1. Edit the console settings file at %LOCALAPPDATA%\Console2\console.xml or %APPDATA%\Console\console.xml.
  2. Replace the <colors> ... </colors> section with the following:
    <colors>
       <color id="0" r="7" g="54" b="66"/>         <!-- black -->
       <color id="1" r="38" g="139" b="210"/>      <!-- blue -->
       <color id="2" r="133" g="153" b="0"/>       <!-- green -->
       <color id="3" r="42" g="161" b="152"/>      <!-- cyan -->
       <color id="4" r="220" g="50" b="47"/>       <!-- red -->
       <color id="5" r="211" g="54" b="130"/>      <!-- magenta -->
       <color id="6" r="181" g="137" b="0"/>       <!-- yellow/brown -->
       <color id="7" r="238" g="232" b="213"/>     <!-- white -->
       <color id="8" r="0" g="43" b="54"/>         <!-- brblack --> 
       <color id="9" r="131" g="148" b="150"/>     <!-- brblue -->
       <color id="10" r="88" g="110" b="117"/>     <!-- brgreen -->
       <color id="11" r="147" g="161" b="161"/>    <!-- brcyan -->
       <color id="12" r="203" g="75" b="22"/>      <!-- brred -->
       <color id="13" r="108" g="113" b="196"/>    <!-- brmagenta/violet -->
       <color id="14" r="101" g="123" b="131"/>    <!-- bryellow -->
       <color id="15" r="253" g="246" b="227"/>    <!-- brwhite  -->
    </colors>
    
  3. Restart Console2.

Colors in vim look good:

Editing a CPP file in vim

Cygwin ls colors are a bit odd compared to other platforms:

Cygwin directory listing

Posted in Cygwin, Technology, Windows | 1 Comment

How to Build Microsoft Detours Express (32-bit) on 64-bit Windows

Microsoft Detours Express, which is 32-bit only, can still be built on 64-bit operating systems. Here’s how:

  1. Open a 32-bit Command Prompt (C:\Windows\SysWow64\cmd.exe).
  2. Run VCVARS32.BAT
    • VS2010: "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\vcvars32.bat"
    • VS2008: "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat"
  3. Set the target processor to x86 (set DETOURS_TARGET_PROCESSOR=X86).
  4. Build Detours using nmake.
Posted in Technology, Windows | Leave a comment

What Exactly Are ATL’s BEGIN_COM_MAP, END_COM_MAP, and COM_INTERFACE_ENTRY Macros?

There are many places where ATL’s COM_MAP macros are documented, but I haven’t seen it plainly stated what they actually mean.

Simply put, BEGIN_COM_MAP implements _InternalQueryInterface. COM_INTERFACE_ENTRY indicates that your class supports the specified interface. END_COM_MAP finishes the _InternalQueryInterface implementation.

Note: A QueryInterface implementation which calls this _InternalQueryInterface method must either be hand-coded, or supplied by CComObject, CComAggObject, etc.

For example:

class MyClass :
    public CComObjectRoot,
    public ISomeInterface
{
public:
    BEGIN_COM_MAP(MyClass)
        COM_INTERFACE_ENTRY(ISomeInterface)
    END_COM_MAP()
};

CComClass myInstance = new CComClass;

The COM_INTERFACE_ENTRY line indicates that MyClass implements ISomeInterface. If QueryInterface is called to requests an ISomeInterface pointer, the call will succeed. Without the COM_INTERFACE_ENTRY line, the QueryInterface call would fail.

Posted in C++, COM, Technology, Windows | Leave a comment

Skype 5.5 Cannot Display Asian Characters

After upgrading to Skype 5.5, I found that Japanese and Chinese characters showed as a series of boxes. I could type or paste them and they would be visible on the other end, but not on my end. Similarly, if the other person wrote Asian characters, they would not render correctly, like this:


A temporary fix is to change the IM font to Arial Unicode MS, which may have to be enabled from the control panel. Here are the steps:

  1. In the Skype menu, select Tools | Options, then click on “IM & SMS”, then “IM appearance”:


  2. Click on “Change font” to bring up the font dialog:


  3. If “Arial Unicode MS” is available, select it, click OK, then Save, and you’re done.

    If “Arial Unicode MS” is not available, then click “Show More Fonts” to bring up the Control Panel’s Font selector:


  4. Locate “Arial Unicode MS”, click on it to select it, then click on “Show” in the toolbar. Close the Fonts window (click the red X). You will have to close the Font dialog as well, then reopen it, in order for the Arial Unicode MS font to be displayed.

Posted in Technology | Leave a comment

Things That Suck: Ubuntu Unity

I just upgraded my virtual machine to Unity. All the negatives I’d read rang true. The interface really does seem like a poor copy of OS X, for tablets. Complaints are often dismissed with a curt suggestion to switch distributions. However, there is an inescapable truth:



If the #2 Google suggestion is “your product sucks”, you can take it as strong evidence that you’ve made a poor product development decision.

Personally, I’m rolling my virtual machine back to a prior snapshot.

Posted in Linux, Technology | Leave a comment

Virgin Mobile USA – No Data Connection (3G)

If you’ve been battling Virgin Mobile USA’s technical support drones and have been unable to get 3G data access, check that 3G data is enabled on your phone.

From the main screen:

  • Press the menu button
  • Select Settings
  • Select Wireless & Networks
  • Scroll to the bottom of the menu and select Mobile Networks
  • Make sure “Data Enabled” has a green check mark next to it

Virgin Mobile USA (i.e. Sprint) was unable to solve this after three phone calls over the course of a day. Their technical support script jumps straight into cellular network settings and battery removal.

Posted in Technology | Leave a comment

Activating a Virgin Mobile Phone in a Different Area Code – Vanilla Visa Payment Problems

As an experiment in semi-anonymity, I thought I would see if I could activate my Virgin Mobile Optimus V in a more desirable area code than my own. After a bit of research, I decided to buy a $50 Vanilla Visa prepaid debit card from Walgreens. They claim the card can be used for online purchases, but you’ll need to register the card and provide a zip code for verification. You can enter any zip code you like, and no personal information is required.

I was able to successfully create an account with Virgin Mobile in the desired area code. However, the payment was rejected. One possible reason is that Virgin Mobile may not be able to process a credit card with an expiration date so far in the future. The initial payment form used a text field for expiration year, so I could enter anything I wanted. When I revised my payment method, the web form only allowed selection up to, I believe, 2016. After I changed my payment method to a different, real credit card, the account was activated (though I still had problems with the phone being activated on the network).

So, first off, I’m pretty sure you could get the Virgin Mobile phone number in any area code you want, anyway, because the first step in their registration process asks your zip code. Billing is done at a later point in the process, with its own zip code field. Second, Vanilla Visa cards claim they can be used online, but since they have expiration dates far in the future, the website you want to buy from may not be set up to process them correctly. Basically, the entire process was interesting, but a waste of time.

At some point, it might be fun to try again using a pseudonym. When the online payment fails, one could call and attempt to resolve the payment over the phone. The effort involved would quickly exceed my interest in anonymity, but it might be a fun exercise.

Posted in Technology | Leave a comment

Source Control Use: Git, Mercurial, Bazaar, DARCS, Subversion, Team Foundation Server, CVS

What version control system is really most popular? Not in terms of getting mentioned on blogs, but in real-world terms of jobs?

Source: this HN comment, though I added CVS to the mix.

Posted in Technology | Leave a comment

Getting Started with Android Deployment and Debugging

As usual with Android, getting started on a process usually involves a few hiccups. Here is a complete list of the steps it took for me to get started with deploying apps directly to my Android phone from my Windows development box.

  1. Install the Android SDK.
  2. Add the Android SDK’s Platform Tools directory to your path (so that you can run the adb tool).
    • Click Start
    • Right click on Computer, select Properties from the menu
    • Click Advanced System Settings on the left
    • Click Environmental Variables
    • Double-click on PATH in the User Variables list, append a semicolon and the Android SDK Platform Tools folder (e.g. “;C:\Program Files (x86)\Android\android-sdk\platform-tools”)
  3. Install the ADB driver for your device.
    • If you have a Google device (e.g. Nexus One), install the Google ADB driver.
    • If you have a non-Google device (e.g. LG Optimus V), search for “[your device brand and product name] adb driver”, which should turn up the necessary driver. Using the example of the LG Optimus V (VM670 aka LG LGP500), the LG Mobile Support Tool must be installed (be prepared for a uniquely awful user interface).
  4. On your Android device, go to Settings | Applications | Development. Enable USB debugging. You might as well enable the other two options, as well.
  5. Plug in your Android device.
  6. Create and compile an Android project. Locate the .apk file, which will be in your project’s bin directory.
  7. Open a command prompt and type, adb install pathToYourPackage.apk. If you have an emulator running, you may need to tell adb to only reference the USB device with the -d switch.

    Incidentally, I had some trouble getting my PC to recognize the Android over USB initially. It took a few minutes for me to realize that the power adapter for my USB hub had come unplugged.

Posted in Android, Technology | Leave a comment