This file contains 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
//DEBUG | |
sock.onmessage = function(message) //When the client hears from the server | |
{ | |
var msg = JSON.parse(message.data); //parse the JSON object to var msg | |
try | |
{ | |
if(msg.name != cName) //if this is for another player | |
{ | |
if(msg.func == 'updatePosition') //if that player movied | |
{ |
This file contains 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
Crafty.sprite(200, "img/clock.png", | |
{ | |
clock: [0,0,0,0] | |
}); | |
Crafty.sprite(128, "img/tiles2.png", | |
{ | |
grass: [0, 0, 1, 1], | |
stone: [1, 0, 1, 1], | |
tilled: [2, 0, 1, 1] |
This file contains 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
<? | |
if ($login) | |
{ | |
$id = $_SESSION['user']; | |
if (isset($_SESSION['LAST_ACTIVITY']) && (time() - $_SESSION['LAST_ACTIVITY'] > 3600)) | |
{ | |
// last request was more than 30 minutes ago | |
session_unset(); // unset $_SESSION variable for the run-time | |
session_destroy(); // destroy session data in storage |
This file contains 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
<?php | |
require 'master.php'; //sets obfuscated variables and connections | |
$userid = $_GET["userid"]; | |
mysqli_query("SET SESSION time_zone = '+00:00'"); | |
$query = "SELECT $dbuserid, $dbcell, ($dbduration - (time_to_sec(CURTIME()) - time_to_sec($dbstart))) as seconds, $dbcount, $dbactive FROM $dbusertable WHERE $dbactive = 0 AND $dbverified = 1 AND $dbclient = 1 AND CURTIME() > $dbstart AND (time_to_sec(CURTIME()) - duration) < time_to_sec($dbstart)"; | |
This file contains 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains 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 class MyRunnable implements Runnable { | |
private Data data; | |
public MyRunnable(Data _data) { | |
this.data = _data; | |
} | |
public void run() { | |
... | |
} | |
} |
This file contains 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
// show The Image | |
new DownloadImageTask((ImageView) findViewById(R.id.imageView1)) | |
.execute("http://java.sogeti.nl/JavaBlog/wp-content/uploads/2009/04/android_icon_256.png"); | |
} | |
public void onClick(View v) { | |
startActivity(new Intent(this, IndexActivity.class)); | |
finish(); | |
} |
This file contains 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
<link rel="import" href="../notification-elements/notification-alert.html"> | |
<link rel="import" href="../cool-clock/cool-clock.html"> | |
<link rel="import" href="../paper-toast/paper-toast.html"> | |
<link rel="import" href="../topeka-elements/category-icons.html"> | |
<link rel="import" href="../core-icon/core-icon.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> |
This file contains 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
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<link rel="import" href="../core-header-panel/core-header-panel.html"> | |
<link rel="import" href="../core-icons/core-icons.html"> | |
<link rel="import" href="../core-icon/core-icon.html"> | |
<link rel="import" href="../core-icons/av-icons.html"> | |
<link rel="import" href="../paper-fab/paper-fab.html"> | |
<polymer-element name="my-element"> |
This file contains 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 static TreeNode ToTreeNode(XmlDocument doc, string root = "root") | |
{ | |
TreeNode node = new TreeNode(root); | |
Nodify(node, doc.DocumentElement); | |
return node; | |
} | |
public static TreeNode ToTreeNode(string filename, string root = "root") | |
{ | |
var x = new XmlDocument(); |
OlderNewer