This blog no longer exists.
You will be redirected to something cool.

Thursday, December 29, 2011

DDoS Attack on Ruby Hash algo in v 1.8.7-p352 and older

Denial of service attack on the hash algorithm in Ruby. Scary stuff!
I've never used 1.8 as I started learning Ruby with 1.9.1 (and later)

The folks over at Ruby recommend to do either of the following,

A: Scramble the string hash function
or
B: Upgrade to Ruby ruby 1.8.7-p357 or higher (1.9 is awesome, though, imo.)

Do you use any of the affected versions of Ruby?

JewelryBox, The Official RVM GUI

I came across the RVM GUI today (it's called JewelryBox.) I'm trying this out after having some difficulty installing RVM on my Mac. I got JewelryBox to install, but it's taking forever to get Ruby 1.9.3 downloaded, so I'm still in that phase (the 'net is slow tonight.)

Does anyone have any experience using JewelryBox? If so, do you like it? Why or why not?

Edit: I ended up giving up on JewelryBox as it was never able to download Ruby. If anyone is able to get this working, let me know what you did. This seems like an awesome project, but unfortunately, it didn't work out for me.

Wednesday, December 28, 2011

Ugh, New IP Address

I was just looking over my traffic stats for the past few days and I noticed that my IP address had changed. That's a bit of a pain because I exclude my own IP (and thus my own traffic views) across my own websites and blogs.

Since I manage ~10 sites in Google Analytics and ~5 in StatCounter (CodeGurl stats are managed by both GA and SC), it'll take a good deal of configuration. Luckily, with StatCounter, I can update the IP to block across all sites in my account. Google Analytics is more work because not only to I have to update each domain, but the way they have the IP blocking set up (each segment of the IP in its own box), it's just... meh.

Friday, December 2, 2011

Interview is Out!

My interview on HubPages came out!

I totally cheated an took a peek at the newsletter before receiving it in my inbox by checking on HubPages' newsletter page. (Kind of like how my mom opened her Christmas gifts on December 1st.)

Anyway, you can check out my interview here.

Saturday, October 29, 2011

Get the Daily Rubyist

When playing around with the twitter aggregator, Paper.li, I came up with an idea to collect tweets about the ruby programming language. With Paper.li, you can enter hash tags and twitter searches to put together a nice source of information for an online paper. The Daily Rubyist, which is the paper I created, uses the following hash tags:
#ruby (filtering out mentions of jewelery)
#rails (as long as it mentions the word ruby)
#git (as long as it mentions the words ruby or rails)

Given the current articles popping up on 'The Daily Rubyist', can anyone think of any hash tags or twitter search terms that would be a great source of information? Maybe you know of some popular libraries that get tweeted about -- or whatever you can really think of! Specific Twitter users can be added to the feed, so if you know of someone that posts some great Ruby-related tweets.

I want to add that I do not profit, monetarily, from the paper. It's really just a great way for me to really see what's new in the Ruby community. If anything, it helps those who write the articles that show up. This is because backlinks that appear on a Paper.li paper are do-follow. :P

So yeah, if you're interested, go ahead and subscribe to the paper and let me know some ways I can tweak it to perfection.

Friday, October 28, 2011

PragProWriMo: The NaNoWriMo for Tech Writers

If you're familiar with NaNoWriMo (National Novel Writers Month)  but not really into writing fiction, PragProWriMo might be right up your alley. Like NaNoWriMo, PragProWriMo is a month-long book writing event taking place each November (PragProWriMo 2011 marks the third year of this event.) However, instead of writing a novel, PragProWriMo participants are invited to write a book on a computing/tech topic.

NaNoWriMo challenges participants to write an entire novel (of at least 50,000 words) cover-to-cover from scratch in a 30 day period. Writing a book on computing requires a lot of elbow grease, so fortunately participants are only required to write 60 pages of their tech book (and then continue writing later.) This way, by the end of November, participants know whether or not they have it in them to complete an entire book.

If you haven't already guessed, PragProWriMo was created by The Pragmatic Bookshelf. During the month of November, writers can get writing advice, see progress reports of other writers, and just ask questions about PragProWriMo on the PragProg forums.

Don't forget to follow @PragProWriMo on Twitter for the latest updates!

Thursday, October 27, 2011

Ruby DocTest with Victor Goff of RubyLearning

I did a Google+ hangout/interview with +Victor Goff who taught me how to use Ruby DocTest. It reminded me of RSpec, but the key difference is that Ruby DocTest is used with IRB returns. Nifty, right?

Of course, I had to install a new gem. You can install it by running:
gem install rubydoctest

Victor created a file, hello.rb which contains code in a comment block. By running the following command, we ran an IRB session in the code comments:
rubydoctest hello.rb
This is what we created:

The => line is the 'expectation, or the assertion, or the 'should be' line as it would be for RSpec.

I learned that upon the creation of a new test that causes other tests to fail, it's best to ignore the older tests and work on the new feature until it passes.

On a side note, unrelated to Ruby DocTest, I also learned how to use a default param in Ruby. I had already known what it was, but this was the first time I got to see it in action. :P

Why would I choose Ruby DocTest over RSpec?
When teaching new programmers, and new programmers to Ruby, they are going to use IRB to do their testing anyway. Why have the RSpec/minitest/test-unit framework overhead to learning? You can IMMEDIATELY get them thinking about how their methods return things, and testing, and measuring... with 0 additional overhead in learning. Also, it shows them that documentation and examples in their own programs is easy to do, and it doesn't get 'stale' when it is executable. They learn that they can safely refactor under test.


The advantage to having documentation would be that you can use rdoc to document your methods (and it is testable) and it also serves as example usage for those using your documentation.


In Real Life... Ruby DocTest for what I use it for is small snippets and portions of programs that I may not understand the domain well enough to actually write tests first. The IRB session right there let's me get feedback from my program... (And I don't necessarily have to open up an IRB session).

Victor Goff writes for RubyLearning.org where programmers can take courses to further their Ruby (and general programming) education. I met Victor on Google+ and while I've not participated in his RubyLearning courses, they appear to be very interesting and educational. (Definitely worth checking out.)

Tuesday, October 18, 2011

Blogger Trick: Resize Ads Using an 'If' in Markup

I wanted to put ads on CodeGurl, but was having a problem with it looking tasteful, while still being effective. A 200 x 200 pixel ad unit (embedded at the top right of each post) is more effective in terms of CTR than a 125 x 125 pixel unit. The 200 x 200 pixel ad unit looks great in an individual blog post. However, when on the homepage, if a post has an image, the image will appear at the top left of the post. Because of this, it makes the blog look like garbage.

To fix this, I had to make some changes to my template. I wanted to make it so that when a user is on the homepage, the ad unit at the top right of each post is 125 x 125 pixels, but when they are viewing an individual post, the ad unit is 200 x 200.

To fix this, I changed the code to this:

This really seems to work out really well. I have a few slight things to work out on the images, such as some slight padding so that a post's text doesn't smush right up against the ad unit. I am too lazy to make the change right now.

Hopefully I don't encounter any problems with this change. I might have to check out past blog posts to see how it looks, especially ones where I've placed an image (in-post) at the top right.

I've added a 200 x 200 pixel image and a 125 x 125 pixel image to this post so that you can see the difference in size of the ads. :)

Thursday, October 13, 2011

I was interviewed by ExtraSmall.Me - Check it out!

So, I wrote this article on being thin, for which I won something called an accolade on HubPages. Shortly thereafter, I was contacted by a blogger/reporter who wanted to do an interview for her new blog. So, after a large amount of procrastination I agreed to an interview, so you can read "What it's REALLY like to be naturally thin: interview" which is the end product of said interview.

One thing I would like to add is that I agree with what I said to the question:
What would you tell young naturally thin girls struggling with their self esteem?

However, I said it out of appropriateness. What I really wanted to say was essentially what I should have done in high school: If someone is mean to you, tell them to go f*ck themselves.
Hell, I could have used some advice like that, but eh, c'est la vie.

Just wanted to clarify that question a bit. :P

Sunday, September 25, 2011

Plugging Along; Hashes Next

Well, I finally completed the homework for the chapter on subroutines. I got help from a programmer friend who was able to decode Perl for me based on his knowledge of other programming languages. The context thing was sort of strange to him, but he understood what was going on enough to be able to be a big help to me.

I was able to complete the homework. Aside from the Internet constantly going out, it wasn't as bad as I thought it would be. I made some mistakes in syntax, but the idea I had was in the right direction, so that wasn't so bad. The quiz questions at the end of the chapter were easy as pie, which, to me, means I probably got them totally wrong (that's how things work for me.)

The next chapter is on hashes which will be interesting. Hopefully that's fairly straightforward. We'll see, we'll see.

Wednesday, September 21, 2011

No, I Don't (Context in Subroutines)

Okay, so I was introduced with subroutines which seemed all fine and dandy. I was actually excited to finally be exposed to subroutines. However, it seriously baffles my mind. The subroutines... cake. Context with subroutines? I want to pull my hair out.

I read the chapter last night and it's the first time in the course where I didn't understand anything that was happening. I read on to see if I could piece it together, but alas I am at a wall. A brick one. Hopefully I'll get it after I muck through it again.

In other news, I went through my articles on HubPages and I either need to actually try to rank for the keywords which I've written articles around OR write more articles. I really don't feel like going around and grabbing up backlinks. That said, none of the articles on my list are anything I really feel like writing about. I'll have to find a way to raise the bar on my motivation when it comes to writing.

Monday, September 19, 2011

I Think I Got It (Context)

Well, I hit the books, so to speak, and completed that scary homework assignment on context in Perl. At first I made a bit of a mistake, but I mucked through it and I think I've got it. My program works according to what the assignment wanted, hopefully I wrote it in a way that works in the way the assignment intended.

I have a few short essays in the chapter to complete, but then I get to move on to creating my first subroutines in Perl. Finally!

Things will be winding down with Perl after the next few chapters and then the course with be over. I'll (probably) have the Python course next. I'll take that road when I get to it (or however that idiom goes.)

Saturday, September 17, 2011

Wrapping My Head Around Scalar & List Context

I've been working on learning the various nuances of scalar and list context in Perl. It seems straightforward, but I am worried I'm not getting things 100%. There is a lot of scary talk basically saying if I don't learn it, bad things will happen. This sort of leads me to believe that this might either be difficult stuff or easy to overlook.

In fact, one example which was an array in scalar context output something I didn't expect. I expected the script to spit out the array in a string, but rather it gave me 6, which is the number of elements in the array. I'm pretty sure I know why, but I'll just have to do the homework to see if I'm really grasping this concept.

Wednesday, September 7, 2011

Yarrrr! Drop Yer Perls

I don't know what the title of this is supposed to mean. Perhaps it's strange because it's 10 'til my bedtime!

Anyway, I have thusly decided to move on with the cert in which I am enrolled, thus I will be learning Python next and not continuing with Perl. There are a few reasons for this.

I would like to learn Python and the other languages in the cert I'm in.

Okay so that's one reason.

Friday, September 2, 2011

Looping in Perl

I just got done with a chapter (and homework) on writing loops in Perl. Surprisingly, it was significantly easier than any other chapter I'd done yet. Perhaps this is due to the amount of time (a ton) learning loops when I first started learning programming (Ruby.)

I also learned about postincrements and preincrements which were (and still kind of are) a difficult concept for me. Eh, I may suck at it now, but I'll get better as I shove along. I also learned about some flow control concepts like last, redo, and next. I only really covered 'last' in my coursework but as I move ahead I'll better understand flow control.

So here is some sample code (in Ruby) that is strikingly similar to some code a friend wrote for me in order to pound the concept of loops into my head years ago. So on to the code:

i = 0

while i < 12
  puts i.to_s
  i = i + 1
end 


And here's how I learned to write this in Perl:
#!/usr/bin/perl
use strict;
use warnings;

my $i = 0;

while ( $i <= 12 )
{
  print $i, "\n";
  $i = $i + 1;
} 

Wednesday, August 31, 2011

Move Ahead in Perl or Try Something New?

I'm just about halfway done with my Perl course and it feels really good. I'm not sure if I'm going to go on to a more difficult Perl course or to go on to another language.

There two sides to this coin. If I go on to the cert for open source programming, this course is it for Perl. I would then move on to an intro course for Python, a course on the Unix file system (which would be fun), an intro course on PHP, and the finish off with a database programming course (which I think would be a blast.)

If I stay with Perl and move on to more advanced Perl-y things, I think I would learn more about computer science, in general, but it would be more focused on one particular language versus "Survey of Computer Science" so to speak.

Tonight's section was difficult for me, but I got everything down. My big problem was that, while my code worked, it was generating warnings.

My code was as follows:
if ($var eq undef)
{
  do a thing
}
else
{
  do something
}

To fix it, I did the following:
if ($var)
{
  do something
}
else
{
  do a thing
}

Chip learning some
Ruby with me
I don't think the solution I came up with was in the chapter I'd just read, but it was marked correct. I am trying to solve problems with the information they present versus going off on my own and using "outside" information to solve things.

It's been really hard because I've been wanting to write methods, loops, etc, pretty much since I started out in the course, but haven't gotten there yet. I'm trying to keep it relevant to exactly what is taught so I don't get ahead of myself and learn bad habits.

I am going to go hog wild on some Ruby stuff, though. I read a little more of Well-Grounded Rubyist, but had to stop as I wanted to try something out that I was learning... and I'm have a big problem getting Ruby installed. (I recently formatted.)

Tuesday, August 30, 2011

Perl index()

I was playing with index() in Perl today, which was a lot of fun. I started off with something similar to this code, which prints out the following:

Here is a list of my programming books
1 The Well-Grounded Rubyist
2 Pragmatic Thinking & Learning
3 Programming Ruby 1.9
4 Learning Perl

I learned how to use index() in the course I'm taking. In this example, I am using index() to print out ONLY Ruby books (and their ranking). I am aware that it's very redundant code (I'll change that later.)

Index() determines the position of a character in a string. If the string doesn't contain the character, index() will return -1.

Some interesting stuff I'm learning.

Beginning Programming: Why Learn Ruby

If you're new to programming, Ruby is a great programming language to start off with. The Ruby community has composed many guides, videos, blogs, books, etc in order to teach this programming language to those who are new to computer science. Most of these guides teach the fundamentals of computer science while showing how to program in Ruby. Another great reason to choose Ruby is because the language's syntax is much easier to read and understand than other programming languages.

Friday, August 26, 2011

Perl Heredoc & Conditionals

I just finished learning more about heredocs in Perl in my Perl programming course. After getting set up on Ubuntu, I decided to get comfortable programming in Linux again (it's a super pain in Windows.)

Here I am playing around with a few new concepts and some things (like variables/scalars) which I'm definitely comfortable and used to using. This tiny program I wrote is extremely redundant (I could write this thing to be teeny-tiny in Ruby, but I'm not at that point in Perl.) However, writing this helped me think in a more Perl-y way.

I'm using scalars, a heredoc, if statements/conditionals, and the split() function. I did this in order to write out a list of programming books in different languages and then retrieve the data with split() in order to list how many of each type of book I have. I then used an if statement to print out 'book' or 'books' based on the quantity. Quite redundant, but it works and I'll learn to make it smaller as I progress in the course.

Go ahead and check out my horrid, little program. (Yes, I know it needs a loop. I'll add it in a later update, in a later blog post :P)

Monday, August 22, 2011

Perl Heredoc

I'm learning about something called a heredoc in Perl. It's an interesting concept that I've not come across so far in Ruby (although a friend tells me that this does exist in Ruby.)

Essentially it's for multi-line strings -- and they make code a quad-billion times easier to read. Don't quote me on the quad-billion thing... I'm not sure how many ease-of-reading units there are in Perl code without a heredoc nor how many there are with a heredoc.

It'll take a bit to get used to using a heredoc, especially the empty line thing -- what's that about? Well, I'll learn it!

Tomorrow I'm going to finish the lesson on the here document thing and then read up on using a heredoc in Ruby because that will be interesting. I shall post what I find.

Sunday, August 21, 2011

Adding, Concatenation, Ruby, & Perl

I've noticed some similarities between Ruby and Perl, but have noticed some really strange differences. One of these is this:

0.1 + 0.1
0.1 + "0.1"
"0.1" + "0.1"

In Ruby, the answers would be as follows:
0.2
Error: String can't be coerced into Float (TypeError)

0.10.1

In Perl:
0.2
0.2
0.2

I'll have to do some digging to see why it happens like this in Perl, but it's really strange to me, perhaps because I learned it, well, the Ruby way.

Friday, August 19, 2011

Perl (Learning a New Language)

Welp, I'm taking a Perl course. So no Ruby for a while -- okay, so that's a lie. I <3 Ruby so I'll definitely be programming in it for fun. I'm learning a new language, I'll be strapped for time  to play around in Ruby, but I'll make it happen

I learned that Perl can be considered to be a procedural language, function, and object-oriented programming language. However, the class focuses on procedural programming with Perl. This will be a lot of fun! I'm definitely excited.

I've already written that basic "Hello World" program and have done a bit of coursework although I'm jumping ahead of myself since nothing will really start until next week. I also learned about pragmas which sent me on one of those Wikipedia black holes of information searchin'. I did enjoy reading about directives and their usages in various programming languages including Ada, Haskell, and C. Good times, good times.

Wish me the best of luck! Any cool programs that I write in Perl will definitely be posted here, so keep an eye out! 

Thursday, August 18, 2011

Word Length Checker

This tool checks for word length, but instead of pasting text into a box, it's more complicated than that. Here's the problem I was having and why I created this tool:

One of my niche sites has several hundred posts of varying length. Since Panda it hasn't been doing so well, and a huge part of this is the length of each post. The only posts that are doing well are the longer ones. So I wanted to find each of the offending "short" posts and expand on the topic of each. There are several hundred posts, so it's something that will take quite a bit of time doing manually, thus this tool was born.

While there is a better way to do this than by pulling the blog's RSS feed (the feed only hold x amount of information) I decided that this would be the quickest way to get the program up and running. The program is written in Ruby and uses nokogiri & open-uri so that it can retrieve and parse not only the feed, but each post on the feed. It then takes each post and counts up the words. The end result is a list of articles (and their content) which does not pass a minimum word length (which is essentially just a list of blog posts I need to lengthen.)

It's a work in progress, thus the gist over the formal repo, but head on over to the project to check it out!

Monday, August 15, 2011

Ruby SERP Checker Repo

Recently, Google made a large number of changes to their SERPs, so I have decided to abandon my SERP checker project (RankyPanky) that I was writing in Ruby. As Google has been rolling out update after update (We're on Panda 2.6 now, right?,) it's getting increasingly difficult to parse Google SERPs.

Constructocat by jsncostello
I removed the Repo from Github. However, if you want to see the code and fix it, mangle it, etc... you can! I left the code in a Gist for ya'. Head on over to the RankyPanky SERP checker Gist and have at it!

The code is half complete, and, I apologize, a mess. I was trying to implement a number of features shortly before I stopped writing. To make things simpler in creating a Gist, I removed the RSpec tests. If you need/want the spec, just send me a line and I'll hand it over.

While this project is at an end, I did make use of what I learned of nokogiri in my latest project, which I will share soon!

Wednesday, August 10, 2011

C Programming Exercises



This article has been moved.
You will be redirected shortly. Alternatively, you can access it directly by going to:
C Programming Exercises





Wednesday, July 27, 2011

Keyword List Maker

I created ListMaker while I was doing some keyword research. I wanted to check the global monthly searches for something in each US State. Let's say the keyword was "travel destinations." I wanted to check for each:

"Travel destinations in Alabama"
"Alabama travel destinations"

"Travel destinations in Alaska"
"Alaska travel destinations"

And so on and so forth for each US State. Unfortunately there are fifty states and that requires a lot of data entry, so I wrote code that asks:

"What is your keyword?"

"Would you like your keyword to go before (b) or after(a) your state?"

The code will then map each state to "travel destinations" and print the keyword list to a new file. I decided to have the program name the file after the keyword, instead of just some static name, in case I want to map states to multiple keywords.

You can download Keyword List Maker. Or just check out the code.

Thursday, July 14, 2011

MBTI Program - Getting Started

I am starting on the MBTI (Myers Briggs Type Indicator) quiz program that I decided to write. I chose to write this program because I wanted to learn how to write a quiz.

One of the most interesting elements I want to include in this is the ability to hide which answer equals which type. This is to prevent against scraping. I first came across this concept when I was hand-scraping a quiz to see which answers equaled which personality type. One website programmatically writes the IDs for each question and leaves absolutely no information in the other parts of the mark-up that lets users know which answer equals which type.

Tonight I worked on getting the HTML and CSS written for this program. It's extremely plain right now, but I did at least create a minimalistic header for it using an image I found in Google search (very very bad girl) and PhotoShopped (err The GIMPed??) it with a Free For Commercial Use font I found.



















If you are curious about how the markup looks at this point, it is below. I want to remind you, however, that it is very minimal at this point. Click on the image to make it larger.

Tuesday, July 12, 2011

NoDoFollow

NoDoFollow is an amazing tool for Firefox users.
Here's how it works:
Red links are nofollow
Blue links are dofollow (these are GREAT for SEO)

All you you have to do to enable or disable NoDoFollow is to right click and select (or deselect NoDoFollow.) You don't even have to restart FireFox!

If you would like to see the tool in action, check out the image below (taken from this very blog post!

You can download the NoDoFollow Firefox Plug-in free.

Sunday, July 10, 2011

Machine Up & Running + Received Ruby Books

My computer is up and running. I had a number of problems with it including the big one with the whole virus thing. I kept trying to format it, but the format failed each time. On a hunch, I opened it up and saw that both hard drives were set to master (they were put in by someone else shortly after my last format). Instead of setting one to slave, I just pulled it out and then I was able to format.

I've got everything up and running now and the machine runs beautifully. I still need to install software and pull files from my latest backup (which was a while back) but everything seems to be in order.

I guess it's a lesson... or rather two lessons:
Don't let other people mess with my computer
Back everything up regularly. (err more regularly.)

Big news, I also got all the Ruby books I'd ordered. I'm totally stoked about that... more on that topic down the road.

Wednesday, July 6, 2011

Haxxored

It'll be a while before I can post anything useful as I have to fix my computer. :( I suppose I deserve it, since I let someone touch my precious computer.

+-++-++-++-++-++-+
|H||a||c||k||e||d|
+-++-++-++-++-++-+

Yep, my favorite machine, (the one named LoL) got superAIDs. I'm pretty sure I got it during the format when Windows 2008 was put on it. From what I've read, what I've comes specially packaged with a lot of bootleg operating systems or fake OS validator thingies. Not that I've ever bootlegged anything before. Yarr!

Despite the light jokes strewn throughout this post, I'm actually really frustrated. But alas, this time I'll DIY... err DIM?

Not a happy camper.

Friday, July 1, 2011

Google Bounce Rate on Wedding Blog Fixed

I fixed the page reloading problem I was having on my wedding website. I've been having the problem since February and now I'm finally seeing really traffic stats on the site instead of a bounce rate at around 0%. After the fix I'd proposed in an earlier post, I had to wait a few hours for Google to report my latest traffic and now that the numbers are in, I'm glad to say that the problem is gone.

Refreshing Problem on Website

One of my websites (not this one) has some sort of unidentified bug that is causing it to load and then reload part of the site before completing the load.

This normally wouldn't be a problem, but it's causing some reporting errors with Google Analytics. In particular, it's showing a bounce rate of 0.68%. The bounce rate was about 80% before February 20, so the problem (probably) started then.

And, of course, it's causing the site to load more slowly, as a whole, possibly costing the site its readership.

I went through the template and made some changes, removing some redundancies (there were a LOT of them) and I also removed Blogger's "share this around the internet" stuff, since I have a third party script that does the same thing. Since un-checking the box didn't remove it, I removed the offending code from the xml file.

I also removed and reinserted the GA code in the case that it had been put in wonky -- it'll be several hours before I am able to look at the logs and tell if my bounce rate is going up to a more realistic (sadly) number.

However, I can say that now the site is loading much faster. I also cut down the number of blog posts on the front page from four to two; moved my 'about', 'contact', and 'privacy' pages from blog posts to actual pages (as when the site was created, Google didn't have "pages" on Blogger.)

I also changed the ads from being little squares in the post, to small banners between the title and the post. While this area doesn't convert quite as much as in the corner where they were, it looks a ton better.

In the past, I'd put some text in the sidebar to help the ads become more "relevant" to the topics of the blog, but those two mini-articles to the footer and wrote a third on the footer. It sounds like it would look horrible, but it looks really spiffy.. I'm quite proud of it as the third article I added seems to help prevent the ads from being kind of off-the-wall and more relevant than with just the two articles. Also, it looks a lot nicer overall.

So loads fast + looks better + ads are more relevant... let's see how this converts.

Wednesday, June 29, 2011

Going Yahoo! American

After like ten or so years (wow, probably more than that), I have decided that it's time to get a Yahoo! account in the US. I have, for the longest time, had a email@yahoo.co.uk address and it's getting to where there are restrictions on things I can do on the site given that I want to use American services, yet are forced to use UK ones.

It was a good run with my old email address on Yahoo! but it's barely usable as I cannot use the US version of the site and I've also been banned from using various services (I have no idea why, I emailed Yahoo about it and no response.)

With an American email address I get a fresh start and I also get to use the services I know and love (but haven't really gotten to use.)

Goodbye, old persona.

On a side note, I will only be using the services (as you have to be logged in to do some fun things), I will not be using the search engine. ---- I openly protest as it's now owned by Microsoft. Which is ironic because Yahoo was like the last of the "old" Internet... to me at least. Keep it classy, MS.

Crap, I just realized that I have the same initials as MicroSoft.


Signed,
-MS

Formatted to Ubuntu

My sister has given my parents this old laptop and they don't use it. Since MY laptop is now impractical to use, I decided to go ahead and format the older laptop and go ahead and use it.
Debian was my first choice as Ubuntu is using this whole Unity thing which I do not particularly care for. Since I didn't have a Debian disk and also that it was four in the morning, I decided to just go with Ubuntu for now (to just get rid of the pestilence that is Windows Vista.)

I would also like to add that I have recently updated the goodies section to reflect the addition of MongoDB and Mongoid to my repetoire.

Tuesday, June 28, 2011

Yay! I ordered some Ruby books!

I am so happy! I finally ordered some Ruby books! I got two books, both of which YOU can purchase in the CodeGirl Store.

I got The Well-Grounded Rubyist and Programming Ruby (Pickaxe.) They both are 1.9 books. I am so excited for them to get here. That's all the programming news I have, but at least today you have TWO blog posts to read instead of just one.


Sunday, June 26, 2011

Teh Codefront

I heart programming, for real. For rill rill.. I haven't been able to program in a while as I have been busy with some article writing (boring) and an upcoming family reunion. To top it off, I  am working toward opening my own company (8-bit-ftw.) Makes me supah' bizzy'.

If you're bored because I haven't yet released my super awesome SERP checking code or just generally bored, check out my latest article, "How to Install Ubuntu on VirtualBox" or see the huge update I made to "39 Places to Get Backlinks".

Sunday, June 19, 2011

VirtualBox and Ruby

I just published my 100th hub on HubPages, "How to Install VirtualBox." The hub just talks about how to install it. I have one in the works that shows how to install Ubuntu on Virtual Box.

As for programming, I've been up to a lot of random stuff lately. I've been trying to put together a program that does the MBTI quiz. While I've already completed this piece of software months ago, it was given my skill set back then. I want to redo it using what I have at my disposal now.

Tuesday, May 10, 2011

RSpec is really, really awesome

Tonight I found out that RSpec is coding zen. For real! It was the first time I'd written my specs BEFORE the code (like you're sposed' to) and it just made my job a LOT easier. Here's what happened:

I wrote the specs:
describe "#make_urls" do
  it "should replace /s with a +" do
    make_urls(["oranges apples"]).should == ["oranges+apples"]
  end
end

While I was writing the code, I'd accidentally used a method for string on an array. Upon testing the code, I couldn't, for the life of me, figure it out. Back in the day when I didn't use RSpec (last week) I'd be shutting down and restarting the Sinatra do-hicky and going back and forth to 192.168.1.more_ip:4567/get_page. However, with RSpec, I was able to tell right away that my code wasn't working. Magic! I'm sold on it.

I accidentally did this:
def make_urls(arr)
  arr.gsub(" ", "+")
end

Instead of this:
def make_urls(arr)
  arr.each do |e|
    e.gsub!(" ", "+")
  end
end

Friday, May 6, 2011

Breaking Ruby code up into methods

I wanted to try out RSpec so that I could more easily test my Ruby code, but had to break it up into methods. Going from this code to something nice and easy to test with RSpec was very difficult for me as I still have problems writing methods. After receiving help on StackOverflow on how to set up the methods, I was able to fill in the blank spots. While I'm not really "on my own" with writing methods, this was definitely a good exercise in getting me where I want to be with that.

In the same night, I was able to figure out how to use RSpec with the nice, clean Ruby code and to get my project up on GitHub. I still will have challenges ahead in writing methods as well as writing my specs BEFORE writing my Ruby code. Git also will throw a few curveballs at me as I continue to learn to use it. While difficult for me to really understand right now, RSpec is already helpful and Git is a godsend.

Here is the code after breaking it up into methods. Later I will show all of what I completed in a post about RSpec.

Sunday, May 1, 2011

Trying out RSpec for SERP checker

In my latest project, I am rewriting a PHP script that checks the SERPs of a website in various search engines. In the original PHP script there were several lines of code that weren't needed. There also are problems with how the script "pulls" links from Google... it's not really a problem, per se, but a strange way to go about it.

In adapting this code to Ruby, I decided to start out by just having it check Google SERPs, so the original PHP script has been edited in order to make my job of rewriting the script in Ruby a lot easier.

I intend, from this point, to use RSpec to better test and develop the script as I'm already finding a number of bugs that are making the development process a headache. I find that if I write tests, I can check whether or not the code is working without opening my browser and entering different examples that could break the code. Doing it manually is not only time-consuming, but it also makes it difficult to remember what conditions I've tested and which I haven't.

In this script, the user may enter several keywords and their website url in order to check where their website places in the SERPs for each keyword. At this point, I am working to make a clean list/array of keywords... removing any extraneous commas, spaces, newlines, and returns. A sample "clean" array would look like the following:

array = ['code gurl', 'RSpec', 'tennis', 'Sinatra',
  'Flying Spaghetti Monster']

In hand-testing (without RSpec) the code, I've come up with some problems/specs to keep in mind:

Cannot separate list by a space as the user is not required to use a space to denote a new keyword. Note: If a user enters multiple words on a single line without comma separation, they will be counted as a single keyword to account for longtail keywords. I think that covers everything.

The tests aren't written, but I do think that currently, the code would pass. However, if I had the tests written, I would haven't to wonder/worry if any changes to the code would break something. Currently in order to check that, I would have to manually enter the keywords (as pictured above) for each case and visually check out the results to see if it passes all cases. With testing it would just say "Hey, you passed this one, this one, and failed this one." Handy!

View the code here
Stay updated and follow the SERP checker project here