Older blog entries for asmodai (starting at number 54)

Adding android.support.v4 to your Android application in IntelliJ IDEA

You can enable support for certain forward version features via the android.support namespace. In order to accomplish this you need to start the Android SDK Manager and make sure that under the Extras heading you select and install the Android Support package.

Once done you go into the directory extras/android/support/v4 and copy the android-support-v4.jar to your own project’s libs directory. Next go within IntelliJ IDEA to File » Project Structure and under Project Settings go to Modules, make sure your application is selected in the middle pane, then on the right side select the Dependencies tab. In the window below click the plus-icon and select Jars or directories. From the resulting window browse to your libs directory and select the android-support-v4.jar and press OK to close the window and add the jar-file to the dependencies of the project. Close the Project Settings by pressing the OK button.

Syndicated 2012-02-26 15:14:56 from In Nomine - The Lotus Land

Android Galaxy S2 Skin and AVD

What I did to get the Galaxy S2 skin to work with the Android Virtual Device (AVD) was:

  1. download the skin from the Samsung Developer website, it’s under the Add-on SDKs,
  2. extract to a Galaxy_S2 directory,
  3. put the entire directory in the [Android-SDK directory]/platforms/android-10/skins directory,
  4. edit the manifest.ini and change api=9 to api=10,
  5. restart AVD Manager,
  6. under skin in the device configuration you should see Galaxy_S2 in the dropdown.

Syndicated 2012-02-22 11:55:11 from In Nomine - The Lotus Land

Small touches that inspire

It’s the littlest of things that can really brighten my mood when I notice them. In this case I was watching Fallout: New Vegas’ DLC trailer for Honest Hearts. In the trailer you see the player with a pistol and on one side of the pistol at least is written: “καὶ ἡ σκοτία αὐτὸ οὐ κατέλαβεν”. This is Greek and refers to the second part of the verse of John 1:5 in the New Testament of the bible, meaning in English: “and the darkness did not comprehend it”. In my opinion a great way to bring enlightenment by the bullet.

Syndicated 2011-05-14 20:22:03 from In Nomine - The Lotus Land

TortoiseSVN (Subversion) and Windows 7 file corruption

During a checkout of a Subversion tree on my Windows 7 installation I got quite a fair share of errors from TortoiseSVN, all of which ended with The file or directory is corrupted and unreadable.

After digging around a bit, I came across this blog post on the exact same problem. And subsequently I found there is a hotfix available from Microsoft on their page about . This hotfix will be in the upcoming service pack 1.

You might also be able to work around it by disabling indexing on the particular folder or drive. It solved it for me at least.

Syndicated 2011-02-11 12:48:07 from In Nomine - The Lotus Land

Visual Studio editor rulers

If you like to have a visual cue for, say, where the 80th column is then this page over at Stack Overflow details the various registry keys you might need to add as well as showing which extensions can do it for you. For VS 2010 Professional and up you can use the Productivity Power Tools, but it seems that Visual Studio 2010 Express has no guides support.

Syndicated 2011-02-10 12:41:41 from In Nomine - The Lotus Land

Sublime Text with 80 and 120 column rulers

For many programming languages we still like to use either 80 or 120 columns in our editors to ensure it fits easily on print, as well as to use it as an aid for ensuring concise code.

In Sublime Text you can set vertical rulers for this by going to Preferences > User File Preferences and add rulers 80 120 and save the file.

For Sublime Text 2 it’s again under Preferences > User File Preferences, but the configuration file is now in JSON format, so you need to add "rulers": [80, 120] and maybe you need to append a comma at the end if you have more configuration directives following it.

Syndicated 2011-02-02 12:06:48 from In Nomine - The Lotus Land

PyCharm 1.1.1 released

PyCharm 1.1.1 was released yesterday. It consists mostly of bugfixes, find the full release notes on their site.

Syndicated 2011-01-20 12:31:33 from In Nomine - The Lotus Land

Mercurial 1.7, cacerts, and FreeBSD

So with recent Mercurial 1.7 releases HTTPS support was tightened, so you are bound to encounter a warning in the form of: warning: bitbucket.org certificate not verified (check web.cacerts config setting).

Now, on http://mercurial.selenic.com/wiki/CACertificates there are details on what to configure for certain operating systems. Given I use FreeBSD, I altered my $HOME/.hgrc as follows:

[web]
cacerts = /etc/ssl/cert.pem

For OpenBSD this should be in the same place since release 3.8. But apparently NetBSD does not have such a file in base.

Syndicated 2011-01-07 14:05:19 from In Nomine - The Lotus Land

PyCharm and external lint tools

PyCharm already has a number of features present in various tools to lint/check your source code with, but offers a way to hook up external tools. Under File > Settings is a section called IDE Settings. One of the headings here is called External Tools. Select this heading and then press the Add... button on the right hand pane to configure a new external tool.

In the Edit Tool window that now appeared fill in a name, e.g. PEP8 and a group name Lint and add a description. Next point the Program to the location of the pep8.exe executable, e.g. C:\Python27\Scripts\pep8.exe. For Parameters you need to use $FilePath and Working directory should be filled in by default. Once done, you can close it by pressing the OK button.

Now, pyflakes has no .exe or .bat file to accompany it. You will need to add a pyflakes.bat in your Scripts directory inside Python with the following contents:

@echo off
rem Use python to execute the python script having the same name as this batch
rem file, but without any extension, located in the same directory as this
rem batch file
python "%~dpn0" %*

Within PyCharm you follow largely the same settings as for pep8, however make sure to point to the batch file of pyflakes under Program. Close the external tools configuration windows by clicking OK twice. Under the menu heading Tools you should see an submenu heading Lint which, in turn, should contain two menu items: PEP8 and Pyflakes.

Now open a Python file, go to Tools > Lint > PEP8 and you should get output like the following in your Run (4) window:

D:\Python26\Scripts\pep8.exe D:\pprojects\babel\babel\tests\__init__.py
D:\pprojects\babel\babel\tests\__init__.py:16:1: E302 expected 2 blank lines, found 1

Process finished with exit code 1

Syndicated 2010-12-14 12:49:33 from In Nomine - The Lotus Land

svn switch in Mercurial (hg)

For my own sanity:

In order to change the parent repository URL of a Mercurial clone (as svn switch does) one simply edits .hg/hgrc and adjusts the default under [paths].

Syndicated 2010-11-29 12:36:42 from In Nomine - The Lotus Land

45 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!