This file contains 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
[NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) { | |
NSInteger responseCode = [(NSHTTPURLResponse *)response statusCode]; | |
if (!connectionError && responseCode == 200){ | |
// all is good, load the data | |
} | |
else{ | |
//show error message | |
NSLog(@"connectionError=%@", connectionError); | |
NSLog(@"responseCode=%d", responseCode); | |
[SVProgressHUD showErrorWithStatus:@"Oops, unable to load movies, check your internet!"]; |
This file contains 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
#import <Foundation/Foundation.h> | |
enum TEMPERATURE_TYPE{ | |
CELCIUS, | |
FAHRENHEIT, | |
}; | |
@interface SFTemperatureModel : NSObject |
This file contains 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
# coding: utf-8 | |
# # Regression Week 2: Multiple Regression (gradient descent) | |
# In the first notebook we explored multiple regression using graphlab create. Now we will use graphlab along with numpy to solve for the regression weights with gradient descent. | |
# | |
# In this notebook we will cover estimating multiple regression weights via gradient descent. You will: | |
# * Add a constant column of 1's to a graphlab SFrame to account for the intercept | |
# * Convert an SFrame into a Numpy array |
This file contains 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
[ | |
{ | |
"id": "b93671f5.98624", | |
"type": "debug", | |
"z": "5d7690ec.49781", | |
"name": "", | |
"active": true, | |
"console": "false", | |
"complete": "payload", | |
"x": 579.5, |
This file contains 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
[ | |
{ | |
"id": "dc765e4b.46713", | |
"type": "subflow", | |
"name": "random", | |
"info": "", | |
"in": [ | |
{ | |
"x": 230, | |
"y": 320, |
This file contains 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
From https://zemian.github.io/2016/10/05/My-Quick-Git-Reference.html | |
git clone http://path/to/repo.git # Retrieve a repo for work (auto checkout master branch into WorkingDir) | |
git init # Create new repository for work (auto checkout master branch into WorkingDir) | |
git init --bare # Create new repository without WorkingDir - bare repo for server share only | |
git status # Print current status of the repo | |
git branch -a # List of all branches (including remote branches) | |
git tag # List of all tags | |
git log -3 # Show last 3 commits |
This file contains 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
//TRY 1 | |
// const nextCharForNumberString = function(str){ | |
// const trimmed = str.trim(); | |
// const number = parseInt(trimmed); | |
// const nextNumber = number + 1; | |
// return String.fromCharCode(nextNumber); | |
// } | |
//TRY 2 | |
// const nextCharForNumberString = function(str){ |
This file contains 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
@Test | |
public void getAllBooksShouldReturnListOfAllBooks() throws Exception { | |
final String expectedTitle = "The Lightning Thief"; | |
mockMvc.perform(get(baseUrl + getAllBooksURL) | |
.accept(MediaType.APPLICATION_JSON)) | |
.andExpect(status().isOk()) | |
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)) | |
.andExpect(jsonPath("$", hasSize(5))) |
This file contains 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
public static Matcher<List<Book>> containsTitle(final String title){ | |
return new BaseMatcher<List<Book>>() { | |
@Override | |
public boolean matches(Object item) { | |
List<Book> books = (List<Book>) item; | |
List<Book> booksFiltered = books.stream() | |
.filter(b -> b.getTitle().equalsIgnoreCase(title)) | |
.collect(Collectors.toList()); | |
return !booksFiltered.isEmpty(); | |
} |
This file contains 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
function cd { | |
# Run the system CD command on the parameters that were passed in | |
builtin cd "$@" | |
# Check if the directory we are in now is a git directory | |
if [ -d ".git" ]; then | |
# If so, check to see that there are no uncommitted files | |
if [ $(git status --porcelain 2>/dev/null| egrep "^(M| M)" | wc -l) ]; then | |
# Rebase our current branch with upstream/master | |
git fetch upstream && git rebase upstream/master | |
fi |
OlderNewer