Friday, January 31, 2014

XML to JSON

Right , so I was going to blog about the fail of a night I had last night. I tried winging the creation of an application, but turns out that it’s really not a smart idea and you become unorganized. Lesson learned!
So instead of informing you about my failures, I’m going to show you my small triumph! Holla! Today work asked me to create a ruby script that fetches RSS feeds from various news sites and create a JSON out of the RSS feeds. Figuring this has a gem out there I googled the situation. All I got in return was a bunch of gems that halfway did what I needed, or made it x10 harder than it needed to be. So I broke it down into individual steps then created the ruby to go along with it.
1.       Get response body from URL *RSSfeed
2.       Change response body from XML to JSON.
3.       Output to JSON file.

require 'net/http'
require 'active_support/all'

s=Net::HTTP.get_response(URI.parse('http://rss.cnn.com/rss/cnn_topstories.rss')).body
response = Hash.from_xml(s).to_json
    file = File.new("feed.JSON", "w")
     file.syswrite(response)
     file.close

That’s all I want , pretty simple and not that complex. Other gems were going to have me build my own template and blah blah blah. Nah , so I looked a bit into activesupport ( used this gem in previous ruby scripts I’ve created) and it helps with the .from_xml . I’ve been searching for a while on how to switch xml to json for the web app I’ve helped create here at work. But dang.. It’s just so short and sweet and it makes me excited. :D

Hope this helps if you need it

-Hannah

Tuesday, January 28, 2014

We are pleased to inform you that you have been accepted at Hogwats School of Witchcraft and Wizardry-

  I have such an inner struggle with this. I grew up with Harry Potter and company, went on the adventures with them , experienced heart break ( I still have problems with the fact JK killed Sirius ) and triumph.

As the days approached my 11th birthday, I started getting nervous and excited for the letter I was sure that I was to receive. My birthday had come and passed and I experienced heart break, much like many other children around the world. But now that I have grown up a bit and actually realized that unfortunately Hogwarts is only a place I can visit in my imagination and Disney World, I got to thinking about the concept of Hogwarts , witchcraft , monsters and magic. To be entirely honest , I have no idea if I could handle it. Let me explain .

Right , so I grew up with the internet.  Literally. The first website was created on the sixth of august in 1991. So the internet is older than me by three weeks.  So there was never a time while I was alive that the internet wasn’t available. By the time I got to elementary school we were learning how to use the world wide web and all of  that jazz. THE POINT , im trying to get to is that I don’t think I would have a clue how the heck to function without technology. My tooth bush is electric for crying out loud!!

Oh , you want to text your friend? No cell phones.

Oh you need to email your family?  Wrong , you’re going to use an owl to communicate.

Although, it would be pretty rad to have the great hall. Such good food and you don’t have to cook.  Honestly, all these kids stating how they want to go to Hogwarts, they’d need therapy after a week. I know I would! 

Monday, January 27, 2014

Do you want to break free from your iOS jail cell?

After seeing all the fancy pictures of what people can do with a jailbroken iPhone gets you thinking " Should I commit to the jailbreak?" "Is it a good idea to jailbreak your phone?". Well here is the low down. By jailbreaking your iPhone, you have the ability to access files that usually would be completely out of reach from you. Your ability to reach these files gives you the opportunity to express your individuality as a iOS user.

Oh , you want a batman symbol instead of your carrier's name? Jailbreak has a tool for that.
Oh, you want different types of icons for your app? Jailbreak has a tool for that.

It can open you up to so many different things that will enhance your iPhone experience. There is a whole community of people that contribute to the tool development for jailbreaking. It's actually honestly pretty cool what you can do with a jailbroken phone.

This question always comes up though... Is jailbreaking legal? 

As of right now , yes , it is legal as long as you don't use it to unlock your phone to different carriers. So , change all the things that you want to change * insert all the things meme* and go crazy. Just stay clear of unlocking different carriers because that's when things become illegal.

Next most common question. Can I brick my phone? 
*To brick - to render unusable making your iPhone become a very expensive paper weight*

I haven't heard of anyone bricking their phone from jailbreaking but I could be wrong. I am pretty sure that you are good to go as long as you back up your phone before you start the transformation. But don't quote me on that because I am not 100% sure.

Overall , it's a great way to express yourself while still having an iPhone. But there are alot of risks that come with it that may not be worth the trouble of actually jailbreaking your phone. So , it is totally up to you!!!

I have been looking into the whole jailbreaking scene ever since seeing this reddit post in r/jailbreak : here

It's just so pretty!! and the add on's are rad. Like the whole flux thing , that's just awesome.

Lemme know if you've jailbroke your phone and if you like it or not.

-Hannah


Friday, January 24, 2014

Technology Diet Status : OVER

