Blog

Thursday, August 06, 2009
revised AutoHotKey script
A couple of weeks back, I posted a semi-useful AutoHotKey script, just a little script to paste text from the clipboard, but stripped of formatting. Well, I did some searching, and of course, I'm not the only person to have come up with this basic script. This guy posted a similar script, a couple of years ago. The one thing I learned from his script, which I somehow didn't think of myself, is that, rather than sending the clipboard contents using "SendInput", it's better to put the text *back* on the clipboard, then send ctrl-V. The reason this works better is that, in most applications, a paste is an atomic operation that's easily undoable, whereas using SendInput appears to the application as though you just manually typed out the contents of the clipboard.
I also decided to disable the macro in Excel, since I have an existing macro in Excel that's mapped to ctrl-shift-V, and I don't want to override that. So, bottom line, the macro now looks like this:
#IfWinNotActive Microsoft Excel 
^+V::
myStr := clipboard
myStr := RegExReplace(myStr, "\s+$","")
clipboard := %myStr%
Send ^V

Still nothing terribly amazing, but very useful, and something I was living without for longer that I should have.

Labels: , ,

posted by Andrew 7:23 PM
0 comments

Saturday, July 18, 2009
useful AutoHotKey script
I've been using AutoHotKey for a while now. I've got a few macros programmed into it that are pretty much wired into my brain at this point. There's one thing I've been meaning to write for the last year or so, and just never got around to it. Well, I was in the middle of something on Friday, and I just decided that I needed to stop what I was doing, and just figure out how to write this macro. It turned out to be a lot simpler than I though it was going to be! Now I feel kind of stupid for putting it off for so long.

Basically, I wanted a macro that would do a "Paste Special / Text Only". Mostly, I needed this in Lotus Notes, but there are other apps where it could come in handy. Long ago, I'd taken care of this in Word with a simple one-line VBA macro. But, I never really knew how to do this in Notes. The reason I need this, is that I'm often pasting text from Word, or a web page, or some other app, into Notes. The text goes to the clipboard as formatted text, and if I just do a straight paste into Notes, all the formatting info gets pulled in, and it's usually not a good match for the default e-mail formatting in Notes. So, I'd settled on just selecting Edit, then Paste Special, then Text from the menus. But that's a lot more work than pressing Ctrl-V.

Before yesterday, I'd never looked at the AHK docs closely enough to realize how simple this was. The contents of the clipboard, in plain text format (that's the key there!) are available in a system variable called "clipboard". So, all I really needed to do is call SendInput on that. Duh. Just to get fancy, I also decided that I wanted to trim trailing whitespace from the clipboard contents. So, here's a simple macro that trims trailing whitespace from the contents of the clipboard, and sends it out:
^+V::
myStr := clipboard
myStr := RegExReplace(myStr, "\s+$","")
SendInput %myStr%

I just have that mapped to Ctrl-Shift-V, so I can paste text anywhere, without formatting, no problem. And, yes, I could have written this in one line, but I broke it up so it would be easier to see what I was doing.

The point of this story, I guess, is that AutoHotKey is a wonderful thing, and that some things are simpler than you think they are, if you just sit down and spend a few minutes reading the docs.

Labels: , ,

posted by Andrew 4:59 PM
0 comments

Wednesday, May 13, 2009
programming books
I finished the Advanced .Net Programming class a couple of weeks ago that I was taking at NYU. While the class was going on, I limited my reading mostly to stuff that related to the class. I read bits and pieces of three books; I posted about those back in February.

I took a break from reading any programming-related books for the last couple of weeks, but now I'm looking to get back into something. I picked up Rocky Lhotka's Expert C# Business Objects again tonight. I've had that book since 2007, I think, and I just haven't been able to get all the way through it. The copy I have is now several versions behind. (Here's a link to the current version.) I had read through the first six chapters previously. Tonight, I just sat down and leafed through the remainder of the book. I've decided that there's nothing else in there I really need to read in depth right now, so I'm just going to drop it, and maybe pick up the new version at some point and start over with that.

