Visual Studio JavaScript & CSS Outlining

Sometimes it’s the little tools that really make your day.

 

I finally got fed up with my growing JavaScript files and thought it would be great if Visual Studio allowed me to collapse functions just like it does with c# and other source files.  So I did a Google search.

 

Well, Velio Ivanov created a great little Add on that does just this and for CSS too!  Thanks Velio!!!

 

Check it out: http://jsoutlining.codeplex.com/

CrystalQuartz for Quartz.Net 2

Quartz.Net is an awesome and robust framework for scheduling jobs within .Net.  It is based on the very popular Quartz for Java.

Once you start using Quartz.Net very quickly you will want some sort of dashboard interface where you can view all the jobs that are running and other metrics.

Well, before you go developing your own there are already a few out there.  While most are full ASP.Net WebForms or MVC apps there are a couple of axd dashboards which allow you to easily embed them in your website with only a few changes to your Web.Config.  Take a look at CrystalQuartz or QuartzNetWebConsole.

After looking at both I chose CrystalQuartz because it seemed to be easier to implement with  my particular site and I liked the dashboard a little better.  I encourage you to look at the latest version of both and make your own decision.

Unfortunately I was using the beta version 2 of Quartz.net.  This is a great version and if you are just starting out I recommend it because it is much more intuitive than the current 1.0 release. 

That being said, CrystalQuartz (nor QuartzNetWebConsole) is not compatible with Quartz.Net v2.  So I made a few tweaks to the code and now it works great.

Feel free to download my version here:

CrystalQuartz Compatible with Quarts.Net v2.zip

I’ve contacted the CrystalQuartz team about adding my additions to their project but I have not heard anything back.  I’d love to fold my changes into their codebase so that it can be properly maintained and help others out.  However, in the mean time I’ve received a few requests for my changes so I’m making them available here.  I am not planning on maintaining this so if there are breaking changes as Quartz.Net v2 nears production then I may or may not have the time to update my copy of CrystalQuartz.  I do expect the CrystalQuartz team to come out with a v2 version that works with Quartz.Net when it is finally released.

Enjoy!

iPads at the Admin Level

At my school district we are starting to deploy iPads just as many others are.  While managing the vast number of iPads is still a difficult task there are several solutions and I hope that in a year a robust solution will be available.

However, what I haven’t seen is a decent business case for iPads.  When you have administrators that have all their documents in a folder on the server, shared documents in their department networked folders and a wealth of sensitive data that needs to be used by various people there just doesn’t seem to be an easy way to tackle this with an iPad.

Beyond simply email, calendar and Internet access how can we make these devices more useful in an everyday environment?  My Assistant Superintendent of Education Services has a goal of getting principals and assistant principals out of their office and more intimately involved in the daily activities of their schools.  To this end they have been given iPads to use in their job.  However, when the iTunes store is the first place users look for apps to utilize, syncing data with iTunes on their desktop computers, non-networked file access, etc this becomes a real challenge.

To this end I have attempted to find out how we may get tools in the hands (forgive the pun) of our staff that take advantage of our networked file infrastructure, Active Directory for authentication and authorization and vast wireless access across our school sites.

Check out my video where I presented our model to the CETPA CTO Mentor Program, of which I meet once a month in Sacramento with other education CTO and IT staff members.

http://vimeo.com/mattpenner/ipadsforadmins

We have had a lot of great interest in our model from the various school districts as well as Apple and Microsoft.

Next week I will be presenting the same topic geared towards developers at the Inland Empire .Net Users Group, of which I also am a member.  At that presentation I will be getting into the nitty-gritty detail of how it all works.  Plus you will see a production ready implementation rather than the proof of concept in the above presentation.  I’ll record this one as well and post it as soon as I can.

More as it comes! Smile

IIS7 Won’t Respond Over SSL if No Certificate is Selected

Ugh, while the title of this post doesn’t sound like that much of an issue chalk this one up to an experience I hope someone else doesn’t have to deal with.

We had an issue with our A/C unit in our data center last night and several of our servers were shut down due to excessive temperatures.  We are slowly brining them up as we are managing the cooling and they are all fairly coming up as normal. Some of the older servers reported errors with batteries or failed drives but these are fairly routine.

However, we had one of our brand new servers start up with seemingly no issues but IIS 7 was not responding to web requests.

This server serves up only two web applications over SSL and has worked fine for the last month that it has been in service.

Looking at the IIS logs, event viewer and any other sort of diagnostic tool we could think of reported no errors at all…and no connection attempts either.  Connecting from the local host offered no error messages.  Connecting through Fiddler2 only showed the cryptic message, “the server has actively closed the connection”.

