Dealing With NTFS Hard Links in C#

Home / Dealing With NTFS Hard Links in C#

Dealing With NTFS Hard Links in C#

.NET, C#
The NTFS provides three types of links. Junctions, symbolic links and hard links. Windows shortcuts are something different again. This article deals with hard links and how to check whether two hard links refer to the same file, or vice versa, whether multiple hard links exist for a single file. Check Whether Two NTFS Hard Links Reference the Same File In opposite to symbolic links, when dealing with hard links, you cannot distinguish between the target and the link to that target. A hard link is just a file, it is not a reparse point. So how find out whether two files are actually hard links to the same file? – Exactly! It has to be the same file. This can be evaluated using the NTFS file index, which is provided…
Read More

Nachweislich keine Deadlocks

Multi Threading
Warum Mutexe Beim Schreiben von Multi-Threaded Code ist es unumgänglich, die einzelnen Treads miteinander zu synchronisieren, um Race Conditions zu vermeiden. Im Allgemeinen werden Mutexe verwendet, um kritische Bereiche des Codes zu schützen. Mutexe haben zwei Methoden: mutex.acquire () und mutex.release (). Für jeden Codeblock der von einem mutex.acquire () (sperren) und einem mutex.release () (freigeben) eingerahmt ist, ist gewährleistet, dass es nur von einem Thread gleichzeitig ausgeführt werden kann. Wenn ein Thread den Codeblock ausführt und ein anderer erreicht den mutex.acquire(), wird der zweite Thread blockiert, bis der erste Thread den Aufruf von mutex.release() erreicht. So weit, so gut. In einem komplexen System gibt es oft viele solche Critical Sections.  Aus Gründen der Performance, der Skalierbarkeit und des Ansprechverhaltens, werden meist verschiedene Mutexe verwendet. Würden alle Critical Sections durch…
Read More

Project Time Recorder – Powered by AngularJS

AngularJS, JavaScript
Our company SEKAS GmbH has a proprietary system for keeping track of employee work hours. The system has been in place since 1992. Its an Oracle Forms based system. Recently we decided for various reasons, that we wanted something new. One of the problems with the old system is that employees working at clients sites have no way to book times from remote. The new system will be a browser based system with a backend running in our company. The browser UI will consist of two parts built with different technologies. The management side allows maintenance of  core data like available projects and work packages, users, billing information etc. It also allows company management to generate reports and bills etc. This part of the UI will use a classical round trip approach and…
Read More

Motorola Fills up Android Property System

Android, Milestone
For almost half a year now, I have been having sporadic problems with my Mororola Milestone. After booting the phone, everything worked alright but after some usage, some features started to fail. Either WiFi connections didn’t work any more or 3G data connections stopped working or VPN failed to establish a connection. Also, some settings (for example: notification sound for SD card availability) failed to persist through reboots. I finally found out why! Android has a low level property system that lives in the init process. A good writeup of how it works can be found at http://rxwen.blogspot.com/2010/01/android-property-system.html The important part is that the property system only has space for 247 system properties. The properties are filled from the following files: /default.prop /system/build.prop /system/default.prop /data/local.prop Additional properties are created by…
Read More

Weak Listeners

Java, Netbeans
Resource Deallocation in Java Resource deallocation in Java is no problem since Java has automatic garbage collection. Right! ...? ...?? ...Wrong! Since Java has automatic garbage collection, resource deallocation is often taken care of for you, but when it is not, it becomes a real pain. Since the language relies so heavily on garbage collection, it seems the language designers forgot to include good mechanisms for the cases where garbage collection does not solve the problem (releasing external resources) or just does not happen automatically. A common scenario for memory leaks in Java is Listener registration and de-registration. When you want one component to react to events in another component you usually use a listener pattern. The listening component registers itself as a callback client to an observable component. Finding the right place to register the…
Read More

Is the USPTO violating Patents it granted itself?

Uncategorized
I was reading a news story about the patents US-Patent 5,838,906 and US-Patent 7,599,985. The patents are about: Distributed hypermedia method and system for automatically invoking external application providing interaction and display of embedded objects within a hypermedia document As I understand the patents, they are (among other things) about browser plug-in. If you follow the links  to the patents (either US-Patent 5,838,906 or US-Patent 7,599,985), you come to pages on the United States Patent and Trademark Office. At the top of the page there are a couple of red buttons, one of them is labeled “Images”. If you click on that button, you come to a page that requires an Apple QuickTime plug-in. Apple of course is one of the companies being sued by Eolas Technologies for violating the…
Read More

Image Preview in JFileChooser

Java
I just put together a little code to show an image preview in the JFileChooser. It shows a scaled image on the right side of the file chooser. The image is scaled to completely fit inside the box to the right. The file chooser does not filter files. It allows the user to select any file but if it can be opened as an image, the preview is shown. I created a component based on JPanel for the preview which overrides the paintComponent method: package x.y.z.util; import java.awt.Graphics; import java.awt.Image; import javax.swing.JPanel; public class ImagePanel extends JPanel { private Image image; private Image scaledCache; public ImagePanel() { setBorder(javax.swing.BorderFactory.createEtchedBorder()); } public void setImage (Image image) { this.image = image; scaledCache = null; repaint(); } private Image getScaled() { int iw =…
Read More

Netbeans Debugger Problems

Java, Netbeans
My colleague Chris Andritzky keeps getting bitten by problems of the Netbeans Debugger. In a multi threaded application, threads are stopped by breakpoints but the debugger does not realize it.It seems there are two bugs behind this, one in JDK6 and one in the Netbeans Debugger.The bug is described in Issue 167776. The JDK6 bug is supposedly fixed in Update 16. The Netbeans bug will be fixed in Netbeans 6.8. Chris is going to try Netbeans 6.8 Milestone 1.Update:Chris tried updating to Update 16 first. This didn't help. Updating to Netbeans 6.8 Milestone 1 solved the problem though.
Read More

Subdocument in Netbeans RCP

Java, Netbeans
In my current Netbeans RCP project, I manage entities called configurations which are persisted in a separate component. Each configuration is defined by an XML file and a bunch of additional resource files. The configuration itself (the XML file) can be edited graphically. A new requirement came up which essentially defined a new type of additional resource files. These resource files contain Lua scripts and have to be editable in the configuration tool. (more…)
Read More