My friend Nick brought this video to my attention. It shows how small $100 million dollars is compared to the entire US budget. What really stood out to me was how much of the budget is dominated by welfare handouts… looks like over 80%. I guess we are “all socialists now.”
(requires Adobe Flash plugin… click HERE to watch it on YouTube)
I found my Charlie Hunter CD recently and I’ve been enjoying listening to him again. He’s an amazing musician apart from the fact that he plays the bass and guitar simultaneously. YouTube didn’t exist when I first got into him, and it’s nice now to be able to watch him play. Enjoy!
(requires Adobe Flash plugin… click HERE to watch it on YouTube)
If this video ever gets deleted from YouTube, you can download it HERE.
Well, I wasn’t planning of having 2 of these posts in a row be about Obama, but I guess the President is always an easy target.
President Obama claims that his 2010 budget will save American taxpayers $2 trillion over the next 10 years… $2 trillion compared to what? His numbers all depend on what the baseline is. According to Politifact, it appears Obama’s stretching the numbers, and rates his claim as “barely true”.
Keep in mind that the deficit is a number that reflects income minus expenses over the course of a single year…
When we talk about the deficit getting “smaller,” though, you have to ask “smaller compared to what?”
The answer: smaller than it would have been without Obama’s proposed changes…
Obama’s critics contend he’s inflating the baseline. In particular, they say, Obama claims we would have spent a pile of money on “overseas contingency operations,” which means the wars in Iraq and Afghanistan. Obama’s budget then posits that he wouldn’t spend that much money…
“It’s the equivalent to assuming an expensive vacation, then not taking it, and saying you’ve cut your family’s budget,” he (Brian Riedl) said. “To claim savings off that baseline is ridiculous.”
The left-leaning Center on Budget and Policy Priorities… said a more realistic number for deficit savings was $900 billion, a little less than half of Obama’s estimate.
… Obama’s budget increases revenues by letting the Bush tax cuts expire… The Obama budget document shows a deficit reduction of $636 billion over 10 years from those tax increases.
You can read the entire article HERE.
After some digging, I finally found out how to create a regex for Sed (stream editor) that will find a line that does NOT contain a particular string. First, I used ‘find’ to list all the *.cpp files in my source tree:
find . -name “*.cpp” -print
Then I piped the files to ’sed’ via ‘xargs’ (Note: replace the ‘-e’ with ‘-i’ to actually modify the files inline):
find . -name “*.cpp” -print | xargs sed -e ‘/STRING_TO_INGORE/! { d }’
The trick is adding the ‘!’ (exclamation point) after the search expression. Without it, ’sed’ would think you only want lines with the string, not without it.
This is different than another syntax I’ve seen used: /(?!STRING_TO_IGNORE)/.
Here’s another example. Say you want to replace STRING1 with STRING2 only if the first characters of the line (ignoring white space) are NOT “//”… i.e. skip the string replacement in code comments:
sed -i ‘/^[ \t]*\/\/.*/! { s/STRING1/STRING2/ }’
NOTE: ‘[ \t]*’ means ignore 0 or more spaces or tabs.
I heard several people now tell me how amazing it is that the snipers landed 3 kills with 3 shots from a boat. Having known a sniper and seen him hit skeet one-handed with a 9mm, I can tell you that this doesn’t surprise me at all. I’m actually more surprised at the public’s reaction. Here’s a great excerpt from a DefenseTech article I read on the incident:
A shot of 80-90 feet — even at night and in rolling seas — is a cakewalk for DevGru SEALs.
“These guys can put three rounds onto the head of a quarter at that range,” Allen told me.
…A multi-thousand ton destroyer is a pretty stable platform in any but the most tumultuous sea states and makes dialing in a shot on an admittedly tossing life raft more doable — a smart platform for the Team to operate from. …
I think the American public doesn’t fully appreciate the talent of these teams. Props to SEAL Team VI!
I’m sorry, but this is too funny not to post…
(requires Adobe Flash plugin… click HERE to watch it on YouTube)
If this video ever gets deleted from YouTube, you can download it HERE.
A lot of solutions I’ve found for recursively replacing text in files is implemented using shell scripts, perl, php, or some other inconvenient way. Rushi got it right by using the Linux command line. Here it is (slightly modified) from his blog:
find . -name “*.cpp” -print | xargs sed -i ’s/[find]/[replace]/g’
where “[find]” and “[replace]” are the things you are searching for and substituting.
To search files with multiple file extensions, use:
find . -name “*.cpp” -o -name “*.h” -o -name “*.c” | xargs sed -i ’s/[find]/[replace]/g’
ADDED 4-13-2009: See comments for other variations.
We got an interesting application crash yesterday with a confusing message similar to this:
Fault bucket 42424242, type 1
Event Name: APPCRASH
Response: None
Cab Id: 0
Problem signature:
P1: MyApp.exe
P2: 1.42.42.42
P3: 598773cf
P4: StackHash_ac62
P5: 0.0.0.0
P6: 00000000
P7: c0000007
P8: 00000000
P9:
P10:
We spent some time wondering if our crypto libraries were the problem (we just made some changes recently), but concluded that was unlikely. So what the heck is the “StackHash” module? Did our trashed stack cause the kernel to think we were a different module? Nope.
The answer is that the Windows executive couldn’t identify the module we were in when the application crashed (it uses the instruction pointer to determine what code was executing). In this case, the kernel simply takes a hash of the stack so at least we might be able to identify if we’ve seen this exact crash before. Here’s the answer summarized by an engineer from Microsoft:
In the OS when I try to get a faulting module name it is possible that there is no module laoded (sic) at that address. For example in this case the EIP was zero. So in those cases where a module is not loaded and it is not also in the unloaded module list, I take a stack hash of the stack so that we can identify this crash from other crashes where also the module is not known.
I’ve been jealous of Rob’s screensaver for awhile now. I thought it was Mac only until I asked him about it… nope. I installed the Windows version today. What a beautiful piece of art! The creator, Jesson Yip, describes it like this:
Analogy is a typographic clock which fuses the immediacy of digital with the visual-spatial quality of analogue into a hybrid format. It presents an everyday object with a fresh twist.
Click on the image below to visit his site and download it. Enjoy!
The title’s kind of a misnomer. This post is really to help me remember how to get a human-readable string from a Windows error code… I’m finally tired of always having to look it up
. However, my current situation revolves around determining why a DLL (or *.so on Linux) failed to load, so that’s why this post it titled the way it is.
I like to disable the annoying default dialog that pops up in Windows when a library fails to load.
SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX | SEM_NOALIGNMENTFAULTEXCEPT | SEM_NOOPENFILEERRORBOX);
Now, here’s the code to get a user friendly text string:
#ifdef WIN32
LPVOID pStr = 0;
DWORD_PTR args[1] = { (DWORD_PTR)pFilename };
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_ARGUMENT_ARRAY,
NULL,
GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR)&pStr,
0,
(va_list*)args);
// TODO: Do something with the string pStr here.
LocalFree(pStr);
#else
// TODO: Call dlerror() and do something with the string.
#endif


