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
| var fields = "W........WW."; | |
| fields += ".WWW.....WWW"; | |
| fields += "....WW...WW."; | |
| fields += ".........WW."; | |
| fields += ".........W.."; | |
| fields += "..W......W.."; | |
| fields += ".W.W.....WW."; | |
| fields += "W.W.W.....W."; | |
| fields += ".W.W......W."; | |
| fields += "..W.......W."; |
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
| fields = "#S######.#"; | |
| var width = fields.length; | |
| fields += "......#..#"; | |
| fields += ".#.##.##.#"; | |
| fields += ".#........"; | |
| fields += "##.##.####"; | |
| fields += "....#....#"; | |
| fields += ".#######.#"; | |
| fields += "....#....."; | |
| fields += ".####.###."; |
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
| var c1=3,c5=2,c10=1,c50=3,c100=0,c500=2,A=620; | |
| var total = 0,i=0; | |
| for(i = 0 ; i < c500 && (A-500) >= 0 ; i ++,total++){A-=500} | |
| console.log("500円"+i+"枚"); | |
| for(i = 0 ; i < c100 && (A-100) >= 0 ; i ++,total++){A-=100} | |
| console.log("100円"+i+"枚"); | |
| for(i = 0 ; i < c50 && (A-50) >= 0 ; i ++,total++){A-=50} | |
| console.log("50円"+i+"枚"); | |
| for(i = 0 ; i < c10 && (A-10) >= 0 ; i ++,total++){A-=10} | |
| console.log("10円"+i+"枚"); |
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
| var i=0,t=0,answer=[],jobs=[{id:1,s:1,t:3},{id:2,s:2,t:5},{id:3,s:4,t:7},{id:4,s:6,t:9},{id:5,s:8,t:10}]; | |
| jobs.sort(function(a,b) {return a.t-b.t;}); | |
| for(;i<jobs.length;i++){ | |
| if(t<jobs[i].s){ | |
| answer.push(jobs[i]); | |
| t=jobs[i].t; | |
| } | |
| } | |
| console.log(answer); |
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
| var items = [{w:2,v:3},{w:1,v:2},{w:3,v:4},{w:2,v:2}]; | |
| var results = [],values =[]; | |
| var MAX_W=5; | |
| for(var start = 0; start < items.length ; start ++){ | |
| var current_w =0, current_v = 0; | |
| var item_numbers = []; | |
| for(var i = start ; i < items.length; i++){ | |
| if(MAX_W >= (current_w+items[i].w)){ | |
| item_numbers.push(i); | |
| current_v += items[i].v; |
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
| $ cat Cat.js | |
| var Cat; | |
| Cat = (function() { | |
| function Cat(name) { | |
| this.name = name; | |
| } | |
| Cat.prototype.mew = 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
| (function(){ | |
| var total = 0; | |
| var year = (new Date()).getFullYear(); | |
| function init(num) { | |
| num = (typeof num !== 'number' ? 0 : num); | |
| if(num === 0) { | |
| $('<div/>').css({ | |
| position: 'fixed', | |
| left: 0, | |
| top: 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
| $ wget http://nginx.org/keys/nginx_signing.key | |
| $ sudo apt-key add nginx_signing.key | |
| $ sudo su | |
| # echo 'deb http://nginx.org/packages/mainline/ubuntu/ xenial nginx' >> /etc/apt/sources.list.d/nginx.list | |
| # echo 'deb-src http://nginx.org/packages/mainline/ubuntu/ xenial nginx' >> /etc/apt/sources.list.d/nginx.list | |
| # apt-get update | |
| # apt-get install unit |
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
| command arg1 arg2 |
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
| module.exports = { | |
| "heat":"[エアコン暖房ボタンの赤外線信号]", | |
| "cool":"[エアコン冷房ボタンの赤外線信号]", | |
| "airoff":"[エアコンオフボタンの赤外線信号]", | |
| "tv":"[テレビ電源の赤外線信号]" , | |
| "light":"[ライトの赤外線信号]" | |
| }; |