Archive for the ‘learning’ Category

RPI students create some cool things

March 9th, 2011 in gnome, learning, mozilla, open source, PlanetGNOME

At the Rensselaer Center for Open Source Software students develop open source software solutions to solve societal problems.

For example, at the HFOSS Symposium today I talked to Graylin Kim who is working on the New York Senate Open Legislation Service where people can look up any bill that is being discussed in the New York Senate, get a permanent url to share and discuss on their own websites or grab all the data via REST. The idea is to encourage more citizens to get involved in legislature. Developers can get involved at http://nysenate.gov/developers or #nyss_openlegislation @ Freenode.net for OpenLegislation

I also discovered that Ease, a slide share program for GNOME, that is currently being developed by Nate Stedman. (An earlier version, Glide, was created by an RPI student, Rob Carr.)

You can check out the RPI Center for Open Source and the other projects students are working on. The program was started by a grant from an RPI alum, Sean O’ Sullivan. He started MapInfo (now PBInsight) and JumpStart International (article).

They were at the HFOSS Symposium sharing how their program worked with other educators.

[Post edited for accuracy on March 9, 2011.]

Learning to write JavaScript

February 10th, 2011 in learning, mozilla, PlanetGNOME, Web/Tech, webapps

So now that I work at Mozilla, I figured it was time to develop a “web app” just to make sure I understood it all. And since my team is working on educational resources for web developers, I wanted to see what it was like to learn how to use some of them using resources online.

So I decided to use the resources I could find online and write some JavaScript to do a pet project of mine.

What was the problem I wanted to solve?

I really wanted a way to automatically add “Photo by <author>” to the bottom of Flickr pages I want to use in my presentations. I have a number of workarounds I’ve developed to do this in an effective way, but I really just wanted to click a button.  For example, at first, I saved the image with the author’s name as the file name, and then every time I used the picture, I added text to the slides. Then I wrote a Ruby script that went through all my picture files and added “Photo by <filename>” to them. But that is still a three step process: grab the author’s name, save the photo as the author’s name and then run the script. Also, I like searching on Flickr better than I like searching my personal archive. Tags are nice.

I also wanted to make it a service and a bookmarklet so others could easily use it.

Why did I decide to use JavaScript?

When I first started this problem, I wrote a script in Ruby. I thought I’d use Ruby on Rails to make it into a web app, but Rails looked pretty difficult to setup for a newbie, so I put it on the back burner.

Now that I’m at Mozilla, I thought it was high time to learn JavaScript.

(For the record, I have a background in C, C++ and Java. I find Ruby much more intuitive to read than JavaScript. But I find JavaScript much more readable than many other things.)

In retrospect, the Flickr API is difficult to use from JavaScript. I think using PHP would have been much easier. It did force me to use only one call to Flickr (the right solution), as adding a Flickr API call to JavaScript turned out  to be unintuitive to me. You basically build a <script> object and then append it to the document.

Like this (copied from sample code):

document.flickrURL = ‘http://api.flickr.com/services/rest/?method=flickr.photos.getInfo&api_key=’ + document.apikey + ‘&photo_id=’ + photoNumber + ‘&format=json’;

//add the flickr javascript to the page so it gets executed
//flickr automatically calls jsonflickrAPI(rsp)
var root = document.getElementsByTagName(‘head’)[0];
var oS = document.createElement(‘script’);
oS.setAttribute(‘type’, ‘text/javascript’);
oS.setAttribute(‘src’, document.flickrURL);
root.appendChild(oS);

Maybe that’s the way things are usually done in JavaScript, but it took a while to wrap my head around it. I felt like I was dynamically changing the code at execution time which made me feel like I was in a science fiction movie. Except that I didn’t think my problem warranted that complicated of a solution.

Part of my comprehension problem was that a call to Flickr calls your jsonFlickrAPI() function and you don’t get to say when that’s called. Nor change it for different calls. (Although maybe you could have several JavaScript files each with their own jsonFlickrAPI() functions. I didn’t try that.)

How did I learn?

I asked one really stupid question of my team mates. Then I decided I really needed to see if I could learn this from web resources.

