Skip to content

Instantly share code, notes, and snippets.

while Username_entered != Username_stored:
Username_entered = input()
if Username_entered == Username_stored:
break
print ("\nERROR! You have entered the incorrect username. Please enter the correct username.")
PasswordLogIn()
// Java code for thread creation by extending
// the Thread class
class MultithreadingDemo extends Thread
{
public void run()
{
try
{
// Displaying the thread that is running
System.out.println ("Thread " +
@Echocage
Echocage / test.java
Last active February 22, 2018 20:54
package com.vencillio.rs2.content.dialogue.impl;
import com.vencillio.core.util.Utility;
import com.vencillio.rs2.content.dialogue.DialogueManager;
import com.vencillio.rs2.content.dialogue.Emotion;
import com.vencillio.rs2.entity.item.Item;
import com.vencillio.rs2.entity.player.Player;
import com.vencillio.rs2.entity.player.net.out.impl.SendMessage;
/**
package com.vencillio.rs2.content.dialogue.impl;
import com.vencillio.core.util.Utility;
import com.vencillio.rs2.content.dialogue.DialogueManager;
import com.vencillio.rs2.content.dialogue.Emotion;
import com.vencillio.rs2.entity.item.Item;
import com.vencillio.rs2.entity.player.Player;
import com.vencillio.rs2.entity.player.net.out.impl.SendMessage;
/**
$text = "this is test sentence to see if this works";
$source = "auto";
$target = "pl";
$regex = '/"([^+,+$]+)"/';
$textEncode = urlencode($text);
$response = file_get_contents("http://translate.googleapis.com/translate_a/single?client=gtx&sl=auto&tl=$target&dt=t&q=$textEncode");
$response = preg_replace('/,+/', ',', $response);
function timeLookup($name)
{
global $file;
$ptfile = fopen($file, 'r');
while ($line = fgets($ptfile)) {
$line = trim($line);
$arr = str_getcsv($line);
if ($arr[0] == $name) {
echo $arr[1];
return;
function recordStart($name)
{
global $startTimes;
$startTimes[$name] = time();
}
function recordStop($name)
{
global $startTimes, $file;
$stopTime = time();
$regex = "/\"([^.+,.+$]+)\"/";
$textEncode = urlencode("Hello world");
$file = file_get_contents("https://translate.googleapis.com/translate_a/single?client=gtx&sl=auto&tl=es&dt=t&q=$textEncode");
echo " $file\n";
$file = preg_match($regex, $file, $matches);
echo "matches: $matches[0]";