import randomalpha_left = ['r', 'q', 'w', 'e', 'r', 't', 'a', 's', 'd', 'f', 'g', 'z', 'x', 'c', 'v', 'b']num_left = ['1', '2', '3', '4', '5', '6']symbols_left = ['`']alpha_right = ['j', 'k', 'l', 'n', 'm', 'h', 'y', 'u', 'o', 'i', 'p']num_right = ['7', '8', '9', '0']symbols_right = [';', "'", '[', ']', '.', ',', '/', '-', '=', '\\']left = [alpha_left, num_left, symbols_left]right = [alpha_right, num_right, symbols_right]def gen_pw ():passwd = ""for i in range (8):if i % 2:cata = left[random.randrange (3)]else:cata = right[random.randrange (3)]passwd += cata[random.randrange (len (cata))]return passwddef check_pw (p):has = [False, False, False]for c in alpha_left:if c in p:has[0] = Truefor c in num_left:if c in p:has[1] = Truefor c in symbols_left:if c in p:has[2] = Truefor c in alpha_right:if c in p:has[0] = Truefor c in num_right:if c in p:has[2] = Truefor c in sym1ols_right:if c in p:has[2] = Trueif False in has:return Noneelse:return ppwlist = []while len (pwlist) < 25:tmp_pw = check_pw (gen_pw ())if tmp_pw:pwlist.append (tmp_pw)print pwlist
Wednesday, May 25, 2011
Very crude password generation
Generates 25 passwords which alternate between the left and right hands for each character, have alphanumerical plus symbols and never require holding down shift. Coded while playing Super Smash Brawl at 3am so I bet there's a million horrible things about it.
Wednesday, May 11, 2011
Door + electronics
So far it's just a couple status LEDs (door open/closed and a "doorbell") and sketchy wires but I'm planning on cleaning it up once I have time.

