RegEx for CSS

I've spent a good amount of time on code refactoring over a large code base.

Maybe for the future I will code up a RegEx generator to help search for all (or obvious) occurances of CSS patterns.  For now, I will just start posting helpful RegEx here: 

For instance, doing a code review, and I'm trying to find all occurrences of this rule (below) in our JSP code base, which is huge. 

#error .moduleStructContent .errorHeader {float:none}

You should try to run this in Eclipse (Ctrl+H) make sure your narrow your search as much as possible using file name patterns in this case I'm searching JSPs (*.jsp) or alternatively (*.js*) if you want to include your .js code as well.


Maybe this is not the most elegant solution. But, for right now, it's working. I'll try to find something later that will return more accurate results.


This will at least give you a good place to start testing any occurance of this rule. 

This is a cool tool to help construct your RegEx.  It came in useful to remind me of the [\s\S]*, which matches any character or whitespace across multiple lines, which is key for this sort of search. 

A Shift in Education

With the birth of my daughter right around the corner, I have been thinking a lot about her education.  And, I am very much in the favor of a home school education.  Well.. that's not completely accurate.  I am very much in favor of an internet based education.  The location of the delivery is still in the air.  

In my own experience, I have witnessed the meaning of a college degree in today's economy.  There is a certain prestige of having an expensive piece of paper that you've earned through hardwork and perseverence.  But, more and more, I am seeing the "success" market (as opposed to the "job" market) seeking out individuals who have achieved rather than simply learned.  With the constantly maturing internet economy, I think there is an inevitable shift pending in education.  In fact, I think the shift is in mid swing.  Technology and the internet has revolutionized so much already in many aspects of business.  Elements of education have already shifted from text book education to video education, to the inevitable computerized learning systems.  

The entertainment systems of the world have ben extremely sucessful over the years.  Entertainers have studied the human psycology of... well.... entertainment; how to captivate, how to amuse, and how to motivate.... etc.  And, entertainment has been a valuable tool to communicate various messages, ideas, and dispositions very effectively.  It is high time that main stream educators utilized the currently available technologies, and strategies available, including entertainment, to educate our children.  

The Khan Academy

