Archive for October, 2005

Flock

This is just a test of the blogger portion of the Flock browser.

System.DateTime

Just a followup to what I blogged earlier today. Using System.DateTime, one can implement a generic kind of caching in a snap. In the class of your choice:


    string oldFile   = "/path/to/file"
    DateTime fileTime;
    DateTime timeNow;
    DateTime fileTimePlus;
 
    if ( File.Exists( oldFile )) {
        fileTime = File.GetLastWriteTime( oldFile );
        timeNow   = DateTime.Now;
        fileTimePlus = fileTime.AddDays( 1 );
      
        if ( timeNow > fileTimePlus ) {
        ...do stuff...

So at the do stuff part then you can make a descision about downloading another file, generating another file…on and on.

File times with C#

I have been working on a little web widget that I don’t have done yet, but in the course of writing it I wanted to do some file time checking so as to create a sort of pseudo cache, to stop the need to bombard a webservice. Note, these are notes to myself for the future.


using System;
using System.IO;
 
public class fileTime {
 
    public static void Main( string[] args ) {
        string fileName = "/home/username/test.txt";
  string time;
  string now;
 
        if ( File.Exists( fileName )) {
    Console.WriteLine( "Yes, file exists." );
    time = File.GetLastWriteTime( fileName ).ToString();
    Console.WriteLine( "Last write time was: " + time );
    now   = DateTime.Now.ToString();
    Console.WriteLine( "Time is now: " + now );
  } else {
    Console.WriteLine( "No such file" );
  }
    } // end Main
} // end class

I wanted to throw this together so I could just test it out.

blather

Added a new catagory…blather. Feel free to skip these, this is just personal journal type stuff. This is day 2 of my adventure with wordpress, and while it seems pretty strange to be blogging through a web interface the look and use is starting to grow on me.

Ask and ye shall recieve

For some odd reason tonite I went back to the main mono site and found that there has appearently been some work done on it. It’s just MediaWiki, but it now has a lot more complete documentation as well as more in depth information. Check it out. There were things on there that I had no idea even exsisted at this point.

1337

heh, in my del.icio.us today I saw something funny

leet

Shit simple C# development

Most of my friends know that lately I have become pretty interested in C# and .Net for Linux. I have booted windows to try the System.Windows.Forms stuff just to see what the hubub was about, and yeah, it makes GUI dev for windows easy…but that is not something I am all that interested in…well I am not all that interested in GUI development period.

This brings me to my first point which is that I have been finding things are pretty easy to get up and running so far. I have used a few of the libraries at this point and found them to work well. The documentation for the .Net libs that are part of the monoproject are lacking, but the mailing list seems to get a fair amount of traffic and there have been regular updates to C#, the libs and the main IDE (monodevelop). I take that to mean that the whole thing is under a good bit of development and as things get more robust, perhaps we’ll see better documentation.

I have been trying to use monodevelop, mostly because IDE’s for languages that have a lot of libraries can be handy, and for the most part it works. However, it still needs work. There is no ASP.NET syntax highlighting (at least none that I could find, and a post to the list turned up nothing). Also, I find the vernacular used to be a little confusing. I suppose it’s an effort to make Visual Studio users comfortable, but having never used that I feel like I should be reading documentation on the IDE instead of fumbling around in the interface willy nilly…but of course I don’t.

I mostly have been using eclipse. It’s ok. It excels for Java development, but the C# plugin is no where near as robust. Not that I am complaining, I certainly didn’t lift a finger to help with the plugin, so what can I really say.

I have been threatening to gather a bunch of vim macros and write some of my own to make it’s C# experience shit simple…but I of course never do :)

I picked up Mono, A Developers Notebook. It’s pretty good. Real light on theroy, so unless you are motivated to learn the theroy behind some of the practice in there, you may want to wait a bit before buying. It’s a great way to write a book though in my opinion. I like that for 90% of the things you want to do with a new language there are examples and hints in there. It makes the pain of transition really bearable.

That’s it for now

theme

Appearently people with more time than brains like to pour over the themes for wordpress. I found this one pretty quick. I think it sucks but it sucks lesser than others.

*edit* I am not referring to the current theme, should the author of said theme happen by here *edit*