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
| jdk1.7.0/bin/jstat -gccapacity 9043 | tail -n 1 | awk '{ print $4, $5, $6, $10 }' | python -c "import sys; nums = [x.split(' ') for x in sys.stdin.readlines()]; print(str(sum([float(x) for x in nums[0]]) / 1024.0) + ' mb');" |
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
| TServerTransport serverTransport = new TServerSocket(port); | |
| TThreadPoolServer.Args a = new TThreadPoolServer.Args(serverTransport).processor(processor); | |
| a.maxWorkerThreads(5); | |
| TThreadPoolServer server = new TThreadPoolServer(a); | |
| return server; |
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 points = [[-200,-200],[200,-200],[200,200],[-200,200]], | |
| lines = _(points).zip(rot(1, points)).map(function (x) { | |
| var a = x[0], b = x[1]; | |
| return makeLine(a[0], a[1], b[0], b[1], 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
| var rot = function (n, l) { return l.slice(n).concat(l.slice(0,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
| var f = function (l) { | |
| var paired = [], | |
| previous = 0; | |
| for (var i = 1; i < l.length; i++) { | |
| paired.push([l[previous], l[i]]); | |
| previous++; | |
| } | |
| paired.push([previous,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
| var _ = require("underscore"), | |
| assert = require("assert"); | |
| describe("Djikstra", function () { | |
| var links = [ | |
| {from:"1",to:"2",cost:7}, | |
| {from:"2",to:"1",cost:7}, | |
| {from:"2",to:"3",cost:15}, | |
| {from:"3",to:"2",cost:15}, |
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
| zypper ar http://download.opensuse.org/distribution/11.3/repo/oss/ oss | |
| zypper ar http://download.opensuse.org/distribution/11.3/repo/non-oss/ non-oss | |
| zypper refresh --services |
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
| public void testHeaders() throws Exception { | |
| router.on("/testHeaders").put(new F<Request, Response> () { | |
| @Override | |
| public Response f(Request a) { | |
| System.out.println(a.headers.keySet()); | |
| Assert.assertEquals("application/json; charset=UTF8", a.headers.get("Content-Type")); | |
| Assert.assertEquals("MyUserAgent", a.headers.get("User-Agent")); | |
| Assert.assertTrue("Check authentication is http basic auth", a.headers.get("Authorization").contains("Basic ")); | |
| return Response.custom(200, Maps.<String,String>newHashMap(), "<html>Custom response content</html>"); |
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
| 200 | |
| Server: Alcatel-Lucent OSP 2.4 | |
| Content-Type: text/xml; charset=utf-8 | |
| Content-Length: 18266 | |
| Connection: close | |
| Set-Cookie: OSP_Ref=0000000517800056;Domain=10.100.75.12:8088;Path=/pfmaccess | |
| <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:osp="urn:OSP_methods"> | |
| <SOAP-ENV:Body> |