netbard: (Default)
2009-07-15 10:56 pm
Entry tags:

Apple Disables iTunes for Palm Pre

So I don't actually own a Pre - but I still think its fairly lame for Apple to produce a special release of iTunes whose only purpose is to disable Palm Pre syncing. 

http://www.engadget.com/2009/07/15/itunes-8-2-1-brings-pres-music-syncing-capability-to-a-halt/

netbard: (Default)
2009-06-26 02:07 pm
Entry tags:

Word 2007 Blogging

The lesson learned from the previous entry is, by the way, to not use Microsoft Word 2007 to attempt to write and publish blog posts to livejournal. The publishing interface doesn't work, for some reason, and copying the entry from Word to Semagic once I installed the client made for some very messy HTML.
netbard: (Default)
2008-10-03 09:53 am
Entry tags:

Why I Love LINQ-to-SQL

The task: given a Scale which may contain one or many ScaleTexts and are thus reflected in the SQL database as a Scales and ScaleTexts table with ScaleTexts having a ScaleId foreign key reference, create the Scale in the database.

The old method: Generate and execute SQL to create a scale in the database and save its id. Methodically go through each of the ScaleTexts and generate and execute SQL to create a ScaleText in the database.

The LINQ method (given items as an IEnumerable(of string) that contains the scale texts for the new scale, and Db represents the DataContext derived object for the project):

Dim scale = New Scale() With {.Name = String.Format("{0} - {1}", items.First(), items.Last())}
Dim englishId = GetEnglishLanguageId()
For i As Integer = 0 To items.Count() - 1
    scale.ScaleTexts.Add(New ScaleText() With {.ScaleLabel = items.ElementAt(i), _ 
                                               .ScaleOrder = i + 1, _ 
                                               .ScaleValue = i + 1, _ 
                                               .LangID = englishId})
Next

Db.ScaleTexts.InsertAllOnSubmit(scale.ScaleTexts)
Db.Scales.InsertOnSubmit(scale)
Db.SubmitChanges()

Return scale


To me, this is so much better. I'm not having to move my head from writing VB.NET code to writing Transact-SQL, I can stay within the object model I've been working with all along and just expect the DataContext object to handle actually updating the database. All of my code is compile-time checked, rather having to wait until run-time to find out if I messed up a SQL statement.

Yum.
netbard: (Default)
2008-08-12 11:52 am
Entry tags:

Development Environment

So tomorrow we're having a meeting to discuss the development environment that we're going to use for an upcoming project. This has kept me somewhat busy thinking about it, but I'm reasonably sure I know what we need.

First, hardware. I'm going to be proposing that we buy a new server. A big, beefy server that can run up to three VM instances on it. Those three VM instances will be our development environment web server, our development environment database server, and a development server running a couple of other things. If we can't get one that will run three instances, than we'll get one that can run two instances and another, smaller one, for our development server

The development environment web server and db server are boring. IIS and SQL Server 2005. Yawn.

The development server is the really interesting thing - in one fell swoop I'm proposing updating a lot of our development practices:
  • Install Subversion as our source control client. This is head and shoulders above Visual SourceSafe, and represents a new model of source control that makes multiple people editing a file easier and makes it a lot easier to branch off the main development trunk. This will involve installing TortoiseSVN and AnkhSVN on developer boxes.
  • Cruise Control.NET. This is iffiest - I'm not sure I can get support for true continuous integration.
  • nAnt. If I can't get support for continuous integration, I'll need this anyways. Minimally, we're going to do nightly builds. They're the best way to determine that progress is being made and that quality is being maintained during the code construction phase of a project.
  • fxCop. This allows us to do code construction checking based on a set of rules generated by Microsoft guidelines. We'll be taking a close look to turn off rules that are stupid.

In addition, we'll be upgrading to Visual Studio 2008 as soon as possible . I believe the plan is to get the MSDN SKU of it, which will be awesome. We'll also be creating a seperate area of FogBugz for the use of this project and discussion best practices for using that.

Getting all this through will probably be a not easy task. But doing it will get us right on line for some world-class development environment characteristics. And it will make our projects more successful - which means it will be worth it.

netbard: (Default)
2008-07-23 03:09 pm
Entry tags:

Dear Windows

Seriously. I get it. You can't deal with swapping out COM components in memory without flushing that memory by doing a restart. Its why half the time when we install a new application, we have to reboot.

But rebooting the web server after I updated a COM component that I guarantee a grand total of one IIS site was using? Without prompting me about whether or not I wanted a restart?