I used primarily three:

  1. MDN. When I wanted to learn more about an element or what was possible, I ended up on MDN. Probably because I was familiar with this site – it’s the one that my team at Mozilla maintains! But I really didn’t find any other site that covered all topics like a reference guide. It did turn up several times in my searches too.
  2. StackOverflow. I googled most of the problems I had and several time I found good answers on StackOverflow.
  3. Personal blogs. A lot of my questions and answers were found on personal blogs. People had encountered a similar problem and they blogged about it.

How’d I get started?

It’s been a long time since I’ve written code. (Other than an occasional program or script to solve a quick problem.) I broke my problem down into nice little steps. Each one of which was functional on its own.

For example:

  1. First I wrote a “Hello World” app in JavaScript. This was to make sure I knew where the code should go, the basics of getting setup with an editor, etc. (Very easy.)
  2. Then I figured out how to make a canvas and draw an image on it. (Easy.)
  3. Then how to write text on an image. (Easy.)
  4. Then how to create a jpg of that canvas. (Was easy. Then it quit working.)
  5. Then I figured out how to have the user specify the image location and the text. (Pretty easy.)
  6. Then I figured out how to get an image from Flickr. (Not easy.)
  7. Then I figured out how to get an image from Flickr when all you have is the url of the photo page. (Really not easy.)
  8. Then I figured out how to put some javascript on a website for everyone to use. (Very easy.)
  9. Then I created a bookmarklet. (Not as easy as I thought but quick.)

What was hard?

Trouble shooting and Flickr.

  • Trouble shooting JavaScript was not always easy. If I was getting someone started with JavaScript, I’d set up their development environment and explain the tools first. Firebug, the Firefox Console and alerts ended up being my friends. Before I do more JavaScript development, I’ll explore some more debugging tools.
  • Flickr. I think the Flickr API might be really easy to use if you use a language where you could just make a call from the code. I had to create a URL and then append it as a script. It made trouble shooting harder and it felt clumsy.

A couple of times I also ran into something that made no sense to me or was taking too long to trouble shoot and instead of figuring it out, I did it a different way. I think it would be good for my education to figure out what was wrong with the initial approaches.

What did I end up with?


If you’d like to try it out, drag this bookmarklet [thisphotoby] to your bookmarks bar. (If you are on Internet Explorer, right click and save it.) Then go to a Flickr photo page and click on the bookmarklet. It will return the photo with “Photo by <author>, <url>” overlayed over the  bottom of the photo.

You can also check out the (very ugly) website I made, thisphotoby.com.

Next steps

There are a lot of things I could do to improve this.

  1. Add error handling. If anything goes wrong, well, it just doesn’t work. I didn’t do any checking or give the user any helpful tips. A terrible coding practice!
  2. Clean up the code. I copied and pasted ideas from many places and ended up with variable names and function names that follow no standard. I’d also like to find a JavaScript style guide and clean up the code.
  3. Add user preferences. It would be nice to specify which size image you want, if you want white or black text, what size text, etc.
  4. Licenses. I’d like to be able to check what permissions the user has and what license the photo is under in order to help the user understand how they can use the photo. Flickr lets you download all sizes of all photos even if they are licensed “All Rights Reserved”. This script passes on that ability, but it would be nice to also make the licensing more obvious.
  5. Create a jpg. I had it working with a png and a jpg. Then the jpg part quit working. I tried several other methods and did not get it working. Since I felt like I had accomplished my goal, I left this for later.
  6. Make a pretty website. :)

Learning division in school these days

December 28th, 2010 in kids, learning

One of the things that has frustrated us with our 10 year old’s current school is that he has no text books. This makes it hard for us to look up how he’s learning things. It’s especially frustrating in math as they now learn different methods we did.

Recently, I was struggling to show him how to divide. (Well, I wasn’t struggling to show him how to divide but my way seemed to be completely foreign to him, as if he’d never learned it before. So I was struggling to build on what he already knew.)

So I asked his teacher how he had taught the class to divide, and he sent me back this work sheet with the “4 methods he had taught them”.

Nevermind that those are 3 methods and one explanation on how to write problems – I will admit that at times I’m a bit too pedantic about saying exactly what you mean. (But really, it’s math, you have to say 3 when you mean 3!)

While it seems like a good way to understand what division is all about, it seems to be lacking in ways to easily come up with the exact answer. But it does work to teach them how multiplication and division are related.