Meanwhile, I also recently bought C# 2008 for Programmers by Paul and Harvey Deitel. I picked this up largely because I'd found some good stuff in an older version of the book that's available on the Safari subscription I have through ACM. This is a general C# book, written for people who already have programming experience. It covers a lot of the newer stuff in C# and .Net that I haven't really had time to pick up, since I first learned this stuff back in the days of .Net 1.1 -- LINQ, generics, WPF, and so on. I'm thinking I should probably put this book on top on my reading list, since there's a lot of stuff in there that could actually be useful to me at work.

Labels: ,

posted by Andrew 10:00 PM
0 comments

Tuesday, May 05, 2009
Jira
I finally got around to installing Jira today. The Windows install was pretty simple. I did a default install, then went in and changed the database to MySQL. That worked fine. I then tried getting the CVS integration working, but I haven't got that figured out yet. It just hangs when I try to set up a CVS module.

Either way, now I'll have to spend some time setting up projects, and seeing if I can get myself used to tracking projects in Jira. Of course, I'll also have to see if I can get the two other developers in the department interested in using it.

Labels:

posted by Andrew 9:27 PM
0 comments

Wednesday, April 22, 2009
Jira
I picked up Jira and Confluence this week, during Atlassian's "Stimulus Package" sale -- $5 each! A while back, I'd looked at Jira, and several other bug-tracking/project-tracking applications, but I never got around to evaluating any of them. I've had a vague sort of a plan to implement Trac eventually, after first converting from CVS to Subversion (which was also a vague kind of plan with no particular timeline on it). I don't think I could have ever talked my boss into paying $1200 for Jira, which is their cheapest commercial license. The $5 version only covers 5 users, but that's fine, since I only have two programmers working for me right now anyway.

It looks like Jira can work with either CVS or Subversion. I'm still planning on converting to SVN before I install Jira though. Of course, since we're a (mostly) Microsoft shop, I should probably look into TFS, but I think that might a bit too expensive for me.

It's a bit of a balancing act, in a small shop, trying to figure out how much time and money to spend on infrastructure (for lack of a better word) -- project tracking, version control, formal testing, and so on. I can't spend too much time on it, but if I don't do it at all, things start to fall apart...

Labels: ,

posted by Andrew 9:55 PM
0 comments

Friday, March 06, 2009
DreamSpark
Whenever I take a class at NYU, I always spend a little time looking around to see if I can take advantage of any student discounts on software or hardware, while I have a valid student ID card. In the past, I've picked up some random software from the NYU computer store, if there was something I needed, and they had it cheap. Right now, Microsoft has a great program called DreamSpark that allows college students to download certain developer tools for free. The authentication mechanism ties into NYU's Net ID system, so you can authenticate yourself as an NYU student just be selecting "NYU" from a drop-down at the DreamSpark site, then logging into your NYU account. Pretty simple. I'm downloading Visual Studio 2008 Pro, SQL Server 2008 Developer, and Windows Server 2008 Standard right now. I'm not sure that I really need *any* of these things; I have access to all of them through my MSDN subscription at work. But, this way, I'll have a set of licenses that are definitely *mine*, and not the company's, just in case.

Labels:

posted by Andrew 9:43 PM
0 comments

Monday, February 16, 2009
.Net books
The instructor for my NYU .NET class listed three books on his syllabus. Programming C#, by Jesse Liberty, is the main book for the class. CLR Via C# by Jeffrey Richter is an optional book, as is Programming .NET Components, by Juval Lowy.
I bought all three of these books the old-fashioned way: from Amazon, in dead tree form. I have an older edition of the Liberty book, but I don't have any edition of the other two, and I think they'll come in handy.
None of these books is available on the Kindle, by the way, though the Liberty book is available as a DRM-free e-book directly from O'Reilly. Of course, the e-book costs $40, while the hard copy from Amazon is only $31.50. Oh, and the Juval Lowy book is available through the limited Safari subscription I get through ACM, though I didn't figure that out until I'd bought the hard copy.
I actually haven't bought any computer books in a while, so I was due to plunk down some money and (hopefully) spend some time reading. The last time I remember buying anything was after VS 2005 and .NET 2.0 came out.

