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 org.example; | |
| import org.tensorflow.SavedModelBundle; | |
| import org.tensorflow.Tensor; | |
| import org.tensorflow.ndarray.IntNdArray; | |
| import org.tensorflow.ndarray.NdArrays; | |
| import org.tensorflow.ndarray.Shape; | |
| import org.tensorflow.proto.framework.SignatureDef; | |
| import org.tensorflow.types.TInt32; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| #!/usr/bin/env python | |
| import paho.mqtt.client as mqtt | |
| import RPi.GPIO as GPIO | |
| def on_connect(client, userdata, rc): | |
| #print ("Connected with rc: " + str(rc)) | |
| client.subscribe("kwf/demo/led") | |
| def on_message(client, userdata, msg): |
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 static bool SubsetSum(IEnumerable<int> list, int s) | |
| { | |
| var arr = list.ToArray(); | |
| Array.Sort(arr); | |
| var a = arr.Where(i => i < 0).Sum(); | |
| var b = arr.Where(i => i > 0).Sum(); | |
| if(a > s || b < s) | |
| { | |
| return false; | |
| } |