I also really liked that it was immediately followed up with word problems, i.e. “Mike has 32 cookies. He wants to share them equally with his 6 friends. How many cookies does each friend get?”

I hope there’s a next step where they learn how to divide the “good old-fashioned way”.  Whether or not they do, I’ve already taught my 10 year old that way, although I had to teach him decimals as well. (I’m sure that when I first learned to divide, they very conveniently left out all problems with remainders and then added them in later.)

Which way do you think is the best way to teach kids about division?

What types of questions were you not allowed to ask?

October 5th, 2009 in Career, kids, learning

Earlier today I read an interesting article and tweeted:

4yos ask questions, 6yo have learned that teachers value right answers more than provocative questions
Then I shared that I was once banned from asking questions in a physics class because the teacher didn't know the answers and thought I was trying to disrupt the class. (My question asking status was reinstated after the teacher talked to my awesome math teacher and got confirmation from her college professor that the questions really were hard questions without answers.)

I've been amazed at the number of really smart people who have shared similar stories!

Q1
Q2
Q3
Q4
Q5
Q6
Q8
Q9
Q10

Do you have a similar story to share? How do we help today's kids not run into this?

For my part, I think I kept asking the "hard" questions because my parents and my other teachers were so supportive.


How long does it take to be an expert?

August 9th, 2009 in Books, learning

Photo by Scott Ableman

Photo by Scott Ableman

Malcolm Gladwell says it takes 10,000 hours to become an expert. He looked at professional hockey players, pianists and composers and said in each case it took them 10,000 hours of practice to get really good.

I’ve always thought practice was more important than talent – I think it looks like you have talent when you like something so much you spend hours and hours on it. The kid that loves baseball, plays every chance he gets and practices on his own. That kid gets good. How good he gets might depend on talent, but either way, he’ll get good.

In Outliers, a book I just started listening to, Malcolm says people have talent but without the 10,000 hours of practice, we’ll never see it.

So how much is 10,000 hours?

At an hour a day, that’s 27 years. At 3 hours a day, it’s still close to 10 years. What do you do for 3 hours a day? If you are like most of us, the only thing you do for 3 hours a day, day in and day out, is something you are paid to do. (So make your job something you enjoy doing!) Although I’d guess there are some free software developers out there who put in a lot of hours “practicing” coding every week regardless of whether they get paid for it.

How long does it take someone with a job to get really good at it? Say you got a job writing code – and you’ve never written code before – and you actually get to code 40 hours a week. (40 hours of coding, not email or meetings.) And you only took two weeks of vacation a year. After 5 years, you would have the potential to be an expert developer. (In the book, Malcolm talks about how people like Bill Gates and Bill Joy got their coding experience – he thinks experts are people that got the opportunity to practice 10,000 hours.)

So next time you admire someone for their skills and say “I could never do that” – stop and think. Did you give it the 10,000 hours?

Web Food for June

June 18th, 2008 in learning

Bumper stickers reveal link to road rage : Nature News
People who had a larger number of personalized items on or in their car
were 16% more likely to engage in road rage, the researchers report in
the journal Applied Social Psychology1.

What Thomas Edison Can Teach You about Blogging

Most blogs are abandoned after a month or two…. the average time that it takes a blog to rise to the top of the pile is around 3 years (it’s now longer).

Lost in E-Mail, Tech Firms Face Self-Made Beast – NYTimes.com

“e-mail apnea,” coined by the writer Linda Stone, which refers to the
way that people, when struck by the volume of new messages in their
in-boxes, unconsciously hold their breath.

Lost in E-Mail, Tech Firms Face Self-Made Beast – NYTimes.com
A
typical information worker who sits at a computer all day turns to his
e-mail program more than 50 times and uses instant messaging 77 times,
according to one measure by RescueTime, a company that analyzes
computer habits.

Traveltalkonline: Sailing the BVIs Vs Grenadines
For
what its worth, I heard this perspective from a sailor with much more
experience than me – "sailing in BVI is cruising on training wheels."

Long vs. Short Articles as Content Strategy
A good editor should be able to cut 40 percent of the word count while removing only 30 percent of an article’s value.

How we read online. – By Michael Agger – Slate Magazine

Nielsen holds that on-screen reading is 25 percent slower than reading on paper.