Finally after restarting the entire server, the IIS service, the web site and the app pools we were grasping at straws.  Bindings were correct, permissions were correct, doing a “netstat –an” revealed the server was indeed listening on port 443.

In the end, what solved it is in the binding settings the Certificate dropdown showed None.  I selected the self-signed server certificate and the whole thing suddenly came alive.  I attempted to set the SSL certificate back to None, which wasn’t an option anymore.

Of course that makes sense.  How can you serve up SSL traffic when there is no certificate to authenticate the request with?  However, why a server restart caused the certificate to no longer be selected is beyond me. 

And why did IIS never throw an event or some type of log error that said, “Hey, you’re trying to serve SSL but no certificate is selected!”???

Anyway, hopefully this will show up on a Google search for someone else.  Cheers. Smile

KeyNote on the iPad–A pleasure to use and a touch interface done right

Recently I’ve started using an iPad 2 in my work environment and I’ve been doing a few presentations about it.  So I was on the hunt for a decent presentation software.  I just picked up KeyNote on the iPad and I have to say I love it.  So much that I had to blog about it, and that’s saying a lot. Smile

KeyNote is a touch app done right.  There is a discussion going on that touch devices should have a touch O/S and a point and click device should have a point and click UI, and very rarely should they actually be merged.  That’s one reason why Windows on an iPad has never really worked and probably never will unless Windows 8 changes the game.

KeyNote is an example of a great app that is designed with the iPad as the only device it is intended for.  The entire interface is based on the touch/swipe model of the iPad, of course.  The UI is very intuitive and very easy to use .  All the interactions make perfect sense and are very easy to use, including adding images, sizing, rotating, adding animation effects, etc.  I’m amazed at the power of the editor while still being a simple touch device.

It’s nice being able to create presentations on the fly with it.  Had I not had Internet access when I was at the Ontario airport I would have been severely hampered when trying to create a recent iPad presentation on the fly.  Had I had KeyNote it would have been a snap other than the graphics I downloaded from Google Images.

I’ll be using KeyNote for the majority of my presentations from now on.  I’ll probably spring for the $0.99 KeyNote presenter remote app that allows me to control the presentation from my iPhone along with viewing what slide I’m on and the presentation notes.

It is just such a pleasure to use an app that blows away all expectations of the iPad and just makes perfect sense.  KeyNote hits the ball out of the park. I know it sounds like I’m an Apple fan boy but believe me, this app deserves it.

Adding a group of computers to an AD Group using PowerShell

PowerShell is a lot of fun but I don’t always get to play with it.  Anytime I have to do large tasks that move a lot of simple data or AD type tasks then I’ll sometimes pull it out.

Recently we installed Windows 7 across our district.  During that process we renamed all the computers because our old naming convention wasn’t always followed and it created a lot of confusion and inconsistency.

All our library staff computers have a special application that allows them to download barcodes that are read using a handheld barcode scanner for inventories.  This previously was pushed out by a group policy.  Since the computers were erased during the Win7 install and the computer names had changed we had about 25 computers that needed to be added to the group again.

Sounds like a perfect chore for PowerShell.

First of all, I forgot the name of the group that they needed to be added to, but I knew it had “dolphin” in the name, since that is the name of the software.  Active Directory Users and Computers (ADUC) won’t let you search on a portion of the name, just the beginning or the end.  Not much help there.

PowerShell makes this trivial:

Get-ADGroup -filter {name -like "*dolph*"}

This returned the following:

DistinguishedName : CN=g-InstallLibraryDolphin,OU=Computer,OU=Software Install,DC=valverde,DC=edu
GroupCategory     : Security
GroupScope        : Global
Name              : g-InstallLibraryDolphin
ObjectClass       : group
ObjectGUID        : 0909537b-ddcc-41c1-bd37-667fdb943a95
SamAccountName    : g-InstallLibraryDolphin
SID               : S-1-5-21-1659004503-746137067-682003330-69446

That’s the one!

Our naming convention for or library computers is wXX-Library, where XX is the two character code for the school the computer is at.  However, simply filtering on this wouldn’t help, because we name all our library student computers as follows: wXX-LibrarySYY, where YY is simply a number stating at 01 and goes up for however many student computers are in the library.

So, here is the PowerShell command that stores all our library staff computers into a $libcomps variable, excluding the student machines:

$libcomps = Get-ADComputer -filter {name -like "*library*" -and name -notlike "*libraryS*"}