Labels: ,

posted by Andrew 10:35 PM
0 comments

Saturday, February 14, 2009
random stuff
I'm spending the weekend just hanging out in the apartment, trying to get over a cold that I probably caught last weekend at NYCC, or possibly from someone at work. I started a new class at NYU this week, Advanced .NET Programming. It looks like it should be an interesting class. I don't get a chance to delve into the more advanced .NET stuff often. When I'm doing .NET stuff, it's usually pretty straightforward ASP.NET work. It was a little hard to get through the first class, since I was fighting this cold, and I really just wanted to get home and get some sleep. I'm hoping I'll feel better by next Thursday, so I can maybe be a little more engaged with the class and a little less preoccupied with just trying to stay awake!

Labels: ,

posted by Andrew 10:34 PM
0 comments

Wednesday, August 27, 2008
Vista: almost done
I'm nearly done moving all my stuff over to the Vista install on my desktop machine. I de-authorized iTunes under XP, so I can use it under Vista. I moved my OneNote files over. Almost all of my key programs are installed and working now.

I'm installing Visual Studio 2008 right now. I haven't used VS 2008 before, so hopefully I can spend some time playing around with it now. I don't think I'm going to bother installing any older versions of VS. I don't really have any independent projects in .Net 1.1 or 2.0 that I need to worry about supporting.

I have Delphi 4 on my XP drive, and I have one fairly important program written in it: the database program that I use to manage my comic book collection. This is a program that I first wrote in BASIC on the Commodore 64, and have ported (or rewritten) several times. It's probably time to rewrite it again, this time as a Windows Forms app in C#, maybe. I'll have to see if I can even get the existing Delphi program running under Vista. I never really made an installer for it, and I think I may have used a weird library or two.

I think rewriting an old Delphi app in C# is particularly apropos, since I'll basically be following Anders Hejlsberg from Borland to Microsoft. I considered upgrading the project from Delphi 4 to the newest version of Delphi, but I don't see much point in spending time on that right now, since Delphi programming doesn't seem to be a marketable skill anymore. And the new version of Delphi costs a minimum of $400, whereas I got a free copy of VS 2008 from Microsoft when I went to the launch event a few months back.

Labels: , ,

posted by Andrew 9:29 PM
0 comments

Monday, June 09, 2008
ASP.NET MVC
I went to the ASP.NET MVC Firestarter event in NYC on Saturday. It was an all-day (9-5) event with several speakers talking about various aspects of the MVC framework, and some associated topics. Nearly everything that was covered was new to me. I'm somewhat familiar with the idea of the MVC design pattern, and I've played around with SubSonic a bit, but I hadn't really read much of anything about ASP.NET MVC specifically. I feel like I'm pretty far behind the times, given that most of the stuff I do in work right now is still in ASP.NET 1.1.

I still need to learn LINQ too. I haven't really had time to sit down and play with that yet either.

Labels: ,

posted by Andrew 7:00 PM
1 comments

Tuesday, June 03, 2008
Microsoft stuff
I went to a Microsoft Heroes Happen Here event today in Edison. I had registered for the NYC event that happened about a month ago, but things came up at work, and I couldn't make it. Stuff came up at work today too, so I had to skip the developer stuff in the afternoon. The morning track basically covered Windows 2008. It was pretty interesting, and I did learn some new stuff. They gave out a software bundle that included Vista Ultimate, VS.NET 2008, and a few other things. Honestly, the bundle o' stuff is one of the main reasons I went to this event.

