Monday, September 30, 2013

Stanford Course - Build a Calculator with iOS5

I went thru the Stanford iOS5 code walk thru to build the calculator.  The lecture notes can be found here.

A Few tidbits on the new stuff i learned:

Convert a double to a string - here on the brain object , send title of button pressed to performOperation method which returns a double.  On the NSString method StringWithFormat method, we convert it to a string value
double result = [self.brain performOperation:sender.currentTitle];
NSString *val = [NSString stringWithFormat:@"%g", result];
How to write a getter/setter for a property (in this case an array which get initialized prior to use)
- (NSMutableArray *) operandStack {
     if (_operandStack == nil) {
        _operandStack = [[NSMutableArray alloc] init];
     return _operandStack;
- (void) setOperandStack: (NSMutableArray *) operandStack {
                 _operandStack = operandStack ;

Adding wrapped double in a object to an array:
NSNumber *number = [NSNumber numberWithDouble:operand];
[self.operandStack addObject:number];
 Referencing and then removing object in an array:
NSNumber *number = [self.operandStack lastObject];
if (number)    [self.operandStack removeLastObject]
 Append to current Output String the digit value pressed:
    NSString *newDisplayText = [calculatorOutputText stringByAppendingString:buttonText] ;

Btw, I found this web site cs193p that chronicles the entire course [calculator post]. Another site.  Lastly,  on the apple iOS site  portal or Dev Center, noticed they have section on configuring web applications and things like CSS

One more thing. In the file system on your mac, there is the developer directory. This folder contains about xcode pdf file, a documentation directory, and even a code samples directory.
Related Links:
Objective C Primer
Working with Objective C
NSMutableArray Reference 
NSString Reference

Thursday, September 26, 2013

Don't get iOS 7 yet..

link :
Given all these bugs and issues, combined with some genuine major advances, it’s hard not to interpret this as a beta release that was rushed into production for the release of the iPhone 5S. In a way, it reminds us of the Android 3 release — which was rushed into production for the Motorola Xoom tablet — with severe bugs and performance deficiencies. We’re eagerly awaiting the release of the first update for iOS 7 when we hope Apple delivers on its usual commitment to quality.
I have experienced alot of my applications not working. For example, GMail keeps crashing on iPad and MyFitnessPal on iPhone also crashes when attempting to enter text.

Monday, September 23, 2013

PhoneGap, jQuery Mobile, and Usergrid Learning session from Apigee

Tim Anglade demo on Mobile development from Apigee:

IOS7 Safari

I am not sure how they came up with the share icon with the new release of iOS7 Safari. The stick figures are going to take a long time getting used to. This article goes into extensive detail on the new browser.

Before the IPhone I never really paid much attention to the Mac culture but the products are great. I guess if you look closely enough you can find faults or stuff you don't like.

This big overhaul in this release of the GUI is pretty dramatic in the amount of changes.  I have found that they stick with their designs and only change when there are flaws.

Sunday, September 22, 2013

Sencha Touch Lab

Sencha Touch with Yelp using architect tool[Insert Yelp Key here]&term=hotels&location=Raleigh NC

Restaurants Store URL:[Insert Yelp Key here]&term=eat&location=Raleigh NC

Shops Store URL:[Insert Yelp Key here]&term=shops&location=Raleigh NC

Data distance

Data Distance
Spedy  http2
Distance between. Hard drive and user
Cache headers
Ehcache couchbase app caching
Web server caching nginx
Database caching external memcached memory
Trace route tool tracert

Windows 8 Native Html

Windows Native applications

7.4% windows 8 market share

Kevin Ashley card games on windows 8

html,css, js

renders trident By Brian Hitney

API Mash on GitHub

8 or 8.1

vs studio express free

windows runtime - winRT

winjs - windows library for javacript #winjs

Saturday, September 21, 2013

Practical HTML5 with Ray Camden from Adobe

Practical HTML5


New types , tricks, validation Number, range,date, color, search, Tel,email,URL

 jquery uILabel date picker replacement Netscape not supporting
Formaction tag on button

 Details tag Del and ins tag Tag

apply forms called output based on computation works with form oninput Input type range

 Client side validation Local storage Simple API either simple strings, json

 Up to 2.49 Meg's localstorage.getItem, set item, remove item clear Session storage across tabs window.localstorage

Don't use cookies

 Index db API for client side storage,

high performance searches Built in nosql database Loosely goosey

Xhr2.  Spec

Cors call other servers  - real way

From post with file now with binary data with xhr2

Download tag in a tag

Page visibility API

Document query selector

data attributes

Link Blast

Conference sessions

Angular Git Hub

angular session

Raymond Camden

FigLeaf Tutorial

stands for Syntactically Awesome StyleSheets. It is a tool that allows you to write CSS more easily . It is an extension of CSS3 which means whatever CSS file is a valid SassyCSS (SCSS). It allows you to use variables, nested rules, mixins, inline imports, interpolation, arguments, manipulating colors and more with a fully CSS-compatible syntax. Sass generates well formatted CSS and it is much easier to organize and maintain your stylesheets.

Mobile shootout with Jason Michael Perry from FigLeaf

Mobile shootout

Consulting with NC AOC

Works with alot of frameworks. He likes iOS

Co Author of Free Teach Yourself Sencha in a day. Also wrote a book on ExtJS

Such a new industry with Objective C and mobile.

For alot of applications, building something that works on all platforms will do the job

Built a reference app - Friends with Beer

Built it with 3 platforms

layout, Theming, Data Interobibility,Media Handling

1) jQuery Mobile (DOM easy rampup), 2) Sencha, 3) appcelerator titanium (converts js to native)

