Scratch, a cool programming language for kids

Posted by Joel Jensen Fri, 12 Oct 2007 15:47:18 GMT

I was at a Chris and Lisas’ house last night. Their son (10) showed me some video games he had just created using a really innovative smalltalk IDE for children. It’s called “scratch” http://scratch.mit.edu. The various controll structures in programming are shaped like lego/ puzzle pieces. Certain actions only fit with in certain data structures. But piecing them together you can easily make and learn programming. I think this really really would have ‘fit my head’ when I was young. After watching him for about 20 minutes, I could easily see him writing much more difficult things in only a few years.

The IDE generates smalltalk squeak in the background, creating objects, actions, amimations, images and passing messages around between objects. There’s even a smalltalk debugger, but it’s hidden enough that you really really have to want to get at it. I assume this is to prevent people from accidenly going there and getting confused.

You make the datastructures, then associate them with images or animation. Their son made a pretty respectable game in 2 days. When done, you can share it on the scratch site, people can play it, download the code and extend it themselves. They call this ‘remixing’. Its a really cool way of getting kids into open source programming.

Scratch

How much is $450 billion?

Posted by Joel Jensen Sun, 09 Sep 2007 09:33:00 GMT

I was wondering today, if we took all the money spent in Iraq, as dollar bills, would it blanket the entire country?

Dollar bill = 6.6294cm * 15.5956 = 103.3894 square cm per dollar bill

square cm per square meter = 10,000

square m per square km = 1,000,000

cm per km = 10,000,000,000

dollar bills per km = 96,721,714

cost of Iraq war so far $450,000,000,000

km of paper coverage = 4,653 square kilometers ( the state of Deleware is 5,133 square km )

area of Iraq = 437,072 SQ KM

We have a way to go, we’ve only gotten a little over 1% coverage so far.

If it were pennies:

$1 = 156.3175 cm of pennies,arranged in a hexagonal fasion 6 pennies touching every penny

7,035 square km. Probabally enough to pave all the roads in copper.

https for rails 1

Posted by Joel Jensen Tue, 28 Aug 2007 05:27:00 GMT

Heres some tips for rails https.

First – use the plugin SslRequirement. But REMEMBER this ONLY works on controllers that are listed in the routes.rb file as RESOURCES

map.resources :blahblah

IE they only work on resources. Period. For non resource controllers, you will have to stick it in the links.

<%= button_to "Checkout", {:action => :checkout,:controller=>"catalog",:protocol=>"https://",:only_path=>false },{}%>

Here is how to use the ssl plugin

ruby script/plugin install ssl_requirement


class ApplicationController < ActiveRecord::Base
    include SslRequirement
end


class AccountController < ApplicationController
    ssl_required :signup, :payment
    ssl_allowed :index

    def signup
      # Non-SSL access will be redirected to SSL
    end

    def payment
      # Non-SSL access will be redirected to SSL
    end

    def index
      # This action will work either with or without SSL
    end

    def other
      # SSL access will be redirected to non-SSL
    end
end

Next Here is a working apache / mongrel config for a https ssl virtualhost. REMEMBER enable proxy, rewrite, and headers in the apache modules stanza

<IfDefine SSL>
<IfDefine !NOSSL>
<VirtualHost 192.168.1.42:443>
    DocumentRoot /srv/www/site-name/current/public
    ServerName www.site-name.com:443
    ServerAdmin webmaster@site-name.com
    ErrorLog /var/log/apache2/site-name.com-error_log
    CustomLog  /var/log/apache2/site-name.com-access_log combined
    HostnameLookups Off
    UseCanonicalName Off
    ServerSignature Off

    SSLEngine on
    SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL 
    SSLCertificateFile    /etc/apache2/site-name-ssl/www.site-name.com.crt
    SSLCertificateKeyFile /etc/apache2/site-name-ssl/site-name.key
    SSLCertificateChainFile  /etc/apache2/site-name-ssl/gd_intermediate_bundle.crt
    SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0

    <Directory "/srv/www/site-name/current/public">
        Options FollowSymLinks
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>

    RewriteEngine On


    # Don't do forward proxying
    ProxyRequests Off

    # Enable reverse proxying
    <Proxy *>
        Order deny,allow
        Allow from all
    </Proxy>


    RequestHeader set X_FORWARDED_PROTO 'https'

    RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
    RewriteCond %{SCRIPT_FILENAME} !maintenance.html
    RewriteRule ^.*$ /system/maintenance.html [L]

    RewriteRule ^/$ /index.html [QSA] 
    RewriteRule ^([^.]+)$ $1.html [QSA]


    # Redirect all non-static requests to cluster
    RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
    RewriteRule .* http://127.0.0.1:3000%{REQUEST_URI} [L,P,QSA]

    # Deflate
    AddOutputFilterByType DEFLATE text/html text/plain text/css text/xml application/xml application/xhtml+xml text/javascript 
    BrowserMatch ^Mozilla/4 gzip-only-text/html
    BrowserMatch ^Mozilla/4.0[678] no-gzip
    BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

