Solving “Only Content controls are allowed directly in a content page that contains Content controls”
By admin | February 3, 2012
While debugging and creating a new ASP.NET User Control, I stumbled across the following error, “Only Content controls are allowed directly in a content page that contains Content controls” that I did not encounter before. The culprit: an invalid assembly in the custom ASP.NET User Control registration section of “web.config“:
The first thing I tried, is, of course, to follow the advice on the can and remove any tag or text other than “<asp:Content>” tags from the page. But as, you can see, there are no other characters or tags on the page, and I had tried many times to regenerate the page or force VS to “re-parse” the page without success.
After some more debugging for a while, I found this error, which was related to an invalid assembly in the registering custom ASP.NET User Controls section of the web.config document:
And the answer? It turns out it was easy enough to fix after all, just fix the offending assembly reference!

The culprit of the error, Only Content controls are allowed directly in a content page that contains Content controls
And voila, fixed:
Topics: Windows | No Comments »
Android codec benchmarks
By admin | February 1, 2012
VLC for Android pre-alpha benchmarks (Feb 1, 2012) for various audio codecs.
Specs
Motorola XT300 - Android 2.1, 500 Mhz, 256 MB, rooted with busybox, Qualcomm MSM7225 (ARM1136EJ-S core, ARMv6TEJ architecture, no NEON extensions)
/proc/cpuinfo output
Processor : ARMv6-compatible processor rev 2 (v6l) BogoMIPS : 525.92 Features : swp half thumb fastmult edsp java CPU implementer : 0x41 CPU architecture: 6TEJ CPU variant : 0x1 CPU part : 0xb36 CPU revision : 2 Hardware : QCT MSM7x25 SURF Revision : 0000 Serial : 0000000000000000
Method
adb shell "/system/xbin/busybox ps aux | grep vlc" adb shell "/system/xbin/busybox top -b | grep <pid of VLC as above>"
Ogg files
Comparing three popular codecs for decoding OGG vorbis files, libavcodec from libav, vorbis and tremor.
Results
PID PPID USER STAT VSZ %MEM CPU %CPU COMMAND avcodec: 5266 956 10072 S 163m 88.4 0 25.0 org.videolan.vlc.android vorbis: 5331 956 10072 R 166m 89.8 0 41.0 org.videolan.vlc.android tremor: 5174 956 10072 S 156m 84.5 0 32.4 org.videolan.vlc.android
So, it seems avcodec is the clear winner, followed by tremor and lagging in last place libvorbis.
AC3 files
Test sample
First 30 seconds of http://people.videolan.org/~jb/ac3_the_other_side_44khz.wav
Results - Inconclusive?
| liba52 Mean: 31.51667% Median: 27.15% |
libavcodec Mean: 28.86667% Median: 29.25% |
ac3 with liba52
-A dummy --codec=a52tofloat32 D/vlc ( 6768): using decoder module "a52" Over 30 seconds PID PPID USER STAT VSZ %MEM CPU %CPU COMMAND 6768 956 10072 R 160m 86.7 0 52.6 org.videolan.vlc.android 6768 956 10072 S 159m 86.1 0 30.5 org.videolan.vlc.android 6768 956 10072 R 156m 84.5 0 25.6 org.videolan.vlc.android 6768 956 10072 S 156m 84.5 0 27.4 org.videolan.vlc.android 6768 956 10072 S 156m 84.5 0 26.9 org.videolan.vlc.android 6768 956 10072 S 156m 84.5 0 26.1 org.videolan.vlc.android Mean: 31.51667 Median: 27.15 Mode: N/A
ac3 with libavcodec
-A dummy --codec=avcodec D/vlc ( 6829): using decoder module "avcodec" Over 30 seconds PID PPID USER STAT VSZ %MEM CPU %CPU COMMAND 6829 956 10072 S 158m 85.5 0 32.3 org.videolan.vlc.android 6829 956 10072 R 155m 83.8 0 30.0 org.videolan.vlc.android 6829 956 10072 S 155m 83.8 0 26.3 org.videolan.vlc.android 6829 956 10072 S 155m 83.8 0 30.0 org.videolan.vlc.android 6829 956 10072 S 155m 83.8 0 28.5 org.videolan.vlc.android 6829 956 10072 S 155m 83.8 0 26.1 org.videolan.vlc.android Mean: 28.86667 Median: 29.25 Mode: 30.0
Topics: Mobile | No Comments »
Deepen an existing shallow clone with git
By admin | January 31, 2012
In git, the new revolutionary DVCS system, to shallow clone a repository means to check out only the latest snapshot of a git repository, unlike a normal clone which pulls the entire repository. A shallow git repository can save bandwidth and take up less space.
git clone --depth=1 git://repo.example.com/mycoolapp
However, let’s say that once you checkout the project, compile it and decide that you want to contribute to it, then a shallow clone would probably not suffice. In this case, one can deepen the repository by using the following command inside the git repository, where n = number of revisions to deepen to:
git fetch --depth=n origin master
Saves more than having to re-clone everything from scratch and lose your working tree.
Topics: Linux | No Comments »
VLC pre-alpha for Android 2.1 - Jan 2, 2012
By admin | January 2, 2012
Will post a how-to compile guide later, just wanted to upload the binaries that I am working on through GCI for purpose of testing, along with screenshots. If in doubt, download the first one (VLC-debug.apk).
- VLC-debug.apk (7.4MB, alternate download)
- VLC-debug-unaligned.apk (7.4MB, alternate download)
Screenshots
Topics: Mobile | No Comments »
Operating systems and car dealerships
By admin | November 4, 2011
An excerpt from the essay In the Beginning was the Command Line (CC BY-SA 2.0) by Michael Foord.
The analogy between cars and operating systems is not half bad, and so let me run with it for a moment, as a way of giving an executive summary of our situation today.
Imagine a crossroads where four competing auto dealerships are situated. One of them (Microsoft) is much, much bigger than the others. It started out years ago selling three-speed bicycles (MS-DOS); these were not perfect, but they worked, and when they broke you could easily fix them.
There was a competing bicycle dealership next door (Apple) that one day began selling motorized vehicles--expensive but attractively styled cars with their innards hermetically sealed, so that how they worked was something of a mystery.
The big dealership responded by rushing a moped upgrade kit (the original Windows) onto the market. This was a Rube Goldberg contraption that, when bolted onto a three-speed bicycle, enabled it to keep up, just barely, with Apple-cars. The users had to wear goggles and were always picking bugs out of their teeth while Apple owners sped along in hermetically sealed comfort, sneering out the windows. But the Micro-mopeds were cheap, and easy to fix compared with the Apple-cars, and their market share waxed.
Eventually the big dealership came out with a full-fledged car: a colossal station wagon (Windows 95). It had all the aesthetic appeal of a Soviet worker housing block, it leaked oil and blew gaskets, and it was an enormous success. A little later, they also came out with a hulking off-road vehicle intended for industrial users (Windows NT) which was no more beautiful than the station wagon, and only a little more reliable.
Since then there has been a lot of noise and shouting, but little has changed. The smaller dealership continues to sell sleek Euro-styled sedans and to spend a lot of money on advertising campaigns. They have had GOING OUT OF BUSINESS! signs taped up in their windows for so long that they have gotten all yellow and curly. The big one keeps making bigger and bigger station wagons and ORVs.
On the other side of the road are two competitors that have come along more recently.
One of them (Be, Inc.) is selling fully operational Batmobiles (the BeOS). They are more beautiful and stylish even than the Euro-sedans, better designed, more technologically advanced, and at least as reliable as anything else on the market--and yet cheaper than the others.
With one exception, that is: Linux, which is right next door, and which is not a business at all. It’s a bunch of RVs, yurts, tepees, and geodesic domes set up in a field and organized by consensus. The people who live there are making tanks. These are not old-fashioned, cast-iron Soviet tanks; these are more like the M1 tanks of the U.S. Army, made of space-age materials and jammed with sophisticated technology from one end to the other. But they are better than Army tanks. They’ve been modified in such a way that they never, ever break down, are light and manoeuvrable enough to use on ordinary streets, and use no more fuel than a subcompact car. These tanks are being cranked out, on the spot, at a terrific pace, and a vast number of them are lined up along the edge of the road with keys in the ignition. Anyone who wants [one] can simply climb into one and drive it away for free.
Customers come to this crossroads in throngs, day and night. Ninety percent of them go straight to the biggest dealership and buy station wagons or off-road vehicles. They do not even look at the other dealerships.
Of the remaining ten percent, most go and buy a sleek Euro-sedan, pausing only to turn up their noses at the philistines going to buy the station wagons and ORVs. If they even notice the people on the opposite side of the road, selling the cheaper, technically superior vehicles, these customers deride them cranks and half-wits.
The Batmobile outlet sells a few vehicles to the occasional car nut who wants a second vehicle to go with his station wagon, but seems to accept, at least for now, that it’s a fringe player.
The group giving away the free tanks only stays alive because it is staffed by volunteers, who are lined up at the edge of the street with bullhorns, trying to draw customers’ attention to this incredible situation. A typical conversation goes something like this:
Hacker with bullhorn: “Save your money! Accept one of our free tanks! It is invulnerable, and can drive across rocks and swamps at ninety miles an hour while getting a hundred miles to the gallon!”
Prospective station wagon buyer: “I know what you say is true…but…er…I don’t know how to maintain a tank!”
Bullhorn: “You don’t know how to maintain a station wagon either!”
Buyer: “But this dealership has mechanics on staff. If something goes wrong with my station wagon, I can take a day off work, bring it here, and pay them to work on it while I sit in the waiting room for hours, listening to elevator music.”
Bullhorn: “But if you accept one of our free tanks we will send volunteers to your house to fix it for free while you sleep!”
Buyer: “Stay away from my house, you freak!”
Bullhorn: “But…”
Buyer: “Can’t you see that everyone is buying station wagons?”
Topics: Linux | No Comments »
Geany 0.21 Debian pacakge for Ubuntu/Debian
By admin | October 25, 2011
The version of Geany provided with the repository in Ubuntu is a bit outdated (0.18) by two years, so we have also decided to produce an updated version (0.21) for use on Ubuntu 10.04 LTS and other versions of Ubuntu.
Download
- Debian package (5.7 MB)
- RPM package (5.7 MB)
Compiling
./configure --enable-binreloc --enable-socket --enable-vte --enable-the-force --prefix=/usr make make install
Topics: Linux | 1 Comment »
Updated version of YASM v1.1.0 for Ubuntu
By admin | October 24, 2011
The version of YASM provided with Ubuntu 10.04 is a bit outdated (0.8, updated in 2009) and is not sufficient enough to compile Mozilla Firefox. Therefore we have decided to compile an updated package of YASM v1.1.0 instead.
Download
- yasm-compdigitec-unofficial_1.1.0-1_i386.deb (Debian Package, 1.8MB)
- yasm-compdigitec-unofficial_1.1.0-1_i386.rpm (RPM Package, 1.8MB)
wget http://www.tortall.net/projects/yasm/releases/yasm-1.1.0.tar.gz -O- | tar zxvf - cd yasm-1.1.0 ./configure --disable-nls --prefix=/usr make make install yasm --version #yasm 1.1.0.2352 #Compiled on Oct 23 2011. #Copyright (c) 2001-2010 Peter Johnson and other Yasm developers. #Run yasm --license for licensing overview and summary.
Topics: Linux | No Comments »
Adding custom profile fields in WordPress (fully automatic)
By admin | October 17, 2011
Custom profile fields are additional custom-defined fields in the WordPress usermeta database that permit us to store additional information about a user. To add custom profile fields, add the following line to your functions.php in your theme folder:
include('customfields.php');
Now create a new file called customfields.php in the theme folder (the same folder as function.php) with the following contents:
<?php
function get_extra_profile_list() {
return Array(
/* Add your custom fields, here like follows:
'slug_of_the_field_here' => 'Field name for display',
*/
'address' => 'Address',
'favouritecolour' => 'Favourite Colour'
);
}
add_action( 'show_user_profile', 'extra_user_profile_fields' );
add_action( 'edit_user_profile', 'extra_user_profile_fields' );
function extra_user_profile_fields( $user ) { ?>
<h3><?php _e("Extra profile information", "blank"); ?></h3>
<table class="form-table">
<?php
foreach(get_extra_profile_list() as $key => $value) {
?>
<tr>
<th><label for="<?php echo $key; ?>"><?php _e($value); ?></label></th>
<td>
<input type="text" name="<?php echo $key; ?>" id="<?php echo $key; ?>" value="<?php echo esc_attr( get_the_author_meta( $key, $user->ID ) ); ?>" class="regular-text" /><br />
<span class="description"><?php _e("Please enter your $value."); ?></span>
</td>
</tr>
<?php
}
?>
</table>
<?php }
add_action( 'personal_options_update', 'save_extra_user_profile_fields' );
add_action( 'edit_user_profile_update', 'save_extra_user_profile_fields' );
function save_extra_user_profile_fields( $user_id ) {
if ( !current_user_can( 'edit_user', $user_id ) ) { return false; }
foreach(get_extra_profile_list() as $key => $value) {
update_usermeta( $user_id, $key, $_POST[$key] );
}
}
?>
Now if you go to “Users” under your administration and edit a user, the additional profile fields will show up at the bottom of the edit page.
Topics: PHP | 2 Comments »
WP No-bot Question plugin for WordPress
By admin | October 9, 2011
Most spam on your WordPress blog is caused by automated robots (spambots) which keep submitting to your comment form to inflate some shady website’s rank. Short of completely disabling or turning on blog moderation and wasting your time filtering through the mess, you can now use the new WP No-bot Question plugin developed by Compdigitec for WordPress - simply activate, set your question and answers and block all the spam bots! Best used in conjunction with other spam and server protection plugins such as NoSpamNX and Bad Behaviour. This plugin was inspired by the Anti-Bot Question Mod for phpBB, which is very effective against spambot user registration on phpBB.
See the plugin page on Compdigitec for more details and screenshots/downloads.
Topics: PHP | No Comments »
Compiling GNU Bash 4.x for Android 2.x
By admin | September 4, 2011
Updated (2012-02-04): Updated to Bash 4.2 and included source code used to compile.
GNU Bash (the GNU Bourne Again Shell) is the standard shell on most desktop and server distributions of Linux. As a result, we can download bash source code and compile the Bash shell for use on Android devices to replace default /bin/sh and busybox sh. Since the Android NDK doesn’t support the full glibc library (it lacks /etc/group and friends), a small patch is required to compile Bash for Android 2.x devices (probably caused by changes since Android 1.5.x).
If you don’t feel like compiling from scratch you can download a pre-built version.
Prerequisites
- Android NDK set-up and functioning
- Bash source (wget http://mirror.csclub.uwaterloo.ca/gnu/bash/bash-4.2.tar.gz)
- Host system development headers, etc (build-essential)
- Android Bash patch
Once your prerequisites are set up and functioning properly (adjust all paths as required, such as ndk path):
export ANDROID_NDK=/opt/android-ndk-r7
export CC="${ANDROID_NDK}/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc --sysroot=${ANDROID_NDK}/platforms/android-5/arch-arm/"
patch -p0 < bash-android.patch
./configure --host=arm-linux --enable-static-link --without-bash-malloc --disable-rpath --disable-nls
Once that is done, open Makefile and add -static to CFLAGS so it looks like so: “-g -O2 -static”
make file bash # bash: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, not stripped
You will find bash sitting in the folder. Now you can deploy it and try it through adb or something similar:
adb push bash /data/local/bin/bash adb -d shell $ /data/local/bin/bash bash-4.2$ /data/local/bin/bash --version GNU bash, version 4.2.0(2)-release (arm-unknown-linux-gnu) Copyright (C) 2011 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software; you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. bash-4.2$
Of course, once you have it ready and set up you should probably create a “.bashrc” file to make the terminal a bit more bearable, if you wish to.
Topics: Mobile | 4 Comments »










