id stringlengths 36 36 | text stringlengths 1 1.25M |
|---|---|
ad2b2445-0bdd-46b4-9cd3-596d7af1daf9 | public InputStream( java.io.InputStream in ) {
this( in, DECODE );
} // end constructor |
8b12e152-cd0a-403e-b2e9-5178424efc12 | public InputStream( java.io.InputStream in, int options ) {
super( in );
this.options = options; // Record for later
this.breakLines = (options & DO_BREAK_LINES) > 0;
this.encode = (options & ENCODE) > 0;
this.bufferLength = encode ? 4 : 3;
... |
487000f1-557a-46ba-b448-24dadbd02638 | @Override
public int read() throws java.io.IOException {
// Do we need to get data?
if( position < 0 ) {
if( encode ) {
byte[] b3 = new byte[3];
int numBinaryBytes = 0;
for( int i = 0; i < 3; i++ ) {
... |
bcc905b8-dd95-416f-873d-651f2b7e0cda | @Override
public int read( byte[] dest, int off, int len )
throws java.io.IOException {
int i;
int b;
for( i = 0; i < len; i++ ) {
b = read();
if( b >= 0 ) {
dest[off + i] = (byte) b;
}
... |
093a61d8-f513-419f-8dbb-187cae313cf7 | public OutputStream( java.io.OutputStream out ) {
this( out, ENCODE );
} // end constructor |
c96f51f3-de9d-459f-97b1-340829be580c | public OutputStream( java.io.OutputStream out, int options ) {
super( out );
this.breakLines = (options & DO_BREAK_LINES) != 0;
this.encode = (options & ENCODE) != 0;
this.bufferLength = encode ? 3 : 4;
this.buffer = new byte[ bufferLength ];
... |
4bfdb4e9-6b7b-4b84-9dcd-b77933009afe | @Override
public void write(int theByte)
throws java.io.IOException {
// Encoding suspended?
if( suspendEncoding ) {
this.out.write( theByte );
return;
} // end if: supsended
// Encode?
if( encode ) {
... |
9c3a7fcb-d79a-4d2d-a225-4671f4cd3821 | @Override
public void write( byte[] theBytes, int off, int len )
throws java.io.IOException {
// Encoding suspended?
if( suspendEncoding ) {
this.out.write( theBytes, off, len );
return;
} // end if: supsended
for( int i ... |
f27afc7f-ff4a-4c06-8a72-4671ee48dfc0 | public void flushBase64() throws java.io.IOException {
if( position > 0 ) {
if( encode ) {
out.write( encode3to4( b4, buffer, position, options ) );
position = 0;
} // end if: encoding
else {
throw... |
e2014df7-273a-4054-a8b0-a5d096529ac7 | @Override
public void close() throws java.io.IOException {
// 1. Ensure that pending characters are written
flushBase64();
// 2. Actually close the stream
// Base class both flushes and closes.
super.close();
buffer = null;
ou... |
6886c8fc-5e76-4c1e-8b14-69c7a899d55c | public void suspendEncoding() throws java.io.IOException {
flushBase64();
this.suspendEncoding = true;
} // end suspendEncoding |
d260d3a0-bdfd-4e06-8f4e-ee78746bf716 | public void resumeEncoding() {
this.suspendEncoding = false;
} // end resumeEncoding |
db3dd6a1-1c66-49ee-b5bb-b8237ae6d38f | private AndroidApplication() {
} |
66032583-ead6-41ba-9cc5-d45e83858ee9 | public AndroidApplication(String name, String image, String packageName,
String description, String category, String currency, Double price, Long fileBytes,
String minAnddroidVersion) {
this.image = image;
this.name = name;
this.package... |
777848b5-d8c4-48eb-b3db-716e43d5b9d8 | public String getImage() {
return this.image;
} |
65e2e0da-e18a-4cb8-bb3f-4e16e549f09a | public String getPackageName() {
return this.packageName;
} |
cb3ebae8-9893-4c55-b0bf-4e20efc00668 | public String getName() {
return this.name;
} |
1c3848bc-b7f4-4060-b106-3825e80be13e | public String getDescription() {
return this.description;
} |
96358618-526d-4fb6-9871-b28eca46b371 | public String getCategory() {
return this.category;
} |
20c9442c-b1b2-463e-b8c5-eb0f2b27cea8 | public String getDetailsUrl() {
return this.detailsUrl;
} |
b146bb66-d9b9-4276-87d9-5b0b439c8a51 | public Double getPrice() {
return this.price;
} |
be4a0967-0df6-46bf-a89d-e7b32d07cf15 | public String getCurrency() {
return this.currency;
} |
a3e156ac-0b11-4f71-b4a1-c2577b8373fc | public Long getFileBytes() {
return fileBytes;
} |
d0a92a43-7219-446b-bf1f-816f6c7e6156 | public String getMinAndroidVersion() {
return this.minAndroidVersion;
} |
e26f7a54-4a9f-4ab1-aecb-1e7c0cee79c2 | public String toString() {
return String.format("{\"name\": \"%s\", \"image\": \"%s\", \"packageName\": \"%s\", " +
"\"description\": \"%s\", \"detailsUrl\": \"%s\", \"category\": \"%s\", \"currency\": \"%s\"," +
"\"minAndroidVersion\": \"%s\", \"price\": \"%s\", \"fileBytes\": \... |
49cb6977-6f53-4b46-b3f7-29a26af03f0c | public static void main(String[] args) throws Exception {
if (args.length<1) {
System.out.println("java -jar AndoidMarketParser.jar <searchQuery>");
return;
}
String request = args[0];
List<AndroidApplication> returnData = AndroidMarketHandler.marketSearch(request... |
6c0af0b9-f711-451f-a053-b03d607ef2f5 | @Test
public void longNameInRequestTest() {
String request = "UFO hotseat";
List<AndroidApplication> returnData = AndroidMarketHandler.marketSearch(request);
assertNotNull(returnData);
assertEquals(returnData.size(), 1);
} |
6e06b8e6-c987-4e10-819e-888fa36e0b74 | @Test
public void getRequest() {
String request = "pname:com.fullfat.android.agentdash";
List<AndroidApplication> returnData = AndroidMarketHandler.marketSearch(request);
assertNotNull(returnData);
assertEquals(returnData.size(), 1);
} |
99a9c009-faba-4e07-9813-a6970df403be | @Test
public void getSize() {
String request = "pname:com.fullfat.android.agentdash";
List<AndroidApplication> returnData = AndroidMarketHandler.marketSearch(request);
assertNotNull(returnData);
assertFalse(returnData.isEmpty());
assertEquals(returnData.size(), 1);
... |
82da4330-6a99-4de8-af9a-e480d48876e1 | @Test
public void badRequest() {
String request = "pname:net.cachapa.libra31231231231231231";
List<AndroidApplication> returnData = AndroidMarketHandler.marketSearch(request);
assertNotNull(returnData);
assertTrue(returnData.isEmpty());
} |
a133aba3-15dc-46db-bcb7-5a2e1111b7e2 | @Test
public void requestWithoutSize() {
String request = "pname:net.cachapa.libra";
List<AndroidApplication> returnData = AndroidMarketHandler.marketSearch(request);
assertNotNull(returnData);
assertFalse(returnData.isEmpty());
assertEquals(returnData.size(), 1);
A... |
44c3dd58-a180-4ea2-a575-8c7ceefd2d14 | @Test
public void parserTest() {
String request = "pname:ru.yulagroup.book";
List<AndroidApplication> returnData = AndroidMarketHandler.marketSearch(request);
assertNotNull(returnData);
assertFalse(returnData.isEmpty());
assertEquals(returnData.size(), 1);
AndroidA... |
58cd6ed5-13ee-4a92-97d6-3e3988e619e7 | public HelloWorldResource(String template, String defaultName) {
this.template = template;
this.defaultName = defaultName;
this.counter = new AtomicLong();
} |
830581ee-1019-4085-bbfe-cdfb617e542e | @GET
@Timed
public Saying sayHello(@QueryParam("name") Optional<String> name) {
return new Saying(counter.incrementAndGet(), String.format(template,
name.or(defaultName)));
} |
e3b52e69-a9f5-4e19-a24f-03612f2ca9d5 | public static void main(String[] args) throws Exception {
new HelloWorldService().run(args);
} |
080ec78b-3a2c-4d44-8ec2-688bde857405 | @Override
public void initialize(Bootstrap<HelloWorldConfiguration> bootstrap) {
bootstrap.setName("hello-world");
} |
a252f996-c1a5-43e0-b77f-337195d29ceb | @Override
public void run(HelloWorldConfiguration configuration,
Environment environment) {
final String template = configuration.getTemplate();
final String defaultName = configuration.getDefaultName();
environment.addResource(new HelloWorldResource(template, defaultName));
... |
5cbaa07a-24f2-43da-a7a8-42f2c61d9742 | public TemplateHealthCheck(String template) {
super("template");
this.template = template;
} |
ec849b94-460f-4d7b-b1d7-4751148584f0 | @Override
protected Result check() throws Exception {
final String saying = String.format(template, "TEST");
if (!saying.contains("TEST")) {
return Result.unhealthy("template doesn't include a name");
}
return Result.healthy();
} |
2010390f-088c-473f-852e-7f1524ef55aa | public String getTemplate() {
return template;
} |
3651ed13-14e5-4acd-b07f-2274825e99e7 | public String getDefaultName() {
return defaultName;
} |
d0413d96-86f0-4e0e-84b6-302b67c3cc6b | public Saying(long id, String content) {
this.id = id;
this.content = content;
} |
a75f134d-05d5-4db9-a4ac-f339786325c2 | public long getId() {
return id;
} |
dcc3ced1-07da-4739-b299-b23c5aee08b1 | public String getContent() {
return content;
} |
c1eda9d3-2aae-4ac4-bd2d-a6a06d428b01 | public static void main(String[] args) throws Exception {
// The simple Jetty config here will serve static content from the
// webapp directory
String webappDirLocation = "src/main/webapp/";
// The port that we should run on can be set into an environment
// variable
//... |
9febec93-6320-4aa2-bdf4-62273a5d8c31 | @Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
PrintWriter out = resp.getWriter();
out.println("hello, world");
out.close();
} |
8e197dc9-6b42-4557-b984-0e37fe552775 | public ControleUniversal(InterfaceControleUniversal controle){
controle.executaSolicitacao();
} |
600d2887-c08f-4011-9932-be1c3e0741f0 | public static void main(String[] args) {
ControleUniversal controla;
controla = new ControleUniversal(new ComandCarroLigar());
controla = new ControleUniversal(new ComandCarroDesligar());
controla = new ControleUniversal(new CommandPortaoAbrir());
controla = new... |
ed30a516-0041-4937-8bbe-c37cdd53cd92 | public void DesligarCarro() {
System.out.println("babahbahbah - Carro Desligado");
} |
04447053-78ef-4374-b6c1-a7fe1472e4a9 | @Override
public void executaSolicitacao() {
this.DesligarCarro();
} |
87c865ff-24c0-406b-91a4-723811082417 | public void AbrirPortao(){
System.out.println("pi pi pi pi - Portão Aberto");
} |
9b4c96e6-807f-45cb-83fd-b2483a3ac469 | @Override
public void executaSolicitacao() {
this.AbrirPortao();
} |
5535fb3f-f22e-4610-aed2-2a4a056f7ce3 | public void executaSolicitacao(); |
a220499f-4ef3-46a9-bd9c-f050c2d61f4f | public void ligarExecutar() {
System.out.println("VRUMMMMMMMM - Caro Ligado");
} |
e42c11bd-5636-480b-879e-e593ed322b78 | @Override
public void executaSolicitacao() {
this.ligarExecutar();
} |
0ed062c8-6e24-4c1f-bc57-6f8aaf530315 | public void FecharPortao(){
System.out.println("Tan tan tan - Portão Fechado");
} |
43bea861-7afd-4512-a8a5-34318f280811 | @Override
public void executaSolicitacao() {
this.FecharPortao();
} |
bf6775ed-6052-4a96-9e4e-905117220ada | SlidingPuzzleBoard(final int colCount, final int rowCount) {
setStyle("-fx-background-color: #f3f3f3; "
+ "-fx-border-color: #f3f3f3; ");
cols = colCount;
rows = rowCount;
double gameBoardWidth = SlidingPuzzlePiece.getPuzzleSize() * colCount;
double gameBoardHei... |
a9896f06-2b4a-452c-a141-bb701e53c20f | public final int getCols() {
return cols;
} |
ffcf7b4a-642a-48be-82b5-8b99fc58ec3c | public final int getRows() {
return rows;
} |
41abd634-2ce8-49a8-a6ca-f89af407dfef | SlidingPuzzleField(final int col, final int row,
final double coordX, final double coordY) {
this.fieldCol = col;
this.fieldRow = row;
this.fieldCoordX = coordX;
this.fieldCoordY = coordY;
this.isFree = false;
} |
243c7efb-f4b3-44cc-8665-29ac113a8570 | public final int getFieldCol() {
return fieldCol;
} |
90f4ff76-1228-4c25-8447-fd08b188d24a | public final double getFieldCoordX() {
return fieldCoordX;
} |
839ac017-0105-4527-99de-83be935d89a0 | public final double getFieldCoordY() {
return fieldCoordY;
} |
8e04efd8-accb-4e95-9330-9bb808e167cb | public final int getFieldRow() {
return fieldRow;
} |
47b9b2ed-3181-4499-90ea-b9997ddd415d | public final boolean getFree() {
return isFree;
} |
aaf9738c-d30e-4691-8e91-cbcad2132c4e | public final void setFieldCol(final int newFieldCol) {
this.fieldCol = newFieldCol;
} |
58aefcb9-d08f-48d2-beed-f53a2ae7b05e | public final void setFieldCoordX(final double newFieldCoordX) {
this.fieldCoordX = newFieldCoordX;
} |
3e908086-3f5d-4476-af1f-789595622e91 | public final void setFieldCoordY(final double newFieldCoordY) {
this.fieldCoordY = newFieldCoordY;
} |
be16d397-9ff4-405b-9837-df404379941b | public final void setFieldRow(final int newFieldRow) {
this.fieldRow = newFieldRow;
} |
d086c9a0-e09b-49d1-8f0e-77f6a7a8a275 | public final void setFree(final boolean free) {
this.isFree = free;
} |
aa65db58-150d-4a99-9c89-e6dbbac9d715 | public static Vector<SlidingPuzzleHighscore> getPuzzleHighscores() {
return puzzleHighscores;
} |
3230d010-2f95-4892-9e11-969481110b62 | public static void readXML() throws Exception {
puzzleHighscores = new Vector<SlidingPuzzleHighscore>();
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document doc = builder.parse(new File("highscore.xml"... |
4d1ed2f4-e7b9-4db0-8d2b-c5545b9d5e2a | public static final void setPuzzleHighscores(
final Vector<SlidingPuzzleHighscore> newPuzzleHighscores) {
SlidingPuzzleHighscore.puzzleHighscores = newPuzzleHighscores;
} |
82d874fa-55e0-4b0d-8217-f16eac0fab19 | public static void writeXML() throws Exception {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document highScoreListe = builder.newDocument();
Element root = highScoreListe.createElement("root");
... |
4f475fbb-92b3-4543-b992-3346bf012c3e | SlidingPuzzleHighscore(final String newUserName,
final String newUserScore) {
this.userName = newUserName;
this.userScore = newUserScore;
puzzleHighscores.add(this);
} |
9933f644-2b5e-419c-b231-41c8ec2b5865 | public final String getUserName() {
return userName;
} |
ce10e6f0-84c6-4d97-8d5b-b731b42163e6 | public final String getUserScore() {
return userScore;
} |
284c8212-fba0-4852-b09a-4132c6c92171 | public final void setUserName(final String newUserName) {
this.userName = newUserName;
} |
52fc28d8-40fa-4606-a2d0-1ba6bcd8bd7d | public final void setUserScore(final String newUserScore) {
this.userScore = newUserScore;
} |
50d38809-4a14-4499-b6a7-0d63efdf8628 | public static void activateFields() {
for (final SlidingPuzzlePiece puzzleTeil : SlidingPuzzlePiece
.getPuzzlePiece()) {
puzzleTeil.setActive();
}
} |
c2fcec43-72ed-433d-b188-9a344df11b8c | public static Timeline getFlow() {
return flow;
} |
3b914e6d-7402-423f-ab4e-0155f1514f43 | public static SlidingPuzzleBoard getGameBoard() {
return gameBoard;
} |
62b11a26-3d89-4f20-b67b-3948ac65a5b3 | public static int getMergeProcedures() {
return mergeProcedures;
} |
1ab2c733-9098-4002-bdb9-2e215411cbcc | public static int getMoveCount() {
return moveCount;
} |
9bbbb897-68c1-4ee6-af9f-a04afa6c9dcc | public static Stage getThisStage() {
return thisStage;
} |
5c5e9f12-0184-4db3-9e80-807c42944011 | public static String getUserName() {
return userName;
} |
88e1a566-020a-4203-b6b1-453c9eda4986 | public static void hideOneField() {
int emptyIndex = randomDigit(1, SlidingPuzzlePiece.getPuzzlePiece()
.size());
SlidingPuzzlePiece.getPuzzlePiece().get(emptyIndex).setVisible(false);
SlidingPuzzlePiece.getPuzzlePiece().get(emptyIndex).getField()
.setFree(true);
... |
d164296c-beb8-4405-8a36-8df40184634f | public static void main(final String[] args) {
Application.launch(args);
} |
615aef40-ff88-452a-9144-f96f3f0473a9 | public static void puzzleReady() {
boolean isWin = true;
for (SlidingPuzzlePiece thisPiece
: SlidingPuzzlePiece.getPuzzlePiece()) {
if (thisPiece.getField().getFieldCoordX() != thisPiece.getRootX()) {
isWin = false;
}
if (thisPiece.getF... |
920ebc17-b548-4e22-8435-31d49d4a2eeb | public static int randomDigit(final int a, final int b) {
return (int) (Math.random() * (b - a) + a);
} |
8598e6f4-91b3-46fa-aa98-60fc54e347ae | public static void resetGameBoard() {
for (SlidingPuzzlePiece puzzleTeil : SlidingPuzzlePiece
.getPuzzlePiece()) {
if (puzzleTeil.getVisible() == null) {
puzzleTeil.setVisible(true);
}
}
} |
39ef2ada-7be7-4864-b5f9-0b983c8e3709 | public static void setFlow(final Timeline newFlow) {
SlidingPuzzleGame.flow = newFlow;
} |
e61025ac-7bce-46b5-99d3-5de5b1c96060 | public static void setGameBoard(final SlidingPuzzleBoard newGameBoard) {
SlidingPuzzleGame.gameBoard = newGameBoard;
} |
3e881671-a805-46b3-89b9-c663854e175d | public static void setMergeCount(final int mergeCount) {
SlidingPuzzleGame.mergeProcedures = mergeCount;
} |
462960f5-467d-48a1-940b-d382e35f3bf0 | public static void setMergeProcedures(final int newMergeProcedures) {
SlidingPuzzleGame.mergeProcedures = newMergeProcedures;
} |
ab77634a-e487-42bd-92af-8f472aab96e7 | public static void setMoveCount(final int newMoveCount) {
SlidingPuzzleGame.moveCount = newMoveCount;
} |
d6f2a5ef-b63d-471e-bf7b-07e5ce1897f8 | public static void setThisStage(final Stage newStage) {
SlidingPuzzleGame.thisStage = newStage;
} |
4b976145-f655-4769-8b3e-fda020d11258 | public static void setUserName(final String newUserName) {
SlidingPuzzleGame.userName = newUserName;
} |
90c63f12-9ebb-4d6a-aaf1-6c78703b4773 | public final Group createGameBoard() {
flow = new Timeline();
Group group = new Group();
Image image = new Image(getClass().
getResourceAsStream("socialite.jpg"));
int colCount = (int) (image.getWidth()
/ SlidingPuzzlePiece.getPuzzleSize());
int... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.