Thursday, June 14, 2012

android vs iphone/ios

I just read an incredibly well-written article from the point of view of a 4-year iphone user switching to android. if you're looking for an iphone (or android) bashing, move along. this is actually a balanced article that points out the pros and cons for both. very well done:

29 Days with Android

Tuesday, June 5, 2012

Eclipse Subversive plugin out of Java heap space

Solution:

Use the JavaHL SVN Connector instead of SVN Kit. to install the JavaHL Connector:
  1. In eclipse go to Help --> Install New Software...

  2. Work with: --> choose the community.polarion.com update site

  3. Expand Subversive SVN Connectors

  4. Choose the JavaHL version corresponding with your version of subversion

  5. Click Next, and then follow the instructions to complete installation

  6. Window --> Preferences --> expand Team --> select SVN --> select the SVN Connector tab --> change the SVN Connector to JavaHL --> OK
There are additional steps for completing the JavaHL installation. Subversive doesn't seem to have any helpful documentation regarding this, but Subclipse does:
http://subclipse.tigris.org/wiki/JavaHL

In Linux (elementary, Ubuntu, Debian), you can do this to finish the installation:
  1. Install libsvn-java:
    sudo apt-get install libsvn-java

  2. Then edit eclipse.ini (located in /etc/ if you installed eclipse from a package or in the eclipse folder you extracted if you downloaded it from the eclipse website), and add the following line after the -vmargs line:
    -Djava.library.path=/usr/lib/jni

    For Ubuntu 12.04 64-bit, the line should be:
    -Djava.library.path=/usr/lib/x86_64-linux-gnu/jni/

  3. Restart Eclipse

Details:

So I recently switched to Subversive from Subclipse as my SVN plugin in Eclipse. I was checking out one of my repositories (a pretty big one), and I got this error:

Checkout operation for 'https://svn.example.com/myproject' failed.
Java heap space


I have 1 GB of java heap space given to Eclipse (-Xmx1024m in /etc/eclipse.ini), and I don't think I've run out yet, but I went ahead and upped it to 1.5 GB. I got the same error. 2 GB--same error. I tried again with 2 GB of heap space, closing all perspectives to save memory, and it finally worked.

I new something wasn't right, but at first I couldn't find anything in Google. I kept searching, and finally found this:
http://www.eclipse.org/forums/index.php?t=msg&goto=559537&S=9c09f002ceb108176748012e60540921

Essentially the problem is a bug with the SVNKit SVN connector. There are two connectors available:
  • SVNKit
    • Pros: easier to install
    • Cons: possibly buggier, because it's a Java reimplementation of Subversion
  • JavaHL
    • Pros: more stable, because it's a wrapper around the native subversion C code
    • Cons: a little more work to set up
The solution, as mentioned above, is to use the JavaHL connector, because this problem is caused by a bug in the SVNKit connector.

Friday, May 25, 2012

wine crashing on ubuntu 10.10

solution:



downgrade wine, like so:

  1. uninstall the current version of wine
    sudo apt-get remove wine1.3 wine1.3-gecko ttf-symbol-replacement-wine1.3

  2. install the older stable version of wine
    sudo apt-get install wine1.2




backstory:



I was recently trying to install steam on ubuntu 10.10 using the latest wine (1.4 something I believe). it kept crashing X windows right as it tried to launch steam.exe, or when I tried to launch it manually. here's the end of the terminal output:

