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 java.lang.reflect.*; | |
/* ... */ | |
Class c = module.getClass(); | |
Method configureMethod = c.getDeclaredMethod("configure", new Class[] { } ); | |
configureMethod.setAccessible(true); | |
configureMethod.invoke(module, new Object[]{}); |
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 org.lobobrowser.html.test.*; | |
import org.lobobrowser.html.gui.*; | |
// ... | |
public class CobraBrowserTestView extends FrameView { | |
HtmlPanel panel; | |
CobraBrowserTestView(SingleFrameApplication app) { |
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
String jsonString = "{'ms':1, 'ts':[{'id':1}, {'id':2}]}"; | |
JsonParser gson = new JsonParser(); | |
Type stringCollType = new TypeToken<List<Object>>(){}.getType(); | |
JsonElement element = gson.parse(jsonString); | |
JsonObject element2 = element.getAsJsonObject(); | |
String t = element2.get("ts").toString(); | |
System.out.println(t); // [{'id':1}, {'id':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
import java.io.IOException; | |
import java.net.HttpCookie; | |
import java.util.ArrayList; | |
import java.util.List; | |
import junit.framework.TestCase; | |
import org.apache.http.HttpResponse; | |
import org.apache.http.client.ClientProtocolException; | |
import org.apache.http.client.HttpClient; |
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 java.util.Map; | |
public interface SiteAuthInterface { | |
class AuthorizationFailedException extends Exception{} | |
public void setRoot(String siteRoot); | |
public void setAuth(String username, String password); | |
public String post(String relativePath, Map<String, String> params) | |
throws AuthorizationFailedException, IOException, ClientProtocolException; | |
public String get(String relativePath, Map<String, String> params) |
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 java.awt.Point; | |
import java.awt.Rectangle; | |
import java.util.ArrayList; | |
import java.util.Collection; | |
import java.util.Iterator; | |
import java.util.List; | |
import java.util.NoSuchElementException; | |
import java.util.TreeMap; | |
public class Tree2d<K extends Point.Double> implements Collection<K> { |
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
/** | |
* Example of how to wrap android.util.Log so that the tag is managed based on class name or logger name. | |
*/ | |
public class MyLogger { | |
private final String mTag; | |
public MyLogger(String name) { | |
mTag = "Application:" + name; | |
} |
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
blueprint: | |
name: Appliance has finished | |
description: Do something when an appliance (like a washing machine or dishwasher) | |
has finished as detected by a power sensor. | |
domain: automation | |
input: | |
power_sensor: | |
name: Power Sensor | |
description: 'Power sensor entity (e.g. from a smart plug device).' | |
selector: |
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
blueprint: | |
name: Zooz ZEN71 | |
description: Automations helper for the Zooz ZEN71 On/Off Switch using the | |
Zwave JS integration. | |
domain: automation | |
input: | |
zooz_zen71: | |
name: Zooz ZEN71 | |
description: The ZEN72 Switch to interact with. | |
selector: |