Custom Search

Friday, December 26, 2008

OpenCV read coordinates from cvFindContours

CvSeq* contour1 = 0;
cvThreshold( src, src, threshold, 255, CV_THRESH_BINARY );//convert to black and white
cvFindContours( src, storage, &contour, sizeof(CvContour), CV_RETR_CCOMP, CV_CHAIN_APPROX_SIMPLE );
cvZero( dst );
contour1 = contour;
for( ; contour != 0; contour = contour->h_next )
{
cvDrawContours( dst, contour, CV_RGB(0,255,0), CV_RGB(255,255,0), -1, 1, 8 );
}

int maxLevel = 3;
CvTreeNodeIterator iterator;
CvPoint pt,pt1,pt2;
if(contour1 != 0)
cvInitTreeNodeIterator( &iterator, contour1, maxLevel );
int i = 0;
while( (contour1 = (CvSeq*)cvNextTreeNode( &iterator )) != 0 )
{
CvSeqReader reader;
int count = contour1->total;
cvStartReadSeq( contour1, &reader, 0 );
count -= !CV_IS_SEQ_CLOSED ( contour1 );
CV_READ_SEQ_ELEM ( pt, reader );
i++;
ptArray[i] = pt;
printf("coordinates%d: %d %d \n",i ,pt.x, pt.y);
cvRectangle( dst, pt, cvPoint(pt.x+2,pt.y+2) , CV_RGB(0,0,255), 1, 8, 0 );
}
// replace CV_FILLED with 1 to see the outlines

Taken from http://cv-kolaric.blogspot.com/ thanks SINISA KOLARIC :)

Monday, December 22, 2008

Borderline personality disorder

Borderline personality disorder (BPD) is a psychiatric diagnosis in the Diagnostic and Statistical Manual of Mental Disorders (DSM-IV Personality Disorders 301.83) that describes a prolonged disturbance of personality function characterized by depth and variability of moods. The disorder typically involves unusual levels of instability in mood; "black and white" thinking, or "splitting"; chaotic and unstable interpersonal relationships, self-image, identity, and behavior; as well as a disturbance in the individual's sense of self. In extreme cases, this disturbance in the sense of self can lead to periods of dissociation. These disturbances can have a pervasive negative impact on many or all of the psychosocial facets of life. This includes difficulties maintaining relationships in work, home, and social settings. Attempted suicide and completed suicide are possible outcomes, especially without proper care and effective therapy. Onset of symptoms typically occurs during adolescence or young adulthood. Symptoms may persist for several years, but the majority of symptoms lessen in severity over time,with some individuals fully recovering. The mainstay of treatment is various forms of psychotherapy, although medication and other approaches may also improve symptoms.

Friday, December 5, 2008

Self Handicapping

Self-handicapping occurs when individuals anticipate failure on a self-relevant task and create impediments to success. Thus doing things that would increase the self-handicapper's risk of failure.
Why do people, given the availability of alternative self-protective strategies such as self-affirmation and self-evaluation maintenance that do not entail self-sabotage?
A hypothesis is that self-handicapping might serve a secondary purpose: to preserve a pleasant affective state.
1) Self-handicappers re protected from failure by ascribing poor performance to factors other than lack of ability.
2) People who succeed despite their handicaps earn extra credit for their success.
Therefore, self-handicappers discount ability attributions for failure but augment ability attributions following success.
Self-handicapping may lead to more positive mood.
Is mood an antecedent influence on self-handicapping?
Mood states play an important role in how people attribute success and failure.
Happy persons tend to take credit when doing well, but avoid self-blame when experiencing failure.
Sad persons took little credit for success, but blamed themselves when they did poorly.
Real-life relationships showed similar mood-induced bias.
Happy people rely on positive moods as a resource to help them deal with aversive but potentially useful negative feedback. However, when negative feedback is uninformative or unreliable, happy mood produces the opposite reaction, as people become protective of their positive moods.
Self-handicapping occurs when people doubt their ability and value of receiving further feedback is low.
Results show that non-contingent feedback induces greater self-handicapping than contingent positive feedback, as people who receive non-contingent feedback doubt that they can perform well again.

