Monday, February 27, 2012

Free, Cheap, Open Source talk at CCSA

This is the presentation I gave on Wednesday Feb 29th 2012 at  California Chater Schools Conference in Sacramento. It talks about how we use open source software at SCVi Charter school.












Tuesday, February 21, 2012

The Maker's Schedule Vs. The Manager's Schedule

There is a wonderful article written on Paul Graham's blog  about the different work schedules of Makers and Managers.  Anyone who ever schedules a meeting of any kind should have to read this first.  If you have "Makers" in your organization, you need to understand the price you are paying.  You may be paying for an entire day's worth of work when you only meant to pay for an hour.

Here are a few snippets that I think are especially interesting..
"One reason programmers dislike meetings so much is that they're on a different type of schedule from other people. Meetings cost them more.

There are two types of schedule, which I'll call the manager's schedule and the maker's schedule. The manager's schedule is for bosses. It's embodied in the traditional appointment book, with each day cut into one hour intervals. You can block off several hours for a single task if you need to, but by default you change what you're doing every hour.

When you use time that way, it's merely a practical problem to meet with someone. Find an open slot in your schedule, book them, and you're done.

Most powerful people are on the manager's schedule. It's the schedule of command. But there's another way of using time that's common among people who make things, like programmers and writers. They generally prefer to use time in units of half a day at least. You can't write or program well in units of an hour. That's barely enough time to get started.

When you're operating on the maker's schedule, meetings are a disaster. A single meeting can blow a whole afternoon, by breaking it into two pieces each too small to do anything hard in. Plus you have to remember to go to the meeting. That's no problem for someone on the manager's schedule. There's always something coming on the next hour; the only question is what. But when someone on the maker's schedule has a meeting, they have to think about it.

For someone on the maker's schedule, having a meeting is like throwing an exception. It doesn't merely cause you to switch from one task to another; it changes the mode in which you work.

I find one meeting can sometimes affect a whole day. A meeting commonly blows at least half a day, by breaking up a morning or afternoon. But in addition there's sometimes a cascading effect. If I know the afternoon is going to be broken up, I'm slightly less likely to start something ambitious in the morning. I know this may sound oversensitive, but if you're a maker, think of your own case. Don't your spirits rise at the thought of having an entire day free to work, with no appointments at all? Well, that means your spirits are correspondingly depressed when you don't. And ambitious projects are by definition close to the limits of your capacity. A small decrease in morale is enough to kill them off.

Each type of schedule works fine by itself. Problems arise when they meet. Since most powerful people operate on the manager's schedule, they're in a position to make everyone resonate at their frequency if they want to. But the smarter ones restrain themselves, if they know that some of the people working for them need long chunks of time to work in."



"When you're operating on the manager's schedule you can do something you'd never want to do on the maker's: you can have speculative meetings. You can meet someone just to get to know one another. If you have an empty slot in your schedule, why not? Maybe it will turn out you can help one another in some way.

Business people in Silicon Valley (and the whole world, for that matter) have speculative meetings all the time. They're effectively free if you're on the manager's schedule. They're so common that there's distinctive language for proposing them: saying that you want to "grab coffee," for example.

Speculative meetings are terribly costly if you're on the maker's schedule, though. Which puts us in something of a bind. Everyone assumes that, like other investors, we run on the manager's schedule. So they introduce us to someone they think we ought to meet, or send us an email proposing we grab coffee. At this point we have two options, neither of them good: we can meet with them, and lose half a day's work; or we can try to avoid meeting them, and probably offend them. "

"Those of us on the maker's schedule are willing to compromise. We know we have to have some number of meetings. All we ask from those on the manager's schedule is that they understand the cost."




Monday, February 20, 2012

Setting Up Google Apps For Education

We've been using GoDaddy for our Web Hosting, Mail Hosting, and DNS Services.  We have been using them since the school opened and have been pretty happy with them. Though, there are other services available and we are always looking at options. One option that many schools use is Google Apps For Education.  Since we are a school, Google offers their entire Email, Calendar,  and Apps suite for free.

