params by 가니

<div class="hiddenDiv" style="display:none;"></div>


// create data string
var datas = new Array(some_value);
var data = "";
for(var i = 1; i <= datas.length; i++){
data += "param"+i+"="+datas[i-1]+"&";
}
data = data.substring(0, data.length-1);
jQuery.ajax({//Make the Ajax Request
type: "POST",
async: false,
url: "url",
data: data,
success: function(html){//html = the server response html code
$(".hiddenDiv").html(html);
}
});



...
<?php
include_once 'dbcon.php';

for($i = 1; ;$i++){
if( isset($_POST["param".$i]) ){
$params[$i] = mysql_real_escape_string($_POST["param".$i], $con);
}else{
break;
}
}
?>


...
<?php 

function echo_alert($msg){
echo "<script>alert('".$msg."');</script>";
}
function echo_script($msg){
echo "<script>".$msg."</script>";
}
?>

java file write by 가니

File file = new File("./abc.txt");
BufferedWriter out = new BufferedWriter(new FileWriter(file));
out.write("abc");
out.newLine();

...

out.close();

java websocket stop server and restart by 가니

https://github.com/TooTallNate/Java-WebSocket/issues/220


i met god. 

Found a solution, hope it doesnt destroy anything else:

Add selector.close() at the end of the run method in WebSocketServer:

finally {
if (decoders != null) {
for (WebSocketWorker w : decoders) {
w.interrupt();
}
}
if (server != null) {

            try {                selector.close();                server.close();            } catch (IOException e) {                onError(null, e);            }        }    }

java file read by 가니

BufferedReader in = new BufferedReader(new FileReader(args[0]));
String s;

while ((s = in.readLine()) != null) {
System.out.println(s);
}
in.close();

android EditText set cursor position by 가니

et1.setSelection(et1.getText().length());

1 2 3 4 5


Kany's Blog

닉네임 : 가니
메일 : vmxlf@naver.com

통계 위젯 (화이트)

00
4
29377