Display Only Excerpts Instead of Full Posts

By default in the theme “Twenty Eleven” of WordPress everywhere (except for search results) full posts are displayed. But I don’t like that, because if I click on a category or tag, I just want to get an overview what posts are assigned to it. If I want to read one completely, I can still click on it.

Therefore I wanted to display only excerpts of posts for following pages:

  • Search results (which is the case by default already)
  • Homepage of the blog
  • Category archive pages
  • Tag archive pages
  • Date-based archive pages (I don’t use them at all right now)

To accomplish that, you just have to replace the line in the “content.php” theme file

<?php if ( is_search() ) : // Only display Excerpts for Search ?>

with this one:

<?php if ( is_home() || is_tag() || is_category() || is_date() || is_search() ) : ?>

That’s it. Now at least I think it looks better for the user and I’m sure also search engines don’t mind that (keyword: “duplicate content”). ;-)

Multilingual Blog in WordPress: qTranslate, WPML or Multisite Feature

As I setup this blog on a new platform, I wanted to make sure it is multilingual directly from the beginning.

Disappointed I realized that WordPress still does not provide options for multilingual blogs originally. I don’t understand that, because obviously many people have exactly this problem: how to get the WordPress blog multilingual.

While searching for a solution, I basically found three useful options:

  • Plug-in qTranslate
  • Plug-in WPML
  • Using the multisite feature of WordPress itself

qTranslate

When I tested this plug-in I saw quite fast that it does not provide slug translation for posts, pages, categories and tags. This way this plug-in is useless in my opinion, because without a slug translation search engine optimization is basically impossible.

Obviously the original plug-in developer did not like or had no time to implement that feature yet, but although there are already other guys dealing with that issue (see this forum post), I don’t want to use such an incomplete plug-in right now.

WPML

On the first sight WPML looks like a good alternative. It is not free (anymore), but I don’t mind paying some dollars for a good plug-in.

But there are following reasons why I will not use it and asked for refunding my money (which is possible within 30 days):

  1. I want to have all languages (including the default one) in a subdirectory and this is not supported by WPML. The workaround provided in the forum is a little bit too “hacky” (you never know which problems you’ll get with such hacks later on).
  2. it is unhandy that WPML does not allow to have tags and categories with the same names and slugs for different languages. If different languages are placed in a subdirectory (or even subdomain), there is no need to have cross-language unique names and slugs.
  3. there is a bug in WPML where posts are losing the translation relation to each other. No explanation or solution was provided therefore till now.

But I would like to add that refunding the money was done very fast (within few hours) as promised by the company; so it’s save to test WPML yourself.

WordPress Multisite

Obviously there are not many options left. Therefore I go this way now.

Of course, there is a drawback with this solution, too: translated posts are not directly linked to each other and therefore the reader cannot switch to another language of the post easily. But maybe I’ll create a plug-in to fix this later on myself.

At least you don’t need to rely on other plug-ins for multilingual blogs with this solution.

Here I explain how to add language selection flags although using WordPress Multisite.

And which option you are using for your multilingual blog?

Intel Black Belt Status as AppUp Developer

Today I was informed by the German community manager Monika Lischke of Intel’s AppUp developer program that I will get the Intel Black Belt Status!

That’s really great as one of many benefits resulting from this award is that I’ll be invited to come to the Intel Developer Forum (IDF) in San Francisco this year. :-)

Do you also participate in the Intel AppUp Developer program?

Dotclear as Alternative to WordPress

While searching for a good, new platform for this blog, the first blog software you came across obviously is WordPress. But as I was not so happy with the multi-language features of WordPress (see this other post), I searched for a better solution.

Then I found Dotclear that looked at first sight like a interesting alternative:

  • It looks clean and easy.
  • It’s written in PHP (as I’m developing in PHP myself, too, that’s important for me in case it should be necessary to add or change something myself).
  • It should be easily possible to use more than one language for the blog (that’s the reason why I’m unhappy with WordPress).

Therefore I just gave it a try and installed it on my test server which worked without problems and errors.

Directly after the first login I wanted to have a look inside the documentation and the plug-in descriptions to see what plug-ins are available for this system. But then I was appalled: all plug-in descriptions and part of the documentation seem to be only available in French!

Maybe I could still understand it by using my school’s Latin knowledge and Google Translate, but I really don’t want to use a blogging system that’s main language is not English.

