Author: jasper

  • ‘rsync’ command source and destination explained

    ‘rsync’ command source and destination explained

    rsync command is super useful because it could incrementally sync files between locations without the overhead of compressing and transferring. There are heaps of tutorials about how to use it, how very few cover the point that how to sync two folders, which I believe is the most common use. I’d run rsync -avzP dir1 […]

  • Role transition to a Frontend Developer

    Role transition to a Frontend Developer

    There are only two hard problems in Computer Science: cache invalidation and naming things. Phil Karlton I recently started a frontend role at Automattic. Just in case any of you still don’t know the company, it’s the company behind WordPress.com, Tumblr, Simplenote etc. Developers at A8C are all kinda full stack engineers. I was mostly […]

  • 10 Years Anniversary

    10 Years Anniversary

    Freak! It’s been 10 years already since I first wrote a post ….

  • Add permanent route for VPN connections on Windows 10

    Add permanent route for VPN connections on Windows 10

    Add-VpnConnectionRoute -ConnectionName “YPC” -DestinationPrefix “10.1.1.0/24” -PassThru

  • Fix! Unable to Remove bluetooth devices/mouse/keyboard/speaker issue for Windows 10

    Fix! Unable to Remove bluetooth devices/mouse/keyboard/speaker issue for Windows 10

    This is the only working solution for me. Enjoy. My symptoms: – Previously working bluetooth speaker (UE BOOM 2 in my case) stops connecting – Windows 10 ‘Bluetooth and other devices’ menu shows the device as Paired – Pressing connect makes it attempt to connect but fails then it goes back to Paired – Remove […]

  • Example of Sending SMS in PHP Using AWS SNS

    Example of Sending SMS in PHP Using AWS SNS

    $client = AWS::createClient(‘Sns’); $sms = [ ‘Message’ => ‘sms_content’, ‘PhoneNumber’ => ‘sms_recipient’, ‘MessageAttributes’ => [ ‘AWS.SNS.SMS.SenderID’ => [ ‘DataType’ => ‘String’, ‘StringValue’ => ‘AD’ ], ‘AWS.SNS.SMS.SMSType’ => [ ‘DataType’ => ‘String’, ‘StringValue’ => ‘Transactional’ ], ] ]; $result = $client->publish($sms);

  • [CI] Bulb Switcher

    [CI] Bulb Switcher

      There are n bulbs that are initially off. You first turn on all the bulbs. Then, you turn off every second bulb. On the third round, you toggle every third bulb (turning on if it’s off or turning off if it’s on). For the nth round, you only toggle the last bulb. Find how […]

  • 健身计划一期(2015.8.28-2015.10.31)

    健身计划一期(2015.8.28-2015.10.31)

    大家相互监督、相互鼓励,把身体练好! 目标 体重不做高要求,减10斤左右即可,关键是脂肪减下去,肌肉长起来 人员 jasper, bill, xinli 一期周期 2015.8.28-2015.10.31 时间 每周保证四天,每天中午至少一小时 流程 11:40出发,健身完毕后洗澡,吃饭 健身流程 跑步30min以上 慢跑,心率140-160 beat/min 柔韧5min 压腿 扭腰 胳膊  力量15min,包括 臂力:选择合适重量,每组15个,至少两组,做到不能做为止 腹肌:仰卧起坐或够腿,每组15个,做到不能做为止 卧推:选择合适重量,每组20个,至少两组,做到不能做为止 放松活动10min 饮食 健身时多饮水 多吃蛋白质,如蛋清、瘦肉、鸡肉、豆制品、脱脂奶等 少吃碳水化合物,如米饭、馒头、面条等主食,糖类等 不吃油炸、肥肉、坚果等高脂肪含量的食物 不喝饮料(0热量的可以) 晚饭少吃 保证睡眠,良好的睡眠是最轻松的减肥方式

  • 面试程序题-二分查找(1)

    面试程序题-二分查找(1)

    一个数组,大小先减后增,请找到增减部分的分界点,要求算法时间复杂度O(logN)。 下面给出了一个递归实现的版本。 这个问题还可以让查找其中的某个元素,也是二分,思路一样。 #include <iostream> #define MAX 13 using namespace std; void findBreakpoint(int* a, int starti, int endi){ int i = (endi-starti)/2+starti; if(starti==i){ cout<<i<<endl; return; } if(a[i]<a[i+1]){ findBreakpoint(a, starti, i); }else{ findBreakpoint(a, i+1, endi); } } int main(){ int a[MAX] = {12, 11, 10, 8, 5, 6, 7, 9, 11, 12, 13, 20, 50}; findBreakpoint(a, […]

  • 一面在准备一些基础的算法,一面在准备语言相关,泛技术渣太苦逼了,在准备两种语言PHP和Java,而我最近一直在做是却是C++,是不是相当奇葩。。。