Thursday, September 10, 2009

Free SMS

http://www.160by2.com
http://www.way2sms.com

Friday, September 4, 2009

Setting Default OS to boot in Vista and Windows 7

To set the default OS (in case of dual boot Windows OS) to be either Vista or Windows 7, do the following
1. Click "My Computer" - > Properties (You can also go here from "Control Panel"->"System")

2. Click on "Advanced System Settings" on the left side panel (This will open "Advanced" tab in "System Properties" dialog)


3. Click on "Settings" of "Startup and Recovery" group


4. Select the "Default Operating System" in "System Startup" group

Cannot open Control Panel or My Computer Properties

If you are using Vista or Windows 7, and if when you try to open Control Panel or "My Computer"->Properties, sometimes it wont open it. It appears to be loading for few seconds and after that it wont load.
This is due to the corrupted .cpl files.

To resolve this issue, do the following

1. Type "services.msc" in the run command
2. Restart "Software Licensing" service

Now you should be able to open the Control Panel and My Computer Properties.

Thursday, September 3, 2009

Socket Programming - ASYNCHRONOUS

What is Asynchronous Socket Programming?
  • "Event-driven" programming or "select()" based multiplexing
  • A concept of "handling" multiple connections in "single thread/process"
When do we need this?
  • Assume you have to write a server that will be "hit" by "n" number of clients with some requests
  • You would prefer any of the follow
  • synchronous: you handle one request at a time, each in turn.
    pros: simple
    cons: any one request can hold up all the other requests
  • fork: you start a new process to handle each request.
    pros: easy
    cons: does not scale well, hundreds of connections means hundreds of processes.
    fork() is the Unix programmer's hammer. Because it's available, every problem looks like a nail. It's usually overkill
  • threads: start a new thread to handle each request.
    pros: easy, and kinder to the kernel than using fork, since threads usually have much less overhead
    cons: your machine may not have threads, and threaded programming can get very complicated very fast, with worries about controlling access to shared resources.
  • The best solution would be "select" system call.
How "select" works?
  • The normal heirarchy of socket programming calls in the server side would be "socket()->bind()->listen()->accept()".
  • If you notice, here "accept" is the blocking call. In order to avoid this blocking stuff, we use "select" which will "run" through all the connected sockets to check if there are any requests pending for "reading, writing or error conditions".
  • If any requests pending, "select" will return the number of requests pending to be processed.
  • Hence the heirarchy would be "socket()-> bind()->listen()->select()->accept()"
  • But here the disadvantage is that, we need to iterate through all the "connections" (descriptors) connected to check "Are you the one with pending requests?" questions.

To diable Firewall

1. Run "services.msc" in command prompt
2. Go to "Windows Firewall"
3. Right click - > Properties. Then you stop it.
4. Then you "disable" it in the startup type and then exit.

Wednesday, September 2, 2009

Socket Programming

SOCKET:

Glibc, SVN and Qt

SUSE:
Installation Guidelines: http://doc.trolltech.com/4.4/install-x11.html
SVN:

unresolved external symbol

































unresolved external symbol __imp___CrtDbgReportW:
1. When u get this error, go to visual studio project settings -> C/C++ ->
Code Generation -> RunTime Library has the "debug" enabled (ex: Multi Threaded Debug DLL).
If not enabled, enable it and rebuild again.
2. Also check if Linker->Debugging->Generate Debug Info is on or not