All the resistor values are completely arbitrary, I grabbed them at random and they work. If I thought it through I could probably get the LEDs a little brighter but it doesn't matter too much. The only important things are that the resistors are large enough so the LEDs don't burn out and R2 has to be small enough to pull enough of the current so the LED doesn't turn on.
Bare wires, when you short them together the red LED turns on. I'm planning on putting a nicer button here
Aluminum tape on the door and weather stripping (convenient for sealing a door and guaranteeing good contact!) with wires duct taped on each contact, since only the non-sticky side of aluminum tape is conductive.
All of it together:
Yay!
EDIT: As several people have pointed out, it would be smarter to do the door switch with a transistor. The reason I didn't was because the circuit got about a minute of thought (if that) and I just grabbed a few parts near me.
Electric scooter
Mid February, I decided to build an electric scooter. Unfortunately I didn't write up what I was thinking along the build, but I took a lot of pictures. I finished the majority of the mechanical work (minus mounting the motor and I still don't have a brake) in late March and have been using it as a kick scooter since then. When I'm done, it will have a hub motor I built, a motor controller I bought, and as many batteries as I can possibly back into the base. I'm hoping for a 10 mile range but I have no idea how efficient the motor will be yet.
Pictures and write-ups of some of the choices I made and the ways I built things coming soon, finals week is coming up so I'm short on time.
Wednesday, June 9, 2010
Emacs with Google Go
With this set up, hitting H-m (hyper-m) in emacs it compiles the current buffer and runs it if compiling succeeds.
; current-buffer-name.go; make current-buffer-name && ./current-buffer-name(defun compile-run () (interactive) (setq name (first (split-string (buffer-name (current-buffer)) "[.]"))) (compile (format "make %s && ./%s" name name)))
; assigns hyper-m (I have the Windows key set as hyper) to running compile-run(global-set-key (kbd "H-m") 'compile-run)And the piece of my Makefile that handles this:
%: %.go 6g $^ 6l -o $@ $@.6You'll have to tweak the Makefile stuff if you want to compile for anything other than amd64.
The compile-run function should actually work for any language, as long as you get the Makefile set up correctly.
Edit: Here's a version that just compiles and doesn't run the current buffer (you'll still need the same Makefile entry above)
(defun compile-buffer () (interactive) (setq name (first (split-string (buffer-name (current-buffer)) "[.]"))) (compile (format "make %s" name)))
; Sets meta-m (AKA alt-m or escape-m, or command-m on Macs)(global-set-key (kbd "M-m") 'compile-buffer)
Tuesday, April 14, 2009
VDG assembly overview
Starting from the top down, original design. I'm redoing the top roller since it was having serious problems, which I'll describe later.
The top is made of two steel mixing bowls taped together with aluminium tape. It's connected with a wire to a screen wire patch (aluminium). The screen comb is attached to the top of the main PVC shaft, and is very close (but not touching!) to the neoprene belt.
The upper roller the belt goes over is a piece of PVC pipe wrapped in aluminium tape (to make it be conductive), and spins on a smaller piece of PVC pipe which goes through a couple holes in the top of the main PVC shaft.
The lower roller is plastic, and is directly connected to the motor's shaft.
The base is designed to be expandable, it is made of wood, screws, some metal supports, and can have parts replaced relatively easily, as well as cardboard inserted in some spots to more precisely set the belt's angle up (to make sure the top and bottom rollers are as close to perpendicular as possible).
The lower shaft (which doubles as the lower roller) extends out in both directions, through two bearings. Two small pieces copper pipe with 1/2" ID and very thin walls are on both outside walls of the base, superglued on (to stop the shaft from shifting while it's spinning). There is a drill bit glued inside one end of the PVC bottom roller, which a handheld electric drill can easily be attached to.
The top is made of two steel mixing bowls taped together with aluminium tape. It's connected with a wire to a screen wire patch (aluminium). The screen comb is attached to the top of the main PVC shaft, and is very close (but not touching!) to the neoprene belt.
The upper roller the belt goes over is a piece of PVC pipe wrapped in aluminium tape (to make it be conductive), and spins on a smaller piece of PVC pipe which goes through a couple holes in the top of the main PVC shaft.
The lower roller is plastic, and is directly connected to the motor's shaft.
The base is designed to be expandable, it is made of wood, screws, some metal supports, and can have parts replaced relatively easily, as well as cardboard inserted in some spots to more precisely set the belt's angle up (to make sure the top and bottom rollers are as close to perpendicular as possible).
The lower shaft (which doubles as the lower roller) extends out in both directions, through two bearings. Two small pieces copper pipe with 1/2" ID and very thin walls are on both outside walls of the base, superglued on (to stop the shaft from shifting while it's spinning). There is a drill bit glued inside one end of the PVC bottom roller, which a handheld electric drill can easily be attached to.
Friday, April 10, 2009
VDG works first try
First attempt the VDG worked, updates coming eventually for steps between this and last post.
Tuesday, March 31, 2009
Van de Graaff generator progress
Cut a couple strips of Neoprene to get the correct length & 2" wide strips, superglued together to make a belt.
Either a blender motor or hand held electric drill motor (both AC Induction (split-phase capacitor) motors) is probably best. Need to work out how to build a mount for whichever used. If possible, the base needs to be designed to switch the motor out.
The base has to be far enough from the top to hold the Neoprene belt as tight as possible, as long as the bottom doesn't break from the strain. It has to be stretched enough to be pulled from the inner edge of the PVC pipe and not have enough slack to attract itself and have the insides of the belt come in contact with eachother.
Either a blender motor or hand held electric drill motor (both AC Induction (split-phase capacitor) motors) is probably best. Need to work out how to build a mount for whichever used. If possible, the base needs to be designed to switch the motor out.
The base has to be far enough from the top to hold the Neoprene belt as tight as possible, as long as the bottom doesn't break from the strain. It has to be stretched enough to be pulled from the inner edge of the PVC pipe and not have enough slack to attract itself and have the insides of the belt come in contact with eachother.
Subscribe to:
Posts (Atom)



