Tuesday, August 12, 2014

Cleaning Up Old Links

I recently started to clean up the http://www.lazyhacker.com website some parts of which I haven't touched in 10 to 15 years.  One of the pages that I was cleaning up with the utilities page that I had put together.

It was very interesting to see how much has changed (and in some cases how much haven't).  Some observations:

A number of the tools and programs that I linked to no longer exists, but a surprising number still do.  Mostly it was the commercial software that disappeared while community and open source stuff are still going strong.

The programming environment has sure changed a lot.  Back then, we tend to look for "utilities" that helped us with our work.  These days things are more on-line web applications and rather then small utilities it's more large applications.

Back then the major online programming resource was DejaNews (Usenet).  Software was obtained from FTP servers and now how many kids even know what FTP is?

We used to share code by zipping it up for download and now you have Github, Pastebin, etc.

EMACS and VIM.  Many will come and many will go, but these two always remain in the conversation.

One noticeable exception around commercial software was Microsoft.  Most of the Microsoft tools that I linked to were not only still alive, but Microsoft continue to make sure all the URLs to them still worked!  They actually do a better job then open source projects such as Fedora (moved from redhat.com to its own domain but no redirect from the old url to the new) and Jikes (IBM didn't redirect the old jikes page to its new domain).

I removed the Java related stuff since I don't do much Java anymore (not terribly sad about that), but I do wonder about the future of Java.  Perl has kind of faded from public view while C is always and will be C.  I haven't touched Scheme if forever!  I added a link to Go.

If I were to create a new page, I think the whole classification of things would be totally different with categories that wouldn't have been there 15 years ago and many of the old categories be unknown to the new programmer.

Monday, August 11, 2014

Books For Every Programmer's Shelf

Here are some books that I believe should be on every programmer’s bookshelf.
The C Programming Language, 2nd Edition” - By the creators of the C language, this concise book clearly teaches the foundations for the C language. For a more tutorial book on C, I would suggest “C Primer Plus”
Wiley’s Teach Yourself C++” by Al Stevens - My favorite book for learning C++.
Programming Pearls “ - A great collection of essays on programming including ways to approach programming problems.
Programming Perl” - The definitive book for the Perl language by the creator of the language.
The Art of Computer Programming, Volumes 1-4A Boxed Set” - This thick 4 volume set is a thick academic tomb of knowledge for computer science.
Software Tools” or “Software Tools in Pascal” - Writing software tools and utilities is a special discipline.
The Practice of Programming” - Easy to read text on programming practices.
Win32 Programming” by Brent E. Rector, Joseph M. Newcomer - While Petzold’s Programming Windows®, Fifth Edition is generally considered THE book on windows programming, I actually like this book better because of its more in-depth coverage of the topics.
Here are some books for the professional programmer that isn’t around coding.

Friday, August 1, 2014

Use Google Drive For Free Web Hosting on Custom Domains

Update:  Google Drive no longer offer the ability to serve web pages so this post is no longer relevant.

Google Drive allows a very convenient and free way host web pages.  You simply share the folder to the public and anyone can go to http://googledrive.com/host/<folder id> with their browser and see your web site.  Publishing a page or any file is just a matter of dropping it into the drive folder.  However, Drive currently doesn't support custom domains so if you have your own domain (e.g. example.com) you can't have http://www.example.com be served from Drive.

There is a site, http://gweb.io, that allows you to do this for about $10/year, but I've never used them or know much about them.  Instead, this article will describe one way to roll your own using Google App Engine (GAE) and if your site only have moderate traffic you should be able to stay within its free quota.  Note:  this was a quick hack I did and not meant to be a high performance web site.  Don't be running your own Google with this!  :-)

The basic idea is very simple.  GAE allows you to have custom domains so you create an app on it and it can map to your domain (e.g. http://www.example.com).  What the app will do is take the URL, translate it to the googledrive.com URL and fetch the page for you and return it through app engine.

From 
http://www.example.com/page1.html 
To 
http://googledrive.com/host/page1.html
With the mapping, use GAE's FetchURL service to grab the file and pass it back to the caller.  That's it.


Follow the GAE tutorial on setting up a basic helloworld app (such as this one for Go).  Instead of hello.go, I have file called "fetch.go" and instead of "package hello" it is "package fetch".  For the content of fetch.go:

Remember to put in your folder ID in fetch.go at line 20 (I should've made it a constant and easier to spot).

Now give it a try on your local server to make sure it works and then upload your project.  If everything is working well, you can them map this app to your domain.  That's it!

Now, this is not very optimized and only really recommended for small sites.  For example, this will fetch from googledrive on every request and the browser might not be able to cache it.  For the former, it would be easy to insert memcache to keep a cached version on the server side.  For the latter, we'd want to stick in some headers to help browsers cache the file unless the file is updated very frequently.

Anyway, with GAE's generous free quota, this might work well for many small sites out there to serve some examples web sites or landing pages.

One question we might ask ourselves is that why use Drive at all if you're using GAE already?  For me it was mainly convenience of being able to just drop the file into a drive folder and 'cause I just wanted to write some Go code on GAE.

Sunday, March 2, 2014

Disabling Anti-Aliasing on Chrome

Update:  To make it easier, I uploaded the files to https://github.com/lazyhacker/chromecss.  Just download it and point your Chrome browser to use it as an extension.

While I love Chrome and it's my favorite browser, the one thing I really dislike about it is the way it handles anti-aliasing.  I really don't like the seeing soft fuzziness around fonts.  It always makes me feel it's blurry.

Previously, to disable the anti-alias in Chrome you would create a "User Stylesheet\Custom.css" file (Chrome doesn't use the OS's font setting) with the following:

body { -webkit-font-smoothing: none; }

But starting with version 33, Chrome no longer load the user style sheet so one day I started Chrome and everything looked fuzzy again!

The "new" way around this to create your own Chrome extension.   All this involves is adding one new file.

Create a new directory and add a new file called manifest.json.  Have the following in it:

{    "manifest_version": 2,    "name": "Disable AntiAlias in Chrome",    "version": "0.1",    "content_scripts": [{        "matches": ["https://*/*", "http://*/*"],        "css": ["style.css"]    }]  }

Then create a file that matches the name used in the line "css": ["style.css"].  In this example, create a file called style.css.

Style.css should have the same thing as what was in the Custom.css file above.

Then on the url bar in Chrome, type "chrome://extensions/" (without the quotes).  Enable the "developer mode" checkbox and click on the "Load unpacked extension" button.  Select the directory that contains your newly created file.

Done.

Saturday, August 17, 2013

Setting up Vim for Go

A more updated post on setting up VIM is here.

I've been playing around with the Go programming language recently and so I wanted to configure VIM to work better with it.  The Go package comes with vim plugins for syntax highlighting, indentation and helper functions which is a good start, but I wanted to have some of the nice things that I set up previously for other languages that used more frequently such as being able to jump to functions, auto completions, etc.  The Go community have made this dead simple and will only take a few minutes.

Auto-Completion

While I'm not a big fan of IDEs, one feature I always do want is context aware auto-completion (e.g. type in a partial function name and get a list of possibilities).  I remember using a Norton tool as far as the DOS days since I'm terrible at remembering the exact spelling of function names/variables, members, etc.

Gocode is a daemon that will provide this functionality.  It is a daemon that is editor-agnostic so it can be used by VIM, Emacs, Sublime Text, etc.  Setup is a one-liner:
go get -u github.com/nsf/gocode
Then use the vundle VIM plugin by adding this to your .vimrc:
bundle Blackrush/vim-gocode  
The plugin will automatically start the daemon if it is not already running or you can start/stop it manually.

I use the SuperTab plugin so that when I hit "Tab" that it brings up the autocomplete menu so I set this in my .vimrc:
 let g:SuperTabDefaultCompletionType = "context"
There you go!  Auto-completion for Go in VIM.

CTags/Tagbar

I use ctags to to let VIM know how to jump to declarations (e.g. cursor on a function name and jump to the function definition).  To add Go support to CTags, use the gotags package.
go get -u github.com/jstemmer/gotags
The README.md even has the VIM configuration for using with the Tagbar plugin!

Misc

I also added this to my .vimrc:
    au FileType go au BufWritePre <buffer> Fmt
    autocmd FileType go setlocal tabstop=4
The first line will run the Go code formatter whenever the file is saved.  The second line shows a tab as 4 spaces instead of 8 spaces that is the default for Go.

Tuesday, December 18, 2012

Chrome Font Smoothing

I'm not a big fan of OSX's font smoothing and I'm not fond of Chrome on OSX's font smoothing either so I end up turning it off with the following:

~/Library/Application Support/Google/Chrome/Default/User StyleSheets/Custom.css

body { -webkit-font-smoothing: none }

Other options are:  subpixel-antialiased and antialiased.

Tuesday, October 9, 2012

My Garage Workshop

Even before we moved into our house, I had been planning an area to be my workshop.  I wanted a place that was organized, comfortable and had the space for me to work on projects big and small.


Everything is against one wall or on wheels so they can be moved against the wall to help conserve space.


It felt good to have built a lot of the things myself (with some assistance from a little helper) including the workbench, carts and some of the shelving.


I'm looking forward to being able to build some stuff here.

Sunday, September 30, 2012

Mitre Station in the Workshop

While the Kapex isn't a large compound sliding mitre saw, having it on my workbench effectively took up most of the available work surface so I've been wanting to build some kind of miter station for it.  Originally I thought about building a mobile mitre station, but after some thought decided to just build a stationary one next to the workbench at the same height so the workbench can double as a work piece support extension.




It's essentially just a box with an compartment underneath being used to house the dust collector.  The main challenges for the build were making it level since my garage has a pretty steep slope and getting the height right so that the Kapex is at the same height as the workbench.  I used shims on the back to and on the front I used some machine levelers to make it easier to adjust the height.  I was able to get it even with the workbench.


There is an opening in the back for the hose, power cord and air to flow through.


The other side of the station still need an extension so I'm thinking of building a folding extension that I can pull out whenever I need to use it.  Also, some shelving next to the station would be useful and would complete my work space "L".


Dust Collection for Router Table

I have a list of woodworking projects that I've been wanting to do and last weekend I planned on completing a couple of them.  My work area is in the garage and shares space with the car.  To do any work requires that I back the car out and setup my tools each time.  This isn't a big problem as most of time since I have most of my tools on mobile carts and setup time is minimal.  The project I had planned on doing involved cutting down full sheets of plywood so there was some extra setup assembling my cutting table.  While this takes away time that I'd like to spend working on the projects it's a minor annoyance.  Now what is frustrating each time I get to time to do some work is the dust clean up especially when I work with the router.  So much dust is generated that I always have to cut my working time so I can clean and vacuum up the mess and while I can keep the car outside during the weekend I have to clean at the end of each session since I don't want the family to have to go through all the dust.  This meant that I probably spent a couple of hours out of a few hours on cleaning.

I decided that I need to do something about this otherwise I just won't be able to get much done, so I started to see if I can put some kind of dust collector into the router table.  Most plans show a dust collector connected to the back or base of the router, but a lot of people also mentioned that this didn't work very well in actually capturing the dust.  Also, a lot of dust actually accumulate above the table..  Buying a Festool 1400 and the CMS module isn't a realistic option, so I did some  more searching and found the Keen Dust Collector for Routers.



Essentially this is a little rubber cut that you put on the underside of your router plate so that dust doesn't fall down into the router and router table.  By limiting the space where dust can spew a vacuum's section is a lot more effective in capture the dust.





I have a Bench Dog 40-001 ProTop Contractor Benchtop Router Table which is an enclosed router table so setup involved drilling a hole in the back to run the vacuum hose through.



There is is plastic sheet that sits between the router base and the router table.  It has a velcro ring that the blue rubber cup sticks to so the cup doesn't move around.  Mount your router and put in the rubber cup and then attach the hose.



Conclusion?  It works very well!  I cut multiple dados through 3/4 in plywood and very few dust got on the floor or into the router cabinet.  It was good enough that I felt comfortable going right back into the house after a slight dust off with my hands for some dust that did get on to my shirt and pants.  For about $40, you can have  a pretty effective dust collector for the router table that can save hours of clean up.

Friday, August 24, 2012

Mobile MFT3 Cart with Boom Arm and Storage

My "workshop" is, like many people, in the garage and one stipulation from She Who Must Be Obeyed for letting me indulge in my hobby is that the garage must still be able to function for its intended purpose for at least one car.  That means being able to move stuff around and out of the way.   While the MFT/3 is not super heavy, it doesn't motivate me to want to me to move it.  Besides moving the table itself there is the vac and other pieces of equipment that needs to be moved as well.  I decided that what I need is a mobile cart with storage that will keep everything together and I just need to roll one thing around.

The result is this mobile storage cart for my MFT3:


I got a lot of the inspiration from others especially those who posted on the Festool Owners Group.  I added a boom arm to hold up the vacuum hose and power cord so they stay out of the way when I'm cutting.  There are 3 compartments for storing things in the front and a small storage place in the back as well.  The caster are machine leveling casters from WoodRiver which keeps it stable and stationary when, but when I want to move it I can lower the wheel.

Finding a place to keep the saw between cuts has always been a pain so I decided to have  space next to the table to put it down.  I put in some sides to prevent it from accidentally falling off.


I haven't done too much since building the cart, but I have some projects in mind if only I can find the time... :-)