Skip to content

Instantly share code, notes, and snippets.

View qingswu's full-sized avatar

qingswu

  • Canada
View GitHub Profile
@bzerangue
bzerangue / yahoo-weather-condition-codes.xml
Created February 1, 2011 06:53
Yahoo Weather Condition Codes
<?xml version="1.0" encoding="UTF-8"?>
<yahoo-weather-codes>
<code number="0" description="tornado"/>
<code number="1" description="tropical storm"/>
<code number="2" description="hurricane"/>
<code number="3" description="severe thunderstorms"/>
<code number="4" description="thunderstorms"/>
<code number="5" description="mixed rain and snow"/>
<code number="6" description="mixed rain and sleet"/>
<code number="7" description="mixed snow and sleet"/>
@andrewharvey
andrewharvey / Makefile
Created November 27, 2011 10:38
Given a list of OSM meta-tiles, render the meta-tile using Mapnik, and chop up the tile using ImageMagick.
CXX = g++
CXXFLAGS = $(shell mapnik-config --cflags) $(shell Magick++-config --cxxflags --cppflags) -Wall
LDFLAGS = $(shell mapnik-config --libs --dep-libs --ldflags) $(shell Magick++-config --ldflags --libs) -lboost_program_options -lpthread
OBJ = mapnik_osm_metatiles.o
BIN = render_mapnik_osm_metatiles
all : $(BIN)
@NightlordTW
NightlordTW / gist:1511193
Created December 22, 2011 17:55
Constrained Logistic Regression
################################################################################
# Calculates the maximum likelihood estimates of a logistic regression model
# Slopes are constrained to non-negative values
#
# fmla : model formula
# x : a [n x p] dataframe with the data. Factors should be coded accordingly
#
# OUTPUT
# beta : the estimated regression coefficients
# vcov : the variane-covariance matrix
@mshivers
mshivers / nnlr
Created February 3, 2012 15:46
L2 Regularized Non-negative logistic regression
import scipy as sp
from scipy import optimize as opt
def nnlr(X, y, C):
"""
Non-negative Logistic Regression with L2 regularizer
"""
def lr_cost(X, y, theta, C):
m = len(y)
return (1./m) * (sp.dot(-y, sp.log(sigmoid(sp.dot(X, theta)))) \
@moolex
moolex / ip.set.bat
Created January 4, 2013 05:04
Windows下自动设置IP的批处理脚本
@echo off
::需要设置的网络,一般为“本地连接”或者“无线网络连接”
set name="无线网络连接"
::请根据您的参数修改以下数据
::设置 IP地址
set ipaddress=18.1.16.169
::设置 子掩码
set mask=255.255.252.0
::设置 网关
set gateway=18.1.19.254
@wh5a
wh5a / mp6.c
Last active April 5, 2024 08:02
CUDA 2D Convolution.
#include <wb.h>
// Check ec2-174-129-21-232.compute-1.amazonaws.com:8080/mp/6 for more information
#define wbCheck(stmt) do { \
cudaError_t err = stmt; \
if (err != cudaSuccess) { \
wbLog(ERROR, "Failed to run stmt ", #stmt); \
return -1; \
@Yago
Yago / free-tiles.txt
Created January 29, 2014 11:01
GIS - Free tiles
Nokia :
http://{s}.maptile.maps.svc.ovi.com/maptiler/v2/maptile/newest/normal.day/{z}/{x}/{y}/256/png8
MapQuest :
http://a.tile.openstreetmap.org/{z}/{x}/{y}.jpg
http://otile1.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg
http://otile1.mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.jpg
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active July 28, 2024 15:27
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@BloodAxe
BloodAxe / eggs_detector.cpp
Created July 15, 2014 14:37
Image enchancement and Hough transform example
/**
* @brief Image enchancement and Hough transform example
* @author Eugene Khvedchenya <ekhvedchenya@gmail.com>
* @copyright computer-vision-talks.com/articles/how-to-detect-circles-in-noisy-image/
*/
#include <opencv2/opencv.hpp>
@SteveRuben
SteveRuben / client.cpp
Created October 21, 2015 08:30
Multiple streaming in c++ using opencv; OpenCV video streaming over TCP/IP
/**
* OpenCV video streaming over TCP/IP
* Client: Receives video from server and display it
* by Steve Tuenkam
*/
#include "opencv2/opencv.hpp"
#include <sys/socket.h>
#include <arpa/inet.h>
#include <unistd.h>