New ebooks blog

I’ve started another blog for ebook stuff. General ed tech hackery and random thoughts will continue to appear here.

Share and Enjoy:
  • Print
  • Digg
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Yahoo! Buzz
  • Twitter
  • Google Bookmarks
  • connotea
  • Diigo
  • email
  • Google Buzz
  • HackerNews
  • Reddit
  • RSS
  • Slashdot
  • Technorati
  • Tumblr
Posted in Tech | Comments Off

Ever feel like you wandered into a parallel universe?

This has to be one of the goofiest things I’ve ever read.

“The ebooker mantra that “Amazon is my friend and will do me no harm”

I’ve never heard an “ebooker” (by which he apparently means readers and authors) say that even once, much less often enough to be described as a “mantra”. Certainly I’ve never confused Amazon with one of my friends; I’ve always known that Amazon is a profit-making business whose goals may or may not be congruent with my own at any specific moment.

“thinking that when that happens authors will flourish by directly dealing with megacorporations like Amazon”

Yep, you’re clearly much better off directly dealing with small, caring, mom-and-pop operations like Lagardère (owns Hachette), News Corp (owns HarperCollins), Holtzbrinck (owns Macmillan), Pearson (owns Penguin), Bertelsmann (owns Random House), and CBS (owns Simon & Schuster).

Because they are your “friends”.

Right.

“how long will it be before Amazon starts squeezing authors dry”

Yeah, maybe they’ll reduce royalties from 70% to 15% and base their relationship with authors on a business model that could be compared, unfavorably, with a payday loan operation. Oh, wait: his friends are already doing that, aren’t they?

This guy needs an editor. :-)

H/T: Mad Genius Club

Share and Enjoy:
  • Print
  • Digg
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Yahoo! Buzz
  • Twitter
  • Google Bookmarks
  • connotea
  • Diigo
  • email
  • Google Buzz
  • HackerNews
  • Reddit
  • RSS
  • Slashdot
  • Technorati
  • Tumblr
Posted in Tech | 5 Comments

Bulk Downloading Google Web Fonts for local use

Google Web Fonts is a very large collection of freely-distributable fonts (some great, some not so great :-) ). They provide a variety of methods for using these in your web pages, which are all fine if you need just a couple of them. Unfortunately a recent project requires several hundred of them. Loading them over the web at runtime is a non-starter — it’s just too slow (I need to load every font so I can display the full collection as type samples). You could download the fonts one at a time, but I’m way too lazy for that. Ruby to the rescue!

Update: I see that WordPress (or at least this theme) eats indentation even if you wrap the code in <code></code> tags. Fail. Oh, well. If you have a use for this, I’d bet money that your editor will handle reindenting the code for you. Heh.


# Font downloader for Google Web Fonts.
# Puts the fonts in a file called "Fontname.ttf" (spaces in the font name are removed)
# and outputs the CSS code to load the fonts.
# Run with something like ruby snagfonts.rb > fontloader.css to get the CSS font directives in a nice file.
# Copyright 2012 by Contraterrene eLearning Group, LLC
# MIT License or Ruby License, your choice.

require 'rubygems'

require 'open-uri'
fonts = [
"Aclonica",
"Annie+Use+Your+Telescope",
"Anonymous+Pro",
"Allerta+Stencil",
"Allerta",
"Amaranth"

# Add all you want :-) Just be sure to replace any spaces in the font name with +

]

baseURL = 'http://fonts.googleapis.com/css?family='

