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
import org.junit.rules.TestRule; | |
import org.junit.runner.Description; | |
import org.junit.runners.model.Statement; | |
/** Got flaky tests? Shampoo them away. */ | |
public final class ShampooRule implements TestRule { | |
private final int iterations; | |
public ShampooRule(int iterations) { | |
if (iterations < 1) throw new IllegalArgumentException("iterations < 1: " + iterations); |
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.example.scalpeldrawer; | |
import android.app.Activity; | |
import android.content.Context; | |
import android.support.v4.widget.DrawerLayout; | |
import android.util.AttributeSet; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.CheckBox; |
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
/** | |
* Proxying implementation of Context that simply delegates all of its calls to | |
* another Context. Can be subclassed to modify behavior without changing | |
* the original Context. | |
*/ | |
public class ContextWrapper extends Context { | |
Context mBase; | |
public ContextWrapper(Context base) { | |
mBase = base; |
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
public class Application extends ContextWrapper implements ComponentCallbacks2 { | |
public Application() { | |
super(null); | |
} | |
/** | |
* Called when the application is starting, before any activity, service, | |
* or receiver objects (excluding content providers) have been created. | |
* Implementations should be as quick as possible (for example using | |
* lazy initialization of state) since the time spent in this function | |
* directly impacts the performance of starting the first activity, |
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
public class XXXXXApplication extends Application | |
{ | |
public XXXXXApplication() | |
{ | |
instance = this; | |
} | |
public void onCreate() | |
{ | |
params = new Bundle(); | |
SpInfo spinfo = new SpInfo(this); |
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.example.drawtest; | |
import android.content.Context; | |
import android.graphics.Canvas; | |
import android.graphics.Color; | |
import android.graphics.LinearGradient; | |
import android.graphics.Paint; | |
import android.graphics.Path; | |
import android.graphics.Point; | |
import android.graphics.RectF; |
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
git checkout master | |
git pull origin master | |
git merge develop | |
git push origin master |
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
Entity bookShelf = schema.addEntity("BookShelf"); | |
bookShelf.addIdProperty(); | |
Entity book = schema.addEntity("Book"); | |
book.addIdProperty(); | |
book.addStringProperty("name"); | |
Property bookFKShelves = book.addLongProperty("bookShelf_id").notNull().getProperty(); | |
book.addToOne(bookShelf, bookFKShelves); | |
bookShelf.addToMany(book, bookFKShelves); |
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
<?php | |
$url = "http://www.google.com"; | |
file_get_contents($url); | |
print_r( $http_response_header) ; | |
?> |