Skip to content

Instantly share code, notes, and snippets.

View wongsyrone's full-sized avatar
😂
Babysitting

Syrone Wong wongsyrone

😂
Babysitting
View GitHub Profile
@wongsyrone
wongsyrone / readme.md
Created August 25, 2016 06:58 — forked from max-mapper/readme.md
notes from hacking my kindle paperwhite

outline

useful hacks

@wongsyrone
wongsyrone / Reset_Reregister_Windows_Update_Components.bat
Created August 24, 2016 23:15
Reset_Reregister_Windows_Update_Components
:: Created by: Shawn Brink
:: http://www.sevenforums.com
:: Tutorial: http://www.sevenforums.com/tutorials/91738-windows-update-reset.html
net stop bits
net stop wuauserv
net stop appidsvc
net stop cryptsvc
Ipconfig /flushdns
https://www.brobwind.com/archives/824
public int divisorSum(int n){
// n has no divisors other than itself
if(n == 1){
return n;
}
// Find and sum divisors:
int half = n/2;
int sum = n;
do {
Win7修改:
  第一步:
  打开C盘(系统盘),用户,你的机器名字,找到AppData。
  AppData这个文件默认是隐藏的,所以你需要在文件夹选项里点击查看,勾选显示 隐藏文件、文件夹,这样就可以看到AppData了!
  第二步:
  点击Roaming,找到Battle.net,如果很多可以按快捷键B,在用记事本打开Battle.net。
  第三步:(重点)
  修改Client语法下的AllowedRegions区域,
  将AllowedRegions区域加入CN;US;EU;KR
  Regions就是你的登录可以选择的区域,CN就是国服;US美服;EU欧服;KR韩/台服。(根据自己的喜好选择对应的区域)
@wongsyrone
wongsyrone / hash.c
Created June 15, 2016 07:09 — forked from tonious/hash.c
A quick hashtable implementation in c.
#define _XOPEN_SOURCE 500 /* Enable certain library functions (strdup) on linux. See feature_test_macros(7) */
#include <stdlib.h>
#include <stdio.h>
#include <limits.h>
#include <string.h>
struct entry_s {
char *key;
char *value;
@wongsyrone
wongsyrone / Nim.c
Last active June 12, 2016 03:16
Nim Game
/**
* 292. Nim Game
* You are playing the following Nim Game with your friend: There is a heap of stones on the table,
* each time one of you take turns to remove 1 to 3 stones. The one who removes the last stone will
* be the winner. You will take the first turn to remove the stones.
* Both of you are very clever and have optimal strategies for the game. Write a function to
* determine whether you can win the game given the number of stones in the heap.
* For example, if there are 4 stones in the heap, then you will never win the game:
* no matter 1, 2, or 3 stones you remove, the last stone will always be removed by your friend.
*
@wongsyrone
wongsyrone / GPS.cs
Last active June 6, 2016 01:45
GPS路线偏移
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace GPS1
{
class GPS
{
//将角度转换为弧度
server:
# curl -o /etc/unbound/root.hints https://www.internic.net/domain/named.cache
# update root.hints every six months
num-threads: 2
interface: 0.0.0.0
interface: ::0
port: 53
so-rcvbuf: 4m
so-sndbuf: 4m
so-reuseport: yes
@wongsyrone
wongsyrone / sysctl.conf
Created April 30, 2016 00:33 — forked from chenshaoju/sysctl.conf
sysctl.conf
#
# /etc/sysctl.conf - Configuration file for setting system variables
# See /etc/sysctl.d/ for additonal system variables
# See sysctl.conf (5) for information.
#
#kernel.domainname = example.com
# Uncomment the following to stop low-level messages on console
#kernel.printk = 3 4 1 3