jQuery Mobile - html markup

jQuery mobile falls apart doesn't do a lot, low level data calls like in jQuery

need to bring stuff in to do stuff such as library like backbone, mainly does UI piece

template engine doesnt exist have to use Moustache templates

Good things is alot of IDE support

Tooling: Aptana, Dreamweaver, Codiqa (awesome web based tool ), Theme Roller from jQuery Mobile site.

Very repetitive with markup such as footer and headers

Put js at end of page makes it faster.

Strengths: know DOM , suppports all devices, great way to get started
Weaknesses: doesn't scale well, no built in MVC, performance worst, needs 3rd party plugins ( i.e. maps is a plugin jquery ui maps plugin), styling not as easy. No compiling engine.
Best for small projects or multi page apps.

Best practice is each pieces views  and break them up but here its one file.

dom attribute TEL to make a phone call.

Sencha Touch

- whats makes it awesome  is tools like Sencha Architect 3(WYSIWG, shows code generated) to build pages

do everything in javascript , no dom

declarative structure

works with model structure and stores (collection of models)
json p call

3party support sucky

Sencha cmd3 - takes app and minfies it

SASS - syntactically awesome stylesheets

Can create overrides in architect to custom components

sencha eclipse plugin

senchas command - stub a project generate code - ant compile tool

Sencha Architect pricing - insane functionality

Better than jquery mobile performance

Well suited for large projects Fig leaf tutorials

 Built own thing but moving phone gap

 Packaged web view that is not native

Open source release code everyone with license

App accelerator 

Eclipse based App accelerator

Bought Aptana for IDE titanium studio

Native Closed source Mvc

 Support android

 Cloud based tools Alloy XML structure Data handling uses backbone

Lunch learning

I spoke with few people at lunch and the discussion was on mobile. The talk was that clients usually are going for either an android app or an iOS app. In cases where both is needed that Phonegap is  good choice. As, its hard finding staffing resources to write the app twice unless you have deep pockets. That is even with apps that have more than a single page. This can be done by cleaning up the DOM. The hybrid approach where you can flavor part of your app as native and have let say the controller piece using javascript. That way you don't have to go through the approval process with each code change. Something like App Cache can be used for the brains of the app on the javscript side. The gentleman I spoke with will be writing an article in Smashing magazine about this.  Also, got into a talk about Windows 8, and there was concern that the name has a bad reputation in the market place, even though many are not familiar with the issues. Seemed like re-branding of product is needed.  As some people, like there old windows experience. As well, spoke about how the html5 app such as facebook and the fast book implementation. There was mention of how the DOM was storing out so many things that you would expect it to be cleaned out. No wonder it didn't work good. A good scrolling list library is infinite.js The Moustache template was referenced also.

Introduction to Phonegap with Raymond Camden Part 2

Suggests Chrome dev tools .

Ripple Emulator was best in past . Broken now. In repair mode.

"If you are doing mobile and they don't buy the hardware - Quit!"

desktop tools:

ios remote debugging with iOS simulator -

Android chrome not part of device now. Has its own stock browser