Although I’m a German native speaker, I even don’t think any bigger open source project should choose German as main language: if there are translations in other languages that’s great, of course, but as most of all people understand English, the main language of all projects should be English! Period.

Therefore I stopped testing Dotclear and stayed with WordPress.

Did you also have positive or negative experience with Dotclear yourself already?

USB Audio Interfaces With Good Frequency Response

For a measurement system I needed an USB audio interface with a good frequency response (at least up to 40 kHz).

After doing a first research on this topic on the internet I realized that this won’t be very easy as most of the manufacturers just don’t put any useful info regarding frequency response on their webpage. And if you asked them they, often just don’t know it themselves.

So I ordered these interfaces for testing:

  • M-Audio FastTrack Pro (about €160)
  • TASCAM US-122 MKII (about €130)
  • E-MU 0202 USB (about €100)
  • ESI Dr. DAC nano (about €70)

Here are the results of the individual audio interfaces.

M-Audio FastTrack Pro

M-Audio FastTrack Pro

The problem with this interface was that it still uses USB 1.1 and therefore a sampling rate of 96 kHz is only possible in one direction (in or out). That would be OK for me as I only needed to use it for output, but whatever I tried I did not get the interface to work with a sampling rate of 96 kHz – it only accepted 44.1 kHz. As a result the upper end of the frequency response is around only 20 kHz. So I cannot use this interface for my purpose.

TASCAM US-122 MKII

TASCAM US-122 MKII

This was the best interface in respect of frequency response in my test: in contrast to the FastTrack Pro it uses USB 2.0 and therefore can easily handle 96 kHz sampling rate in both directions simultaneously. The frequency response is also very good (20 Hz to 40 kHz with +/-1 dB) as the following diagram of the RightMark Audio Analyzer shows:Frequency Response of TASCAM US-122-MKII

E-MU 0202 USB

E-MU 0202 USB

Whatever I tried, but I did not get this interface to work correctly: my Windows XP computer crashed several times while trying to get the drivers to work and I really don’t want to talk about the Windows 7 Beta Drivers at all! I cannot understand why a company like Creative (E-MU was acquired by Creative in 1993) does not have official (not beta!) and working Windows 7 drivers about 2 years after this operating system was released.

ESI Dr. DAC nano

ESI Dr. DAC nano

This was the cheapest interface in my small test and it also does not have many features: it really only outputs stereo audio – over S/PDIF or line out –, but this works just fine at 96 kHz sampling rate. The frequency response is not what I would call “neutral” (it looks like as the manufacturer want to boost the bass a little bit with intent), but at least also the higher frequencies are sent with not too high absorbability (20 Hz to 40 kHz with +2/-3 dB). For this test I used the TASCAM US-122 MKII interface as input for the RightMark Audio Analyzer:Frequency Response of ESI Dr. DAC nano

As a summary I recommend the ESI Dr. DAC nano interface if only stereo output at 96 kHz is necessary and +2/-3 dB in the 20 Hz to 40 kHz frequency range are OK. Otherwise the best one in respect of frequency response of the tested devices definitely is the TASCAM US-122 MKII.

Math Parser for .NET

For a new software project I’ve searched for a good math parser for .NET.

Beside parsing and evaluating a formula with all common mathematical functions (like sine, cosine, logarithm, …), I additionally needed to be able to use variables inside the formulas.

The best solution that I found is this one here:
http://www.lundin.info/mathparser.asp

The usage is very easy; here you can see a C# example code:

// Instantiate the parser
ExpressionParser parser = new ExpressionParser();

// Create a hashtable to hold values
Hashtable h = new Hashtable();

// Add variables and values to hashtable
h.Add("x", 1.ToString());
h.Add("y", 2.ToString());

// Parse and get the result
double result = parser.Parse("xcos(y)", h);

And for those of you that prefer Visual Basic .NET:

' Instantiate the parser
Dim parser As New ExpressionParser()

' Create a hashtable to hold values
Dim h As New Hashtable()

' Add variables and values to hashtable
h.Add("x", 1.ToString())
h.Add("y", 2.ToString())

' Parse and get the result
Dim result As Double
result = parser.Parse("xcos(y)", h)

It is important that the values are always added as String to the hashtable of variables. The reason is that internally it just injects them into the formula before parsing it – this way they have to be of type String, obviously.

