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
@Override | |
public LayoutParams generateLayoutParams(AttributeSet attrs) { | |
return new CellLayoutParams(getContext(), attrs); | |
} | |
public static class CellLayoutParams extends MarginLayoutParams { | |
public int cellX = 0; | |
public int cellY = 0; | |
public int cellRowSpan = 1; | |
public int cellColSpan = 1; |
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
package com.htc.blinkfeed.sample.vimeo.api; | |
import java.io.IOException; | |
import java.net.HttpURLConnection; | |
import oauth.signpost.OAuthConsumer; | |
import oauth.signpost.basic.DefaultOAuthConsumer; | |
import oauth.signpost.exception.OAuthCommunicationException; | |
import oauth.signpost.exception.OAuthExpectationFailedException; | |
import oauth.signpost.exception.OAuthMessageSignerException; |
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
/* | |
Blink | |
Turns on an LED on for one second, then off for one second, repeatedly. | |
This example code is in the public domain. | |
*/ | |
// give it a name: | |
int led = D7; |
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
var SparkCore = require('./spark_core'); | |
var util = require('util'); | |
var juliansCore = new SparkCore({ | |
device_id: 'YOUR_DEVICE_ID', | |
access_token: 'YOUR_ACCESS_TOKEN' | |
}); | |
var val = 0; | |
(function blink() { | |
val = (val + 1) % 2; |
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
package main | |
import ( | |
spark "github.com/julianshen/SparkGo" | |
"time" | |
) | |
func main() { | |
core := spark.SparkCore{"YOUR_ACCESS_TOKEN","DEVICE_ID"} |
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
// give it a name: | |
int _led = D7; | |
//function definition | |
int led(String command); | |
// the setup routine runs once when you press reset: | |
void setup() { | |
// initialize the digital pin as an output. | |
pinMode(_led, OUTPUT); |
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
Intent intent = new Intent("com.android.launcher.action.INSTALL_SHORTCUT"); | |
intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, "test"); | |
PackageManager pm = getPackageManager(); | |
ApplicationInfo youtube = null; | |
ApplicationInfo plus = null; | |
ApplicationInfo map = null; | |
try { | |
youtube = pm.getApplicationInfo("com.google.android.youtube", PackageScanIntentService.FLAGS_PACKAGE); |
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
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"os" | |
) | |
func main() { | |
type User struct { |
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
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"os" | |
) | |
func main() { | |
type User struct { |
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
extension CollectionType where Generator.Element == String { | |
func find(subString:Generator.Element) -> Int { | |
for (i,s) in self.enumerate() { | |
if s.containsString(subString) { | |
return i | |
} | |
} | |
return -1 | |
} | |
} |