Since you cannot pipe computer objects straight into the Add-ADGroupMember commandlet (why, I have no idea but it doesn’t make sense to me) you have to iterate over the $libcomps collection and add them one by one:

foreach ($c in $libcomps) {Add-ADGroupMember g-InstallLibraryDolphin -Members $c}

The command ran for about .25 seconds and did all the work for me.  I think researching the right commands to use took about 2 minutes, which is still faster than had I had to move them all over one by one. 

Heck, this post took longer than the entire task all together. Smile

Extending Your jQuery Application with Amplify.js

This was a pretty amazing article about how to extend your jQuery code even further using Amplify.js.  Elijah has a great writing style with very organized and clear examples. 

He first starts out with what I think is a pretty nice and clean example app.  Then he proceeds to discuss various improvements he makes using Amplify.js and refactoring to various patterns that really start to bring out the flexibility of the app.

Definitely take a look!

http://msdn.microsoft.com/en-us/scriptjunkie/hh147623.aspx

Microsoft Surface 2 with PixelSense

This is just amazing stuff.  When Microsoft Surface first came out you knew this was opening the door to the future.  All the flashy futuristic movies where video screens are interactive and everywhere, tables, walls, etc are now coming to reality.

With Surface 2 they have really taken a huge leap forward.  Now they are using LCD screens with what they call PixelSense technology.  Along with R, G and B pixels there is now a fourth pixel that can detect in the infrared range.  The LCD screen actually can detect the objects on the table.

What this does is change the older hardware with complex projectors, cameras and sensors into a sleek tabletop design.

Just to give you an idea here is what the original Surface typically looked like:

The large enclosed portion below the glass is actually hiding the set of projectors and cameras along with the computer hardware.

Now, with most of the complex sensing technology actually built into the LCD they can now produce tables that look like this:

I’ve seen Microsoft Surface products built into the wall at fancy hotels or casinos in Las Vegas.  Now we’ll start seeing a lot more of these pop up everywhere.

It’s an amazing time to be alive! Smile

The preferred way to change due dates in Destiny en masse

Destiny is the district-wide library system we use from Follett.

One common request I get is to update a due date for a large number of books.  Usually this is because a librarian has checked out textbooks but then the end of the school year changes by a day, or the original checkout date was incorrect.

If the due date is in the future, and you are on Destiny 9.9 or later, Destiny has a feature for this.  Simply click on the Circulation tab at the top, click the Renew tab at the left and select the By Date tab on the upper right (could there be any more tabs? Smile).  This allows you to find books due in the future by date and renew them in bulk.

If your due dates are already past, or if you need to filter your books using more detailed criteria Destiny has no built-in way to fix this.  You have to manually go to each checkout and change the due date.  When you’re dealing with hundreds or thousands of books this can be prohibitive.

Destiny does, however, have what they call an Offline Circulation feature.  This is primarily used in case the Destiny server is unavailable but you still have to check in/out books to students.  You use a barcode scanner to scan in a checkout code, then scan the student’s ID and then finally the book they are checking out.  This creates a simple text file that you then upload into Destiny.  The really nice thing is that during the upload Destiny lets you select a date of the transaction.  So, if a mistake happened several weeks ago, you can set the date of the transaction to the day after, assuming that no transactions have happened on these books since the mistake.

The really nice perk about this is if you have had several hundred books marked as lost (because they were overdue for a long period of time) then you may have students with all sorts of fees on their records.  Simply checking out the books again to their accounts reverses all the fees and marks the books correctly as checked out.

But how do you create an Offline Circulation file for thousands of books?  Unfortunately Destiny doesn’t have a built-in way to do this either.

This is where SQL comes in. Smile  I’ve been working with the Destiny database directly in SQL for over 4 years for various reasons.  The Follett development staff do a good job of keeping it fairly well organized and understandable.

If you don’t have access to your Destiny database then buy lunch for one of your IT database admins and they’ll help you. Smile  We love free food.

Here is a sample script that will generate a Destiny Offline Circulation file.  It does this for all textbooks at a specific site that were marked lost on 4/24/2011.

-- Create Offline Circulation file to recheck-out all RVHS textbooks that were lost on 4/24/2011

SELECT  '%C125J' + char(13) -- Checkout to patron code
    + patronbarcode + char(13) -- Patron's barcode
    + copybarcode -- Textbook barcode
FROM    
    copy c -- copy table
    join bibtextbook t on (c.bibid = t.bibid) -- textbooks only
    join sitepatron p on (c.patronid = p.patronid) -- patron table
