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
UIImage* resizeImageToSize(UIImage* image, CGSize size) | |
{ | |
UIGraphicsBeginImageContext(size); | |
CGContextRef ctx = UIGraphicsGetCurrentContext(); | |
//Account for flipped coordspace | |
CGContextTranslateCTM(ctx, 0.0, size.height); | |
CGContextScaleCTM(ctx, 1.0, -1.0); | |
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
# -*- coding: utf-8 -*- | |
from multiprocessing.dummy import Pool as ThreadPool | |
from lxml import html | |
import requests | |
import string | |
THREADS=10 | |
punctuation = '!"#$%&\'()*+,-./:;<=>?[\\]^_`{|}~' | |
headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36'} |
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
/***************************************************************** | |
LSM9DS0_AHRS.ino | |
SFE_LSM9DS0 Library AHRS Data Fusion Example Code | |
Jim Lindblom @ SparkFun Electronics | |
Original Creation Date: February 18, 2014 | |
https://github.com/sparkfun/LSM9DS0_Breakout | |
Modified by Kris Winer, April 4, 2014 | |
The LSM9DS0 is a versatile 9DOF sensor. It has a built-in |
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 torch | |
import torch.nn as nn | |
import torch.nn.functional as F | |
from torch.nn.parameter import Parameter | |
def debug(debug_open, x, layername): | |
if debug_open: | |
print x.size(), 'after', layername | |
class PVANet(nn.Module): |
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
# -*- coding: utf-8 -*- | |
""" | |
Very simple HTTP server in python. | |
Usage:: | |
./dummy-web-server.py [<port>] | |
Send a GET request:: | |
curl http://localhost |
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
# -*- coding: utf-8 -*- | |
import example_helper | |
import json | |
import csv | |
import urllib | |
import numpy as np | |
from deepmoji.sentence_tokenizer import SentenceTokenizer | |
from deepmoji.model_def import deepmoji_emojis | |
from deepmoji.global_variables import PRETRAINED_PATH, VOCAB_PATH |
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
//A library adopted from Python version Wagner & Fischer algorithm: | |
//url: https://gist.github.com/kylebgorman/8034009 | |
//for more information, please go to the original library | |
function INSERTION(A, cost=1){ | |
return cost; | |
} | |
function DELETION(A, cost=1){ | |
return cost; | |
} |
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.BufferedInputStream; | |
import java.io.BufferedOutputStream; | |
import java.io.DataInputStream; | |
import java.io.DataOutputStream; | |
import java.io.EOFException; | |
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.FileNotFoundException; | |
import java.io.FileOutputStream; | |
import java.io.IOException; |
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
using System; | |
using System.ComponentModel; | |
using System.Drawing; | |
using System.Linq; | |
using System.Runtime.InteropServices; | |
using System.Security; | |
using System.Security.Permissions; | |
using System.Windows.Input; | |
namespace Demo |
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
[ | |
{ | |
"link": "https://m.weibo.cn/detail/4661384946125143", | |
"Time": "Wed Jul 21 13:10:38 +0800 2021", | |
"address": "河南省郑州市崔庙镇", | |
"lng": 113.330031, | |
"lat": 34.64436, | |
"post": "郑州#河南暴雨互助# 📢#河南暴雨救援# 求助帖❗️❗️❗️被困求救地址:荥阳市崔庙镇王宗店村情况:房子塌了,一对母女被困塌房里,现在救援队过不去,路面双向被冲断,母女还被困两个小时了,没有办法,寻求社会帮助,只能皮艇支援!!!!!!☎️:13653820035 ", | |
"urgent": "", | |
"category": "", |