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 Application { | |
private interface Interface1 { | |
void method1(); | |
} | |
private interface Interface2 { | |
void method2(); | |
} |
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
class RandomTransformer { | |
private int lastReturned = 0; | |
public int rand10() { | |
lastReturned = ((lastReturned + rand7()) % 10) + 1; | |
return lastReturned; | |
} | |
} |
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 class StringTo2DArray implements Function<String, int[][]> { | |
@Override | |
public int[][] apply(String s) { | |
String trimmed = s.trim(); | |
String arraysString = s.substring(1, trimmed.length() - 1); | |
String[] arrays = arraysString.replaceAll("]\\s*,\\s*\\[", "]\n[") | |
.split("\n"); |
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
[ | |
{ | |
"title": "Pirates of the Caribbean: Dead Man's Chest", | |
"tag_line": "Captain Jack is back.", | |
"plot_summary": "Jack Sparrow races to recover the heart of Davy Jones to avoid enslaving his soul to Jones' service, as other friends and foes seek the heart for their own agenda as well." | |
}, | |
{ | |
"title": "Pirates of the Caribbean: At World's End", | |
"tag_line": "At the End of the World, the Adventure Begins", | |
"plot_summary": "Captain Barbossa, Will Turner and Elizabeth Swann must sail off the edge of the map, navigate treachery and betrayal, find Jack Sparrow, and make their final alliances for one last decisive battle." |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
import time | |
import pprint | |
from selenium import webdriver | |
from browsermobproxy import Server | |
class Browser: | |
def __init__(self): | |
self.server = None | |
self.profile = None |
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 void main(String[] args) throws Exception { | |
int p = 43; // very large prime number | |
int q = 59; // very large prime number | |
int n = p * q; | |
int p1q1 = (p - 1) * (q - 1); | |
int e = 13; // gcd(e, p1a1) = 1 | |
String message = "HELLO"; | |
byte[] bytes = message.getBytes(); | |
for (int i = 0; i < bytes.length; i++) { |
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
import logging | |
logging.basicConfig(level=logging.DEBUG) | |
logger = logging.getLogger(__name__) | |
logger.debug('Hello, Logging!') |