Happy participants did not self-handicap merely because they wanted to avoid effrt to maintain good mood, or experienced elevated tates of imulsiveness, situational self-esteem, or arousal. Therefore mood should directly influence the motivation to self-handicap.

Most people self-handicap defensively, to discount distressing self-attributions of failure, but not to improve existing aversive states.

Lifted from www.sciencedirect.com On being happy but fearing failure: The effects of mood on self-handicapping strategies

Thursday, November 27, 2008

test

Sunday, August 17, 2008

AVG 8.0 A .bin file is missing error!

1) Go to the AVG website at the following URL: http://www.grisoft.com/ww.download-update

2) Create a folder on your desktop and download the following files to the folder:
1) AVI: 270.6.4
2) IAVI: / 1616

3) Open the AVG control panel and click the "Tools" link. Select "Update from Directory," navigate to the desktop file that you created and placed the downloaded files into and select the file as the update source.

AVG should automatically load the update files and all of your notifications should go back to green.

"it will analyze the updates and the progress bar will stop about 1/4 of the way across. Look in the popup window, you then need to hit the "update" button."

I didn't have this problem. I just had to wait a little longer than usual for the 1/4 bar to continue moving.


Taken from the following forum:
http://forum.pcmech.com/showthread.php?s=280e4ddf7c54ff5d42ab950f433439e7&p=1373508#post1373508
Thanks!!:)

Monday, March 10, 2008

MBA?

Top 3 EMBA's available in Singapore

Chicago GSB
Ranked 7
21 months US$102,000 plus GST
http://www.chicagogsb.edu/execmba/admissions/costs.aspx

Insead
Ranked 9
14 months €90.000
http://www.insead.edu/emba/financing/index.cfm

Rutgers Business School
Ranked 27
http://www.rutgers.sg/admissions.html
15 month US$48,000

Sunday, March 9, 2008

multi touch flash

http://ssandler.wordpress.com/my-software/
http://digitalvolvelles.wordpress.com/2008/02/27/using-tuio-to-connect-multi-touch-hardware-to-multi-touch-applications/
http://www.adobe.com/devnet/flash/articles/webcam_motion_05.html
http://www.actionscript.org/resources/articles/613/1/Camera-motion-controlled-ball/Page1.html
// save previous state
oldData.copyPixels( newData , newData.rect , new Point( 0 , 0 ) );
return differences;
http://www.rxsurface.blogspot.com/
http://www.tobytremayne.com/index.cfm/2007/3/4/Flex-2--Webcam-motion-tracking-part-3#comments
http://www.nastypixel.com/prototype/project/
http://newmovieclip.wordpress.com/2006/06/11/detect-and-locate-webcam-motion-in-flash-8/flash-motion-tracking/
Using grid to track gesture. what is the color range for skin?

Monday, February 11, 2008

using beta software that is restricted to the US only!

Being outside the USA Sucks!
I'm not able to use Yahoo GO! TV and other online or beta services. I managed to get it working with The Privacy Guards http://www.theprivacyguard.com/ when i changed my IP to one in the USA. However, this stupid software is unable to change it to the location that i desire and randomly assigns it to any country like Japan, Australia etc. Once in a blue moon i'm able to get my IP address to be in the States.
Anyone knows a better IP spoofer where I can specify where i want my IP address to be?

Friday, February 1, 2008

PS3 tricks

I am finally posting something about ps3. Hahaa found this 10 tricks for ps3 on this website. http://www.tech.co.uk/digital-home/general/blogs/2007/04/06/10-ps3-tricks-sony-doesnt-tell-you
The following 3 points are useful for me :)