Phonegap Build

new folder, put index.html in it

put github url  or zip file upload it

building for 6 different platforms.

can install it from the website

Single page application phonegap is best for. Doesn't work so well for multi page apps. - looks like bootstrap

Pebble l- looks like a watch

Using_the_application_cache - compares whet you have to the server

Introduction to Phonegap with Raymond Camden

 Intro Phone Gap

Raymond works for Adobe after mainly being a server side developer. Client side the past few years.

open source name is Cordova - currently they are the same code

shell around a web view , enhances html "adding cowbell" .

Mozilla has spec for working with batteries. PG tries to follow the specifications.

His focus is android and iOS

write once and modify in every other platform. Not write once and use everywhere.

Can write 95% of application.

Globalization broken in 3.0 - data number formatting, fixed in 3.1

Storage - web sql for storing on client - local storage product for small sets of data.
w3c worked with spec websql (dead)  - but not for mobile , new thing is indexdb, but not used on mobile much

Can use javascript libraries with - cant talk to js on different server - new cors library for this,

no UI in phone gap -let others do this

Demo app : UnTappd  - built on web standards - good example of phonegap

Can use command line for generating code folders for iOS and Droid

Brackets is open source editor that he uses.

PhoneGap build - dont worry about sdk builds and does it for you , free tier and for pay tier

new install process makes use of Node, you dont need to know it to use it, node product manager NPN

He suggests Node but don't need to know it to use phone gap. He is not big command line person.

command line is:

phonegap help cerate
phonegap help remote build

phonegap create MyLittleKittenIsEpic


phone local run local ios
phonegap run local android

in www is an index.html, didnt use eclipse

phonegap 3 has changed things, camera tweak, app slimmer, will support nothing, need feature, tell me u want to use it, must use command line to add to baseline. i.e. add camera api

phonegap local plugin add X
where x is location of plugin i.e. url

docs mentions cordova command line, difft than phonegap one, phonegap one better

hello world convert into binary

he uses zepto a toned down implementation version ofjquery

he likes geolocation  library

navaigator.geolocation.getCurrentPosition(function (geo) {...

don't have to be js ninja with phonegap

Friday, September 20, 2013

NCDevCon 2013

Th NC Dev Con 2013 conference has some nice offerings in the mobile and web  development space.

The main ones that will be of importance to me are The Sencha Touch hands on workshop (Sunday 9 am), and the Mobile Development Shootout (Saturday 1:30pm).

As it looks now, I'd like to start of Saturday with the Phonegap hands on with Dean Peters:
this presentation will take you through some of the tips, tricks and traps in using technologies such as Twitter Boostrap, iScroll, Zepto.js and Eclipse to get the most out of your responsively designed HTML5 solution.
Although, I am tempted to see the Angular session.

I mentioned above about going to Mobile Shootout, but after that I am torn on what to take. Probably, will go to the Design across multiple devices and platforms .

For the last session of the day, definately has to be Bootstrap  with Steve Keator.

Like i mentioned above, Sunday starts off with the Sencha hands on.

Native Html5 Apps follows. Unfortunately, I'll miss Javascript Bad Parts

Ending with Responsive Websites - Do I Need It? How Do I Built It? , and Mobile Security.

Thursday, September 19, 2013

Styling that Page

The CSS file is where we are tasked with finding the tag we must change to make the view look like we want it.

Dr. Patrick Young CSS lecture notes (pdf, 30 pages)
Lean  css-positioning - interactive html css site   a class with a lot useful material and references
Intro CSS
the 30 css selectors you must memorize/
CSS parody
css attractive website
mozilla css Getting Started
The format of a selector is as follows

   Selector {property : value}

Type selector – targets selector by element name, can have comma and wild card *

Contextual Selectors – apply style to properties based on context or relation to another element

Descendant selector: descendants of another element, list separated by space starting with the higher level element, can have commas separating multiple entries, and can be specified several levels deep

Child selector: like a descendant but specified by a specific parent of an element, indicated as child with greater than sign between elements >

Adjacent selector: elements that comes directly after a certain element with same parent, indicated with plus sign

Class and Id selectors - specified in regard to specific elements which are a class or a specific ids specified by user.

  • For class you define it in terms of class in regards to a specific type selector with a dot separator. 
  • To specify class selector to all elements within a class you can leave out the type selector 
  • id selector target a single element and work like class selector except indicated with a #
Attribute selectors – targets specific attribute names or values

  • Simple attribute: specified for an attribute for an element, indicated as element[attribute] 
  • Exact attribute value : specified as element[attribute="myvalue"] 
  • Partial attribute value: doesnt match whole word but search value within attribute value , specified as element[attribute~="myvalue"] 
  • hyphen separated value : used for case where you look for value of ‘myvalue’ or starting with ‘myvalue-’ , indicated with |= 

Pseudeoclass selector : targets a group of elements such as an anchor. has a colon : after the anchor followed with the attribute kind (i.e. link, or name)

 there are others supported other than the anchor tag . i.e. :first-chld, :first-line, :first-letter,:before, :after

How you reference style sheets:

<link rel=style sheet href=file.css type=text/CSS />
@import url();

Document structure and inheritance
- parent child relationships
- sibling relationships
- descendants
- Inheritance : styles passed down to descendants

Overriding styles by nodes higher in hierarchy Can get presentation rules from several sources and conflicts

Passed down until overridden by command with more weight Resolve rules from competing style sheets

When user agent (ie browser) encounters element looks for all style rules that may apply Sorts out this out based on Style sheet origin

Least weight to greatest
1 User agent style sheet
2 reader style sheet
3 authorsyle sheets
4 !Important marked

External file sheets further down document greater precedence

Imported styles sheets override linked ones Embedded styles sheets override external ones Inline styles override other references

Selector More specific the selector the more priority it gets

Least to most priority for selectors follow

Individual element to pseudo element selector

Contextual selectors Class selectors Id selectors rule order Last one wins Display roles

Block level elements – line breaks before and after it and fills in width of the parent that contains it


Inline – no line breaks
Emphasized text
None – Wont display
 List-item Run-in

Box model :

4 Background
3 Margin
2 Border
1 Padding
0 Element box around it

padding vs margin
a) padding - outer edge
b) margin - space between items

