Friday, January 30, 2015

4 Reasons Why You Should Learn Ruby As Your First Programming Language





Learning to code has a steep learning curve. You’ll encounter foreign concepts, technical jargon, and difficult choices. One of the very first choices you’ll have to make is which programming language you should start with.
Programming languages are similar to spoken languages. Each programming language falls into one or more categories. A few categories you might have heard of include imperative, object oriented, functional, or logic-based. Fortunately, once you learn one language it’s much easier to learn a second language in the same category. Unfortunately, that first language is going to be tough to learn.

Ruby is a general purpose programming language created in the 1990s by Yukihiro “Matz” Matsumoto. It’s also one of the best languages to start with when you’re first learning to code.

Ruby is one of the easier languages to learn

I remember when I first started learning to code. It was an introductory Computer Science class and the course curriculum used C++. In the world of programming, everyone’s first computer program is one that displays the message “Hello, world!”. It’s known as the “Hello World Program”.
Here’s what that looks like using C++:
c++ coding exampleIntimidating, isn’t it? To display “Hello, world!” to a computer screen, you’ll have to learn multiple C++ functions and keywords. Here’s the equivalent Ruby source code:
ruby coding exampleMuch simpler than the C++ version!
Ruby is considered a higher level programming language than C++. A high-level language features strong abstractions from computer details. Whereas low-level languages are closer to machine details (like memory addresses or CPU registers), high-level languages are closer to a naturally spoken language.
When you’re first learning to code, a high-level programming language like Ruby is much easier to use.

Learning Ruby is a stepping stone to Ruby on Rails

If you’re currently working within the software industry or startup community, chances are you’ve heard of Ruby on Rails (often shortened to just Rails). Rails is a software framework for creating web applications.
Many students new to programming aren’t sure what the difference is between Ruby and Ruby on Rails. Ruby is a language. Ruby on Rails is a framework that uses and depends on the Ruby programming language. Think of a framework as a collection of pre-written code to help programmers. In this case, the Rails framework is a collection of pre-written code to help programmers make websites and web applications.
Still confused? Think of making a sandwich. You simply add a slice of meat, cheese, and lettuce to two slices of bread. But where did the bread come from? It’s easier to get pre-sliced bread from the grocery store instead of baking our own bread using flour and water. In this case, the Ruby programming language is flour and water. Pre-sliced bread is the Ruby on Rails framework.
Learning Ruby is a prerequisite to learning Ruby on Rails. You’ll be one step closer to creating web applications like Twitter, Yellow Pages, Hulu, or Groupon.

Ruby knowledge is in demand

The TIOBE Programming Community Index lists Ruby as the 13th most popular programming language as of the time of writing this article.1 Although popularity is a good thing, what’s better is demand. Currently, Ruby is experiencing incredible growth in demand2
Demand for Ruby programmers is most likely tied to the Ruby on Rails framework, which launched the programming language into mainstream development in 2004. Employers are building their websites using Ruby on Rails. They need Ruby developers to maintain their code bases.
ruby developer on computer
Ruby developers are a hot commodity now.
Caption if possible: Data center full of servers powering hundreds of websites.
The demand for Ruby also exists outside of Ruby on Rails. Ruby is increasingly becoming common within DevOps roles. Wondering what DevOps is? A website or web application with huge amounts of traffic will usually require hundreds of computers to run on, called servers. DevOps engineers ensures the reliability and efficiency of those servers. DevOps engineers also automate the deployment of servers, so websites can quickly handle large surges of traffic. Ruby is a popular programming language for DevOps frameworks like Puppet and Chef.

Ruby has a huge and useful ecosystem