A good introduction to the Khan Academy can be found in Salman Khan's TED Talk.  The main element of the Khan Academy that impresses me is their linear lesson system.  This is a system that allows the student to progress at their own rate.  If you browse to ~7:50 of Khan's Talk he elaborates on the point. (go ahead, I'll wait).  

So, my proposal for the world, should you choose to accept it is, why not use the Khan Academy system now?  OR, create something like it?  It will get better over time.  Make a Wiki sort of system out of it.  Let people contribute.  As proven with Wikipedia, people will show up.  

There and back again.


Ahhh yes,, hopefully this will the first post in a long line of honest, to myself at least, blog entries where I will share with you the fruitlessness of my labours for the past 10 years.  Fruitlessness in that I don't make much money.  In fact, I'm flat broke.  And, I'm not that happy, mostly because I'm tired of being broke. This is going to be an account of how I get out of my current reality an into a life that I will create for myself. If I have nothing else, I have optimism.  

I've spent a lot of time getting to where I am right now, which as I just stated is not very far at all.  I have a lot of knowledge.  I'm revered as a fairly smart guy, with an Masters of Fine Art in Computer Animation.  I'm a less than part time leader of a local chapter of a world wide special interest group for computer graphics (SIGGRAPH), to which I've donated a mind numbing amount of time.  All to find out that I've been following a path to a dead end.  For me at least.  I could probably move away from my home town, which I've lived in since I was 2, and persue a giant video game or motion picture company.  Once there, I would sit in a dark room and proceed to put all of that knowledge that I've worked up over the years and work my life away.  Yeah, the pay would be pretty good, in few cases (ref Digital Domain Stereoscopic dept interview).  But, after you get over the glam of being a part of the awesomeness which is a major videogame or major motion picture where you were enevitably the lead pebble texture artist, you realize that you're working really hard all the time, your life is largely dictated by insane crunch time schedules, and (your life) is largely not your own.  

I realized that that is not where I want to be.  So, I fell back on my stand-by ability as a web designer and developer.  This I do really well too, and my computer animation ability sometimes folds into my freelance jobs on the web.  Perfect!......... No, not so much.  Turns out I'm not that great of a business man.  My ability to negotiate the price that my work is worth is terrible.  For some reason it's difficult to rationalize the worth of multiple years of design study, degrees, and experience when some dude in pakistan can undercut you by 90%.  Hmm.. go figure.  I could make a business of web development contracting and consulting.  But really, how long will it last until all freelance or small time web development is outsourced to 3rd world countries?  Probably not long.  Furthermore, I'll never really be happy creating brands and web sites for other people.  What I do for them is not my creation.  It's an abomination of someone else's will guiding my ability.  Moving on.   

Well here I am, an ant fart's distance from being flat broke with all the ambition in the world.  If that's all I need, I'm set.   I realize that to find happiness in what I do, I'm going to have to create something tailored to that which I'm passionate about.  One problem is though, I have a lot of passion for a lot of different disciplines.  But, the common thread in all of them, they have to do with creativity and enginuity.  Computer Graphics, Programming, Web Technology, Web Marketing, Design, Engineering, I can't seem to get enough of it all.  The trick is going to be the molding of all of that interest into something that will turn a profit.  

Before I was REALLY a computer geek.  I was a car geek.  I loved the machines.  I was really into performance, tuning, tweaking, upgrading, swapping engines.  That was my thing, engine swaps, or putting hopped up engines in more modest vehicles.   My favorite was a truck that I drove in high school, which I lovingly named the MUT, as she was largely a sum of her parts.  It was an 84 GMC S-15 extra-cab long bed, with a Buick Grand National intercooled turbo charged engine swapped in.  Dropped on coil overs and ladder bars, a narrowed Ford 9 inch rear end and wide low profile tires on the back.  I remember 205-50-15 would barely stretch across those rear wheels.  Oh, it was tubbed too.  In side, there were nice two tone leather seats from a Mustang.  It was clean, long story short, she was bad!  I had my week days devided in half between high school and technical school.  I went to McFatter Vocational/Technical for Automotive Technology.  I was still younger than 18 so I lied about my age to get a job at a local garage, changing tires.  

I also worked for a stint at DiabloSport in Boca Raton, doing technical support.  DiabloSport makes tuning products for all Ford vehicles, including Dodge Diesels, at the time.  They now make a product to reflash Chevy vehicles.  Working at Diablo, I met the head engine tuner, Pat Stajdel.  Pat has since left DiabloSport to build his own brand of tuning products at Sniper Inc.  Over the years we largely lost touch.  That is, until I decided to ask Pat to make me a dealer of Sniper products.  Short story short, he agreed.  And, I'm stoked about bringing all of the ability that I've gained over the years back into the automotive field.  I feel I'm getting closer to that ultimate goal, the marriage of all of my interest and ability into the mutant love of my life, my work. 

So, in a way, I've come full circle.  At the beginning of the trip around is my new business,  MPG Labs.

My Screw Magnet Motor Project


For updates,, go to the bottom of the thread.

 As I start this blog, I have not yet been sucessful, nor failed at recreating the screw magnet motor.  I just decided that I'd document the process that I'm taking to get to my result.  You'll notice that my approach originates from my background as a computer animator.  I have a masters degree in computer animation, which means that I have an uncanny ability to recreate things that I see in video in 3d software.  In this case, I'm working with Blender , an open source 3d animation package.  All that I have to work from is a video from Xpenzif, the original creator of the screw magnet motor.  In this movie transition from one frame to the next, you'll see the care that I've taken to recreate the PVC and screws from the working magnet motor.  There will be some mismatching, as Blender does not take into account lens distortion.  

I figured out my lens depth through some trial and error.  Note that to match the perspective of the photo image taken with a 55m lens on 35mm film (image aspect ratio = 1:1.5) I had to use a 44mm "Lens" spec in Blender. Can't say why the disparity because I don't know how Blender's "Lens" settings are calculated.  But, this is the best guess that I can make. 

3d matching of Xpenzif's original recording



 Here are the measurements that I have estimated at this point.  My measurements are derived from a caliper compared against visual software comparisons.  I was grateful to see a rib towards the top of the PVC in the original Xpenzif video.  This verifies that I have the same exact peice of PVC that he is using.. I believe it's a 4 or 3 inch coupling (available at Home Depot or Lowes in the plumbing section). 

  • Diameter of the PVC: 4 inches
  • inside diameter of the PVC: 3.5 inches
  • PVC cylinder height: 2.255 inches
  • screw offset: 27.6923 degrees
  • screw rows V: 4 rows
  • screw rows U: 13 columns

So far, I have disassembled a SCSI hard drive.  I've removed the magnetic arm and circuit boards from the hard drive.  I've also cut out a significant portion of the hard drive housing to give the PVC some room to turn. 

Then, I used a dremel to route out the inside diameter of the PVC so the diameter and depth of the hard disks fit perfectly.  Note: This took about 3 hours and a resperatory infection to complete.  The result, however, is a peice of PVC that spins as close to perfectly as one could hope for.  

All that I have yet to complete is the grinding and gluing of the screws.

I"ll probably have to pick up some new Neo Dimium magnets as well.  


Original Video from Xpenzif

In watching the original video some more,, I'm noticing the lean to the spindle when Xpenzif shows us the perhiphrial view of the working model.  Someone once mentioned in the forum that gravity might have a finger in the equation.  If you look closely at my image match movie, you'll notice that Xpezif's screws aren't lining up perfectly with my screws.. I assure you that my screws are offset 27.6923 degrees for each set,, which is nearly a perfect offset for 13 columns.  So, my proposal is, Xpenzif is using an imbalance in his offset and gravity at some point in the rotation.  So, if a perfect offset doesn't end up working, I'll try to match a rotation with my 3d model.  Then, I can map his entire screw pattern. 

Here's a video of my progress to date
Feb 13 2008


 Well, I finished the first version of the screw magnet motor.. annnd.. no joy.. in fact.. there are big sticky spots.  So nothing successful here.



Gravity Magnet Motor Invention

~~Added March 24 2012~~

As you might deduce from this little venture, I like to come up with solutions to problems.  This is one of them.  It's a good excercise in creative thinking for sure.  I really like the thought of an energy source that runs solely on naturally occuring, renewable sources.  I like solar, but it's expensive.  I like wind, but it's unpredicatble and inefficient.  Then I thought,, gravity.  What could I build that might leverage gravity to create energy?!?  This is something I came up with.  Turns out it probably won't work.  In fact, I built a little one with pretty strong magnets.  The pull from the magnets didn't allow it to move much at all.  What I thought this thing would do is use magnetic forces to strategically move the weight of the magnets around in positions such that the pull of gravity would move the wheel around.  As mentioned later in this article, I'm no physicist.  It doesn't work.  But, I like to invent.  And, if nothing esle, this was a neat idea towards a meaningful invention.  Back to the drawing board!  Read on if you'd like to see my amazing revelation! wink


I think this animation is pretty self-explanatory. As the wheel rotates, the mass of the magnets get repulsed and attracted in such a way that they shift to a gravitationally-favorable position to keep the wheel rotating. 

~~Added Sep 3 2010 ~~

After wasting a lot of time looking through PMM (Permanent Magnet Motors) and the like, I started to believe those who know better than I.  So, I started wondering about the possibility of using magnets to position themselves in a way that will use gravity to keep, in this case, a wheel turning.  Again, I am no physics student.  So, wether this idea has any merit, I don't really know.  I did try to make a crude model of this idea.  And, I found that there was a lot of magnetic resistance (push/pull) that kept the thing from working the way that I had hoped for.  

Hey, if you're going to fail, do it quickly.  :-)

After pursuing all of this "free energy" thought, ideas, and threads, I settled on the concept that "alternative" energy is there for the taking.  What we need to do is build and improve on those technologies!  They are essentially FREE.  Wind, tide, solar, even gravity can be harnessed, and is harnessed to do work, create energy.  And best of all?!?!  You're not trying to defy physics.  Doesn't that make you feel a little more like you now have an attainable goal?  Good.  Now continue to create.  But, create something that's going to work.  Create something that is going to improve this world we live in.  Create something that is going to improve and promote freedom, autonomy, and independence.  Go on.  Make us proud. 


 :: Sept 6 2008 ::

I can't believe it's been so long since I worked on this..  How time flies.  At any rate, after chatting with Sterling Alan and Jim Dunn about this invention concept, I did a rendition of the original visualization to compensate for some potential magnetic forces that would hinder the intended mechanic of the device.  Jim's statement on PESWiki "it will not work because magnetism requires short distances, and gravity requires larger distances." makes good sense, and it's probably not a good idea to second guess someone with Jim's creds.  I think, though, if one were to cleverly place the magnets in a way that minimizes sticky spots, it might just work.  Granted, it wouldn't have a lot of torque, but it might spin.  

I marked proprietary and confidential on the animation per lawyer instructions, but I'd be impressed if someone got one working in the first place.  Furthermore, by posting the concept online, I revoke my rights to patent the technology.  So, if you're so inclined to try to make one, go for it!  However, I would seriously think about making a tweakable computer model first off.   

 Shortly after the conversation, in true garage hacker form, I set out to build one.  In all, it was not successful.  I found there is a magnetic sticky spot in the slide transition.  For the future, I'd first like to build out a physically accurate computer model before charging to the garage.  So, If anyone can recommend a software package that might be capable of a simulation such as this.. I would like to wrap my brain around it.  

 THANKS!!  And, happy hunting for that working solution.   


:: Feb 18th 2007 ::

Last night, after my failed attempt at reproducing the screw magnet motor , I decided to proceed with my usual free engery net browsing routine, and stumbled on this thread.I took a quick look at the illustration on that page and decided thatit could use far more clarification in the form of a nice animation. Therefore, I created the animation that you see above in the hopes ofpromoting myself as a scientific concept animator.. While creating the animation, I maintained the general concept ofrepositioning the mass of magnets in a way that would cause the overallwheel to spin through gravitational leverage (if there is such athing).  Through the creative process, a new design concept emerged.  Adesign that I feel fully utilizes the repulsive and attractive forcesof the magnets to minimize friction and maximize the "gravitonleverage".  

I already have a few design modifications to make in order to avoidmagnetic interaction between the sliding magnets.  More animations are soon to come. 

On a side note:  If this is, in fact, a unique idea, I hope to retainthe rights to the device until I can properly release it under an opensource-like license.  I want this to be freely available to the world. Let's face it, a free energy source is what the world needs right now. I just don't want "big energy" corporation-x to get their grubby mittson it and try to claim ownership,, etc etc..  I know I'm probablyjumping the gun on this.  No prototype has been built yet.  But, justso it is known, I'd like to protect this concept, if it does in factwork, only to give it away.


VAWT - Vertical Axis Wind Turbines


Update: Since writing this article in 2008, I've done a bunch of research on the design and efficiency of these turbines.  They have their up-sides and down-sides.  The downsides being, they are far less efficient in transforming force from the wind to rotational force, when compared with the typical airplane prop type design.  This is probably why you don't see more planes with this kind of propeller.  They are however, less noisy, which may make them more suitable in an urban environment. 

I was just in DC a few weeks ago and witnessed one of VAWTs big benefits first hand.  In the city, there was a prop type turbine directly adjacent a VAWT.  Wind speed is pretty low and turbulent do to multiple obstructions, like building, trees, and such.  And there she was spinning like a champ, while the prop turbine was dead in the water.  I can already hear the engineers start babbling efficiency numbers and equations for power production.  Prop type turbines make more power, that's a given.  But, that little real world demonstration of utilizing available wind in a certain, non-optimal, environment speaks volumes to me.  

~~~ original post ~~~~~

I remember this type of wind turbine when watching a Science Channel program called EcoTech.  The very same special that my animation was in.  The design is much more like an old lawn mower as compared to the air plane prop design.  This looks far more efficient.  And I could imagine this right at the pinnacle of my house.. just making electricity like crazy!


Look at how f'ing easy it would be to make this thing!  

Here's a nice design!!