Oct 31

At my district we use Aeries, our Student Information System from Eagle Software.  We also use Destiny, our district-wide library system from Follett Software.  Both are great products and, better yet, both are housed on our Microsoft SQL Servers.  This allows us another level of integration since we can get to the raw database for various needs.

One way we take advantage of this is how we load our student photos into Destiny.  Destiny takes a zip file, which contains jpeg files of the students as well as a idlink.txt file, which is an index file that ties the jpeg to the student’s record.

I’m subscribed to the Follett Talk list serve, which is an email list that several Follett Destiny administrators are a part of and every day there are great discussions and help from various users around the country.

When I mentioned that we had a script to help out when updating student photos in Destiny, several were interested .  I’ve been trying to write up a formal blog post on this with great screenshots and directions but, alas, I haven’t had the time.

Anyway, one of our neighboring libraries politely called me about it this morning and I thought I should just put it out there as is for anyone who can use it.

The SQL script file and a quick documentation document are attached to this post.  Get them below.

What it does is grab all the photos (from the school sites you designate) from the server you store your Aeries photos on (this used to be our ABI server but is now our Aeries.Net server), generates the idlink.txt file and puts them all in a zip file for you.  Since it pulls the photos straight from the information in Aeries and also generates the idlink.txt automatically I always get the latest photos (such as from a picture makeup day or newly enrolled students) and also any corrections that may have been put into Aeries.

The script runs in less than a minute for our entire district and then I have a nice easy zip file to upload to Destiny.

There is a little documentation attached but whomever will do this procedure at your site will need some foundational knowledge of Aeries and SQL.  This is not for a librarian at a site that does not have knowledge/access to the Aeries server.

This does not write to any data in the Aeries database so there is no harm in running it.  If there is an error in the script (for instance, you forgot to add your proper school sites and server name) it will simply give you an error but will not cause any changes to data, so don’t worry. 

I hope this helps!

P.S. For those of you who also use BlueBear I had two extra lines of code on the script.  We use BlueBear as our ASB accounting system for our high schools.  It takes photos in the same way but needs them unzipped, all just stored in a single folder.  The last line in my script would unzip the results from above into a folder per school site for our high schools.  This way I would just run the Student Photo Update process in BlueBear and point it at the folder for the correct site.

If you have BlueBear here are the two extra lines I use:
print ‘ECHO Extracting photos for Blue Bear…’
select distinct ‘”c:\Program Files\7-Zip\7z.exe” e c:\pics\’ + cast(stu.sc as varchar) + ‘Pics.zip -oc:\pics\’ + cast(stu.sc as varchar) + ‘  >nul 2>&1′
from stu
join #pics on (stu.sc = #pics.sc and stu.bm = #pics.shortname)
where del = ” and tg = ” and bm <> ”
and stu.sc in (310, 320, 410, 430)

Destiny Student Photo Import Quick Documentation

Student Photo Queries.sql

Oct 14

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/

Aug 11

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.

Jul 14

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

Jul 6

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

Apr 21

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.

Feb 11

Have you ever wished that hitting the F1 key in Visual Studio actually returned good search results in a quick manner? 

Personally I think the F1 key returns decent results, but there certainly are a lot out there who don’t.  I mostly work in .Net so I’m in the camp of users that F1 works well for.

The think I really don’t like though is the 30 seconds or so it takes to launch the help window.  Once you’re there navigation is pretty painful.

For the last several years I’ve all but abandoned F1 and just search Google with “msdn” and my search term.  95% of the time this returns exactly what I want in the first hit.

Wouldn’t it be nice if we could make Visual Studio do this for us?  Well, we can, and have been able to for years!

Check out OriginalGriff’s solution on Code Project.  He clearly outlines the steps and I have to say his solution is quite nice and tidy.

However, I had two very minor criticism, purely for my own tastes.  This solution opens the webpage inside of Visual Studio’s web browser inside the IDE.  This works, but I really like using my own default browser (currently Chrome).  This allows me to open up various hits in several tabs and bookmark interesting solutions.  I can’t do that in the VS browser window.

Second is it grabs the selected text and performs the search on this.  If you don’t select anything it just opens up a search for “msdn”.  The original F1 functionality use to search whatever word your text cursor was on, nothing had to be selected.  I’m lazy and I like this ability.

Last, but not least, as I was writing this blog post and stated above that 95% of the time my search term came up in the first result it hit me. OMG If I think that what I want will be my first hit, why not just return Google’s first result; the equivalent of hitting the older I’m Feeling Lucky button on Google’s home page. If you look at Griff’s solution you will see below it that I proposed an alternate solution that adds these three features.  Now, when I hit F1 or Shift+F1 I, respectively, get the Google search or the first hit directly.

Enjoy!

Dec 7

We have Policies and Procedures document that we are making available on our website.  This document in its entirety easily spans several hundred pages and has a pretty lengthy table of contents. 

To help make this easy to navigate and easier to consume we are posting several of the larger topics as individual documents and making them available from a linked table of contents that is created as a web page.

The requirement is that the table of contents uses different numbering styles at each indentation.  So, for instance, the outline below:

Topic A

   Sub-topic A.1

   Sub-topic A.2

      Sub-topic A.2.1

      Sub-topic A.2.2

Topic B

Topic C

would become:

1. Topic A

   a. Sub-topic A.1

   b. Sub-topic A.2

      i. Sub-topic A.2.1

      ii. Sub-topic A.2.2

2. Topic B

3. Topic C

This document isn’t maintained in a database yet so for now the table of contents is created in good old fashioned HTML.  Using a standard <ol> (ordered list) element in HTML looks initially like this:

  1. Topic A
    1. Sub-topic A.1
    2. Sub-topic A.2
      1. Sub-topic A.2.1
      2. Sub-topic A.2.2
  2. Topic B
  3. Topic C

