Search
Recent News
News - Nov 14, 2011 1:57 - 1 Comment
Un/identified Flying Objects
Many amazing Youtube videos have brought to my attention recently. Sometimes it can be hard to know if what you are seeing is real, mis-interpreted or just plain-old fake. These three videos have really stuck out in my mind as being plausible and significant. So in the spirit of Monday mornings, huddle round the screen, and get ready to geek out!
1: NASA Tether Incident
This video is part of a transmission accidentally leaked by NASA in 1996. NASA were conducting an experiment, dragging a 12 mile long tether to catch particle energy above the atmosphere. When the tether snapped and started floating into space, they noticed something moving in the near-invisible part of the light spectrum. Space-critters!
2: Quantum Locking
This video demonstrates a levitation technique using a liquid nitrogen super-cooled magnet. Two magnetic objects can be locked together using their magnetic field at the quantum level. Rather than the magnets pushing or repelling each-other as we are used to, the objects are locked on an axis and can be moved in an almost frictionless state.
3: Acoustic Levitation
Another levitation technique is using sound-waves. By altering the sonic properties of the air around an object, scientists are able to rotate and position objects in the air. Currently this is only happening with very light objects like ping-pong balls. But maybe one day, we will discover a way to move huge monolithic granite rocks into circles, or stack them on top of each-other in large prismatoids.
News - Aug 12, 2011 2:31 - 0 Comments
TRS-80 Save & Load from MP3
I wanted to start writing some more useful programs using the TRS-80, but having to switch the machine off and loose everything is no fun. Cassette tapes are a little hard to come by in 2011, so getting the TRS-80 Cassette Deck working to save my data also seems like a bit of a pain.
But as the data was being transferred from the computer to cassette via headphone jack, I figured an MP3 recorder might do the trick. I am happy to say… it works.
Programs Stored in Audio Signals
In case you have absolutely no idea what I am talking about, I threw together a quick video clip showing the process. The fact that I’m saving software in an audio signal is extremely satisfying, even if it can sometimes take 1-2 minutes of noise to store a 100 line program. Ouch!
News - Aug 10, 2011 3:21 - 3 Comments
Enter The TSR-80
What a day!
After an email conversation on Craigslist that probably lasted the best part of a month, I finally proved I was not an over-seas scam artist and got the go-ahead to pick up a real working TRS-80.
Me and my buddy Garrett hopped in a Zip Car to drive through some crazy rain. Upon arrival we met a very nice lady called Rebecca, who sold me her husband’s TRS-80 which had been sitting in a box waiting for a loving home.
When we got there, I was very excited to see it working out of the box. Even though the screen is a bit jumpy and the tape-drive needs some work, it is still usable and should not take too much work to fix.
I have been working through an old BASIC book I found on the street last summer, converting the programs to JavaScript. You can read about that project in my post: Basic Programs for Scientist’s and Engineers.
But Wait… There’s More!
Not only did we pick up this awesome machine, that is at least 5 years older than I am; we were also offered the chance to purchase two beautiful computer books from the 1970s. After hearing the context of the books from the owner and having a chance to take a few minutes to look through, it was very hard to say no. To better explain why the books were difficult to turn down, let me show you some quick snaps:
My First TRS-80 Program
After firing the machine up at home, I read through the BASIC Language Reference online and getting a feel for some of the differences between Acorn BASIC and this older flavor, I started throwing a simple program together. It is taking a little while to get used to the keyboard with all the keys being in the wrong places, but the feel of the keys is still strangely familiar.
The program I made was just a way to draw a circle with basic pixels. Being a monochrome machine, the TSR-80 only gives me the choice of either white pixels or black. You can see a picture of the program here. There are a few redundant lines… it’s a work in progress
So that concludes a fun evening: meeting interesting new people, getting a deeper look into how the computer and internet industry began to travel in the direction we find it moving today, and programming in the cool blue, radioactive glow of a TRS-80 monitor.
Zero divided by two equals eight
Thoughts - Sep 8, 2011 22:43 - 0 Comments
A New Beginning
I know you’re out there…I can feel you now. I know that you’re afraid.
You’re afraid of us, you’re afraid of change…I don’t know the future…I didn’t come here to tell you how this is going to end, I came here to tell you how this is going to begin.
Now, I’m going to hang up this phone, and I’m going to show these people what you don’t want them to see. I’m going to show them a world without you…a world without rules and controls, without borders or boundaries.
A world… where anything is possible.
Thoughts - Aug 21, 2011 21:26 - 1 Comment
The Price of Convenience
One of the pitfalls of modern life is the convenience of the financial transaction. Computers make so many things in life literally as simple as pressing a button, but convenience always comes at a price.
The current household debt situation is a great example of convenience gone wrong. Sometimes the price of convenience manifests itself in debt, or sickness, or addiction and can often become a precursor to a lack of choice within a system.
I am not going to argue that the lack of choice in a system is always a bad thing, but I will bet that if you make something “more convenient than nature”, you are always once step closer to some kind of catastrophe.
For me the lure is usually coffee. I drink way too much of the stuff. Living in the city places me in less than 5 minutes walking distance of 11 outlets serving coffee “to go”.
- Sportellos
- Flour
- Dunkin Donuts 1
- Metro Cafe 1
- Au Bon Pan
- Channel Street Cafe
- Dunkin Donuts 2
- Metro Cafe 2
- Sleeper Street Cafe
- Dunkin Donuts 3
- 7-Eleven
The coffee bill really sneaks up on me, because I frequently buy some food item along with it. Why just get coffee when I can get coffee and breakfast too? It is just so convenient! And then there is the almost unavoidable “Business Coffee”.
Creative Saving
I have been taking a course on finance recently, which encourages the student to find creative ways to save money. So to tackle my insanely high coffee-bill, I bought a coffee machine that was on sale at a local store.
OK perhaps that is not so creative, but it does save money. When I was at the store buying the coffee machine, I noticed a dent in the side of the box. When I got to the check out I asked if they would reduce the price on account of the damage?
“Yeah I think we can do you a deal on that!” said the cashier, as rung the coffee machine up for $0.00!
However, a few weeks in to my coffee machine, I realized that I was still buying too much coffee in the wild. And to be completely fair, coffee is a scapegoat, a greater of many evils. It is not just coffee that is convenient to buy.
Services like iTunes and Amazon are just a few clicks away from your bank account. It is almost “too easy” to spend money.
The Ratio of Convenience
One thing I have been thinking about recently is the ratio of convenience between earning and spending, comparing life today with life 20 years ago.
I remember buying my first tape cassette from W. H. Smiths when I was about 12 years old. I had to physically go to the bank, by train, withdraw some cash, walk to the store, purchase the item, go home on the train (I did not have a Sony Walkman at the time), and switch on my stereo cassette deck.
As a kid, buying music took me the best part of a day. As an adult, buying music takes me the best part of a minute. Yesterdays experience was an adventure. Today’s experience is a whisper. And what of tomorrow?
First consider the record highs in the CPI (cost of living), which warn us here in the USA that we are not getting as much purchasing power for each hour we work as we had in the past. Then consider the obvious increase in convenience, brought about by electronic purchasing systems and the proliferation of the web.
These two things (CPI & Convenience) seem inversely proportional. Not only is it more expensive to live. It is also easier to spend. And subsequently, harder to save.
You might guess that as life became more convenient, each hour of the working day should become more profitable. Sadly that is not the case.
Changing Behavior
I am pretty good at doing things I don’t want to do. But pretty bad at not doing things I would do better not to do. And so I have devised an amazing technologically advanced way of saving money. I call it… “The Lock Box”
I bought a cheap but hefty lock-box from Home Depot. It came with two keys. I made a tally of how much money I would need this week, which I withdrew from the bank with a little extra in case of emergency.
I locked my credit cards, ID and checkbooks in the box, and gave the keys to two friends and told them to hide them away at home. If I need my credit card for some kind of big emergency, I can get on my bicycle and ride 30 minutes to get it from my friend’s house (I do not drive). A process that is way too inconvenient for buying coffee, music or whatever it might be from Amazon.
Now if I want to have coffee, I will have to make it myself. And if I want to buy music, I will put it on my shopping list and get it on the weekend… if I still want to buy it.
My hope is that I will be able to take the impulse out of the buying experience and retrain my brain to put more planning into my purchases.
I can already smell the money I’m saving!
If only I could convince President Obama to give this a try.
Thoughts - Jul 6, 2011 7:46 - 0 Comments
Development In Mind
While computers are incredibly powerful tools, there is one thing they have not come close to achieving. Thought. A computer has absolutely no idea how to deal with abstract concepts.
Every member at BarCamp 2008 was asked to answer a question: “What will we be talking about in five years?” My answer was “The entropy of information”. If I could go back in time, I would clarify my answer as: “The entropy of apobetics”.
Apobetics — from the Greek word, apobeinon, is the highest level of information hierarchy. It questions the purpose, objective, plan or design, being transmitted in order for the receiver to achieve the desired successful goal or outcome.
Instant Gratification
The internet gratifies us almost instantly. In the development field, it is so easy to walk into a new job, and Google your way through almost every problem. I know this because it is how I started my first big contract in London.
When I stepped out of my comfort zone, and my area of expertise, I was forced to learn fast. The excitement of rapidly researching small code solutions to reach the larger goal of a program was very addictive.
What was I learning in such a hurry? Primarily, I was learning how to rely on the collective human intelligence. I definitely learned many things along the way. But this kind of behavior is a completely different animal from the contemplative study of a subject and the logical deduction of a solution to a problem.
I have heard it said that the way we use computers endangers our ability to think critically1. Admittedly, I always considered this to be a non-issue as I assumed the human mind would not change significantly as the common development skill-set shifted. But as time goes on, I am becoming more concerned (because I have seen it in myself), that the we really are loosing something very important.
The apobetic. The depth of the understanding. The living consciousness of the abstract concept, where the problem and solution are realized as two sides of the same coin. I think in some general sense, as we solidify the “how” of a thing in our collective consciousness, we begin to loose sight of the “why”. We begin to loose our ability to reason.
Two Modes
There seem to be two basic modes to any action taken in life. Impulsive or contemplative. I will say from my own experience that the conditions under which I am developing software will more often than not, preempt the particular mode into which I fall.
When rushing to a deadline, rational thought can often be thrust aside in favor of the “square peg round hole” process. Trying to guess your way through a problem is a deadly game. Sometimes it can give you great momentum, but it will inevitably lead you to an impassable object.
I find it particularly easy to fall into this mode of development, in which I use the computer as my primary thinking tool.
- Have an idea
- Open up the code editor
- Program towards a fuzzy solution
But what happens when you sit silently and really think? How many bits of data can your mind process? How many pathways can it navigate, how many rabbit holes can it go down? Is your brain not an infinitely complex machine running at a quantum level? Why slow it down with a computer?
Edit, Save, Run, Error — Edit, Save, Run, Error…
Not now computer. Lets go there after I have the solution.
Knowledge - Sep 12, 2011 13:08 - 1 Comment
Killing All Processes by Name
This little line will immediately kill -9 all the processes with a given name:
ps -ef | grep <process name> | grep -v grep | awk '{print $2}' | xargs kill -9
Knowledge - Sep 12, 2011 12:17 - 0 Comments
Directory Tar Compression
To compress a directory to a tar.bz2 archive, use jcvf:
tar jcvf <filename>.tar.bz2 <dir>/
To extract the directory from the archive, use jxvf like so:
tar jxvf <filename>.tar.bz2
Code - Aug 18, 2011 4:25 - 1 Comment
QBasic Program in HTML5 Canvas
While playing with retro languages recently, I remembered a couple of QBasic programs I wrote many, many years ago. I scanned my 2TB external drive for “.bas” files. The drive generally gets used for stashing hard-drives and user-directories before I do an upgrade.
I found this little program called “Wave-Osc” that combines oscillators to create a waveform. Looking back, I can see a few places I could have sped up the performance. One of the things that really jumped out at me was how rigid and painful multidimensional arrays used to be. Not only that, programming functions in BASIC was overly complicated, and I usually didn’t bother unless my program got above a certain number of lines.
The BASIC
Here is the BASIC code for Wave-Osc:
RANDOMIZE TIMER
SCREEN 13
CLS
speed = .001
StepDown = 30
ScaleWeight = .25
ScalePhase = .0001
OSCedit = 1
Debug = 1
Col = 32
ColRot = Col
ColDiv = 8
OSCnum = 3
DIM Amp(1 TO OSCnum)
DIM Frq(1 TO OSCnum)
FOR Osc = 1 TO OSCnum
Frq(Osc) = 10
Amp(Osc) = 0
Arc(Osc) = INT(RND * 2) + 1
Spd(Osc) = 0
NRG(Osc) = 0
Col(Osc) = Col + (5 * Osc)
NEXT Osc
y = 239
DIM lwall(1 TO OSCnum, 1 TO 320)
DIM oldlwall(1 TO OSCnum, 1 TO 320)
DIM lsum(1 TO 320)
DO
FOR n = 1 TO 320
lsum(n) = 0 + 100
FOR Osc = 1 TO OSCnum
lwall(Osc, n) = 0
NRG(Osc) = NRG(Osc) + Spd(Osc) / StepDown
SELECT CASE Arc(Osc)
CASE 1: lwall(Osc, n) = lwall(Osc, n) + COS(n / Frq(Osc) + NRG(Osc)) * Amp(Osc)
CASE 2: lwall(Osc, n) = lwall(Osc, n) + SIN(n / Frq(Osc) + NRG(Osc)) * Amp(Osc)
END SELECT
lwall(Osc, n) = lwall(Osc, n)
lsum(n) = lsum(n) + lwall(Osc, n)
NEXT Osc
LINE (n, y)-(n, y - lsum(n)), ColRot + (lsum(n) / ColDiv)
LINE (n, y - lsum(n) - 1)-(n, y - lsum(n) - 4), 15
LINE (n, y - lsum(n) - 5)-(n, y - lsum(n) - 50), 0
IF Debug = 1 THEN
FOR Osc = 1 TO OSCnum
PSET (n, y - lwall(Osc, n) - 100), Col(Osc)
PSET (n, y - lwall(Osc, n) - 99), 20
NEXT Osc
END IF
NEXT n
'FOR j = 1 TO 10000: NEXT j
kbd$ = INKEY$
SELECT CASE kbd$
CASE "[", "{": Arc(OSCedit) = 1
CASE "]", "}": Arc(OSCedit) = 2
CASE CHR$(0) + "M": Frq(OSCedit) = Frq(OSCedit) + ScaleWeight
CASE CHR$(0) + "K": IF Frq(OSCedit) - ScaleWeight > 0 THEN Frq(OSCedit) = Frq(OSCedit) - ScaleWeight
CASE CHR$(0) + "P": Amp(OSCedit) = Amp(OSCedit) + ScaleWeight
CASE CHR$(0) + "H": Amp(OSCedit) = Amp(OSCedit) - ScaleWeight
CASE ">", ".": Spd(OSCedit) = Spd(OSCedit) - ScalePhase
CASE "<", ",": Spd(OSCedit) = Spd(OSCedit) + ScalePhase
CASE "+", "=": OSCedit = OSCedit + 1: IF OSCedit > OSCnum THEN OSCedit = 1
CASE "-", "_": OSCedit = OSCedit - 1: IF OSCedit < 1 THEN OSCedit = OSCnum
CASE "D", "d": IF Debug = 1 THEN Debug = 0: CLS ELSE Debug = 1
CASE ELSE: IF Debug = 1 THEN GOSUB OscDebug
END SELECT
LOOP UNTIL kbd$ = CHR$(27)
END
OscDebug:
COLOR Col(OSCedit)
LOCATE 1, 1: PRINT "OSC"; OSCedit
PRINT "Amp"; Amp(OSCedit)
PRINT "Frq"; Frq(OSCedit)
PRINT "Spd"; Spd(OSCedit)
PRINT "Arc ";
IF Arc(OSCedit) = 1 THEN PRINT "sin" ELSE PRINT "cos"
RETURN
If you want to try running this BASIC code, you can copy it to a file and use DosBox and Qbasic to test it out. ( You will need to look at the keyboard keys to change the properties of the oscillators. )
The JavaScript
I converted the program to JavaScript so that it runs in a web-browser with the HTML5 Canvas. Here’s the new JavaScript code:
(function( global, doc ){
var speed = .001
, StepDown = 30
, ScaleWeight = .25
, ScalePhase = .0001
, OSCedit = 1
, Debug = 1
, Col = 32
, ColRot = Col
, ColDiv = 32
, y = 239
, OSCnum = 3
, oscs = []
, i = 0
, lsum = new Float32Array( 320 )
, drawLoop
, context
;
var Osc = function(){
this.index = oscs.length;
this.Frq = 5 + Math.random() * 8;
this.Amp = .5 + Math.random() * 2;
this.Arc = !!parseInt(Math.random()*2);
this.Spd = .01 + Math.random() * .03;
this.NRG = 0;
this.col = Col + (5 * this.index);
this.lwall = new Float32Array( 320 );
this.oldlwall = new Float32Array( 320 );
};
Osc.prototype.sincos = function( arcType ){
return arcType ? Math.cos : Math.sin ;
};
Osc.prototype._lwall = function( n ){
this.NRG = this.NRG + this.Spd / StepDown;
this.lwall[n] += this.sincos( this.Arc )( n / this.Frq + this.NRG ) * this.Amp;
lsum[n] += this.lwall[n];
return;
};
function init(){
for( ; i < OSCnum; i++ ){
oscs[ i ] = new Osc();
}
context = document.getElementById( 'canvas' ).getContext( '2d' );
drawLoop = global.setInterval( draw, 40 );
};
function line( x1, y1, x2, y2, col){
context.strokeStyle = col;
context.beginPath();
context.moveTo( x1, y1 );
context.lineTo( x2, y2 );
context.closePath();
context.stroke();
};
function draw(){
for( var n=0 ; n< 320; n++ ){
lsum[ n ] = 0 + 100;
for( var o=0; o< OSCnum; o++ ){
oscs[o]._lwall( n );
}
var col = 20-((1+(lsum[n]))*2.5);
line( n, y, n, y-lsum[n], 'hsl('+ col +', 100%, 70%)' );
line(n, y - lsum[n]-1, n, y-lsum[n]-4, "#FFF" );
line(n, y - lsum[n]-5, n, 0, "#000" );
for( var o=0; o< OSCnum; o++ ){
context.strokeStyle = 'hsl('+ (30+oscs[o].col*50) +', 100%, 60%)';
context.strokeRect( n, y-oscs[o].lwall[n] - 180, 3, 5) //, Col(Osc)
}
}
};
doc.addEventListener( 'DOMContentLoaded', function(){ init(); }, false );
})( window, window.document );
Running The Program in JavaScript
You can see it running here in the canvas with some random properties. There are a few minor differences:
I created an "Object class" using JavaScript Prototypes, which was so much easier than using multidimensional arrays in QBasic.
I also used HSL colors instead of a "color-palette" enforced by a "screen-mode".
The large waveform at the bottom is the sum of the three waveforms you can see overlaid at the top.
If you want to see this example running in a new window click here.


