Hey guys, sorry it's been so long! I've been ultra-busy, unfortunately not with a new job (they found an internal person). But I honestly just haven't been near a computer other than work. Which is honestly a good idea every once and a while, a technology diet is never a bad thing.

I unplug myself one every couple , when I say couple I mean like 9 months , and I just go out into the real world and do things. I got my hair done , I went hiking , started a new workout regimen with my friend and even started reading a book. *Gasp* It's been decent but I am ready to dive back into the world of technology. I really need to start working on my app. I think I am going to start that tonight before mid-night soccer. 

Also , I am getting ready for a lot of change in my life and having Virgo tendencies it always makes me feel like i am unprepared. Alas, things will work out and change will happen. The latter is inevitable. I will keep you posted on the change that I am going through once everything is confirmed, I am weird and do not wanna jinx it. hehe

I hope everything is well with you! If you stop by let me know and we can talk! 


-Hannah

Monday, January 13, 2014

For-Loop in Objective-C


So , I bought this book yesterday.

And what I plan on doing is once or twice a week blogging about a chapter or two whilst I relearn objective-c.  We basically covered the first* chapter last week with classes , objects and methods. Go us. So let us start on chapter 2.
*First chapter actually about code

----------------------------------------------------------------------------------------------------------------------------

*Recapping the previous chapter*

So last chapter we learned all about Data-types , objects , methods and classes.

Type float
float  floatingVar = 123.21;
Type int
int integerVar = 19;
Type double
double doubleVar = 2.923e+11
Type char
char charVar = ‘h’
Type id
id hannahObject;

*Recap Over*


So this chapter we are going to talk about looping in objective -c

     There are three different types of ways to loop in Objective-c
  • For Loop
  • While Loop
  • Do statement
But We are only covering For loops today.

----------------------------------------------------------------------------------------------------------------------------

Say we wanted to know the sum of all numbers to 150?
    ex. 1+2+3+4......+150

You could individually add all the numbers but that doesn't seem like it would be very efficient. As we are programmers and we are lazy and that's just wayyy tooo much typing.

This is how you would execute the different loops finding the sum of all numbers to 150.

For loop
#import<Fountdation/Foundation.h>

int main ( int argc , char * argv[])
{
  @autoreleasepool{
     int n , sumNumber;
sumNumber = 0;
for (n = 1; n<=150; n = n+1)
sumNumber += n;

NSLog(@”The sum of the numbers is %i” , sumNumber);

   }
return 0;
}
The format of a for loop is

for( init_expression ; loop_condition; loop_expression)
program statements

The three expressions inside of the parentheses are the expressions that control the for loop.

init_expression: used to set up values before the loop begins. (ex. N = 1; )
loop_condition: Used to state the conditions for the loop to execute. (ex. N<= 150;)
loop_expression: This is evaluated after each time the program statements have been executed. (n = n + 1;)

This is a very basic explanation of for loops. For Loops can be very powerful when used correctly. But you must be careful not to fall into the infamous infinite loop. This is when your loop condition is never met and causes the loop to run forever.

Tomorrow I will chat about While loop!

Friday, January 10, 2014

What the Tech : Selfie Olympics

New year , everything is going to be bigger and better right? Bigger ideas , new and better you!

Right well we already have an incredible community of people participating in what is called the "Selfie Olympics". I have NOT the slightest clue on how this started , or why it even started but brace yourself it's about to get wild.

Just a few that made me laugh (See more in my video)  :


Some people are just so much more creative than I am. I can hardly take a regular selfie without looking like grumpy cat let alone do wild things whilst taking a selfie. If this is any indication on how the internet is going to go this year. We are in deep trouble.

55 hours later | Just Hannah

And my hell week is over. I created over 50+ scenarios for my application at work. *war flash backs to finals week during college* Oh my goodness.. tonight I'm going to lay down and watch a movie then go play some soccer Not really anything technical today , just sheer exhaustion and coffee fumes.  A fast paced development cycle is so intense sometimes. But let's be real i'd rather this than slow and boring work,,,

*cheers*


Thursday, January 9, 2014

Cucumber : Advantages and Disadvantages

Cucumber : Advantages and Disadvantages

Cucumber is a testing tool that I have been exposed to since about May 2013. After a solid 7 months of using this on a daily basis I grown to I actually quite like it.

Cucumber is written in a behavior driven development (BDD) and is used with the scripting language Ruby, which is awesome check out my previous blog post.  But you can also use it with different platforms , but I highly suggest ruby.

Moving on.

Let’s talk about the structure of cucumber really quickly.


Here we have a very very basic structure of cucumber. All of these files are required to run your tests. The env.rb is the very first file that is ran when cucumber is executed.  If you have any set up that needs to happen before the initial test is started this is the place to do that. Then you have your feature file and step definitions which are explained further down.


