Skip to content

Instantly share code, notes, and snippets.

k2xl

Block or report user

Report or block k2xl

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am k2xl on github.
  • I am k2xl (https://keybase.io/k2xl) on keybase.
  • I have a public key ASBMOi1dbswQ7CItQm0ib--R4XU3bhtWTMSuAwEmVLMwZQo

To claim this, I am signing this object:

View JAVA HELP
var userChoice = prompt("Do you choose rock, paper or scissors?");
var computerChoice = Math.random();
if (computerChoice < 0.34) {
computerChoice = "rock";
} else if(computerChoice <= 0.67) {
computerChoice = "paper";
} else {
computerChoice = "scissors";
}
var compare=function(choice1,choice2){
View gist:5383208
var radiusOfEachCircle:Number = 50;
for (var n:int = 0; n < 10; n++)
{
var rad:Number = n>1?((radiusOfEachCircle)*Math.sin(Math.PI/n)):0;
trace(n+" circles = "+rad);
}
OUTPUT:
View gist:4773008
controls = new THREE.FlyControls(@camera,@canvas);
controls.movementSpeed = 1;
controls.domElement = @canvas;
controls.rollSpeed = 0.01;
controls.autoForward = false;
controls.dragToLook = true;
View gist:3808706
←[1m←[30m←[46m gems←[1m←[36m Enter your selection:←[0m 1
run bundle exec rake db:drop from "."
Couldn't drop myapp_development : #<PG::Error: could not connect to server: Connection refused (0x0000274D
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
>
View gist:3807814
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2/mysql2.rb:2:in `require': 193: %1 i
s not a valid Win32 application. - C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql
2/1.9/mysql2.so (LoadError)
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2/mysql2.rb:2:in `<top (
required)>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2.rb:9:in `require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2.rb:9:in `<top (require
d)>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/runtime.rb:68:in `require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/runtime.rb:68:in `block (2 level
View gist:1782187
/**
* @author Danny Miller k2xl@k2xl.com
*/
import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import backtype.storm.task.OutputCollector;
View gist:1507659
2011-12-21 20:25:58,797 [Thread-136] WARN backtype.storm.spout.KestrelSpout - Failed to read from Kestrel at localhost:22133
backtype.storm.spout.KestrelClient$ParseError: Kestrel Server Response: ERROR
at backtype.storm.spout.KestrelClient.parseDequeueOutput(KestrelClient.java:160)
View gist:1487198
public void nextTuple() {
ReceiveMessageRequest rmr = new ReceiveMessageRequest(myQueueUrl);
rmr.setMaxNumberOfMessages(10);
List<Message> messages = sqs.receiveMessage(rmr).getMessages();
for (final Message message : messages) {
collector.emit(new Values(message.getBody()), message.getReceiptHandle());
}
}
public void ack(Object msgId) {
sqs.deleteMessageAsync(new DeleteMessageRequest(myQueueUrl, "" + msgId));
View gist:1483798
public void nextTuple() {
ReceiveMessageRequest rmr = new ReceiveMessageRequest(myQueueUrl);
rmr.setMaxNumberOfMessages(10);
List<Message> messages = sqs.receiveMessage(rmr).getMessages();
for (final Message message : messages) {
// probably not the best idea to delete messages synchronously...
collector.emit(new Values(message.getBody()));
sqs.deleteMessage(new DeleteMessageRequest(myQueueUrl, message.getReceiptHandle()));
}
You can’t perform that action at this time.