One of those really handy things to remember… When git “tracks” a branch, it basically sets up an entry in .git/config which tells git what to do with push and pull. For example: I had a remote branch called Task/Round3.3. I wanted to work on it locally, but have push and pull work right. So [...]
Archive for the ‘Engineering’ Category
How to checkout and track a remote git branch
Posted in Engineering, Linux, Open Source, Software, Technique, tagged git, git branch, version control on July 9, 2010 | Leave a Comment »
MySQL, PostgreSQL, Oracle, SQL Server — Order by RAND ?
Posted in Engineering, Technique, tagged Database, Random Records on July 8, 2010 | Leave a Comment »
Great howto on grabbing a selection of random records from a few different databases here: http://www.petefreitag.com/item/466.cfm
git add -u
Posted in Engineering, Software, Technique, tagged git, version control, scm, git add on May 16, 2010 | Leave a Comment »
Here is a nice little tidbit I ran across some time ago… Ever delete a bunch of files from a git working copy, and then had to go in and tell git that you meant to delete them? For example: [jason@dc40 AppStruct]$ git status # On branch master # Changed but not updated: # (use [...]
New Wooden Gun Project
Posted in Engineering, Fun, Interesting, tagged .45, 3D modeling, SolidWorks, Thompson, Thompson Machine Gun, Toy Gun on April 24, 2010 | Leave a Comment »
In our workshop, we have been designing a new toy wooden gun model in SolidWorks. This is inspired by the classic Thompson Machine Gun from the early 1900′s in the US. We will probably make it out of maple or walnut, and either paint or stain it.
Great article on Python super, __mro__, and attributes
Posted in Engineering, Open Source, Perspective, Technique, tagged Python, Python attributes, Python super(), Python __mro__ on February 20, 2010 | Leave a Comment »
I highly recommend reading this excellent writeup on Python super(), python __mro__, python attributes, and more. It is Copyright © 2005-2009 Shalabh Chaturvedi http://www.cafepy.com/article/python_attributes_and_methods/python_attributes_and_methods.html#method-resolution-order
git scm tip
Posted in Engineering, Perspective, Technique, tagged git, scm, tip, version control on February 20, 2010 | Leave a Comment »
You may be aware of git add . But did you know this: git add . adds all the files. Use with care (only after git status, for example). git add -u . adds and deletes all KNOWN files. This is great if you added and removed or renamed files.
Python 3 bytes indexing returns integers!
Posted in Engineering, Technique, tagged bytes, Python, python 3 on December 31, 2009 | Leave a Comment »
While converting a bunch of werkzeug code to Python 3.1, I ran into an issue with one of the bytes objects that was previously a string. The line of code in question was originally this: if value and value[0] == value[-1] == b’"’: … If value is something, and the first and last characters are [...]
How to Author a *simple* jQuery plugin
Posted in Engineering, Technique, Uncategorized, tagged JavaScript, jQuery, jQuery Plugin on December 21, 2009 | Leave a Comment »
I use jQuery as the JavaScript library for most projects. It’s terribly convenient for selecting elements and processing them. However, jQuery is not JavaScript, and there is a lot of things it cannot do. Rather than writing a separate set of functionality outside of jQuery, why not simply extend it on an application-per-application basis? It [...]
jQuery mouseout vs. mouseleave
Posted in Engineering, Technique, tagged Events, JavaScript, jQuery on December 18, 2009 | Leave a Comment »
Hello! jQuery has a mouseout and a mouseleave event. The main difference is in how they handle child elements. Mouseout fires when the pointer moves into or out from child element, while mouseleave doesn’t. This was causing a slight problem of having some menu’s close when the mouse encountered a link or other child element [...]