Search This Blog
Saturday, April 7, 2012
Android 4.0.3 XXLPQ Screen timeout bug
I had an issue with my Android ICS 4.0.3 XXLPQ ROM.
The problem was that the screen did NOT turn itself off after a defined period of time so when
I received an sms or a call the screen remained lit till the time I actually came and turn it off manually.
It was annoying and drained the battery.
I turned out that it was a kernel problem. Updating the kernel to speedmod-kernel-s2 worked like a charm
and resolved my issue. It's supposed to be faster than the stock kernel but what I really cared about was
screen backlight timeout bug.
Kernel:
Working/Confirmed root for Samsung Galaxy S2 stock ROM on Android 4.0.3 version XXLPQ
Model: Samsung Galaxy S2 I9100
ROM: Android 4.0.3 stock ROM XXLPQ
1. download the file below
2. unpack it and copy the content to your SD card
3. enter CWM - upArrow, Home Key, and power button pressed simultaneously
4. search for "Install zip from sdcard"
5. choose "CWM.zip"
6. touch clockworkmod recovery will run
7. search for "Install zip from sdcard"
8. search for SU-Busybox-Installer.zip and apply the update
File:
OfficialICS_ROOT.7z
Guide for UNROOTING is available inside the package (in short: apply the SU-Uninstaller-Signed.zip update)
Tested on stock 4.0.3 LPH & LPQ rom.
Visual/Touch interface Clockworkmod recovery for Galaxy S2
Tuesday, March 13, 2012
Postgres using replace function; Postgres replacing phrase in an XML-typed column;
I wanted to replace column content '{ApplicationVersion}' with '{RegularMessage}' string. Postgres syntax seemed a little bit strange to me (because of the XMLPARSE) so I’m writing the solution here. As it turned I had to cast my content argument to text first as it was an XML-typed column - there is no automatic casting. If you forget to that the error pops up which suggests there is no replace function referenced but it actually means that there is no replace function with such arguments so you should cast your arguments:
ERROR: function replace(xml, unknown, unknown) does not exist
update messageset content = XMLPARSE(
DOCUMENT replace(text(content),'{ApplicationVersion}','{RegularMessage}')
)
where type = 'RegularMessage';
where content is the xml-typed column.
XMLPARSE can have DOCUMENT or CONTENT as arguments and you need to write one of the two keywords before the actual column name:
XMLPARSE (DOCUMENT '<?xml version="1.0"?><book><title>Manual</title></book>');
or
XMLPARSE (CONTENT 'abc<foo>bar</foo><bar>foo</bar>');
Thursday, March 1, 2012
GIT good practices; What to remember when coming from SVN; SVN to GIT tutorial
When working with a distributed repository system one needs to remember that it is slightly different from SVN and CVS repositories. I will put most aspects in points for easy remembering.
- Your LOCAL commit time/order is remembered when pushing your changes. So if you commit changes on master and then try pulling and pushing it will create a nasty “divide and merge” track on master. It looks like this:
To prevent this behavior always do REBASE instead of pull when syncing with the distributed repository.
Rebase in TortoiseGit is available from rightClick->Git sync->Fetch&Rebase
- If possible work on your LOCAL branch. For example, when your main branch is called “master”, create a branch called “localMaster” and commit changes to this branch. When the time comes to push your changes you will switch to “master”, pull the changes. Then switch back to “localMaster”, rebase localMaster in position to master to include all the changes which have been made on master and resolve any conflicts. Then switch to “master”, merge master from “localMaster” to include changes from “localMaster” in “master”. In the end you just push your “master” branch.
GIT good practices – using “master” and “localMaster” branches.
- You clone the repository from source. And create your “localMaster” branch. So you have: “origin/master”, “origin/HEAD”, “master” and “localMaster”.
- commit changes to “localMaster” branch
- Switch back to “master” branch and pull changes from repo
- switch to “localMaster” and do a rebase with “master”. In this way all the changes which have been pulled to master will be reflected in “localMaster” branch
- this is how it looks “as a pure concept” after the rebase. You need to resolve any conflicts that can occur during this process.
- switch to “master” branch and merge changes from “localMaster” to reflect commits made in “localMaster” to “master” branch
- now that you have merged “master” and “localMaster” you can switch to “master” and push your changes so that others can see your commits.
I hope this is helpful.
Wednesday, February 29, 2012
Silverlight animating PopupMenu–‘IsOpen’ property, translate transform and opacity
This sample shows how to animate System.Windows.Controls.Primitives.Popup ‘IsOpen’ property, its position and opacity.
To change the visual state from code behind use:
VisualStateManager.GoToState(this, "HiddenState", true);
VisualStateManager.GoToState(this, "VisibleState", true);
Thursday, February 9, 2012
Using StringFormat in Binding
I had a problem using string format for a simple task of just "following the string from Binding with a ‘:’ sign. This can accomplished with:
Content="{Binding a,Source={StaticResource b}, StringFormat='{}{0}:'}"
Don’t forget the ‘’ signs.