2) The secret video reset
One of the most annoying aspects of the PS3 are its video settings. Take it up to the bedroom portable or round to a friend's house and there's a good chance that you won't be able to see anything onscreen because your 'new' TV is running at a different resolution or using a different cable connection. And - because you can't see anything - you can't change it. Until now. Shut down your PS3 then restart by pressing and holding the power button. This will reset your PS3 to its most basic 480p graphics mode so you'll be able to see enough to choose RGB SCART, component, HDMI or whatever from here.

9) Force a PS3 to show your files
Put your photos in a folder called 'PICTURE' or your videos in a folder called 'VIDEO' or simply *force* your PS3 to look at your files on your stick regardless of what you called them or where you put them. Insert your stick and go to the menu option you want (Photos, Music, whatever). Press Triangle to bring up a menu and choose Display All. This will show every file on the stick. It even works for a plugged-in iPod, though the multi-folder structure you'll reveal is a bit baffling. Still, your songs are in there if you've got the patience to find them.
10) Change your album art
When you import a music CD your PS3 automatically pulls down the album art and stores it with the tracks. Occasionally it gets it wrong, however, or it may simply not be able to find the art of your hipper, less commercial tracks. This is easily fixed however. Download a pic of the art you need as a jpg on your PC and put it onto a stick (in a folder called PICTURE, ideally). Copy it to your Photo menu (press Triangle). Now go to Music and select the album folder with the offending art. Press Triangle and select Information. Go to the Photo menu and select your new picture. Bingo.

4) Boost your WiFi
Slow downloads and dodgy PS3 connections? Try this... Firstly let's start with a bit of wireless networking 101. Try getting a direct 'line of sight' between your wireless router and your PS3. Pull them out both out from alcoves and behind dense furniture and try to minimise the number of obstacles between both boxes. (Nothing degrades your Wi-Fi signal like a nice stone fireplace....)

Next, stand your PS3 on its on end. The PS3's antenna is located in the right hand side so standing it up on its left-edge gives it a bigger spread. Ideally put your router up on a high shelf.

Finally - and this is the clever bit - take a Coke can (other soft drinks are available) and cut the top off. Cut down the sides of the cup-like can and fan out the divisions slightly so it looks like a weird metal flower. Now make a hole in the bottom and place your new 'high-gain antenna' over your router's stubby aerial so it pokes through. Now point it at your PS3. Sounds mad, looks awful, but you could see a 10% boost in signal strength.

----------------------
I have no idea how a coke can can boost signal strength. can anyone enlighten me ?

Virus removed!

I managed to find the exe file in my temp folder and i deleted it. The virus has not surfaced again ever since. The file name was us0105.exe. :)

Wednesday, January 30, 2008

Virus!

My McAfee virus scan picked up this irritating virus W32/Sality.ad!!!
Argh, i tried to clean it but found no removal instructions on the web except for sophos website but their removal tool didn't detect any virus. sigh. I tried searching for the related dll files and exe files and deleted them manually but the virus scan still picks it up.

Friday, January 25, 2008

Flash full screen

This website has a very cool function for flash.
http://julian.empiregn.com/2007/2/22/How-to-create-true-fullscreen-movies-with-Flash

Saturday, January 19, 2008

DNS server

I installed a DNS Server called Treewalk, and is able to redirect websites to my webpage in my computer. Even computers connected to my main computer will be redirected. I have disabled DHCP in a router connected to my main computer via LAN and turned on Internet Connection Sharing via dial-up with my GSM modem. Without the dial-up, there isn't an ICS in the LAN connection properties. Another method would be to install a wireless adapter and LAN will have the ICS option.

trustedinstaller.exe in vista

Trustedinstaller.exe was activated when I started wmplayer and realplayer together. After that, trustedinstaller.exe kept appearing and I couldn't play any DVD using wmplayer. After I uninstalled realplayer, restarted my computer and run wmplayer, trustedinstaller.exe was activated again. I decided to wait till it finishes using my resources then play a dvd. TrustedInstaller.exe disappeared soon after. :)