This blog posting is a cronicle of our process of moving to Google Apps for our school .

1) Step One : Register Your Domain.
We already had an existing domain so we could have moved that to Google. Though, we had been looking at a shorter one for quite some time. We decided to coordinate the two events together.  For our domain services, I used DynDNS. I really like them. They have a nice web interface and reasonable prices.  Registering the domain was pretty straightforward. I also paid for their custom DNS service which I have found to be very helpful with DNS forwarding and sub domains.




2) Step Two: Set Up Your Domain With Google
You can go to the Google K-12 page and click on the Get Apps today button.  The page will have you set up your initial administrator account and then have you verify your domain.  Verifying your domain can be a bit tricky. You have some choices.
  1. Add an HTML file to your web server to be downloaded via FTP.
  2. .
  3. Use a Google Analytics tracking code.
Since this was a new domain that did not have a web server or a FTP server set up, I had to go with Option #3.  This wasn't too difficult. I went back to DynDNS and added the record. 
 3) Step Three: Configure Google Apps
This part is pretty straightforward.  We were able to do it all from the Google apps Dashboard for our domain. The only part that was slightly tricky was setting up mail in DNS.  By default, your users will get to e-mail under the google domain. For example, in our case that would have been http://mail.google.com/a/scvi-k12.org.  We wanted our users to see their mail under our own domain, i.e. http://mail.scvi-k12.org. To fix this, you need to add a "MX" record to our DNS settings.  With DynDNS, this was not difficult.  I simply went to the DNS settings and added the servers that google suggested.

This allows our users to get to mail under http://mail.scvi-k12.org instead of http://mail.google.com/a/scvi-k12.org.

4) Step Four: Request NonProfit/Educational Status
The standard Google Apps domain only allows you to add 10 users.  You'll need to request to have your domain upgraded to Google Apps For Education.  This is done by using the Application Form on Google's Web Site.

5) Step Five: Add Users
In the long term, we'd like to have an internal LDAP server that stores all school accounts. This would include logins, passwords, and e-mail addresses for all staff and students. We could then drive Google from the LDAP logins.  However, this is beyond the scope of what we want to bite off right now.

For now, we will add users manually. For Facilitators, Staff, and Admin this will mean creating the account from the Google admin console.  For students, we are going to import users using a CSV file. We currently use Rediker to keep track of our student population. We can dump users out of Rediker and then process the information with a python script which creates a CSV file for Google. Here is the basic strategy of how the accounts will be named.
  • Facilitators, Staff, and Admin : Google ID/ E-Mail name will be First.Last@scvi-k12.org  
    • This is the same as we have now under the scvcharterschool.org domain.
    • Google will replace our Go Daddy accounts, it will not be second account.  The legacy scvcharter accounts will be re-directed to Google.
  • Learners: We have a few choices
 We are currently leaning towards Short Unix Names.  This is gives a visible distinction between staff and students and is consistent with what other schools are doing. We are still investigating how these will be grouped and what permissions will be allowed at each level. For example, we may not want all grades to be able to send e-mail from their Google ID.  When this is worked out, I'll put the details in a future posting.

Saturday, February 18, 2012

Using A Rosewill RNX-N250 on Ubuntu Linux

I was given an opportunity to speak at the California Charter School Conference in Sacramento about using Open Source Software in Education.  I wanted to bring some Linux boxes to demo and show folks how they work. However, I had a problem.  I was told that there may be no wired network at the conference. Since most of our Linux boxes at SCVi are older, donated machines, they don't have a wireless interface.

I needed to pick up some aftermarket wireless adapters so that I'd be able to demo from the machines I planned to bring.  Though, getting devices that work properly on Linux can get interesting at times.  After a little research, I decided to go with the Rosewill RNX-N250 wireless adapter. Fortunately, Newegg was having a "Shell Shocker" deal at the time so I was able to pick them up for $16 each.



