Tuesday, November 29, 2011

Watch a Memory Bit Switch

Want to watch a memory bit flip at the atomic scale?

Calling all my fellow EE's and any other physics/geek aficionados, check out this 5 min interview explaining latest research in ferroelectric memory. Why is it cool? Because you can see the material change state (the field sweep) through the memory layer. Bonus: this imaging of the process was unexpected, current models do not represent this effect. They need to be revised. So cool.

http://www.youtube.com/watch?v=7I-G9TzfDYY

Don't know about that youtube title - I doubt this effect is "real time". It has to have been slowed down.

Friday, October 7, 2011

Brown Fox and Lazy Dog

I saw this video and it reminded me of my early computer days. My father owned a computer time share business; companies ran their business on software designed and built by my father's software team on computers maintained by the company. It was the first cloud. Of course, it wasn't called that then. It was called time share, which was invariably mistaken for vacation property.

How could this video possible trigger that?


The jump happens around 1:20 mark.

I worked at my dad's office in the summer between high school. They had IBM key punch machines. You'd bang out something in numbers and letters on the machine and it would produce a card with the characters printed on top and machine readable holes printed on the body of the card. My father's company produced a piece of hardware that meshed with the key punch interface and caused the machine to read or write cards. You had to pop a plate off the back of the machine and wire the device in there. There were hundreds of pins sticking up, but only forty or so were relevant.

The device converted card data back and forth into RS-232, which at the time was the new plug-in standard between computer devices. Now, we have USB, Parallel, Serial (RS-232 was serial), FireWire, Wireless, etc. To test each hand built device they manufactured, you'd have a stack of cards with the alphabet and numerals on them, each one shifted in a loop (A-Z0-9 then B-Z0-9A, etc.). Sometimes, if you wanted to do a quick check, you'd type in "The quick brown fox jumps over the lazy dog."

I helped build some of those devices, soldering them together at a workbench. The main builder, Freida, taught me how to solder. Earlier in her career, she worked on space hardware and missile electronics. When the electronics were soldered into boards for a missile special care had to be taken because of the vibrations from the missile's engine. Little double bends were made into each resistor, capacitor and inductor leg, that became springs to dampen the vibration. She built every device that way and made sure I did, too. Between her hardware production talent and the software designer who wrote the code that ran the box, those things were bomb proof.

Companies all over the world bought the device. The company saw the future of computers and realized that other companies would want to take all of their punch card data and convert it into some other electronic format (magnetic tape and disk drives). But, that's not exactly what happened. Many of their customers had processes that centered around punch cards. For a manufacturer, the cards represented a pick list and notes could be made on the cards by hand. They were a physical token that was also machine readable. Think of today's 1D and 2D bar codes.

These devices were built in the early 1970s and 1980s. I think years later one of the companies called him to ask if it was year 2000 compliant. Ha.

The smells in that office were stunning, not in a bad way. The company was located in the basement of an apartment building. They had three large HP computers, bays of disk drives that would be laughable today due to their very small storage capacity. There's more computer power and storage in an iPod nano than was in that whole basement. There were teletype machines, hardware workbenches, and free coca-cola, BBQ potato chips and pretzels. The place smelled of ozone and machine oil and solder flux and bbq. There was a constant churning and humming going on from the teletypes, disk drives and magnetic tape.

It's amazing what that little basement operation had going on inside of it. It was at the forefront of so many of the technologies that we see around us, today. Cloud, data centers, business accounting and manufacturing software, free goodies for the staff. All of that was going on forty years ago.

The quick brown fox jumps over the lazy dog, indeed.

Wednesday, October 5, 2011

RIP Steve

http://www.ted.com/talks/steve_jobs_how_to_live_before_you_die.html

Monday, September 5, 2011

Sims Social Addiction


Hello, my name is Andy, and I'm a Sims Social Addict.

 "Hello, Andy."

It all started so innocently. When a good friend of mine who works on The Sims stopped by, my son asked him about the new Facebook game Sims Social and if it was in Beta. "Sure, give it a try." I told myself I, too, should check it out. It's my friend's game, and I've never played The Sims.

In fact, I've never really played computer games. Decades ago, I did play my share of RPGs when they were only paper, dice and manuals. I'm a software developer and have plenty of time in front of the computer. I don't need any more. They've never really been able to attract me for very long.

I jump on facebook, find Sims Social and run the application. I've never even run a Facebook application before! Suddenly, I'm opening boxes, visiting my neighbor Bella Goth (more about her later), finding my Facebook friends who play Sims Social and asking to be their Sims Social neighbor. Wow, this is fun!

