I hereby claim:
- I am jutonz on github.
- I am jutonz (https://keybase.io/jutonz) on keybase.
- I have a public key ASB4kgScwqq-AQAdN-YS6Cjtn9kajFex2zil_yfIYg6yugo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
import java.io.IOException; | |
import java.io.OutputStream; | |
import java.net.InetSocketAddress; | |
import java.util.Random; | |
import com.sun.net.httpserver.HttpExchange; | |
import com.sun.net.httpserver.HttpHandler; | |
import com.sun.net.httpserver.HttpServer; | |
public class Server { |
require "http/server" | |
port = 8080 | |
server = HTTP::Server.new(port) do |request| | |
HTTP::Response.ok "text/plain", "Hello, Ajita#{"a" * rand(20)}" | |
end | |
puts "Listening on localhost:#{port}" | |
server.listen |
package main | |
import ( | |
"fmt" | |
"time" | |
"io" | |
"net/http" | |
"math/rand" | |
"bytes" | |
) |
require 'webrick' | |
include WEBrick | |
port = 8080 | |
puts "Listening on http://#{Socket.gethostname}:#{port}" | |
server = HTTPServer.new(Port: port) | |
server.mount_proc "/" do |request, response| | |
response.body = "Hello, Ajita#{"a" * rand(20)}" |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
import java.util.Arrays; | |
/*------------------------------------------------------------------------- | |
// AUTHOR: James Bossio | |
// FILENAME: NumberCollection.java | |
// SPECIFICATION: | |
// FOR: CSE 110 | |
// TIME SPENT: 40 mins | |
//----------------------------------------------------------------------*/ |
public int findMax() | |
{ | |
//test | |
int max = numberArray[0]; | |
for (int i = 0; i < numberArray.length; i++) | |
{ | |
max = numberArray[i]; // You're overwriting your old max here. | |
if (numberArray[i] > max) | |
max = numberArray[i]; | |