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
WebSocket負荷テストの結果 | |
---- | |
Room2, Client1 = 10000 | |
Room2, Client2 = 10000 | |
Room3, Client1 = 3600 | |
Room3, Client2 = 3600 | |
Room4, Client1 = 5500 | |
Room4, Client2 = 5500 | |
Room5, Client1 = 10000 | |
Room5, Client2 = 10000 |
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
package herokuSamples.web.mail; | |
import java.util.List; | |
import java.util.ArrayList; | |
import java.util.Map; | |
import java.util.HashMap; | |
import java.io.UnsupportedEncodingException; | |
import java.io.InputStream; | |
import java.io.IOException; |
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
angular.module('directive') | |
.directive("spMaxlength", function() { | |
return { | |
restrict: 'A', | |
require: 'ngModel', | |
link: function(scope, elm, attrs, ctrl) { | |
var max = parseInt(attrs.spMaxlength || 0, 10); | |
ctrl.$parsers.unshift(function(viewValue) { | |
var len = viewValue ? viewValue.length - (viewValue.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g)||[]).length : 0; | |
if (len <= max) { |
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
module.exports = function (grunt) { | |
'use strict'; | |
function loadDependencies(deps) { | |
if (deps) { | |
for (var key in deps) { | |
if (key.indexOf("grunt-") == 0) { | |
grunt.loadNpmTasks(key); | |
} | |
} |
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 STR = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_!+-/.:"; | |
var INPUT = "JfnAmrOmaTrRr:lmiCLmgCUpmoRRF/yycf:T!ZC-yuFyLfZLUrRyORUcf:ROy-fOOTlfiLC-iCU:cfLy"; | |
var LOOP = 100000; | |
function adjust(n) { | |
while (n > 58) { | |
n -= 59; | |
} | |
while (n < 0) { | |
n += 59; |
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
"use strict"; | |
/* | |
CREATE TABLE users ( | |
id SERIAL PRIMARY KEY, | |
name VARCHAR(255) NOT NULL, | |
email VARCHAR(255) NULL, | |
github_username VARCHAR(255) NULL, | |
password VARCHAR(255) NULL, | |
image_url VARCHAR(255) NULL, |
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
scala> val a = "Jack" | |
a: String = Jack | |
scala> a.hello | |
<console>:9: error: value hello is not a member of String | |
a.hello | |
^ | |
scala> class B(s: String) { | |
| def hello = "Hello " + s |
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
// http://www.softantenna.com/wp/software/5-programming-problems/ | |
// Problem 5 | |
case class Expr(str: String, ret: Int) { | |
def plus(n: Int) = Expr(str + " + " + n, ret + n) | |
def minus(n: Int) = Expr(str + " - " + n, ret - n) | |
def concat(n: Int) = { | |
val next = last match { | |
case 0 => ret * 10 + n | |
case x if (x < 0) => ret - x + (x * 10) - n | |
case x if (x > 0) => ret - x + (x * 10) + n |
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
val c = Challenge.syntax("c") | |
val cr = ChallengeResult.syntax("cr") | |
val list = withSQL { | |
select( | |
c.result.*, | |
sqls"count(cr.id) as count" | |
).from(Challenge as c) | |
.leftJoin(ChallengeResult as cr) | |
.on(c.id, cr.challengeId) | |
.where(buildCondition(user.id, publicOnly)) |
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
SELECT | |
c.id, | |
count(cr.id) as count | |
FROM challenges c | |
LEFT OUTER JOIN exam_challenges ec ON (c.id = ec.challenge_id) | |
INNER JOIN exams e ON (ec.exam_id = e.id) | |
LEFT OUTER JOIN exam_delivers ed ON (ed.exam_id = e.id) | |
LEFT OUTER JOIN challenge_results cr ON (c.id = cr.challenge_id AND cr.deliver_id = ed.id) | |
WHERE c.user_id in (1) | |
GROUP BY c.id |
OlderNewer