fontcss = "";
fonts.each do |font|
fontURL = baseURL + font
open(fontURL) {|f|
# This file contains the Google-based CSS rules for the font.
fontCSS = f.read()
# Extract the URL for the actual font data.
urlstr = fontCSS.match(/url\(\'([^\']+)/)
url = urlstr[1]
# Read the TrueType font data
gttf = open(url)
ttffontCSS = gttf.read()
# I'm putting my fonts in a fonts/ subdirectory, which needs to exist ahead of time.
fname = "fonts/" + font + ".ttf"
# Get rid of any + characters in the font name - some OSes don't like that.
fname = fname.gsub(/\+/,'');
fontFile = File.new(fname, "w")
fontFile.syswrite(ttffontCSS)
fontFile.close
gttf.close
# Tweak the CSS font directive so it uses our local copy rather than Google's copy
fontCSS = fontCSS.sub(url,fname)
fontcss = fontcss + fontCSS;
}

end
puts fontcss

This little script will download all the fonts you’ve listed in the array, and output the correct CSS to load them. As written, the fonts will be saved in the fonts/ directory (which you must create ahead of time), while the CSS goes to standard output (which you can redirect to a file). It should be simple enough to mod if you want something else.

Sample CSS output:

@font-face {
font-family: 'Aclonica';
font-style: normal;
font-weight: normal;
src: local('Aclonica'), local('Aclonica-Regular'), url('fonts/Aclonica.ttf') format('truetype');
}
@font-face {
font-family: 'Annie Use Your Telescope';
font-style: normal;
font-weight: normal;
src: local('Annie Use Your Telescope'), local('AnnieUseYourTelescope'), url('fonts/AnnieUseYourTelescope.ttf') format('truetype');
}
@font-face {
font-family: 'Anonymous Pro';
font-style: normal;
font-weight: normal;
src: local('Anonymous Pro'), local('AnonymousPro'), url('fonts/AnonymousPro.ttf') format('truetype');
}
@font-face {
font-family: 'Allerta Stencil';
font-style: normal;
font-weight: normal;
src: local('Allerta Stencil Regular'), local('AllertaStencil-Regular'), url('fonts/AllertaStencil.ttf') format('truetype');
}
@font-face {
font-family: 'Allerta';
font-style: normal;
font-weight: normal;
src: local('Allerta Regular'), local('Allerta-Regular'), url('fonts/Allerta.ttf') format('truetype');
}
@font-face {
font-family: 'Amaranth';
font-style: normal;
font-weight: normal;
src: local('Amaranth'), url('fonts/Amaranth.ttf') format('truetype');
}

Share and Enjoy:
  • Print
  • Digg
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Yahoo! Buzz
  • Twitter
  • Google Bookmarks
  • connotea
  • Diigo
  • email
  • Google Buzz
  • HackerNews
  • Reddit
  • RSS
  • Slashdot
  • Technorati
  • Tumblr
Posted in Tech | Comments Off

Pure HTML5/JavaScript color picker for Webkit

Touch/mobile-friendly. No Flash. No external images. No reliance on external frameworks (such as jQuery). No CSS (style to suit yourself). Self-contained JavaScript object (should work without interfering with any framework you’re using).

Enjoy.

 

Share and Enjoy:
  • Print
  • Digg
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Yahoo! Buzz
  • Twitter
  • Google Bookmarks
  • connotea
  • Diigo
  • email
  • Google Buzz
  • HackerNews
  • Reddit
  • RSS
  • Slashdot
  • Technorati
  • Tumblr
Posted in Tech | Comments Off

Dynamic Generation and Injection of CSS Using Data URIs

This snippet illustrates how to generate and parse CSS dynamically.

 

Share and Enjoy:
  • Print
  • Digg
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Yahoo! Buzz
  • Twitter
  • Google Bookmarks
  • connotea
  • Diigo
  • email
  • Google Buzz
  • HackerNews
  • Reddit
  • RSS
  • Slashdot
  • Technorati
  • Tumblr
Posted in Tech | Comments Off

What I Did on My Winter Vacation

You can now build your own installable web apps for iPhone, iPad, and Android  at: https://mobimorphic.com/ (update: the web apps will also work in the Kindle Fire browser, but as yet I haven’t found a way to install them to the home screen).

Note that you DON’T need to be a programmer to build one of these — that was the design goal. If you can use Google Reader or set up a Google Calendar or Flickr album you can use this. Conversely, if you are a programmer you can use the External Code block and go as far as your imagination and skills can take you.

I’ve been working on this stuff for about a month, and I think it’s time to let other people start beating on it. It definitely needs more extensive testing on Android — works fine on my cheapie Android phone and on my Kindle Fire, but there are about a billion different configurations of Android out there. Let me know if something breaks. Note that there are two links on that page — the first goes to a sample app that needs to run on a mobile device to be fully functional. The second is to the self-service app builder, which needs to run on a desktop or notebook using Google Chrome or Safari (no Firefox or IE support, sorry).

Supported resource types at present: Web feed (RSS and Atom), Twitter feed, Flickr photo sets, podcasts (both audio and video), YouTube channels, Google Maps, user-entered HTML (includes a WYSIWYG editor), external code, external site, phone dialer, SMS text message, iTunes store, email, Google Calendar, and Facebook.

Next steps: performance optimization, more themes, and better docs. I also have some ideas for cool new blocks, and want to make Facebook an internal resource (like Twitter) rather than an external link.

 

Share and Enjoy:
  • Print
  • Digg
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Yahoo! Buzz
  • Twitter
  • Google Bookmarks
  • connotea
  • Diigo
  • email
  • Google Buzz
  • HackerNews
  • Reddit
  • RSS
  • Slashdot
  • Technorati
  • Tumblr
Posted in Tech | Comments Off

What is the modern equivalent of BASIC?

In this post, Mark Guzdial brings up an issue that’s generated a fair amount of interest in recent years.  The old-school personal computers — Apple II, Atari, Commodore — all came with a free, and built-in, BASIC interpreter. BASIC even came with PC-DOS/MS-DOS.  This onboard BASIC was the first exposure to programming for many (I’m tempted to say most) of today’s programmers.

Now, no one would argue that BASIC is a great language. It was, however, free and ubiquitous – there were problems if you wanted to share your Atari BASIC program with someone who had an Apple II, but often you could make the code work with a little bit of ingenuity.

Where do modern kids get that experience?  Are we creating a generation of appliance users who (if they’re exposed to programming at all) get their first experience in a behemoth like Java?

So there’s no confusion here: I like Java (well, I like the JVM anyway :-) ), and have written more than my share of it. However, it doesn’t exactly lend itself to casual tinkering.  Compare:

10 PRINT "Hello, world!"

1 line, 11 characters of overhead, what the code does is obvious at a glance, even to someone who doesn’t know programming (they might wonder about the 10, but that’s about it).

to:

public class HelloWorld {

     public static void main(String[] args) {
          System.out.println("Hello, World!");
     }

}

6 lines, 112 characters of overhead — plus you have to compile it, maybe set up your CLASSPATH, and perhaps perform other chores that stand in the way of instant gratification. Also, the code is largely opaque to a programming-naive reader. “public class”? “static”? “void”? Say what?

There have been many attempts to fix this. Scratch from MIT, Alice from Carnegie Mellon, indie projects such as Hackety Hack from why the lucky stiff (please come back, _why! We miss you!), special purpose scripting languages such as LSL, and several others.

With the exception of LSL, most of them are excellent (Cory Ondrejka, author of LSL:  “[N]ote to self, next time spend more than one night designing language.:-) ).  I’ve had good luck teaching this type of language to an audience of K-12 teachers, most of whom had no background in programming.

