Montag, Januar 11th, 2010 | by Andreas Bruckner | Posted in .NET Framework, C#, Problemlösungen, Programmierung Allgemein, Visual Studio | No Comments »
On my last vacation I used 2 digicams, but had one set to a wrong timezone accidently. That’s why I cannot copy the pictures of both cameras to one single folder, sort by date and rename. In short terms: I cannot join the pictures.
Searched the internet, but found tools, which can set the date to a specific date only, but cannot correct the timezone (e.g. add 6 hours to the file’s existing modification date).
So I had to write my own solution. Find the download links below, and feel free to modify the sources. This is a MS VS2008 project, built for .NET Framework 2.0
Hint: Please note, that usage of this tool is your own responsibility!
—
Ich hatte im Urlaub 2 Digitalkameras mit, wobei eine noch irrtümlich die Zeitzone vom vorangegangenen Urlaub gesetzt hatte. Resultat: ich kann nun nicht mehr einfach die Bilder der beiden Kameras in ein Verzeichnis kopieren, sie nach Datum sortieren, und umbenennen. Kurz: ich kann sie nicht korrekt zusammenfügen.
Zuerst müßte ich das ModificationDate von Kamera A um 6 Stunden (sprich: die Zeitzone) korrigieren.
Im Internet fand ich nur Tools, die das Datum auf einen vorgegebenen Wert setzen, daher habe ich das selbst in die Hand genommen. Die Download Links sind unten zu finden, die Sourcen dürfen frei modifiziert werden. Es handelt sich um ein MS VS2008 Projekt, und kompiliert für .NET Framework 2.0.
Hinweis: die Verwendung erfolgt auf eigenes Risiko!
—
Download:
Binary
Sources
Screenshot:

