tag:blogger.com,1999:blog-82149321479066504422024-03-13T08:47:14.705-07:00Politics, Robotics and LinuxAt the moment I am most passionate about politics, robotics and linux. So if you like any of this stuff come and read!!!stephenmmhttp://www.blogger.com/profile/11320584628764748257noreply@blogger.comBlogger46125tag:blogger.com,1999:blog-8214932147906650442.post-13765341296126996662012-08-18T22:56:00.001-07:002012-08-18T22:56:51.187-07:00Advanced Arduino HackingFor the Arduino hacker ready to go to the next level. Really great Article:<br />
<br />
<a href="http://pragprog.com/magazines/2011-04/advanced-arduino-hacking">The Pragmatic Bookshelf | PragPub April 2011 | Advanced Arduino Hacking</a>: <br />
<br />
stephenmmhttp://www.blogger.com/profile/11320584628764748257noreply@blogger.com0tag:blogger.com,1999:blog-8214932147906650442.post-72747191291407703702011-09-12T12:08:00.001-07:002011-09-12T15:37:35.386-07:00Searching code for a string not in the comments...Every few months I need to search my code for a string but there are a bunch of references to that code in the comments and I want a regex that will remove those for me. I forget how to do it so every few months I have to figure it out again, well hopefully I will remember when I put it here:<br /><br /><blockquote><br />>cat example.txt<br /><br />token asdf asdf @OK<br />asdf token asdf @OK<br />//token @BAD<br />asdf token asdf // asdf token asdf @OK<br />// This is a token @BAD<br />/some/dir/token @OK<br />aaa token try again @OK<br />aaa token try again @OK<br />aaaa token try again @OK<br /><br />>egrep '^.?([^/][^/])*token' example.txt<br /><br />token asdf asdf @OK<br />asdf token asdf @OK<br />asdf token asdf // asdf token asdf @OK<br />aaaatoken try again @OK<br />aaa token try again @OK<br />aaaa token try again @OK<br /></blockquote>stephenmmhttp://www.blogger.com/profile/11320584628764748257noreply@blogger.com1tag:blogger.com,1999:blog-8214932147906650442.post-12318531476635345672011-04-21T14:11:00.000-07:002011-04-21T14:14:03.632-07:00USB3 SpeedsI <a href="http://photography-on-the.net/forum/showthread.php?t=980975">read this little post</a> about USB3 speeds that I found very interesting since I am working on designing USB3 hubs.<br /><br /><blockquote><br />COUNTERPOINT<br />by Chris Karr, Director, Software/Firmware Engineering of the Branded Products Group at Western Digital Corporation (and previous author of SpeedTools (QuickBench, ZoneBench, etc.),<br /><br />I read your article and have some feedback about your Key Insight #1. I strongly disagree that USB 3.0 is slower than eSATA, per se. eSATA is limited to 3 Gb/sec whereas USB 3.0 is a 5 Gb/sec interface. They both use 8b/10b encoding so they are both 80% efficient on paper. (Transport protocol overhead further reduces real world data transfer rates and this overhead varies by bus interface type.) We expect USB 3.0 to be able to crack 400 Megabinary bytes per second (MiB/sec) with the right setup. eSATA will likely never crack 275 MiB/sec unless/until they move to 6 Gb.<br /><br />The limiting factor with USB 3.0 storage devices to date has been the 3 Gb SATA backend of the first generation of USB 3.0 to SATA bridge chips. The 3 Gb SATA interface limits the potential of the 5 Gb Superspeed USB interface. Plus, converting from SATA protocol to USB protocol adds a bit of additional overhead.<br /><br />That said, there are two basic approaches to actually deliver max speed over USB SuperSpeed with a bridged SATA solution, neither of which, to my knowledge, have yet been done:<br />1) Put two 3 Gb SATA ports on the back end of the USB bridge and connect two SATA devices which can saturate both of the SATA busses (think two SandForce-based SSD's in a RAID 0).<br />2) Make a bridge chip with a USB 3.0 front end and a 6 Gb SATA backend and stuff a 500 MiB/sec enterprise-class 6 Gb SSD or RAM drive behind it.<br /><br />You will need a very powerful PCI bus (aka Gen 2 running off north-bridge, etc.) to get the best numbers, but we believe USB 3.0 can reach at least 400 MiB/sec once the other system bottlenecks are resolved. Of course, with a single HDD all this comparison stuff doesn’t mean much because they just aren’t fast enough to be meaningfully bottlenecked by either SATA or SuperSpeed USB.<br /><br />Lastly, look for well-designed integrated USB 3.0 host controllers coming in the near future to further boost USB max data transfer rates.<br /></blockquote>stephenmmhttp://www.blogger.com/profile/11320584628764748257noreply@blogger.com0tag:blogger.com,1999:blog-8214932147906650442.post-3536663965521904972011-04-06T18:52:00.000-07:002011-04-06T18:56:11.768-07:00Preserving code formatting in blog postsIn my last post I needed to keep the format of the code snippets. I found this very useful tool that will keep the formatting for you and and generate the raw HTML for it:<br /><br />http://www.manoli.net/csharpformat/stephenmmhttp://www.blogger.com/profile/11320584628764748257noreply@blogger.com0tag:blogger.com,1999:blog-8214932147906650442.post-41086976161140537772011-04-06T18:08:00.000-07:002011-04-06T18:58:34.816-07:00Vim Visual Selection Tricks<!-- code formatted by http://manoli.net/csharpformat/ --><br /><style type="text/css"><br />.csharpcode, .csharpcode pre<br />{<br /> font-size: small;<br /> color: black;<br /> font-family: Consolas, "Courier New", Courier, Monospace;<br /> background-color: #ffffff;<br /> /*white-space: pre;*/<br />}<br /><br />.csharpcode pre { margin: 0em; }<br /><br />.csharpcode .rem { color: #008000; }<br /><br />.csharpcode .kwrd { color: #0000ff; }<br /><br />.csharpcode .str { color: #006080; }<br /><br />.csharpcode .op { color: #0000c0; }<br /><br />.csharpcode .preproc { color: #cc6633; }<br /><br />.csharpcode .asp { background-color: #ffff00; }<br /><br />.csharpcode .html { color: #800000; }<br /><br />.csharpcode .attr { color: #ff0000; }<br /><br />.csharpcode .alt <br />{<br /> background-color: #f4f4f4;<br /> width: 100%;<br /> margin: 0em;<br />}<br /><br />.csharpcode .lnum { color: #606060; }<br /></style><br /><pre class="csharpcode"><br /><br /><span class="rem"># VISUAL SELECTION TRICKS:</span><br /> <span class="rem"># You can use filters and vim's execution mode.to do some powerful things.</span><br /> <span class="rem"># A filter is any standard UNIX program (sort, awk, grep, cut, paste, sed ...) that can read from stdin and write to stdout.</span><br /> <span class="rem"># Vim's execution mode lets you read in or replace text with the output of a program. If you make a visual selection (say,</span><br /> <span class="rem"># using V or C-V), and hit :, your command prompt will immediately be :'<,'>, which means "Apply whatever command follows</span><br /> <span class="rem"># to the lines included in the visual selection." At this point, you can write !foo to replace the text with the output of</span><br /> <span class="rem"># program foo.</span><br /><br /> <span class="rem"># For example, to sort the text by the python column, select it, hit :, and enter !sort -k5. The whole command will look like</span><br /> :<span class="str">'<,'</span>>!sort -k5<br /> <span class="rem"># Running it will produce:</span><br /><br /> a b cd 1 p<br /> b b cd 2 y<br /> c b cd 3 t<br /> d b cd 4 h<br /><br /> <span class="rem"># Results in:</span><br /><br /> d b cd 4 h<br /> a b cd 1 p<br /> c b cd 3 t<br /> b b cd 2 y<br /><br /> <span class="rem"># For more complex tasks, awk is your friend. A command like</span><br /> :<span class="str">'<,'</span>>!awk <span class="str">'{ print $1, $3, $2, $4, $5 }'</span><br /><br />a cd b 1 p<br />b cd b 2 y<br />c cd b 3 t<br />d cd b 4 h<br /><br /> <span class="rem"># will flip the second and third columns (but note that inter-column spacing is collapsed).</span><br /> <span class="rem"># To do maths on a column, try something like</span><br /> :<span class="str">'<,'</span>>!awk <span class="str">'{ sub($4, $4*2+1); print }'</span><br /><br /> a b cd 3 p<br /> b b cd 5 y<br /> c b cd 7 t<br /> d b cd 9 h<br /><br /> <span class="rem"># Could get the same result with perl if there is only one column of numbers:</span><br /> :<span class="str">'<,'</span>>!perl -pe <span class="str">'s/\d+/$&*2+1/e'</span><br /><br /> <span class="rem"># To flip the visual selection just select the rows and then:</span><br /> :<span class="str">'<,'</span>>!tac<br /><br /> d b cd 4 h<br /> c b cd 3 t<br /> b b cd 2 y<br /> a b cd 1 p<br /><br /> <span class="rem"># This pipes the lines through the unix 'reverse cat' program.</span><br /></pre><br /><br /><br /><div><br /></div><div><br /></div><div><br /></div>These ideas were taken from here:<div><br /></div><div><a href="http://stackoverflow.com/questions/5561249/how-to-flip-a-visual-selection-in-vim">http://stackoverflow.com/questions/5561249/how-to-flip-a-visual-selection-in-vim</a></div><div><br /></div><div>Sand here:</div><div><br /></div><div><a href="http://stackoverflow.com/questions/3752785/what-can-you-execute-on-visually-selected-text-in-vim">http://stackoverflow.com/questions/3752785/what-can-you-execute-on-visually-selected-text-in-vim</a></div>stephenmmhttp://www.blogger.com/profile/11320584628764748257noreply@blogger.com0tag:blogger.com,1999:blog-8214932147906650442.post-84962844710902372652011-03-05T12:11:00.000-08:002011-03-05T13:17:52.274-08:00My switch from the 3Gs iPhone to Android (Samsung EPIC on Sprint)I just got my first android phone, the Samsung EPIC 4G through Sprint. There are many reasons why I chose this specific Android phone but here were a few of my requirements:<div><ul><li>Physical keyboard (although I am also very impressed with Swype)</li><li>Front facing camera which will allow for video conferencing</li><li>At least a 1Ghz processor (The GPU helps out a lot as well)</li><li>AMOLED screen (Not technically a requirement but if you have ever seen it you will understand)</li><li>Android OS 2.2 (Froyo) -- Sprint actually just retracted this update but it should be back soon.</li><li>Faster network (4G)</li><li>Stop paying any more Apple taxes</li></ul></div><div>Some may wonder why I didn't go with the new iphone. Well, I wanted a physical keyboard and I wanted the ability to create scripts on my phone so that I could get my phone to do exactly what I wanted it to do. Sprint seems to be a much better user experience so far as well, with or without 4G. As it turns out my wife was already on Sprint so our cash flow will also be much improved ($0.20 per text? c'mon AT&T). </div><div><br /></div><div>I was tempted to wait for this summer as to let my contract with AT&T lapse. There will certainly be newer phones introduced by then as well, but I figured life is too short. Also the fees for ending the contract were not that bad and Sprint had some pretty good incentives that more than made up for it.</div><div><br /></div><div>Is there anything I will miss about my iPhone? Honestly I don't think so. Some may miss iTunes but I never really got into iTunes that much anyway. I almost always stream my music (<a href="http://www.slacker.com/">Slacker</a>) anyway so the network is much more important to me.</div><div><br /></div><div>Upside surprises</div><div><br /></div><div><ul><li>The network just seems much much snappier than AT&T even when I am on 3G.</li><li>The screen is amazing when I set it next to my old phone the iPhone seems downright dull. When I look at my Picasa pictures on the EPIC using there "gallery" app it is like looking at the pictures for the first time. I have never seen my pictures looking so good!</li><li>Integration with all the Google tools is excellent. </li><li>Swype virtual keyboard is much more usable than I ever thought it could be. It makes me question my requirement for a physical keyboard it is that good. If you are not planning to write scripts on your phone you may really not need the physical keyboard, maybe.</li></ul><div>Downside surprises</div></div><div><br /></div><div><ul><li>The keyboard keys are a little bit too flush. I wish everyone that made physical keyboards would use the raised keys like on Blackberry's. I find myself looking at the keys a bit too much trying to find where my fingers are exactly. I was thinking about adding a dot of super glue to all the keys so that I could really feel them but I am not sure there is enough clearance. </li><li>I wish the four buttons at the bottom of the phone were physical keys as well so I wouldn't have to look at them to push them.</li><li>I find it a bit frustrating to get help with things. For instance one of the reasons I got the phone was so that I could send certain incoming calls directly to voice mail (you know who you are, jk :). If you search the intertubes you can find lots of people talking about it, but it seems like my phone does not have the option. I am not sure if it is the Android OS 2.1 or Sprints front end or what but the slight differences are a bit frustrating. On the other hand I know that eventually I will get it working where as with the iPhone I would never be able to fix it because of the closed nature of the phone. </li></ul></div><div>My following posts will describe in more details my attempts to script up my phone.</div>stephenmmhttp://www.blogger.com/profile/11320584628764748257noreply@blogger.com2tag:blogger.com,1999:blog-8214932147906650442.post-30226069238447988652010-05-25T21:48:00.000-07:002010-05-25T22:23:00.620-07:00Is DropBox a usefull tool?hmm.... In a word, yes! I feel like I am a little late to this party but what a productivity booster <a href="https://www.dropbox.com/referrals/NTc0MzU2OTE5">DropBox</a> can be. The greatest thing about Dropbox is that it acts like a folder on your drive and everything you put in there gets synced. Now you might not think that is so great since you would have to store all your configuration files in some random folder but all you really have to do is move your important files to the sync folder and then create a symbolic link to them from the original location. Pretty darn simple and very effective. Now I can have one .vimrc file, one plugin directory, one .alias file and all my different machines can use it!<div><br /></div><div>Here is a snippet from my notes that shows you how simple this really is:</div><div><span class="Apple-style-span" style="font-family:'courier new';"><br /></span></div><div><div><span class="Apple-style-span" style="font-family:'courier new';"> SYNCING MY FILES VIA THE CLOUD (DROPBOX)</span></div><div><span class="Apple-style-span" style="font-family:'courier new';"> Once dropbox is installed I ran these commands on my myth box and things were backedup and synced</span></div><div><span class="Apple-style-span" style="font-family:'courier new';"> mv hlp Dropbox/HOME</span></div><div><span class="Apple-style-span" style="font-family:'courier new';"> ln -s ~/Dropbox/HOME/hlp/ hlp</span></div><div><span class="Apple-style-span" style="font-family:'courier new';"> mv bin Dropbox/HOME</span></div><div><span class="Apple-style-span" style="font-family:'courier new';"> ln -s ~/Dropbox/HOME/bin/ bin</span></div><div><span class="Apple-style-span" style="font-family:'courier new';"> mv web Dropbox/HOME</span></div><div><span class="Apple-style-span" style="font-family:'courier new';"> ln -s ~/Dropbox/HOME/web/ web</span></div><div><span class="Apple-style-span" style="font-family:'courier new';"> mv .vimrc Dropbox/HOME</span></div><div><span class="Apple-style-span" style="font-family:'courier new';"> ln -s ~/Dropbox/HOME/.vimrc/ .vimrc</span></div><div><span class="Apple-style-span" style="font-family:'courier new';"> mv .tcshrc Dropbox/HOME</span></div><div><span class="Apple-style-span" style="font-family:'courier new';"> ln -s ~/Dropbox/HOME/.tcshrc/ .tcshrc</span></div><div><span class="Apple-style-span" style="font-family:'courier new';"> mv .alias Dropbox/HOME</span></div><div><span class="Apple-style-span" style="font-family:'courier new';"> ln -s ~/Dropbox/HOME/.alias/ .alias</span></div><div><span class="Apple-style-span" style="font-family:'courier new';"> On other linux machines I will have to diff these files and see if there is any way to easily merge them</span></div><div><span class="Apple-style-span" style="font-family:'courier new';"> tkdiff ~/Dropbox/HOME/hlp/ hlp</span></div><div><span class="Apple-style-span" style="font-family:'courier new';"> tkdiff ~/Dropbox/HOME/bin/ bin</span></div><div><span class="Apple-style-span" style="font-family:'courier new';"> tkdiff ~/Dropbox/HOME/web/ web</span></div><div><span class="Apple-style-span" style="font-family:'courier new';"> tkdiff ~/Dropbox/HOME/.vimrc/ .vimrc</span></div><div><span class="Apple-style-span" style="font-family:'courier new';"> tkdiff ~/Dropbox/HOME/.tcshrc/ .tcshrc</span></div><div><span class="Apple-style-span" style="font-family:'courier new';"> tkdiff ~/Dropbox/HOME/.alias/ .alias</span></div><div><br /></div><div>Use<a href="https://www.dropbox.com/referrals/NTc0MzU2OTE5"> this link</a> to sign up and you get an additional 250MB of storage.</div></div><div><br /></div>stephenmmhttp://www.blogger.com/profile/11320584628764748257noreply@blogger.com0tag:blogger.com,1999:blog-8214932147906650442.post-89774657296052058752010-05-08T14:35:00.000-07:002010-05-08T14:41:31.244-07:00Chaning startup programs on windows 7<div style="font-size: large; font-weight: bold;"><b><span style="font-size:130%;"><span style="color:navy;">Through System Configuration</span></span></b> </div><br /><b><span style="color:red;">NOTE:</span></b> <i>Using the Selective Startup option in System Configuration (msconfig), you can enable or disable startup programs. You will need to be logged into an <b>administator</b> account, or provide the administrator password to open System Configuration</i>.<blockquote><b><span style="font-size:100%;">1.</span></b> Open the Start Menu.<blockquote>A) In the search line, type <b>msconfig</b> and press <b>Enter</b>. (See screenshot below) <blockquote><a href="http://www.sevenforums.com/attachments/tutorials/2167d1231221579-startup-programs-change-start_menu_msconfig.jpg" rel="Lightbox_12757" id="attachment2167"><img title="Startup Programs - Change-start_menu_msconfig.jpg" src="http://www.sevenforums.com/attachments/tutorials/2167d1231221579t-startup-programs-change-start_menu_msconfig.jpg" class="thumbnail" alt="Startup Programs - Change-start_menu_msconfig.jpg" style="margin: 2px;" border="0" /></a><br /> </blockquote>B) Go to step 3.<br /></blockquote><b><span style="font-size:100%;"><span style="color:red;">OR</span></span></b><br /><br /><b><span style="font-size:100%;">2.</span></b> Open the<a href="http://www.sevenforums.com/tutorials/262-control-panel-view-home-all-items.html" target="_blank"><b> <u>Control Panel (All items view)</u></b></a> and click on the <b>Administrative Tools</b> icon, then click on <b>System Configuration</b>. Close the Control Panel and Administrative Tools windows.<br /><br /><b><span style="font-size:100%;">3.</span></b> If prompted, click on <b>Continue</b> for the UAC prompt, or type in the administrator's password.<br /><br /><b><span style="font-size:100%;">4.</span></b> Click on the <b>Startup</b> tab. (See screenshot below)<br /><div style="width: 100%;"> <div style="font-style: italic; color: rgb(153, 102, 51); margin: 8px auto 0px; font-weight: bold; font-size: small; padding: 5px; background-color: rgb(255, 242, 170); border-left: 4px solid rgb(202, 202, 0); border-top: 1px solid rgb(202, 202, 0); border-right: 1px solid rgb(202, 202, 0);"> <img title="Tip" class="inlineimg" src="http://www.sevenforums.com/images/tipsmall.png" alt="Tip" align="absmiddle" border="0" height="16" width="20" /> Tip</div> <div style="padding: 4px; background: none repeat scroll right bottom rgb(255, 255, 225); border-left: 4px solid rgb(202, 202, 0); border-right: 1px solid rgb(202, 202, 0); border-bottom: 1px solid rgb(202, 202, 0); margin: 0px auto 8px;">If you look under the <b>Location</b> column for the <b>Start Item</b>, you will see the registry location for it that you can use to remove the startup item using METHOD FOUR below instead.</div> </div><blockquote><a href="http://www.sevenforums.com/attachments/tutorials/2160d1231220077-startup-programs-change-system_configuration_startup_tab.jpg" rel="Lightbox_12757" id="attachment2160"><img title="Startup Programs - Change-system_configuration_startup_tab.jpg" src="http://www.sevenforums.com/attachments/tutorials/2160d1231220077t-startup-programs-change-system_configuration_startup_tab.jpg" class="thumbnail" alt="Startup Programs - Change-system_configuration_startup_tab.jpg" style="margin: 2px;" border="0" /></a><br /></blockquote><b><span style="font-size:100%;">5. <span style="color:blue;">To Disable a Startup Program -</span></span></b><blockquote>A) Select a listed startup program and uncheck it. (See screenshot above)<br /><br />B) Repeat to disable anymore listed startup programs.<br /></blockquote><b><span style="font-size:100%;">6. <span style="color:blue;">To Enable a Startup Program -</span></span></b><blockquote>A) Select a listed startup program and check it. (See screenshot below step 4)<br /><br />B) Repeat to enable anymore listed startup programs.<br /></blockquote><b><span style="font-size:100%;">7. <span style="color:blue;">To Disable All Listed Startup Programs -</span></span></b><blockquote>A) Click on the <b>Disable all</b> button. (See screenshot below step 4)<br /><br />B) Go to step 9.<br /></blockquote><b><span style="font-size:100%;">8. <span style="color:blue;">To Enable All Listed Startup Programs -</span></span></b><blockquote>A) Click on the <b>Enable all</b> button. (See screenshot below step 4)<br /> </blockquote><b><span style="font-size:100%;">9.</span></b> Click on <b>Apply</b>. (See screenshot below step 4)<br /><br /><b><span style="font-size:100%;">10.</span></b> Click on the <b>Boot</b> tab, then check the <b>Make all boot settings permanent </b>box and click on <b>OK</b>. (See screenshot below)<blockquote><a href="http://www.sevenforums.com/attachments/tutorials/71528d1273254573-startup-programs-change-boot-1.jpg" rel="Lightbox_12757" id="attachment71528"><img title="Startup Programs - Change-boot-1.jpg" src="http://www.sevenforums.com/attachments/tutorials/71528d1273254573t-startup-programs-change-boot-1.jpg" class="thumbnail" alt="Startup Programs - Change-boot-1.jpg" style="margin: 2px;" border="0" /></a><br /></blockquote><b><span style="font-size:100%;">11.</span></b> Click on <b>Yes</b>. (See screenshot below)<blockquote><a href="http://www.sevenforums.com/attachments/tutorials/71529d1273254573-startup-programs-change-boot-2.jpg" rel="Lightbox_12757" id="attachment71529"><img title="Startup Programs - Change-boot-2.jpg" src="http://www.sevenforums.com/attachments/tutorials/71529d1273254573t-startup-programs-change-boot-2.jpg" class="thumbnail" alt="Startup Programs - Change-boot-2.jpg" style="margin: 2px;" border="0" /></a><br /></blockquote><b><span style="font-size:100%;">12.</span></b> Click on the <b>Restart</b> button to apply. (See screenshot below)<br /> <b><span style="color:red;">WARNING:</span></b> <i>This will restart your computer immediately. Save and close anything that you are working on first</i>.<blockquote><a href="http://www.sevenforums.com/attachments/tutorials/2161d1231220084-startup-programs-change-restart.jpg" rel="Lightbox_12757" id="attachment2161"><img title="Startup Programs - Change-restart.jpg" src="http://www.sevenforums.com/attachments/tutorials/2161d1231220084t-startup-programs-change-restart.jpg" class="thumbnail" alt="Startup Programs - Change-restart.jpg" style="margin: 2px; width: 300px; height: 137px;" border="0" /></a><br /></blockquote></blockquote>stephenmmhttp://www.blogger.com/profile/11320584628764748257noreply@blogger.com0tag:blogger.com,1999:blog-8214932147906650442.post-24202603047459767862010-03-29T20:47:00.001-07:002010-03-29T20:47:31.101-07:00VIM TIPS<div>VIM TIPS</div><div> </div><div> You can substitute the search string for upper and lower case ( <a href="http://vim.wikia.com/wiki/Switching_case_of_characters">http://vim.wikia.com/wiki/Switching_case_of_characters</a> ):</div><div> :%s/\(foobar\)/\L\1/gc </div><div> </div><div> </div><br>stephenmmhttp://www.blogger.com/profile/11320584628764748257noreply@blogger.com0tag:blogger.com,1999:blog-8214932147906650442.post-89361619720789486092010-03-29T12:33:00.001-07:002010-03-29T12:33:49.223-07:00PERFORCE TIPS:<div>PERFORCE TIPS:</div><div> </div><div> </div><div># USEFULL ALIASES:<br> # PERFORCE SHORTCUTS<br> alias p4_client echo `p4 info | perl -ne 's/Client name: (.*)$/print $1/e'`<br> alias p4_changes p4 changes -c `p4_client`</div><div> alias myp4v p4v -c `p4_client` -u ${USER} -p ${P4PORT}<br><br></div><br>stephenmmhttp://www.blogger.com/profile/11320584628764748257noreply@blogger.com0tag:blogger.com,1999:blog-8214932147906650442.post-52395405822561314692010-01-18T11:36:00.000-08:002010-01-18T11:40:01.860-08:00Microsoft is sooo 1980s....I mean really how come one of the oldest email clients around (outlook) does not even include instant messaging??? Yah know... I mean ... Really is it that difficult? I mean whateva... Microsoft rocks... NOT!stephenmmhttp://www.blogger.com/profile/11320584628764748257noreply@blogger.com0tag:blogger.com,1999:blog-8214932147906650442.post-48624927395154317832009-10-29T21:30:00.001-07:002009-10-29T21:30:48.990-07:00Google Sidewiki entry by Stephen<div xmlns='http://www.w3.org/1999/xhtml'><p>This is a really great company!</p>in reference to: <a href='http://proasix.com/'><a href='http://proasix.com/'>http://proasix.com/</a></a> (<a href='http://www.google.com/sidewiki/entry/117956649471569180949/id/2IE4R_NLwNc7SOQ9Lwvpv2I8AU0'>view on Google Sidewiki</a>)</div>stephenmmhttp://www.blogger.com/profile/11320584628764748257noreply@blogger.com0tag:blogger.com,1999:blog-8214932147906650442.post-14415705085927476972009-09-25T08:31:00.000-07:002009-09-25T08:33:36.248-07:00How to colorize any text based outputI found this little tidbit the other day. Very useful for highlighting simulation output warnings and errors:<br /><br /><a href="http://winterstorm.ca/hilite">http://winterstorm.ca/hilite</a>stephenmmhttp://www.blogger.com/profile/11320584628764748257noreply@blogger.com0tag:blogger.com,1999:blog-8214932147906650442.post-29966900026251169442009-09-23T22:25:00.000-07:002009-09-23T22:28:15.439-07:00Extract prices from craiglist#!/usr/bin/perl<br /># This is a script that will help me search craigslist and extract<br /># price information and average the data to get what the going<br /># price of an item is<br />#<br /># Example:<br />#; ~/bin/cl_get_prices.pl -string=2006 -string=maxima<br />#; ~/bin/cl_get_prices.pl -string=2003 -string=maxima -cities=dallas<br />#; ~/bin/cl_get_prices.pl -string=2003 -string=maxima -verb=4<br />#; ~/bin/cl_get_prices.pl -string=ps3 -string=80gb -verb=4<br />#; ~/bin/cl_get_prices.pl -string=ps3 -string=80gb -trim=.333<br />#; ~/bin/cl_get_prices.pl -string=ps3 -string=60gb -trim=.2 -filter_on_title=1<br />#<br /># I think I am going to give three outputs. Mean, Median and Trimmed Mean.<br /># This way if there is outlier data it will be easy to spot in the Mean<br /># value.<br /><br />use strict;<br />use Getopt::Long;<br />use List::Util qw(sum);<br />use Statistics::Descriptive;<br />use List::MoreUtils qw(uniq);<br /><br />my @item_prices;<br />my $delay_between_searches = 5;<br /><br /># Define the arguments<br />my %opts = ();<br />&usage unless &GetOptions(\%opts, 'help'<br /> ,'strings=s@'<br /> ,'cities=s@'<br /> ,'trim=s'<br /> ,'filter_on_title=s'<br /> ,'min=s'<br /> ,'max=s'<br /> ,'verbosity=i'<br />);<br />if ( @{opts{strings}} eq 0 ) { die " NO SEARCH STRING WAS GIVEN"; }<br />unless ( exists ${opts{cities}} ) {<br /> push( @{$opts{cities}}, 'austin' );<br />}<br /><br />$opts{trim} = .25 unless ( exists $opts{trim} );<br />$opts{min} = "" unless ( exists $opts{min} );<br />$opts{max} = "" unless ( exists $opts{max} );<br />$opts{verbosity} = 3 unless ( exists $opts{verbosity} );<br /><br />foreach my $city ( @{$opts{cities}} ) {<br /> &get_item_prices( \@item_prices, \@{$opts{strings}}, $city, $opts{min}, $opts{max}, $opts{filter_on_title} );<br /> sleep( $delay_between_searches );<br />}<br /><br />@item_prices = sort {$a <=> $b } @item_prices;<br />@item_prices = uniq @item_prices;<br />my $stat = Statistics::Descriptive::Full->new();<br />$stat->add_data(@item_prices);<br />$Statistics::Descriptive::Tolerance = 1e-10;<br />my $mean = $stat->mean();<br />my $var = $stat->variance();<br />my $tm = $stat->trimmed_mean($opts{trim});<br />my $std = $stat->standard_deviation();<br /><br />print "Prices: @item_prices\n";<br />printf "Statistics: Mean: %10.4f Var: %10.4f Std Dev: %10.4f Trimmed mean: %10.4f\n", $mean, $var , $std , $tm ;<br />print "". scalar( @item_prices ) . " ITEMS WERE FOUND\n";<br />print "lowest:\t\t$item_prices[0]\n";<br />print "highest:\t$item_prices[$#item_prices]\n";<br />print "Mean:\t\t" . sum( @item_prices )/@item_prices ."\n";<br />print "Median:\t\t" . $item_prices[@item_prices/2] ."\n";<br />print "Trim Mean:\t" . $tm ."\n";<br /><br />sub get_item_prices {<br /> my ( $item_prices_ref, $strings_ref, $city, $min, $max, $filter_on_title ) = @_;<br /> my $wget="http://$city.craigslist.org/search/sss?query=";<br /> my $str_cat = "";<br /> foreach my $str ( @$strings_ref ) {<br /> $wget .= "$str_cat$str";<br /> $str_cat = "+";<br /> }<br /> my $html = `wget -q -O - $wget`;<br /> print $html . "\n" if $opts{verbosity} > 6;<br /> my @chunks = split /(<\/?p>\s*)+/,$html;<br /><br /> # Filter out everything but the titles<br /> my $num_chunks = scalar @chunks;<br /> for ( my $idx = $num_chunks-1; $idx >= 0; $idx-- ) {<br /> delete $chunks[$idx] unless $chunks[$idx] =~ m/^......\s-\s/;<br /> print "$idx|$chunks[$idx]\n" if $opts{verbosity} > 4;<br /> }<br /><br /> # Clean up the title and do additional filtering on the title<br /> my $num_chunks = scalar @chunks;<br /> for ( my $idx = $num_chunks-1; $idx >= 0; $idx-- ) {<br /> my $rm_item = 0;<br /> $chunks[$idx] =~ s/^.+html">//;<br /> $chunks[$idx] =~ s/>//gs;<br /> $chunks[$idx] =~ s/<//gs;<br /> $chunks[$idx] =~ s/ / /gs;<br /> $chunks[$idx] =~ s/<[^>]*>//gs;<br /> if ( $filter_on_title eq "1" ) {<br /> foreach my $str ( @$strings_ref ) {<br /> if ( $chunks[$idx] !~ m/$str/i ) {<br /> $rm_item = 1;<br /> }<br /> }<br /> }<br /> delete $chunks[$idx] unless $rm_item == 0;<br /> }<br /><br /> # Extract price information from the titles<br /> @chunks = sort @chunks;<br /> foreach my $chunk (@chunks) {<br /> if ( $chunk ne "" ) {<br /> print " $chunk\n" if $opts{verbosity} > 3;<br /> my @words = split(' ', $chunk);<br /> foreach my $word (@words) {<br /> if ( $word =~ m/^\$/) {<br /> $word =~ s/(\$|,)//g ;<br /> if ( $word =~ m/^\d+$/ ) {<br /> push(@$item_prices_ref, $word);<br /> }<br /> }<br /> }<br /> }<br /> }<br /><br />}stephenmmhttp://www.blogger.com/profile/11320584628764748257noreply@blogger.com0tag:blogger.com,1999:blog-8214932147906650442.post-84499251201665237532009-06-10T15:25:00.000-07:002009-06-12T19:57:01.904-07:00HOTO: Create html "snapshot" from your gvim editorHere is my .vimrc snippet that allows me to quickly save off a file in an HTML format with all of the syntax highlighting, etc..<br /><br />The function is not working.. :( will have to work on it more later...<br /><pre><p style="FONT: 10pt courier; COLOR: #0000a0"><br />" Settings for :TOhtml<br />let html_number_lines=1<br />let html_use_css=1<br />let use_xhtml=1<br /><br />""function not working<br />"function! MyToHtml()<br />" normal :colorscheme default<br />" normal :TOhtml<br />" normal :colorscheme torte<br />"endfunction<br />"nmap <Leader>html :call MyToHtml()<br />nmap <Leader>html :TOhtml<CR>zR :w! ~/tmp/<C-R>%<CR> :q!<CR><br />nmap <Leader>print :colorscheme default<CR> :TOhtml<CR>zR :w! ~/tmp/<C-R>%<CR> :q!<CR>zR:colorscheme torte<CR><br /></pre></p>stephenmmhttp://www.blogger.com/profile/11320584628764748257noreply@blogger.com0tag:blogger.com,1999:blog-8214932147906650442.post-32860939445547704542009-06-08T11:22:00.000-07:002009-06-12T19:57:01.904-07:00COLRM - Discovered a fun new tool!It seems amazing to me that no matter how long I work in the world of Linux I am still to this day finding little tools to help my productivity. There are many different ways to remove certain columns of information from a text file but I just discovered<a href="http://books.google.com/books?id=2Et--84HIkwC&pg=RA1-PA559&lpg=RA1-PA559&dq=example+colrm&source=bl&ots=ISi6uEnYOU&sig=0Sl3Ub0_tIyFbByFNmaJidhWiGc&hl=en&ei=ZFotSszfH5ryswPB8vCiCw&sa=X&oi=book_result&ct=result&resnum=4"> colrm </a>( colrm first_col [second_col] ) which is a tool to do specifically that task. I am not sure how it does this behind the scenes so I am not sure how well it works if performance is critical but for a hackey little side thing it seems to do very well.<br /><br />Here is an example where I removed columns 87 to the end and from column 1 to 69 leaving just column data from 70 to 86:<br /><br /><pre><p style="FONT: 10pt courier; COLOR: #0000a0"><br />> cat ~/tmp/max_data.out colrm 87 colrm 1 69 > ~/tmp/max_data2.out<br /></p></pre><p></p>stephenmmhttp://www.blogger.com/profile/11320584628764748257noreply@blogger.com0tag:blogger.com,1999:blog-8214932147906650442.post-48865508808271478442009-06-05T15:54:00.000-07:002009-06-12T19:57:01.904-07:00A better unit conversion script (h2b b2h h2d d2h)So I have been trying to get a robust unit conversion script for a while and I have had a few different solutions but I always had some troubles with them. bc is the calculator tool that comes with most linux distributions and is pretty widely available and is very good at doing the conversions but it too had some difficulties if the string containing the numbers was not formatted just right. So I use a small Perl wrapper script to do the formatting and then pass it on to bc. This seems to be working very well for me now. You can see the code below. <br /><br />I also have some vim commands that call this script and allow me to do do conversions right from within vim (will add this vim code later). I also have some csh alias commands that I will add later as well. <br /><br />It has proven to be very powerful and has improved my coding and debugging efficiency. Hope someone else finds it useful.<br /><br /><br />##### FILE: bc_conversion.pl ######<br /><pre><p style="font: 10pt courier; color: #0000A0;"><br />#!/usr/local/bin/perl -w<br /># Use the bc function to do conversions..<br />#<br />## | check if called properly<br />#if ($#ARGV >= 0) {<br />if ($#ARGV < 2) {<br /> print " Usage: $0 <input_base> <output_base> <formula> \n" ;<br /> print " used to wrap bc so you can set the base input and output \n" ;<br /> print " in order to do conversions. For example to convert binary \n" ;<br /> print " to hex, run the following command: \n" ;<br /> print " bc_wrapper.sh 2 16 1001_1011 \n" ;<br /> print " RESULT: 9B \n" ;<br /> exit<br />}<br /><br />$ARGV[2] =~ s/_//g;<br />$ARGV[2] =~ tr/a-z/A-Z/;<br /><br /># The following is a csh command that tells the tool bc the output base type,<br /># the input base type and the expression to run.<br />my $cmd = "bc << EOF \<br />obase=$ARGV[1]; \<br />ibase=$ARGV[0]; \<br />$ARGV[2]; \<br />quit; \<br />EOF";<br /><br />#print " $cmd \n";<br />#system("$cmd") == 0 or die "system $cmd failed: $?";<br />my $result = `$cmd`;<br /># Make the result easier to read by inserting underscores<br />if ( ( $ARGV[1] eq "2" ) || ( $ARGV[1] eq "16" ) ) {<br /> $result = reverse $result;<br /> $result =~ s/(\w{4})/$1_/g;<br /> $result = reverse $result;<br /> $result =~ s/^_//g;<br />}<br />print "$result";<br /></pre></p>stephenmmhttp://www.blogger.com/profile/11320584628764748257noreply@blogger.com0tag:blogger.com,1999:blog-8214932147906650442.post-41396835796787684562009-06-05T15:45:00.000-07:002009-06-12T19:57:01.905-07:00My faster little find scriptI have been using this script for a long time. It certainly could be improved but it has proved invaluable.<br /><br />##### FILE: find.pl #####<br /><pre><p style="font: 10pt courier; color: #0000A0;"><br />#!/usr/local/bin/perl -w<br />use strict;<br />use Getopt::Long;<br />use Pod::Usage;<br /><br />my $cmdLine = "rerunRegressionResults.pl @ARGV \n";<br /><br />my $dateStamp=`date +'%Y-%m-%d-%H%M'`; chomp($dateStamp);<br />my $output = "";<br />my $help = 0;<br />my $grep = "";<br />my $displayOnly = 0;<br />my $noGrep = 0;<br />my $noVim = 0;<br />my $vimCmd = "";<br />my $dryRun = 0;<br />my $cmd = "";<br />my @fileNames;<br />my $replaceWithSpace = "~"; # Default is to replace all ~ with spaces.<br />my $arg = "";<br />my $verbosity = "";<br />my $endFind = "";<br />my @strings;<br />my $grepArg = "";<br />my $findRslt = "";<br />my $findRsltFound = 0;<br />my $endGrep = "";<br />my @dirs;<br />my @findRslts;<br />my @nots;<br />my @ands;<br />my @prunes;<br />my @sqlResults;<br />my @outputList;<br /><br />my $ok = GetOptions(<br /> 'displayOnly|do' => \$displayOnly,<br /> 'noVim|nv' => \$noVim,<br /> 'vimCmd|vc=s' => \$vimCmd,<br /> 'dryRun|dr' => \$dryRun,<br /> 'dirs=s@' => \@dirs,<br /> 'output=s' => \$output,<br /> 'endGrep|eg=s' => \$endGrep,<br /> 'fileNames|fn=s@' => \@fileNames,<br /> 'noGrep|ng' => \$noGrep,<br /> 'arg=s' => \$arg,<br /> 'verbosity=s' => \$verbosity,<br /> 'endFind|ef=s' => \$endFind,<br /> 'strings=s@' => \@strings,<br /> 'grepArg|ga=s' => \$grepArg,<br /> 'nots=s@' => \@nots,<br /> 'ands=s@' => \@ands,<br /> 'prunes=s@' => \@prunes,<br /> 'replaceWithSpace=s' => \$replaceWithSpace,<br /> 'help' => \$help<br />);<br /> if ( !$ok ) { die; }<br /><br /> pod2usage(1) if $help;<br /><br /> push ( @strings , @ARGV );<br /> if ( ( @strings == 0 ) && ( @fileNames == 0 ) ) { die " NO SEARCH STRING OR FILE NAME GIVEN!!! "; }<br /><br /> # Decide the defaults:<br /> if ( @fileNames == 0 ) {<br /> $fileNames[0] = "*";<br /> } else {<br /> if ( @strings == 0 ) { $strings[0] = $fileNames[0]; }<br /> }<br /> if ( @dirs == 0 ) {.<br /> $dirs[0] = "$ENV{'PWD'}";.<br /> }<br /> if ( $vimCmd eq "" ) { $vimCmd = "/usr/local/bin/gvim"; }<br /> if ( $arg eq "" ) { $arg = ""; }<br /> if ( $endFind eq "" ) { $endFind = ""; }<br /> #if ( $grepArg eq "" ) { $grepArg = " -n -I -i -C 3 "; }<br /> if ( $grepArg eq "" ) { $grepArg = " -n -I -i "; }<br /> if ( $output eq "" ) { $output = "~/tmp/find_$strings[0].rslt" }<br /><br /> # Start to build up the find argument<br /><br /> foreach ( @prunes ) { $arg .= " -not \\( -type d -name \"*$_*\" -prune \\) " }<br /> foreach ( @ands ) { $arg .= " -name \"*$_*\" " }<br /> foreach ( @nots ) { $arg .= " -not -name \"*$_*\" " }<br /> if ( @fileNames > 1 ) { $arg .= " \\( "; }<br /> foreach my $index (0..$#fileNames) {<br /> if ( $index > 0 ) { $arg .= " -o "; }<br /> $arg .= " -name \"*$fileNames[$index]*\" ";<br /> }<br /> if ( @fileNames > 1 ) { $arg .= " \\) "; }<br /><br /> # Create the comands and execute<br /> foreach my $string ( @strings ) {<br /> if ( $replaceWithSpace ne "" ) { $string =~ s/$replaceWithSpace/ /g; }<br /> $cmd = "find @dirs $arg $endFind -follow ";<br /> $cmd .= " -print0 | xargs -0 grep $grepArg '$string' $endGrep" unless $noGrep;<br /> print " $cmd \n" unless $verbosity eq "quiet";<br /> $findRslt = qx"$cmd" unless ( $dryRun );<br /> if ( $findRslt =~ m/[a-z]/i ) {<br /> $findRsltFound++;<br /> push ( @outputList , $findRslt );<br /> }<br /> }<br /><br /> if ( ( $findRsltFound < 1 ) && ( ! $dryRun ) ) {.<br /> die " !ERROR! ---> \"$strings[0]\" not found in dir(s) @dirs \n";.<br /> }<br /><br /> # Generate my output<br /> if ( $displayOnly ) {<br /> print @outputList;<br /> } else {<br /> open OUT_FILE, "> $output" or die "cant open $output : $!";<br /> print OUT_FILE @outputList;<br /> close OUT_FILE;<br /> #print @outputList;<br /> unless ( $noVim ) {<br /> my $cmd3;<br /> my $gvimSearch = "";<br /> # The search +/ does not work if using --remote in vim!!! SUCKS<br /> $gvimSearch = " +\"/$strings[0]\" " unless ( $vimCmd =~ m/remote/ );<br /> $cmd3 = "csh -c \"$vimCmd $output $gvimSearch \"";<br /> print " $cmd3 \n";<br /> system("$cmd3") == 0 or die "system $cmd3 failed: $?" unless ( $dryRun );<br /> }<br /> }<br /><br /><br />__END__<br /><br />=head1 NAME<br /><br />find.pl help<br /><br />=head1 SYNOPSIS<br /><br />find [options]<br /> Options:<br /> -help This help message<br /> -dirs Directory to search*<br /> -output Alternative output filename<br /> -type Find's type (default = "-type f")<br /> -endGrep|eg Additional grep arguments<br /> -fileNames|fn File Name (default = "*")<br /> -arg Additional find Arguments<br /> -endFind|ef Additional find Arguments for the end of find command<br /> -strings Strings grep will use to search*<br /> -grepArg|ga Alternative grep arguments (default = " -n -I -i -C 3 ")<br /> -nots Additional find logic*<br /> -ands Additional find logic*<br /> -prunes Trims directories from search<br /> -displayOnly|do Does not generate a file<br /> -fno Search for the file name only (no grep)<br /> -noVim|nv Do not open output file with vim<br /> -dryRun|dr Run the script but print the commands do not actually run them<br /><br /> Examples:<br /><br /> find.pl stringtofind<br /> find.pl -fn filetofind stringtofind<br /> find.pl -string stringtofind -fa "-maxdepth 1"<br /> find.pl -s stringtofind -fa "-maxdepth 1"<br /> find.pl stringtofind -fa "-maxdepth 1"<br /> find.pl stringtofind -prune directorynottosearch<br /> find.pl stringtofind -not log<br /> find.pl string_with_spaces -replaceWithSpace _<br /><br />=cut<br /></pre></p>stephenmmhttp://www.blogger.com/profile/11320584628764748257noreply@blogger.com0tag:blogger.com,1999:blog-8214932147906650442.post-872216594853514392009-06-05T15:34:00.000-07:002009-06-12T19:57:01.905-07:00Faster editting of linux script filesIf you are like me you want to open your scripts quickly without having to find where they are and then opening it up. Use my little vich.pl script to automatiically find and open the script with one command:<br /><br />##### FILE: vich.pl #####<br /><pre><p style="font: 10pt courier; color: #0000A0;"><br /> #!/usr/local/bin/perl -w<br />use strict;<br />my $whichOutput = qx` which $ARGV[0]; `;<br />$whichOutput =~ s/\s+$//;<br />stat($whichOutput);<br />print "Readable\n" if -r _;<br />print "Writable\n" if -w _;<br />print "Executable\n" if -x _;<br />print "Setuid\n" if -u _;<br />print "Setgid\n" if -g _;<br />print "Sticky\n" if -k _;<br />print "Text\n" if -T _;<br />print "Binary\n" if -B _;<br />if ( ( $whichOutput =~ m/^\// ) && ( -T $whichOutput ) ) {<br /> qx`gvim -geometry 100x50 $whichOutput `;<br />} else {<br /> my $myoutput = "~/tmp/vich.out";<br /> open OUT_FILE, "> $myoutput" or die "cant open $myoutput : $!";<br /> print OUT_FILE $whichOutput;<br /> close OUT_FILE;<br /> qx`gvim -geometry 100x50 $myoutput `;<br />}<br />##########################################<br /># END OF FILE<br />##########################################<br /></pre></p><br /><br />Make an alias:<br />> alias vich vich.pl<br /><br />Now instead of doing:<br /><br />> which myscript<br />/usr/bin/myscript<br />> vim /usr/bin/myscript<br /><br />you can just do:<br /><br />> vich myscript<br /><br />Just a little thing to speed things up..stephenmmhttp://www.blogger.com/profile/11320584628764748257noreply@blogger.com0tag:blogger.com,1999:blog-8214932147906650442.post-64256685814966551912009-06-05T15:10:00.000-07:002009-06-12T19:57:01.905-07:00Make your config files very flexible (w/ Perl eval)I have to make my config files flexible so that I can allow my users a lot of options and even override functions. I can do this by making my config file "eval"-able. Meaning that the config file is actually Perl code that can be interpreted by the calling Perl script. <br /><br />Most of the code was taken from:<br /><br />http://www.usenix.org/publications/perl/perl13.html<br /><br />Here is my proof of concept code:<br /><br />##### FILE: evalConfigExample.pl #####<br /><pre><p style="font: 10pt courier; color: #0000A0;"><br />#!/usr/bin/perl -w<br /># Filename: evalConfigFileExample.pl<br /># This is a proof of concept script to show how one can use a perl script as a config.<br /># file. This allows much more freedom when declaring a configuration file. One can<br /># call functions, redefine functions and generally do anything that you could.<br /># normally do in a regular perl script. Ex:<br />#; ~/bin/evalConfigFileExample.pl -file ~/bin/evalConfigFileExample.cfg<br /><br />use Getopt::Long;<br />use Data::Dumper;<br />use Pod::Usage;<br /><br />my $page_info ;<br />my %opts = ();<br />my $ok = GetOptions(\%opts,<br /> 'file=s',<br /> 'help'<br />);<br />if ( !$ok ) { die; }<br />pod2usage(1) if (exists ( $opts{help} ) );<br /><br />sub printer {<br /> print "In Perl prog\n";<br />}<br /><br />sub hello_world {<br /> print "Calling hello_world from eval'd config file!\n";<br />}<br /><br />sub parse_cfg {<br /> my($file) = @_;<br /> delete($INC{$file});<br /> eval('require("$file")');<br /> die "*** Failed to eval() file $file:\n$@\n" if ($@);<br /> print ("VENDOR = $VENDOR \n");<br />}<br /><br />printer();<br />parse_cfg( $opts{file} );<br />print ("VENDOR = $VENDOR \n");<br />printer();<br /><br />##########################################<br /># END OF FILE<br />##########################################<br /></pre></p><br /><br />##### FILE: evalConfigExample.cfg #####<br /><pre><p style="font: 10pt courier; color: #0000A0;"><br />#evalConfigFileExample.cfg<br />$VENDOR = "Sun";<br />$HARDWARE = "Sparc";<br />$OS = "Solaris";<br />$VERSION = "2.5";<br />$HOSTNAME = `/bin/hostname`;<br />$PSCMD = "/usr/bin/ps -ef";<br />hello_world();<br /><br />sub printer {<br /> print "In required file\n";<br />}<br /><br />##########################################<br /># END OF FILE<br />##########################################<br /></pre></p><br /><br />The output should look like this:<br /><br /><pre><p style="font: 10pt courier;"><br />> evalConfigFileExample.pl -file evalConfigFileExample.cfg<br />In Perl prog<br />Subroutine printer redefined at evalConfigFileExample.cfg line 9.<br />Calling hello_world from eval'd config file!<br />VENDOR = Sun<br />VENDOR = Sun<br />In required file<br /></pre></p>stephenmmhttp://www.blogger.com/profile/11320584628764748257noreply@blogger.com0tag:blogger.com,1999:blog-8214932147906650442.post-55708592625813401692009-02-01T21:41:00.000-08:002009-06-12T19:57:01.905-07:00Check out this picture!<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUBsYHDBQbuxVgnAsaz9DyKW-MXgHZIqYQ_wfyT0lpJn9K3bQRjtS9CZMbVaqR2Tu4wJJ5Qx-cjUKF1aRxbbPjUmp0SLB662VNAFjNyu9YzIBXowyQgp5PVYytyNI-m09tAVbXiv-ImmU/s1600-h/IMG_8012.jpg"><img style="CLEAR: both; FLOAT: left; MARGIN: 0px 10px 10px 0px" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUBsYHDBQbuxVgnAsaz9DyKW-MXgHZIqYQ_wfyT0lpJn9K3bQRjtS9CZMbVaqR2Tu4wJJ5Qx-cjUKF1aRxbbPjUmp0SLB662VNAFjNyu9YzIBXowyQgp5PVYytyNI-m09tAVbXiv-ImmU/s320/IMG_8012.jpg" border="0" /></a><div style='clear:both; text-align:LEFT'><a href='http://picasa.google.com/blogger/' target='ext'><img src='http://photos1.blogger.com/pbp.gif' alt='Posted by Picasa' style='border: 0px none ; padding: 0px; background: transparent none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;' align='middle' border='0' /></a></div>stephenmmhttp://www.blogger.com/profile/11320584628764748257noreply@blogger.com0tag:blogger.com,1999:blog-8214932147906650442.post-72509935511971277432007-10-14T20:46:00.000-07:002009-06-12T19:57:01.905-07:00Vimperator -- vimified browsing (at last)I have found the coolest productivity tool since vim. <a href="http://www.google.com/url?sa=t&ct=res&cd=1&url=http%3A%2F%2Fvimperator.mozdev.org%2F&ei=GOgSR9qDEYTeeoHB9ZIL&usg=AFQjCNFXl4T4towwx_Dry3NA4QMCJCXMfA&sig2=U9NiXVtlnFx9tbdHkuGFmQ">Vimperator!</a> This allows you to do modal browsing much in the same way that vim does. The greatest thing is that it allows you to write maps (keybindings) that can dramatically improve your productivity on the web. What is so great about modal editing and browsing? You don't have to use that pesky mouse as much anymore. Your fingers stay near home row more often and allow you to control almost everything from they keyboard.<br /><br />Here is a <a href="http://www.google.com/url?sa=t&ct=res&cd=2&url=http%3A%2F%2Fwww.linux.com%2Ffeature%2F114419&ei=JOYSR8_CCqjkepSg_J0L&usg=AFQjCNGSL0o8LAxVfGmUK9xJ5AN2SGSOrg&sig2=R6jsjFgjnru9Mv1HLuHt3Q">link </a>from linux.com that has a somewhat decent discussion about it. I am sure there will be many more articles written bout this great tool. Here is the <a href="http://www.google.com/url?sa=t&ct=res&cd=4&url=http%3A%2F%2Fvimperator.cutup.org%2F&ei=GOgSR9qDEYTeeoHB9ZIL&usg=AFQjCNHd2qisp6udTaRVimNLA0sYhIApXg&sig2=LOMzv1DbjUDZWBuBMaabNA">offical wiki</a>.<br /><br /><br />It is only at version 0.52 as of this writing so I am sure there are improvements to come but it already has vastly sped up my surfing. One vim like feature I would like to see is the visual mode for selecting things. Your mappings and customizations (like vimrc file) are stored in a file named vimperator. Here is what my vimperatorrc file looks like so far:<br /><code><br /><br />set activate=quickmark,paste<br />set nobeep<br />set complete=sbfh<br />set defsearch=google<br />set guioptions=<br />set maxhints=1000<br />set preload<br />set previewheight=20<br />set showmode<br />set showstatuslinks<br />set showtabline=2<br />set titlestring=Vimperator Dev<br />set verbose=9<br />set wildmode=list:full<br /><br />" start MozRepl<br />js <<eof if="" in="" components="" net="" mozlab="" 1="" eof="" restart="" vimperator="" map=""><c-r> :restart<cr><br /><br />" select next/previous tab<br />map <right> gt<br />map <left> gT<br />map ,src :source ~/.vimperatorrc<cr><br /><br />" move current tab left/right<br />map <s-right> :tabmove! +1<cr><br />map <s-left> :tabmove! -1<cr><br /><br />" move up and down one page<br />map <c-j> <c-f><br />map <c-k> <c-b><br /><br />" Tab maps<br />map <c-n> :tabopen<cr><br />map <c-l> :tabnext<cr><br />map <c-h> :tabprevious<cr><br /><br />" backward and forward<br />map gk :back<cr><br />map gj :forward<cr><br /><br />map <c-x> :quit<cr><br /><br />echo .vimperatorrc sourced<br /><br />" vim: ft=vimperator sw=2 sts=2<br /><br /></cr></c-x></cr></cr></cr></c-h></cr></c-l></cr></c-n></c-b></c-k></c-f></c-j></cr></s-left></cr></s-right></cr></left></right></cr></c-r></eof></code>stephenmmhttp://www.blogger.com/profile/11320584628764748257noreply@blogger.com0tag:blogger.com,1999:blog-8214932147906650442.post-78858823785948978132006-07-13T09:26:00.000-07:002009-06-12T19:57:01.906-07:00New Job<div xmlns="http://purl.org/atom/ns#"> <p>I gave my resignation to Sigmatel on Monday. I will be doing the same kind of work (pre-silicon verification) but as a contractor/consultant at Analog Devices here in Austin. They are a pretty good company and they are starting to use some of the newer verification methodologies so I will be helping them bring this up. Should be very exciting. The world of verification is getting very exciting!</p> <p> Read more at <a href="http://blog.360.yahoo.com/blog-ak1S0bEib6OOWSb_tz.geaZOci2R1Q--?cq=1&p=14">blog.360.yahoo.com/blog...</a> </p> </div>stephenmmhttp://www.blogger.com/profile/11320584628764748257noreply@blogger.com0tag:blogger.com,1999:blog-8214932147906650442.post-71345855591750763582006-06-23T00:59:00.000-07:002009-06-12T19:57:01.906-07:00CNN.com - Study: Earth 'likely' hottest in 2,000 years - Jun 22, 2006<div xmlns="http://purl.org/atom/ns#"> <p>First to add a comment to this news. I just wanted to test to see how adding a new comment to a page would look. Hopefully this will motivate people to do something about global warming.</p> <p> Read more at <a href="http://www.cnn.com/2006/TECH/science/06/22/global.warming.ap/index.html">www.cnn.com/2006/TECH/s...</a> </p> </div>stephenmmhttp://www.blogger.com/profile/11320584628764748257noreply@blogger.com0tag:blogger.com,1999:blog-8214932147906650442.post-4709201252486962502006-06-23T00:39:00.000-07:002009-06-12T19:57:01.906-07:00Simpy and GoogleAdSense<div xmlns="http://purl.org/atom/ns#"> <p>Simpy adds GoogleAdSense to users pages. This is simpy amazing! There are such incredible synergies happening here with all the Web2.0 stuff. You can now make money off the links that you create. You will not become a millionare from this but it does encourage people to make links and tags more relevant. Keep watching this space for more Web2.0 magic!</p> <p> Read more at <a href="http://www.simpy.com/3p">www.simpy.com/3p</a> </p> </div>stephenmmhttp://www.blogger.com/profile/11320584628764748257noreply@blogger.com1