New Trends

Mother Love


The photo "Mother Love in Earthquake" taken by Zou Sen wins the gold prize in War & Disaster News Singles in the 5th China International Press Photo (CHIPP) Contest held in Shanghai, China, from March 20 to 25, 2009. (Xinhua Photo)


AddThis Social Bookmark Button

C++ : Convert String to WChar and Vice Versa. ( WCHAR[260] ) to std::string etc. )

Visual Studio 2005, 2008 C++.

//String to WCHAR
std::wstring s2ws(const std::string& s)
{
int len;
int slength = (int)s.length() + 1;
len = MultiByteToWideChar(CP_ACP, 0, s.c_str(), slength, 0, 0);
wchar_t* buf = new wchar_t[len];
MultiByteToWideChar(CP_ACP, 0, s.c_str(), slength, buf, len);
std::wstring r(buf);
delete[] buf;
return r;
}

//WCHAR to String
std::string ws2s(const std::wstring& s)
{
int len;
int slength = (int)s.length() + 1;
len = WideCharToMultiByte(CP_ACP, 0, s.c_str(), slength, 0, 0, 0, 0);
char* buf = new char[len];
WideCharToMultiByte(CP_ACP, 0, s.c_str(), slength, buf, len, 0, 0);
std::string r(buf);
delete[] buf;
return r;
}

Ref: MSDN

AddThis Social Bookmark Button

Restart Windows Server 2003 from the command line

By Derek Schauland , Special to ZDNet Asia
Tuesday, January 22, 2008 03:01 PM

There is a quick workaround that restarts the Windows Server 2003 computer, without having to handle power cords or the power switch.

The Windows Server 2003 computer you are working on will not shut down. You don't have any luck using the Start menu or the [Ctrl][Alt][Delete] methods, and you need to restart the server as quickly as possible. There is a quick workaround that gets the job done--and you don't even have to handle power cords or the power switch.

From the command line, you can shut down or reboot any Windows Server 2003 computer (or even Windows XP or Vista machines) with the Shutdown.exe command. (Note: The exe file extension is optional for the Shutdown command.) Shutdown.exe contains a number of switches that allow you to specify different actions for the server when the Shutdown command executes. The Shutdown.exe switches are as follows:

/? Displays the Help listing
/i Displays the graphical user interface (GUI); it must be the first option
/l Logs off the current user; it cannot be used with the /d or /m options
/s Shuts down the computer
/r Shuts down and restarts the computer
/g Shuts down and restarts the computer and then restarts any registered applications
/a Aborts system Shutdown
/p Turns off the local computer with no timeout or warning
/h Hibernates the local machine
/e Documents the reason for shutting down the computer
/m Specifies the target computer; it is used with \\computername
/t xxx Where xxx is the number of seconds before Shutdown
/c "comment" Where "comment" is the reason for the Shutdown or restart
/f Forces running applications to close without warning users
/d [p|u:]xx:yy Provides the reason for the Shutdown action: p = planned; u= unplanned; xx supplies the major reason code; yy = supplies the minor reason code

When you enter a Shutdown with no arguments, the Help listing will display. The Help listing also includes the reason codes available for use with the /d switch. The reason codes are shown below:

Reasons on this computer:

E=Expected U=Unexpected P=Planned c=Customer Defined
Type Major Minor Title





U

0

0

Other(Unplanned)
E

0

0

Other(Unplanned)
EP

0

0

Other(Planned)
U

0

5

Other Failure: System Unresponsive
E

1

1

Hardware: Maintenance(Unplanned)
EP

1

1

Hardware: Maintenance(Planned)
E

1

2

Hardware: Installation(Unplanned)
EP

1

2

Hardware: Installation(Planned)
P

2

3

Operating System: Upgrade (Planned)
E

2

4

Operating System:
Reconfiguration (Unplanned)
EP

2

4

Operating System:
Reconfiguration(Planned)
P

2

16

Operating System:
Service Pack (Planned)
U

2

17

Operating System:
Hotfix (Unplanned)
P

2

17

Operating System:
Hotfix(Planned)
U

2

18

Operating System:
Security Fix(Unplanned)
P

2

18

Operating System:
Security Fix(Planned)
E

4

1

Application: Maintenance(Unplanned)
EP

4

1

Application: Maintenance(Planned)
EP

4

2

Application: Installation(Planned)
E