I'm harvesting my garden, cooking, keeping my Sim happy, visiting friends, buying furniture, re-arranging my house, and buying a new room for my stuff. Everything is going great! Then, wa-wa-wa, I'm out of energy or, fzzzzt, something breaks. So, I wait to recharge, five minutes, ten minutes... one hour goes by. What happened to the time?

Full screen mode really knocks me out. Everything is so much bigger and easier to manage; yet, in that mode I don't even know I’m on the computer, anymore. I lose track of time with no clock at the edge of the screen telling me to move on with my (real) life.

No matter. Go run an errand or attend a meeting. 90 minutes later I'm fully recharged and ready to go. I start working on musicianship, cooking skills, writing skills, artistry. Got to clear that lawn and build my house.

After a while, game strategies emerge. I'm not sure if gardening helps because energy may have more value than the simoleons harvested. Still, I plan my plantings around when I think I will be returning to the game. One hour? Four hours? Eight? One day? Got to pick them when they’re fresh!

Whenever I return to Sim Social, I need to work on my mood. Better use those simoleons to buy things to make me (my Sim) feel better: a telescope and a stereo that lets me dance and exercise. Attend to the basic needs, have fun, beat back the boredom, visit a friend and then... Inspiration!

Doing stuff when I’m inspired nets more simoleons. It also seems to make me more attractive socially. Which is great because some of the objects I buy for my house or levels I achieve require Hearts (love). Inspiration makes neighbor Sims more receptive, makes it easy for me to get some love.

This is when things began to go off the rails.

I need to take a moment to tell you about my neighbors in this game. They consist of four real people (their Sims, actually) and Bella Goth, everybody's friend. The four real people behind the Sims are my son, my friend who works on the game, his wife and a distant Facebook acquaintance who happens to be a gay man. So, that's my neighborhood - three males, two females. My son, my best friend since elementary school, his wife, a dude who could almost be complete stranger 'cause I couldn't pick him out of a line up, and a fake, totally made up woman.

To achieve certain goals in the game, I need to make some romance. When I visit a neighbor and click on the Sim to interact, one of the choices is Flirt. But, with whom? There’s the rub. The object of my (male) Sims attention needs to be female, or it just won't work for me. The game doesn’t care, my Sim doesn’t care, but it needs to work for me. Flirting with my best friend's wife's Sim? NO! WRONG! Flirting with a gay man’s Sim? Nope, don’t care how open minded I am and that it’s all a fiction. It ain’t me. What if the real guy found out, I wouldn't want to lead him on. So, the only choice for me was Bella Goth.

Probably, no one would ever know, by the way. Well, almost no one. My eight-year-old daughter starts to sit next to me and watch me play. She begs me to let her play or get her a Facebook account so she can play herself. She talks about what she would do with her Sim, that she can't wait for the time when she has a Sim Social and buys it things and arranges the house and has neighbor Sim Socials. She begs me to buy a Pink Bathroom.

The thing is, I can't have her next to me when I flirt with Bella! I can't let her watch her dad (whoops, my Sim) flirt with and romantically kiss a woman not my wife/her mother. I especially can't let her watch me give Bella Goth a massage on that couch. No one should watch that with another person in the room, let alone one's daughter (no matter what age she is).

Guilt and embarrassment start to set in. I begin hiding my playing time. I turn the sound down on my computer. I try turning it off, but I need to hear the sounds coming from Sims Social, I need to know what's happening in the game. I play at wonky hours. I plan strafe runs at the game. Quick in, full energy burns, then out. Don't give anyone a chance to see me. I do late night sessions after everyone's in bed so I can really focus on my crafts, skills, levels, house. Am I about to jump up a skill level? Make sure I use most of my energy 'cause I’ll get a full boost at skill jump. Plan when and how.

The thing is, I can't get anywhere with Bella, not anywhere real, anyway. I need to find a woman neighbor on facebook, if this is going to work for me. At this point, my wife is clear that I am in full-blown addiction, and she wants no part of the game. Plus, being married - I'm not going to recruit a single woman on facebook to be my neighbor for Sims Social so I can try that relationship thing. I’d feel like I’m cheating.

Also, I need non-romantic help with my Sim, but I’m embarrassed to recruit new players to be neighbors. In the past, I successfully staved off the fire hose of Facebook requests to help people grow carrots, raise pigs and never, ever participated in an assassination. I can’t bear to be that guy begging his (real) Facebook friends for help in his (fake) Sim world. This is getting to be too much.

Then, it all changed. It’s last night:

I really need some help. I need someone I can count on, someone who would be there for me, to visit when I call, to repair my broken easel or clean my dirty toilet whenever I need it and without asking.

