Skip to content

Instantly share code, notes, and snippets.

@neojou
neojou / TCPSocketServer.py
Created August 12, 2015 17:43
python : server show receive data
#!/usr/bin/env python
import sys, socket, SocketServer
class MyTCPHandler(SocketServer.BaseRequestHandler):
def handle(self):
self.data = self.request.recv(2**16)
while (self.data):
print self.data
@neojou
neojou / FileTreeModel.java
Created July 26, 2015 16:43
Java jpegviewer
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package jpegviewer;
import java.io.*;
import java.util.*;
import javax.swing.tree.*;
@neojou
neojou / HashMapExample.java
Created July 26, 2015 12:37
Java - HashMap example : to get the name of today's month
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package neo.example;
import java.util.*;
/**
@neojou
neojou / FindMaxTask.java
Created March 30, 2015 18:12
Java : Thread / callable example : to find out the max integer
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package neo.util;
import java.util.concurrent.Callable;
/**
@neojou
neojou / ball-bounce.lsl
Created March 22, 2015 10:53
second life : LSL : make ball bounce
default
{
on_rez(integer arg)
{
llResetScript();
llSetStatus(STATUS_PHYSICS, TRUE);
llSetStatus(STATUS_ROTATE_X | STATUS_ROTATE_Y | STATUS_ROTATE_Z, FALSE);
}
@neojou
neojou / teleport.lsl
Last active August 29, 2015 14:17
linden script for teleport in Second Life.
key teleportee;
default
{
state_entry()
{
//llSay(0, "Touch to teleport");
}
touch_start(integer total_num)
@neojou
neojou / FibonacciForkJoin.java
Last active July 22, 2017 22:52
Java : calculate Fibonacci number by using Java's ForkJoinPool and RecursiveTask
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package neo.app;
import java.util.concurrent.*;
class Fibonacci extends RecursiveTask<Long> {
@neojou
neojou / MyString.java
Created February 21, 2015 11:56
java : MyString : if the words reversed is the same as original
package neo.lang;
import java.lang.String;
import static java.lang.System.out;
/**
*
* @author neojou
*/
public class MyString {
@neojou
neojou / HourseJumpMap.java
Created February 15, 2015 18:50
Knight's Tour : 5x5 = 1728 : written in Java
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package nj.app.ai;
import static java.lang.System.out;
import java.util.*;
@neojou
neojou / Hanoi.java
Last active August 29, 2015 14:15
Hanoi program written in Java.
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package nj.app;
import java.util.*;
import static java.lang.System.in;
import static java.lang.System.out;