I've put off installing Vista on my main desktop machine at home, for a variety of reasons. Now that I have a free copy of Vista Ultimate with SP1, though, I decided to give it a shot. I'm not doing an upgrade install, though. I'm still afraid to try that. Instead, I'm wiping out my Ubuntu install, and putting Vista on my second drive. I'll have XP on my 250 GB main drive, and Vista on my 100 GB secondary drive. I'm hoping that dual-boot between XP and Vista works out OK. I'm running the install right now; it's been going for about 20 minutes. I think it's almost done.

I also registered for the ASP.NET MVC Firestarter event in NYC that's coming up this weekend. It's always a little hard to talk myself into spending a whole day indoors on a sunny Saturday, in a Microsoft office, but I really need to keep up with some of this stuff. And I think it'll be kind of fun.

Labels: ,

posted by Andrew 7:53 PM
0 comments

Wednesday, March 26, 2008
dnrTV: .Net 2.0 stuff
I just watched dnrTV 18, on new language features in .Net 2.0. I was already familiar with partial classes, but they also went over some more esoteric stuff, including covariance and contravariance, nullable classes, and anonymous methods. Geez. There's a lot of odd stuff in .Net that I just don't know much about. Well, I guess that's the point of watching screencasts and reading books and whatnot, huh?

Labels: ,

posted by Andrew 10:26 PM
0 comments

Sunday, March 23, 2008
yet more dnrTV
Not that anyone but me is going to be interested in this, but I watched dnrTV show #13 today, the second part of the CSLA.NET 2.0 overview. I've only scratched the surface on CSLA.NET so far, but I think I have a little more of an understanding of what's going on and how it works.
I also caught up a bit on the .Net Rocks podcast on the trip down to my parents' house and back today for Easter. I'm still about 40 episodes behind. I was (mostly) keeping up for a while, but I started falling behind when they went to twice-weekly. Then, my commute got shorter, which means less time for podcasts in the car. So, the end result is a huge backlog of DNR episodes.

Labels: ,

posted by Andrew 9:11 PM
0 comments

Thursday, March 20, 2008
more dnrTV
The battle between dnrTV and Frisky Dingo continues. I watched show 12 today, the first CSLA.NET 2.0 show. An interesting start, but they really only scratched the surface. I really need to get back to reading Rocky's book.

Labels: ,

posted by Andrew 8:23 PM
0 comments

Wednesday, March 19, 2008
dnrTV - Generics
I keep meaning to watch dnrTV, but I never seem to get around to it. I need to find about an hour where I can sit still in front of the computer, and give it my full attention, and that isn't easy lately. I did just watch show #9, with Venkat Subramaniam talking about generics in C#. This is one of a handful of topics that I've got on my mental to-do list to learn more about. I see that show 105, the most recent show, is also about generics, so maybe I'll try and watch that one tomorrow.

There are a number of shows on CSLA.NET, which is another topic I really need to learn about. I really need to talk myself into watching this stuff more often, and maybe watching a little less Frisky Dingo!

Labels: ,

posted by Andrew 10:21 PM
0 comments