TRBL (Top Right Bottom Left)
-  margin: 2px 1px 3px 4px (top, right, bottom, left)

display inline vs block - display of block means multiple items can  NOT be displayed beside it (goes below), whereas inline means multiple items on same line (goes beside it)

Inner edge
Outer edge

 Unit measures
    Pixel Pts Pc Em Ex In Mm Cm

 Color value
   % values

Tuesday, September 17, 2013

The Javascript Prototype

The definition of a Prototype

All objects in JavaScript inherit from at least one other object. The object being inherited from is known as the prototype, and the inherited properties can be found in the prototype object of the constructor.
The post Understanding Prototype says
JavaScript objects also have one additional attribute: a pointer to another object. We call this pointer the object’s prototype. If you try to look up a key on an object and it is not found, JavaScript will look for it in the prototype.
plain english guide to javascript prototypes :
Prototype chains (aka prototype inheritance) Every object in Javascript has a prototype. When a messages reaches an object, JavaScript will attempt to find a property in that object first, if it cannot find it then the message will be sent to the object’s prototype and so on. This works just like single parent inheritance in a class based language.

The Prototype chain - more
Each object has an internal property called prototype, which links to another object. The prototype object has a prototype object of its own, and so on – this is referred to as the prototype chain. If you follow an object’s prototype chain, you will eventually reach the core Object prototype whose prototype is null, signalling the end of the chain.

A use case of the prototype.

Monday, September 16, 2013

Javascript Object types

The different type of objects in javascript:

 "Native objects are those objects supplied by JavaScript. Examples of these are String, Number, Array, Image, Date, Math, etc."

 "Host objects are objects that are supplied to JavaScript by the browser environment. Examples of these are window, document, forms, etc."

 "And, user-defined objects are those that are defined by you, the programmer."

From ECMA -
native object object in an ECMAScript implementation whose semantics are fully defined by this specification rather than by the host environment.

host object object supplied by the host environment to complete the execution environment of ECMAScript.

Should we extend native objects?

Here is the list of all important JavaScript Native Objects:

Sunday, September 15, 2013

Angular First Steps

Go to web site and download

Dev Guide :

Tutorial :

User Group mtg - "First know that Single-page apps are apps. They're not webpages. So we need to think like a server-side developer in addition to thinking like a client-side developer. We have to think about how to divide our app into individual, extensible, testable components"