err:wgl:is_extension_supported No OpenGL extensions found, check if your OpenGL setup is correct!
fixme:iphlpapi:NotifyAddrChange (Handle 0x453d95c, overlapped 0x4353d20): stub
fixme:winsock:WSALookupServiceBeginW (0x453da5c 0x00000ff0 0x453daa4) Stub!
[0525/102859:ERROR:network_change_notifier_win.cc(111)] WSALookupServiceBegin failed with: 8
fixme:toolhelp:CreateToolhelp32Snapshot Unimplemented: heap list snapshot
fixme:toolhelp:Heap32ListFirst : stub
ALSA lib pcm_pulse.c:1008:(_snd_pcm_pulse_open) Unknown field handle_underrun
err:winediag:AUDDRV_GetAudioEndpoint PulseAudio "default" -22 without handle_underrun. Audio may hang. Please upgrade to alsa_plugins >= 1.0.24
../../src/xcb_io.c:385: _XAllocID: Assertion `ret != inval_id' failed.
XIO: fatal IO error 11 (Resource temporarily unavailable) on X server ":0.0"
after 150 requests (144 known processed) with 0 events remaining.

I'm not sure which part of that caused the crash. I googled the third-to-last line, and came across this still unfixed bug that's been in ubuntu for the last four versions (please try to convince me the ubuntu developers care about stability):
https://bugs.launchpad.net/ubuntu/+source/libx11/+bug/507062

after I downgraded wine (see solution above), steam installed just fine:
winetricks steam

if, for some reason, you removed the wine PPA or need to install winetricks manually, this should do the trick:

cd /usr/local/bin
sudo wget http://winetricks.org/winetricks
sudo chmod +x winetricks
cd ~

Thursday, May 17, 2012

Playing Half Life 2 on an old/slow computer

I wanted to play Half Life 2 on an old laptop with Intel GMA 900 graphics (910GML/915GM chipset), but with the default settings the game would often become unbearably slow. So after doing some googling and lots of testing, I found some settings that seem to work.

  1. First, create a text file named autoexec.cfg and place it in the hl2/cfg folder. Give it the following contents:

    // see http://www.tweakguides.com/HL2_8.html for more information
    // also see https://developer.valvesoftware.com/wiki/List_of_HL2_Cvars

    // ***** major stuff *****
    mat_compressedtextures 1
    mat_forcemanagedtextureintohardware 0
    mat_softwarelighting 0
    // in pixels
    //r_decal_cullsize
    // specific number
    //r_decals
    // level of detail at a distance: -8 to 8
    //r_lod

    // ***** minor stuff *****
    cl_ejectbrass 0
    cl_show_splashes 0
    dsp_slow_cpu 1
    mat_bumpmap 0
    mat_dxlevel 70
    muzzleflash_light 0
    r_drawflecks 0
    r_waterforceexpensive 0
    sv_robust_explosions 0
    violence_ablood 0
    violence_agibs 0
    violence_hblood 0
    violence_hgibs 0

    // these are newer source 2007-based variables and may be unrecognized by older
    // versions of half life 2
    ai_expression_optimization 1
    mem_max_heapsize 768

  2. In your shortcut that you use to launch Half Life 2, add the following parameters:
    -novid -window -dxlevel 60 -heapsize 786432 -console

    The end result will look something like this:
    "C:\Program Files\Games\Half-Life 2\hl2.exe" -novid -window -dxlevel 60 -heapsize 786432 -console

  3. (Optional) Create valve.rc in the hl2/cfg folder, or edit the one that already exists, and make sure the startupmenu line is commented out by ensuring there are two slashes (//) in front of it.

  4. Lastly, read this article to get more information on what these tweaks mean and how to customize them for your system:
    http://www.tweakguides.com/HL2_1.html
If you're playing on a machine with integrated Intel graphics, GMABooster may help some as well.

Monday, April 30, 2012

my next OS: elementary



as ubuntu 12.04 brings yet another buggy release (see the comments here), I'm all the more excited about elementary's upcoming Luna release.

elementary, for those of you who don't already know, is everything linux (and any operating system) should be. it's crisp, clean, and most importantly, consistent! the team at elementary have created a desktop environment and suite of applications that adhere to a common set of interface guidelines. it's evident they care more about a great UX and UI than cramming more bells and whistles into an already inconsistent and unstable UI (ubuntu's unity).

for those of you suffering through another buggy ubuntu release with the lackluster unity desktop environment, I highly recommend elementary.

less is more.

Friday, April 27, 2012

Powerbook G4 not enough disk space

Solution:

Set the date and time.

Details:

So I had an old Powerbook G4 lying around that someone had given me. I hadn't used it in a while, and I turned it on, plugged a USB drive in, and tried to copy some files. I got an error message saying there wasn't enough disk space. Strange, as there was plenty of space, on the hard drive and the USB drive. I ctrl-clicked on the hard drive, clicked get info, and the space wasn't even reporting. Even more strange.

Well... turns out it was the fault of my own laziness. When I first booted the laptop, it said that the date had been reset, probably because the CMOS battery was dead. The error said that I'd probably have problems until I fixed the date, but hey, I just wanted to copy some files off, nothing serious.

Well, while I was putzing around, I decided to go ahead and set the date and time. Lo and behold, my problem went away. If I hadn't been so lazy and paid more attention to the error message I wouldn't have had the problem in the first place. Lesson learned? We'll see... :)

Thursday, April 19, 2012

problems overriding android compatibility methods

I had a class that extended android.support.v4.app.FragmentActivity. I wanted to override onRetainCustomNonConfigurationInstance, and I ran into the following error, indicating FragmentActivity didn't have that method:

The method onRetainCustomNonConfigurationInstance() of type ... must override or implement a supertype method


here's how to fix it:

  1. open the android SDK manager


  2. update the compatibility package


  3. copy the updated compatibility package to the /libs folder of your project. see here for where to find the compatibility package: http://developer.android.com/sdk/compatibility-library.html#SettingUp




that last part's what got me; I assumed updating the compatibility package would update it in my project :P