Wednesday, September 27, 2006

Thoughts on Tiddly Wiki

I mentioned last week that I was trying out Tiddly Wiki.

Pros:
Thns is a really neat application and implementation. It turns out that there are several variations on the theme on the web. I like that it's easy to save two copies, one for a daily journal, and one for a simple notes and todo list. I like keeping the two separate, it's easier for me to find my todo items itf I don't have to search through any journal entries that I'm making. I like that I can modify the source code. I haven't, but I like that control. I can look at it to learn as well as use it to play with new things that I learn. The entire application is a single .html file, making it portable, it can reside easily on even the smallest thumb drives. The editing is pretty standard, using the "standar" wiki editing format, that is used by many other wiki tools, including Media Wiki. Finally, there are a few keyboard shortcuts to prevent me from having to use my mouse.


Cons:
There aren't enough keyboard shortcuts. I like to be able to do as much as possible without having to use my mouse. It's a local wiki, which is great for my own todo lists, but I can't share it with anyone, at least without some additional effort. It may be possible to host the .html file on a service that allows me to share documents and have multiple people using it, but I think we are more often going to be overwriting what the other person does, if that's the case. Mostly though I just want to be able to share a read-only version of things. Being able to send the html for the visible tiddlers to the clipboard would be interesting, then I could just paste that into another application, it wouldn't be ideal, but it would make sharing my list easier. The default behavior is to make a backup copy of each change (just like a normal wiki), but to do that, the entire .html document is saved with a date-time stamp. Not an issue at first with a 160KB file, but what happens a year from now when I have a 5 MB document that is being backed up 3-4 times a day. I don't like the prospects of space that it can use. Too bad there is no built-in keep archive for 10 days type of function. Maybe I can write it.

My view:
There are more things that I like about this than I dislike. I'm planning to keep using it for a while longer to see if it continues to satisfy my needs. I haven't done much with JavaScript in the past, so I'm interested in looking at the source to learn new things, but It starts as a 51,000+ line file with nothing in it. I'd like the backups to only be the backups of html and not the entire javascript, but that will require some work on my part to understand how the code is curerntly working and to learn how to change it. The original site also mentioned several "plugins" for this application. I'm not sure what a plugin for an html file is, but I will look at them to see how they enhance the existing wiki structure. One of my biggest positives with this is that I can take just my thumb drive with me and be able to keep my notes no matter where I go. All new computers have a USB drive that I can plug into. There are a few places that I go that have old enough computers that they don't have a USB drive, but I'll just have to know that and take my laptop with me to those.

Thursday, September 21, 2006

Personal wiki

I have been looking at trying to find different options for journalling. I downloaded PowerJournal recently and was not happy with it. PowerJournal and the Desktop Sidebar that I like to use.

When I type in PowerJournal it makes the entire sidebar flicker.

Since I'm not excited about what I was using, I've started to look for new things. I use a wiki for a lot of documentation at work, and I figured there is probably a good wiki I can use on my own.

I know there are a lot of them out there, but the first one that I've run across and am trying is Tiddlywiki. So far this is about the coolest concept that I have ever seen. This wiki is an html file. That's it. There is no database, no php install, no web server. Open the Html file in a browser with javascript enabled and wow. There some plugins that can be downloaded with it as well, but for now I'll play with this for a few days and then post an update. I really like the idea of it just being an .html file. I have the entire source code, in the one file. I opened it and glanced through the code. I didn't dig into it though. With almost 52,000 lines in the file, it will be a while before I decide to dedicate that much time to understanding how it works. I wonder if something similar can be done with web pages through servers. A way for this wiki to reside on a server and be shared by others. Hrm.. Maybe that's something I'll have to research.

At least take the time to look at the page. Notice when you click on a lick it expands out into a new section that wasn't there before. It's a cool way to nest and group comments and have them all reside in the same page.

Wednesday, September 20, 2006

Java Training

I haven't crossed over to the other side yet. I'm in Dallas at Java training this week. I've been here all week. My trip here was a nightmare.

Monday I was in a fog and practically falling asleep in class. It's not the insructors fault, nor is it a dislike for Java. It's just that I didn't have enough sleep. We covered some of the basics of the Model View Controller pattern and where to use Servlets, JSPs and EJBs. The entire class is spent building up the same application. We start it from scratch and every lab continually adds to it. We setup a database using Cloudscape. This is a free database which is included with RAD.