Where they come up short is ubiquity. They’re almost all free, which is great, but they have to be installed, which is not so great. Most school computers are locked down extremely tightly (an interesting topic its own right). In fact, one of my students was reprimanded for installing Scratch on her classroom machines.

Even if you are permitted to install the software, the installation step still creates a barrier for sharing your creation with your friends, since they in turn have to install something before they can run your code.

MIT has worked around this to some degree with their Java (and now Flash) web-based Scratch players, but Java and Flash present their own issues (school firewalls or other security software may block Java and Flash, Windows machines, and starting with OS X Lion, Macs, no longer come with Java installed, Flash doesn’t work at all on iPhone/iPad, and doesn’t work very well on Android).

So… what to do?

I would argue that JavaScript is the modern equivalent of BASIC; it’s free, ubiquitous, and has the requisite nasty, nasty syntax. :-)   Any kid with a web browser and a text editor can write and run JavaScript without installing anything. HTML 5 opens up the possibility for impressive visual and sound effects that can be shared with anyone else on the planet who has a modern browser.

Even with the ugly syntax, JavaScript is a much better language than old-school BASIC. Closures, anonymous functions, objects — there are a lot of Big Ideas in there.

Besides the syntax, the other drawbacks of JavaScript include performance and the sandbox model (sandboxing is essential when you’re running arbitrary code from random web sites, but extremely inconvenient when you’re running your own trusted code).

There are workarounds. There are new packages that let you use better syntax (e.g., CoffeeScript, which gives you Ruby-like syntax, the experimental ClojureScript, which gives you Lisp, and many others).

With respect to speed, Google has invested major effort in their V8 JavaScript compiler, which gives you near-native code performance. It’s much, much faster than classic JavaScript.

There are also several options for those who chafe at the sandbox.

Node.js lets you access the file system, write servers, and similar stuff.

Packages such as PhoneGap and Appcelerator Titanium let you write JavaScript applications that run on phones and other mobile platforms. In both cases, the code has direct access to phone features such as the camera, microphone, contact list, geolocation, accelerometers, and so on. PhoneGap works by calling native routines from interpreted JavaScript, while  Titanium precompiles the JavaScript to native code.

While I have no data, I would wager that the ability to do cool things on their phones, and share those cool things with their friends*, would be an extremely powerful motivator for today’s students.

 

 

* The biggest barriers to doing phone stuff are bureaucratic rather than technical — there are some issues involved with distributing your creation.  For iOS,  the best option right now (on a school level)  appears to be Apple’s Enterprise Distribution mechanism, which isn’t particularly transparent, cheap, or low-friction. For individuals (or if you want wider distribution through the App Store) you’ll need to buy a seat in the standard iOS developer program. I’d really like to see Apple set up some kind of low-cost student program — perhaps it could include the standard developer package’s ability to distribute to a limited number of devices on an ad hoc basis,  but not include the commercial features (e.g., distribution through the App Store). Android is much more lenient in this respect.

 