</VirtualHost>                                  

</IfDefine>
</IfDefine>

My pain is your gain.

SVN externals

Posted by Joel Jensen Thu, 23 Aug 2007 08:20:00 GMT

Here is how to set a directory to fetch as an svn:externals directory. I keep forgetting this. Now you can remember it too.

#make sure your editor variable is set, find the editor
# or which vi or whatever
which emacs  

#no spaces in EDITOR="
export EDITOR="/usr/bin/emacs"     

cd THE-DIRECTORY-YOU-WANT-EXTERNAL-TO-BE-IN

#propset the svn externals on the current directory, this pops up the editor
svn propedit svn:externals .     

# in emacs --- in emacs -- in emacs one directory per line.
apache-ant http://svn.repository.my/apache-ant/trunk/

# you saved the file, back in the shell
#download the repo as the new directory directory-name, in this case apache-ant
svn update

DONE

Nested Java classes from jruby

Posted by Joel Jensen Thu, 02 Aug 2007 17:06:00 GMT

I needed to get at a nested java class from jruby.

It’s tricky. Here’s How I did it

Java class ‘Fonzie’ has a nested public class ‘Hair’

include_class 'com.als.Fonzie'
Hishair = Fonzie::Hair
folicle = Hishair.new(nil)   # if the constructor takes no arguments you must include nil here.

# view that it's really a nested class

folicle.java_class 

# returns com.als.Fonzie$Hair

Heres a list -o- useful mac software.

Posted by Joel Jensen Tue, 31 Jul 2007 02:13:00 GMT

MUST HAVE

super useful app like finder on steroids http://quicksilver.blacktree.com/

most excellent project timer widget http://www.microcore.dk/TheDailyGrind/

good countdown timer widget http://www.metabang.com/widgets/stop-it/index.html

list of osx shortcuts widget http://www.apple.com/downloads/dashboard/reference/xcuts.html

dashboard wiki ( not super useful but fun ) widget http://inkspotting.com/wikity/

All the linux programs ( for mac ) – recommended http://www.macports.org/

There is something very similar called http://finkproject.org/

trick out safari http://pimpmysafari.com/plugins/safaristand

PRODUCTIVITY

open office with cocoa mac look and feel http://www.neooffice.org/neojava/en/index.php

project management just started using this one, no opinion yet http://bargiel.home.pl/iGTD/

mailing list software http://imailistproj.sourceforge.net/

billing and invoicing http://www.prettygoodsoftware.org/

screencast software ( make a movie of your screen as you do something ) http://www.shinywhitebox.com/home/home.html

enveloper maker http://www.ambrosiasw.com/utilities/easyenvelopes/

set alerts for most anything on your system, alot of good software plugs into this http://growl.info/

PROGRAMMING

terminal replacement, tabbed terminal http://iterm.sourceforge.net/

cocoa mysql http://cocoamysql.sourceforge.net/download.php

enable the local mailserver for testing of php mail functions http://cutedgesystems.com/software/PostfixEnabler/

text editor http://macromates.com/

really useful firefox plugins https://addons.mozilla.org/en-US/firefox/addon/1843 https://addons.mozilla.org/en-US/firefox/addon/60

COMMUNICATION

RSS news aggregator (free and good) http://www.utsire.com/shrook/

multi client chat http://www.adiumx.com/

ftp / sftp http://cyberduck.ch/ or http://code.google.com/p/macfuse/

irc client http://colloquy.info/

vnc http://sourceforge.net/projects/cotvnc/

remote desktop ( terminal services ) http://www.microsoft.com/mac/otherproducts/otherproducts.aspx?pid=remotedesktopclient

control outbound connections http://www.obdev.at/products/littlesnitch/index.html

bittorrent client http://azureus.sourceforge.net/