RAD as it turns out is just a bunch of purchased plug-ins for Eclipse. The development is all done in Eclipse using the plugins to enhance the environment. I've never used Eclipse before, so I have no idea what the base functionality provides. The instructor mentioned that there are a lot of free plugins that would provide you with a very usable development environment.

Tuesday and Wednesday are both kind of a blur to me. I've had so much new information thrown at me that I'm not sure which way is which. I've learned about Java Beans and tags. I've learned about script funcitonality so I can use ${item.id} instead. I've also started working ahead on the labs and am currently working on custom tags.

Every little click I do in the IDE, I learn something new. "Oooh, I didn't know you can do that" is running through my head all the time. I would be lost if I wasn't following step by step instructions though. I'm learning a lot, but I also still don't understand practically anything. At least I understand the code (mostly). Now if I can just figure out why everything has to go where it does in the project.

File Modified time

I had a problem recently where a program provided to me exported 60,000 files. Only some of these files were exported with the modified time was set to the year 1617.

I wrote myself a little utility to set the last write time to now for any file that was not set correctly. this is a simple utility writen in C# VS 2002. Why 2002 insteady of 2005? Honestly, 2005 was taking too long to program in. There are some bugs with it that anytime it starts to show intellisense my PC freezes for the next 20 seconds to 4 minutes. Yes, I would type and wait 4 minutes for the next character to appear. Anyway, I went back to using what I knew would work better.

My original issues were that I was trying to verify that File.GetLastWriteTime actually showed me the 1617 date, but I had mistakenly put GetLastAccessTime. This caused me a lot of pain as I paced and cursed. But when I found my own small simple bug, I fixed it.

Here is the entire code showing the count of files that are updated. I did play with the formatting a little to reduce a few lines of code.

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;

namespace SetDateOfFiles
{
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox txtFolder;
private System.Windows.Forms.TextBox txtResults;
private System.Windows.Forms.Button button1;
private System.ComponentModel.Container components = null;

public Form1(){
InitializeComponent();
}

protected override void Dispose( bool disposing ){
if( disposing ){
if (components != null) {
components.Dispose();
}
}
base.Dispose( disposing );
}

#region Windows Form Designer generated code
private void InitializeComponent(){
this.label1 = new System.Windows.Forms.Label();
this.txtFolder = new System.Windows.Forms.TextBox();
this.txtResults = new System.Windows.Forms.TextBox();
this.button1 = new System.Windows.Forms.Button();
this.SuspendLayout();

this.label1.Location = new System.Drawing.Point(24, 8);
this.label1.Name = "label1";
this.label1.TabIndex = 0;
this.label1.Text = "Folder:";

this.txtFolder.Location = new System.Drawing.Point(144, 8);
this.txtFolder.Name = "txtFolder";
this.txtFolder.Size = new System.Drawing.Size(200, 20);
this.txtFolder.TabIndex = 1;
this.txtFolder.Text = "C:\\MyFiles";

this.txtResults.Location = new System.Drawing.Point(24, 88);
this.txtResults.Multiline = true;
this.txtResults.Name = "txtResults";
this.txtResults.Size = new System.Drawing.Size(480, 160);
this.txtResults.TabIndex = 2;
this.txtResults.Text = "textBox2";

this.button1.Location = new System.Drawing.Point(152, 48);
this.button1.Name = "button1";
this.button1.TabIndex = 3;
this.button1.Text = "run";
this.button1.Click += new System.EventHandler(this.button1_Click);

this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(528, 269);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.button1,
this.txtResults,
this.txtFolder,
this.label1});
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);

}
#endregion

[STAThread]
static void Main() {
Application.Run(new Form1());
}

private void button1_Click(object sender, System.EventArgs e){
txtResults.Text = "";
string[] files = Directory.GetFiles(txtFolder.Text);
int changeCounter = 0;
int filesChecked = 0;
int totalFiles = files.Length;
foreach( String f in files ){
filesChecked++;
if( File.GetLastWriteTime(f) < new DateTime(2000, 1, 1) ){
changeCounter++;
File.SetLastWriteTime(f, System.DateTime.Now );
}

if( filesChecked % 10 == 0 ){
txtResults.Text = String.Format("{0} of {1} files checked\r\n{2} files changed.",
filesChecked, totalFiles, changeCounter);
txtResults.Refresh();
}
}
txtResults.Text = String.Format("{0} of {1} files checked\r\n{2} files changed.",
filesChecked, totalFiles, changeCounter);
}
}
}