Cucumber is written using the syntax of gherkin. * I see what you did there* Gherkin is a natural language for testing. Natural language, meaning that it’s readable and understandable to those who don’t program.

EX:
Given I go to “www.google.com”
And you search for “Technical Hannah”
When the search is shown
Then I click on Hannahs blog

BOOM. There you go, nothing too difficult. So gherkin is saved in what is called a feature file. These are the files that cucumber looks for when ran. A feature file looks like the following :

@tag
Feature: Teaching Cucumber
                Scenario : Search for Technical Hannah on Google

Given I go to “www.google.com”
And you search for “Technical Hannah”
When the search is shown
Then I click on Hannahs blog

It’s as easy at that. Now you might notice a few new things added here. The “ @tag” the “feature” and the  “scenario”.

Tags are used to call feature files. You can only have one feature per feature file. But you can have many scenarios under one feature.

Not too complicated. You can even put tags over certain scenarios in your feature file if you only want to run that certain scenario.

So if I were to travel to my cucumber file on my computer and run cucumber it would look something like this. (note that when you do this it executes ALL feature files under the feature file folder)

C:\cucumber> cucumber
You can implement step definitions for undefined steps with these snippets:
Given(/^I go to "(.*?)"$/) do |arg1|
  pending # express the regexp above with the code you wish you had
end
And(/^you search for "(.*?)"$/) do |arg1|
  pending # express the regexp above with the code you wish you had
end
When(/^the search is shown$/) do
  pending # express the regexp above with the code you wish you had
end
Then(/^I click on "(.*?)"$/) do |arg1|
  pending # express the regexp above with the code you wish you had
end
 * you add your own ruby scripts here 
Cool , we now have our step definitions that will execute our cucumber file. Notice that when I created the feature file there were quotations around some of the words inside the feature. When the step definitions are created those are seen as variables. This makes it easier to reuse code in your testing system , this is one of my favorite parts about cucumber. If we go back to the feature file we just have to change the variables to anything that we want and the ruby that you've associated with your step definitions should execute correctly.

After you run your tests your test results will show up inside of the command prompt.

Why cucumber is awesome :
1.       Upper level management can read it and it will make sense to them.
2.       Quick and easy set up and execution
3.       Efficient testing

Why Cucumber is not-so-awesome:
1.       I have yet to figure out a way to pass variables between the different lines of gherkin.
2.       Causes the tests to run slower which can be a pain when trying to figure out the execution time of a program.

Overall Cucumber is awesome. It’s a really rad testing tool and I highly suggest you use it if you can. If you need to learn ruby to use it. DO IT!! Ruby is a quick and easy language to learn and it’s fairly powerful when partnered with cucumber.

Happy testing J

Wednesday, January 8, 2014

Just a quick Objective - C Overview

Right , I promised myself that I would keep to my blog schedule I have planned. But I don't think adding more content is a bad thing. So here is my third blog for the day. *sweet baby rays*

So , I have an interview tomorrow and I am going to brush up on my Objective-C and iPhone development. *these posts are going to be really embarrassing if I don't get the job.. yikes oh well*  And when I teach what I am learning it sticks better so buckle up you're about to learn some Objective-C. *confetti falls from celling*






Alright first off, what is Objective-C?

  • Objective-C is most often used whenever you are programing in the iOS or the OS X operating systems. 
  • Objective-C also provides object-oriented capabilities and dynamic runtime
Fancy stuff. So in non technical terms , Objective-C is mostly used in Apple products , and the dynamic run time means that objective-c decides which method implementation to call right before calling it. 

COOL.. movinggggg on...

Let's do some code together shall we? 

To start off we will cover some basic syntax -

A Class- 
 *NOTE CLASS NAMES MUST BE UNIQUE.. like you ;)
So a class is simply called by typing the following :
--> @interface HannahClass : NSObject
--> End

 Righto simple enough. Next step is we are going to document name and twitter handle. These are called properties. They're called like this.

@interface HannahClass : NSObject

@property NSString *name;
@property NSString *handle; 

end

Sweet. So now our app uses the class Hannah and has two string properties within it that holds my name and my twitter handle.
  • please note that we use the asterisk to indicate that they are c-pointers. So basically memory stuff.
The following two lines are for int and num declarations. So we are going to add birth day and birth year.

@property NSNumber *birthDay;
@property int *birthYear;

Right. Noted that int isn't an NS because I fudged that up the first time. *thehe*

How to call a method. SIMPLE.. I got this..

-->  (void)someMethod; 

BOOM. That's how it's done. Yes yes I realize that if you're coding on a mac and using XCode it most likely autocompletes this for you but ya know. WHAT IF YOUR XCODE JUST DIES AND YOU SUDDENLY NEED TO CODE BUT YOU CAN'T USE XCODE. Hmmm that's what I thought.

