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 classifyDatum { | |
| public static void main(String[] args) throws Exception { | |
| // load the classifier | |
| Classifier cls = (Classifier) weka.core.SerializationHelper.read("your/path/to/training/data.csv.model"); | |
| // now classify data from a csv file | |
| classifyCsv(cls, "your/path/to/test/data.csv"); | |
| // or classify some value captured from somewhere |
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
| /* | |
| Objects can have the following parameters: | |
| color: '#fff' by default | |
| impassable: true if it blocks the player from movement (false by default) | |
| onCollision: function (player, game) called when player moves over the object | |
| onPickUp: function (player, game) called when player picks up the item | |
| symbol: Unicode character representing the object | |
| type: 'item' or null | |
| */ |
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
| beaconManager.getBeaconParsers().add(new BeaconParser(). | |
| setBeaconLayout("m:0-3=4c000215,i:4-19,i:20-21,i:22-23,p:24-24")); // iBeacons | |
| beaconManager.getBeaconParsers().add(new BeaconParser(). | |
| setBeaconLayout("m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24")); // Estimotes | |
| beaconManager.getBeaconParsers().add(new BeaconParser(). | |
| setBeaconLayout("m:0-3=a7ae2eb7,i:4-19,i:20-21,i:22-23,p:24-24")); // easiBeacons |
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
| def get_final_window_rect(self): | |
| """Gets the final size of the main window of guake. The height | |
| is the window_height property, width is window_width and the | |
| horizontal alignment is given by window_alignment. | |
| """ | |
| screen = self.window.get_screen() | |
| height = self.client.get_int(KEY('/general/window_height')) | |
| width = 90 | |
| halignment = self.client.get_int(KEY('/general/window_halignment')) |
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
| function allowCrossDomain(req, res, next) { | |
| res.header('Access-Control-Allow-Origin', '*'); | |
| res.header('Access-Control-Allow-Headers', 'x-requested-with, Content-Type, Auth-Token'); | |
| // intercept OPTIONS method | |
| if ('OPTIONS' == req.method) { | |
| res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE'); | |
| res.send(204); | |
| } |
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 lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>get demo</title> | |
| <style> | |
| span { | |
| color: red; | |
| } | |
| div { |
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
| // Define various ADC prescaler | |
| const unsigned char PS_16 = (1 << ADPS2); | |
| const unsigned char PS_32 = (1 << ADPS2) | (1 << ADPS0); | |
| const unsigned char PS_64 = (1 << ADPS2) | (1 << ADPS1); | |
| const unsigned char PS_128 = (1 << ADPS2) | (1 << ADPS1) | (1 << ADPS0); | |
| // Setup the serial port and pin 2 | |
| void setup() { | |
| Serial.begin(115200); |