Office Setup
Posted by Andrew Flanagan in Actual Events, Geekiness on December 31, 2009
I seem to remember talking about this already but I’ve further upgraded my man-cave to new levels of geekiness. I know have two 26″ screens that I’ve wall mounted just above my desk (keeps them in the same position regardless of all the clutter on my desk.)
Currently I’m running OS X on my right screen and Windows 7 on the left. I use Synergy to share mouse/keyboard commands so it feels like one continuous background. I’m mostly using OS X still but the new machine has 6GB of RAM which gives a lot of breathing space if the Mac gets bogged down.
What I’d like to do is switch out my aging Logitech system with two simple monitor speakers — I still haven’t decided what make/model to get but they have good stuff for pretty cheap. I’ll plan on mounting these on a small shelf along with all the hard drives and accessories that I have. If that all works, I could simply get rid of the desk and bring the leather chair from downstairs. Should be a nice setup.
I have visions of punching a hole behind the monitors and making an in-wall rack that I can use to store my rather large 4U case. The wall there backs into the garage rafters and there’s quite a bit of room. Ventilation and cooling would be an issue but I’m sure I can come up with something that works well.
What’s your work/play area set up like? I’ll post any pictures I receive…
Ice and Keeping Warm
Posted by Andrew Flanagan in Actual Events on December 30, 2009
We’ve been having some icy weather of late. The frosts have been beautiful — much heavier than usual. Some of these last few days have just been gorgeous. Cold, crisp, but wonderfully clear!
Most of the plants are holding up well. With the exception of the new maple sapling and the new rhodedendron which our new puppy Jack 2.0 has decided to eat. I think they’re goners.
In order to keep Jack warm, I made a dog house. The design is pretty simple, should be big enough for him even when he’s full-grown and as a plus, it’s insulated. It’s not the prettiest thing inside but my woodworking skills are pretty rudimentary. I did get a new DeWalt Jigsaw (which works great). I was amazed by just how much this thing weighed… It’s heavy enough that I really need a hand-cart to move it around. I suppose that’s good — the boys and the dog won’t be able to move it around. The walls are about 2 inches thick — outer hardi-plank, 1″ foam insulation, and 1/2″ plywood sheathing inside. I was able to use a lot of scraps that I had. I think the total cost was under $100.
I made it to match the house so at least it fits in nicely with the yard. The roof is done pretty poorly. I actually have enough to put on a second layer of shingles (which would probably help keep it dry) but I got lazy and decided to wait and see what Jack does to this before moving on.
Graphs
Posted by Andrew Flanagan in Geekiness, Somewhat Random on December 29, 2009
Google Public DNS
Posted by Andrew Flanagan in Actual Events, Geekiness on December 3, 2009
Google today announced that they’re providing a high-performance public DNS server. This sounds like a great idea from a performance perspective … I’ve not had too many complaints with my DNS servers provided by Comcast but I’ve definitely had some issues at my work with slow/non-responsive DNS servers.
However, I suppose this is just one more thing that can go wrong. Now there’s one BIG target to attack and if someone happens to poison the cache, we’re all in a world of hurt.
I do plan on updating my home router though to start using this. I’ll post a follow-up with my review.
From: Official Google Blog: Introducing Google Public DNS.
Update: They’re definitely taking security very seriously. Some more info can be found here that’s quite helpful.
Types of People
Posted by Andrew Flanagan in Actual Events, Somewhat Random on December 2, 2009
Found this in some notes from a while back (I believe it was at a series of classes at Faith):
VRP – Very Resourceful People
These people IGNITE Spiritual Passion (Mentors)
VIP – Very Important People
These people SHARE Spiritual Passion (Peers)
VTP – Very Trainable People
These people CATCH Spiritual Passion (Proteges)
VNP – Very Nice People
These people ENJOY Spiritual Passion
VDP – Very Draining People
These people SAP Spiritual Passion
(If someone knows the source I’ll post it — I can’t remember)
Scuttle Firefox extension
Posted by Andrew Flanagan in Geekiness on October 23, 2009
I use Scuttle on my server (for storing bookmarks). The beauty of the solution is that I have a centralized repository of bookmarks (which isn’t too special considering that many services provide this feature) but in addition, it’s very nicely set up to server as Live Bookmark lists in Firefox. So for example, I can have a single Live Bookmark drop-down for all work-related links, or all my “daily” websites or whatever and automatically add and remove from them as I see fit. The Live Bookmarks mean that all I need to do to reorganize links is retag them and it’s instantly working on all the computers I have.
It’s handy. But there’s a problem. The Firefox extension for Scuttle isn’t really being maintained. It’s pretty simple but needed a new “max firefox version supported” string in the configuration. I’ve updated this and am now posting the unofficial 0.4.2 release of the Firefox Scuttle plugin with support for Firefox 3.5+.
Unicorns?
Posted by Andrew Flanagan in Geekiness on May 17, 2009
I don’t know how many people reading this may know, but you can use Google as a calculator. Doing a search for “4 * pi” will in fact return a special “first result” that is the calculation. This is handy as it also does unit conversions like in order to convert 22 km to furlongs. There are some easter eggs though, and this is definitely the best: number of horns on a unicorn. Maybe it’s just me, but this is incredibly funny to me.
I’ve been playing with the very impressive WolframAlpha and wondered if they had done anything similar. Sure enough “number of horns on a unicorn” return the expected result. Even more amusingly, my second guess, number of horns on a horse shows that they really having some fun:
C++ from Python
Posted by Andrew Flanagan in Actual Events, Geekiness on March 30, 2009
I was impressed today to see how easy it was to call a C++ DLL from Python. I got the following information from another site:
1. Create a file called dlltest.cpp and write a function that sums two numbers and returns the result:
//dlltest.cpp #define DLLEXPORT extern "C" __declspec(dllexport) DLLEXPORT int sum(int a, int b) { return a + b; }The extern “C” construct tells the compiler that the function is a C function. It also removes the decorations from the functions names in the DLL.
__declspec(dllexport) adds the export directive to the object file so you do not need to use a .def file.
2. Include the header of the function in dlltest.h:
//dlltest.h int sum(int, int);3. Create a new Dinamic-Link Library project and include the two files, compile, and create the DLL.
4. You can now use Dependency Walker to see the list of the exported functions. You should see here the sum function.
5. Move the DLL in the Python folder or use
>>> import sys >>> sys.path.append(r"C:\path\of\dll")to include the DLL folder in the list of Python folders.
6. Use the ctypes module to access the DLL:
>>> from ctypes import * >>>mydll = cdll.dlltest >>> mydllNote: ctype module is already included from Python 2.5. If you are using an older version you can download ctypes here.
7. Now call the function:
>>> sum = mydll.sum >>> sum <_FuncPtr object at 0x0097DBE8> >>> sum(5, 3) 8
Reposted from here… (Thanks!)
I need to get into Python more — I’ve used Ruby a bit but have tended to ignore Python simply because I’ve not seen it is needed. Evidently, I need more side projects.
Google CTemplate
Posted by Andrew Flanagan in Geekiness on March 30, 2009
I just realized that I reinvented the wheel a month or so… I had a need for a nice templating language and although I did look for a solution that already existed, I didn’t look hard enough. Google CTemplate is exactly what I wanted. My solution was basically to create this from scratch while ignoring all the complexities that I thought I wouldn’t need. The result works (and may even be faster) but it feels clunky and it’s not very flexible. You learn something new every day. Maybe with Rev2 of our release I’ll start using this — it certainly would be easier and the API is already documented.
From their website:
Here is a simple template file:
Hello {{NAME}}, You have just won ${{VALUE}}! {{#IN_CA}}Well, ${{TAXED_VALUE}}, after taxes.{{/IN_CA}} |
Here is a C++ program to fill in the template, which we assume is stored in the file ‘example.tpl’:
#include <stdlib.h> #include <string> #include <iostream> #include <google/template.h> int main(int argc, char** argv) { google::TemplateDictionary dict("example"); dict.SetValue("NAME", "John Smith"); int winnings = rand() % 100000; dict.SetIntValue("VALUE", winnings); dict.SetFormattedValue("TAXED_VALUE", "%.2f", winnings * 0.83); // For now, assume everyone lives in CA. // (Try running the program with a 0 here instead!) if (1) { dict.ShowSection("IN_CA"); } google::Template* tpl = google::Template::GetTemplate("example.tpl", google::DO_NOT_STRIP); std::string output; tpl->Expand(&output, &dict); std::cout << output; return 0; } |