When they arrived, I put the CD in the drive and saw drivers for Mac and Windows, but nothing for Linux.  Checking the details on Newegg showed that these devices should work on Linux and that they use the Realtek RTL8192CU chipset.  After some searching around. I was able to find drivers on the Realtech Web Site.

DescriptionVersionUpdate
Time
File
Size
Download
Site
1
Site
2
Site
3
Site
4
Site
5
Site
6
Linux Kernel 2.6.18~2.6.38 and Kernel 3.0.2
Android 1.6~2.3 and 4.x
3.3.2_31922012/1/98322kHKCNUS2US3US1UK1

The driver only works with Linux Kernel 2.6.18~2.6.38 and Kernel 3.0.2 so you  need to make sure yours is within this range. This can be done in the terminal with the 'uname' command.

$ uname -a
Linux LOGOS 2.6.32-38-generic #83-Ubuntu SMP Wed Jan 4 11:13:04 UTC 2012 i686 GNU/Linux

Once you download the package, you can run the install.sh script and install it. (I had to change permissions on mine).  Once the installation is done, reboot your computer and your wireless adapter should be working.

Monday, February 6, 2012

Understanding Force Quit On The Mac

How many times have you had an application go haywire and then needed to "Force Quit".  Ever wondered what that means and why it is necessary?  You probably thought,  "why can't I just close the app and let it die?"   For those folks with a deep need to tinker and understand, this blog post is for you.

One of the greatest things Apple ever did was to decide to bring OSX to the macintosh.  OSX is based on the Unix operating system. Specifically, it's based on the NeXTSTEP OS which was a very special version of Unix tailored by Steve Job's NeXT corporation.

All versions of Unix allow "Pre-Emptive MultiTasking" which means many different processes can by many different users at the same time.  Apple OS X,  Linux, Sun Solaris, Cray Unicos, IBM AIX, HP uX, and any other version of Unix will support this feature.  The wonderful thing about this is that you can have one user running one process and another user running another process and they won't normally interfere with each other.

You actually can see this if you open a Terminal.  On your Mac, open Terminal and type "ps".  The "ps" command will show you all the processes that are running.

Every process has a "Process ID" that is given to it.  It also will have a parent process and the process ID of the parent is shown as well.

Though, sometimes, things go wrong. Sometimes a process will find a way to hog system resources or behave erratically. Sometimes, a process would go so wrong, that you had to force it to die.  For this reason, Unix needed a command to talk to send messages to the process, and, if necessary, shut the process down. So, the "kill" command was created.


Kill takes a "signal" which is sent to the process. If you just type "kill" and your process ID, that signal will be "SIGTERM" which tells the process to terminate. Though, if the process is really wedged tight, that won't be enough. So, there is a more lethal and powerful signal, "SIGKILL" which can not be ignored.  In unix, each signal has a number. For "SIGKILL" the number is 9 so a SIGKILL is usually referred to as a "kill -9".


When you are doing a "Force Quit" on the Mac, this is exactly what you are doing.  It's a "kill -9" wrapped in a nice user interface.  Though, if you wanted to play Unix Nerd, you could do the same thing from a shell.

The Kill Command

