I really like to hack commands into console windows but when using Subversion excessively I rather use a good and stable client GUI. But no matter if you’re using a GUI or the command line client it is recommended to configure everything properly.
(more…)
Why would one choose to make a HttpRequest via Javascript? Well, the answer is rather trivia. With an HttpRequest you can request data without actually reloading the whole content of the page. This is really useful for big and complex websites to reduce CPU utilization on the server side and to reduce the load-time of the pages on the client side – as an example.
Just take a look at the following line of code:
xmlHttp.open('GET', 'foo.php', true);
Before that call you would of course first create the xmlHttp object. If you want to instantiate this object with Internet Explorer you have to create it with the ActiveXObject class while the rest of the browser world is using the XMLHttpRequest class.
But isn’t that a little bit complicated for more complex websites? Yes. In a real world example you would rather use AJAX (Asynchronous Javascript and XML) to make any HttpRequests. In this example I don’t want to discuss AJAX in general, but rather take a closer look at the technique that is working in the background.
The following example code was taken from the German Wikipedia page.
(more…)
While using and maintaining Subversion repositories on a Windows Server I quickly felt the need for hook scripts that do some work before and after committing changes to a repository. This is fairly easy on a Unix or Linux based system where you can use the power of shell scripts, but on a Windows based OS this might be a little more challenging.
The SVN Book unfortunately isn’t much helpful on this and even searching for existing (Windows) hook scripts on the net isn’t very fertile. Apparently.
Try searching for example “pre-commit.bat” including the quotation marks.
That will at least yield in to something useful to work with. The examples I’ve found were very mixed up and usually buggy.
But good news are that you can use almost everything that is executable for hook scripts. Batch files are the most common practice but you can also use WSH scripts, Perl, Python and even compiled code.
After studying the existing scripts I realized that it’s not that difficult to get a batch file to work with the Subversion server. You’ll just have to be careful on some things.
(more…)
It’s not unusual that I sometimes need to create unique keys. GUIDs are great but they can get really long. Sometimes I just need simple (shorter) unique keys. For example when I send a request to my web application there’s an ID that correlates my request with the transaction. A GUID isn’t what I’d want here.
I often see techniques that use sequential IDs of appropriate size as they will guarantee uniqueness. Easy and simple! But not secure in any way. Anyone could easily brute force sequential IDs to retrieve records from a database.
(more…)