Thursday, January 17, 2008

HDMI to DVI to VGA

Doesn't work! HDMI is digital only.
I tried to connect my HDMI Output from my motherboard to a VGA dell monitor. There was no display and the graphics card didn't detect any display at all. Sigh.. need to find a dvi monitor.

Setting up the GSM/GPRS Modem

The worst software I have ever used and purchase is Mobilexdge 5.0. The registration is troublesome which requires you to email them your reg info which is derived from the license key on a piece of A4 sized paper that comes separately with the CD!
Well setting it up on a new computer is terrible.
Under device manager-> modems -> GPRS wireless modem
Modem properties: Extra Settings-> Extra initialization commands, you will need to add the following if you are using Singtel (Hi-cards do not work)

AT+CGDCONT=1,"IP","e-ideas" (or miworld or )
-Create a new network connection
-Username: 65(m1)65IDEAS(Singtel)
-Password: user123 (m1) IDEAS (Singtel)
-Dial: *99***1#

M1 Settings
• Homepage - http://mmsgw:8002/
• Bearer - GPRS• GPRS settings:
• IP address - 172.16.14.10 IP Port : 9201
• APN - miworld
• User ID - 65
• Password - user123
• MMS relaysrv. - http://172.16.14.20:8002/
• Proxy address: 172.16.1.23
Proxy protocol – HTTP
- Use proxy server – Yes
- Proxy server – 172.16.14.10
- Port number – 8080

(found these on the M1 Website)

WAP profile name: IDEAS WAP (GPRS)
WAP gateway IP: 165.21.42.84
Homepage title: SingTel IDEAS
Homepage URL: http://www.ideas.singtel.com
Security/authentication: OFF/ normal
APN (for WAP access): e-ideas
User-id: 65IDEAS
Password: IDEAS
Data Bearer: GPRS
GPRS connection: always attach/always on
TCP/IP: Use server assigned IP addresses
Name servers: Use server assigned IP addresses
Primary DNS: 0.0.0.0
Secondary DNS: 0.0.0.0
Port (for UP or OpenWave Browser phones): 9201
Proxy Settings: proxy.e-ideas.com.sg,
Port: 8080
Primary DNS: 165.21.83.88
Secondary DNS: 165.21.100.88
MMSC URL: http://mms.singtel.com:10021/mmsc
WAP gateway IP: 165.21.42.84
APN (for WAP access): e-ideas
User-id: 65IDEAS
Password: IDEAS

The following has to be in the mobilexdge.CFG file for singtel to work:
MOXRULES=3??

[SMSGW_STN_1]
COMPORT=5
MODEMSETTING=115200,N,8,1
TIMEOUT=1000
RECVINT=5
LOGENABLE=Y
LOGFILE=c:\MobileXdge\LOGFILES\Stn_1.LOG
ACTIVETIME=00:00-00:00
MM1MMSSVR=http://mms.singtel.com:10021/mmsc
GPRSPROFILE=SingTel
MM1WAPSVR=165.21.42.84
MM1WAPPORT=8080
MM1IP=165.21.42.84
MM1MASK=255.255.255.255
ASSIGNIP=10.23
STARTUP=Y

For Starhub :
[SMSGW_STN_2]COMPORT=2
MODEMSETTING=115200,N,8,1
TIMEOUT=1000
RECVINT=5
LOGENABLE=Y
LOGFILE=c:\MobileXdge\LOGFILES\Stn_2.LOG
ACTIVETIME=00:00-00:00
MM1MMSSVR=http://mms.starhubgee.com.sg:8002
GPRSPROFILE=Starhub
MM1WAPSVR=10.12.01.80
MM1WAPPORT=8080
MM1IP=10.12.0.0
MM1MASK=255.255.0.0
ASSIGNIP=10.17
STARTUP=N

