Custom Search

Saturday, November 27, 2010

Samsung Galaxy Tab M1 settings

Name: sunsurf internet
APN: sunsurf
Proxy: not set
Port: not set
User name: +65
Password: user123
Server: Not Set
MMSC: http://mmsgw:8002
MMS proxy: 172.016.014.010
MMS port: 8080
MCC: 525
MNC: 03
Authentication type: None
APN type: internet + mms


Friday, November 26, 2010

Flash Export to Quicktime mov

When exporting to Quicktime movie, make sure that there is no stop(); inside the as code. If there is, it will hang at "Recording Flash content".
This export function works for timeline written Flash and not purely AS written Flash. I exported a movie that loaded everything with Flash and it was only a clip that is half a second long. Therefore, you will have to specify the length of the movie manually.

Monday, August 30, 2010

php mail() function

When using smtp.gmail.com, gmail will automatically change the From: field to the account.

$receiverName = "receiver name";
$to = "to@hotmail.com";

$senderName = "sender name";
$senderEmail = "sender@hotmail.com";

$subject = "Hi $receiverName, Email From $senderName";

$fileatt = 'image.jpg';

$fileatttype = 'image/jpeg';

$fileattname = 'image.jpg';

$file = fopen( $fileatt, "r" );

$data = fread( $file, filesize( $fileatt ) );

fclose( $file );

$dataencode = chunk_split(base64_encode(file_get_contents('image.jpg')));

$mime_boundary='==Multipart_Boundary_x'.md5(mt_rand()).'x';

//reply to field allows the reply to one sender.
// but from field will still show 2 senders

$headers = "From: $senderEmail \r\n" .
"Reply-To: $senderEmail \r\n".
"MIME-Version: 1.0\r\n" .
"Content-Type: multipart/mixed;" .
"boundary=\"$mime_boundary\";\n\n"
;

$message = "--$mime_boundary\n";
$message .= "Content-Type: text/plain; charset=UTF-8\n";
$message .= "Content-Transfer-Encoding: 8bit\n\n";
$message .= "Thank You.\n\n";

$message .= "--$mime_boundary\n" .
"Content-Type: image/jpeg;\n" .
" name= image.jpg \n" .
"Content-Disposition: attachment;\n" .
" filename= $fileattname \n" .
"Content-Transfer-Encoding: base64\n\n" .
$dataencode . "\n\n" .
"--$mime_boundary--\n";
$message1 = "test";

$mail_sent = @mail( $to, $subject, $message1, $headers."From: $senderName<$senderEmail>");
//if the message is sent successfully print "Mail sent". Otherwise print "Mail failed"
echo $mail_sent ? "Mail sent" : "Mail failed";


Will result in the From field being your gmail regardless of what you key in.

However, if you use Yahoo email smtp server, the From: field will not be automatically changed and the result will be your desired one.

change the mail function to the following when using gmail smtp servers:

$mail_sent = @mail( $to, $subject, $message1, $headers."From: $senderName<$to>");

So that your default gmail account will not be seen. However, in the original message properties, it will still be shown for both yahoo and gmail.

Tuesday, August 17, 2010

smtp server settings

gmail

smtp.gmail.com
Port 465, Implicit TLS. Protocol always starts with TLS.

smtp.bizmail.yahoo.com
Port 25, Do not use TLS

smtp.mail.yahoo.com
Port 25, Do not use TLS

smtp.live.com
port 25, SSL enabled

Sunday, August 8, 2010

How to connect your iphone to your laptop wifi ad-hoc

Some hotels don't have wireless internet connection and they only have a wired LAN and unfortunately, iphone can't connect to the internet via the usb unlike windows mobile phones.

Here's how to setup a wireless adhoc network on windows xp and connect your iphone to your laptop to use the LAN.

Go to wireless network connection properties,

Add... a new Preferred networks:

Enter a new SSID, wireless network key of your choice,

Then click ok

Next, Highlight both your LAN and Wireless Network Connection

Right click and create a network bridge

Done!

You should see that your wireless Network Connection is not connected but the Network bridge is connected when you connect your phone.

This should work like a normal wireless router and no additional configurations should be needed on your phone.

Cheers!

Wednesday, February 24, 2010

opencv read xml file contents

I spent 1 hour trying to find out what was the problem of reading the contents of an xml file.

When reading a single parameter,

eg. 0

you have to use cvReadIntByName

When reading multiple parameters

eg. 0 30 200 10 3

you have to use CvSeq* s = cvGetFileNodeByName(fs,0,"calibration")->data.seq;

then cvReadInt( (CvFileNode*)cvGetSeqElem(s,index) );

My problem was I was reading a single parameter and I used the second method but specifying index = 0. This doesn't work! CvSeq* s returns rubbish when there is only 1 parameter.


Thursday, February 11, 2010

Create EXE from SWF

Create a new project Flex project
Application Type web application (not Desktop Application which becomes *.air)

In your Flex SDK folders you should see a 'runtimes\player\win\FlashPlayer.exe' which is a stand alone Flash player. Open your SWF with that and you'll see a 'Create Projector...' menu item in the File menu which will create the stand-alone EXE.


Tuesday, February 9, 2010

Get MAC Address

#include
#pragma comment(lib, "IPHLPAPI.lib")


static void GetMACaddress(void)
{
IP_ADAPTER_INFO AdapterInfo[16];
DWORD dwBufLen = sizeof(AdapterInfo);
DWORD dwStatus = GetAdaptersInfo(AdapterInfo,&dwBufLen);
assert(dwStatus == ERROR_SUCCESS);
PIP_ADAPTER_INFO pAdapterInfo = AdapterInfo;
char macaddress[13];
char tempmacaddress[3];
do{
sprintf(macaddress,"");
printf("%s",pAdapterInfo->AdapterName);
for(int i=0; iAddressLength;i++)
{
if(i== (pAdapterInfo->AddressLength -1))
{
sprintf(tempmacaddress,"%.2X",(int)pAdapterInfo->Address[i]);
strcat(macaddress, tempmacaddress);
//printf("%.2X\n",(int)pAdapterInfo->Address[i]);
}else{
sprintf(tempmacaddress,"%.2X",(int)pAdapterInfo->Address[i]);
strcat(macaddress, tempmacaddress);
//printf("%.2X-",(int)pAdapterInfo->Address[i]);
}
}
printf(macaddress);
pAdapterInfo = pAdapterInfo->Next;
}while(pAdapterInfo);
}

Wednesday, January 27, 2010

Windows 7 control panel in one folder

Create a new folder called:
GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}