Thursday, September 27, 2007
reference vs. value types, and LINQ
One of the people I work with was having some trouble with reference vs. value types (in C#) this week. This article seems to give a pretty clear explanation of how these things work. Always good to have a little refresher on the fundamentals.

And, in poking around on this guy's web site, I found LINQPad, a tool for executing LINQ queries. I have to admit that I haven't had any time to play around with LINQ at all, but I'm really curious about it. I like his idea of trying to do all your ad-hoc SQL queries in LINQ for a week, to force yourself to start getting used to it. Some of the stuff I'm doing this week is requiring me to do a *lot* of ad-hoc SQL, though. My brain is so completely wired for T-SQL at this point that I think I'd get really frustrated really quickly trying to use anything else.

Labels: , ,

posted by Andrew 11:00 PM
0 comments

Tuesday, June 12, 2007
Dynamically Created Controls in ASP.NET
I was working on a project last week that involved dynamically creating a bunch of controls on an ASP.NET page, then trying to, um, do stuff with them. (For lack of a better explanation...)

This article does a good job of explaining something that I'd kind of missed at first: dynamically-created controls don't stay on a page after postback, normally. The "Page" class is stateless, destroyed after rendering the page. I didn't wind up using this guy's solution; I actually realized that I didn't need to be dynamically creating the controls at all. I'd copied my page from another page that *did* need to create controls dynamically, but after I looked at my own page, I realized I just didn't need to do things that way.

I've been doing more ASP.NET programming than usual lately, because I'm trying to finish up a project for a big client at work, and it's kind of tricky and time-sensitive. Because of that, I'm just doing it (mostly) myself instead of farming it out to one of the other programmers. I'm having some fun with it. Aside from the dynamically created controls, I'm also playing around with generics a bit. This article by Jesse Liberty was helpful for setting up a simple collection using generics.

Labels: ,

posted by Andrew 10:39 PM
0 comments

Friday, May 18, 2007
AppleScript
Related to my little iTunes buying spree from yesterday, I've been trying to find a good way to keep my purchased iTunes stuff in sync between my PC and my Mac. I've been thinking about just using rsync or something, but I haven't gotten around to playing with that yet.

Instead, I started looking into doing this with AppleScript. That seems like it should be easily doable, but I haven't been able to get this set up exactly the way I'd like. I started with a "copy files" script found at Doug's AppleScripts for iTunes page. The script just copies any selected songs in iTunes to a single location. I've just been selecting my most-recently purchased stuff in the "Purchased" list, then running this script to copy the files from my Mac to my PC. Then, on the PC, I just drag the files over iTunes, and they get moved into the right directories automatically.

I've got two little problems with this script: First, it tends to come back with an error when it's copying a big video file. Second, it doesn't provide any feedback while it's copying (no progress bar or anything like that). I decided to see what I could do about that, and came across this article at MacTech. I managed to use the example from that article to put together a nice app with a progress bar that should do just what the original script did. It compiles OK, but, unfortunately, doesn't work when I call it from the iTunes script menu. Clearly, I need to do some more reading on AppleScript and figure out how this stuff works. Also, the script uses the same method to do the file copies as the original script, so I'm assuming video file copies will probably error out the same as they did in the old script.

Labels: ,

posted by Andrew 11:05 PM
0 comments

Friday, April 13, 2007
ACM
A few months back, I blogged about ACM's deal with Safari and Books 24x7, where ACM members can access a subset of these online libraries. At the time, the book selection on both sites seemed to be a bit out of date. Well, they've updated the selection on both sites today, and there's definitely more useful stuff up there now. They've (finally) got some ASP.NET 2.0 stuff, including the "ASP.NET 2.0 Core Reference" book by Dino Esposito, which is pretty useful. They even have some stuff on WCF and WPF.

The printing capabilities on Safari have gotten a bit more useful, too. I don't remember exactly how it used to work, but it's definitely easier to print a big chunk of text than it used to be.

I'm not sure that much has changed on the Books 24x7 site, though. I think there's more .Net 2.0 stuff than there used to be, but I did a search on "Vista" and found nothing at all, initially. That's not good. (I later found two Vista books that inexplicably did not show up when I searched for "vista".) The Safari site has about four Vista books, which is OK, but not great.

Labels: ,

posted by Andrew 10:49 PM
0 comments

Wednesday, April 11, 2007
asp.net performance
We've been having some trouble with our main ASP.NET application in work recently. (It's our intranet, basically.) It's been growing a lot lately, with more and more functionality being added to it, and more and more users accessing it. It's running on a Windows 2000 server under ASP.NET 1.1. I have a new server set up that I'm planning on moving it to -- it's running Windows Server 2003, and I was planning on upgrading the app to ASP.NET 2.0 before moving it over. Given the performance problems, though, and my general lack of spare time, I'm thinking about moving it over as is, just to see if that helps, then maybe upgrading it to 2.0 later, when I have some time.

