1. Programming Font

    01-09-2009 by dan

    I really like a nice font.  The Georgia font that I am composing this post with in WordPress, for example.

    By default, Windows Vim uses a font called FixedSys, which is actually a pretty nice, clean fixed-width font.  However, after staring at it for a long time, I sometimes get the urge to spice it up a bit.  My favorite font has been Tahoma, then Lucida Console in the past, but for the last few years my absolute favorite font for programming has been one of the Proggy font series.

    My current Vim setup has a Proggy font at size 12 using the “desert” colorscheme.  I switched to this from FixedSys/colorscheme torte.  Refreshing!

    • Share/Bookmark

  2. Mp3Dj

    01-07-2009 by dan

    I just found a project called Mp3Dj.  I don’t know how I didn’t stumble upon this before, because it is almost exactly what I am looking for — an open-source Flex mp3 jukebox with an SQL backend.  There doesn’t appear to be much of a community for it, and there is no working example anywhere.  (There are screenshots here, though)

    I’m going to take it apart a bit, because I would rather use PHP and MySQL than Java and MySQL.  This stems mostly from the fact that the server I want to run this code on is a PowerPC, and there is no Java JRE for PowerPC.  (only jikes, which doesn’t cut it for some reason)  Also, the Mp3 ID3 reader I found earlier has many PHP examples.

    Anyway, it looks like this guy has solved my problem of dropping onto a list, so I’m the most interested in looking at that.  It appears that he has used a tree for the playlist section of the player, which is probably a good idea (I think the tree allows for context sensitive drag-n-drop).  I’ll dig into this a bit and see what I can find.

    • Share/Bookmark

  3. Hardware store sales

    by dan

    I went to the local Ace hardware store to buy some clamps to secure water pipes in my basement to the wall.  I knew what size the pipes were, the size of the gap between the wall and the pipe, and that I would need some kind of screw that can attach to my cinderblock basement walls.

    I found the clamp I wanted, and saw that it came with a wood screw.  So I went to ask the “resident expert” about getting a screw that would work on concrete.  He pointed out that I’d also need a properly sized masonry bit for my drill to get a hole going for the screw.  Fine — makes sense.  He showed me a bit, and I said it looked too big, but he assured me that it was the right size.  Long story short, I got home, drilled the hole, and of course the bit was too big.

    The point of this story is to ask the question “How much of a hardware store’s revenues come from purchases like this?”  I can’t return any of the stuff, because it’s all been opened and used.  I didn’t spend much on this stuff, but if you figure that every guy who goes into a hardware store comes out with some amount of stuff like this, and if you figure every guy’s garage is full of this kind of crap, hardware stores must be selling unnecessary crap to people all the time.

    The internet clearly has made some impact on this.  We can now research a purchase and instructions ahead of time, and only buy something we feel confident in (I did not do this for my recent pipe clamp purchase).  I wonder if this is also part of the “internet kills local business” phenomenon — better informed consumers not wasting money.

    • Share/Bookmark

  4. Rewire a House

    01-06-2009 by dan

    The wiring in my house sucks.  It’s a hodgepodge of quick fixes, some of it up to date, some of it ancient.  The circuits don’t make a lot of sense, there aren’t enough outlets, and there are wires not terminated properly everywhere.  And, the whole thing is grounded to the plumbing (the upstairs receptacles don’t even have 3 prongs!), which means that the grounding isn’t done properly.

    I’d really like to learn to rewire the house myself — without stripping the walls down to studs.  I don’t want to hook up the electricity to the new wiring, but I would really like to run the wires through the walls myself.  That way I know where they are, and I can drill and cut without worrying about hitting electric.  While I’m in the walls running wires, I could also run surround sound wiring and ethernet, so it would be really useful.

    I need to find out a few things about wiring, though:

    • How do I design the circuits?  There must be good design techniques, but the internet is not exactly a great resource (so far).
    • I will need to get any electrical work I do inspected by a qualified electrician.  How do I make sure I pass that inspection?
    • Is this even possible?  What if I rewire the house, and the electrician says he won’t use my wiring job?
    • What are the different gauges of wiring, and where do I use them?

    I have a few preliminary steps I can take, which I have started on:

    • How much does the wiring cost?
    • Draw a circuit diagram of the house as it exists today.
    • Get a book about the electrical code.
    • Share/Bookmark

  5. Drag and Drop Flex List

    by dan

    I am having a hell of a time figuring out how to implement a drag and drop playlist feature in my Flex jukebox.  It’s easy enough to have two lists and drag between them, but what I want to do is have a list of playlists and a list of songs (of the active playlist) and be able to drag an Mp3 entry from the list of songs and drop it into one of the playlists in the list of playlists.

    This doesn’t sound too hard…  Figure out what the drop target is, and add the drag item to that list.  The problem I have been having is that the drop target tends to be the whole list, not a particular item on the list.  Can I add specific drag and drop functionality to each item in a list/datagrid?

    I’m still clunking through the Flex syntax, too, which certainly isn’t helping my cause.

    I’ll take another crack at it today, and we’ll see what happens.

    • Share/Bookmark

  6. Vim Modelines

    01-05-2009 by dan

    Vim modelines are one of the coolest features of Vim.  You can use a modeline to apply settings to a specific file in Vim.

    For example, if I wanted to open a file and have it expand the tabs instead of using tab characters (hitting the tab key puts in 4 spaces instead of a tab character), I can add this to the top of my Vim file:

    # vim:set et:

    Or, I could specify the shiftwidth and tabwidth:

    # vim:sts=4 sw=4 cindent:

    The neat thing about this is that if someone opens your file in Vim and has different settings than you, your settings in the Modeline will override the other person’s settings, so they will see the file as you intended.

    I am currently looking to see if there is a way to add something like a Modeline to force Vim to open your file with a predefined split.  This would be something like this in your file:

    # vim :split horizontal:

    Now, if I were to open this file in Vim, this would put in a horizontal split where I placed the modeline.  This would be nice for editing purposes, because often I am working on a function where I need to reference back to a point in the file that is nowhere near that function.  If Vim opened it up with both parts of the function visible in different splits, I wouldn’t have to go looking for them.

    • Share/Bookmark