Unbidden, a thought occurs to me, the answer stares me in the face, a little bit of my own human inspiration. I need a sockpuppet - my own neighbor Sim! I do it in a flash. Clickity-clack, I make a Facebook sockpuppet - a new account that I control, a fake person that I friend. Of course, he is male, a married man can't have too many single female friends. I friend him. Clickity-clack, he creates a female Sims Social sockpuppet. Two different browsers with two Sims, one of them me and one of them some other not quite unreal, not quite female, not quite me.

This is fantastic. It works so well. She sends me things I need. No more wasting energy cleaning puddles from the bathroom floor or fixing that busted stereo. She makes my bed. We giggle, we flirt, we become lovers, we date. We build a two-person bed together. She cares for me, she is my Muse. I can clear my land of mushrooms. I gain skills without the drudgery and annoyances that hold back those Sims who lack that all giving partner. Ahhh, perfection - bliss.

My two Sims, one real, one fake, both empty of all of their energy, I exit the game, satisfied with my brilliant new move. Then, I glance at the clock. I told my wife I'd be up in a minute, it is now 1:30am.

This is very wrong, I have traded my life with some strange electronic version of Dorian Gray's picture, and it’s not going to end well.

Hello, my name is Andy, and I'm a Sims Social addict.

Wednesday, July 13, 2011

Vodaphone Hack

