October 2007 Archive

Anna Weatherup Sunday Sesh, or, How to Rotate a Video Clip Using Mac OSX (plus waterskiing)

Sunday, October 7th, 2007

Today Christian, Groovy (a Holden fan), Milli, scruffy little fella Matt, Patsy and Shannon came to see Anna Weatherup’s Sunday Sesh at The Beach House in Brisbane (cnr Albert and Elizabeth St, above Starbucks and McDonalds) — every week at 4pm btw!

Was a great way to spend a Sunday arvo with a few drinks (not alcoholic for me because I’m off it for 30 days!) and having a chat, Anna’s really talented and entertaining.

How does this relate to rotating a video clip on Mac OSX? I’m glad you asked.

Well, I had my cheap and cheerful digital camera with me and I took a video of the last 30 seconds of Anna cracking out Leonard Cohen’s “Hallelujah”. As you can see I have uploaded the video to Youtube for your viewing pleasure, but my plan came unstuck when I realised that I had recorded the video with my camera on end (you might call this “portrait” mode), and this meant that the video would be sideways on Youtube when it was uploaded. Not good.

I opened up iMovie HD with the plan of just rotating the video there, exporting it and uploading the clip to Youtube, job done. But no. iMovie HD as it comes with OSX 10.4 doesn’t rotate video — it only has every other effect known to man, but nothing that you actually need, like being able to rotate a clip.

My usual googling around didn’t turn up too much useful stuff at first as I found things like Apple’s Final Cut Pro and QuickTime Pro — well they cost money and I’m a tightarse so I don’t really want to be dropping cash on software just to rotate a single thirty-second video by 90 degrees. So I persevered and then I found a couple of interesting links, the first of which was an iMovie plugin called Simple Rotate. I downloaded Simple Rotate and I’m sure it’s good but I didn’t use it because I then found MPEG Streamclip, an awesome but not very intuitive thing that can export to a zillion formats and even rotates, crops, resizes and a bunch more stuffs. So I imported my QuickTime MOV (that’s what Kodak cameras save videos as) into MPEG Streamclip, then exported as an MPEG4 with AAC audio. I messed around with the cropping settings, set “rotate” to 90 degrees, clicked the “Make MP4″ button and voila! The video file was even smaller than the original so it was quicker to upload to Youtube.

Unfortunately the video I created was a little bit too narrow (because it was created from portrait mode, remember?) so Youtube stretches the clip horizontally, which sucks.

waterskiing!

But I don’t want to end this post on a bad note, so in other news, today I went waterskiing! It was with the Brisbane Waterski club where the club members will gladly take you out on the river at Jindalee and help you learn to ski, giving you tips on what you’re doing wrong and, in my case, drive the boat around in circles to come and pick you up after you stack it, again and again. It’s great fun — next week I’ll be standing up for sure. Fingers crossed.

How to Hide HTML Elements and How to Find Named SQL Server Instances With the SQL Server Browser Service

Wednesday, October 3rd, 2007

I learned some stuff the other day at work that maybe should be obvious, but it wasn’t obvious to me and so what I’m going to do is start a new blog category named “Stuff I’ve Learned”. The two things in this post could probably also be filed in another category called “Duh” but I haven’t decided yet if that is a good idea — maybe after writing this I will decide.

database administrator

Well, what have I learned? The first item was about HTML and CSS and really Javascript as well — you might call this “DHTML” but who am I to judge? The second was about SQL Server and how a client (e.g. Query Analyzer or a website) resolves a named instance of a SQL Server.

  1. You can hide a DIV element using visibility:hidden; in CSS, and then show one of the child elements of the DIV using Javascript, without modifying the visibility of the DIV. How about that!
    I have a demo HTML page that is similar to our real scenario, having two radio buttons and an image in an invisible DIV. The first radio button makes the DIV visible, which, as you would expect, shows the image that is a child element of the DIV. This is how I thought you would need to do things. The second radio button in the example page shows only the image, without showing the parent DIV element — and it still works! This was unexpected for me because surely an element shouldn’t be shown if it is inside another, invisible element? This works in Internet Explorer 6 and Firefox 2 but I haven’t tried any other browsers.
  2. We’ve been setup new SQL Servers at work and maybe to save IP addresses, or maybe to ease administration (DNS entries? Server administration overhead?) load, we are using named SQL Server instances on a single hostname (e.g. BNESQL5000\SQL5000) where BNESQL5000 is the hostname and SQL5000 is the name of the SQL Server instance on the server.

    Now the other afternoon, I could connect fine to the named instance using Query Analyzer, which I had running since that morning. Another dude at work couldn’t connect using Enterprise Manager (ergh, clicking — I’ll do it with SQL cause I’m a Real Programmer). Obviously I was connected and using the server, so it wasn’t a problem with the SQL Server instance itself — it was running fine. So I ran netstat on my PC to see which TCP port I was connected to the SQL Server on. It was port 50433 incidentally, so I said to my Enterprise Manager-using friend, “Try BNESQL5000,50433″ as your SQL hostname, which sneakily connects directly to the named instance without using its name. Well voila, my Enterprise Manager-using friend connected straight up and started hammering out database changes with his clicky mouse like a demon.

    You’re probably wondering, “Omg Glenn, tell me how this named instance and TCP port magic happens!” and that’s great because I am going to tell you. The way it happens is that when you try to connect to a named SQL Server instance your client goes “uhh, the bit before the backslash is a hostname, duhhh, but there’s a backslash so, um, that’s the name of an instance innit?” and so it connects to port 1434 (standard SQL Server port of 1433, plus one) which is where the SQL Server Browser service is listening. There, the client asks the question of “which port is named instance ‘SQL5000′ listening on?” and the SQL Browser replies with port 50433. So then the client goes “BOOYA!” and connects to port 50433 without any complaints or further ado.

    So obviously, the problem was that the SQL Browser service wasn’t running on our server, after it was rebooting or something silly. I smugly informed the DBAs what was going on and they fixed the problem in no time. All was well.

So here ends Lesson One of “Stuff I’ve Learned”, I hope it was informative and sufficiently brief! :D