The Kill Command used to send a signal to a process. The signal sent might not necessarily be to terminate execution. The following table is a list of some of the signals supported.
SIGNAL NUMBER DEFAULT EVENT Explanation
HUP 1 Exit Hangup Tells the program to reread all of its configuration files.
INT 2 Exit Interrupt
QUIT 3 Core Quit Terminates Program and leaves a core file.
ILL 4 Core Illegal Instruction
TRAP 5 Core Trace/Breakpoint Trap
ABRT 6 Core Abort
EMT 7 Core Emulation Trap
FPE 8 Core Arithmetic Exception
KILL 9 Exit Killed Cannot be caught or ignored.
BUS 10 Core Bus Error When used with Celpaint, will cause it to save out the planes.
SEGV 11 Core Segmentation Fault Will cause Softimage, Maya and Photoshop to save out and then exit.
SYS 12 Core Bad System Call
PIPE 13 Exit Broken Pipe
ALRM 14 Exit Alarm Clock
TERM 15 Exit Terminated Terminates, but is more gentle. It gives the process a chance to clean up. This is the default.
USR1 16 Exit User Signal 1 Causes the font server to re read the configuration file.
USR2 17 Exit User Signal 2 Causes the font server to fluch the font cache.
CHLD 18 Ignore Child Status Changed
PWR 19 Ignore Power Fail/Restart
WINCH 20 Ignore Window Size Change
URG 21 Ignore Ugrent Socket Condition
POLL 22 Exit Pollable Event
IO 22 Exit input/output possible signal
STOP 23 Stop Stopped (Signal)
TSTP 24 Stop Stopped (User)
CONT 25 Ignore Continued
TTIN 26 Stop Stopped (tty input)
TTOU 27 Stop Stopped (tty output)
VTALRM 28 Exit

Saturday, February 4, 2012

Uploading To YouTube From The iPhone

While working on an iPhone application, I wanted to add the ability to share videos on YouTube.  Since the iPhone comes with a YouTube application, I expected this to be pretty easy. What I found was that, although not terrible, there were more options for doing this than I expected. The choices you make depend on the amount of integration you want with your application.  If you are looking at a similar scenario, here are some options to consider.

1) Have Users Upload From A Photo Album
By far, the simplest way to upload a video to YouTube from your iPhone is to make use of the built-in "Send To YouTube" button in the photo albums. You can have your application save the movie to the phone, and then have the user share it from there.  Making your application save a movie to the phone is pretty easy and can be done with the following line of code.

if (UIVideoAtPathIsCompatibleWithSavedPhotosAlbum (pathToMovieFile))
{
    UISaveVideoAtPathToSavedPhotosAlbum (pathToMovieFile, nil, nil, nil);
}

Once the movie is saved, the user needs to share it from their album.   To do this, they click on the "Pictures" icon on the phone and go to "Camera Roll"





You can then browse to the video you want to upload.  When you find it, click on the "Send To YouTube Button". Your phone will guide you through uploading the video.


First, it asks you to log in to your YouTube account. Generally, this is a GMail account.


Once you enter your credentials, you are taken to a very nice page to enter information about your video and upload it. 


Once it is done, you'll get a confirmation that the movie uploaded. The nicest thing about all this is that you don't have to write any more code than what it took to create and save the movie file. The YouTube login dialog and details page all are handled by the phone.

2) EMail The Video To YouTube Mobile
YouTube has a nice feature that allows you to get an e-mail address that will publish videos for you. You simply send e-mail to this address, and it appears on your YouTube channel.  To do this, you need to be able to send your movie as an e-mail.  You could use the above example and simply use the "EMail Video" button. Though, if you wan to be a bit more deluxe, you could have your application spawn the e-mail message with the address already filled out.  Sending an e-mail from the phone is pretty straight forward using the MFMailComposeViewController class.  Rather than put all the code here, there is a great Apple Example you can reference.

Of course, you'll need to know the YouTube address for your user.  You get it from the YouTube web site under "Mobile Setup" in your account settings.  I could walk you through this, but it's easier to let YouTube explain in the following video.



3) Full You Tube Integration With Your Application
The most deluxe, and also the most difficult you can choose is to write code to  integrate YouTube into your application. For instance, you could have a "Share On YouTube" button in your application that walks the user through uploading their video.  This would provide the same experience as the first option, but do it entirely from within your application.  Essentially, you will need to implement all the code from Step #1 yourself in your application. This is considerably more work than the above options, but also provides the nicest experience for your user. 