If you follow mobile phone security (or haven't been on vacation), you've read about THC's Vodaphone hack by now. Although I shouldn't be surprised, it continually astounds me how companies make such poor security design decisions. Of course, then I realize that this was not a design decision as no security expert could have been consulted on this design. Perhaps Vodaphone rushed the product to market.

Having watched a Fortune 500 company, which believed in security, lift its internal process to begin to match the onslaught of outside hacking, I can tell from the outside that Vodaphone has little or no internal security process. Despite any rhetoric and PR, they do not care about security, their customers or quite frankly their shareholders.

Security is complicated and it takes trained professionals to ensure a product's security and safety. However, this type of problem could have been prevented easily - who stores an administrator password inside their systems and distributes them to customers?!

I can't believe we have to close our eyes, hold our noses, cross our legs and hope these companies know what their doing. I always had philosophical problem with the White and Grey hackers who published their attacks. However, very few folks have the talent or knowledge to understand the complete and utter lack of security inherent in their consumer devices. Someone has to watch out for us.

Aarrgh!


UPDATE:

THC's Wiki for tracking this project can be found here.

Wednesday, February 2, 2011

Basic Programming 101: Session IV

For-Loop and Counting


The for-loop construct allows us control specific execution of a programs actions. It says: "do this for this many times." The program can count up, count down, count by fractions, whole numbers or whichever scalar value we choose. Recursion, although powerful, may have resource limitations (every function call takes memory). If the algorithm doesn't require "state" or memory, a for-loop does nicely.
We have two examples here, a very short program that shows the for-loop and a second program that graphs functions.
For-Loop
10 REM Simple for-loop prints nums 1..10
20 for i = 1 to 10
30 print i
40 next i
Function Grapher
In this next example, we build a function graphing program that steps through a range of values and plots each of the points. We could do this in whole number steps, but the plotted functions may not appear continuous; they'll look more like points than connected curves/lines. The finer the grain of step, the more likely the function appears continuous.
Lines 10 & 100 set up some constants and open a graphics window of the appropriate size. In this case, we keep two constants which represent the center of our graphics screen.
10 xc = 250 : yc = 200
100 graphics window 25,25,xc*2,yc*2
Next, Line 110 contains our for-loop. It has a range of [-250..250] and granularity (step) of 1/10. You might need to make this finer (smaller) depending upon the kind of function you have. In this case, it could be step 1, because the function is a simple line.
110 for t = -250 to 250 step 0.1
Lines 120 and 130 contain the function. We set variables x and y to t. This will graph the line y=x. You might wonder why we didn't just make x the for-loop variable ("for x = -250 to 250"). There's a good reason for this, I will explain below.
120 x = t
130 y = t
Line 140 does our work: set a point at . Not really because we have xc and yc in the calculations. Remember, is the center of the graphics window (the size of the window is 2*xc, 2*yc). Also, note that we subtract y from yc instead of add. That's because graphics windows are upside-down when compared to Euclidean graphs, which have positive Y going up the page. Computer graphics windows have positive Y going down the page and the origin (0,0) in the upper-left corner, a natural consequence of the way information is displayed on a computer's screen.
140 graphics pset xc+x,yc-y
Finally, we close the for-loop in Line 150 and, as I like to be disciplined in my coding, Line 160 ends the program. This line is not strictly needed, but if we ever implement a subroutine, you would want the program to end here, so make it a habit.
150 next t
160 end
Why is X not the loop variable?
We could have made x the loop variable, but didn't. Why? Because, not every equation to be plotted has only one value of y for every x. What does that mean? Consider the equation y^2 = x. This is a parabola, but tilted on its side 90 degrees. In all but one case, there are two values of y that satisfy any particular x. If x = 4, y = 2 or -2. To plot this equation, use y = t and x = t^2.
Making a circle would be a challenge, since the equation for a circle is x^2 + y^2 = r^2. Fortunately, BASIC, like all good programming languages, provides a math library to assist us. Some of you may not have had trigonometry, yet, but there are well known functions from trig that address this problem: sine and cosine. In BASIC, these are sin and cos. They take an angle and return the Y or X value appropriate for that angle. In fact, cos(t)^2 + sin(t)^2 = 1 for every angle t. The math library uses radians, instead of degrees.
To plot a circle, use x = 100*cos(t) and y = 100*sin(t). This paints a circle with radius 100. If you want an oval, change the constant (100) in either or both of the equations.
In fact, playing around with programs is a great way to understand how they work. Feel free to play with this code and see what types of shapes and patterns you can draw. I've included some of the interesting ones I've found below. Use the comments section to add your own and tell us what it makes.
Infinity: [-250..250],1/10,x=110*cos(t),y=100*sin(t)*cos(t)
Spiral: [0..250],1/1000,x=t^2*cos(t)/2,y=t^2*sin(t)/2


Tuesday, February 1, 2011

Basic Programming 101: Session III

Recursion

Recursion, one of the great and subtle features of mathematics and programming, means to define a function or procedure using itself. Classic examples include factorial and the fibonacci sequence. Fibonacci has real world parallels (with leaf and population growth) and even touches upon fundamental mathematical constants. All from one little self-defined function.

In this program, we display levels of triangles and play sounds when each triangle is drawn. The program asks the user to input the number of triangle levels, then, using two recursion steps (one for each level, one within a level), it draws the triangles. At no time does it track how many triangles it needs to draw, it only checks to see if it reached the end of the levels and the end of a row. The frequency of the sound played scales linearly with the number of levels while the duration of the sound falls (shortens) with the square of the levels. That's because the area of a triangle is proportional to the square of its height (or side).

First, we set up some variables. These determine the size of a border region on the graphics window (bd) and the height and width of the drawable region on that window (py, px).

10 bd = 10
20 py = 433
30 px = 500


Next, we ask the user for number of levels to display and compute the delta width and height, which becomes the width and height of the triangles (dx, dy). We also compute the sound frequency (frq) and the duration of the sound (dur). If the duration is less than 1/20 of a second, it won't play, so we make sure its at least that duration.

100 input "How many levels of triangles would you like? ",levels
110 dx = px/levels
120 dy = py/levels
130 frq = 110+110*levels
140 dur = 1/levels/levels
150 if (dur < .05) then dur = .05

Open the graphics window and be sure to include a border around it. Call our draw_triangle recursion routine with the point at which it is to start displaying the triangles and pass the number of levels to draw and an indicator to draw multiple levels. The point we pass is the lower left corner of the triangles - the recursive routine computes its drawing from the bottom up.

160 graphics window 25,25,px+2*bd,py+2*bd
170 draw_triangle(bd,py+bd,levels,1)
180 end

Here we have the routine that does the heavy lifting. It takes the lower left point, the current level and a boolean variable indicating whether we should draw sub levels (levels above this level). If is_full is ZERO, we only draw this level of triangles. Line 1010 tells us to stop if we have fewer than ONE level to draw. Line 1020 tells us if is_level is not ZERO, to draw the next level of triangles (level-1), and make sure it's a half triangle width to the right and a full triangle higher on the screen.

1000 sub draw_triangle(x,y,level,is_full)
1010 if (level < 1) then return
1020 if (is_full <> 0) then draw_triangle(x+dx/2,y-dy,level-1,is_full)

Here we draw the actual triangle then play a sound. Note the points on the triangle are computed from dx and dy.

1030 graphics triangle x,y,x+dx,y,x+dx/2,y-dy
1035 sound frq,dur,10


Finally, our second recursion step draws the remaining triangles for this row. Notice how is_full will be ZERO, so none of the triangles drawn from this call will hit the lower levels. That's OK, we already took care of that above. Also, note that we are drawing the row with this call, so the point we pass is one triangle to the right and on the same line. Remember to decrement level by one when we make the call.

1040 draw_triangle(x+dx,y,level-1,0)
1050 end sub