Tuesday, May 4, 2010
disable or remove weather from HTC Sense in windows based phones
Saturday, January 30, 2010
home grille enhancement
Sunday, January 24, 2010
enable microphone to speaker in vista for pavilion dv2
Monday, October 26, 2009
using USB CDROM or DVDROM to install debian lenny, and got CDROM not detected.
here is the work around.
use the non-graphical installer
proceed normally for language, locale and keyboard settings
you will then get "No common CDROM drive was detected.
presss ALT+F4
you will see the error: unable to enumerate USB device on port xx
If so, press ALT+F2
press enter to get to console
then enter: modprobe -r ehci_hcd
(this will remove your high speed usbmodule)
press ALT+F4 again and you will see someting like "New USB device found"
last line shoud be: Attached scsi generic sg0 type 5
press alt+F1 to get back to menu
select "NO" when asked to load from removable media.
Select "Yes" when asked "Manually select a CD-ROM module and device"
Select "none" when prompted" Module needed for accesssing the CDROM:"
Just press enter when asked for "Device file for acccessing CDROM" (you are selecting the default "/dev/cdrom"
the installer should begin "Scanning the CDROM"
you could then continue normally.
.
Sunday, May 24, 2009
Howto write sybase sql query that group by date in multiple shifts or parts
There was a problem that I got solved. and I got them with the help from the guys at the sybase.public.ase.general newsgroups.
The basic requirement is to group the date into multiple parts or shifts when I do a sql query
For example, I have a table that keeps login time for some staff. but I need to get total logins for 4 periods each day. 12AM until 6AM, 6AM until 12PM, 12PM until 6PM and the remaining 6 hours.
the sql query should be as follows, and it uses "datepart" to divide the groups into 24 groups, and then divide them with 6 so that we got 4 new groups.
select convert(varchar(12),LoginDate,106), datepart (hh,LoginDate)/6+1,count(*)
from TABLE where LoginDate>="1 Jan 2009 7:00" and LoginDate<"4 Jan 2009 7:00"
group by convert(varchar(12),LoginDate,106),datepart (hh,LoginDate)/6+1
If we got an offset OperationalDate, for example that start from 7AM today until tomorrow's 7AM, (with an 8hour shifts each) then we could add the offset in this sql query using "dateadd":
select convert(varchar(12),dateadd(hh,-7,LoginDate),106), datepart (hh,LoginDate)/8+1,count(*)
from TABLE where LoginDate>="1 Jan 2009 7:00" and LoginDate<"4 Jan 2009 7:00"
group by convert(varchar(12),dateadd(hh,-7,LoginDate),106),datepart (hh,LoginDate)/8+1
However, if you are designing the database from scratch, better add new column for the period( or shifts), and the operationaldate in the table. we could use trigger thereafter to insert the value into these colums. (as notably mentioned by one participant on May 21th 2009 in the same thread)
Here is the complete thread:
http://groups.google.com/group/sybase.public.ase.general/browse_thread/thread/5e7b7a88cbeddd3c?hl=en#
.
Wednesday, April 29, 2009
Linux / unix delete a line from the same file
In Linux shell script, howto delete one line from a file and save it in the same file?
The longer method would be
-------------
grep -v PATTERN MyFile > MyFile.new
mv -f MyFile.new MyFile
------------
The one-liner command would be as below
sed -i "/PATTERN/d" MyFile
option -i means "edit the file and save it in place (as the same file)"
/d means to delete - it will deleteall lines that contains PATTERN.
Read sed manual for more info




