Thursday, July 26. 2007
This year I am attending OSCON for the second time. One of the more interesting sessions talked about YUI CSS, the Yahoo User Interface style sheets. With very simple CSS, they manage to support multi-column web page layouts that work reliably on all browsers. Since my biggest project, the Madison Digital Image Database, still uses tables for page layout, this is what I have been looking for, I just did not know.
Wednesday, July 12. 2006
In my earlier post about moving away from using an administrator account for daily use, I mentioned a problem with MSN Messenger and the fact that upgrading to the latest version (8.0) fixed it - well, it did not. What happened was that after I installed Messenger using my administrative account, Messenger ran - using the administrative account. Stopping and restarting using my regular account produced a login error message again. Lots of people seem to have the same problem, so I took a different route by downloading and installing Gaim.
A few more issues I ran into since my last post:
Symantec AntiVirus no longer auto-protects my hard drive. I decided that was acceptable and scheduled nightly scans of my hard drive instead.
Microsoft Word shows an error regarding Adobe macros when starting up. Apparently the Adobe Acrobat macros that get installed in Microsoft Office don't work when running as non-admin. I'll try to uninstall them, they don't seem to be essential.
All Microsoft Passport related logins seem broken. This also is not a big issue for me, I dropped Microsoft's Finance site in favor of Google's a while ago, and the automatic update feature in my copy of Microsoft Money 2003 has been broken for a long time anyway.
Visual Studio 2003 actually worked with the exception of web application debugging, I had to set the ASP.NET worker process to run under my regular user account instead of the SYSTEM account. Instructions for this were actually referenced with the error message that appeared.
Otherwise everything looks just fine right now, I'll post again in a few days with any additional experiences.
Monday, July 10. 2006
We recently decided to switch users in our department to LUA, which unfortunately has nothing to do with a trip to Hawaii. LUA stands for Limited (or Least privileged) User Account and basically means that you are no longer running Windows using an administrator-level account. While this greatly increases your security, especially while browsing the Internet, it is not without problems. It seemed sensible to switch my own account first before telling everyone else to do it, and immediately I ran into an obscure problem that did not seem to exist on Google yet (or I used the wrong search terms), so hopefully this will help somebody who is trying to make the same jump.
Lots of great information about LUA can be found on Aaron Margosis' WebLog and on the noadmin site.
My user profile
After removing my account from the local Administrators group, I logged out and back in and was presented with a Windows 2000-style taskbar without any custom toolbars and my desktop icons all neatly arranged by filename. The taskbar itself was permanently locked. I tried switching back to the XP theme, which worked, at least until I logged out again. Aha! Seems like the desktop settings are not being saved. Fast forward two or three hours and I know the culprit - my now least privileged account is no longer allowed to write to its own HKEY_CURRENT_USER tree in the registry. After another hour I figured out how to fix the problem: Put the account back in the Administrators group, run regedit, find the user in the HKEY_USERS branch, add the account to the permissions list and give it full control, remove the account from the Administrators group and log out and back in.
MSN Messenger
After my account seemed to be working again, MSN Messenger 7.5 was non-functional. When trying to log in, I got a 80048883 error, which does not seem to be at all uncommon.
Downloading the DLL file that is advertised on many of the web sites did not work for me, so I upgraded to the latest version, Windows Live Messenger. Problem solved.
I have not had the guts to start up Visual Studio to see what will happen. Stay tuned.
Saturday, February 11. 2006
Here's what I did for the last four hours...
I'm working on my favorite project to make it compatible with MySQL 5.0 (which for some reason has several incompatibilities with the previous version) and I run into a weird bug when inserting Unicode strings. The project supports both Microsoft SQL Server and MySQL, so I use the N'...' syntax to encode Unicode strings.
According to the documentation, that should be fine, but of course it is not. The documentation says that these two statements are equivalent:
SELECT N'some text'; SELECT _utf8'some text';
At least when using Connector/Net, that does not seem to be true. When
inserting values into a UTF8 column, the following statements yield different
results:
INSERT INTO test VALUES (N'\\'); -- inserts two backspaces INSERT INTO test VALUES (_utf8'\\'); -- inserts only one
Even worse:
INSERT INTO test VALUES (N'Côte d\'Ivoire'); -- syntax error INSERT INTO test VALUES (_utf8'Côte d\'Ivoire'); -- works
For now I'm waiting to see what the response to my bug report will be - perhaps it's not a bug after all, but a feature...
Friday, January 20. 2006
A collegue referred me to this excellent presentation titled How to Design a Good API and Why it Matters by Joshua Bloch, principal software engineer at Google. If you are developing software that has to interoperate with other systems, check it out!
Monday, November 21. 2005
Just recently I received several comments regarding my earlier Secure POP3 client for C# entry. When I originally posted it, I expected the author of the OpenPOP library to release a new version with the changes to support SSL in the near future. Since this has not happened, I am now providing the modified POPClient.cs source file. To use it, download the OpenPOP source code (version 1.3 from June 16, 2004), replace the POPClient.cs file in the OpenPOP/POP3 directory, and recompile. You also need this SecureSocket library.
Friday, September 23. 2005
One of my bigger development projects at work is the Madison Digital Image Database. It is basically a teaching and learning tool that allows faculty to build slideshows from a large repository of images and present them in a classroom or allow students to study them online, print them out etc.
Earlier this week, I also got my first iPod, which was shipped from China on Saturday and arrived Monday morning on the "ground shipping" option - thanks FedEx!
Since the iPod nano can display photos, I had to squeeze some MDID slideshows on it.
Continue reading "Finding a use for an iPod at work"
Friday, September 16. 2005
This is the last part of an article series exploring reading and writing CSV files with C#/.NET.
Part 1 covered converting the contents of a DataTable into CSV format. Part 2 explained how to read a CSV file back into a DataTable.
Finally we will look at some test cases for use with NUnit, a very important tool that I'll describe in more detail in an upcoming article. There is quite a bit of code, but it is all very simple and easy to understand. Each method marked with [Test] will be called by NUnit and run one of the CSV related methods in turn. Assert statements will then check if the returned values are valid or not.
Continue reading "CSV file parser and writer in C# (Part 3)"
Monday, September 12. 2005
This is the second part of an article series exploring reading and writing CSV files with C#/.NET.
Part 1 covered converting the contents of a DataTable into CSV format; this part explains reading a CSV file back into a DataTable.
Continue reading "CSV file parser and writer in C# (Part 2)"
Thursday, September 8. 2005
An issue that comes up quite frequently is how to read and write comma seperated value (CSV) files in C#. Surprisingly the .NET libraries have no built-in support for this, and the usual solution to use an OleDb connection to the CSV file with Microsoft Excel's database driver is convoluted and not cross-platform.
CSV files have a very simple structure ( source): - Each record is one line (with exceptions)
- Fields are separated with commas
- Leading and trailing space-characters adjacent to comma field separators are ignored
- Fields with embedded commas must be delimited with double-quote characters
- Fields that contain double quote characters must be surounded by double-quotes, and the embedded double-quotes must each be represented by a pair of consecutive double quotes.
- A field that contains embedded line-breaks must be surounded by double-quotes
- Fields with leading or trailing spaces must be delimited with double-quote characters
- Fields may always be delimited with double quotes
- The first record in a CSV file may be a header record containing column (field) names
In this article, I'll provide simple, but fully functional code to read and write a CSV file according to these rules. In memory, data will be represented as a DataTable, which makes it easy to process; for storage in the file system or transfer over a network the CSV data will be stored as a String or in a Stream.
Continue reading "CSV file parser and writer in C# (Part 1)"
Wednesday, September 7. 2005
Most of my programming is now done in ASP.NET and C#, so when I was looking for a library that can access Google Mail via POP3-SSL, I looked in the usual places (sourceforge.net, google, etc.) There are a lot of GMail clients out there, but most of them don't work - I found OpenPOP, a very nice POP3 client library though, but it did not support SSL.
More searching for an SSL TCP socket library then, and after a lot of commercial offerings I finally found a free SecureSocket library.
Tying it into the POP3 client was trivial, since the nice folks at mentalis.org implemented their secure TCP client with the regular .NET TCP client interface, so after half an hour I was checking GMail from within C#.
My changes should actually end up in OpenPOP soon, if you are interested in them right now, send me an email to get the diff file or copy and paste it from below.
Continue reading "Secure POP3 client for C#"
|