I know that there's probably a lot I could do to tweak the performance on this application. We've done very little in the way of performance-tuning on our ASP.NET stuff. I discovered a book from Microsoft yesterday, Improving .NET Application Performance and Scalability, which I think should be some help in guiding us through some tuning and optimization. The book is available as a PDF download, and it's about 1100 pages. I read through a couple of chapters tonight, and it's definitely got some useful advice on ASP.NET, ADO.NET, and SQL Server tuning. There's plenty more in there too, but that's all I've had time to read so far. I'm finding it useful enough that I went over to Amazon and ordered a used copy of the dead tree version. Highly recommended, if you need to do some .Net tuning, and you're not sure where to start.

Labels: ,

posted by Andrew 10:40 PM
0 comments

Saturday, February 24, 2007
lots of computers
Right now, I'm running a full backup of my desktop PC to my new 500 GB external drive. I'm also working on wiping my old Gateway and reinstalling Windows XP on it, so I can hand it off to a friend who has some use for it. And I'm also installing various things on my new Vista laptop. So I'm jumping around from machine to machine, checking on stuff, pressing "OK" a lot, and stuff like that.

On the Vista laptop, I've spent several hours trying to get Visual Studio 2005 and SQL Server Express set up. Everything seems to be working now, but it sure takes a long time to get that all set up. First, you have to install the original VS 2005 package from DVD. That takes a while. Then, you have to install SP 1. That can take quite a while: several hours. There's a good explanation for this lengthy install here, and apparently Vista adds even more of a complication to this, so it takes even longer under Vista vs. XP.

After SP1, you need to install the Visual Studio 2005 Service Pack 1 Update for Windows Vista Beta. I'm a little alarmed that this is still a beta; you'd think that one of Microsoft's first priorities would be getting a good solid development environment running on Vista.

And, if you want to bring SQL Express up to date, you need to install SQL 2005 Service Pack 2. I'm not 100% if I had to do both of these, but I installed "SQL Server 2005 Express Edition with Advanced Services" and "SQL Server 2005 Express Edition Toolkit". Then, I went back and installed the latest Books Online files.

So, all that took about four hours. Call me crazy, but that really seems like too long just to set up your development environment. Back in the old days, it'd take maybe 5 minutes to install, say, Clipper 5.2 or Turbo Pascal. I guess this is progress, but it doesn't feel like it!

Labels: , ,

posted by Andrew 3:34 PM
0 comments

Thursday, December 07, 2006
ACM
I've been playing around today with the online book access I can get through ACM. You can get access to about 500 books from Safari and 400 from Books 24x7. Mind you, there are thousands of books on the main Safari site, and thousands more on the main Books 24x7 site. A regular Safari subscription is $20 per month, and Books 24x7 is about $450 per year, so both those options are a bit expensive. There are some useful titles among the limited library of books available through ACM, but not too many recent ones. For instance, there's a good bit of stuff on .Net 1.1, but very little on .Net 2.0. I don't think I could just stop buying computer books, based on the selection available through ACM, but there is some good reference stuff there. There's also not much you can do in the way of printing from either service, within the ACM section. Still, I'm going to try to keep this stuff in mind before running out and buying any more computer books, and I'm going to try to remember to seach these services the next time I'm trying to solve a programming problem.

Labels: ,

posted by Andrew 9:09 PM
0 comments

Sunday, November 19, 2006
New Jersey Code Camp
I went to New Jersey Code Camp yesterday, but I only stayed for the first two sessions, then I left to go off and take care of something at work. I like the concept. One of the sessions I attended went over my head, I think, while the other one mostly covered stuff I already know. It would have been interesting to stay through the whole thing and see how some of the other sessions shaped up.

Labels:

posted by Andrew 6:23 PM
0 comments

Wednesday, June 20, 2001
Does it ever bother you when a 17-year old seems to know more about programming that you do? And you're 34? (Actually, it doesn't bother me much, and he seems like a nice guy, so it's cool. He's written some neat stuff, too!)

Labels:

posted by Andrew 7:36 PM
0 comments


This page is powered by Blogger. Isn't yours?
© 2008 Andrew Huey