Sunday, October 20, 2013
Javascript techniques
Module pattern
function Answer(questionID, text) {
this.questionID = questionID;
this.text = text;
}
Working with arrays
var list1 = Array();
list1.push(currSec);
jQuery Append to element
$('#addLink').append('<B>test</B>');
Opener
http://www.webreference.com/js/tutorial1/opener.html
Saturday, October 19, 2013
Summer 2013 Harvard Building Mobile Applications Course
Building Mobile Applications class cs76 at Harvard from summer 2013 with David Malan. This course has a focus on iOS6, with some HTML5.
Official class page
The lecture1 goes over C and objective C programming as of iOS6 with Rob Bowden . The code notes has the examples of the Objective C starting on page 15.
The lecture 2 goes over iOS programming and goes over MVC iOS code
Official class page
The lecture1 goes over C and objective C programming as of iOS6 with Rob Bowden . The code notes has the examples of the Objective C starting on page 15.
The lecture 2 goes over iOS programming and goes over MVC iOS code
- https://developer.apple.com/library/ios/featuredarticles/ViewControllerPGforiPhoneOS/Introduction/Introduction.html
- https://developer.apple.com/library/ios/documentation/iphone/conceptual/iphoneosprogrammingguide/ManagingYourApplicationsFlow/ManagingYourApplicationsFlow.html
Thursday, October 17, 2013
Together Native and Html5
Peter Traeg of Universal Mind has written an article at Smashing Magazine about mixing together Native and Html5 .
https://github.com/ptraeg/html5-in-mobile-apps
Exposing a portion of the user experience through HTML and JavaScript means that some of the experience can be served from the Web and thus be dynamic. As we saw earlier, it’s possible for this Web-served content to invoke native code in your application via a “bridge” that you create.
Apple allows JavaScript code to be downloaded and executed as long as it runs within the context of the UIWebView control in your iOS application. This is the only situation in which code “downloading” is allowed in iOS.
The UIWebView in iOS and its associated UIWebViewDelegate provide the mechanism that allows native code and JavaScript to communicate with each other.
https://github.com/ptraeg/html5-in-mobile-apps
Tuesday, October 15, 2013
Learn It on Web
Now a days there are so many ways to learn things on the web. Over the past year or so I have found a few site to help me improve my skills. Most of these are free resources but not all. This will be a dynamic list and will be updated periodically ...
- A list of free programming books
- free books
- http://www.skilledup.com/learn/openu/learn-computer-science-online-free/
- Udacity
- teamtreehouse.com
- Codecademy
- codeschool.com
- Khan Academy
- http://learncodethehardway.org/
- https://manual.cs50.net/seminars/
- http://www.saylor.org/courses/cs412/
- skillsmatter.com
- http://chinwag.com/
- http://www.objc.io/
- http://www.davemark.com/
- http://cs76.tv/2012/spring/
- http://cs76.tv/2013/summer/
- http://designthencode.com/
- http://online.stanford.edu/courses/platform/iTunes%20U
- http://www.openculture.com/freeonlinecourses#ComputerScience
- https://www.coursera.org/courses?orderby=upcoming&cats=infotech
- Web design videos
- youtube Java tut
- http://sixrevisions.com/category/tutorials/
- http://www.openseminar.org
- https://courseware.stanford.edu/pg/courses/archives
- https://courseware.stanford.edu/pg/courses/lectures/317431
- GIT
- http://www.cssjunction.com/
- learn css positioning
- http://css-tricks.com/video-screencasts/
- mobile
- http://www.powershow.com/
- http://www.ecma-international.org/publications/standards/Ecma-262.htm
- http://www.w3.org/html/wg/drafts/html/master/Overview.html
- http://www.stanford.edu/class/cs193a/
- http://www.stanford.edu/class/cs193c/resources.html
- http://www.bobmccune.com/
- http://dimsumthinking.com/
- http://codevisually.com/
- http://www.cis.upenn.edu/~matuszek/
Saturday, October 12, 2013
MongoDB Week 1
I started the MongoDB for Java developer course this week.
The lead developer of the java driver Jeff Yemin along with Andrew Erlichson are the instructors.
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
<version>2.10.1</version>
</dependency>
System.out.println( "Hello World!" );
{ "_id" : { "$oid" : "5254c64c2488183e2c3d49f8"} , "text" : "hello world"}
Spark Web Application Framework
http://www.sparkjava.com/
<repositories>
<repository>
<id>Spark repository</id>
<url>http://www.sparkjava.com/nexus/content/repositories/spark/</url>
</repository>
</repositories>
<dependency>
<groupId>spark</groupId>
<artifactId>spark</artifactId>
<version>0.9.9.4-SNAPSHOT</version>
</dependency>
import spark.Request;
import spark.Response;
import spark.Route;
import spark.Spark;
public class HelloWorldSparkStyle {
public static void main( String[] args )
{
//http://localhost:4567/
Spark.get(new Route("/") {
@Override
public Object handle(Request arg0, Response arg1) {
return "Hello Spark World!";
}
});
}
}
Freemarker ...
Spark.post(new Route("/favorite_fruit")
Schemaless Mongodb example (can add columns on fly)
json - arrrays, dictionaries (associated maps)
MongoPosts
16meg limit on document
The lead developer of the java driver Jeff Yemin along with Andrew Erlichson are the instructors.
Non relational algebra
Json store
Json documents - collection of documents
Key values
Mongoshell - tcpconnects to mongodb
Sparq java - routes to urls
Freemarker mvc
Copy files in bin dir to c:\mongodb226
Make data dir under c drive, Under data mkdir db
Go to bin dir
c:\mongodb226>mongod
mongod --help for help and startup options
Tue Oct 08 22:44:36 [initandlisten] MongoDB
starting : pid=1696 port=27017 dbpath=\data\db
\ 64-bit host=CSGRALLT10
Tue Oct 08 22:44:36 [initandlisten] db
version v2.2.6, pdfile version 4.5
c:\mongodb226>mongo
MongoDB shell version: 2.2.6
connecting to: test
Welcome to the MongoDB shell.
For interactive help, type
"help".
For more comprehensive documentation, see
Questions? Try the support group
>
Or
mongo localhost
> db
test
> show collections
> db.mycollections.insert({text:'hello
world'})
> show collections
mycollections
system.indexes
> db.mycollections.find()
{ "_id" :
ObjectId("5254c64c2488183e2c3d49f8"), "text" : "hello
world" }
>
c:\>cd data
c:\data>cd db
c:\data\db>dir
Volume
in drive C is Windows
Volume Serial Number is 1CEC-CA9A
Directory of c:\data\db
10/08/2013
10:58 PM <DIR> .
10/08/2013
10:58 PM <DIR> ..
10/08/2013
10:58 PM <DIR> journal
10/08/2013
10:50 PM 6 mongod.lock
10/08/2013
10:58 PM 67,108,864 test.0
10/08/2013
10:58 PM 134,217,728 test.1
10/08/2013
10:58 PM 16,777,216 test.ns
10/08/2013
10:58 PM <DIR> _tmp
4 File(s) 218,103,814 bytes
4 Dir(s) 49,962,684,416 bytes free
> mvn archetype:generate
enter 308 at prompt
308: remote ->
org.apache.maven.archetypes:maven-archetype-quickstart (An archetype which
ven project.)
308
mvn compile exec:java -Dexec.mainClass="org.mongodb.App"Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): 308:Choose org.apache.maven.archetypes:maven-archetype-quickstart version:1: 1.0-alpha-12: 1.0-alpha-23: 1.0-alpha-34: 1.0-alpha-45: 1.06: 1.1
Choose a number: 6: 6
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
<version>2.10.1</version>
</dependency>
import com.mongodb.DB;
import com.mongodb.DBCollection;
import com.mongodb.DBObject;
import com.mongodb.MongoClient;
import com.mongodb.ServerAddress;
public class HelloMongoDB {
public static void main( String[] args ) throws UnknownHostException
{
MongoClient mongoStyleClient = new MongoClient(new ServerAddress("localhost", 27017));DB db = mongoStyleClient.getDB("test");
System.out.println( "Hello World!" );
DBCollection coll = db.getCollection("mycollections");
DBObject document1 = coll.findOne();
System.out.println(document1); }
}}Hello World!
{ "_id" : { "$oid" : "5254c64c2488183e2c3d49f8"} , "text" : "hello world"}
Spark Web Application Framework
http://www.sparkjava.com/
<repositories>
<repository>
<id>Spark repository</id>
<url>http://www.sparkjava.com/nexus/content/repositories/spark/</url>
</repository>
</repositories>
<dependency>
<groupId>spark</groupId>
<artifactId>spark</artifactId>
<version>0.9.9.4-SNAPSHOT</version>
</dependency>
import spark.Request;
import spark.Response;
import spark.Route;
import spark.Spark;
public class HelloWorldSparkStyle {
public static void main( String[] args )
{
//http://localhost:4567/
Spark.get(new Route("/") {
@Override
public Object handle(Request arg0, Response arg1) {
return "Hello Spark World!";
}
});
}
}
Hello Spark World!
Template library
http://freemarker.org/
.ftl files combined with data map
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>2.3.19</version>
</dependency>
Spark - Http Get , Http Post
Freemarker looping
Freemarker ...
Spark.post(new Route("/favorite_fruit")
Schemaless Mongodb example (can add columns on fly)
MongoPosts
16meg limit on document
Subscribe to:
Posts (Atom)