Thursday, March 17, 2011

VS Express Edition - Start external program solution

"As you've noticed, this functionality is not available in Express. This is one of the many places where the IDE has been simplified..." words of Luke Hoban on social.msdn.microsoft.com.

It's not simplyfication, it is just taking away basic functionality and getting money from users. The postbuild event idea is not bad, but will start the application every time and I am not sure about debugging, if you need to attach to a process or it is done automatically. Here comes a solution, you need to edit the .user file of your project: .vcproj.user for C++ or .csproj.user for C#, probably similar for VB.

For C++ find a Configuration and edit|add DebugSettings:


<debugsettings
Command="C:\Program Files\Adobe\FrameMaker7.1\FrameMaker.exe"
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine=""
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor="0"
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>


C#:

<project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<propertygroup condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<startaction>Program</startaction>
<startprogram>C:\Program Files\Adobe\FrameMaker7.1\FrameMaker.exe</startprogram>
<startarguments/>
<startworkingdirectory/>
</propertygroup>
</project>



Good luck debugging your libraries with Express edition.

Wednesday, March 2, 2011

Instantchess reset free game limit

Ever wondered how they are doing (instantchess dot com)? Changing the nick soes not help. It works from the same network but different computers. So it is not filtered on IP. Cookies? Good one, but no! And that didn't let me sleep. Flash cookies!!! Very smart. Will not tell you how to clear those beauties but Google will show you the proper Macromedia page.

Oh, on the other hand any person familiar with web and flash, or just a well informed person knows things like this. Companies like to hide things in flash/cookies and many times they are also harnessing this feature. So just spreading common knowledge, think people, smart things make you stupid!

Workplace: they started to monitor internet browsing - solution

Hi, my employer or rather those beautiful administrators decided to monitor internet browsing, to reduce the network traffic. They were monitoring it even before, but not officially and were doing it only to add pages to blacklist. I'm so happy, now the 2Mb connection will be like Pegasus, flying when needed. Of course not.

But what to do when you are bored or asking for tasks is not the way to getting promoted :)
Fortunately we are intensively using virtual machines for different purposes, VMware. Set the network to bridged, that way you access your network directly and they will have no way to get to you, they will see only the ip and the name of the virtual machine (change it) :) Happy browsing anonymously and till admins will find a way (if exists, probably yes) to associate virtual machines to real ones :)

You know this is not ethical ;)

Uploading large files using HTTP PUT in .NET

Hi,

another tech blog to share my struggle with HTTP PUT. C# offers many ways to upload files, the simplest is using WebClient, however it failed with out of memory on large files.

During the testing I received many different problems
  • System.NotSupportedException: The stream does not support concurrent IO read or write operations.
  • System.OutOfMemoryException
  • The server committed a protocol violation. Section=ResponseStatusLine
  • And few more I forgot but will add later, maybe...
Out of memory:
HttpWebRequest request = new ...
request.SendChunked = true;

Concurrent IO operations:
HttpWebRequest request = new ...
request.AllowWriteStreamBuffering = false;

Protocol violation:
Create a web.config file near your exe with useUnsafeHeaderParsing=“true“, search web how to do that properly. But that was not acceptable in our case as we had both source codes, client and server. The server was not sending response or not a standard response with proper headers. So after uopload we removed the wait for a response:

HttpWebResponse response = (HttpWebResponse)request.GetResponse()

Hope I helped, good luck.

Tuesday, March 1, 2011

ph-art

Making traffic and links for a friend, have a look at it: ph-art :)