Much like any other language methods can take parameters. 

-->  (void)someMethod : (someType) value;

Same thing but with more than one param -
--> (void)someMethodWithFirstValue :(SomeType)value1 secondValue:(AnotherType)value2;

cool beans..

I think that's enough review for the moment as I am very tired. BUT.. I wish all of you a happy day! If anyone reads this far haha.


*disclaimer : The source i used for objective-c was here












You're a what?

What if I told you that you could travel , code , build applications , AND GET PAID. Honestly, if you said that sentence to me a week ago I probably would have laughed in your face and said that there is no such thing. BUT ALAS , there is. Developer Evangelist , or Technical Evangelist.

Right. Now before you say " Doesn't an evangelist deal with religion?". Not this time, a tech or dev. evangelist is basically the act of going out and spreading the word of a certain technology. (jeezo that even sounds a bit religious) Spreading the word of technology consists of so much more than just talking to people about it. You tweet about it. You blog about it *hayyyy*. You give presentations on it. You Youtube it. SHOOT! Even sometimes you create it.

Honestly, I thought I was dreaming when I read the job description that said , Travel , speak to people outside your cube , and code. My three all time favorite things wrapped into one. There has to be one catch. So far I haven't found any and I have articles that I have been reading to prep myself for my interview tomorrow ( *fingers crossed*).

The moment I fell in love with this job was when I realized that I still get to do what I love( program , be involved with the tech world) AND be social about it. I have been working a 9-5 job and I never realized how much you don't actually converse with people. I mean don't get me wrong, I talk to my cube mate but that's when I am not coding. But when I get in the zone , lord knows HOW LONG I can code for. So, it's a bit more anti-social. I never realized how much I need human interaction until I sat behind a desk for 10 months.

Anyway , if you're into blogging about your favorite technologies , tweeting , recording , speaking , or even demoing this job is for you. Cause I know it's absolutely the right job for me. Now , it's only a matter of time about acquiring the job.



Young Cyborg to Kick off the World Cup. Wait , What?

As ridiculous as that title sounds , it's true , a young teen might kick off at the world cup this year if all goes to plan.

Being a soccer fan in general I am already stoked about the World Cup. Three games a day for a month is literally a dream come true. But having a paralyzed teen literally kick off the world cup in a pant exoskeleton literally makes me giddy. This pant suit is accompanied with a pretty sweet helmet that helps the brain and the pants get up talk to each other.

I think it even looks a bit futuristic with a backpack , that seems to be the size of a small child , on  the back. Sorta looks like a jetpack.

Either way this is huge because it could help eradicate nearly all wheelchairs. Basically the inability to walk will not be an issue anymore.

Link to original article : Mind-controlled prostheses offer hope for disabled

Monday, January 6, 2014

Ruby : Quite the Gem



Ruby is a scripting language, much like Python. It can be used across all plat forms making it a rather dynamic language.  Ruby is also object oriented so every value is an object. Variables hold references to objects. Every function is a method, and all methods are called on objects.

What I think about Ruby -
In May I got tasked with learning ruby in order to create automated tests. Before ruby we were using strictly selenium and XPath for our automated tests. But we added the element of cucumber to our tests and we drive cucumber with ruby scripts. Learning ruby was quite interesting. This is the first language that I have had to learn quickly in order to get result as soon as possible.

I like how lite and quick straight ruby is, also rather easy to learn too.  I did not have too much problems doing everything that I needed to accomplish. Although I do not like how threading works in Ruby. It is not as efficient as Java obviously, but it just seems unstable at time. This might have been the task I was trying to do , but it just did not work out.


Overall, I think Ruby is a great scripting language and is optimal for automated tests. It is quick and efficient. Ruby is easy to learn and does not have a high learning curve. 

Saturday, January 4, 2014

Classic First Post

Well , Hello!  I guess for the first post I will just let you know a bit about myself. My name is Hannah, and I currently reside in Colorado. I recently , May 2013 , graduated from Colorado State University - Pueblo with a degree in Computer Information Systems with an emphasis in programming. I was also apart of the women's soccer team during my time at CSU-P. I currently work for a company called Intelligent Software Solutions out of Colorado Springs. I am a Software Engineer in Test and I love it! I create automated tests for nearly all the applications that our company engineers.

Some of the languages that I have worked with are :
  1. Ruby
  2. Java
  3. C#
  4. JavaScript 
  5. Objective - C
I plan on learning much more!
I am creating this blog in order to keep myself sane , and give me a electronic place to keep my thoughts because I cannot read my own handwriting on occasion.

If you're feeling adventurous add me on twitter and we can tweet each other !

Hope to chat to you soon!

-Hannah