Custom Search

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}

Wednesday, December 9, 2009

How do I recover my Joomla admin password?

How do I recover my Joomla admin password?

this work with Joomla 1.0 and Joomla 1.5

If you know the email address that was used, the simplest thing is to do is to use the "lost password" Front-end function if you have made it available.

If not, you will need access to the MySQL database.

You have two choices, either add a new super administrator or change the password stored in the data base. To do this you need to go to phpMyAdmin (or use a similar tool) and manually edit the database. Before doing this back up our complete database.

Run this to create a new user known as admin2.

INSERT INTO `jos_users` VALUES      (62, 'Administrator2', 'admin2', '  your-email@email.com This e-mail address is being protected from spambots. You need JavaScript enabled to view it  ', '21232f297a57a5a743894a0e4a801fc3',       'Super Administrator', 0, 1, 25, '2005-09-28 00:00:00', '2005-09-28 00:00:00', '', ''); INSERT INTO `jos_core_acl_aro` VALUES (10,'users','62',0,'Administrator2',0); INSERT INTO `jos_core_acl_groups_aro_map` VALUES (25,'',10); 

The password will be admin. Immediately log in and change this password.

Or

You can change the password in the table for your admin user (assuming you never changed the user name; if you have just change the instructions below to .

The password is stored in the MySQL database jos_users table password field. (change this for your table prefix if different)

Open the table, find your admin username, and then select that row for editing.

The password must be hashed, you cannot simply enter text into this field.

Set the password to a known value

- password = "this is the MD5 hashed password" ------------------------------------------------------ - admin  = 21232f297a57a5a743894a0e4a801fc3 - secret = 5ebe2294ecd0e0f08eab7690d2a6ee69 - OU812  = 7441de5382cf4fecbaa9a8c538e76783 

Paste the hashed password into the field, save the change, and log-in using the new password. Immediately change your password to something more secure!

Thursday, December 3, 2009

localhost not recognised in Windows Vista

The standard way to resolve that is to find the hosts file
and map your loopback address ( 127.0.0.1 ) to "localhost".

There's an issue connected to doing that on Vista.

The hosts file is considered a system file by Vista.
You have to first take ownership of it then grant yourself full control.

These are the two commands that you need to run from an elevated command prompt.
(Right click "command prompt" and choose "Run as Administrator") :

1.
takeown /f c:\windows\system32\drivers\etc\hosts

2.
icacls c:\windows\system32\drivers\etc\hosts /grant yourusername:f

If you installed to a drive other than "c:", modify accordingly, of course.

Now you can open the file with notepad, insert this line and save the hosts file
( make sure it doesn't acquire a .txt extension ) :

127.0.0.1 localhost

If that doesn't fix it, you have a bad install of the TCP/IP stack.


Copied from Juan T. Llibre, asp.net MVP