The free assembly is open source and under the LGPL license. Therefore it can also be use in commercial projects as long as it is only linked dynamically as external library.

Simple Sine Generator for .NET

In this post I want to show how to create an easy sine generator in .NET.

Let’s start with a code listing and then I’ll explain what I’m doing here:

const double frequency	= 1000;
const double amplitude	= 20000;
const long sampleRate	= 44100;
const int durationSec	= 5;

long sampleCount = sampleRate * durationSec;

double timeStep = 1.0 / (double)sampleRate;

double time = 0;
int[] values = new int[sampleCount];
for (long i = 0; i < sampleCount; i++) {
	values[i] = (int)(amplitude * Math.Sin(2 * Math.PI * frequency * time));
	time = time + timeStep;
}

OK, here are some explanations:

  • lines 1-4: some constants you can change to e. g. adjust the frequency.
    Note: the frequency cannot be more than half the sampling rate.
  • line 6: calculating the number of sampling points.
  • line 8: calculating the time between two sampling points.
  • lines 10-11: some variable initializations.
  • lines 12-15: here finally the value of each sampling point is calculated.

And here is the corresponding code for Visual Basic .NET:

const frequency as double		= 1000
const amplitude as double		= 20000
const sampleRate As Long		= 44100
const durationSec As Integer	= 5

Dim sampleCount As Long
sampleCount = sampleRate * durationSec

Dim timeStep As Double
timeStep = 1.0 / sampleRate

Dim time As Double = 0
Dim values(0 To sampleCount - 1) As Integer
For i As Long = 0 To sampleCount - 1
	values(i) = amplitude * Math.Sin(2 * Math.PI * frequency * time)
	time = time + timeStep
Next i

For sound playback you can now use either an API call like PlaySound (of winmm.dll) or the solution of this great article.

Did you also need to generate a sine in .NET yourself already?

MobileMonday: Speech About “Getting Your Windows and MeeGo Apps Into AppUp”

Today there was a MobileMonday Developer Day (M2D2) in Munich (München, Germany) with the Intel AppUp Application Lab: MeeGo Series extended, organized and hosted by MobileMonday and Intel in cooperation with about 100 attendees.

The speakers spoke about details of the Intel AppUp Developer Program, the advantages of the MeeGo platform, the numerous tools (in particular the MeeGo SDK & Qt), the binary code validation and the app developer community.

MobileMonday Intel AppUp Application Lab

I was invited to give a speech there on the topic Getting Your Windows and MeeGo Apps Into AppUp. Download the PowerPoint presentation.

Digitally Sign Binary Files on Windows

Already since several years I’m signing all my binary files digitally – like setups or product executables.

But why is the digital signature of binary files so important?

If a binary file is digitally signed the user, who wants to execute the file, can make sure it is the original file and it was not modified in any way. Additionally Windows Vista and Windows 7 User Account Control displaysWindows User Account Control (Signed)

instead of this ugly message box:Windows User Account Control (Not Signed)Beside that also app store systems like Intel AppUp require that your setups are being digitally signed.

To start you will first need a code signing certificate. If you are a developer in the Intel AppUp program, you get this directly from the AppUp developer website. Otherwise you can get cheap certificates from Comodo here: http://codesigning.ksoftware.net

After you have received your code signing certificate, you can use a small GUI application for signing binary files.

Or, if you don’t like GUI applications or want to include the signing into your build process, you can create a small batch file like this and just drag & drop the binary file that you want to sign on this batch file (or pass it as parameter):

signtool.exe sign /f "certificate.pfx" /p "password" /t "http://timestamp.verisign.com/scripts/timstamp.dll" "%1"

Obviously you need to exchange certificate.pfx with the file name of your certificate (which should be placed in the same directory as the batch file and the file signtool.exe) and password with your certificate password that you have chosen while exporting it from your web browser. To get the file signtool.exe, you need to download the free Microsoft Windows SDK.

Here are some frequently asked questions on code signing certificates and digital signature.

Do you already digitally sign your binary files, too?

MobileMonday: Drivers of the Mobile Ecosystem

Today there was a MobileMonday in Berlin (Germany) about the Drivers of the Mobile Ecosystem. The event focussed on trends and technology with the potential to create new mobile businesses.

MobileMonday: Drivers of the Mobile EcosystemI was invited by Intel to be at their booth and talk about Intel AppUp, the new app store for netbooks and tablets.