Traveltalkonline: Long Bay Bch Resort vs Sebastian’s Seaside Villas?

For an extra $50 a night, Malcolm will leave the freezer door open with a fan in front. Just ask!!

Is Google Making Us Stupid?
Immersing
myself in a book or a lengthy article used to be easy. My mind would
get caught up in the narrative or the turns of the argument, and I’d
spend hours strolling through long stretches of prose. That’s rarely
the case anymore. Now my concentration often starts to drift after two
or three pages. I get fidgety, lose the thread, begin looking for
something else to do. I feel as if I’m always dragging my wayward brain
back to the text. The deep reading that used to come naturally has
become a struggle.

Bob Sutor: Open Blog | Why I stopped using Twitter
Finally,
I think I made the wrong decision to post the tweets to my blog. They
should have been ephemeral, said and gone. Anything that warranted
posting to the blog should have had its own entry.

Findings – Futurist Ray Kurzweil Sees a Revolution Fueled by Information Technology – NYTimes.com
Are
you depressed by the prospect of dying? Well, if you can hang on
another 15 years, your life expectancy will keep rising every year
faster than you’re aging.

Findings – Futurist Ray Kurzweil Sees a Revolution Fueled by Information Technology – NYTimes.com
Worried
about greenhouse gas emissions? Have faith. Solar power may look
terribly uneconomical at the moment, but with the exponential progress
being made in nanoengineering, Dr. Kurzweil calculates that it’ll be
cost-competitive with fossil fuels in just five years, and that within
20 years all our energy will come from clean sources.

Findings – Futurist Ray Kurzweil Sees a Revolution Fueled by Information Technology – NYTimes.com
Do
you have trouble sticking to a diet? Have patience. Within 10 years,
Dr. Kurzweil explained, there will be a drug that lets you eat whatever
you want without gaining weight.

mikesimonsen: just noticed I spent more on Coffee (~$80) in May than I did on gasoline (~$60). Fuel’s fuel, right?
 
   

Bilingual people have to search for words more often

April 23rd, 2008 in learning

Anybody who knows me has probably heard me say "now, what’s that word I’m looking for?" I seem to say that many times a day – there’s a perfect word but I it takes me a few seconds to remember just what word it is. Turns out I do that more often than most because I’m bilingual. Or so says this study: Why you make the same mistake twice. They also say that every time I do that, I’m more likely to do that again as my brain learns to forget. Or something like that.

Learning Lessons While Dreaming

March 28th, 2008 in learning

A few days ago I read a story about a woman who went to Auschwitz as a girl with her little brother. On the way there her brother lost his shoe. She chewed him out and called him a "stupid boy!" Soon after that moment, they were separated and she never saw him again.

Last night I dreamt I was driving and my seven year old stepson was in the front seat. I was really mad at something he’d done and I said "If you can’t listen then I don’t think you should go to South Dakota with us." He started crying and then I lost control of the car and we started spinning off the freeway.

The point of the Auschwitz story was the woman now tries never to leave anyone with a conversation she doesn’t want to be their last. Obviously my mind thought that was an important lesson for me to learn and taught it to me in a much more emotional way than any story I could ever read!

High achiever vs Gifted vs Creative

January 1st, 2008 in learning

I just read an excellent article about the difference between a high achieving student, a gifted student and a creative student.  Our schools tend to treat high achievers and gifted students the same and they are not.  Although a student may be both a high achiever and gifted.  For example:

the teacher announces an assignment, and the high achiever quickly tries to determine what the teacher most wants so he can please and satisfy the teacher’s intentions: "What do you really want?" The gifted learner ponders what to do that would most interest her as she learns: "What I would like to do is…" Simultaneously, the creative thinker’s mind begins to race with all of the diverse and varied possibilities that could be explored.

The comparison table in the article is also really interesting.  I’m not sure the classifications are right and I might add more than the three he has, but it is really interesting food for thought.

You are always becoming smarter. Pass it on.

January 1st, 2008 in learning

From NPR’s Student’s View of Intelligence Can Help Grades:

The students in the latter group "learned that the brain actually
forms new connections every time you learn something new, and that over
time, this makes you smarter."

By the end of the semester, the group of kids who had been
taught that the brain can grow smarter, had significantly better math
grades than the other group.

You can get smarter.  So pass it on!