The way to change the numbering style is by using the CSS list-style-type style on the <ol> element with various options such as decimal, lower-alpha and lower-roman.  You can find a great example of this at w3schools.  So, I could manually change the list style of each <ol> tag based on how much it was indented, but this would be a pain to maintain.  Anytime we changed the layout I would have to change the list-style-type styles and be sure to keep everything consistent.  I thought this would be a perfect place to use jQuery.

Using jQuery I was able to define an array of the types I wanted to use.  jQuery would then find all the <ol> and nested <ol> elements and change the style for each indentation.  Once done I could simply maintain the table of contents and jQuery would handle the styling. I couldn’t find any jQuery plug-ins that did this so here is the code I came up with.  If I end up using more than a couple of times I’ll probably create a plug-in for it.

1: function styleOutline() {
2: // List-item-styles we would like to use
3: var olStyles = ['decimal', 'lower-alpha', 'lower-roman'];
4:
5: // Process the parent element.
6: styleOl($(‘ol:first’), 0);
7:
8: function styleOl(element, styleIndex) {
9: // Apply style
10: element.css(‘list-style-type’, olStyles[styleIndex % olStyles. length ]);
11:
12: // Call recursively for each nested ol
13: element.children().each(
14: function (i) {
15: var ol = $( this ).children();
16: if (ol) {
17: styleOl(ol, styleIndex + 1);
18: }
19: }
20: );
21: }
22: }
23:

This works great and took me only a couple of minutes to do. Definitely an improvement over the manually written way.  I hope this helps someone else out there!

Oct 5

We have a particular web product that we use for all of our clients.  It is a pretty incredible system and has several hundred clients.  We are one of their largest ones so, between our implementation, and their normal customer needs its understandable why they cannot accomodate every one of our requests right away.

That being said, there was one slight “feature” that went slightly against one of our policies.  So, what to do?  Well, I put on my curiously tipped white hat and go to work.  One of the cool features of the system is they allow us, the admins for our group for all intensive purposes, to update portions of the page for our users.  They don’t escape HTML so it turns out I’m able to inject my own JavaScript code.

Ooohhh, that’s bad.  ;) I let the company know but I proceed on.

Turns out they, being the creative bunch they are, make use of jQuery.  This is definitely turning into a possibility with my toolbox already stocked and ready to go.

The particular portion of the page I choose to launch my JavaScript from is ideal because it is on the navigation bar, ensuring that it will be displayed on almost every screen.  Because we can only change content for our users it ensures that my changes will only affect our users and not those of their other clients.  However, with 5,000 users I had better make sure my code is well tested and clean.  I still have the ability to disrupt my 5,000 users if I make a bad mistake.  Point noted.

The vendor puts a character limit on the particular area of the page I’m changing.  That means I have to inject JavaScript that tells the browser to load a larger script from elsewhere.  No big, I put the script on our department website.  Hmmm, not so good.  The system is now throwing a warning that I’m loading JavaScript from a non-secure source.  Hmm.  Sure would be nice if I could load the script directly on my vendor’s server.

Well, I can. :)  The vendor also allows us to upload documents to a library that our users can download from.  So, I upload the script.  Uh, oh, didn’t work.  Turns out they block all but a few extensions.  So, instead of calling it myscript.js I change it to a text file called myscript.txt.  That uploads great and, guess what, the browser is happy to execute it.  Great!  On my way.

After a few tests it turns out I’m able to quite nicely make our little “issue” a thing of the past.  First I check to make sure the page in question is the one being viewed.  That way the bulk of the code (all 6 lines of it) runs only when necessary.  Then it cleans up after itself by removing my injected code from the page DOM.  Nice!

It’s not foolproof of course.  If the user isn’t running JavaScript then my trick won’t work, however,  half the system won’t work for them anyway since JavaScript it is required.  Also, if someone is sneaky enough they can load the original source and see where I injected my code.  But, if they are going to do that we have bigger problems then them simply disabling my script.

OK, that covers the techy issues, what about the people ones?  Well, as you may have guessed, no matter how many times we alerted our users to the changes we made, some users started calling the vendor’s Help Desk asking what happened to the report they were used to.  The vendor then called me after spending two days trying to solve the issue they weren’t seeing.  They didn’t really care for the changes.  They understood the necessity and gave me props for how I handled it but now their Help Desk had no idea if a problem call was because of their system or my code.  Granted, this totally makes sense.

So, they gave us a choice.  We can continue to develop our own “customizations” but we have to take over all Help Desk calls for our users for the entire system.  I understand that, but directly supporting 5,000 users is not something we are capable of doing.  I have to note also that the Help Desk is absolutely outstanding, one of the best  Ihave ever worked with.

So, after the vendor agreed to look into implementing our change we are allowed to keep the code and support the Help Desk for any questions regarding this one issue.  Once the vendor has solved the problem we will remove it and go on our way.

So, here is the moral of the story: Hacking your vendor’s site open doors to lots and lots of capabilities, however, it may aggravate your vendor a little or, quite possibly, cause an early termination to your contract.  I suggest you keep this little tool in your developer’s pocket for extreme cases.

It was fun and our vendor is great.  Once I put the change in place we started to come up with lists of additional “nice to have” features I could implement, but, in the end, we’ll just hand those over to our vendor and see if they make it in someday.

Sep 19

We had a great time at the Inland Empire launch of the new Windows 7 Phone.  I got to present on developing for the phone along with Dustin Davis and Oscar Azmitia.  James Johnson and the Inland Empire .Net Users Group hosted the event at DeVry University.  Fun was had by all.

I recorded the sessions so I will have them up soon for all to see how we did.

Take care and happy developing!

« Previous Entries