This file contains 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
def bitwise(a, b) | |
array = [] | |
array_trunc = [] | |
for i in a..b do | |
array << i.to_s(2) | |
end | |
array.sort.reverse! | |
len = array[0].length |
This file contains 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
tab = [] | |
10.times { tab << rand(36) + 1 } | |
#max | |
max = tab[0] | |
tab.each do |x| | |
max = x if x > max | |
end |
This file contains 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 express = require("express"), | |
fs = require('fs'); | |
//database | |
var file = __dirname + "/public/test.db", | |
exists = fs.existsSync(file), | |
sqlite3 = require("sqlite3").verbose(), | |
db = new sqlite3.Database(file); | |
//create table Data with key and value |
This file contains 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 express = require("express"), | |
url = require('url'); | |
var app = express(); | |
var data = {}; | |
app.get('/set', function(request, response) { | |
var queryData = request.query; | |
for (var i in queryData) { |
NewerOlder