text stringlengths 14 410k | label int32 0 9 |
|---|---|
public TailCall processLeavingTail(XPathContext context) throws XPathException {
Controller controller = context.getController();
SequenceIterator iter = select.iterate(context);
XPathContextMajor c2 = context.newContext();
c2.setOrigin(this);
c2.setCurrentIterator(iter);
... | 9 |
public void SetMean(double mean)
{
this.mean = mean;
} | 0 |
private void scan(File directory)
{
ImageProducer ip = new ImageProducer();
Parser parser = new Parser();
File[] files = directory.listFiles(new FileFilter() {
public boolean accept(File file) {
return
file.getName().endsWith("nfo") ||
... | 7 |
public long getLastModified() {
return this.lastModified;
} | 0 |
private boolean jj_3_24() {
if (jj_scan_token(DOT)) return true;
if (jj_scan_token(ID)) return true;
if (jj_scan_token(LSB)) return true;
if (jj_3R_27()) return true;
if (jj_scan_token(RSB)) return true;
if (jj_scan_token(LP)) return true;
Token xsp;
xsp = jj_scanpos;
if (jj_3R_115()... | 8 |
protected static ImageIcon createImageIcon(String path) {
java.net.URL imgURL = PrograNoobs.class.getResource(path);
if (imgURL != null) {
return new ImageIcon(imgURL);
} else {
System.err.println("Couldn't find image file: " + path);
return null;
}
} | 1 |
public void updateControls() {
if (currentMenu == null) return;
if (Menus.get(currentMenu).isHidden()) return;
Vec2.i mousePos = new Vec2.i(InputHandler.getMouseX(), InputHandler.getMouseY());
List<Control> controls = Menus.get(currentMenu).Children;
for (Control control : controls) {
if (control.get... | 8 |
private void jj_add_error_token(int kind, int pos) {
if (pos >= 100)
return;
if (pos == jj_endpos + 1) {
jj_lasttokens[jj_endpos++] = kind;
} else if (jj_endpos != 0) {
jj_expentry = new int[jj_endpos];
for (int i = 0; i < jj_endpos; i++) {
jj_expentry[i] = jj_lasttokens[i];
}
jj_entries_loo... | 9 |
public String convertWtoHSingle(String _note) {
StringBuffer buffer = new StringBuffer();
String note = getNoteWithoutOctave(_note);
int octave = findNoteOctave(_note);
int hIdx = findIndex(note,wSwars);
int diff = hIdx - wIndex;
int factor = hIndex + diff;
if (factor < 0) {
factor += 12;
octav... | 6 |
public void setEBlock()
{
if(Board.easter)
{
int q = Board.getBlocks().size();
int u = (int) (Math.random()*q);
switch(u)
{
case 0: ImageIcon qq = new ImageIcon("resources/2+4.png");
image = qq.getImage(); break;
... | 6 |
int insertKeyRehash(double val, int index, int hash, byte state) {
// compute the double hash
final int length = _set.length;
int probe = 1 + (hash % (length - 2));
final int loopIndex = index;
int firstRemoved = -1;
/**
* Look until FREE slot or we start to loo... | 9 |
Class142_Sub27_Sub13(Class73 class73, Class73 class73_1, int i, boolean flag) {
NodeList nodeList = new NodeList();
int j = class73.method797(i);
aClass98Array4845 = new Class98[j];
int ai[] = class73.method772((byte) -69, i);
for (int k = 0; k < ai.length; k++) {
byt... | 5 |
public ArrayList<Integer> plusOne(List<Integer> a) {
int len = a.size();
boolean carryOver = true;
ArrayList<Integer> result = new ArrayList<>();
for(int i= len-1; i >=0; i--) {
int val = a.get(i);
val = carryOver == true ? val+1 : val;
if(val%10 == 0 && val !=0) {
result.add(val%10);
... | 8 |
public static void main(String[] args) {
int i1 = 0x2f; // Hexadecimal (lowercase)
System.out.println("i1: " + Integer.toBinaryString(i1));
int i2 = 0X2F; // Hexadecimal (uppercase)
System.out.println("i2: " + Integer.toBinaryString(i2));
int i3 = 0177; // Octal (leading zero)
System.out.println("i3: " + In... | 0 |
private void testAdd(String start, DurationFieldType type, int amt, String end) {
DateTime dtStart = new DateTime(start, GJChronology.getInstance(DateTimeZone.UTC));
DateTime dtEnd = new DateTime(end, GJChronology.getInstance(DateTimeZone.UTC));
assertEquals(dtEnd, dtStart.withFieldAdded(type, a... | 3 |
@Override
public void mouseClick(int X, int Y) {
if(this.getMouseListener() != null)
{
this.getMouseListener().MouseClick(this);
}
} | 1 |
public void banMacs() {
Connection con = DatabaseConnection.getConnection();
try {
loadMacsIfNescessary();
List<String> filtered = new LinkedList<String>();
PreparedStatement ps = con.prepareStatement("SELECT filter FROM macfilters");
ResultSet rs = ps.exe... | 7 |
private void newMealGoButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_newMealGoButtonActionPerformed
if (newMealNameTextField.getText().length() > 0
&& newMealCaloriesTextField.getText().length() > 0
&& newMealProteinTextField.getText().length() > 0) {
... | 5 |
public char remove() {
// array empty?
if (top == 0) {
throw new java.util.NoSuchElementException();
}
char c = data[--top];
// resize if makes sense?
// TODO!
// return value
return c;
} | 1 |
@Test
public void filtersByYearWorks2() {
citations.add(c1);
citations.add(c2);
citations.add(cnull);
filter.addFieldFilter("year", "2012");
List<Citation> filtered = filter.getFilteredList();
assertTrue(filtered.contains(c2) && filtered.size() == 1);
} | 1 |
* @return a char array containing all the data of that version
*/
public char[] getVersion( int version )
{
int length = 0;
// measure the length
for ( int i=0;i<pairs.size();i++ )
{
Pair p = pairs.get( i );
if ( p.versions.nextSetBit(version)==version )
{
length += p.length();
}
}
char[... | 5 |
public Node remove(Node node) {
if (null == node) return node;
if (head == node && head.next == head) {head = null;}
else {
node.prevous.next = node.next;
node.next.prevous = node.prevous;
if (head == node) {
head = node.next;
}
node.next = null;
node.prevous = null;
}
return... | 4 |
@Before
public void setUp(){
inData = new DataArrays<Integer>();
numberOfPoints = 5;
for(int i = 0; i < numberOfPoints; i++){
Integer[] array = new Integer[10];
Arrays.fill(array, i);
inData.addToKit(array);
}
} | 1 |
private void buildTimer(){
if (partie.getParametreJeu().getSecondesParTour() != 0)
{
horloge = new Horloge(partie.getParametreJeu().getSecondesParTour());
horloge.addListener(new HorlogeEventListener() {
@Override
public void updateHorloge(HorlogeEvent horloge) {}
@Override
public void... | 7 |
public static void init(String path) throws IOException
{
FileReader file = new FileReader(path);
BufferedReader reader = new BufferedReader(file);
while ( reader.ready() )
{
String[] line = reader.readLine().split(" ", 2);
if ( line[0].length() > 0 && line[0].charAt(0) != '#' )
{
String[] configA... | 6 |
public void drawBoard(final Graphics g) {
new Runnable() {
@Override
public void run() {
Rectangle s = g.getClipBounds();
g.drawImage(background, 0, 0, null);
for (int i = s.y / 32; i < (s.y + s.height) / 32; i++) {
for (int j = s.x / 32; j < (s.x + s.width) / 32; j++) {
Image element;
... | 9 |
private void voiceTalkButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_voiceTalkButtonActionPerformed
// TODO add your handling code here:
String dest = myList.getSelectedValue().toString();
dest = dest.trim();
if ( client.player != null )
{
JO... | 2 |
@RequestMapping(method = RequestMethod.POST, value = "signup")
private String createCustomerAndLogin(@RequestParam(value = "username") String login,
@RequestParam(value = "password") String password,
@RequestParam(value = "firstName... | 1 |
public Vector<Site> findFreeSites() {
Vector<Site> freeSites = new Vector<Site>();
for (int m = -vision; m <= vision; m++) {
for (int n = -vision; n <= vision; n++) {
Site site;
int x = xPosition + m;
int y = yPosition + n;
if ... | 8 |
public void addTask(Runnable runnable){
try {
queue.put(runnable);
} catch (InterruptedException e) {
e.printStackTrace();
}
} | 1 |
Vector loadArray(int[] array)
{
Vector v = new Vector(array.length/2);
for (int i = 0; i < array.length; i+= 2)
{
Point p = new Point(array[i], array[i+1]);
v.addElement(p);
}
// System.out.println(v.size() + " " + array.length);
return v;
} | 1 |
protected List<Framedata> translateRegularFrame( ByteBuffer buffer ) throws InvalidDataException {
while ( buffer.hasRemaining() ) {
byte newestByte = buffer.get();
if( newestByte == START_OF_FRAME ) { // Beginning of Frame
if( readingState )
throw new InvalidFrameException( "unexpected START_OF_FRAME... | 9 |
final boolean method1623(int i, int i_22_) {
if (i_22_ >= -32)
method1618(null, 16);
anInt2902++;
if ((i ^ 0xffffffff) == 0)
return false;
if ((i ^ 0xffffffff) == (((Class225) this).anInt2918 ^ 0xffffffff))
return true;
if (((Class225) this).anIntArray2915 != null) {
for (int i_23_ = 0;
((Cl... | 6 |
private List<Enemy> getEnemies() {
List<Enemy> enemies = new ArrayList<Enemy>();
for (Tile t : game.getMap().getMap()) {
if (t instanceof Road) {
Road r = (Road) t;
for (Enemy e : r.getEnemies()) {
enemies.add(e);
}
}
}
return enemies;
} | 3 |
public static boolean isPrime(long num)
{
if (num<2)
return false;
if (num==2)
return true;
if (num%2==0)
return false;
for (long i = 3; (i*i)<=(num); i+=2)
{
if (num%i == 0)
return false;
}
return true;
} | 5 |
public static String getMouseName(int mouseCode) {
switch (mouseCode) {
case MOUSE_MOVE_LEFT:
return "Mouse Left";
case MOUSE_MOVE_RIGHT:
return "Mouse Right";
case MOUSE_MOVE_UP:
return "Mouse Up";
case MOUSE_MOVE_DOWN:
return "Mouse Down";
case MOUSE_WHEEL_UP:
return "Mouse Wheel ... | 9 |
public static void manageExtends(ClassDiagram system, Map<String, RegexPartialMatch> arg, final Entity entity) {
if (arg.get("EXTENDS").get(1) != null) {
final Mode mode = arg.get("EXTENDS").get(1).equalsIgnoreCase("extends") ? Mode.EXTENDS : Mode.IMPLEMENTS;
final String other = arg.get("EXTENDS").get(2);
E... | 7 |
@Override
public String Prune(Data data, HashMap<String, String> decisions) {
boolean containsAttributeNode = false;
for (String attributeValue : copySet(children.keySet())) {
Node child = children.get(attributeValue);
if (child instanceof AttributeNode) {
HashMap<String, String> newDescisions = copyHash... | 4 |
protected Token jjFillToken()
{
final Token t;
final String curTokenImage;
final int beginLine;
final int endLine;
final int beginColumn;
final int endColumn;
String im = jjstrLiteralImages[jjmatchedKind];
curTokenImage = (im == null) ? input_stream.GetImage() : im;
beginLine = input_stream.g... | 1 |
public String toString() {
return asString();
} | 0 |
@Override
public void render(GameContainer container, StateBasedGame game, Graphics g)
throws SlickException {
worldMap.draw(cameraX, cameraY);
g.drawString("Camera is at x: " + cameraX
+ " y: " + cameraY, 20, HEIGHT - 20);
g.drawString("Player is at x: " + player.playerX
+ " y: " + player.playe... | 5 |
@Override
public void paintBorder(Graphics g) {
if (isSelected()) {
if (mTimer != null) {
mTimer.stop();
}
mFadeCount = mFadeLimit;
} else {
if (isRollover) {
mFadeCount++;
if (mFadeCount >= mFadeLimit) {... | 7 |
private void startGameSession() {
while (gameState.round < default_rounds + 1) {
synchronized (sync_object) { //game started
sync_object.startGame = true;
sync_object.notifyAll();
System.out.println("server:-----Unblocked startGame-----");
}
sync_object.question_id = gameState.generateQuestionID(... | 9 |
@Test
public void runTestMultiHandlers1() throws IOException {
InfoflowResults res = analyzeAPKFile("Callbacks_MultiHandlers1.apk");
Assert.assertNotNull(res);
Assert.assertEquals(0, res.size());
} | 0 |
private boolean isEmpty(Map<String, EnumElement> board, EnumLine line,
EnumColumn column) {
return board.get(this.createPosition(line, column)) == null ? true
: false;
} | 1 |
@Override
public Point getToolTipLocation(MouseEvent event){
int col = columnAtPoint( event.getPoint() );
int row = rowAtPoint( event.getPoint() );
if (row >= 0 && col >= 0 && getCellToolTip(event) != null) {
return getCellRect(row, col, false).getLocation();
}
r... | 3 |
public static long getMaxRectangleSum() {
int ROWS = m.length, COLS = m[0].length;
long[] comp = new long[ROWS];
long maxArea = 0;
for (int left = 0; left < COLS; left++) {
Arrays.fill(comp, 0);
for (int right = left; right < COLS; right++) {
for (int r = 0; r < ROWS; r++)
comp[r] += (m[r][right]... | 3 |
public boolean getFin() {
return fin;
} | 0 |
Double getNumber(String strName)
{
try
{
return Double.valueOf(strName);
}catch(NumberFormatException e) { }
if (strName.equalsIgnoreCase("global"))
{
try
{
Variable varStore = engGame.varVariables.getVariable(readScriptForCompile());
if (varStore != null && varStore.isNumber())
{
r... | 7 |
private boolean areParenthesesBalanced(String string) {
int count = 0;
for (int i = 0; i < string.length(); i++) {
if (string.charAt(i) == '(')
count++;
else if (string.charAt(i) == ')')
count--;
if (count < 0)
return false;
}
return count == 0;
} | 4 |
public boolean isEqual(LiteralLabel value1, LiteralLabel value2) {
if (value1.getDatatype() instanceof XSDFloat && value2.getDatatype() instanceof XSDFloat) {
Float n1, n2;
n1 = null;
n2 = null;
Object v1 = value1.getLexicalForm();
Object v2 = value2.getLexicalForm();
boolean v1Str... | 8 |
public void exit(User user){
UserSettingsClient.getInstance().saveUserSettings();
DatabaseConnection.getInstance().leaveAllChannels(user);
try {
GameConnection.getInstance().leaveQueues(user);
GameConnection.getInstance().leaveGames(user.getID());
} catch (Exception e) {
e.printStackTrace();
}
... | 1 |
public void keyPressed(KeyEvent e) {
if (moves == 0) {
if (e.getKeyCode() == KeyEvent.VK_R)
reset();
}
else if (e.getKeyCode() == KeyEvent.VK_I) {
try{
JFileChooser chooser = new JFileChooser();
chooser.setFileFilter(new Fil... | 5 |
public final EsperParser.declaration_return declaration() throws RecognitionException {
EsperParser.declaration_return retval = new EsperParser.declaration_return();
retval.start = input.LT(1);
Object root_0 = null;
Token DECLARE21=null;
Token IDENTIFIER22=null;
EsperP... | 1 |
public Binomial(int n, double p) throws ParameterException {
if (n < 1 || p < 0 || p > 1) {
throw new ParameterException("Binomail parameters n in N, 0 <= p <= 1.");
} else {
this.n = n;
this.p = p;
bern = new Bernoulli(p);
}
} | 3 |
public void add(String id, String name) {
// Do not add nulls or empties
if ((id == null) || id.isEmpty()) return;
if ((name == null) || name.isEmpty()) return;
id2names.getOrCreate(id).add(name);
name2ids.getOrCreate(name).add(id);
} | 4 |
public void testRounding7() {
MutableDateTime test = new MutableDateTime(2002, 6, 9, 5, 6, 7, 8);
try {
test.setRounding(ISOChronology.getInstance().hourOfDay(), -1);
fail();
} catch (IllegalArgumentException ex) {}
} | 1 |
protected boolean printTemplates(PrintContext p, Property predicate, String keyword, boolean force, Resource graphIRI, SPINModuleRegistry registry) {
List<RDFNode> nodes = getList(predicate);
if(!nodes.isEmpty() || force) {
if(keyword != null) {
p.printIndentation(p.getIndentation());
p.printKeyword(keyw... | 7 |
private String toStringHelper(Node<T> currentNode, String result) {
if (currentNode.getHead() == null) {
return result;
} else if (currentNode.getTail() != null) {
String r = currentNode.getHead().toString();
r = result + r;
return toStringHelper(currentNode.getTail(), r) + " ";
}
return result + cu... | 2 |
public void start() {
int count = 0;
//While the simulation still has time or cars/pedestrians, keep processing events
while((carList.size() > 0 && pedList.size() > 0) || currentTime < duration) {
Event currentEvent = eventList.poll();
currentTime = currentEvent.getTime();
processEvent(currentEvent);... | 4 |
public List<EventName> sendRequest(String lang) {
List<EventName> result = new ArrayList<EventName>();
RestTemplate rest = new RestTemplate();
String json = rest.getForObject("https://api.guildwars2.com/v1/event_names.json?lang="+lang, String.class);
ObjectMapper mapper = new ObjectMapper();
try {
JsonNode... | 2 |
@Override
public boolean equals(Object obj) {
if (this == obj) return true;
if (obj == null) return false;
if (getClass() != obj.getClass()) return false;
Quat other = (Quat) obj;
if (Double.doubleToLongBits(w) != Double.doubleToLongBits(other.w)) return false;
if (Double.doubleToLongBits(x) != Double.doub... | 7 |
String markers2string(Markers markers) {
StringBuilder sb = new StringBuilder();
int prevEnd = -1;
markers.sort(false, false);
for (Marker m : markers) {
if (prevEnd >= 0) {
for (int i = prevEnd; i < m.getStart(); i++)
sb.append('-');
}
for (int i = m.getStart(); i <= m.getEnd(); i++)
sb... | 4 |
public boolean superClassOf(ClassInfo son) {
while (son != this && son != null) {
son = son.getSuperclass();
}
return son == this;
} | 2 |
public void write() throws Exception{
File file = new File(path);
if (! file.exists()) {
boolean created = file.createNewFile();
if (created) {
System.out.println("New file was created.");
} else {
System.out.println("Unexpected error o... | 8 |
private void processArguments( final String[] args )
throws CommandException {
log.debug( "processing arguments: " + Strings.join( args, "," ) );
if ( args.length == 0 ) {
throw new CommandException( "Command requires arguments" );
}
String sopts = "-:cf:";
LongOpt[] lopts =
{
new LongOpt( "... | 8 |
public void simpleTagNotEmpty(String name, String value) {
if (value != null && value.length() != 0) {
startSimpleTag(name);
writeEncodedData(value);
endTagEOL(name, false);
}
} | 2 |
public int compareTo(Object o){
Symbol s = (Symbol) o;
if(this.equals(o))
return 0;
if(this.ns == null && s.ns != null)
return -1;
if(this.ns != null)
{
if(s.ns == null)
return 1;
int nsc = this.ns.compareTo(s.ns);
if(nsc != 0)
return nsc;
}
return this.name.compareTo(s.name);
} | 6 |
@Test
public void compareHands_TwoFullHousesWithSameTripsDifferentPairs_HandWithHigherPairWins() {
Hand p1 = Hand.FullHouse(Rank.Four, Rank.Nine);
Hand p2 = Hand.FullHouse(Rank.Four, Rank.Ace);
assertTrue(p1.compareTo(p2) < 0);
} | 0 |
public void keyPressed(KeyEvent e) {
int key = e.getKeyCode();
if (key == KeyEvent.VK_SPACE) {
Cast(); //action that shoots a FrostBolt.
}
if (key == KeyEvent.VK_LEFT) {
if(x <= 0+image.getWidth(null)){
x = 0;
keyReleasedLeft(e);
}else{
... | 9 |
private Message message_en_cours(int id, int date, int taille){
Message mess = null;
switch (id) {
//deplacement1
case(0x100):
mess = new Deplacement1(date, id, taille);
System.out.println("deplacement1 reconnu");
break;
case(0x111):
mess = new Deplacement2(date, id, taille);
System.out.... | 6 |
public void close()
{
sock.close();
} | 0 |
@EventHandler
public void onInventoryClick(InventoryClickEvent event) {
if (event.getCurrentItem() != null) {
if (BungeeUtilities.getInstance().getConfig().getBoolean("server-menu.prevent-item-movement")) {
if (event.getCurrentItem().hasItemMeta()) {
if (event.getCurrentItem().getItemMeta().hasDisplayNam... | 9 |
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 boolean handleClick(Point clickPoint) {
if (shouldRender) {
HUDArea hudArea = null;
if (isInside(clickPoint)) {
//start from the top and work our way down to "layer" the huds
for (int i = (hudAreas.size() - 1); i >= 0; i--) {
hu... | 4 |
private void quickSort(List<T> list, int startIndex, int endIndex) {
// BASE CASE: List contains one or fewer elements or the indexes are out of bounds.
// This indicates that the list is sorted as we have no out of order elements in a zero or one
// element list.
if (endIndex <= startIndex || endIndex ... | 3 |
public List<Pair<Clan,Clan>> findUncommonRivalrousClans(MOB M1, MOB M2)
{
final List<Pair<Clan,Clan>> list=new XVector<Pair<Clan,Clan>>(1,true);
if((M1==null)||(M2==null))
return list;
// i need the disunion here (what's the word for that?), as a order-irrelevant set of pairs
for(final Pair<Clan,Integer> c ... | 8 |
public void startGameLoop() {
gameLoopRunning = true;
new Thread(new Runnable() {
@Override
public void run() {
double lastTime = System.currentTimeMillis();
while (gameLoopRunning) {
double current = System.currentTimeMillis();
double elapsed = current - lastTime;
game.processInp... | 3 |
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
Player player = null;
if (sender instanceof Player) {
player = (Player) sender;
}
if (player == null) {
sender.sendMessage("This command can only be run by a player");
return true;
}
i... | 8 |
public void addTileset(TileSet tileset) {
if (tileset == null || tileSets.indexOf(tileset) > -1) {
return;
}
Tile t = tileset.getTile(0);
if (t != null) {
int tw = t.getWidth();
int th = t.getHeight();
if (tw != tileWidth) {
... | 5 |
public void consoleOut(){
for (Being being: beings){
System.out.println(being);
}
System.out.println("------------------------------------------------------");
for (Being being: zeroBeings){
System.out.println(being);
}
System.out.println("Number o... | 2 |
@Override
public void e(float sideMot, float forMot) {
if (this.passenger == null || !(this.passenger instanceof EntityHuman)) {
super.e(sideMot, forMot);
this.W = 0.5F; // Make sure the entity can walk over half slabs,
// instead of jumping
return;
}
EntityHuman human = (EntityHuman) this.passe... | 8 |
public boolean generate(World var1, Random var2, int var3, int var4, int var5) {
int var11;
for(boolean var6 = false; ((var11 = var1.getBlockId(var3, var4, var5)) == 0 || var11 == Block.leaves.blockID) && var4 > 0; --var4) {
;
}
for(int var7 = 0; var7 < 128; ++var7) {
int var8... | 6 |
private int[] getPairing(int chr, int side) {
assert(popdata.ploidy > 2);
int[] pairedWithSide = new int[popdata.ploidy];
boolean done[] = new boolean[popdata.ploidy];
TetraploidChromosome tchrom = (TetraploidChromosome)popdata.getChrom(chr);
if (genomehs == null) calcGenomehs();... | 8 |
public static void SleepThread(int timeToSleep){
try{
Thread.sleep(timeToSleep);
}catch(InterruptedException e){}
} | 1 |
@Override
public PacketSyncPacket getSyncPacket() {
List<Class<? extends APacket>> clazzList = new ArrayList<>(PList);
return new PacketSyncPacket(clazzList);
} | 1 |
public Equation(String expression) {
this.expression = expression;
try {
//Conditional function
CustomFunction conditionalFunction = new CustomFunction("if", 3) {
public double applyFunction(double[] values) {
if (values[0] >= 0) {
... | 8 |
private void drawSolutionProgress(Graphics2D g2)
{
if (numSolutions == 0)
{
return;
}
//System.err.println("---- " + currentHelp1Counter + " / " + numSolutions);
if (HelpParadigm.Classic.equals(slateComponent.getSlateSettings().getHelpParadigm()))
{
// Draw circular progress of number of soluti... | 7 |
public Combo_Box_Change_Appointment_Information() throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException
{
//MAIN FRAME
super("Team J's Scheduler | Change Appointment Information");
setBounds(50,50,500,300);
setResizable(false);
setDefaultCloseOperation(JFrame.DISPOSE_ON_... | 8 |
public Map<RedisBigTableKey, byte[]> getByKey(byte[] table, RedisBigTableKey k) throws RedisForemanException
{
boolean tableExists = tableExists(table);
boolean emptyParts = hasEmptyParts(k);
if (tableExists && !emptyParts)
{
Map<RedisBigTableKey, byte[]> toReturn = new HashMap<RedisBigTableKey, byte[]>();
... | 6 |
private void randomizeIndexedSprite(IndexedSprite indexedSprite) {
int j = 256;
for (int k = 0; k < anIntArray1190.length; k++) {
anIntArray1190[k] = 0;
}
for (int l = 0; l < 5000; l++) {
int i1 = (int) (Math.random() * 128D * j);
anIntArray1190[i1] = ... | 9 |
@Override
public void publish(Event event){
Class<? extends Event> type = event.getClass();
List<Object> handlers = eventHandlers.get(event.getClass());
if(handlers == null){
LOG.info("No event handlers declared for event " + type.getName());
return;
}
... | 9 |
public static List<AlertBean> fetchAlerts(StudentBean student) {
List<AlertBean> catMap = new ArrayList<AlertBean>();
ResultSet rs=null;
Connection con=null;
PreparedStatement ps=null;
try{
String sql="SELECT person_id, alert_description, viewed, alert_id "
+ "FROM STUDENT_ALERTS "
+ "WHERE p... | 9 |
public void eventTextDescription(Event e){
//by Budhitama Subagdja
String desc = "";
desc = desc + "At (" + e.x + "," + e.z +") ";
desc = desc + "Health: " + e.curHealth + " ";
if(e.emeDistance<1){
desc = desc + "Enemy Detected! Distance: " + e.emeDistance;
}
//jTextArea3.append(desc... | 9 |
public int MutatedBinarySearch(String[] strs, String str) {
if (str == null || str == null || str == "")
return -1;
return searchRec(strs, str, 0, strs.length - 1);
} | 3 |
private String getServerConfigurationValue(String serverId, String node) {
NodeList serversNodes = document.getElementsByTagName("servers");
NodeList serverNodes = serversNodes.item(0).getChildNodes();
String value = null;
for (int i = 0; i < serverNodes.getLength(); i++) {
... | 3 |
private JSONWriter end(char m, char c) throws JSONException {
if (this.mode != m) {
throw new JSONException(m == 'o' ? "Misplaced endObject." :
"Misplaced endArray.");
}
this.pop(m);
try {
this.writer.write(c);
} catch (IOException e) {
... | 3 |
public void setCost(Cost cost) {
this.cost = cost;
} | 0 |
@Override
public void destroyTarget() throws Exception {
Object arr[] = { this, target };
double rate = 3;
// Math.random(); // generate random success
if (//(target.getStatus() == Missile.Status.Launched) &&
(this.getDelayBeforeLaunch() < target.getFlyTime() + target.getLaunchTime())) {
// if rate ... | 6 |
@Override
public synchronized void stop() {
if (D) Log.d(TAG, "stop");
for (ConnectThread ct : connectionAttempts.values()) ct.cancel();
connectionAttempts.clear();
for (ConnectedThread ct : remoteConnections.values()) ct.cancel();
remoteConnections.clear();
if (mS... | 5 |
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.