text stringlengths 14 410k | label int32 0 9 |
|---|---|
public SearchFilterTest() {
super(new File(new File("tests"), "work"));
} | 0 |
private boolean isASCII(byte[] data, int start) {
// look at the first 4 bytes
for (int i = start; i < start + 4; i++) {
// get the byte as a character
char c = (char) (data[i] & 0xff);
if (c >= '0' && c <= '9') {
continue;
} else if (c >=... | 7 |
private void syncDir(String pathname) {
File f = new File(pathname);
if (! f.getName().equals(SystemProperties.getInstance().getDatabaseName())) {
File[] listfiles = f.listFiles();
for (int i = 0; i < listfiles.length; i++) {
if (!stop) {
File item = listfiles[i];
if (! item.isHidden()) {
... | 5 |
public boolean getBoolean(int index) throws JSONException {
Object object = this.get(index);
if (object.equals(Boolean.FALSE) ||
(object instanceof String &&
((String)object).equalsIgnoreCase("false"))) {
return false;
} else if (object.equals(Boolean.... | 6 |
@Override
public boolean handle(Request request, Response response) {
// get the series
BasicSeries series = null;
try {
String id_ = request.path.substring(
request.path.lastIndexOf('/')+1);
int id = Integer.parseInt(id_);
Series s = Profile.getInstance()
.getSeries().getById(id);
if ... | 8 |
static public boolean validOptions(String[][] args, DocErrorReporter err) {
for (int i = 0; i < args.length; ++i) {
if (args[i][0].equals("-output")) {
outfile = args[i][1];
} else if (args[i][0].equals("-see")) {
refInlineName = args[i][1];
} else if (args[i][0].equals("-See")) {
refBlockName = ... | 4 |
private void fixTransitions() {
HashSet<SinglePair> actToDiscard = new HashSet<SinglePair>();
HashSet<SinglePair> obsToDiscard = new HashSet<SinglePair>();
for ( SinglePair sa : transitions[0].keySet() ) {
if ( rMatrix.get( sa ) == null ) {
actToDiscard.add( sa );
... | 7 |
public static void main(String argv[]) {
try {
File fXmlFile = new File("data/sp_data_school_day_1.gexf");
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
Document doc = dBuilder.parse(fXmlFile);
//optional, but recommend... | 3 |
public static void main(String args[]) {
/*
* Set the Nimbus look and feel
*/
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/*
* If Nimbus (introduced in Java SE 6) is not available, stay with the
* default look and fe... | 6 |
private String printWeapon(Weapon weapon) {
String wpn = "";
switch (weapon) {
case ROCK:
wpn = "rock";
break;
case PAPER:
wpn = "paper";
break;
case SCISSORS:
wpn = "scissor";
... | 3 |
void printRow() {
for (V v : vars) {
w.print(", " + v.valueString());
}
w.println();
} | 1 |
public void removeCodeAt(final int i) {
if (this.isDeleted) {
final String s = "Cannot change a field once it has been marked "
+ "for deletion";
throw new IllegalStateException(s);
}
code.remove(i);
this.setDirty(true);
} | 1 |
public ItemStack getItems(Inventory inv, ItemStack itemStack) {
ItemStack itemStackC;
int amount = itemStack.getAmount();
for (int x = 0; x < inv.getSize(); x++) {
if (amount == 0) {
break;
}
itemStackC = inv.getItem(x);
if (itemSta... | 8 |
protected boolean checkWin() {
if (players2.numWolves() == 0) // humans win
{
bot.sendMessage(gameChan, getFromFile("VILLAGERS-WIN", NARRATION));
bot.sendMessage(gameChan, getFromFile("CONGR-VILL", NARRATION));
} else if (players2.numWolves() * 2 >= players2.numAlive()) // wolves win
{
if (players2.num... | 3 |
protected void writeToStream(final InputStream in, final OutputStream out)
throws XMPPException
{
final byte[] b = new byte[BUFFER_SIZE];
int count = 0;
amountWritten = 0;
do {
// write to the output stream
try {
out.write(b, 0, count);
} catch (IOException e) {
throw new XMPPExce... | 7 |
static final boolean method2446(char c, byte i) {
if (i != 105)
anInt10503 = 124;
anInt10508++;
if ((c < 48 || c > 57)
&& ((c ^ 0xffffffff) > -66 || (c ^ 0xffffffff) < -91)
&& (c < 97 || c > 122))
return false;
return true;
} | 7 |
@Override
public boolean execute(Player player) {
if (!this.hasSecondWord()) {
GameEngine.gui.println("Drop what?");
return false;
}
String name = this.getSecondWord();
if (player.getInventory().hasItem(name))
{
player.getCurrentRoom().getI... | 2 |
public static JSONLiteral create(boolean value) {
return value ? TRUE : FALSE;
} | 1 |
public static boolean isInArray(String needle, boolean case_sensitive, String... haystack) {
if (case_sensitive) {
for (String s : haystack) {
if (needle.equals(s)) return true;
}
return false;
} else {
for (String s : haystack) {
if (needle.equalsIgnoreCase(s)) return true;
}
return false... | 5 |
private void unfilterPaeth(byte[] curLine, byte[] prevLine) {
final int bpp = this.bytesPerPixel;
int i;
for(i=1 ; i<=bpp ; ++i) {
curLine[i] += prevLine[i];
}
for(int n=curLine.length ; i<n ; ++i) {
int a = curLine[i - bpp] & 255;
int b = pre... | 8 |
public boolean equals( Object other ) {
if ( ! ( other instanceof TObjectFloatMap ) ) {
return false;
}
TObjectFloatMap that = ( TObjectFloatMap ) other;
if ( that.size() != this.size() ) {
return false;
}
try {
TObjectFloatIterator ite... | 8 |
public void testDefaultPassWord(){
Client c =Client.getInstance();
try {
c.connect(url,userName,userPassword);
} catch (XmlRpcException e) {
fail();
} finally {
try {
c.close();
} catch (XmlRpcException e) {
fail(e.getMessage());
}
}
} | 2 |
@Test
public void testClientMessagingNoPush() {
System.out.println("testClientMessagingNoPush");
try {
assertTrue(c.registerToServer(GlobalConstants.IP_LOOPBACK));
} catch (Exception ex) {
fail("Registration from client to server failed - " + ex);
}
... | 5 |
protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
if (!request.getParameterMap().isEmpty()) {
List<String> fouten = new ArrayList<>();
try {
long docentNr = Long
.parseLong(request.getParameter("docentNr"));
Docent docent = doc... | 4 |
protected void generateLanguageModel() {
double totalWord = 0;
for (_Doc d : m_corpus.getCollection()) {
if (d instanceof _ParentDoc)
continue;
_SparseFeature[] fv = d.getSparse();
for (int i = 0; i < fv.length; i++) {
int wid = fv[i].getIndex();
double val = fv[i].getValue();
totalWord +... | 5 |
protected void calcDIR_CrtDate() {
byte[] bTemp = new byte[2];
for (int i = 16;i < 18; i++) {
bTemp[i-16] = bytesOfFAT32Element[i];
}
Integer temp = byteArrayToInt(bTemp);
DIR_CrtDate = (temp & 0b11111) + "." + ((temp & 0b111100000) >> 5) + "." + (((... | 1 |
public void addFile(InputStream stream) throws InvalidMidiDataException, IOException {
Sequence seq = MidiSystem.getSequence(stream);
for( Track t : seq.getTracks()) {
for( int i = 0; i < t.size(); i++) {
MidiEvent event = t.get(i);
MidiMessage m = event.getMessage();
/*
* We do not wan... | 5 |
private void buildGamePlateau(String dataFilename)
{
HashMap<CouleurPropriete,Groupe> groups = new HashMap<>();
groups.put(CouleurPropriete.bleuCiel,new Groupe(CouleurPropriete.bleuCiel,50));
groups.put(CouleurPropriete.bleuFonce,new Groupe(CouleurPropriete.bleuFonce,200));
... | 9 |
public static Rule_CR parse(ParserContext context)
{
context.push("CR");
boolean parsed = true;
int s0 = context.index;
ArrayList<Rule> e0 = new ArrayList<Rule>();
Rule rule;
parsed = false;
if (!parsed)
{
{
ArrayList<Rule> e1 = new ArrayList<Rule>();
int s1 = c... | 7 |
public boolean executeMove(Board board) {
boolean success = false;
int h = Util.firstEmptyPosition(board, this.getCol());
//Check whether column is valid
if (!Util.isColumnValid(board, this.getCol()) ||
(h <= Util.ERRORTHRESHOLD) || (h >= board.getHeight())) {
success = false;
} else {
board.se... | 3 |
public static void main(String[] args) throws IOException{
Data data1 = new Data(10, 2, 2013);
Data data2 = new Data(11, 2, 2013);
Corrida corrida1 = new Corrida(1, 58, 58);
Corrida corrida2 = new Corrida(2, 58, 58);
Etapa etapa1 = new Etapa(data1, corrida1, "GP... | 4 |
private String parseTagComponent(Tokens tokens) {
String currentToken = tokens.getNextToken();
// keep parsing the file until we find the end of the component
while(!EOF(currentToken) && !(compare(currentToken,"cfcomponent") == 0 && compare(tokens.getPreviousToken(),"/") == 0)) {
currentToken = tokens.g... | 9 |
public SimulatedAnnealingOutput() {
super("Templado simulado");
initComponents();
s = dc.generateRandomSchedule(2, 3, 5, 6);
sched = dc.printScheme(0, 0, s);
for (RoomOutput[] sched1 : sched) {
for (int m = 0; m<sched[0].length; m++) {
a... | 2 |
private void preCheckInstruction() {
if (_captureMode && _captureOut != null) {
try {
// log in the same format as other emulators use to make an easier side-by-side comparison
// format is: ProcessCounter 3 bytes for Opcode Instruction (readable) (after value if stor... | 6 |
public void registerPlaceable(Placeable p) {
if (!placeables.containsKey(p.getId())) {
placeables.put(p.getId(), p);
}
} | 1 |
private void getDatabaseData(User user){
try
{
ArrayList<Activity> actList = factory.getActivities();
for(Activity activity : actList){
activities.put(activity.getKey(), activity);
}
plans = factory.getWorkoutPlansForUser(user);
for(WorkoutPlan plan : plans){
ArrayList<PlanElement> planEl... | 8 |
public boolean isBookable(){
return (capital!=null && intrest!=null && !isPayedOff());
} | 2 |
@Override
public void increaseComplexity() {
if (level == 6) {
SoundEffect.stopMusic();
levelType = LEVEL_MID;
SoundEffect.MUSIC_2.loop();
}
if (level == 11) {
SoundEffect.stopMusic();
levelType = LEVEL_COMPLEX;
SoundEffect.MUSIC_3.loop();
}
if (level == 19) {
if (!isWin)
winTextTime... | 4 |
public void calcScore(Frame [] frame, int [] accumScore, int frameNum) {
while (thisIndex <= frameNum) {
// Optimised by jwlee
int basic = addFirstSecond(frame[thisIndex]);
int bonus = 0;
if (frame[thisIndex].isStrike())
bonus = strikeBonus(frame, thisIndex, frameNum);
if (frame[thisIndex].isSpare... | 4 |
@Override
public void endElement(String uri, String localName, String qName) throws SAXException {
if (qName.equals("rowset")) {
if (requiredSkills) {
requiredSkills = false;
} else if (skillBonusCollection) {
skillBonusCollection = false;
} else if (skills) {
skills = false;
response.add(sk... | 8 |
private BottomPanel() {
//create leftmenu
leftMenu = new JList(menuOptions);
leftMenu.setPreferredSize(new Dimension(65,435));
leftMenu.setBorder(BorderFactory.createEtchedBorder());
leftMenu.setBackground(new Color(235,235,235));
leftMenu.setForeground(Color.BLACK);
JPanel menuLabel = new ... | 9 |
public void SetDirection(char newDirection)
{
this.direction = newDirection;
} | 0 |
public void newMixer( Mixer m )
{
if( myMixer != m )
{
try
{
if( clip != null )
clip.close();
else if( sourceDataLine != null )
sourceDataLine.close();
}
catch( SecurityException e... | 8 |
private boolean r_postlude() {
int among_var;
int v_1;
// repeat, line 75
replab0: while(true)
{
v_1 = cursor;
lab1: do {
// (, line 75
... | 8 |
public Rule(eGame gme) {
switch (gme) {
case FiveStud: {
this.MaxNumberOfPlayers = 4;
this.NumberOfCards = 5;
this.NumberOfJokers = 0;
this.CommunityCards = 0;
break;
}
case FiveStudOneJoker: {
this.MaxNumberOfPlayers = 4;
this.NumberOfCards = 5;
this.NumberOfJokers = 1;
this.Communit... | 9 |
public static boolean isValidUrl(String url) {
if (StringUtils.startsWith(url, "#"))
return false;
if (StringUtils.endsWithIgnoreCase(url, "jpg"))
return false;
if (StringUtils.endsWithIgnoreCase(url, "jpeg"))
return false;
if (StringUtils.endsWithIgn... | 9 |
@Override
public String listarElementos(Class<?> claseElemento) {
int contadorAux = 0, i = 0;
String retorno = "";
while (i < TAMANO_T && contadorAux < contadorRegistros) {
if (tabla[i] != null) {
IteradorLista iterador = tabla[i].getIteradorLista();
while (iterador.getNodoActual() != null) {
IKe... | 8 |
public String getName() {
return name;
} | 0 |
public Calculator(String exp) {
Stack<AbstractExpression> stack = new Stack<AbstractExpression>();
char chArray[] = exp.toCharArray();
AbstractExpression left = null;
AbstractExpression right = null;
for (int i = 0; i < chArray.length; ++i) {
switch (chArray[i]) {
... | 3 |
public void addArg(CLineArg arg) {
if(!args.containsKey(arg.getKey())) {
args.put(arg.getKey(), arg);
if(arg.isRequired()) {
reqBalance--;
}
}
} | 2 |
@Override
public void run() {
options.status = "Take ingots";
if (ctx.skillingInterface.isProductionInterfaceOpen()) {
ctx.skillingInterface.cancelProduction();
return;
}
if (ctx.skillingInterface.opened()) {
if (ctx.skillingInterface.getAction().equals("Take")) {
if (ctx.skillingInterface.selec... | 9 |
public String toString() {
String res = "HashMap :";
for (int i = 0 ; i < this.size() ; i++)
res += "\n\t" + this.keys.get(i) + "\t==>\t" + this.values.get(i);
return res;
} | 1 |
@Override
public void keyPressed(KeyEvent e) {
switch (e.getKeyCode()) {
case KeyEvent.VK_UP:
if(snake.getDirection() != Direction.DOWN)
snake.setDirection(Direction.UP);
break;
case KeyEvent.VK_DOWN:
if(snake.getDirection() != Direction.UP)
snake.setDirection(Direction.DOWN);
break;
case K... | 8 |
public Wall(Position position, int length, Direction direction) {
super(position);
if (length <2)
throw new IllegalArgumentException("Length has to be at least 2!");
if (direction == null)
throw new IllegalArgumentException("Direction can't be null!");
this.length = length;
this.direction = direct... | 2 |
public static Bookmark loadData() throws FileNotFoundException, IOException{
Bookmark loadedBookmark = null;
ObjectInputStream input = null;
//Open input stream
input = new ObjectInputStream(new FileInputStream("bookmarks.data"));
if(input != null){
//Read bookmark from file
Object obj = null;
tr... | 6 |
public static void validateConfiguration()
{
int err = 0;
if ((RUN_STATS == null) && (CONVERT_FA == null)) {
if (hadoopBasePath == null) { err++; System.err.println("ERROR: -out is required"); }
if (STARTSTAGE == null && hadoopReadPath == null) { err++; System.err.println("ERROR... | 8 |
private void VerbindenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_VerbindenActionPerformed
//Variable um den Thread bei Aufruf von "Trennen" anzuhalten und wieder zu starten. 1 heißt verbunden, 0 heißt getrennt
schleife=1;
//Variable damit Verbindung w... | 8 |
public void initDeck() {
for (int i = 0; i < deck.length; i++)
deck[i] = i;
} | 1 |
public static Object[][] dataForTable(DateTime beginDate, DateTime endDate, BigDecimal startingAmount, BigDecimal goal, int buttonChoice, ArrayList<BigDecimal> have)
{
int size = 0;
Object[][] data = null;
Model mod = new Model();
switch(buttonChoice)
{
case 1:
size = Model.weeks(Model.howMa... | 6 |
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://down... | 6 |
public static Connection establishConnection() {
// Connection string for your SQL Database server.
String connectionString = "jdbc:sqlserver://ah0sncq8yf.database.windows.net:1433"
+ ";"
+ "database=db_like"
+ ";"
+ "user=MySQLAdmin@ah0sncq8yf"
+ ";" + "password=almeta%6y";
Connection conne... | 2 |
private void doLoop() {
for (ITickable e: updateList) {
e.update(delta);
}
for(ITickable e: tempAddUpdateList){
updateList.add(e);
}
for (ITickable e: tempRemoveUpdateList) {
updateList.remove(e);
}
tempRemoveUpdateList = new ArrayList<ITickable>();
tempAddUpdateList = new ArrayList<ITickable>(... | 3 |
private void clearbutttonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_clearbutttonMouseClicked
// TODO add your handling code here:
editorarea.setText("");
}//GEN-LAST:event_clearbutttonMouseClicked | 0 |
public void setQuantityPurchased(int quantityPurchased) {
this.quantityPurchased = quantityPurchased;
} | 0 |
protected void calculateEdgeTiles(Point paramPoint, int paramInt)
{
int i = 0; int j = this.gridsize.width - 1; int k = 0; int m = this.gridsize.height - 1;
int n = Math.max(i, paramPoint.x - paramInt);
int i1 = Math.min(j, paramPoint.x + paramInt);
int i2 = Math.max(k, paramPoint.y - paramInt);
i... | 6 |
public static boolean validate(WidgetChild... wc) {
if (wc == null || wc.length == 0)
return false;
for (WidgetChild c : wc) {
if (c == null || !c.validate())
return false;
}
return true;
} | 5 |
public void addClass(Class<?> cls) {
if(cls.isArray() || cls.isAnnotation() || cls.isPrimitive()) {
return;
}
if(cls.isInterface()) {
interfaces.add(cls.getName().replace('.', '/'));
} else {
classes.add(cls.getName().replace('.', '/'));
}
} | 5 |
@Override
public String getText()
{
if((txt.getText() == null) || (txt.getText().equals("")))
return null;
else
return txt.getText();
} | 2 |
public boolean update(int n){
x = Math.min(x + n,xMax);
if (x<0)
x = 0;
return (x==xMax);
} | 1 |
public void afterPropertiesSet() throws Exception {
Assert.hasText(eventTypePackageName, "eventTypePackageName is must be specified");
Assert.notEmpty(statement, "statement is empty");
configuration = new Configuration();
configuration.addEventTypeAutoName(eventTypePackageName);
_instance = EPService... | 8 |
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
UserManager other = (UserManager) obj;
if (group... | 9 |
@Override
public Movie readFrom(Class<Movie> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException, WebApplicationException {
Movie movie = new Movie();
JsonParser parser = Json.createParser(ent... | 5 |
static final Entity method1353(int i, int i_4_, int i_5_,
Class var_class) {
Class357 class357
= Message.aClass357ArrayArrayArray2029[i][i_4_][i_5_];
if (class357 == null)
return null;
for (Class148 class148 = ((Class357) class357).aClass148_4396;
class148 != null;
class148 = ((Clas... | 5 |
private static void visitPointerLabelPlusReg(MemoryStateCreator mem, PointerLabelPlusRegContext tree) {
switch (tree.getChild(1).getText()) {
case "A":
mem.addRegisterA_pointerPlusLiteral(0); break;
case "B":
mem.addRegisterB_pointerPlusLiteral(0); break;
case "C":
mem.addRegisterC_pointerP... | 6 |
static double[][] inverse(double[][] A){
double[][] B;
double detA = det(A);
if(A.length == 1){
B = new double[1][1];
B[0][0] = 1/detA;
}else{
B = new double[A.length][A.length];
B = transpose(cofactor(A));
for(int i = 0; i < B.length; i++){
for(int j = 0; j < B.length; j++){
B[i][j] = B... | 3 |
public static void main(String[] args) throws ClassNotFoundException, UnsupportedLookAndFeelException, IllegalAccessException, InstantiationException
{
// UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
UIManager.setLookAndFeel(WebLookAndFeel.class.getName());
BrainPanel... | 0 |
static final void method607(int i, String[] strings, short[] is, int i_64_,
boolean bool) {
try {
if (bool != false)
aFloat1136 = 0.5791872F;
if (i > i_64_) {
int i_65_ = (i_64_ - -i) / 2;
int i_66_ = i_64_;
String string = strings[i_65_];
strings[i_65_] = strings[i];
strings[i] = string;
s... | 9 |
public void NotifyServerStatusChanged() {
for (IServerStatusChangedNotification sscn : serverStatusChangedNotificationListeners) {
sscn.onServerStatusChanged();
}
} | 1 |
void checkPoint() throws FileNotFoundException{
/*
* save the index
*/
PrintWriter indexSave = new PrintWriter(new File("testData/indexCheckpoint/index"));
Iterator<Entry<String, long[]>> iter = index.entrySet().iterator();
while(iter.hasNext()){
Entry<String, long[]> entry= iter.next();
ind... | 3 |
final static String getXYZFromMatrix(Matrix4f mat, boolean allPositive) {
String str = "";
float[] row = new float[4];
for (int i = 0; i < 3; i++) {
mat.getRow(i, row);
String term = "";
if (row[0] != 0)
term += (row[0] < 0 ? "-" : "+") + "x";
if (row[1] != 0)
term +=... | 9 |
public CEMILData request(final KNXAddress dst, final Configuration c)
{
final Cache cache = c.getCache();
if (cache == null || !(dst instanceof GroupAddress))
return null;
final LDataObject o = (LDataObject) cache.get(dst);
if (o == null)
return null;
// check if there is an expiration timeout for a st... | 8 |
private void openLink(String urlString) {
if (urlString.startsWith("www.")) {
urlString = "http://" + urlString;
}
try {
URL url = new URL(urlString);
URI uri = url.toURI();
Desktop desktop = Desktop.isDesktopSupported() ? Desktop.getDesktop() : null;
if (desktop != null && desktop.isS... | 7 |
@Override
public void run()
{
for (int i = 1; i < columns; i++)
{
for (int k = 0; k < frames; k++)
{
scrollToVisible(table, k, i);
if (result[i][k] == -1)
table.getModel().setValueAt("X", k, i);
else
table.getModel().setValueAt(result[i][k], k, i);
try {
if (!(propWin == n... | 6 |
public void issue_Age() { // This is the original function - just changed its name to issue_Age: issue oldest ready instructions first
int count = 0; //count the number of instructions to issue in current cycle
ROB_entry[] currentCycleIssuedInstr=new ROB_entry[machineWidth];
for (Iterat... | 9 |
public Annotation getAnnotation(String type) {
Annotation[] annotations = getAnnotations();
for (int i = 0; i < annotations.length; i++) {
if (annotations[i].getTypeName().equals(type))
return annotations[i];
}
return null;
} | 2 |
public static Bool valuseOf(Boolean isTrue) {
for (Bool bool : values()) {
if (Objects.equals(isTrue, bool.isTrue)) {
return bool;
}
}
return null;
} | 2 |
public static String getClearTitle(String row_text) {
String clearTitle = "", href_1, href_2;
for (Matcher m_href = p_wikiparen.matcher(row_text); m_href.find(); m_href = p_wikiparen
.matcher(clearTitle)) {
href_1 = m_href.group(2);
href_2 = m_href.group(3) == null ? href_1 : m_href.group(3);
clearTitl... | 3 |
private static void compareGbAudio(GbAudio a, GbAudio b) {
for (int i = 0; i < Math.min(a.soValues.length, b.soValues.length); i++) {
if (a.soValues[i] != b.soValues[i]) {
System.out.println("diff so " + i + ": " + a.soValues[i] + " " + b.soValues[i]);
break;
}
}
for (int i = 0;... | 4 |
private static Configuration readArgs(final String[] args) throws IOException
{
Configuration config = null;
String url = null; // you can set the destination as -site
String file = null; // name of the properties file
for (int i = 0; i < args.length; i++)
{
... | 7 |
@Override
public User getUserByID(String id) {
Connection conn = null;
PreparedStatement stmt = null;
User user = null;
ResultSet rs = null;
try {
conn = dataSource.getConnection();
stmt = conn.prepareStatement("SELECT USER_ID,USER_PASSWORD,USER_DATE F... | 8 |
public void actionPerformed(ActionEvent e) {
if (data.getPassedWordsIdList().size() < data.getWordList().size()) {
frame.getContentPane().removeAll();
frame.initComponents();
frame.repaint();
frame.revalidate();
}
else {
frame.getConten... | 1 |
public Object getValueAt(int row, int col) {
Movement movement = rekening.getBusinessObjects().get(row);
if (col == 0) {
return movement.getTransactionString();
} else if (col == 1) {
return Utils.toString(movement.getDate());
} else if (col == 2) {
if... | 6 |
public String getItemName(int itemSlot)
{
if(itemSlot > 5 || itemSlot < 0)
{
return null;
}
if(inv[itemSlot] == null)
return null;
return inv[itemSlot].getName();
} | 3 |
public PropertyManager(String filename) {
InputStream stream = PropertyManager.class.getClassLoader().getResourceAsStream(filename);
try {
PROPERTIES.load(stream);
} catch (IOException e) {
e.printStackTrace();
}
} | 1 |
@Override
public boolean recordDeath(Player player, String deathMsg, Location loc, String items, int exp) {
String data = deathMsg + "|" + Long.toString(System.currentTimeMillis()) + "|"
+ items + "|" + Integer.toString(exp) + "|" + loc.toString();
try {
ArrayList<String> l = (ArrayList<String>) this.co... | 1 |
@Override
public void paintComponent(Graphics g) {
super.paintComponent(g);
Graphics2D g2d = (Graphics2D)g;
int currentPass = 0;
int passesToComplete = 1;
for(Entity c : entities) {
if(c.renderPass < currentPass) {
currentPass = c.renderPass;
}
else if(c.renderPass > passesToComplete) {
pass... | 6 |
public Cliente(String nome, String endereco)
{
this.nome = nome ;
this.endereco = endereco ;
} | 0 |
public static Forme T() {
ArrayList<Vecteur> liste = new ArrayList<>();
liste.add(new Vecteur(1, 0));
liste.add(new Vecteur(1, 1));
liste.add(new Vecteur(1, 2));
liste.add(new Vecteur(0, 1));
Vecteur<Integer> _centre = new Vecteur(1, 1);
return new Forme("T", lis... | 0 |
public void visit_ixor(final Instruction inst) {
stackHeight -= 2;
if (stackHeight < minStackHeight) {
minStackHeight = stackHeight;
}
stackHeight += 1;
} | 1 |
protected void setResizable(boolean _resizable) {
this.isResizable = _resizable;
} | 0 |
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.