This file contains hidden or 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
private void login(String username, String password) | |
{ | |
LoginCredentials creds = new LoginCredentials(username, password); | |
AsyncAPI.getInstance().login(creds, new ITaskCallback() { | |
@Override | |
public void onResult(AbstractRunnable task) | |
{ | |
boolean success = task.getResult(); | |
if (success) { | |
Login.this.runOnUiThread(new Runnable() { |
This file contains hidden or 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
} else { | |
AlertDialog.Builder builder = new AlertDialog.Builder(this); | |
builder.setMessage("Login Failed!").setPositiveButton("OK", | |
new DialogInterface.OnClickListener() { | |
@Override | |
public void onClick(DialogInterface dialog, int id) | |
{ | |
dialog.dismiss(); | |
} | |
}); |
This file contains hidden or 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
import java.text.DecimalFormat; | |
import java.text.NumberFormat; | |
public static String formatBytes(long numBytes) | |
{ | |
NumberFormat formatter = new DecimalFormat("#.00"); | |
StringBuffer buffer = new StringBuffer(); | |
if (numBytes > 1024) { | |
if (numBytes >= 1073741824D) { | |
buffer.append(formatter.format((double) numBytes / 1073741824D)).append("GB"); |
This file contains hidden or 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
private void login(String username, String password) | |
{ | |
LoginCredentials creds = new LoginCredentials(username, password); | |
AsyncAPI.getInstance().login(this, creds, new ITaskCallback<Boolean>() { | |
@Override | |
public void onResult(AbstractRunnable<Boolean> task) | |
{ | |
handler.sendEmptyMessage(DISMISS_LOGIN_DIALOG); | |
boolean accountOK = false; |
This file contains hidden or 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
@Override | |
public void onResume() | |
{ | |
super.onResume(); | |
FavoritesController controller = FavoritesController.getInstance() | |
synchronized (controller) { | |
if (controller.isLoading()) { | |
try { | |
controller.wait(); | |
} catch (InterruptedException e) { |
This file contains hidden or 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 T | |
{ | |
private static final String FOO; | |
static { | |
FOO = "baz"; | |
} | |
public static void main(String[] args) | |
{ | |
System.out.println(FOO); |
This file contains hidden or 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
$mobileID = 0; | |
if ($mobileID == 'beta') { | |
error_log("shit bricks: " . $mobileID); | |
} | |
... | |
php test.php | |
shit bricks: 0 |
This file contains hidden or 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 T | |
{ | |
public static void main(String[] args) | |
{ | |
try { | |
dontCatchIt(); | |
} catch (IOException ioe) { | |
System.out.println("Caught IOException: " + ioe.getMessage()); | |
} catch (Exception e) { | |
System.out.println("Caught Exception: " + e.getMessage()); |
This file contains hidden or 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
class PrimeRun implements Runnable { | |
long minPrime; <!-- note not final! | |
PrimeRun(long minPrime) { | |
this.minPrime = minPrime; | |
} | |
public void run() { | |
// compute primes larger than minPrime | |
. . . | |
} |
This file contains hidden or 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 String getAddress() | |
{ | |
try { | |
readyLatch.await(); | |
} catch (InterruptedException inte) { | |
interrupt(); | |
} | |
synchronized (this) { | |
return address; | |
} |
OlderNewer