text stringlengths 14 410k | label int32 0 9 |
|---|---|
@Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
final MOB target=this.getTarget(mob,commands,givenTarget);
if(target==null)
return false;
if(!super.invoke(mob,commands,givenTarget,auto,asLevel))
return false;
final boolean success=prof... | 8 |
public boolean setField(int x, int y, char player) {
if (x > 4 || x < 1 || y > 4 || y < 1) {
return false;
} else {
for (int i = 1; i < field.length + 1; i++) {
for (int j = 1; j < field[i - 1].length + 1; j++) {
if (((i == y) && (j == x) && fi... | 9 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
return getBumoncode() == ((Bumon) obj).getBumoncode();
} | 1 |
protected Boolean tryCheckVLine5(boolean update) {
for (int i = 0; i < 6; i++) {
for (int j = 0; j < 6; j++) {
int count = (gemArray[i][j]);
if (j + 4 <= 5) {
if (count == gemArray[i][j + 1] && count == gemArray[i][j + 2] && count == gemArray[i][j ... | 8 |
public boolean equals(Pair o) {
return o.x == x && o.y == y;
} | 1 |
public static void setMatrix(int[][] matrix){
boolean[] row = new boolean[matrix.length];
boolean[] column = new boolean[matrix[0].length];
for(int i = 0; i < matrix.length; i++){
for(int j = 0; j < matrix[0].length;j++){
if(matrix[i][j] == 0){
row[i] = true;
column[j] = true;
}
}
}
... | 7 |
public void MakeMove(int r1, int c1, int r2, int c2)
{
this.cell[r2][c2] = this.cell[r1][c1];
this.cell[r1][c1] = CellEntry.empty;
// Promote To King
if(this.cell[r2][c2].equals(CellEntry.white) && r2==rows-1){
this.cell[r2][c2] = CellEntry.whiteKing;
... | 4 |
private boolean executarCommand(Operation op, Object object){
int updatedRows = -1;
switch(op){
case INSERIR:
updatedRows = inserir(object);
break;
case ATUALIZAR:
updatedRows = salvar(object);
break;
cas... | 5 |
@Override
public boolean evaluate(Work w) {
int i;
int j;
int limit;
int prime;
int number_of_primesX = 0;
int number_of_41primesX = 1;
int number_of_43primesX = 0;
System.out.println("Thread " + lc_omp.omp_get_thread_num() + ": " + w.start + " - " + w.end);
for (i = w.start; i <= w.end; i += 2)... | 8 |
public Object calculate(GraphModel g) {
SubGraph sg = new SubGraph();
int limit=r2.nextInt(g.getEdgesCount());
Vector<Integer> vi = new Vector<Integer>();
HashMap<Vertex,Vertex> vv= new HashMap<Vertex, Vertex>();
for(int i=0;i<g.getVerticesCount();i++) {
vi.add(i);
... | 8 |
private void quickSortDate(int low, int high) {
int i = low;
int j = high;
java.util.Date pivot = tabledata.get(low + (high - low) / 2).getOrder().getFullDate();
while (i <= j) {
while (tabledata.get(i).getOrder().getFullDate().before(pivot)) {
i++;
... | 6 |
public void rebuild() {
for (int x = 0; x < sizeX; x++) {
for (int y = 0; y < sizeY; y++) {
for (int z = 0; z < sizeZ; z++) {
vertices.add(new Vertex(new Vector3f(x, y, z + BLOCKSIZE)));
vertices.add(new Vertex(new Vector3f(x + BLOCKSIZE, y, z + BLOCKSIZE)));
vertices.add(new Vertex(new Vector3f... | 3 |
@Override
public void stateChanged(ChangeEvent args) {
if(args != null && args instanceof GetDatabySubjectPanelChangeEvent) {
try {
Document doc = this.getRequest().getDocument();
this.updateRequest(doc);
} catch (Exception e) {
// TODO: log this.
}
}
super.stateChanged(args);
try... | 7 |
public void run(){
try {
//SqlSession session = RequestDataSessionManager.getRequestSession();
//DataMapper mapper = session.getMapper(DataMapper.class);
JDBCConn();
//session.commit();
} catch (SQLException ex) {
Logger.getLogger(testDB.cla... | 1 |
private void populateWorld() {
for (int i = 0; i < this.size * CREATURES_ON_SQUARE; i++) {
Random random = new Random();
this.creatures.add(new Creature(square[0], random.nextInt(100), random.nextInt(100)));
System.out.println(this.creatures.get(i).toString());
}
... | 1 |
public void directionForce(final int x){
if(pointChargePosX >= particleXpos && pointChargePosY < particleYpos){
electroForce.setEndX((particleYpos+(particleCharge()*230))/slopeLine);
electroForce.setEndY(((slopeLine*particleXpos)-(particleCharge()*230)));
}
if(poin... | 6 |
private float[] getComputedWindow() {
int ix=(blockFlag?4:0)+(previousWindowFlag?2:0)+(nextWindowFlag?1:0);
float[] w=windows[ix];
if(w==null) {
w=new float[n];
for(int i=0;i<leftN;i++){
float x=(float)((i+.5)/leftN*Math.PI/2.);
x=(float)Math.sin(x);
x*... | 7 |
@Override
public void KeyDown(int key, char c) {
// TODO Auto-generated method stub
if(key == Input.KEY_F2) {
GameInfo.SHOW_DEBUG_INFO = !GameInfo.SHOW_DEBUG_INFO;
}
} | 1 |
@Override
public boolean tick(Tickable ticking, int tickID)
{
if((affected==null)
||(!(affected instanceof MOB))
||(((MOB)affected).amDead())
||(((MOB)affected).amFollowing()==null)
||(((MOB)affected).amFollowing().amDead())
||((hasFought)&&(!((MOB)affected).isInCombat())))
{
unInvoke();
return fa... | 8 |
private void populate()
{
if (isPopulated == false) {
for (int y = 0; y < gridSize; y++) {
for (int x = 0; x < gridSize; x++) {
squares[x][y] = new Square(this, x, y);
}
}
isPopulated = true;
}
} | 3 |
private void jButtonGuardarNovoFornecedorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonGuardarNovoFornecedorActionPerformed
// BOTAO GUARDAR NOVO FORNECEDOR -> JANELA NOVO FORNECEDOR
String nome = jTextFieldNomeFornecedor.getText();
String morada = jTextFieldMoradaFor... | 9 |
private void method289(InteractiveObject interactiveObject) {
for (int x = interactiveObject.x; x <= interactiveObject.anInt524; x++) {
for (int y = interactiveObject.y; y <= interactiveObject.anInt526; y++) {
GroundTile groundTile = groundTiles[interactiveObject.z][x][y];
if (groundTile != null) {
fo... | 7 |
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + (bgToOamPriority ? 1231 : 1237);
result = prime * result + (flipHorizontally ? 1231 : 1237);
result = prime * result + (flipVertically ? 1231 : 1237);
result = prime * result + ((palette == null) ... | 5 |
private int method465(Model model, int i)
{
int j = -1;
int k = model.anIntArray1627[i];
int l = model.anIntArray1628[i];
int i1 = model.anIntArray1629[i];
for(int j1 = 0; j1 < anInt1626; j1++)
{
if(k != anIntArray1627[j1] || l != anIntArray1628[j1] || i1 != anIntArray1629[j1])
continue;
j = j1;
... | 6 |
public Edge addPhraseStructureEdge(PhraseStructureNode parent, PhraseStructureNode child) throws MaltChainedException {
if (parent == null || child == null) {
throw new MaltChainedException("Parent or child node is missing in sentence "+getSentenceID());
} else if (parent.getBelongsToGraph() != this || child.get... | 7 |
public static Adventurer setupPlayer(){
Adventurer player;
Random r = new Random();
Scanner s = new Scanner(System.in);
System.out.println("New player! What will be your adventurer's name?");
String name = s.nextLine();
System.out.println("\nWelcome, " + name + "! Choose a class:\nA : Warrior\nB : Wizard\nC : Ro... | 8 |
void star2() {
int rows = 5;
for (int i = rows -1; i >= 0; i--){
for (int j = 0; j < i; j++){
System.out.print(" ");
}
for (int j = (rows - i) * 2 - 1; j > 0; j--){
System.out.print("*");
}
System.out.println();
... | 3 |
public void recall()
{
if(isReadOnly()) return;
try { fdbf.seek( recordpos() ); } catch (IOException e) {}
writeChars(0,1," "); deleted = false;
} | 2 |
public String addFile( String filename, String alt_filename, String mimetype, METSMetadata md ) throws Exception {
// read in the file
File fileobj = new File( filename );
InputStream is = new FileInputStream(fileobj);
long length = fileobj.length();
byte[] arr = new byte[ (int) length ];
// Read in the bytes
... | 3 |
public <V> Adapter.Setter<V> makeSetter(String methodName, Class<V> _class) {
try {
T version = (T) start.get().newVersion;
final Method method = version.getClass().getMethod(methodName, _class);
return new Adapter.Setter<V>() {
public void call(V value) {
try {
Trans... | 7 |
public static void read(String fileName) {
System.out.println("read start");
SAXBuilder builder = new SAXBuilder();
try {
Document document = builder.build(fileName);
Element root = document.getRootElement();
List<?> list = root.getChildren();
for (int i = 0; i < list.size(); i++) {
Element teache... | 4 |
public final void updateMode()
{
// WE'LL NEED THESE GUYS
Poseur singleton = Poseur.getPoseur();
PoseurStateManager state = singleton.getStateManager();
PoseurState mode = state.getMode();
PoseurFileManager fileManager = singleton.getFileManager();
// IN THIS MODE TH... | 7 |
private void buildTree(Document doc, Element root) {
doc.setXmlStandalone(true);
doc.setStrictErrorChecking(true);
doc.setXmlVersion("1.0");
Element subRoot;
Element e;
subRoot = createElement(doc, "Towns", null);
for(Town i: towns){
... | 2 |
public static void addIntegers(List<? super Integer> list){
list.add(new Integer(50));
} | 1 |
public static void main(String[] args) {
/* program to print the pattern
*
**
***
****
*/
for (int i=0;i<=5;i++)
{
for (int j=0;j<=i;j++)
System.out.print("*");
System.out.println("");
}
} | 2 |
@Test
public void testGitHubSignIn()
{
// I *could* put my actual name and password here, but for obvious security reasons,
// the only use case where I would would be if I had a test account, not a real one.
page.clickOnSignInButton();
SignInPage signInPage = PageFactory.initElements(webDriver, SignInPage... | 9 |
private Space[] getNeighbors(){
Space[] ret=new Space[4];
for (int i=0; i<ret.length;i++){
if (i==0){
if (!(_r==0)){
ret[i]=maze[_r-1][_c];
}
}
if (i==1){
if (!(_c==maze[0].length-1)){
ret[i]=maze[_r][_c+1];
}
}
if (i==2){
if (!(_r==maze.length-1)){
ret[i]=maze[_r+... | 9 |
public void testQuery(String query, int numCols)
{
// try the following
try {
// open the connection to the database
Connection connection =
DriverManager.getConnection(this.urlStr);
// create a statement
Statement statement = connection.createStatement();
... | 3 |
public static int countBacklinksOnRelation(Stella_Object self, Keyword kind, Surrogate relation) {
{ BacklinksIndex index = Logic.getBacklinksIndex(self);
Cons equivalents = (Stella_Object.isaP(self, Logic.SGT_LOGIC_LOGIC_OBJECT) ? ((LogicObject)(self)).variableValueInverse() : Stella.NIL);
int count = ... | 6 |
private ResTable_Entry readEntryTable(byte[] data, int offset) throws IOException {
// The exact type of entry depends on the size
int size = readUInt16(data, offset);
offset += 2;
ResTable_Entry entry;
if (size == 0x8)
entry = new ResTable_Entry();
else if (size == 0x10)
entry = new ResTable_Map_Entr... | 3 |
private static Holder runATrial(MetaboliteClass metabolite, String phyla, OtuWrapper wrapper, List<String> keys,
boolean scramble)
throws Exception
{
int otuIndex = wrapper.getIndexForOtuName(phyla);
HashMap<Integer, List<Double>> metaboliteMap = WriteTrialsForSVMLight.getMetabolites(metabolite, scramble);... | 9 |
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
while (in.hasNextInt()) {
int n = in.nextInt();
if ( (n % 2) == 0 ) {
System.out.println("2^? mod " + n + " = 1");
continue;
}
long s = 1;
boolean b = false;
for( int i = 1;i <n;i++) {
if ( (i * 2 % n... | 8 |
private void insertClusterSequence ( ClusterSequence cs, float offSet) {
//
int scoreIndex=0;
float clusterTime;
for ( int i=0; i < cs.getClusterNumber() ; i++ ) {
clusterTime=cs.getTimeAtStep(i)+offSet;
System.out.println(clusterTime+"eccolo");
for (int j=scoreIndex; j < score.getCl... | 8 |
public final double getTotalBeforeDiscount() {
double total = 0.0;
for (LineItem item : lineItems) {
total += item.getProductAmount();
}
return total;
} | 1 |
private void sort()
{
for(File f : rootDir.listFiles())
{
if(f.isDirectory() && !f.equals(outputDir))
{
for(File f1 : f.listFiles())
{
if(f1.isDirectory())
continue;
String[] split = f1.getName().split("\\.");
if(split.length > 1 && split[1].equalsIgnoreCase(extension... | 9 |
private void bNewActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bNewActionPerformed
TextEnterDialog dg = new TextEnterDialog(this, true);
dg.setLocationRelativeTo(this);
dg.setVisible(true);
if (dg.getReturnStatus() == TextEnterDialog.RET_ADD) {
mapShapes(... | 2 |
@Override
public String getDef() {
return convertToString(def);
} | 0 |
public void render()
{
for(GuiButton button : buttons)
{
button.render(g);
}
for(Particle p : particles)
{
p.render();
}
renderText(new Font("Arial", Font.BOLD, 18), Color.white, Game.WIDTH - 120, 15, "Frames: " + Game.getFPS());
renderText(new Font("Arial", Font.BOLD, 18), Color.white, Gam... | 2 |
public Vector toVector() {
Vector<E> vec = new Vector<E>(array.length);
for (int i = 0; i < array.length; i++) {
vec.addElement(array[i]);
}
return vec;
} | 1 |
public boolean matches(InventoryCrafting par1InventoryCrafting)
{
ArrayList var2 = new ArrayList(this.recipeItems);
for (int var3 = 0; var3 < 3; ++var3)
{
for (int var4 = 0; var4 < 3; ++var4)
{
ItemStack var5 = par1InventoryCrafting.getStackInRowAndCo... | 8 |
public synchronized void run() {
int temps;
this.grille.setScore(this.grille.getScore() + 1); // des qu'une piece est placée sur le plateau, on augmente le score de 1
// tant que la partie n'est pas finie
while (!this.isFin()) {
// est ce qu'on triche ???
if (t... | 9 |
private boolean isInnerElement(TreeItem sourceTreeItem, Object investigationItem) {
boolean isInnerElement = false;
assert sourceTreeItem != null;
if (investigationItem == null) {
return false;
}
if (sourceTreeItem == investigationItem) {
return true;
}
for (TreeItem childItem : sourceTr... | 3 |
public static void binarySearch(int[] arr, int data) {
if (arr.length < 1) {
System.out.println("null?");
return;
}
if (arr.length == 1) {
if (data == arr[0]) {
System.out.println("success.\t" + data + " -> arr[0]");
return;
... | 6 |
private void cherche_Base(){
ArrayList<Cellule> autour = curent.env.getenv(curent);
for (int i =0 ; i<autour.size() ; i++){
if (autour.get(i).objet != null){
if((autour.get(i).objet instanceof Forum)){
Forum b =(Forum ) autour.get(i).objet;
if (this.al != b.al && !b.perdu){
if (!this.a... | 6 |
public void stop(){
if(running){
running = false;
try {
serverSocket.close();
} catch (IOException e) {
LOG.error("stop process server error", e);
System.exit(-1);
}
}
} | 2 |
@Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof ReverseLookupList)) {
return false;
}
final ReverseLookupList<?> other = (ReverseLookupList<?>) obj;
if (decorated == null) {
if (other.decorated != ... | 8 |
public void setStation(Station value) {
this._station = value;
} | 0 |
public void InsertarDocumento(ArrayList datos)
{
// Cambiamos todos los datos, que se puedan cambiar, a minúsculas
for(int i = 0 ; i < datos.size() ; i++)
{
try{datos.set(i, datos.get(i).toString().toLowerCase());}
catch(Exception e){}
}
biblioteca.ins... | 2 |
public void setX(double x) {
this.x = x;
} | 0 |
public void run() {
ServerSocket serversocket = null;
Socket s;
InputStreamReader input;
BufferedReader b;
PrintWriter p;
String message = null;
boolean done = false;
try {
serversocket = new ServerSocket(Utils.FAULTMNGR_PORT, 1); /* backlog is 1 */
serversocket.setSoTimeout(0);
} catch (IOEx... | 6 |
public void handleClick(int button) {
switch (button) {
case 1:
state = State.OBSTACLE;
break;
case 2:
state = State.START;
break;
case 3:
state = State.END;
break;
def... | 3 |
public Ast.AstSchemaExpression parse_SchemaExpression(SpecObject specObject, String property)
{
int at = m_current;
if (!ok())
{
return null;
}
int tat;
if (next(TozeTokenizer.TOKEN_ALL))
{
Ast.AstForAllS node = m_ast.new A... | 7 |
public String getMessage() {
return " a";
} | 0 |
private static void loadAllTheCardImagesFromFileNames(String[] cardImageFileNames, MediaTracker tracker) {
String curDir = System.getProperty("user.dir");
Image pic;
for (int i=0; i < cardImageFileNames.length; i++) {
pic = Toolkit.getDefaultToolkit().getImage(curDir + "/cla... | 2 |
public int getPlayersPatronXP(String playerName) {
int patronsXP = 0;
String SQL = "SELECT `XP` " + " FROM " + tblAllegiance + " WHERE `player` LIKE ?";
Connection con = getSQLConnection();
try {
PreparedStatement statement = con.prepareStatement(SQL);
statement.setString(1, playerName);
ResultSet ... | 2 |
private static void insertionSort(int[] num) {
int j;
int key;
int i;
for (j = 1; j < num.length; j++) {
key = num[ j ];
for(i = j - 1; (i >= 0) && (num[ i ] >= key); i--) {
num[ i+1 ] = num[ i ];
}
iSwaps++;
num[ i+1 ... | 3 |
public Node findLoopStart(Node head) {
Node fast = head;
Node slow = head;
while (fast != null && fast.next != null) {
fast = fast.next.next;
slow = slow.next;
if (fast == slow) {
break;
}
}
if (fast != slow)
return null;
slow = head;
while (slow != null && fast != null) {
if (slo... | 7 |
public void addCard(Card card, boolean position) {
if (position == TOP) {
cardPile.addFirst(card);
}
else {
cardPile.addLast(card);
}
if (component != null) {
component.updateTopCard();
}
} | 2 |
public int getId() {
return id;
} | 0 |
public static boolean isVersionGreaterThan(String isThis, String greaterThanThis){
int A[] = parseVersion(isThis);
int B[] = parseVersion(greaterThanThis);
if(A[0] > B[0]){
return true;
}
if(A[0] == B[0]){
if(A[1] > B[1]){
return true;
}
if(A[1] == B[1]){
if(A[2] > B[2]){
return true;... | 7 |
public LRParseTableAction(GrammarEnvironment environment) {
super("Build SLR(1) Parse Table", null);
this.environment = environment;
this.frame = Universe.frameForEnvironment(environment);
} | 0 |
public static boolean isValidationKeyPressed(){
return (keyState[SPACE] && !prevKeyState[SPACE]) || (keyState[ENTER] && !prevKeyState[ENTER]);
} | 3 |
@Override
public final void connect() throws CommunicationError, ConnectionException {
synchronized(_lock) {
if(_isConnected) {
throw new RuntimeException("Verbindung zum Datenverteiler besteht bereits.");
}
if(_dataModelConnection != null) {
_dataModelConnection.connect();
_dataModel = _dataMod... | 9 |
public AuctionOntology() {
super(ONTOLOGY_NAME, BasicOntology.getInstance());
try {
//Add Concepts
ConceptSchema cs = new ConceptSchema(GOOD);
add(cs, Good.class);
cs.add(GOOD_NAME, (PrimitiveSchema) getSchema(BasicOntology.STRING), ObjectSchema.MANDATORY);
cs.add(GOOD_PRICE, (PrimitiveSchema)... | 1 |
@Override
protected Element getSpecificDataXML() {
Element e = new Element("Album");
if (coverUrl != null) e.setAttribute("coverUrl", coverUrl.toString());
// if (moreInfo != null) e.setAttribute("moreInfo", moreInfo);
return e;
} | 1 |
private Point[] chooseRandomCentres(int k, int n, int d, Point points[]) {
//array to store the choosen centres
Point[] centres = new Point[k];
//choose the first centre (each point has the same probability of being choosen)
int i = 0;
int next = 0;
int j = 0;
... | 9 |
@Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
final MOB target=this.getTarget(mob,commands,givenTarget);
if(target==null)
return false;
if(!super.invoke(mob,commands,givenTarget,auto,asLevel))
return false;
final boolean success=prof... | 8 |
public static double Distance2Objects (ABObject o1, ABObject o2)
{
List<Point2D> pointsO1 = MathFunctions.getObjectContourPoints(o1);
List<Point2D> pointsO2 = MathFunctions.getObjectContourPoints(o2);
double error_distance = 2.0;
double min_distance = 999.0;
for (int i = 0; i < pointsO1.size(); i++)
{
... | 4 |
private void parseType() throws SyntaxError {
switch(currentToken.kind) {
case Token.BOOLEAN:
case Token.VOID:
acceptIt();
break;
case Token.IDENTIFIER:
parseIdentifier();
if(currentToken.kind == Token.LBRACKET) {
acceptIt(... | 6 |
private static void selectionSort(Items[] items) {
for (int pass = 0; pass < items.length-1; pass++) {
// System.out.println(pass + "-" + items[pass]);
int indexOfTarget = pass;
int indexOfSmallest = indexOfTarget;
for (int j = indexOfTarget+1; j < items.length; j... | 3 |
public void validate(){
if ( personBean.getFirstName().length() == 0 ){
addFieldError( "personBean.firstName", "First name is required." );
}
if ( personBean.getEmail().length() == 0 ){
addFieldError( "perso... | 3 |
@SuppressWarnings("rawtypes")
@Override
public boolean equals(Object obj) {
if (this == obj) return true;
if (obj == null) return false;
if (getClass() != obj.getClass()) return false;
NameValuePair other = (NameValuePair) obj;
if (k == null) {
if (other.k != null) return false;
} else if (!k.equals(ot... | 9 |
public void draw(UShape shape) {
// System.err.println("inter=" + shape.getClass());
if (shape instanceof Ftile) {
final Ftile tile = (Ftile) shape;
final Set<Swimlane> swinlanes = tile.getSwimlanes();
final boolean contained = swinlanes.contains(swimlane);
if (contained) {
tile.drawU(this);
// ... | 9 |
@Override
protected void idle() {
boolean moved=false;
switch(facing) {
case UP: moved=move(x, y-1); break;
case DOWN: moved=move(x, y+1); break;
case LEFT: moved=move(x-1, y); break;
case RIGHT: moved=move(x+1, y); break;
}
Random r = new Random();
if(!moved || r.nextInt(8) == 0)
facing = r.nextI... | 6 |
public final Instruction getPrevByAddr() {
if (prevByAddr.opcode == opc_impdep1)
return null;
return prevByAddr;
} | 1 |
private static void recursiveParse(Corpus corpus, Element element, boolean includeTokensWithNonAToZ) {
NodeList nodeList = element.getChildNodes();
for (int i=0; i<nodeList.getLength(); i++) {
Node node = nodeList.item(i);
if (node instanceof Element) {
Element el = (Element) node;
switch (el.getN... | 8 |
public long getSequence() {
return this._sequence;
} | 0 |
public static void main(String[] args)
{
int index = 0;
URL url = Driver.class.getResource("kap1.txt");
In input = new In(url);
TwoThreeTree<String, Value> tree = new TwoThreeTree<String, Value>();
Value v = null;
while (!input.isEmpty())
{
String line = input.readLi... | 9 |
private static int skipUTF8Char(byte b){
if((byte)(b&0x80)==0) return 1;
if((byte)(b&0xe0)==(byte)0xc0) return 2;
if((byte)(b&0xf0)==(byte)0xe0) return 3;
return 1;
} | 3 |
@Test
public void coloursWhenShapeRotates() {
BoardGui board = new BoardGui(30, 10);
board.addNewShape(new LShape());
board.getBoard().rotateShapeAntiClockwise();
int[][] cells = board.getBoard().mapper.getShape().getLayoutArray();
for (int row = 0; row < cells.length; row++)... | 3 |
public static void main(String[] args)
{
BaseSetting bs = new BaseSetting();
Wording w = new Wording("Je suis un énoncé", new Object[10]);
if (w != null) {System.out.println("WORDING NOT NULL");}
// INSERTION WORDING
w.insert(bs);
i... | 5 |
static void tune(Instrument instrument) {
instrument.play(Note.C_SHARP);
} | 0 |
@SuppressWarnings("unchecked")
private ClassNode newConcreteTrait(final TraitInfo info) {
final Type interfaceType = Type.getType(info.getInterfase());
final Type superType = Type.getType(info.getImplementation());
final String implName = superType.getInternalName();
final ClassNode cn = new ClassNode();
fin... | 8 |
public PlayerNumber winner() {
// @@@ quit function use
if (someoneQuit) {
return onePlayerLeft;
}
if (containsInt(moves1, 2) && containsInt(moves1, 5)
&& (movesLeft() != 0)) {
return FIRST_PLAYER;
}
if (containsInt(moves2, 2) && containsInt(moves2, 5)
&& (movesLeft() != 0)) {
return SECOND... | 8 |
private void jBtnSubmitModActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnSubmitModActionPerformed
DateFormat df = new SimpleDateFormat("M/d/yy", Locale.ENGLISH);
DateFormat tf = new SimpleDateFormat("h:mm a", Locale.ENGLISH);
CourseSection section;
ArrayList<MeetingDay> d... | 8 |
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String line = "";
StringBuilder out = new StringBuilder();
fillBox(1000);
while ((line = in.readLine()) != null && line.length() != 0) {
int nCase = Integer.parseInt(line.tr... | 3 |
public void register(HttpServletRequest request, HttpServletResponse response) {
try{
//request.setCharacterEncoding("UTF-8");
//response.setCharacterEncoding("UTF-8");
//JSPȡûϢ
String name = new String(request.getParameter("username").getBytes("ISO-8859-1"),"UTF-8");
String pass =request.getParameter(... | 5 |
public void caseAVariableOccursFixedOrVariable(AVariableOccursFixedOrVariable node)
{
inAVariableOccursFixedOrVariable(node);
if(node.getDataName() != null)
{
node.getDataName().apply(this);
}
if(node.getOn() != null)
{
node.getOn().apply(this)... | 7 |
public void buildXmlDocument() throws Exception {
System.out.println(entryList);
System.out.println(file);
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document doc = builder.newDocument();
... | 3 |
public static void main(String[] args) {
NKeyMap<String, String> map = new NKeyHashMap<String, String>();
for(int i = 0; i < 3; i++){
Double longitude = Math.random();
String latitude = ""+Math.random();
String height = ""+Math.random();
String value = "I am multi key value longitude: '" + longit... | 4 |
Subsets and Splits
SQL Console for giganticode/java-cmpx-v1
The query retrieves a limited number of text entries within a specific length range, providing basic filtering but minimal analytical insight.