where 
    c.status = 200 -- only lost books
    and c.siteid = 215 -- only RVHS
    and p.status = 0 -- Active students only
    and datelost >= '2011-04-24'
    and datelost < '2011-04-25'
ORDER BY patronbarcode, copybarcode

The real magic is the ‘%C125J’ = char(13) portion.  This is the code that Destiny uses for checkout to patron.  The char(13) adds a line feed.  If you execute this and display the results as Text, rather than a table, you will get a line for the checkout code, a line for the patron’s barcode and an line for the textbook barcode.  This is formatted exactly like the Offline Circulation feature.

I hope this helps!

The Real Debate About Gaming in the Cloud and the Future of Technology

Toms Hardware has a lot of great tech news every day.  This one caught my eye from a gaming cloud vendor talking about where gaming was going.  Here’s a hint, he thinks it’s going to the cloud. Smile

I’m really surprised at a lot of the comments about the article. In fact, I was hard pressed to find a single optimistic one.

A good percentage of the arguments seem to be that "games" should be physical media that you can buy in a store and touch. That’s the same argument music providers and purchasers were pushing 10 years ago. Now if you want to actually visit a store to browse and purchase a CD it’s more because you’re a purist or you want to take a walk in "simpler times". If I hear a song I like and actually want to buy it I don’t think twice about going to my favorite online provider and downloading it to my phone. In fact I love the convenience, speed and knowing that that purchase is mine no matter what happens to my phone. There is no physical medium to break or lose.

Other arguments seem to think that bandwidth is too slow/inaccessible/expensive/capped/et and set in stone. Bandwidth will always get faster and more accessible. I know that right now there are arguments at the cost, ISP caps, geographical limitations, but these have always been the same issues in one form or another. ~15 years ago (I’m 34) I was downloading at 2400bps. 10 years ago ISPs were having wars as to which 56k bps technology was to be used. DSL and Cable then started fighting it out and the government was being lobbied as to whether telco companies should be allowed in the entertainment medium (because Internet was seen as serving video and other "TV killers") or whether cable companies should be allowed in the telecommunications medium (because Internet was seen as communication and "telco killers"). Meanwhile computers have been getting faster and mobile devices smaller/more capable. In the end, 10 years from now communication methods will be much faster and potentially very different, but I’m sure there will be similar "debates" going on.

Another set of arguments seem to be geared towards real games are only fit on consoles or high end desktops. I really don’t know why the gaming genre constantly has to be fit into a small space. Already gaming is on a variety of platforms in variety of forms from simple little text games on old cell phones to Crysis II on a $4,000 gaming rig. The gaming platform as a whole is already incredibly broad and it won’t be getting any smaller.

The real argument in this article is where are high-end games going. Again, I don’t think it matters what one guy (who obviously wants to promote his company and that’s what marketing is, don’t be surprised or offended) thinks about where gaming is going.

In my personal opinion (because hopefully much of the above was objective 🙂 ) I have no problem with another company attempting to push gaming into the cloud with an alternative publishing platform. If I don’t like it I don’t have to use it. No big deal.

However, the potential is actually quite amazing and simply mirrors what other industries have done (i.e. music purchases/distribution and now movie subscription/distribution). I’ll just use the Microsoft XNA platform as an example. Potentially (not yet but potentially) the XNA platform can run on the XBOX, PC, Silverlight and a Windows Phone 7. If Microsoft can take this to the ultimate end then why can’t I subscribe or purchase a game online and play it on my XBOX when I’m at home on my 50" LCD and play it on my laptop or enthusiast PC when I want, then play it online within my Silverlight hardware accelerated browser and finally pop in for a few minutes on my dual-core (or whatever in the future) WP7 phone? I purchased or subscribed to the game and have four platforms. I think the argument in the future would be "what do you mean you’re going to sell me a game on a single DVD and not let me play it on any device I want?"

Right now if I buy a song I would expect to be able to play it on any of my devices in any location I’m at and it would infringe on my right as a customer to be told I can’t play it on my phone and my stereo at home and in my car or on my computer at work. We only allow gaming companies to do this because the current technology doesn’t allow me to move Crysis to my phone as easily as a song. Technology will one day make that available and I fully expect to be able to one day buy/subscribe to a game once and play it on any device I choose to because it’s my game/subscription and my devices.

Heck, I expect that one day bandwidth will be fast enough and $500 PCs will be fast enough that I can travel to another country, take photos, go into an Internet cafe (or just use my phone), upload photos to my online account, retouch them and edit video, make them available to family and friends, and even play a WoW (or whatever) for a little bit all without having to carry around a laptop.

That’s where I think we’re going.