wifi sniffer http://www.istumbler.net/

network sniffer http://kismac.de/

MEDIA

RIP MP3’S AT HIGH SPEED uses lame to rip mp3’s and itunes to give them the names. Must compile lame for osx, install apple development tools, you need the c++ compiler, you will not need to actually compile stuff, macports does this for you. install macports, then from terminal as root, “port install lame” http://blacktree.com/apps/iTunes-LAME/

movie viewer http://www.videolan.org/vlc/

view windows media files http://www.flip4mac.com/

mount your ipod and retreve music without Itunes http://ipoddisk.ourbiti.com/

sound editor http://audacity.sourceforge.net/

guitar tuner http://www.silencetostatic.com/software/guitartuner1.0.zip

HELPFUL

windows helpfile viewer for osx http://chmox.sourceforge.net/

mind mapping software ( helps get ducks in row or vector in java speak ) http://freemind.sourceforge.net/wiki/index.php/Screenshots

FUN

mac saber http://isnoop.net/blog/2006/05/20/macsaber-turn-your-mac-into-a-jedi-weapon/

screensaver of earth with live overlays of clouds. http://www.osxplanet.com/

alot of cool screensavers ( he wrote winamp ) http://www.jwz.org/xscreensaver/screenshots/

The weak link

Posted by Joel Jensen Sat, 16 Jun 2007 13:17:00 GMT

Format: Date: 2007-06-17 04:17:35 -0500 Pings: Off Comments: On

My scooter, returned from it’s walkabout with a meth addict, but is still recovering. I was riding to see Pat at Pho79 for soup Friday, cruising about 40mph, the engine made a really loud farting sound then died. I thought it was just hot, or a really fouled plug.

I spent a while at a neighboring auto parts store and replaced the plug. I bought some ether ( starting fluid ), everything starts with starter fluid; most anything. The plug wasn’t the exact type, but close enough

For reference the correct NGK spark plug for a 2003 Aprilia Mojito is a BPR8HS and a NGK 3725, they are one in the same. It’s damn near impossible to find the BPR8HS but the 3725 is common, and when I got the 3725, it had bpr8hs written on the box under 3725. I think they are changing the part number schemes.

The starter fluid didn’t help. The plug was AMAZINGLY FOULED. I was in the process of futzing with the tuning, when the scooter was stolen. It was in an especially bad state of tune, and driven by the thief for 1000 miles. and it showed in the wear on the scooter.

Sparkplug

I brought it home and yesterday did a compression test, it was supposed to have 11 : 1 compression or 176psi, it has 60psi. The piston rings are shot.

I called aprilia and they said that the rings are the weak point in the engine, for precisely the reason to mitigate dumb guy damage. The replacement part is cheap, but takes 4 hours to replace and requires a tree and some rope to install, you decide why.

I’m actually looking forward to riding my bicycle in to work for a week. I have to get up much earlier, but it will be fun.

For a little while yesterday I considered a different scooter. I found this on you tube.

Surface Tension

Posted by Joel Jensen Sun, 10 Jun 2007 23:41:00 GMT

I bought a nice ripe pineapple a few days ago. I took a little too long to cut it up for chutney, resulting in hundreds of little fruit flies.

I found a good way of getting rid of them. A glass of vinegar, with a dash of dishsoap.

They land on the surface of the vinegar, and sink. No surface tension. Most of the flies were gone in 12 hours.

Flies

Lakeshoring

Posted by Joel Jensen Wed, 30 May 2007 18:57:00 GMT

I just heard a great new term. Theres offshoring, where you job out a project to a bunch of people overseas. And there is Lakeshoring, where you job out a project to local consultants ( who may be working at their lake shore homes. )

safehouse

Posted by Joel Jensen Wed, 23 May 2007 12:43:00 GMT

I heard about Wafaa Bilala a Chicago artist from Iraq who has a installation, a site here where you can control a camera roboticly, and shoot him, with paint pellets. In a video he mentioned he needed a good night sleep. I whipped up this ruby script that moves the robot left, all the time. Their firewall blocks me after a while. But if you want to try…

#!/usr/bin/env ruby
# give the guy an hour of sleep
require 'net/http' 

url= 'wafaabilal.com'
h = Net::HTTP.new(url, 80)

7200.times do |i|
  response = h.get("/forward.php?action=move_left") 
  sleep(0.5)
end

Older posts: 1 2 3 4 5 6 ... 9