Share and Enjoy:
  • Print
  • Digg
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Yahoo! Buzz
  • Twitter
  • Google Bookmarks
  • connotea
  • Diigo
  • email
  • Google Buzz
  • HackerNews
  • Reddit
  • RSS
  • Slashdot
  • Technorati
  • Tumblr
Posted in Tech | 2 Comments

Project-Based Learning: Ur Doin It Wrong

Project-Based Learning: Ur Doin It Wrong

It’s always been mystifying to me why some equate a constructivist/constructionist/project-based/inquiry-based approach to education with “teacher doesn’t have to do any work” (actually, I’m pretty sure why some people are fond of that idea, but we won’t go there).  Some years ago, Kirschner, Sweller, and Clark stirred the pot with their article Why Minimal Guidance During Instruction Does Not Work: An Analysis of the Failure of Constructivist, Discovery, Problem-Based, Experiential, and Inquiry-Based Teaching.

Those of us who have advocated (and practiced) this style of teaching with success immediately recognized some of the serious problems with this paper.  It’s pretty clear  that doing truly original work without any scaffolding from a knowledgeable other is hard. Really hard. They give you PhDs for that. :-) In the entire history of the human race, only two people (that we know of) have invented calculus. Odds that a student is going to discover calculus by him- or herself? Not very good.

That’s not to say that students can’t learn from unstructured exploration — I’m a big advocate of tinkering (bricolage, if you want it to sound impressive), and have learned many useful things from it.  But, you know, students don’t really need to pay you tuition to do that. If they aren’t getting any  (or “minimal”) guidance from the instructor, why are they even in school? Why is there even a “teacher”?

(there are some who would argue that school as we know it is a bad idea altogether, but that’s a separate discussion).

The best response to Kirschner, et al, that I’ve seen is Hmelo-Silver, Duncan, and Chinn’s Scaffolding and Achievement in Problem-Based and Inquiry Learning: A Response to Kirschner, Sweller, and Clark (2006).  Their discussion matches closely with my own experience. Correct application of these methods doesn’t mean that the teacher provides no guidance, as Kirschner, et al would have it.  On the contrary, I would argue that doing a good job in this respect requires more work, not less. It’s really much easier for the teacher to make every student perform exactly the same task, which can be graded with a check-off rubric. Giving  students the freedom to pursue their own interests means (or should mean) that the instructor gives each and every student individual attention and careful guidance to prevent them from wandering off into the weeds.

 

 

Share and Enjoy:
  • Print
  • Digg
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Yahoo! Buzz
  • Twitter
  • Google Bookmarks
  • connotea
  • Diigo
  • email
  • Google Buzz
  • HackerNews
  • Reddit
  • RSS
  • Slashdot
  • Technorati
  • Tumblr
Posted in Policy, Tech | Comments Off

Everything about nothing

There’s a long-running joke that the process of getting a PhD requires that you know more and more about less and less, until eventually you know everything about nothing.

When I was in CS grad school, some of my fellow underpaid teaching slaves colleagues and I spent some time thinking about all the different types of nothing there were in the world. We wound up with a long list on the whiteboard, among them:

Zero (integer)
Zero (floating point/real)
Zero vector
Zero matrix (we decided somewhat arbitrarily that matrices and vectors were different for the purpose of this discussion)
Null pointer (points to nothing)
Void pointer (may point to something, but you can’t tell without further information)
Empty string
Identity function
Fixed-point combinators (considered different from identity functions for similar reasons to vectors and matrices)
Nil (in the Lisp sense)
Blank storage media (have capacity but no content)
Vacuum (has extent but no content, esoteric physics theories about vacuum energy aside)
Empty database tables (have structure but no content… arguably similar to null vectors/matrices)
Code segment that has no effect (similar to identity functions, but not quite the same)

I’m sure there are others. Feel free to add suggestions in the comments. :-)

Update: Chip suggests the addition of Seinfeld plots.

Share and Enjoy:
  • Print
  • Digg
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Yahoo! Buzz
  • Twitter
  • Google Bookmarks
  • connotea
  • Diigo
  • email
  • Google Buzz
  • HackerNews
  • Reddit
  • RSS
  • Slashdot
  • Technorati
  • Tumblr
Posted in Tech | 1 Comment

This is progress?

The more things change, the more they stay the same.

Share and Enjoy:
  • Print
  • Digg
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Yahoo! Buzz
  • Twitter
  • Google Bookmarks
  • connotea
  • Diigo
  • email
  • Google Buzz
  • HackerNews
  • Reddit
  • RSS
  • Slashdot
  • Technorati
  • Tumblr
Posted in Policy | Tagged , , | Comments Off