Thursday, September 07, 2006

Book Review: Why leaders can't lead

Why leaders can't lead

The Unconscious Conspiracy Continues by Warren Bennis.

Peter Drucker is quoted on the cover as saying Warren Bennis' background "makes Why Leaders Can't Lead the best book on how leaders can lead." I disagree. This book is much more of cynical. All but the last two chapter do nothing but complain about the way things are and the way people have handled situations. It is dated and spends much of it's time in the Nixon and Reagan administrations. For a leadership book from a former President of a University it was surprising how there were no specific suggestions of how to make Universities better. This feels more like Mr. Bennis wanted to make a buck by reselling the same book that he wrote 20 years ago by having it reprinted. Even the two chapters of suggestions don't feel like anything of substance.


Had I read the reviews at Amazon first, I probably would not have read the book. It is just too much of a rant. And for a book that's ultimately supposed to be about showing how to lead, I completely disagree with his practice of complaining 90% of the time. That's not leading, it's bitching.

Wednesday, September 06, 2006

What is a Great Developer

I have taken this completely from Eric Wise.

A great developer is a person who:

  1. Understands that different tools and languages excel at different tasks. They do not engage in "zealotry" choosing only one pattern or paradigm and jamming it into every problem situation.
  2. Understands that the goal of development is to produce "Working Software". Anything that distracts from working software should be shunned.
  3. Realizes that they will not be the only or last person to experience the code. Avoids unecessary complexity and comments where appropriate.
  4. Gets along with other developers. Realizes there are many solutions that can viably solve a problem and that their way is not always right or best. Is able to be a leader and take direction equally well.
  5. Gets along with end users. Is able to explain technical concepts in "layman terms". Over time, builds a trusting relationship with end users and becomes an advisor, not a dictator, for software requests. Makes every effort to learn the domain from the user perspective.
  6. Is intellectually honest. Does not over or underestimate deadlines, provides software in a timely fashion.
  7. Is always watchful. Constantly looks for ways to improve the day to day productivity and end user experience.
I thought that there could be some other things added. Here are my additions
3b. Documents the process to make it easier for others to understand.
7b. Is constantly learning new skills and techniques to use when appropriate.
8. Is available to listen, and offer suggestions when approached by other developers.
9. Is always available to others.

I believe that the great develop has great skills, but is also available as a mentor. Relationships with clients take time, but are equally important, always take an opportunity to improve your relationships with your clients.

Scroll wheel working

Victories come in small packages.

I have been having to program in VB6 a lot lately and I've been very annoyed by the fact that my scroll wheel doesn't work here. This is the only application that I have that the scroll wheel doesn't work on. The funny thing, is that several years ago I didn't even want a scroll wheel. Now I want to beat someone with a rubber duck if they have a mouse without it.

Anyway, out of frustration, I downloaded and installed the Logitech drivers on my PC and viola!!! I can use my scroll wheel. I also stumbled across a Microsoft post regarding this problem. If you have it, try installing your drivers first, it's probably more reliable than depending on the drivers built-in to the OS. But if that doesn't work then install the VB6MouseWheel.exe.

Tuesday, September 05, 2006

NUnit Addin

I've been wondering why NUnit hadn't just been integrated with the IDE, now I don't have to wonder. It has been.

If you are using VS2005 and want to use the NUnit plugin with your IDE, then get it from Netlogics. I link to a site other than sourceforge, because the installation instructions are here.

Friday, September 01, 2006

Text Parsing

Oooh. I am going to get to take 1 file that's 120 MB and parse it into approximately 40,000 files.

We received a single text file that contains the 40,000 files together, so I will get to write the program to find the start of each bill, find the account number and all information for that file, parse it and write it out to it's own file, containing the entire record wanted.

I'll post if there are any interesting challenges from this. The file appears to be fairly straight forward. There may be 3 or 4 challenges because it contains information from 2 different companies and the other company appears to have 2 or 3 formats for their data. I'll have to make sure I can recognize the format, then pull the required information from the required location.