For M1:
[SMSGW_STN_3]
COMPORT=3
MODEMSETTING=115200,N,8,1
TIMEOUT=1000
RECVINT=5
LOGENABLE=Y
LOGFILE=c:\MobileXdge\LOGFILES\Stn_3.LOG
ACTIVETIME=00:00-00:00
MM1MMSSVR=http://172.16.14.20:8002
GPRSPROFILE=M1
MM1WAPSVR=172.16.14.10
MM1WAPPORT=8080
MM1IP=172.16.0.0
MM1MASK=255.255.0.0
ASSIGNIP=172.
STARTUP=N

When Mobilexdge can send a test sms out and the database can't, try the following:
change MOXRULES=1 to MOXRULES=3
this uses 6.0 instead of .net framework.
Richard said that .net framework for 6.0 should be version 2.0 of .netframework.
I installed VS2005 but it doesn't seem to work.

Found this on their website as well................................

MobileXdge allows users to further customized the application to seamlessly integrate with any third party application through all kinds of protocols like database protocols, SNMP protocols, SMTP protocols, POP3 protocols, flat file protocols, external program activiation.

The Open source code of MOXRules is located in the sub folder "moxrules" of the installed directory of MobileXdge MMS/SMS/WAP Push Gateway, default is "c:\mobilexdge\moxrules".
You will be able to see a file named "MOXRules.vbp", open the file in VB6, and you will be able to customized the rules set to fits into your organisational needs.

Please be reminded that you will need to compile the MOXRules.vbp into MOXRules.dll and copy the compiled dll into you windows system directory.


MobileXdge Support Team

................................




To do a simple http redirect with your webpage: use the following html script:
(<) meta equiv="Refresh" content="5; URL=html-redirect2.html" (>)
where 5 is 5 secs to wait before going to the new page at html-redirect2.html

Took this from http://www.billstclair.com/html-redirect.html

"Evil Twin Access Points for Dummies"
http://airsnarf.shmoo.com/airsnarf4win.html
Cool Phlishing tutorial for hackers.

Wednesday, January 16, 2008

problem of the day

I need to turn my pc into a wifi router/AP. I have a WRT54GC connected via LAN to a PC. Sounds easy? the problem is I need to do a http redirect or nocatsplash to a webpage hosted on this PC for people who are connected to my AP.

Firmware solutions out there:
1) Openwrt, ewrt, dd-wrt, Chillispot etc... doesn't work with my router

Change the router:
I can't find a router that has this function. google and i can only find 3rd party firmware solutions. There were just mentions of turning ur $60 router to a $600 one.

WiFi card method:
1) Internet Sharing Connection in XP requires 2 network cards. I only have one physical LAN point connected to the router.
2) I tried connecting from computer to computer using the router when DHCP is disabled and I could ping. however, I used a DNS Server to do http redirect but only the host PC had the redirect correct. the client PC connected to the router via wifi didn't work. Learnt this from a hack website.
3) buy a wifi card but the router will be useless and range would be very poor. I dunno if the PC would be able to support 50 clients connected to it too.

PC as a router
1)PUBLICip - Free WiFi Solutions for Free WiFi Access
The ZoneCD turns your PC into a router and nothing else!?! useless except for the rag&bone man with loads of old PCs.
2) DHCP Daemon running on the host PC. (haven't tried this out yet.) but after issuing ip addresses what next ? how to redirect their requests?

First blog

I find that there is just too much information on the web that is relevant to me and they are all over the place! I need a place to find the stuff that I have done before so that I don't need to waste time finding it all over again when I need it. I have been writing notes on papers and on word documents but after a few months, they are just too tedious to organise and they're lying around somewhere on one of my office tables. (yes, I have 3 office tables.)
So, here I am.... keeping a blog on technology and other geeky stuff for my work.
Feel free to use the source codes or solutions found on this blog but don't forget to acknowledge my blog.
Cheers,
Chong