This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <servlet> | |
| <servlet-name>SystemServiceServlet</servlet-name> | |
| <servlet-class>com.google.api.server.spi.SystemServiceServlet</servlet-class> | |
| <init-param> | |
| <param-name>services</param-name> | |
| <param-value>com.mindstorm.api.MyEndpoint, com.mindstorm.api.QuoteEndpoint</param-value> | |
| </init-param> | |
| </servlet> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.mindstorm.api; | |
| import com.google.api.server.spi.config.Api; | |
| import com.google.api.server.spi.config.ApiMethod; | |
| import com.google.api.server.spi.config.ApiNamespace; | |
| import com.google.api.server.spi.response.CollectionResponse; | |
| import com.google.api.server.spi.response.NotFoundException; | |
| import com.google.appengine.api.datastore.Cursor; | |
| import com.google.appengine.api.datastore.QueryResultIterator; | |
| import com.googlecode.objectify.ObjectifyService; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Manipulate a text file.Search for 'word' in this text file and replace it with 'inserted word'. Write the contents | |
| back into the original file | |
| */ | |
| package main | |
| import ( | |
| "bytes" | |
| "fmt" | |
| "io/ioutil" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "log" | |
| "os" | |
| ) | |
| func check(e error) { | |
| if e != nil { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Exercise 15 : http://play.golang.org/p/0qhgQmSVBR | |
| Exercise 16 : http://play.golang.org/p/YYdFELAke8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Exercise 11 : Line #5 and Line #6 have errors since you cannot have a pointer to a constant value. | |
| Exercise 12 : The pointer is not initialized to anything (nil). As a result,any operation on this is going to be problematic (Null Pointer Exception). On running the program, it shows panic: runtime error: invalid memory address or nil pointer dereference. | |
| Exercise 13 : a() is invoked first and this prints the value of the global variable i (10), which was initialized to 10 at the start of the program. The next function invoked is b() and this initializes a local variable i to 20. Hence the output is 20. This is a local variable within the scope of the function and does not affect the global variable i, which still has the value of 10. Hence the last function a() invocation simply prints the value of the global variable i that is still 10. | |
| Exercise 14 : main() creates a localized variable i and hence the first output is 20. Then b() is invoked, which also creates a localized variable i, whose value is 40. An |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Week 1 Exercises from Go Course (http://gocourse.slack.com). | |
| Exercise 1 : | |
| /tmp/sandbox760491916/main.go:6: syntax error: unexpected semicolon or newline before { | |
| Needed to push the start parenthesis to the line contain main(). After that it gave the obvious errors i.e. | |
| - package "os" is imported but not used | |
| - println - cannot refer to unexported name fmt.println |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.mindstorm.famousquotesandroid; | |
| import android.accounts.AccountManager; | |
| import android.app.Activity; | |
| import android.app.ProgressDialog; | |
| import android.content.Context; | |
| import android.content.Intent; | |
| import android.content.SharedPreferences; | |
| import android.os.AsyncTask; | |
| import android.os.Bundle; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <uses-permission android:name="android.permission.GET_ACCOUNTS" /> | |
| <uses-permission android:name="android.permission.USE_CREDENTIALS" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Famous Quotes</title> | |
| </head> | |
| <body> | |
| <div id="login"> | |
| <input id="loginButton" type="button" value="Login"/> | |
| </div> |