


jQuery 1.9 and checkbox
Before jQuery 1.9:
1 | $("#mycheckbox").attr("checked", true); |
With jQuery 1.9:
1 | $("#mycheckbox").prop("checked", true); |
More information here: http://jquery.com/upgrade-guide/1.9/#attr-versus-prop-

Fix: The Walking Dead Game doesn’t start on Windows 8 (Steam)
I was having a terrible time getting this game to start at all, couldn’t even get an error message. Finally, after 15 minutes of googling, I found a fix. This problem occurs when a game controller is connected to the PC. In my case I use an Logitech controller (with wireless adapter) for my PC.
Fix:
Download DINPUT8.DLL from here: http://www.dlldump.com/download-dll-files_new.php/dllfiles/D/dinput8.dll/5.03.2600.2180/download.html
Place this file in your install dir for The Walking Dead (C:\program files (x86)\steam\steamapps\common\the walking dead)
Play!

Remove Microsoft Security Essentials after Windows 8 Upgrade
- Download “Microsoft FixIt” tool here
- Run “”Microsoft FixIt”
- Select Detect problems and let me select the files to apply.
- Select Uninstalling.
- After detecting problems Select Microsoft Security Client to uninstall and click Next.
- (Optionl) Repeat the steps from 2 to 5 and, this time select Microsoft Antimalware from list to uninstall and click Next.
- Restart your computer

Gute Musik zum Joggen oder Laufen

Best cover from “Adele – Rolling in the deep”

HowTo: Install Google Play Movies on Galaxy Nexus
- Go to https://play.google.com/store/apps/details?id=com.google.android.videos and install Google Play Movies via web on your Galaxy Nexus
- Open “Google Play Store” on your Galaxy Nexus an search for the “Google Play Movies” App.
- Uninstall the App and after that press the “update” button.
- Works!

WordPress: Adding custom columns to wp-admin posts overview
Adding custom columns to the posts overview from wp-admin is maybe simpler as you think. You need just two hooks, one is an action named “manage_posts_custom_column” and the other one is a filter named “manage_posts_columns”.
Add custom column
With the filter “manage_posts_columns” you can add your custom column to the overview table of the posts. In my case I made the filter a little bit more complex, because I want control of the column order. The default order from wordpress is
- cb
- title
- author
- categories
- tags
- comments
- date
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | public static function addCustomColumn($defaults) { $newDefaults = array(); while ($default = current($defaults)): $key = key($defaults); $newDefaults[$key] = $default; if ($key == "author"): $newDefaults["my_column"] = "My Column Name"; endif; next($defaults); endwhile; return $newDefaults; } |
If you have a more sexy solution for this, tell me :)
Adding content to your costum column
Next and final step is adding the content to your custom colum/row with the action-hook “manage_posts_custom_column”. The action takes the column-name and the post_id of the current row:
1 2 3 4 5 6 | public static function showCustomColumnContent($columnName, $postId) { if($columnName == "my_column"): echo "my column content for post_id " . $postId; endif; } |
Custom columns only for a custom post type
If you want your custom column only in a custom posty, e.g. to display a custom taxonomy, then simply add the name of your custom post type to the name of the hook.
For example:
Action hook “manage_yourcustomposttypename_posts_custom_column”
Filter hook ”manage_yourcustomposttypename_posts_columns”
Full example plugin code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | <?php /* Plugin Name: Custom Columns Example Plugin URI: http://www.eracer.de Description: Example Plugin to demonstrate custom columns in wp-admin Author: Stefan Helmer Version: 1.0 Author URI: http://www.eracer.de */ class CustomColumnsExample { const COLUMN_NAME = "my_column"; const COLUMN_TITLE = "My Column"; public static function initializePlugin() { add_action('manage_posts_custom_column', array("CustomColumnsExample", "showCustomColumnContent"), 10, 2); add_filter('manage_posts_columns', array("CustomColumnsExample", "addCustomColumn")); } public static function addCustomColumn($defaults) { $newDefaults = array(); while ($default = current($defaults)): $key = key($defaults); $newDefaults[$key] = $default; if ($key == "author"): $newDefaults[self::COLUMN_NAME] = self::COLUMN_TITLE; endif; next($defaults); endwhile; return $newDefaults; } public static function showCustomColumnContent($columnName, $postId) { if($columnName == self::COLUMN_NAME): echo "my column content for post_id " . $postId; endif; } } add_action('init', array("CustomColumnsExample", "initializePlugin")); ?> |

Jelly Bean Time


Android ObjectInputStream and ObjectOutputstream snippet
At first, make your object serializable and let the IDE (in my case Eclipse) generate a serialVersionUID for you:
1 2 3 4 5 6 7 8 9 | public class Post implements Serializable{ private static final long serialVersionUID = 7884946435027239199L; public String firstname; public String lastname; } |
Writing to files with serialization and writing objects to file:
1 2 3 4 | FileOutputStream fileOutputStream = openFileOutput("personobject", Context.MODE_PRIVATE); ObjectOutputStream objectOutputStream= new ObjectOutputStream(fileOutputStream ); objectOutputStream.writeObject(yourObject); objectOutputStream.close(); |
Reading files with serialization and get it as object:
1 2 3 | FileInputStream fileInputStream = openFileInput("personobject"); ObjectInputStream objectInputStream = new ObjectInputStream(fileInputStream); Person person = (Person)objectInputStream.readObject(); |
Thats it!





