Unlimited + 50… In math class we were taught to ignore the constant
I was browsing the Internet, or as I like to call it the "InterWeb," and I found an interesting marketing ploy for shared web hosting. A company, which will remain nameless for legal reasons, advertises unlimited shared web hosting for the cheap price of about 6 US dollars per month if you purchase for 10 years in advance. What a deal right? Well, to further this awesome deal they felt the need to add 50 gigabytes of data to the already unlimited gigabytes of storage space that is included in the single package they offer customers. Interesting I thought. Does this kind of marketing strategy work? Who are these companies marketing to who think that their valued customers, and potential customers, do not understand that infinite is the greatest non-specific number attainable in math... And more importantly, why is the 50 GB of extra space the selling point? I laugh... But think it probably works; which is sad.
An unexplained data loss & what’s up
At some point over the past week the hosting company I use had a 'hard drive issue' and unfortunately had to revert all hosting accounts to data from around December 2nd, 2008... Yes, the last back up they had was over 2 months old. Not only is it unsettling that they had such _old_ back ups of their clients software, but I have checked my e-mail history and see no communication from them letting me know that I had lost all of the last two months of progress and data. Upon logging into my client control panel I noticed a 6 month credit for hosting -- does this somehow make it okay for 2 months of work flushed away? No. In fact, I'd rather have those two months of work back. Luckily, I back up the important things every now and then. Still, the urking continues as I see in my e-mail inbox news from the hosting company to do data migrations to new 'more powerful' servers. Let me ask this: Will the power of these servers keep the hard drives from having 'issues'....... Issues are bad m'kay.
If you noticed down time or old content it has now been fixed and I apologize for the potential 'content not found' messages that awaited viewers access attempts.
As of lately, however, I have been doing something pretty neat: teaching a Ruby on Rails workshop on my college campus to students. I wanted to try introducing web framework technology + newly popularized programming languages so naturally Ruby on Rails was a perfect fit. I've now constructed 2 workshops, each lasting roughly 6 hours, and have had extremely high interest and attention spans from students. In the coming week I will be having at least 3 workshops and they take place on weekends. I'll be writing up information about that soon, so if you are interested in learning Ruby on Rails and are local Santa Barbara, CA I encourage you to attend. If you don't even know what Santa Barbara is I still encourage you to learn more by checking out the presentation I will be posting in the following weeks. (Expressing interest in this presentation will speed up how quickly I post it...)
Rcov — measure your test coverage (Ruby on Rails)
Fact: Code can be developed that contains no bugs.
Fiction: That the above happens often.
The act of software development in itself is prone to many errors; typo's, assigning one variable to another without remembering variable types, and more often adding features to existing software and not updating all of the calling code that now does not know it has to pass in a third method parameter.
To combat the unseen errors we can call rake commands to run our unit, functional, and integration tests. But if the tests are not up-to-par, for example they all assert true regardless of any actual testing, then in reality the results are meaningless. So, in essence, to combat poor test coverage, which tries to combat errors in feature development, I decided to give Rcov a try. I took my latest RoR project and built a rake task to run my unit, functional, and integration tests through Rcov. At first I was rather upset when I saw the Rcov results; I was pretty much being told I failed test writing class. On we go...
What is Rcov?
Rcov is a necessary tool if you want to write code that not only works but will also allow for expansion and adaptation (and there are other reasons as well, but that is for you to find out). Technically, it is a tool that measures your code coverage from your tests in a Ruby (and RoR) project. Taken from eigenclass.org, the maker of Rcov, the main points are presented as follows:
* fast execution: 20-300 times faster than previous tools
* multiple analysis modes: standard, bogo-profile, "intentional testing", dependency analysis...
* detection of uncovered code introduced since the last run ("differential code coverage")
* fairly accurate coverage information through code linkage inference using simple heuristics
* cross-referenced XHTML and several kinds of text reports
* support for easy automation with Rake and Rant
* colorblind-friendliness
With that all said, the point of this entry is to not only get other developers using Rcov, but to also share my rake task that I put compiled after reading a few blogs and looking at other Rcov rake task plugins and examples sources. My code was mainly adapted from Alan Johnson ( github plugin project page ).
Mileage may vary. I created a file called rcov.rake in my project/lib/tasks/ folder and its contents:
def run_coverage(files) rm_f "coverage" rm_f "coverage.data" # turn the files we want to run into a string if files.length == 0 puts "No files were specified for testing" return end files = files.join(" ") if PLATFORM =~ /darwin/ exclude = '--exclude "gems/*"' else exclude = '--exclude "rubygems/*"' end rcov = "rcov --rails -Ilib:test --sort coverage --text-report #{exclude} --no-validator-links --aggregate coverage.data" cmd = "#{rcov} #{files}" sh cmd end namespace :test do desc "Measures unit, functional, and integration test coverage" task :coverage do run_coverage Dir["test/**/*.rb"] end namespace :coverage do desc "Runs coverage on unit tests" task :units do run_coverage Dir["test/unit/**/*.rb"] end desc "Runs coverage on functional tests" task :functionals do run_coverage Dir["test/functional/**/*.rb"] end desc "Runs coverage on integration tests" task :integration do run_coverage Dir["test/integration/**/*.rb"] end end end
More information on Rcov is available from the links below:
User Agent inspection: finding the client browser name
Here is a short snippet of Ruby code that I wrote today to detect client browser types. (to override CSS styles based on client browsers..) Hope it helps.
def client_browser_name(user_agent_string) case user_agent_string when /msie 6/i "IE6" when /msie 7/i "IE7" when /msie 8/i "IE8" when /konqueror/i "Konqueror" when /firefox\/2/i "FF2" when /firefox\/3/i "FF3" when /applewebkit/i "Safari" when /gecko/i #generic case where FireFox is not in String (ie. MindField, BonEcho, GranParadiso) "Mozilla" when /opera/i "Opera" else "Unknown" end end
Show/Hide ToolTips with jQuery
An Updated Post Can Be Found Here
As a developer I have faced many problems with tooltips and getting div's to appear, disappear, and jump through hoops. Today I figured out a nice way.
This code below dynamically shows and hides certain div's. Using no onClick event handling. There are 3 pre-reqs,
- you have an outside ID that contains all of your tooltip ID's.
- you assign your tool tip ID's to be uniqueNameToolTip. This will allow the below code to successfully identify and modify each ID independently.
- in your CSS for the aToolTip class you should set "visibility: hidden". This will hide the tool tip by default.
Here is the code below. I have made bold the appended "ToolTip" for each unique ID and the "#Change_Me" which needs to be changed to reflect your code.
<script type="text/javascript"><!--mce:0--></script>
This code should be inserted in to your <head>.
In your body, you will have code that looks like:
<div id="CHANGE_ME"> <table border="0" cellspacing="4" cellpadding="8"> <tbody> <tr> <td style="text-align:right">name</td> <td></td> <td id="uniqueNameToolTip"> <img src="/images/ToolTipName.jpg" alt="" /></td> </tr> </tbody></table> </div>
That's it. Now, when the page loads you will find that when you focus on the text box the tool tip in the right column of the table will appear. I know the formatting is a bit off, bear with me! Question/Comments please post. Note this was developed on an asp.net page, but the concept and functionality (of the javascript) persists on asp, asp.net, php, so forth.
Sapphire 2600xt HD Video Card
My oh my. My new video card arrived last night thanks to UPS. First of all, I have a small shuttle case which is packed with hard drives and other over sized peripherals and was not sure the card would fit. It did and it fit perfectly. This is quite an upgrade from my Sapphire x850XT that I had. The 2600xt is literally a tech savvy movie buffs best friend. It uses on board processing to decode x264, which is the new format high quality files are coming in today, and is simply amazing.
I immediately fitted the card in to my case, booted, and began on VGA connection. I was limited to just a little over 720p resolution so I then decided to try the HDMI support that the 2600xt boasts and I jumped up to 1080 instantly. My desktop looked edgy and blurred here and there, along with being very bright. The video looked flawless and breathtaking. Watching a 720p video in 1080p looked great so I decided to try a 1080p video and let's just say I could see the hairs on the marijuana being sold in the TV show Weeds.
What more is there to say? I did the research and found this particular card to be the best priced and feature packed- I am very happy with it so far. Though, I have only had it about a day now.
Learn more about this card [link]
Post comments/questions.
Designs, designs, and more designs.
Here is a flurry of designs, enjoy!
click here to download .psd
click here to download .psd
click here to download .psd
click here to download .psd
click here to download .psd
(Sorry I don't have a screen shot up right now) Click here to download the .psd file of some white and blue snow themed brown/black themed template.
High Speed Cable Companies monitoring bandwidth?
It has come to my attention, through Slashdot and the many online sources, those bandwidth providers are now looking at the amount of bandwidth used by a customer and then shutting their internet off when a certain invisible limit is reached.
I personally felt this was inevitable and that companies have been doing this for quite some time. It makes sense that companies are starting to announce their hidden agenda’s at this time, because internet bandwidth consumption has risen at such great rates due to video on demand, sites like YouTube, and the fact that the internet is evolving into one large application.
We will see where this goes. Bandwidth is measured at a small level in terms of MB (megabytes) and most commonly measured as GB (gigabytes, which are 1,000 MB). If the average consumer uses 20GB of bandwidth monthly, can you imagine what it will cost for the high tech user who uses 100GB/mo in bandwidth?
Related articles/sources:
- Game Daily - [article]