Dan Wahlin  (in 60ish minutes) - pdf"This tutorial will guide you through the process of creating a full-stack application. It features step-by-step instructions on how to build a fantasy football application, code snippets of the full application, and explanations on design decisions"

Jerod Santo presents on AngularJS: - quick video

Beginners Guide:

Five practical examples

Thinking in Angular

angular newsletter

Coding in Apple iOS

The Fall 2011 Stanford iOS cs193p training series by Paul Hegarty (a former Next employee and long time friend of Steve Jobs) can be found below:


Saturday, September 14, 2013

A big Apple September

This month has sure been a busy month for me in regards to the amount of Apple intake. Over the Labor day weekend I saw the Jobs movie. It made me think of the early days of home computers and brought back memories of neighborhood kids and I using the Atari 2600 Space invaders in 1980. I also loved that game Breakout. Jobs, Woz  and the group of other founders were pioneers in the new  computer age. I loved the the story of the  blue box.

Also, I watched on my Apple TV the launch of the new line of IPhone devices (to run on iOS7). Internet of Things next for Apple?

Discovered few new apple sites I plan on making use of.  CodeSchool, Objective C basics, Cocoa dev central, and iOS developer toolbelt .

Tuesday, September 10, 2013

DeftJs Talk

Two weeks ago I found a meetup for the Sencha Users Group in RTP . Little did I know, it was the the first meeting ever for the group. It was held at EMC and the topic was DeftJS and the speaker was one of the main contributors Brian Kotek  from BoozAllen.

Brian mentioned how he joined John Yarnarella on the project and brought a background in client side technologies such as Flex, typescript , and Google Closure.  Noted was that there is a dependency injection library for Sencha called swiz. But, DeftJs is what he calls an extension library whereby it sits on top of Sencha stack (with either Touch or ExtJs 4.0.7). 

The project has a MIT license.  Using the framework is as easy as getting the js and plopping it into your project. Although, the  Sencha Cmd Packages is becoming pretty popular option. 

The three main components of DeftJs are the:
IoC Container
View Controllers
Support for Promises 

Sunday, September 8, 2013

iOS Core Data

into XCode and create a new project, and when you click next, create Master Detail application, and then when you click next you select the core data checkbox. [link]

In the story board, you will have a Navigation controller and Table view .

In the controller (for me its learningMasterViewController)
(NSFetchedResultsController *)fetchedResultsController

Click the + sign to add new entry

method in controller insertNewObject gets invoked:

(void)controller:(NSFetchedResultsController *)controller didChangeObject:(id)anObject

Part 2 [link]

[newManagedObject setValue:self.testy1.text forKey:@"mymsg"];

Monday, September 2, 2013

RTP software symposium spring data

Talk by Craig Walls
Redis key value store, Riak,...
Spring data umblla project 3 years ago
JPA, Spring android, MongoDB, CouchDB,Neo4j, HBase, Cassandra, jdbc extensions, Hadoop, Gem Fire data grid, amazon s3 blob, rest exporter,
a lot data harvested from somewhere based on that make decisions, i.e election and campaign

Traditional database not capable holding this much data,  distributed file system, send workers at it like mapreduce, with Hadoop , gemfire is like a key value store, redis key value memory you could use it as session,  jms heavy you can do messaging over Redis, document store highly denormalized  and no schema, data not related, storing big chunks of data, resume data is an example, json like , graph databases is great neo4j normalize it into nodes and have relationships easy to understand , column stores key value within a key value, not really worked on Cassandra anymore, focus on hbase, blob s3 not spending time on it

Template oriented data access, auto magic repositories, annotating objects so u can store it

originally a fan of castor , then hibernate came, saved objects, JPA formalized hibernate, avoid queries, he didn't like it, struggling at mappings, complex data gets hard, for example do I make it eager or lazy?, don't like , rather write queries than deal with this, no JPATemplate, suggest not using HibernateTemplate, and JPATemplate, raw form hibernate better, jPA repositories is what is useful,

orderRepsitory  interface extends JPARepository <Order, Long>

No implementation and his test case passed


<JPA:repositories base-package = "">

Find respository method naming

And, Or, Betweeb, LessThan, GreaterThan, IsNull, IsNotNull, ! NotNull, Like, NoLike, OrderBy, Not , In, NotIn,


Annotate as Document

Mongo says Ids need to be String

Infinatest  plugin,

<mongo:repositories base-packages = "">


NodeEntity annotation
Lucene under covers