A programming language’s ecosystem is important for several reasons:
  1. Existing code that you can leverage — Ruby has pre-written frameworks and libraries like Ruby on Rails and Chef. You can use this pre-written code for your own projects. Why spend time reinventing the wheel when someone else has already done it for you? Ruby even has its own system to manage frameworks and libraries, called RubyGems. There are currently over 60,000 libraries to choose from!
  2. Documentation — instructions play a huge role in every developer’s life. As you’re working on your project, you’ll constantly be searching through documentation. First time connecting to a database? The go to starting place is documentation. When you’re coding, there will be a lot of “first times” where you’ll need access to good documentation.
  3. Learning resources — Ruby has a large amount of resources to choose from. There’s plenty of books, screencasts, in-person courses, and even developer bootcamps dedicated to learning Ruby. There are even free tutorials scattered throughout the web, like Why’s Poignant Guide to Ruby.
  4. Community — Stuck on a programming problem or have a question? Find a Ruby mailing list, chat room, or web forum and ask away! The Ruby community is filled with generous developers who enjoy helping out. Be sure to contribute once you’re more experienced. There are even Ruby User Groups, where developers interested in Ruby meet in person to discuss and learn from each other.

How to start learning Ruby

I hope I’ve sold you on why Ruby is an ideal first programming language! As I mentioned, Ruby has an excellent community and extensive amount of learning resources. You can learn from books or online courses, but remember, the best way to learn programming is by getting your hands dirty! As you’re reading books or taking a course, start coding on your own programming projects. You’ll learn best when you’re solving real world problems.

The Importance of Object-Oriented Programming in the Era of Mobile Development

Do you need to know object-oriented programming to create mobile apps? Matt Weisfeld answers that question by examining three questions of his own: What mobile devices are the most prominent in the marketplace today, what programming languages are used to program these devices, and why has object-oriented programming become so important?

As a developer and college professor, I often get asked the following question: “If I want to develop mobile apps, how important is it that I learn object-oriented programming?” My initial response to this query is very straightforward: If you want to program just about anything these days, you’d better learn object-oriented programming.
I have been writing about object-oriented programming (OOP) since the early ‘90s, and the topic of how important it is has been raised in one form or another, well, since the early ‘90s. While the release of the first version of Java in January 1996 significantly increased the interest in OOP, the buzz, in fact, started even earlier than that, with Smalltalk and C++. Regardless of the context, the answer to the question posed above is always the same: Learning object-oriented programming is crucial to all modern software development—including mobile apps.
It can safely be said that the object has been the driving force in the programming industry for a very long time and will continue to be so for the foreseeable future. The evidence to support this statement is pretty compelling! Today, just about every major software development methodology is based on objects. As a result, virtually all programming languages, scripting languages and application designs are object-oriented or object-based.
To back these statements up, all we have to do is take a quick look at the importance that objects play in mobile app development. This includes native apps for phones as well as hybrid apps that can be viewed on any browser (whether it is on a phone, PC, tablet, etc.). While mobile apps are the hot topic today in the software industry, they are just the latest technology in its evolution.
To demonstrate how important object-oriented programming is to mobile app development, let's explore the following questions:
  1. What mobile devices are the most prominent in the marketplace today?
  2. What programming languages are used to program these devices?
  3. Why has object-oriented programming become so important?

What Mobile Devices Are the Most Prominent in the Marketplace Today?

The category of mobile devices is quite broad and can include many products, such as smartphones, tablets, music players, computers, and so on. Since many of the development platforms across manufactures are similar—for example, the development environment for an Android smartphone is similar to that of an Android tablet,—we can focus in on the smartphone category to provide a good representation of mobile devices in general. So let's take a look at the distribution of the smartphone market.
One article from CNET listed the smartphone market share as follows: Apple's iOS at 51.2%, Google's Android at 44.2%, Microsoft's Windows Phone at 2.6% and Other as 2%. A bit more searching revealed that RIM's Blackberry held about 1% of the market, thus adjusting the “Other” category to 1%.
By looking at Figure 1, it is easy to see that about 95% of the market is dominated by two operating system platforms: iOS and Android. The primary difference between the two is that iOS is a propriety technology from a single manufacturer, Apple, while the Android market is a more open system with a variety of manufactures, including HTC, Samsung and Motorola. Despite the fact that the rest of the field represents less than 5% of the market, I wanted to include Windows Phone and BlackBerry in the discussion. Thus, the following four platforms—iOS, Android, Windows and Blackberry—make up approximately 99% of the consumer smartphone market.
Figure 1 Percentage Breakdown of the Smartphone Market
With this information defined, we can now explore what programming languages are used to create phone apps for each of the platforms.

