teaching machines

Custom Activity in Unity

Goal: I want to trigger Android activity-level code in my Unity 3D application. Here’s a minimal example of doing so: Create a new Android project in Eclipse. We won’t be using many of the ADT plugin features. We mostly leverage the compiler and editor. Override UnityPlayerActivity with a custom activity: Add C:\Program Files (x86)\Unity\Editor\Data\PlaybackEngines\androidplayer\bin\classes.jar to the […]

CS 145 Final Exam

Exam Test scores Overall scores

Capturing snapshots of a text file in Vim

To make a movie of textual development, I need a way to capture edits to a text file. Capturing needs to be done automatically and transparently; the developer shouldn’t have to trigger them. Otherwise, he’d forget. My initial thoughts were to intercept every keystroke and record the changes elsewhere on disk. I didn’t really like […]

Making a jQuery slider do something

Getting a slider to display was the first step. The end goal is to make the slider scrub through a series of snapshots of a text file. In between, let’s just figure out how to map the tick to a timestep. jQuery sliders are discrete; they can only be scrubbed to integral positions. Since the […]

Loading a remote file in JavaScript

Next up on my list of things I don’t know how to do is load a file in JavaScript. For now, let’s assume the file is hosted on the same server as the script. I understand that reading local files requires HTML5 and reading files from other servers can be troublesome. jQuery has several ways […]

Adding a slider into WordPress

How can I get a slider in HTML? Actually, how can I get a slider in WordPress, which is slightly harder? jQuery UI provides a slider, but the jQuery that ships with WordPress was not appearing for me. I tried using the jQuery provided by Google’s CDN instead: There are probably later versions I could […]

Notes from 5/18/2012

Evaluating field Stripping out complex numbers and NaNs The critical current has some NaNs and complex numbers where we’re finding roots of negative numbers. MATLAB’s visualization functions don’t seem to tolerate these non-real values. I set all non-reals to 0 with: These two lines exploit the fact that find and isnan report the indices of […]

TODONT

I want you to learn, create, and have free discussions with me. That’s more likely to happen if you avoid certain practices. TODONT #1: Visit me unannounced outside of office hours. You and I both have a lot to do. You can bet my day is scheduled before you even wake up. What’s it busy […]

CS 145 Lecture 27 – Final review

Agenda our own String class indexOf replace startsWith concat a 2-D ripple a bus counter Bingo board Code MyString.java package prefinal; public class MyString { private char[] charries; public MyString(char[] src) { charries = src; } /** * Gets the index of first instance of the * specified character. If character cannot * be found, […]

CS 330 Lecture 40 – Shell scripting, or Why I love Linux

Agenda shell scripting programs are methods speed and terseness caters to file manipulation globbing loops I/O redirection some problems resizing a bunch of images comparing two directories change extensions on a bunch of files checking for new mail sending spam finding big files preparing code for blog posts Code shrinken.sh #!/bin/sh mkdir -p dialup_friendlies for […]

1 184 185 186 187 188 204