Ad

Saturday, January 30, 2016

Codecademy Learn Java tutorial walkthrough 3 Data Type II Boolean

In this tutorial, Codecademy introduces another data type called Boolean, which can only take the value true or false. To the computer, true or false is really 1 or 0. The computer can use 1s and 0s to represent any texts and numbers.

Again, no quotes, no int whole number nor no floats, just true or false.

System.out.println(false);

Codecademy Learn JAVA tutorial walkthrough 2 Data Types I: int

This Codecademy Java tutorial talks about a data type called int, short for integer, any negative or positive whole numbers and also zero. If you want to go deeper : any value between -2,147,483,648 and 2,147,483,648

In this exercise just type any whole number in .println() that is not a decimal number. And don't use any quotes this time. Quotes are for a different data type called strings aka texts in English. 

System.out.println(15);

Codecademy Learn JAVA tutorial walkthrough What's Your Name

Codecademy walkthrough learn JAVA.
You can enter any string as your name to pass this exercise. The key is to surround your name in quotes. For example
System.out.println("your name");

.println() is a very useful Java method.
Codecademy uses it extensively much like console.log for the learning JavaScript path.

Codecademy AngularJS tutorial walk through 4 Filters currency filters




In this exercise, Codecademy asks the student to add a filter to {{product.price}}.

AngularJS filters look like a vertical line which is a special symbol called a pipe and it surely looks like one! After the pipe, we specify currency so that every time AngularJS sees the product.price property say 19, it will automatically add a dollar sign to it making it $19.

This feature is very handy displaying currencies. AngularJS has other cool filters too. 

The concept of filters is like Instagram filters: the underlining data or photo is the same, the filters change the look of the underlining data or photo making things look different. For example, the underlining date is Feb 22, 2015. Using a date filter can display it as 2015/2/22 a format used in Asian countries or it can display it as 2/22/2015 for the US. It's nice that we don't have to change the data or write a function to change the date for each country. We can use the readily available date filter.


Solution 

{{product.price | currency }}

Angular sees the {{}} and be like oh I'd better look at this. These are for me. Then it reads data from the corresponding controller, find a property called product in the $scope of the controller, then find the price property of product. Then it filters the data and turn it into currency format by adding a dollar sign in front of the price.

Learn to code foundations : data type Boolean

learn to code foundations series covers learn to code and computer science basics supporting the #csforall initiative. Boolean is like a coin it can only be two values "head" or "tail" true or false. Remember Boolean is always either true or false. It's quite "extreme".


Boolean is also like a tuxedo cat. Its fur is either black or white.  Again boolean can only be true or false. It is also called bool in Java

In computer speak, true is also 1 and glade is 0. Computers can use a bunch of 0s and 1s to represent numbers and letters, and pretty much everything.

Code School launches new Try Python learn to code course

Code School, online interactive gamified learn-to-code provider, just launched a new Python language course called Try Python and a full Python path in the whimsical theme of Monty Python! Like other Try Ruby Try R courses in its Try series, Try Python is free. The other parts of the path requires monthly subscriptions.

Friday, January 29, 2016

Getting started with AngularJS Single Page Application (SPA) Search Engine Optimization SEO growth hacking tricks

How to utilize one of the most advanced front end frameworks like AngularJS and be able to rank high in Google search engine results? How to rank any Single Page Application (SPA) websites written with templating languages like Mustache and Handlebar.js or front end frameworks like Knockout.js, AngularJS Angular 2, React, Ploymer and or Backbone.js? 



How to create a snapshot for search engine callers
Some developers set up one website for the humans and another for the robots - the search engines. The downside of this workaround is having to maintain two websites. 

Google made efforts to index JavaScript applications but creating snapshots for search engines is still recommended. Other search engines like Bing Baidu and Yahoo only has limited support for SPAs.

Follow search engine guidelines. Render the website for crawlers so that the contents display properly <h1> hello John </h1> not just as <h1> </h1> because crawlers cannot make the correct request to display {{getMyNameFromServer(id)}} for example. Creating snapshots is developers doing work for the crawler.

It's also important to generate a clear site map for the website to help the crawler navigate.

SPA pages made with the likes of AngularJS are snappy and very interactive by nature. There are many entry and exit points and user flows. Developers should work with product owners and product managers to create relevant user flows and experiences when creating the snapshot. 

Automatically recreate or crawl website for search engine optimization
Have you heard about the popularity of PhantomJs? The headless "ghostly" browser? It's perfect for generating snapshot automatically, regularly for sophisticated SPA applications. Use PhantomJs with pretender (prepackaged with Phantom) and store and cache the result in Redis for crawlers to consume.

Route all crawlers by specifying head user agent. 


Get the SEO foundations right

It's still important to still clearly mark SEO metadata like meta description, title, image alt, and meta tags for every page.

React UI, UI UX, Reactstrap React Bootstrap

React UI MATERIAL  Install yarn add @material-ui/icons Reactstrap FORMS. Controlled Forms. Uncontrolled Forms.  Columns, grid