layout: page title: "Azure IoT" description: "Offers support for Azure IoT integration with Homeassistant." date: 2017-10-22 14:18 sidebar: true comments: false sharing: true footer: true logo: home-assistant.png
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 numpy as np | |
import tensorflow as tf | |
_major_version, _minor_version, _ = map(int, tf.__version__.split('-')[0].split('.')) | |
assert _major_version >= 1 and _minor_version >= 2, "requires TensorFlow 1.2.0 and above" | |
text_data_path = "./z_sentences.txt" | |
MAX_SEQUENCE_LENGTH = 10 |
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.apache.spark.sql.{ Row, SQLContext } | |
import org.apache.spark.sql.expressions.Window | |
val sql = new org.apache.spark.sql.SQLContext(sc) | |
val dataset = Seq( | |
("Thin", "cell phone", 6000), | |
("Normal", "tablet", 1500), | |
("Mini", "tablet", 5500), | |
("Ultra thin", "cell phone", 5000), | |
("Very thin", "cell phone", 6000), |
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
#!/bin/bash | |
# Script for installing tmux on systems where you don't have root access. | |
# tmux will be installed in $HOME/local/bin. | |
# It's assumed that wget and a C/C++ compiler are installed. | |
# per https://www.opensource.apple.com/source/ncurses/ncurses-27/ncurses/INSTALL | |
# Script will check whether $HOME/local is under AFS, if so, ncurses shall be configured with --enable-symlinks | |
# exit on error |
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
#!/bin/bash | |
# | |
# Example of how to parse short/long options with 'getopt' | |
# | |
OPTS=`getopt -o vhns: --long verbose,dry-run,help,stack-size: -n 'parse-options' -- "$@"` | |
if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi | |
echo "$OPTS" |
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
/************************************************** | |
1.最简单的方法就是两层循环,复杂度O(n^2) | |
2.使用排序,然后找重复。复杂度为O(nlgn)+O(n)=O(nlgn) | |
3.直接使用快排,在排序过程中,如果发现有重复的,立即结束递归 | |
****************************************************/ | |
#include <stdio.h> | |
#include <string.h> | |
int repeat; |