Here is an example screen from our application.  We wanted the e-mail button to share the movie on e-mail, which also would provide YouTube sharing through the above options. We also added  a YouTube button which we wanted to give the same experience as option #1 above.  In this particular version, YouTube and Facebook were not complete yet, so they are marked as "Coming Soon".


If you want to go to this level of integration, you will need to download the Google Data API for Objective C. There is an SVN Command that will download the API code so you can use it from your project. Once you download the code, there is a YouTubeSample.xcodeproj that will help you get started.  There's a couple things you'll notice right away.

1) You'll need a Google Client ID for your application.  This can be obtained by going to the Google API's Dashboard.
2) You'll need a YouTube Developer Key for your application. This can be obtained from the YouTube Dashboard.

Once you have the above two things, you'll be able to run the Google/YouTube Sample that comes with the sample code. You can upload videos using multiple different YouTube/Google accounts. You can also view information about them.

The GDataAPI is going to give you some options on how you post your video and you are going to need to decide if you want to request these from your interface, or if you want to decide for the user.  Here is some Google example code that shows some of these options.

GDataYouTubeMediaGroup *mediaGroup = [GDataYouTubeMediaGroup mediaGroup];
[mediaGroup setMediaTitle:title];
[mediaGroup setMediaDescription:desc];
[mediaGroup addMediaCategory:category];
[mediaGroup setMediaKeywords:keywords];
[mediaGroup setIsPrivate:isPrivate];

In our case, we wanted to control these things so we didnt' ask the user. Though, they have the ability to change these things later by logging in to YouTube.

[Posting Not Yet Complete - This project is still in progress.   I'll post more as I work this out]

The Bodelin Pro Scope Digital Microscope

At SCVi Charter School We needed a couple small microscopes for our 8th grade science learners.  We decided to try out the Bodelin Pro Scope Mobile Microscope.  These can be purchased for around $400 each and must be used directly with an iPad iPhone, or iPod Touch.


If you decide to try one of these, configuration is a little bit tricky so let me walk you through it. 

1) Install the AirMicroPad iPad application from the iTunes Store.
This is free to download and install from the iTunes store.  Once it is installed, you'll see the icon for it on your iPad.


2) Determine Static IP Address Of Your Device
Each microscope comes pre-configured with a specific IP address.  This was written both on the box and on the microscope itself.  To find it on the microscope, look at the sticker on the bottom. Here is what it looked like on ours. You can see the IP address where it says "IP Addr:" as 192.168.239.1


3) Connect and Configure Your iPad
The microscope will create its own wireless network. You need to connect to it with your iPad. To do this, go to Settings and choose the Wi-Fi option.  The Pro Scope will show up as an available network. In this example, it is "AirMicro239".  Click on the network to attach to it.



OK,. now comes the tricky part. You need to configure your iPad to use a Static IP address. Click on the AirMicro239 network (or whatever your microscope's network is named) and click the "Static" tab. You then need to set the "IP Address" and the "Subnet Mask".  For the IP Address, choose something where the first three numbers are the same as your microscope, but the last one is different. The numbers can be in the range 2-254.  In this example, I chose 192.268.239.100 since my microscope is 192.268.239.1. Also note, that no two devices on the network can have the same IP address. So, if you connect multiple iPads to this scope, they each need to have a different number.  i.e. 192.168.239.100, 192.168.239.101, 192.168.239.102, etc.

You also need to configure the "Subnet Mask". This will be the same for all devices as 255.255.255.0.




Note: While you are attached to the microscope, you will not have access to the internet. Your  iPad will be completely dedicated to using the microscope until you are done.  When are are done using your microscope, you'll need to reconnect to your original network.

4)  Have Fun!
You can now start the AirMicroPad application on your iPad and start looking at things.  Here are some images I captured.

 Lincoln memorial from a penny.

Titanium watch back.

Titanium watch bezel.

Hamilton's eye from a $10 bill.

Lincoln memorial on a $5 bill.

Detail from a $20 bill.