tag:blogger.com,1999:blog-109791782024-03-06T13:34:16.608+05:30Corner HouseAgnel Kurian's programming rough book.Agnel CJ Kurianhttp://www.blogger.com/profile/02108024180511317456noreply@blogger.comBlogger47125tag:blogger.com,1999:blog-10979178.post-89799922710070889102011-04-10T20:53:00.003+05:302011-04-10T21:00:04.595+05:30Goodbye @googlechrome<ol><li>After all these years your "awesome bar" still doesn't <a href="http://www.google.com/support/forum/p/Chrome/thread?tid=12c8d3a634ce988d&hl=en">match substrings in URLs and page titles</a>.</li><li>You download and install updates without even asking. Who do you think paid for this machine?</li><li>@Opera has a real "awesome bar".</li></ol><div class="blogger-post-footer">Deep in the fundamental heart of mind and universe there is a reason. -- Douglas Adams</div>Agnel CJ Kurianhttp://www.blogger.com/profile/02108024180511317456noreply@blogger.com0tag:blogger.com,1999:blog-10979178.post-49549458391404383542011-03-07T21:22:00.004+05:302011-03-07T21:38:53.296+05:30Windows 7 AnnoyanceJust one example...<div><br /></div><div><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieJa70V4-NbcB-mDaC7fprcW6ZRJmiRmwL2oaDTGjYnX3KlcMUmnVp3hwerqiHkoFRiBdbkmr7Ue5qCUdetis52q0UFDeqVv-fznu2WKUFusOcT6rFwJsvSDJTo9qt6ROQFTVfTA/s1600/check_later.png"><img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 320px; height: 273px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieJa70V4-NbcB-mDaC7fprcW6ZRJmiRmwL2oaDTGjYnX3KlcMUmnVp3hwerqiHkoFRiBdbkmr7Ue5qCUdetis52q0UFDeqVv-fznu2WKUFusOcT6rFwJsvSDJTo9qt6ROQFTVfTA/s320/check_later.png" alt="" id="BLOGGER_PHOTO_ID_5581370242599501362" border="0" /></a><br /><br />What's with "Check later", Einstein? What about "Check now"?<br /></div><div class="blogger-post-footer">Deep in the fundamental heart of mind and universe there is a reason. -- Douglas Adams</div>Agnel CJ Kurianhttp://www.blogger.com/profile/02108024180511317456noreply@blogger.com0tag:blogger.com,1999:blog-10979178.post-13035364993081471962010-11-29T00:19:00.003+05:302010-11-29T00:25:48.395+05:30Video Lectures Online - Part 1Stanford University on YouTube: http://www.youtube.com/user/StanfordUniversity<br /><br />Massachusetts Institute of Technology on YouTube: http://www.youtube.com/MIT<br /><br />Indian Institute of Technology on YouTube: http://www.youtube.com/iit#g/p<div class="blogger-post-footer">Deep in the fundamental heart of mind and universe there is a reason. -- Douglas Adams</div>Agnel CJ Kurianhttp://www.blogger.com/profile/02108024180511317456noreply@blogger.com0tag:blogger.com,1999:blog-10979178.post-39585621207385976882010-07-28T11:26:00.004+05:302010-07-28T11:31:50.736+05:30Reversing the Order of Lines in a File<pre><br />//<br />// reversor.js<br />//<br />// Reverses order of lines in a file<br />//<br />// Execute on Windows as:<br />// cscript reversor.js input.txt > output.txt<br />// ------------------------------------------------ <br /><br />var args = WScript.Arguments;<br />if(args.length != 1)<br /> WScript.Quit();<br /><br />// don't use square brackets below...<br />// args is not an array/dictionary<br />var in_file = args(0); <br /><br />var f;<br />var lines = new Array();<br />var fso = new ActiveXObject("Scripting.FileSystemObject");<br /><br />var i = 0;<br />var fin = fso.OpenTextFile(in_file);<br /><br />while(!fin.AtEndOfStream)<br /> lines[i++] = fin.ReadLine();<br />for(i = lines.length - 1; i >= 0; --i)<br /> WScript.StdOut.WriteLine(lines[i]);<br /><br />fin.Close();<br /></pre><div class="blogger-post-footer">Deep in the fundamental heart of mind and universe there is a reason. -- Douglas Adams</div>Agnel CJ Kurianhttp://www.blogger.com/profile/02108024180511317456noreply@blogger.com0tag:blogger.com,1999:blog-10979178.post-30297607424587086082010-04-15T20:41:00.021+05:302010-04-16T23:49:36.653+05:30Installing Trac (mod_wsgi, Apache 2.2, Python 2.6, PostgreSQL 8.4) on Windows XP<h2>Installation</h2><br />
Too many pieces to put together here. The following components of the installation are available as Windows installers; just download and install them in the order listed before continuing with the rest:<br />
<br />
<a href="http://mirror.olnevhost.net/pub/apache/httpd/binaries/win32/httpd-2.2.15-win32-x86-openssl-0.9.8m-r2.msi">Apache 2.2</a><br />
<a href="http://python.org/ftp/python/2.6.5/python-2.6.5.msi">Python 2.6</a><br />
<a href="http://downloads.enterprisedb.com/postgresql/postgresql-8.4.3-1-windows.exe">PostgreSQL 8.4</a><br />
<a href="http://subversion.tigris.org/files/documents/15/46906/Setup-Subversion-1.6.6.msi">subversion 1.6.6</a><br />
<a href="http://subversion.tigris.org/files/documents/15/46888/svn-python-1.6.6.win32-py2.6.exe">svn-python a.k.a Python subversion bindings</a><br />
<a href="http://www.stickpeople.com/projects/python/win-psycopg/#Version2">psycopg</a><br />
<br />
<h3>Creating the PostgreSQL database</h3>Launch pgAdmin III (Start > All Programs > PostgreSQL 8.4 > pgAdmin III). In the pane to the left of the window, right-click your PostgreSQL database (usually labelled "PostgreSQL 8.4 (localhost:5432)") and select "Connect". Supply the password. The tree expands to list all objects in this database.<br />
<br />
Right click on the "Login Roles" node and select "New Login Role...".<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiC7XL6WbvdI0k9kzI07FPMA6yUBXfjFpLeD3FffjanlWzOWYyiXitcUPnwu_odZDI_X4fNRIcnr_rmW7uupQnlMqmteHcRqOJF0hOrff2eeNjYAv4Obr0APewikho1uqIhpdtk6Q/s1600/new_role.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiC7XL6WbvdI0k9kzI07FPMA6yUBXfjFpLeD3FffjanlWzOWYyiXitcUPnwu_odZDI_X4fNRIcnr_rmW7uupQnlMqmteHcRqOJF0hOrff2eeNjYAv4Obr0APewikho1uqIhpdtk6Q/s320/new_role.png" width="274" /></a></div><br />
Fill out the fields to create a new role.<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKq8tufbLvfbB8yGSBCkiRvHAYe9ZnGwfm0MRqqxurGkuqaW9UBx78tJFnc2HH9-rXM2C8-zrD_XaO0WLxJtMu2tNpgy-ImTsVEITpBbtzmFpe4hzT-DY_E5qUT78kx65RBEBPyQ/s1600/new_role_detail.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKq8tufbLvfbB8yGSBCkiRvHAYe9ZnGwfm0MRqqxurGkuqaW9UBx78tJFnc2HH9-rXM2C8-zrD_XaO0WLxJtMu2tNpgy-ImTsVEITpBbtzmFpe4hzT-DY_E5qUT78kx65RBEBPyQ/s320/new_role_detail.png" width="295" /></a></div><br />
Right click on the "Databases" node and select "New Database...".<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3LhgveGt0bTcLV1KWGvw9U37U8NsADz4-ShROzqj3LkhI7HQtlw4GM-GfObSifpb60HZPBOxRkcBPyxQbNqWH0nJW8JMkaOvhuQGyao-VQJQSUEF91hPAESam-Kno-kXtqpbczQ/s1600/new_database.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3LhgveGt0bTcLV1KWGvw9U37U8NsADz4-ShROzqj3LkhI7HQtlw4GM-GfObSifpb60HZPBOxRkcBPyxQbNqWH0nJW8JMkaOvhuQGyao-VQJQSUEF91hPAESam-Kno-kXtqpbczQ/s1600/new_database.png" /></a></div><br />
Fill out the fields to create a database for Trac to use. Set the owner to the same user created in the previous step as a security measure.<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_zibWmqef44sJsSf_VH6twkJPn3-EAXJFnQmUJ3zwYqN51n1lejbXqqDWwt7K6PImjxxoUL58DakL3DF3EFNmU_42BsnXADJNsI543RRK-ealxzBm7nJ2X4YGwTQ-84jUjGeZ8w/s1600/new_database_detail.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_zibWmqef44sJsSf_VH6twkJPn3-EAXJFnQmUJ3zwYqN51n1lejbXqqDWwt7K6PImjxxoUL58DakL3DF3EFNmU_42BsnXADJNsI543RRK-ealxzBm7nJ2X4YGwTQ-84jUjGeZ8w/s320/new_database_detail.png" width="218" /></a></div><br />
<h3>Installing Trac</h3><a href="http://ftp.edgewall.com/pub/trac/Trac-0.11.7.win32.exe">Trac 0.11.47</a><br />
<br />
<h3>Installing mod_wsgi</h3>Download <a href="http://modwsgi.googlecode.com/files/mod_wsgi-win32-ap22py26-3.0.so">mod_wsgi-win32-ap22py26-3.0.so</a> to a temporary directory. Rename the file to mod_wsgi.so and copy it to the modules subdirectory of your Apache installation (usually C:\Program Files\Apache Software Foundation\Apache2.2\modules).<br />
<br />
Locate httpd.conf under the conf subdirectory of the Apache installation (usually C:\Program Files\Apache Software Foundation\Apache2.2\conf) and open it in a text editor. Find the lines starting with LoadModule and insert the following line there:<br />
<pre> LoadModule wsgi_module modules/mod_wsgi.so
</pre><br />
<h2>Creating a Trac Site</h2><h3>Creating a Trac instance/site:</h3>Run the following command from the command prompt:<br />
<pre> trac-admin path-to-desired-location initenv
</pre><br />
Note that you may have to specify the full path to <code>trac-admin</code> as shown here:<br />
<pre> c:\python26\scripts\trac-admin path-to-desired-location initenv
</pre><br />
You will be prompted for the following:<br />
<ul><li>Project Name<br />
<li>Database connection string<br />
<li>Repository type<br />
<li>Path to repository<br />
</ul>
For the database connection string, use the following format:
<pre> postgres://user:pass@localhost:5432/dbname?schema=schemaname
</pre>
If you are following the strings from the screenshots, the corresponding connection string would be:
<pre> postgres://testtrac:password@localhost:5432/testtrac?schema=testtrac
</pre>
This will create your Trac site. You can do a trial run by saying:
<pre> tracd --port 8000 trac-site-location
</pre>
...and then visiting http://localhost:8000/ using your web-browser.
<h3>Configuring mod_wsgi for the site</h3>Run the following command at the command prompt. Replace "temporary-directory" with the name of a temporary folder where the required scripts for your Trac site will be generated.
<pre> trac-admin trac-site-location deploy temporary-directory
</pre>
This command will create two folders within "temporary-directory" -- <code>cgi-bin</code> and <code>htdocs</code>. You will find the properly configured WSGI script for your site in <code>temporary-directory\cgi-bin\trac.wsgi</code>. Open the trac.wsgi in a text editor, prefix all path strings using the back-slash ('\') with the letter 'r'. For example, if you find this:
<pre> environ.setdefault('trac.env_path', 'C:\MyProject\Trac\ExampleSite')
</pre>...prefix the path string with the letter 'r' like this:
<pre> environ.setdefault('trac.env_path', r'C:\MyProject\Trac\ExampleSite')
</pre>
I am assuming this to be a bug with how Trac works on Windows paths. Read about Python's raw strings to find out more about this.
Create a folder called <code>apache</code> within your Trac site and copy the generated <code>trac.wsgi</code> there.
Open httpd.conf, scroll to the bottom and add the following there:
<pre> WSGIScriptAlias /trac "trac-site-location/apache/trac.wsgi"
<Directory "trac-site-location/apache">
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
Allow from all
</Directory>
</pre><div class="blogger-post-footer">Deep in the fundamental heart of mind and universe there is a reason. -- Douglas Adams</div>Agnel CJ Kurianhttp://www.blogger.com/profile/02108024180511317456noreply@blogger.com0tag:blogger.com,1999:blog-10979178.post-15895807739116605352010-03-02T20:07:00.000+05:302010-03-02T20:07:37.130+05:30Why can't I resize this window?<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbReWSI4HJLQ9EPdk_Zdz2zm5aoeXLY3pKfHbLwDEYcOZEzc7-9ivboovqd5_AjGlReN5pVajtvW06Pzrrj09wCefBAHXBYDtx_ogC665hTtXS8kjKCMExmsMwLHjHuXM4uIWFjw/s1600-h/why.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="436" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbReWSI4HJLQ9EPdk_Zdz2zm5aoeXLY3pKfHbLwDEYcOZEzc7-9ivboovqd5_AjGlReN5pVajtvW06Pzrrj09wCefBAHXBYDtx_ogC665hTtXS8kjKCMExmsMwLHjHuXM4uIWFjw/s640/why.png" width="640" /></a></div><br />
Who should be held responsible for this ...abomination?<div class="blogger-post-footer">Deep in the fundamental heart of mind and universe there is a reason. -- Douglas Adams</div>Agnel CJ Kurianhttp://www.blogger.com/profile/02108024180511317456noreply@blogger.com0tag:blogger.com,1999:blog-10979178.post-36173911575719667452010-02-17T21:08:00.001+05:302010-02-17T21:23:40.914+05:30Project with 2 CPP files with the same name in different folders.This comes as a surprise. I have a C++ project in which the code has been split across several folders. I have two .CPP files of the same name (utility.cpp) in two different folders. The content in the files is not the same. Different symbols defined in each. Sounds like this should work without a hitch, right?<br />
<br />
I'm not yet sure of this but it looks like there is no straightforward way to do this in VS2008. Both files are compiled to the same output folder. It looks like the compiler (cl.exe) compiles both .CPP files to the same .OBJ file. So, the last compiled .CPP wins. By the time the linker (linker.exe) reaches the scene, only the symbols defined in the last compiled .CPP are available and the linker fails giving you "LNK2028: unresolved token".<br />
<br />
I looked at VS2008 options to see if there was a way to include the relative path of the source file as part of the compiler's output file path, but so far I have not been successful.<br />
<br />
Here's the <a href="http://stackoverflow.com/questions/2281532">related post</a> on <a href="http://stackoverflow.com/">stackoverflow.com</a>.<div class="blogger-post-footer">Deep in the fundamental heart of mind and universe there is a reason. -- Douglas Adams</div>Agnel CJ Kurianhttp://www.blogger.com/profile/02108024180511317456noreply@blogger.com0tag:blogger.com,1999:blog-10979178.post-36040520064432816472009-08-27T21:52:00.000+05:302009-08-27T21:52:14.408+05:30Dots != Pixels...atleast in the case of printers when accessed via GDI+ in .NET. For example, when a printer reports a DpiX of 600 and you say:<br />
<br />
<span style="font-family: 'Courier New', Courier, monospace;">g->DrawLine(Pens::Black, 0.0f, 50.0f, 600.0f, 50.0f);</span><br />
<br />
...the line drawn goes about three-fourths of the way across an A4 page. Some smart guy somewhere decided that it would be great to use a 1/100 inch co-ordinate system for printers so that the drawing routines used for video output would produce more or less the same size on the printer as well.<div class="blogger-post-footer">Deep in the fundamental heart of mind and universe there is a reason. -- Douglas Adams</div>Agnel CJ Kurianhttp://www.blogger.com/profile/02108024180511317456noreply@blogger.com0tag:blogger.com,1999:blog-10979178.post-80171085164783343892009-08-19T19:43:00.000+05:302009-08-19T19:43:01.778+05:30Typing Tutor<a href="http://www.keybr.com/">This</a> is probably the best typing tutor I have seen so far.<div class="blogger-post-footer">Deep in the fundamental heart of mind and universe there is a reason. -- Douglas Adams</div>Agnel CJ Kurianhttp://www.blogger.com/profile/02108024180511317456noreply@blogger.com0tag:blogger.com,1999:blog-10979178.post-42365041077524661372009-08-15T12:53:00.002+05:302009-08-15T12:56:30.218+05:30Drawing an image with Alpha in .NETThis is how it is done: <a href="http://msdn.microsoft.com/en-us/library/w177ax15(loband).aspx">How to: Use a Color Matrix to Set Alpha Values in Images</a>. There is an error on that post: it mentions <a href="http://msdn.microsoft.com/en-us/library/system.drawing.graphics.drawstring.aspx">DrawString</a> in one place instead of <a href="http://msdn.microsoft.com/en-us/library/system.drawing.graphics.drawimage.aspx">DrawImage</a>.<br />
<br />
The key is to use one of the overloads of <a href="http://msdn.microsoft.com/en-us/library/system.drawing.graphics.drawimage.aspx">DrawImage</a> which takes an <a href="http://msdn.microsoft.com/en-us/library/system.drawing.imaging.imageattributes.aspx">ImageAttributes</a> object as a parameter.<br />
<br />
One thing I don't understand is that the following call fails if <code>srcUnit</code> is specified to be <code>GraphicsUnit::Display</code>.<br />
<br />
<pre>g->DrawImage(image, imgDest, srcRect,
GraphicsUnit::Pixel, imgAttr);</pre><div class="blogger-post-footer">Deep in the fundamental heart of mind and universe there is a reason. -- Douglas Adams</div>Agnel CJ Kurianhttp://www.blogger.com/profile/02108024180511317456noreply@blogger.com0tag:blogger.com,1999:blog-10979178.post-64702429699674873962009-07-09T15:35:00.004+05:302009-07-09T15:57:54.082+05:30Microsoft Connect GemsMy favorites from <a href="http://connect.microsoft.com/">connect.microsoft.com</a>. They really <i>have</i> managed to connect with my sense of humour. I wonder how they can spare any time on developing new products and new releases when there are so many unresolved issues in their existing products! But still, it was fun to read their replies to some bug reports.<br />
<br />
<blockquote>XYZ,<br />
<br />
Thanks for your feedback.<br />
But you haven't answered my question. What would you recommend to cope with cases like attached example illustrates? Is there a general pattern for serializing generic collections?<br />
Posted by Unregistered User on 23/11/2005 at 03:12<br />
<br />
It seems that the attachment was somehow lost from this bug. Could you please reattach and reactivate?<br />
Posted by Microsoft on 06/12/2006 at 13:05 <hr /><br />
Thank you for submitting this issue. Unfortunately, we have decided that it will not be addressed because the risk of the fix and its potential breaking nature outweighs its benefit. By the time the next opportunity to make this change comes about, the hope is that the new serialization technologies in a future version of the Windows Communication Foundation will address your scenario. If this issue is causing significant negative business impact, please contact Microsoft Product Support Services. I regret that we could not provide a better resolution. Rest assured that we seriously considered this issue - a Won't Fix decision is never easy to make.<br />
-- XYZ <hr /><br />
Thank you very, very much for bringing this to our attention, for following up, and for not giving up after two bug resolutions. I think this is a great example of the value of the MSDN Feedback program. You have indeed uncovered a serious problem with Version Tolerant Serialization and Generics. Unfortunately, Whidbey is pretty much completely closed down right now, and it is impossible to check in a fix even for a bug of this magnitude, which is why I am forced to resolve this as Postponed. However, be assured that we are treating this issue very seriously and are now in the process of discussing alternative delivery vehicles for this fix (e.g. the possibility of making a patch available through Product Support Services.) In the meantime, please use assembly binding redirection (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconassemblybindingredirection.asp) as a workaround.<br />
Thank you again for the time you invested in reporting this problem,<br />
-- XYZ<br />
</blockquote><div class="blogger-post-footer">Deep in the fundamental heart of mind and universe there is a reason. -- Douglas Adams</div>Agnel CJ Kurianhttp://www.blogger.com/profile/02108024180511317456noreply@blogger.com0tag:blogger.com,1999:blog-10979178.post-38086045839640468952009-06-02T16:29:00.002+05:302009-07-09T15:39:10.015+05:30.NET ColorTranslator classUse <a href="http://msdn.microsoft.com/en-us/library/system.drawing.colortranslator.aspx"><span style="font-family: monospace;">System.Drawing.ColorTranslator</span></a> to convert between all kinds of color formats. Like converting from <span style="font-family: monospace;">#FF0000</span> to <span style="font-family: monospace;">Color.Red</span> for example.<div class="blogger-post-footer">Deep in the fundamental heart of mind and universe there is a reason. -- Douglas Adams</div>Agnel CJ Kurianhttp://www.blogger.com/profile/02108024180511317456noreply@blogger.com0tag:blogger.com,1999:blog-10979178.post-72836172465535595862009-04-21T11:55:00.003+05:302009-05-24T10:01:31.519+05:30TrueCrypt<a href="http://www.truecrypt.org/">TrueCrypt</a> allows you to create and mount encrypted disk volumes such that your data is encrypted/decrypted on-the-fly as it is read/written. The volume can be mounted from a single file rather than an entire partition. You can select the encryption algorithm used and also use a keyfile instead of a regular password.<br />
<br />
<i>Isn't a Windows password enough protection?</i><br />
No. Someone could boot your machine using a USB or other drive and access your files.<br />
<br />
<i>What about "Encrypt contents to secure data"?</i><br />
I have no idea how that works.<br />
<br />
<i>What about BitLocker on Vista?</i><br />
Sounds good, but you shouldn't be using Vista yet.<br />
<br />
<i>Other advantages?</i><br />
TrueCrypt can encrypt the boot drive. A TrueCrypt volume stored in a single file can easily be moved around, backed up, zipped, deleted and so on...<div class="blogger-post-footer">Deep in the fundamental heart of mind and universe there is a reason. -- Douglas Adams</div>Agnel CJ Kurianhttp://www.blogger.com/profile/02108024180511317456noreply@blogger.com0tag:blogger.com,1999:blog-10979178.post-73033499534074922592009-04-15T14:47:00.004+05:302009-07-09T15:39:26.728+05:30Subversion over Apache on WindowsI had installed <a href="http://www.collab.net/downloads/subversion/">Collabnet Subversion Server</a> as the VCS on my laptop. The <code>httpd.conf</code> installed by default is not usable straight out of the box. Here are a few things I had to fix.<br />
<br />
The Subversion manual prescribes the following setting for using Digest authentication:<br />
<pre><Location /svn>
DAV svn
SVNParentPath /var/svn
AuthType Digest
AuthName "Subversion repository"
AuthDigestDomain /svn/
AuthUserFile /etc/svn-auth-file
Require valid-user
</Location></pre>That doesn't work. From what I learned <a href="http://www.nabble.com/Re:-Problems-creating-root-directories-using-DAV-and-AuthzSVNAccessFile-p19457095.html">here</a>, it should actually be:<br />
<pre><Location /svn>
DAV svn
SVNParentPath /var/svn
AuthType Digest
AuthName "Subversion repository"
AuthDigestDomain /svn
AuthUserFile /etc/svn-auth-file
Require valid-user
</Location></pre>In other words, both <code>Location</code> and <code>AuthDigestDomain</code> should be <code>/svn</code> <i>without</i> the trailing slash. And remember to use <code>htdigest.exe</code> instead of <code>htpasswd.exe</code> when using Digest authentication.<br />
<br />
<hr />Another thing: the locally installed Apache manual is not enabled by default.<br />
<ul><li>Find the following line in <code>httpd.conf</code> and uncomment it:<br />
<code>Include conf/extra/httpd-manual.conf</code></li>
<li>Open <code>conf/extra/httpd-manual.conf</code> and replace all occurrences of the following with the path to <code>httpd/manual</code><br />
<code>F:/windows/subversion/../httpd/tmp/httpd/Apache/manual</code></li>
</ul><div class="blogger-post-footer">Deep in the fundamental heart of mind and universe there is a reason. -- Douglas Adams</div>Agnel CJ Kurianhttp://www.blogger.com/profile/02108024180511317456noreply@blogger.com0tag:blogger.com,1999:blog-10979178.post-18747814846499973242009-03-17T16:02:00.001+05:302009-03-17T16:03:08.105+05:30Binding a Value Type Array to a DataGridViewShort answer: Dont.<br />
<br />
The long answer: try it for yourself.<div class="blogger-post-footer">Deep in the fundamental heart of mind and universe there is a reason. -- Douglas Adams</div>Agnel CJ Kurianhttp://www.blogger.com/profile/02108024180511317456noreply@blogger.com0tag:blogger.com,1999:blog-10979178.post-22853739752052661222008-11-20T12:52:00.010+05:302008-12-01T18:19:32.134+05:30Direct3D Pick Ray<pre>void GetPickRay2(int x, int y, DX::Vector3 %orig, DX::Vector3 %dir){
DX::Matrix proj = device->Transform->Projection;
DX::Vector3 nearVec(x, y, 0), farVec(x, y, 1);
nearVec.Unproject(viewport, proj,
device->Transform->View,
device->Transform->World);
farVec.Unproject(viewport, proj,
device->Transform->View,
device->Transform->World);
orig = nearVec;
farVec.Subtract(orig);
dir = farVec;
}
</pre><br />
<br />
Here x and y are in <b><i>client</i></b> co-ordinates.<br />
<br />
<span style="color: red; font-size: 120%; font-weight: bold;">CLIENT.<br />
CO-ORDINATES.</span><br />
<br />
<span style="font-weight: bold;">DON'T.<br />
EVER.<br />
FORGET.<br />
THAT.</span><div class="blogger-post-footer">Deep in the fundamental heart of mind and universe there is a reason. -- Douglas Adams</div>Agnel CJ Kurianhttp://www.blogger.com/profile/02108024180511317456noreply@blogger.com0tag:blogger.com,1999:blog-10979178.post-47706785467722231672007-05-20T09:44:00.000+05:302007-05-20T10:06:14.827+05:30Debugging Startup Delay in VS.NET (CPVSBUILD)Because VS.NET looks for a machine called <a href="http://groups.google.com/group/microsoft.public.vsnet.debugging/msg/43b365b2ed7c6edf?q=cpvsbuild&hl=en&lr=&ie=UTF-8&oe=UTF-8&rnum=1">CPVSBUILD</a> on your network.<div class="blogger-post-footer">Deep in the fundamental heart of mind and universe there is a reason. -- Douglas Adams</div>Agnel CJ Kurianhttp://www.blogger.com/profile/02108024180511317456noreply@blogger.com0tag:blogger.com,1999:blog-10979178.post-54842057452344195792007-05-20T09:33:00.000+05:302007-05-20T10:06:53.114+05:30How do I call a C/C++ vararg function from C#?Usually you write declarations for each signature using which you intend to call the function. But there is another way:<br /><blockquote><p>In VC#.NET, if you're willing to rely on undocumented features, you can<br />also use the __arglist keyword to define a real .NET vararg method.</p></blockquote>[<a href="http://www.dotnetinterop.com/faq/?q=Vararg">Link</a>]<div class="blogger-post-footer">Deep in the fundamental heart of mind and universe there is a reason. -- Douglas Adams</div>Agnel CJ Kurianhttp://www.blogger.com/profile/02108024180511317456noreply@blogger.com0tag:blogger.com,1999:blog-10979178.post-89060045794478021662007-05-12T12:22:00.000+05:302007-05-13T19:41:01.662+05:30Calling .NET from MFC and VB6<em>Without</em> managed extensions. Create a CCW and call as though it were a COM object.<br /><br /><a href="http://www.codeproject.com/dotnet/nettocom.asp">Exposing .NET Components to COM</a> [code project]<div class="blogger-post-footer">Deep in the fundamental heart of mind and universe there is a reason. -- Douglas Adams</div>Agnel CJ Kurianhttp://www.blogger.com/profile/02108024180511317456noreply@blogger.com0tag:blogger.com,1999:blog-10979178.post-11083825884252966742007-04-29T12:11:00.000+05:302007-04-29T13:41:50.674+05:30RegisterWindowMessage can return different values for identical stringsRegisterWindowMessage <em>can</em> return different values for the same string between regular processes and windows services on the same physical machine. Additionally, PostMessage(HWND_BROADCAST, ...) will not work across desktops. From <a href="http://groups.google.com/group/microsoft.public.vc.language/browse_thread/thread/5916cafe0d8da6cb/57276b55eae261d6?#57276b55eae261d6">microsoft.public.vc.language</a>:<br /><blockquote>Services run in a separate window station, and have their own desktop. Window messages can only be sent between windows on the same desktop. You won't be able to use window messages for communication between a regular process and a service... <a href="http://groups.google.com/group/microsoft.public.vc.language/browse_thread/thread/5916cafe0d8da6cb/57276b55eae261d6?#57276b55eae261d6">More...</a></blockquote><div class="blogger-post-footer">Deep in the fundamental heart of mind and universe there is a reason. -- Douglas Adams</div>Agnel CJ Kurianhttp://www.blogger.com/profile/02108024180511317456noreply@blogger.com0tag:blogger.com,1999:blog-10979178.post-17499907381475761072007-04-22T18:02:00.000+05:302007-05-13T19:42:17.209+05:30File Comparison Tools<a href="http://en.wikipedia.org/w/index.php?title=Comparison_of_file_comparison_tools&oldid=124537826#Features">Comparison of file comparison tools [wiki]</a><br /><br />A <a href="http://discuss.fogcreek.com/joelonsoftware5/default.asp?cmd=show&ixPost=171470&ixReplies=22">discussion</a> on the same topic.<br /><br />The bottom line: <a href="http://winmerge.org/">WinMerge</a> is the best free option; <a href="http://www.scootersoftware.com/home.php">Beyond Compare</a> is good but costs money; <a href="http://www.araxis.com/merge/">Araxis Merge</a> is a bit more expensive but provides a full blown automation API and 3-way file compare.<div class="blogger-post-footer">Deep in the fundamental heart of mind and universe there is a reason. -- Douglas Adams</div>Agnel CJ Kurianhttp://www.blogger.com/profile/02108024180511317456noreply@blogger.com2tag:blogger.com,1999:blog-10979178.post-65204686067405326262007-04-17T22:45:00.000+05:302007-04-19T20:21:50.684+05:30Disable 'Updating Intellisense' in VC++ 2005Rename/remove feacp.dll in the <Vsroot><vsroot>\VC\vcpackages folder<br /><br />Thanks to <a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=426979&SiteID=1">Martin Richter MVP</a><div class="blogger-post-footer">Deep in the fundamental heart of mind and universe there is a reason. -- Douglas Adams</div>Agnel CJ Kurianhttp://www.blogger.com/profile/02108024180511317456noreply@blogger.com0tag:blogger.com,1999:blog-10979178.post-72790206701068568242007-04-15T03:56:00.000+05:302007-04-15T04:10:03.961+05:30FAMFAMFAM<div><a href="http://www.famfamfam.com/lab/icons">This</a> is a neat collection of free icons (PNG format). [I don't know what the name 'famfamfam' is all about. But nice icons.]<br /></div><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtRMB_w7m6yyv3Knn1iUfXsQwYpNHAt1_TpIpQAuxLbAq8f9uGZHEGgQDTJaUSgTp3jx2GhbR5M6lOy-UWia60u9iKqs21VVlHg1v3UsJ9WX6xdUWUp6D4vEGjJyvkFHufBHPg9A/s1600-h/silk_preview_small.gif"><img id="BLOGGER_PHOTO_ID_5053417179323740258" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtRMB_w7m6yyv3Knn1iUfXsQwYpNHAt1_TpIpQAuxLbAq8f9uGZHEGgQDTJaUSgTp3jx2GhbR5M6lOy-UWia60u9iKqs21VVlHg1v3UsJ9WX6xdUWUp6D4vEGjJyvkFHufBHPg9A/s320/silk_preview_small.gif" border="0" /></a><div class="blogger-post-footer">Deep in the fundamental heart of mind and universe there is a reason. -- Douglas Adams</div>Agnel CJ Kurianhttp://www.blogger.com/profile/02108024180511317456noreply@blogger.com0tag:blogger.com,1999:blog-10979178.post-1162541358370007762006-11-03T13:38:00.000+05:302007-04-15T03:42:45.553+05:30Identifying FontsLots of sites offer to help you identify a font you've been looking for. But <a href="http://www.myfonts.com/WhatTheFont/">WhatTheFont</a> is the coolest and easiest way to do this. Almost magic. Just upload your sample image and identify a few characters.<div class="blogger-post-footer">Deep in the fundamental heart of mind and universe there is a reason. -- Douglas Adams</div>Agnel CJ Kurianhttp://www.blogger.com/profile/02108024180511317456noreply@blogger.com0tag:blogger.com,1999:blog-10979178.post-1147932165350985532006-05-18T11:32:00.000+05:302007-04-19T20:22:11.200+05:30C++: Accessing Exception Data in a Generic catch(...)You have a generic C++ exception handler using <code>catch(...)</code> and you need to find the type of exception being thrown. Unlike Java and .NET, the generic handler is not accepting any argument. <a href="http://www.howzatt.demon.co.uk/articles/26Feb03.html">Roger Orr's article</a> shows how to get the exception data on a Microsoft compiler.<br /><br />Here is the code (with the author's permission):<br /><code>// Called from within a catch handler to log a string from the current exception<br />void logException()<br />{<br /> std::string error;<br /> try<br /> {<br /> // re-throw the exception to have another look at it<br /> throw; <br /> }<br /> catch ( std::exception & ex )<br /> {<br /> error = ex.what();<br /> }<br /> catch ( CException * pEx )<br /> {<br /> char szMsg[255];<br /> pEx->GetErrorMessage(szMsg, sizeof( szMsg ));<br /> pEx->Delete();<br /> error = szMsg;<br /> }<br /> // etc etc<br /> catch ( const char *pStr )<br /> {<br /> error = pStr;<br /> }<br /> catch (...)<br /> {<br /> // Search me...<br /> throw;<br /> }<br /> std::cerr << "Uncaught exception: " << error << std::endl;<br />}</code><div class="blogger-post-footer">Deep in the fundamental heart of mind and universe there is a reason. -- Douglas Adams</div>Agnel CJ Kurianhttp://www.blogger.com/profile/02108024180511317456noreply@blogger.com0