Dienstag, Dezember 22nd, 2009 | by Andreas Bruckner | Posted in .NET Framework, Enterprise Architect, Enterprise Architect Erweiterungen, Programmierung Allgemein, Visual Studio | No Comments »
Lately I experienced a strange error automating Enterprise Architect: iterating through the Element-Collection of Package resultet in an AccessViolationException. It worked fine for the first time, but failed the next time, until I replaced the FOREACH-loop with FOR.
So I did some investigation, and the result was like this: FOREACH creates an instance of an IEnumerator, which keeps state through the course of the FOREACH loop. It runs in an own instance, and repeatedly call’s Current() and Next() operations.
On the other side, “FOR” is some “stupid” thing, running through the object’s list. It’s not running in an own instance, and allocating memory is the user’s responsibility.
The more, iterating through a collection using FOR should include the use of Count() which keeps track of how many elements are currently contained. IEnumerable does not.
Conclusion: when programming COM-Objects (like EA), it might be better, using FOR instead of FOREACH.
Note: rumour has it, that many of the types in System.Collection.Generic will not allocate an enumerator on FOREACH. The following post shows exactly in what circumstances an enumerator is allocated on the heap:
> LINK <
Donnerstag, Oktober 29th, 2009 | by Alexander Schölzhorn | Posted in Programmierung Allgemein, Visual Studio | No Comments »
Es wird wieder mal Zeit ein paar meiner Lieblingstools vorzustellen. Diesmals sind es Plugins für Resharper:
- StyleCop for Resharper: Integriert MS StyleCop direkt in den Editor
- Agent Johnson: Bietet zum Resharper noch einige zusätzliche Refactorings an
- RGreatEx: Lokalisierungstool, leider eingestellt. Funktionalität soll aber in Resharper einfliesen.
- Exceptional: Analysiert Exceptions und catch Blöcke
Dienstag, September 15th, 2009 | by Richard Deininger | Posted in .NET Framework, Allgemeine Theorien, C#, Problemlösungen, Programmierung Allgemein, Visual Studio | No Comments »
Heute hab ich was Lustiges/Ärgerliches entdeckt. Für alle, die Deployment Projecte und Buildscripts gemeinsam benutzen, folgender kleiner Hinweis auf eine potentielle Fehlerquelle. Wenn ihr den Productcode ändert und die Productversion erhöht, um ein Setup für eine neue Version zu bekommen, solltet Ihr auf das Guidformat aufpassen.
Es sieht vielleicht nur so aus aber, diese Guid:
{a50e0545-b0da-4a27-a832-93245837ee11}
entspricht nicht dem vom Deploymentproject gewünschten format von:
{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
Zum besseren Verständnis das Deployment project file ist case sensitive und alle Guids sollten immer UpperCase sein also:
{A50E0545-B0DA-4A27-A832-93245837EE11}
Hoffe das hilft einigen weiter.
English:
Today I found something funny/annoying. For all who use Deployment prjects and Buildscripts, is the following little hint of a potential error. When you update the product code and increase the product version to get a setup file for you new version you should watch for the guid format.
It doesn’t look like it but this Guid:
{a50e0545-b0da-4a27-a832-93245837ee11}
does not match the expected format of the deployment project of:
{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
To assist in the understanding the deployment project file is case sensitive and all guid’s have to be UpperCase, therefore:
{A50E0545-B0DA-4A27-A832-93245837EE11}
Hope this will help some of you.
Donnerstag, April 9th, 2009 | by Alexander Schölzhorn | Posted in Visual Studio | 1 Comment »
Endlich ist es soweit. Die neue Version von ReSharper ist verfügbar. Die wichtigsten Neuerungen sind:
* Performance and memory improvements
* Solution-wide code inspections
* Extended naming style configuration
* Support for VB9
Dienstag, Februar 3rd, 2009 | by Alexander Schölzhorn | Posted in Programmierung Allgemein, Visual Studio | No Comments »
Die Visual Studio Testing Extensions sind eine Erweiterungsbibliothek für alle die das Visual Studio Unit Testing environment verwenden. Ziel ist die Unittests lesbarer zu gestalten.
Zum Beispiel wird folgender Test zu diesem leichter lesbaren Test:
[TestMethod]
public void OldWay_Test()
{
int number = 5;
Assert.AreEqual(5, 5);
Assert.IsTrue(5 > 4);
Assert.IsTrue(5 > -1);
}
zu diesem leicher lesbaren Test:
[TestMethod]
public void NewWay_Test()
{
int number = 5;
number.ShouldEqual(5);
number.ShouldBeGreaterThan(4);
number.ShouldBePositive();
}
Donnerstag, Januar 29th, 2009 | by John Fall | Posted in Visual Studio | No Comments »
Hatte heute das Vergnügen, bei meinem bestehenden VS 2008 ein zusätzliches Feature installieren zu müssen (x64 Compiler für C++).
Also VS.Net 2008 DVD rein in den Notebook und Setup.exe ausgeführt – aber leider kommt es nach einiger Zeit zu folgender Fehlermeldung:
“A problem has been encountered while loading the setup components. Canceling setup.”
Nach Rechnerneustart (dachte es liegt an meinem Windows 7!) und einigem herumprobieren fand ich aber im Goolge folgende Lösung.
Wichtig ist, dass man dass Setup aus dem Uninstall (Add/Remove Software) Dialog aufruft, scheinbar kann man nach der Installation von SP1 nicht mehr das Setup von DVD ausführen.
Aber nicht genug, es gab noch ein weiteres Problem:

Nach dieser Datei im Google gesucht und folgende interessante Seite bei MS gefunden: MS Download-Seite
MSI heruntergeladen, aber nun kann man mit dem Browse-Dialog die MSI nicht auswählen (der Dialog erwartet sich scheinbar die richtige Setup-DVD). *grrr*
Einzige Lösung war, dass Setup abzubrechen, wobei glücklicherweise die bereits installierten Komponenten nicht deinstalliert werden:

Danach noch das MSI manuell ausgeführt und endlich funktioniert auch der x64 Compiler!