Lame sauce.
netbard: (Default)
2008-06-23 12:02 pm
Entry tags:

SQL Server Management Studio & Temp Files

So I've been having a lot of trouble with SQL Server Management Studio lately.

Very Nerdy )

I don't know what I did on June 18th at 11:18 AM, but I hope it was worth the aggravation.
netbard: (Default)
2008-06-19 03:25 pm
Entry tags:

Case Sensitive SQL

Huh.

Never thought this would be the case, but it looks like there is a case where Transact-SQL is case-sensitive.

Be warned - this cut is very nerdy )



This is, in my opinion, very lame. A language shouldn't be part case sensitive, part case insensitive. Bad! Pick a side of the road, and stay on it!

netbard: (Default)
2008-06-17 02:46 pm
Entry tags:

Querying XML in a Tabular Format

Because I'm totally always forgetting this syntax and then having to scavenge through multiple sources to find it, you're all going to be subjected to more SQL.

Target audience? What's that? Way more geeky than the average reader wants to read. )

Told ya.

(For the record? Posting this was a pain in the ass. I need a better editor.)
netbard: (Default)
2008-06-17 10:12 am
Entry tags:

Multicore

So I get the SD Times free at work - I think they figure I'll buy all the products they're advertising. And I actually do skim through it - there's a lot of fluff and a lot of trend-following, but there's also some good stuff in there. It is, for instance, way more useful than Information Week has ever thought of being.

That said, this week's issue (or last week's issue, really I don't check my mailbox here enough) had a good counter-point editorial on multi-core processors.

What if multicore is all wrong?
netbard: (Default)
2008-06-17 08:45 am
Entry tags:

Tuesday

It is now Tuesday, and the weather has gone insane. Its not supposed to get past 65 here in Rochester, which is slightly unseasonably cold. But it is sunny, despite the dire predictions of mostly cloudy, so this is mostly a win.

I spent yesterday at work working on getting the item translations in place for one of our reports, which needs to go out in 23 languages. This involved pulling in data from an access database, and from the previous year's report and combining it all into one data table that the reports will drive in. In all? 2024 distinct pieces of text, put together in something like three hours. Last year, the same process would have taken us three days. I am FTW. Today, I'll work on getting the rest of the translations in place. And deal with another client who wants to swap out there X.509 certificate for one that won't be expiring. Fools!

Cam-wise, did a bunch of Mage stuff last night. I'm reasonably sure at least some of it will lead to posts sometime in the near future to [livejournal.com profile] netbardictales. As well as RP, which is awesome.

Tonight after work, drop [livejournal.com profile] jilliko off at her rehearsal and then go off to Aikido. Wednesday night is looking like some game work and, thus, computer time. Thursday is more Aikido and then it looks like I'll be running Forsaken on Friday.

(PS: Hey, LJ? Having a checkbox to "disable auto-formatting" is bad. Reverse that and make the checkbox "enable auto-formatting")
netbard: (Default)
2008-06-13 04:04 pm
Entry tags:

How to Win

1. Get informed from a client that they need to switch over to a new x.509 certificate within a week's time, because theirs is expiring.
2. Get the certificate. Install on all production web servers.
3. Call up the contact at the client.
4. In one SQL statement and about a 2:35 phone call, switch over from using one x.509 certificate to verify SAML requests to another. Do so without knocking anyone out of the report and so that new logins to their report are using the new certificate in a seamless, invisible way. Also effect not one single other user of the SSO authentication architecture I've built.

The thing about IT - a lot of the time if we're being awesome, the users should know nothing about it.
netbard: (Default)
2008-06-11 11:08 am
Entry tags:

VB6

Dear VB6,

I'm not sure if you were aware of this, but Unicode is a very big set of characters. The numeric representation, in fact, goes from x0000 to xFFFF. In decimal, that means it goes from 0 to 65,535. It rather needs to, as holding a spot for every character used in the world is a rather lot of characters.

Why, then, does the internal function for returning the character code of a unicode character (ascw) return an integer? Are you not aware that, in your own language, integers go from -32,768 to 32,767? And that you have a long data type that goes from -2,147,483,648 to 2,147,483,647?

Why do you cause me pain, VB6? Why do you hate me so very much?

The day I get to replace all our VB6 code with a more modern language will be a very, very happy day for me.

Update - the fix I had to do to make this work:

        if (ascw(c) > 0) then
            Response.write c & ascw(c) & "<br/>"
        else
            Response.write c & ((32769 - (ascw(c) * -1)) + 32767) & "<br/>"
        end if