What Programming Languages Are Used to Program These Devices?

This information can be displayed in short order, and does not need a lot of explanation. The list can be seen below.

iOS

Language: Objective-C

Android

Language: Java

Windows Phone

Language: .NET (C#, Visual Basic)

BlackBerry

Language: Java
Source: http://en.wikipedia.org/wiki/Mobile_application_development
Based on this information, we can safely make the following statements with regard to the primary programming languages used for smartphone app development: iPhone apps are developed using Objective-C, Android apps are developed using Java, Windows Phone apps are developed using C# .NET, and BlackBerry apps are developed using Java.  The common thread? All of the languages listed are based on objects! So there really isn't much debate as to how important objects are to the mobile app industry.
It is not often that you can say that a single technology dominates virtually all of a specific market. However, in this case we can easily demonstrate that object-oriented programming is used in virtually all mobile app development.

Why Has Object-oriented Programming Become So Important?

It's all about the network! The rise of object-oriented programming was fueled by the emergence of the Internet as a place of business. While various flavors of object-oriented languages have been around since the 1960s, it is no accident that its widespread adoption coincided with that of the Internet.
If we consider the fact that Java, which was one of the first popular object-oriented languages, was based heavily on C++, the obvious question is why wasn't C++ used instead of Java? The answer is that Java was designed with networks in mind. Originally, in the early 1990s, Java's direct ancestor, Oak,  was created as part of a smart appliances project.
The Oak development team initially attempted to use C++, but there were many features of C++ that presented limitations, including difficulty in networking. The team also wanted a language that was highly portable and included a graphical user interface. After considering extending C++, they decided to create a new language, which was named Oak. Regardless of how successful the Oak programming language might have been, the project was a bit (only a bit) ahead of its time. While the state-of-the-art  in the early 1990s might not yet have been smart appliances and cable TV, something very state-of-the-art  presented itself in the mid 90s: the Internet.
In 1994, Sun decided that the Internet was evolving into something that looked rather similar to the Oak team's vision of what the cable TV industry might someday look like. Oak was renamed Java, and the Java Development Kit (JDK) 1.0 was released on January 23, 1996. The rest, as they say, is history.
Because Java was originally created with many features designed for use on a network, it was a perfect match for the Internet, which was poised to experience explosive growth. Java was strategically positioned to share in this growth, and the stage was set for many other languages to emulate the features that made Java successful. Oh, and there was one other pretty important (and interesting) thing about Java — it was fully object-oriented.
The fact that Java was able to ride the wave of the Internet was partially due to the fact that HTML only presented static content to web pages. One of the cool new features that Java provided was a feature called applets. Applets provided dynamic functionality such as animation, capturing input, and a variety of controls (buttons, check boxes, etc). Java also provided a library for the creation of user interfaces (AWT) that would render on multiple platforms, which was, at the time, virtually unheard of.
Interestingly enough,  the importance of Applets eventually faded as newer technologies within Java emerged (and AWT was superseded by Swing).  Thus, some of the features of Java that led to its initial acceptance were somewhat quickly abandoned. However, the object-oriented nature of Java, as well as its networking capabilities, laid the foundation for the future of programming languages that fueled the Internet and, eventually,  mobile devices.
Today, virtually all of the programming , scripting languages and frameworks used to create mobile applications rely on object technology: Java, C# .NET, Visual Basic .NET, Objective-C, Ruby, JavaScript, jQuery, jQuery Mobile, etc.
Finally, perhaps the most interesting back-story in this discussion is the fact that, as often happens, the technology has come full circle. Remember that the emergence of object technology began in the early 90s with Oak and its vision of smart appliances. Also remember that this vision was well ahead of its time.  So consider this: years ago the Internet was the hot development topic, and today mobile apps are the hot development topic. Perhaps tomorrow's hot topic may well be the concept of “The Internet of Things,” which is being promoted by companies such as GE and Microsoft. “The Internet of Things” refers to uniquely identifiable objects. Thus, the next generation of object development may be the realm of smart cars and smart homes, which contain smart appliances. Sound familiar?

Conclusion

The four major mobile device platforms — iPhone, Android, Windows and BlackBerry — use Java, .NET and Objective-C, which are all based on objects.
These four platforms make up 99% of the smartphone market, and thus an overwhelming part of the mobile marketplace. If for nothing else but dramatic effect, Figure 2 answers the question of how important object-oriented languages are to mobile development. As you can see, virtually all of the mobile app development platforms are object-oriented.
Figure 2 Breakdown of Languages Used in Mobile Development

Five Easy Tools to Build a Website

No matter how modest your launch, your business will need a web presence. Maybe you've been putting it off. After all, we weren't all put on earth to write code on the web--and hiring someone who was is expensive. Luckily, you don't have to know a thing about programming to build a respectable website these days. There are loads of affordable--even free--tools that do the grunt work for you.
You'll need a sense of what you want your website to do for your business. As long as you have a germ of an idea, the best do-it-yourself services will guide you along. You'll also find plenty of options for syncing your website with other online tools like Facebook pages, Twitter profiles, YouTube channels and PayPal accounts. It's surprisingly easy to get a simple but powerful website up and running in a few hours.
Here are our top five picks for launching your business on the web without skimping on quality.

1. Yola

Yola
What it does: Yola lets you build a basic website by picking a template and filling out a few simple forms. Once you have a rough outline, you fine-tune your site with an in-place editing tool. Yola has the goods to let you really dig into the web. You can integrate your site with an impressive list of third-party services such as Google Maps and PayPal, Flickr for photo sharing and Picnik for photo editing.
What it costs: The basic web-building tool and a Yola.com address are free. For extra features, better-looking templates and the ability to use your own domain name, the Yola Silver upgrade is $100 per year.
Bottom line: If you're looking for a basic, professional site at a reasonable cost, Yola's your answer.

2. jimdo

jimdo
What it does: Jimdo's free version does what a respectable website builder should do, and not much else. We suggest springing for the upgrades (which are reasonably priced) to unlock some cool business features, such as custom newsletters to keep in touch with your customers, page-view stats, PayPal stores and password-protected employees-only pages.
What it costs: Basic features and a Jimdo.com address are free. Jimdo Pro is $5 per month. Jimdo Business is $15 per month, including unlimited data storage and online selling, two domain names and business-specific site designs.
Bottom line: The free tool isn't worth your time. But what Jimdo does well is hold your hand with nice templates and good overall tools. If you want to sink a little more effort into a site that looks and feels unique, Jimdo is your best bet.

3. WIX

WIX
What it does: Wix lets you build a great-looking website in no time with its easy-to-use, what-you-see-is-what-you-get editor. Here's the downside: The web development tool is based on Adobe Flash, which works on most PCs but isn't supported by some mobile devices, including the all-powerful Apple iPad. If that isn't a problem for you, Wix has lots of elegant templates that are easy to customize and can fit every business need. Wix's image-heavy sites are especially great for photo galleries, which really show clients what your business can do. A new mobile tool lets you build a simple, smartphone-optimized site to reach on-the-go clients.
What it costs: The full-featured website-building tool and Wix.com address are free. Paid subscriptions, which let you do things like remove ads and link a site to your own domain name, run $5 to $16 per month.
Bottom line: If you must have that slick, designed look and don't mind alienating a couple of potential users, Wix is the answer. Just be sure you understand the limits of Flash, as it can be surprisingly tricky to work with.

4. Intuit Websites

Intuit Websites
What it does: Starting a business takes creativity, but maybe you're not the artistic type. Luckily, even the most design-challenged among us can squeeze a respectable-looking website out of Intuit's somewhat bland but reliable web-editing tool. A quick survey helps you pick a template that's based on what your business does and your goals for the website. The template sorter goes into more detail than many website builders that make you wade through thousands of templates. From there you can tinker with the look and layout, but with some quick text and picture entries you'll be well on your way to a reasonable web presence.
What it costs: The starter package is free for 30 days, then $5 per month. Business and Professional packages are $24 and $50 per month, respectively, and include features like custom domain names, online selling tools and search engine optimization. Insider's note: Intuit has several resale agreements with large telecom companies like Verizon, so don't be afraid to dig around to find a package discount.
Bottom line: This is by no means the slickest tool, but for a basic business site, Intuit isn't bad, and it's especially effective for QuickBooks users.

5. Google Sites

Google Sites
What it does: This service can give you a simple Google web presence for free. But you probably don't need that when there are better, faster and easier options from the likes of Facebook, Twitter and LinkedIn. What Google Sites does best happens outside the public eye. With this tool you can create private, team-based websites within your business--which turns that Google Apps account of yours into a powerful business organization tool. Google Sites puts nifty collaboration tools like announcements, documents and task lists in one online location, allowing you and your colleagues to access them from anywhere. It's a great way to bring some sanity to the startup chaos.
What it costs: It's free.
Bottom line: Don't use this tool to develop a traditional website unless you have a solid coding background or are hiring a coder who does. For the average user, Google Sites is best for creating a company intranet.

Wednesday, January 28, 2015

How to Build a Robot at Home

Do you want to learn how to build your own robot? This is easy and quite cheap to do! The tutorial below will instruct you on how to build a BeetleBot, which moves very similarly to a Roomba. This is a great introductory robotics project for almost any age or experience level.

Steps

  1. Build a Robot at Home Step 1.jpg
    1
    Fit the heat-shrink tubing to the wheel on the original motor. Cut a piece of the tubing just a little longer than each wheel, fit it onto the wheel and shrink it using a lighter or the soldering iron. You may wish to put a few layers in increasing diameters to really build up the “tires”.
    Ad
  2. Build a Robot at Home Step 2 Version 2.jpg
    2
    Glue the switches to the backside of the battery holder. Glue the switches to the back end of the battery holder on the flat side. This should be the end which the wires come out of. Place them at an angle in the corners, such that the contacts farthest from where the lever-looking metal bar goes into the device are touching at the center line of the device.
    • The levers, which are the switches themselves, should be at the outside, near the wires.
  3. Build a Robot at Home Step 3.jpg
    3
    Place the metal strip. Place the 1”x3” strip of aluminum just behind the switches, center it, and then bend the excess down at a 45° angle. Glue it in place with hot glue. Let it set completely before moving on.
  4. Build a Robot at Home Step 4.jpg
    4
    Attach the motors to the metal wings. Using hot glue, attach the motors to the bent down sections of metal such that the “tires” are touching the ground. You will want to pay attention to the charge markings on the motors, as the tires will need to go in opposite directions. Make sure that one motor is placed “upside down,” as compared to the other.
  5. Build a Robot at Home Step 5.jpg
    5
    Form the back wheel. You will need a back wheel so that the robot doesn’t drag. Take a large paperclip and form it into the outline of a TARDIS or a house, with a medium-sized round bead at the peak. Place it at the opposite end from the protruding wires and hot glue the ends of the clip to the sides of the battery holder.
  6. Build a Robot at Home Step 6.jpg
    6
    Solder the robot. You will need to use a soldering iron and solder to connect all of the electrical wires between the components of the robot. This must be done carefully in order to ensure that it works. There are several connections you will have to make:
    • First, solder the connection of the two switches.
    • Next, solder a small wire between the two center connections on the switches.
    • Solder two wires, one from the negative motor and one from the positive motor, to the final connection on the switch.
    • Solder a longer wire between the remaining connections on the motors (connecting the motors to each other).
    • Solder a longer wire between one of the back connections between the motor and the back section of the battery holder where the positive and negative charges meet.
    • Take the positive wire from the battery holder and solder it to the center, touching connections on the switches.
    • The negative wire from the battery holder will go to the center connection on one of the switches.
  7. Build a Robot at Home Step 7.jpg
    7
    Create the feelers for the robot. Cut the rubber/plastic ends off of the spade connectors, open up two paper clips (until they form a shape like a bug’s feelers), and attach the spade connectors to the feelers with more heat-shrink tubing.
  8. Build a Robot at Home Step 8.jpg
    8
    Attach the feelers to the switches and the servo motor. Attach the feelers to the switches using the spade connectors and glue (if you need it, they should clip or slip on just fine) then connect the servo motor directly to the center back of the battery holder.
  9. Build a Robot at Home Step 9.jpg
    9
    Turn it on by putting in batteries. (If you want to you can program a remote from a remote controlled car and turn it on that way). The robot should move in much the same way a roomba does. It just won’t clean your floor. Unless your that good. Congratulations! You've made your robot. Make sure to teach your little guy the Three Laws of Robotics.

Apple's iOS 7 is secure against hackers, but not law enforcement

Forensic scientist and author Jonathan Zdziarski has some mixed news for privacy advocates. Apple’s iOS 7 is “reasonably secure” from attack from a malicious hacker.
However, through the use of backdoor security mechanisms, Cupertino has “worked hard to ensure that it can access data on end-user devices on behalf of law enforcement,” according to Zdziarski.com (via MacRumors).
According to Zdziarski:
I am not suggesting some grand conspiracy; there are, however, some services running in iOS that shouldn’t be there, that were intentionally added by Apple as part of the firmware, and that bypass backup encryption while copying more of your personal data than ever should come off the phone for the average consumer. I think at the very least, this warrants an explanation and disclosure to the some 600 million customers out there running iOS devices. At the same time, this is NOT a zero day and NOT some widespread security emergency. My paranoia level is tweaked, but not going crazy. My hope is that Apple will correct the problem. Nothing less, nothing more. I want these services off my phone. They don’t belong there.
Zdziarski says that it is possible to limit access to these backdoor services — at least to block third-party forensic software. His solution will not protect the device contents if it is sent to Apple for analysis.
To do so, users should enable a complex passcode in iOS and use the enterprise Apple Configurator application to set Mobile Device Management (MDM) restrictions and enable Pair locking, which will delete all pairing records.
Last month, the United States Supreme Court ruled 9-0 that police need a warrant to search cell phones. Therefore, I don’t have a problem with Apple making it easier for law enforcement officials to check user devices — once they get a warrant to do so.

YouTube defaults to HTML5 on the web


If you've been hoping for YouTube to drop the notoriously buggy Flash video format as its default player, well, good news. Nearly five years after the streaming giant started supporting the HTML5 standard for its videos, it's finally now its player of choice. That means from now on, YouTube will use the HTML5 <video> format by default in most modern browsers -- that includes Chrome, IE 11, Safari 8 and beta versions of Firefox. Why the wait? Well, YouTube says in a blog post that it was waiting for HTML5 to mature and improve -- it was still fairly experimental back then. Now, however, the standard is widely adopted and has plenty going for it, like the support for live broadcasts and a more immersive fullscreen view. Seeing as HTML5 is not just in browsers but smart TVs and other streaming boxes too, this news has been a long time coming. Which makes us wonder how long Flash has left before it's gone altogether.

Samsung's Gear VR headset arrives at Best Buy (but not at retail)




 
If you've been curious enough about virtual reality to buy Samsung's Gear VR headset, you've had to visit either AT&T's website or Samsung's to pick one up. Not very convenient, is it? Your VR shopping just got a little bit easier, though, as Best Buy has started carrying the $200 wearable in its online store. Yes, you can order Samsung's immersive display (provided you have a Galaxy Note 4, of course) at the same time as you're looking for a discounted TV. Unfortunately, this availability doesn't extend to Best Buy's retail shops -- you'll still have to buy this experimental headgear sight unseen.