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
真的搞不定语法高亮 |
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
大厅里有100盏灯,每盏灯都编了号码,分别为1-100。每盏灯由一个开关来控制。(开关按一下,灯亮,再按一下灯灭。开关的编号与被控制的灯相同。)开始时,灯是全灭的。现在按照以下规则按动开关。 | |
第一次,将所有的灯点亮。 | |
第二次,将所有2的倍数的开关按一下。 | |
第三次,将所有3的倍数的开关按一下。 | |
以此类推。第N次,将所有N的倍数的开关按一下。 | |
问第N次(N大于等于2,且小于等于100)按完以后,大厅里还有几盏灯是亮的。 | |
请编程实现上面的逻辑,以N为参数 |
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
$(function() { | |
var share = { | |
title: '放手放脚体验高速急刹车 9位科技大咖亲测沃尔沃自动驾驶', | |
desc: '全球首个自动驾驶路试项目 Drive Me Truest Me 自动驾到 谁敢来约', | |
link: 'http://geekpark.net/zhuanti/volvo/mobile.html', | |
icon: 'http://geekpark-img.qiniudn.com/volvo-guestshare.jpg' | |
}; | |
(function() { |
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
/* | |
Recursion is a fundamental programming concept which can lead to elegant and efficient solutions to algorithmic problems. In fact, recursion is so powerful, all iterating behaviour can be defined using recursive functions. You will find recursion indispensable when iterating over nested data structures. | |
A recursive function is a function which calls itself. For example, this recursive function will take an array of words, and return an array of those words, uppercased. | |
*/ | |
function toUpperArray(items) { | |
if (!items.length) return [] // end condition | |
var head = items[0] // item to operate on | |
head = head.toUpperCase() // perform action | |
var tail = items.slice(1) // next |
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
```javascript | |
const cat = (head, ...items) => head.length ? head.concat.apply(head, items) : []; | |
const flat = arr => Array.isArray(arr) ? cat.apply(cat, arr.map(flat)) : [arr]; | |
``` |
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
[General] | |
loglevel = notify | |
skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12,127.0.0.0/24,100.64.0.0/10 | |
bypass-tun = 0.0.0.0/8, 1.0.0.0/9, 1.160.0.0/11, 1.192.0.0/11, 10.0.0.0/8, 14.0.0.0/11, 14.96.0.0/11, 14.128.0.0/11, 14.192.0.0/11, 27.0.0.0/10, 27.96.0.0/11, 27.128.0.0/9, 36.0.0.0/10, 36.96.0.0/11, 36.128.0.0/9, 39.0.0.0/11, 39.64.0.0/10, 39.128.0.0/10, 42.0.0.0/8, 43.224.0.0/11, 45.64.0.0/10, 47.64.0.0/10, 49.0.0.0/9, 49.128.0.0/11, 49.192.0.0/10, 54.192.0.0/11, 58.0.0.0/9, 58.128.0.0/11, 58.192.0.0/10, 59.32.0.0/11, 59.64.0.0/10, 59.128.0.0/9, 60.0.0.0/10, 60.160.0.0/11, 60.192.0.0/10, 61.0.0.0/10, 61.64.0.0/11, 61.128.0.0/10, 61.224.0.0/11, 100.64.0.0/10, 101.0.0.0/9, 101.128.0.0/11, 101.192.0.0/10, 103.0.0.0/10, 103.192.0.0/10, 106.0.0.0/9, 106.224.0.0/11, 110.0.0.0/7, 112.0.0.0/9, 112.128.0.0/11, 112.192.0.0/10, 113.0.0.0/9, 113.128.0.0/11, 113.192.0.0/10, 114.0.0.0/9, 114.128.0.0/11, 114.192.0.0/10, 115.0.0.0/8, 116.0.0.0/8, 117.0.0.0/9, 117.128.0.0/10, 118.0.0.0/11, 118.64.0.0/10, 118.128.0.0 |
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
# general | |
color default 15 235 | |
color cursor 15 241 | |
color title-focus 242 221 | |
color title-blur 242 221 | |
color delimiter 213 default | |
color author 156 default | |
color date 33 default | |
color line-number 221 default | |
color mode 255 default |
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
const path = require('path'); | |
const webpack = require('webpack'); const IS_PRODUCTION = process.env.NODE_ENV === 'production'; | |
const OUT_DIR = path.join(__dirname, './bundle/'); | |
const BrowserSyncPlugin = require('browser-sync-webpack-plugin'); | |
var config = { | |
context: __dirname, | |
entry: { | |
home: './src/home.js' | |
}, |