netbard: (Default)
2008-06-10 03:42 pm
Entry tags:

Today's Edition of Epic/Brutal

Epic: In forty-five minutes, writing a piece of code that will load in an IIS log file, parse each line, and stick the parsed bits into a database table so that we can analyze some cookie information.

Brutal: Finding out forty-five minutes later that our web servers aren't logging cookies.

Its like I'm some sort of fraggin' nocker - endless frustration MY ARSE!
netbard: (Default)
2008-06-05 01:44 pm
Entry tags:

The afternoon can be more fun

Finally found the answer to my problem.

Basically, the AjaxControlToolkit has an AutoCompleteExtender that allows you to add an auto-complete function to a TextBox. This works by specifying a method on a web service that takes in the currently typed text and returns suggestions.

Actually, calling it a web service is inaccurate - it can be used as a web service. But what the AjaxControlToolkit requires is that it not be a web service but what is called a script service - the main difference being (I think) that JSON is used to serialize data being passed back and forth to it.

Interestingly enough, making a web service a script service in ASP.NET requires adding one attribute to your class - System.Web.Script.Services.ScriptServiceAttribute. Doing so will automagically make your web service a script service.

That's right - I spent two hours because instead of coding this:

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ToolboxItem(false)]
[ScriptService]
public class SurveyList : System.Web.Services.WebService

I typed this:
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ToolboxItem(false)]
public class SurveyList : System.Web.Services.WebService

And of course the AutoCompleteExtender simply failed silently. Argh.
netbard: (Default)
2008-06-05 11:44 am
Entry tags:

Ways to spend my morning that are NOT FUN

Toping the list is trying to understand why a 3rd party AJAX component simply doesn't seem to want to work in my project, when it works fine in the sample project.

Doesn't this code know that its supposed to ph34r m3?
netbard: (Default)
2008-05-27 03:45 pm
Entry tags:

Geeky things that are awesome

Things that are awesome - taking a LINQ db query against the database that returns a set of users. Do some calculations, realize that you need to refine the list a little. Do ANOTHER LINQ query - this time not against the db, but against the collection that the first LINQ query returned.

Boo-ya.
netbard: (Default)
2008-03-27 12:47 pm
Entry tags:

Dear Apple,

Kindly stop trying to push Safari on me through your Software Update tool. Given that I have never installed Safari and never intend to install Safari, that hardly qualifies it for being a "Software Update". Please stick to updating my iTunes - I know you need something to do now that you've repaired much of the damage to iTunes that you've done in the past year or so, but tough.
netbard: (Default)
2007-11-29 02:24 pm
Entry tags:

Little Things I've Learned Today

This will eventually make it to an adigitalera.com blog entry on how to deal with SAML, but I wanted to throw this here to remember it:

When attempting to sign a document in an ASP.NET environment, its important to realize that you're likely running in the ASPNET user account. This user account has almost no privileges; amongst those missing are the ability to access the private key's of certificates (though this is a pretty rare privilege - it looks like only the Administrators group and the System account get default access to those). Attempts to access X509Certificate2.PrivateKey will fail by throwing a System.Security.Cryptography.CryptographicException exception with the text payload (keyset does not exist). There are three ways to fix this:

  1. Give ASPNET permissions to read the private key of your certificate. Best way to do this that I've found is to download the Microsoft Web Service Enhancements tools and install them (when installing, select the administration option, unless you're installing it on an actual development box). This will install a certificates management program which you can use to find your certificate and give ASPNET permissions to read your certificate's private key.
  2. Change the user account that your ASPNET site is running under. Remember, though, that by default only the Administrators group and the System account have access to private keys. Generally speaking, you don't want to give this amount of permission to the account running an externally facing web site. Its a very bad idea.
  3. Do both. Create a special user account for ASPNET sites that need to encrypt things, and then give it access to the private key of your certificate.
netbard: (Default)
2007-10-25 11:05 am
Entry tags:

IMAP & GMail

The Register reports that GMail is slowly deploying an IMAP solution. This is pretty nifty; using POP3 against a GMail account previously was rather painful - here's hoping that their IMAP solution carries through things like labeling.
netbard: (Default)
2007-10-25 10:05 am
Entry tags:

Stupid Addons

Note to self: the DOM Inspector and Firebug add-ons for Firefox are intensely useful when debugging web applications. That said, they don't sip memory - they chug it down like a frat boy on a Saturday night. As in half an hour with Gmail brings memory usage up to around 200MB.

Oi.