4

5

Application: Unresponsive
E

4

6

Application: Unstable
U

5

15

System Failure: Stop Error
E

5

19

Security Issue
U

5

19

Security Issue
EP

5

19

Security Issue
E

5

20

Loss of Network Connectivity
(Unplanned)
U

6

11

Power Failure: Cord Unplugged
U

6

12

Power Failure: Environment
P

7

0

Legacy API Shutdown

You can use many of these switches in conjunction with one another when issuing the Shutdown command. A usage example for the Shutdown command follows:

Shutdown /r /c "Hanging Application or service" /t 30

This example would restart the local machine storing the comment provided with the /c switch. Windows would wait 30 seconds before initiating the restart. You might also create a batch file to use when it is necessary to restart a server in a remote location. The batch file might look like this:

Shutdown /m \\computername /r /c "Remote Restart" /t 45

By saving this command in a batch file, it can save you time if you routinely restart the same remote server.

Inspirational...

http://www.healthbolt.net/2007/09/20/professors-gives-final-lecture/
http://www.abcnews.go.com/GMA/TenWays/story?id=3680950&page=1
http://online.wsj.com/article/SB119084081673940375.html?mod=googlenews_wsj



AddThis Social Bookmark Button

Being Stupid And Litigious Is No Way To Go Through Life - Michael Arrington

In the past we’ve posted communications whenever someone has threatened to sue us. I think it’s entertaining, and it hopefully makes people think twice before firing up the legal machine with ridiculous claims. So when YouTube sent us a cease and desist letter, I posted it. And when that asshole Shannon Terry threatened to sue us out of existence, I posted that too.

Now the most ridiculous claim yet. Richard Figueroa, who claims to have the rights to this image of Ashton Kutcher, is demanding that we pay him $150,000 immediately or else he’ll sue us for $1.5 million.

Hi Michael, My name is Richard Figueroa and I am contacting you on behalf of the image you are using of Ashton Kutcher that Beth Boldt had taken. Beth is upset that your company has been using his image to generate traffic and revenue to your company without her permission.We are asking that you pay Beth $150,000,00 for the image that you have been using to generate business. If you choose not to settle this bill now we will ask for $1,500,000 in damages in loss of income form the image you have been borrowing for creating traffic to your website with here picture.if you google Beth Boldt you will get an idea of who she is in the modeling and entertainment industry.We would like to settle this quietly without the media getting involved however if you choose not to agree on these terms we will file a lawsuit against your company for copyright violation and we all know how that’s going to turn out since she’s the photographer of the image you are using.
So here is her invoice: Please make check out to Beth Boldt in the amount of ($150,000,00) send it to
[deleted contact information]
And after payment is made you may not use the image of Ashton anymore unless you want to negotiate a contract.

Thank you
Richard Figueroa
BethBoldt

Here’s the problem: we never used that image of Ashton Kutcher on any of our websites. The one image we did use (in this post) was supplied by Ooma (Kutcher is the creative director for Ooma), and Ooma says they own that image.

The problem turns out to be that if you do a search on Google (or “the Google” as Figueroa calls it), the image in question appears at the top of the results and is linked to TechCrunch. Why? Well we did some digging and it turns out that someone linked to the image in a comment to one of our posts.

I explained all of this to Figueroa on the phone but he insisted that Google bought us and that we need to remove the image from Google immediately. Sadly, Google has not acquired us, and I have no easy method for removing images from Google’s servers.

Normally I’d just let something like this drop since this guy doesn’t understand anything about copyright law or the Internet, but he has also been calling and emailing our advertisers and threatening to sue them, too (listen to the voicemail below). They are understandably concerned, and Heather and I now have to spend time today calming everyone down.

Don’t be this guy.

The voicemail below is to one of our advertisers. Listen to a second one, sent to Ooma, here.

Update: Starting at comment #79 below it looks like Richard weighs in with a number of comments. In comment no. 113 he tried to post my phone number and get people to call me and complain but I just deleted it.

Update 2:
Richard has been calling me this evening saying people are crank calling him and that he will take “legal activation” against everyone who calls him. I’ve removed the phone number above. Please stop calling him because he just calls me afterwards.

Update 3: So the link to TechCrunch on Google’s search results is gone and the picture now links to Yahoo Answers. Richard still isn’t happy and is demanding I link that search result to him. I’m just speechless.