text stringlengths 14 410k | label int32 0 9 |
|---|---|
public final void operateImpl() throws IOException {
final Pattern splitter = Pattern.compile(" ");
String currentLine;
while ((currentLine = readInputLine()) != null) {
final String[] numbers = splitter.split(currentLine);
if (numbers.length != 2) {
thr... | 7 |
private LevelObject getObject(Color colour) {
switch (colour.getBlue()) {
case 0:
return null;
case 1:
return new Block(this, blockTileSheet.getImage(colour.getRed(), colour.getGreen()), getBlockBounds(colour));
case 2:
return d... | 9 |
public void addHighscore(String player, String levelUuid, Integer score) {
Properties properties = new Properties();
try {
// load the score file from the profile folder
properties.load(new FileInputStream(basepath + DEL + player + DEL
+ highscore + DEL + filename));
// check if there is already a... | 5 |
public void setAgents (Vector v) {
agents = v;
} | 0 |
private void paintContainer(Graphics g) {
int xStart = getWidth() / 3;
int yStart = getHeight() / 3;
// create the images
Image slot = containerSlot.getScaledInstance(SLOT_SIZE, SLOT_SIZE, 0);
Image selectedSlot = selectedContainerSlot.getScaledInstance(SLOT_SIZE,
SLOT_SIZE, 0);
// initial slot
int r... | 4 |
public void MergeTable(Table table)
{
int newAttributes = table.ColSize();
AttributeNames.addAll(table.GetAllAttributeNames());
this.nColumns += newAttributes;
int i=0;
for (;i<table.RowSize();i++)
{
if (i<=this.nRows-1)
{
this.Entries.get(i).Data.addAll(table.GetRow(i).Data);
} else
{
... | 4 |
public LocalVariablesSorter(final int access, final String desc,
final MethodVisitor mv) {
super(mv);
Type[] args = Type.getArgumentTypes(desc);
nextLocal = (Opcodes.ACC_STATIC & access) == 0 ? 1 : 0;
for (int i = 0; i < args.length; i++) {
nextLocal += args[i].getSize();
}
firstLocal = nextLocal;
} | 2 |
public static String find(BinaryTree<String>.Node<String> root, String character, String pattern) {
if(root.data.compareTo(character)==0) {
return pattern;
}
if(root.data.contains(character)){
if(root.left!=null && root.left.data.contains(character)){
ret... | 6 |
public Placeable getPlaceableById(String id) {
if (placeables.containsKey(id)) {
Placeable placeable = placeables.get(id);
return placeable;
} else {
return null;
}
} | 1 |
public void send_packet(RdpPacket_Localised data) throws RdesktopException, IOException, CryptoException
{
if(Common.secure == null) return;
int length = data.size();
int data_offset = 0;
int packets_sent = 0;
int num_packets = (length/VChannels.CHANNEL_CHUNK_LENGTH);
num_packets += length - (VChannels.... | 8 |
public boolean editVariable(String[] args, CommandSender sender) {
String groupName = plugin.groups.searchInGroups(args[1]);
List<String> variableResult = new ArrayList<String>();
int counter = 3;
String resultString = "";
String variable = args[2].toLowerCase();
if (groupName == null) {
sender.sendMe... | 9 |
public String toString() {
Class<?> cl = getClass();
StringBuilder sb = new StringBuilder();
sb.append(getFullName(cl));
sb.append("\n---\n");
sb.append(mkString(getProperties(cl), "\n"));
return sb.toString();
} | 1 |
private static void setTreatment(String s, String obj) {
String [] split = null;
if(s.contains("*")){
split = s.split("\\*");
}else if(s.contains("&")){
split = s.split("\\&");
}
String newComp = "";
HashMap<String,String> hash = new HashMap<String,String>();
for(int i = 0 ; i < split.length ; i++)... | 5 |
public boolean ModificarDetallePunto(DetallePunto p){
if (p!=null) {
cx.Modificar(p);
return true;
}else {
return false;
}
} | 1 |
public void renderTile(int xp, int yp, Tile tile) {
xp -= xOffset;
yp -= yOffset;
for(int y = 0; y < tile.getSprite().height; y++) {
int ya = y + yp;
for (int x = 0; x < tile.getSprite().width; x++) {
int xa = x + xp;
/* TODO */ if (xa < -tile.getSprite().width || xa >= width || ya < 0 || ya >= height)... | 7 |
@BeforeClass
public static void setUpClass() {
} | 0 |
private void method394(int i, int j, byte abyte0[], int k, int l, int i1, int j1) {
int k1 = j + l * width;
int l1 = width - k;
int i2 = 0;
int j2 = 0;
if (l < topY) {
int k2 = topY - l;
i1 -= k2;
l = topY;
j2 += k2 * k;
... | 6 |
public void relayout() {
if(mScreen == null || mDocument == null) {
return ;
}
restoreFlags(mDocument.getRootConstruct(), false);
Dimension size = getSize(mDocument.getRootConstruct());
float ratio = (float)size.width / (float)mScreen.width;
while(ratio > mConstructRatioWidth) {
if(!layout(mDo... | 4 |
public void dump(FileOutputStream out) throws Exception {
out.write(packet_tag & 0xff);
out.write(packet_length & 0xff);
out.write(version & 0xff);
out.write(key_id & 0xff);
out.write(s2k & 0xff);
out.write(cipher_text, 0, packet_length);
} | 0 |
@Override
public int getPixel(int x, int y)
{
if (x < 0 || x >= width)
return 0;
if (y < 0 || y >= height)
return 0;
int val = getPixelVal(x, y);
if (format == 1)
val &= 0x1F;
if (format == 6)
val &= 0x07;
return val... | 6 |
public void collide(TreeSet<Planes> planeSet) {
// disables in the plane is landing
if (landing) {
return;
}
Iterator<Planes> planeSetIter = planeSet.iterator();
warning = false;
collide = false;
while (planeSetIter.hasNext()) {
Planes nextPlane = planeSetIter.next();
if (nextPlane == this) {... | 7 |
public BigDecimal getResult() throws CalculatorException, BinaryOperatorException {
while (!expressionStack.operatorStack.isEmpty()) {
evaluateOperator();
}
if (!expressionStack.bracketStack.isEmpty()) {
throw new BinaryOperatorException("missing closed bracket");
... | 2 |
@POST
@Path("{id}")
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
public Response editSensorById(
@PathParam("id") int id,
@FormParam("unity") String unity,
@FormParam("name") String name,
@FormParam("statementFrequency") long statementFrequency,
@FormParam("samplingFrenquency") long samplingFreque... | 9 |
public String getPatientID(){
return HKID;
} | 0 |
private void generateModeConflictRules(List<CtModeConflictRule> modeConflictRules) {
if (null == modeConflictRules || modeConflictRules.size() == 0) return;
for (CtModeConflictRule conflictRule : modeConflictRules) {
List<String> conflictList = conflictRule.getConflictWIth();
if (null == conflictList || confl... | 5 |
public LinkedList<IndexCluster> getClusters(String query) {
LinkedList<IndexCluster> clusterList = new LinkedList<IndexCluster>();
try {
// URL obj = new URL(solrURL + "/collection1/dismax?q=" + query
// + "&wt=xml&rows=100");
String queryEnc = URLEncoder.encode(query, "UTF-8");
URI... | 4 |
public String getType()
{
return TYPE;
} | 0 |
@SuppressWarnings("deprecation")
public void run() {
Date now =new Date();
byte[] buf =new byte[32];
boolean send;
// System.out.println("IRQ");
for (int it=0;it<size();it++) {
// System.out.println("Check "+get(it).getType());
send=false;
if (IECMap.IEC_M_Type.contains(get(i... | 9 |
private byte[] parse(String s) {
byte[] b = new byte[s.length() >> 1];
for (int i=0, j=0; j<s.length(); i++, j+=2)
b[i] = (byte)Long.parseLong(s.substring(j, j+2), 16);
return b;
} | 1 |
public boolean checkIngredients(ItemStack[] matrix) {
List<ItemStack> list = getIngredientList();
int usedItems = 0;
int matrixItems = 0;
for (ItemStack item : matrix) {
if (item != null && item.getTypeId() != Material.AIR.getId()) {
for (ItemStack recipeItem ... | 7 |
boolean checkStrandComplementarity() {
if (strands[DNA_STRAND_BASE] == null || strands[DNA_STRAND_COMPL] == null)
return false;
if (strands[DNA_STRAND_BASE].getLength() != strands[DNA_STRAND_COMPL].getLength())
return false;
int len = strands[DNA_STRAND_BASE].getLength();
for (int i = 0; i < len; i++) {
... | 7 |
public void playStartSound()
{
startClip.start();
} | 0 |
public void remover(long pesquisaId) throws Exception
{
String sql = "DELETE FROM pesquisalocal WHERE id1 = ?";
try
{
PreparedStatement stmt = ConnectionFactory.getConnection().prepareStatement(sql);
stmt.setLong(1, pesquisaId);
stmt.execute();
... | 1 |
@SuppressWarnings("incomplete-switch")
/* package */void processOutputMessage (BitTorrentMessage msg) {
assert msg != null;
switch (msg.getMessageType()) {
case HANDSHAKE_START:
HandShakeStart hss = (HandShakeStart) msg;
localFlags.or(hss.getFlags());
... | 8 |
Expr unary()throws Exception{
Token tmp = look;
switch(look.tag) {
case '-' :case '+' :
case Tag.TAN:case Tag.EXP:
case Tag.SIN:case Tag.COS:
case Tag.LOG:case Tag.LN :
case Tag.SQR:
move();
return new Unary(tmp,unar... | 9 |
private boolean updateClient( Client c )
{
if (c.isClosed())
{
listener.onClientClose( this, c, null );
return false;
}
try
{
c.read();
c.update();
listener.onClientUpdate( this, c );
if (c.isReadyToS... | 3 |
public String getAuthority() {
return this.authority;
} | 0 |
public static void main(String[] args) {
maze = new Maze(BobsMaze.class.getClassLoader().getResource("bobsMaze/maze_01_15x10.txt").getPath());
pop = new Population<>(POPULATION_SIZE, CROSSOVER_RATE, NUM_ELITE,
makeRandomIntChromo, computeIntFitness, mutateIntGenes);
launch(args);
} | 0 |
public List<String> getWords(String s, Set<String> dict)
{
if(s==null||s.equals("")) return null;
List<String> rt = new ArrayList<String>();
Iterator<String> it = dict.iterator();
while(it.hasNext())
{
String d = it.next();
if(isStart(s, d))
{
List<String> after = getWords(s.substring(d.length(... | 7 |
private void edgeMethodFailure(Method method, Graph<?, ?> graph, String validVertex, String invalidVertex)
throws IllegalAccessException {
try {
method.invoke(graph, validVertex, null);
fail();
} catch (InvocationTargetException e) {
checkCause(e, NullPoin... | 8 |
public static void removeFileNameFromList(DocumentInfo docInfo) {
// check to see if this file is in frameInfoList
int position = NOT_THERE;
String filename = PropertyContainerUtil.getPropertyAsString(docInfo, DocumentInfo.KEY_PATH);
for (int i = 0, limit = frameInfoList.size(); i < limit; i++) {
if (... | 3 |
static void dradf4(int ido, int l1, float[] cc, float[] ch, float[] wa1,
int index1, float[] wa2, int index2, float[] wa3, int index3) {
int i, k, t0, t1, t2, t3, t4, t5, t6;
float ci2, ci3, ci4, cr2, cr3, cr4, ti1, ti2, ti3, ti4, tr1, tr2, tr3, tr4;
t0 = l1 * ido;
t1 = t0;
... | 7 |
public long getFileSize() {
return this.fileSize;
} | 0 |
public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
config = plugin.getConfig();
if (commandLabel.equalsIgnoreCase("Eventjoin")) {
if (args.length == 1){
if (sender instanceof Player) {
if (sender.hasPermission("EventManager.Ejoin")){
File locations = ... | 5 |
public supplier browseSupplier(String supplierName) throws SQLException{
supplier searchedSupplier=null;
try{
databaseConnector=myConnector.getConnection();
stmnt=(Statement) databaseConnector.createStatement();
SQLQuery="SELECT * FROM familydoctor.supplier W... | 4 |
public void move(String deplacement){
Vehicule v = getVehicule(deplacement.substring(0,1));
int postX = v.getX();
int postY = v.getY();
if(deplacement.substring(1,2).equals("L")){
postX -= Integer.parseInt(deplacement.substring(2));
postX = 4+postX*30;
}
else if(deplacement.substring(1,2).equals("R"))... | 5 |
public static void main(String[] args) {/*
byte[] i = {0,0,0,0,0,0,0,0};
ArrayList<byte[]> hashes = new ArrayList<byte[]>();
for (int k = 0; k<1000; k++) {
//while (true) {
if(i[7] == 0) System.out.printf("0x%02x%02x%02x%02x%02x%02x%02x%02x\n", i[0], i[1], i[2], i[3], i[4], i[5], i[6], i[7]);
byte[... | 5 |
public static void render(int x, int y){
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glColor3f(0.5f, 0.5f, 0.5f);
GL11.glBegin(GL11.GL_QUADS);
GL11.glVertex2f(x + Game.SCREEN_WIDTH/2-5*40-2, y + Game.SCREEN_HEIGHT/2-5*36-2);
GL11.glVertex2f(x + Game.SCREEN_WIDTH/2+5*40+2, y + Game.SCREEN_HEIGHT/2-5*36-2);
G... | 6 |
public Integer getMajorityGreaterThan(){
int maxKey = Integer.MIN_VALUE;
int maxValue = Integer.MIN_VALUE;
boolean greaterThan = false;
for (Map.Entry<Integer, Integer> e : counts.entrySet()) {
if ( e.getValue() > maxValue ) {
maxValue = e.getValue();
maxKey = e.getKey();
greaterThan = true;
}... | 4 |
public static String replaceSize(String dp) {
Map<String,String> sizeMap = new LinkedHashMap<String,String>();
if (dp == null) return "";
sizeMap.put("whuxga","7680x4800");
sizeMap.put("whsxga","6400x4096");
sizeMap.put("wquxga","3840x2400");
sizeMap.put("wqsxga","3200x2048");
sizeMap.put("wsxga+","1680x1... | 3 |
public static int xDelta(int givenDirection)
{
switch(givenDirection)
{
case 0: return 0;
case 1: return 1;
case 2: return 0;
case 3: return -1;
default: throw new DirectionOutOfBoundsException();
}
} | 4 |
private void append(String text) {
if (text.startsWith("\n"))
width = 0; // reset counter if starts with a newline. only from formats above, not in natural text
if (text.equals(" ") &&
(accum.length() == 0 || StringUtil.in(accum.substring(accum.length() - 1), ... | 8 |
private synchronized void move(){
//Nothing to operate
if(onOperating.isEmpty()){
//No floors is waiting
if(onWaiting.isEmpty()){
status = 0;
idle();
try{
wait();
}catch(InterruptedException ex){
... | 7 |
public void entitiesModified(Iterable<SimpleEntity> entities) {
for (SimpleEntity entity : entities) {
if (entitiesInIndex.contains(entity)) {
if (!entity.exists) {
entitiesInIndex.remove(entity);
} else if (!hasAllComponents(entity)) {
... | 6 |
public void renderProjectile(int xp, int yp, Projectile p) {
xp -= xOffset;
yp -= yOffset;
for (int y = 0; y < p.getSpriteSize(); y++) {
int ya = y + yp;
for (int x = 0; x < p.getSpriteSize(); x++) {
int xa = x + xp;
if (xa < -p.getSpriteSize() || xa >= width || ya < 0 || ya >= height) break;
... | 8 |
private void updatePath(float x, float y) {
closedPath = null;
if (path == null) {
path = new GeneralPath(GeneralPath.WIND_EVEN_ODD);
path.moveTo(x, y);
bounds = new Rectangle2D.Float(x, y, 0, 0);
} else {
path.lineTo(x, y);
float _xmax = (float)bounds.getMaxX... | 5 |
public Complex weightedVariance_as_Complex() {
boolean hold = Stat.nFactorOptionS;
if (nFactorReset) {
if (nFactorOptionI) {
Stat.nFactorOptionS = true;
} else {
Stat.nFactorOptionS = false;
}
}
boolean hold2 = Stat.nEffOptionS;
if (nEffReset) {
if (nEffOptionI) {
Stat.nEffOptionS = tr... | 7 |
private void makeDropTarget(final java.io.PrintStream out, final java.awt.Component c, boolean recursive) {
// Make drop target
final java.awt.dnd.DropTarget dt = new java.awt.dnd.DropTarget();
try {
dt.addDropTargetListener(dropListener);
} // end try
catch (java.util.TooManyListenersException e) {
e.p... | 6 |
public boolean addItemStackToInventory(ItemStack par1ItemStack)
{
int var2;
if (par1ItemStack.isItemDamaged())
{
var2 = this.getFirstEmptyStack();
if (var2 >= 0)
{
this.mainInventory[var2] = ItemStack.copyItemStack(par1ItemStack);
... | 7 |
public static boolean partialArgumentsUnifyWithArgumentsP(Proposition subproposition, Proposition referenceproposition) {
{ PatternRecord patternrecord = ((QueryIterator)(Logic.$QUERYITERATOR$.get())).currentPatternRecord;
int ubstackoffset = patternrecord.topUnbindingStackOffset;
boolean successP = fal... | 7 |
public String goToAdminUpdateProduct() {
this.product = this.userFacade.getProductById(this.id);
this.setPropertyFromProduct();
return "adminUpdateProduct";
} | 0 |
public void setMessage(String message){ this.Message = message; } | 0 |
public void visitEnd() {
super.visitEnd();
if (mv != null) {
mv.visitEnd();
}
} | 1 |
@Override
public double[] derivn(double time, double[] currentMarking) {
updateExpressionValuesTable(currentMarking);
double[] derivativePlaceOverDerivativeTime = new double[input.getSpecies().size()];
List<Specie> species = input.getSpecies();
for (int i = 0; i < species.size(); i++) {
Speci... | 3 |
public static void main(String[] args) throws IOException, FileNotFoundException {
ArrayList<Edge> edges = new ArrayList<Edge>();
final int K = 4;
int n;
BufferedReader br = new BufferedReader(new FileReader("clustering1.txt"));
n = Integer.parseInt(br.readLine());
parents = new int[n][2];
for(int i =... | 6 |
public void saveFile(Object obj, File file) {
if (file.exists()) {
String dirs = file.getPath();
file.delete();
this.createNewFile(file, dirs);
}
try {
this.obj = obj;
this.file = file;
this.saveFile(obj, file);
} ca... | 2 |
@Override
public void run()
{
try
{
Game.log("Game thread sucessfully started");
this.game.run();
}
catch (Exception e)
{
this.didEncounterError = true;
this.exception = e;
this.interrupt();
}
} | 1 |
private static final Pair<Integer, Integer> calculateCoordinate( IBoard board, int row, int column, Move joinType ) {
switch (joinType) {
case UP_LEFT:
row--;
column--;
break;
case UP_CENTER:
row--;
break;
case UP_RIGHT:
row--;
column++;
break;
case LEFT:
column--;
break;
case RI... | 9 |
public static String[] split(String toSplit, String delimiter) {
if (!hasLength(toSplit) || !hasLength(delimiter)) {
return null;
}
int offset = toSplit.indexOf(delimiter);
if (offset < 0) {
return null;
}
String beforeDelimiter = toSplit.substring(0, offset);
... | 3 |
public String getFooter() {
return footer;
} | 0 |
public DERObject getDERObject()
{
if (seq == null)
{
ASN1EncodableVector vec = new ASN1EncodableVector();
for (int i = 0; i != ordering.size(); i++)
{
ASN1EncodableVector v = new ASN1EncodableVector();
DERObjectIdentifier ... | 9 |
protected boolean sendRefCommand(boolean takeoff, boolean emergency) {
int ref = REF_BASE;
if (takeoff) {
ref = ref | MASK_TAKEOFF;
}
if (emergency) {
ref = ref | MASK_EMERGENCY;
}
try {
final String payload = String.format(REF, DUMMY_SN, ref);
if (emergency) {
commandQueue.offer(payload);... | 9 |
public void bind() {
if(shaderProgram != 0 && !isBound) {
ARBShaderObjects.glUseProgramObjectARB(shaderProgram);
isBound = true;
}
else if(shaderProgram != 0 && isBound) {
System.err.print("RoyalFlush: Shader.bind - Shader program " + shaderProgram + " already bound.\n");
}
else {
System.err.print... | 4 |
/* */ @EventHandler
/* */ public void onPlayerDeath(PlayerDeathEvent event)
/* */ {
/* 107 */ if (Main.getAPI().isBeingSpectated(event.getEntity()))
/* */ {
/* 109 */ for (Player p : Main.getAPI().getSpectators(event.getEntity()))
/* */ {
/* 111 */ if ((Main.getAPI(... | 5 |
void mouseDoubleClick(int x, int y, int modifiers, int nearestAtomIndex) {
// viewer.setStatusUserAction("mouseDoubleClick: " + modifiers);
setMouseMode();
switch (modifiers & BUTTON_MODIFIER_MASK) {
case LEFT:
if (measurementEnabled) { // XIE
if (measurementMode) {
addToMeasurement(nearestAtomIndex... | 9 |
@Override
public Component getListCellRendererComponent(JList<? extends RosterComponent> list,
RosterComponent value, int index, boolean isSelected, boolean cellHasFocus) {
Integer cnt = MainWindow.tripDB.getRosterAssignmentCount(c.getTime(), value.getRoster());
Color col = Color.BLACK;
if (value.getRoster(... | 6 |
private boolean isPic(String s) {
if(s.startsWith("http") && (s.contains(".jpg")||s.contains(".png")||s.contains(".bmp")||s.contains(".gif")||s.contains("jpeg"))){
return true;
}
else
return false;
} | 6 |
public boolean getEcho() {return this.echoToConsole;} | 0 |
@Override
public void setPlayers(PlayerDescription[] value) {
for (int i = 0; i < value.length; i++) {
JToggleButton toggle = new JToggleButton(value[i].getName());
toggle.addActionListener(playerSelectActionListener);
toggle.setActionCommand(value[i].getName());
toggle.putClientProperty( "JButton... | 3 |
private static void writeHeader(ObjectOutputStream oos, int[] header) throws IOException
{
for(int i = 0; i < 128; i++)
{
oos.writeInt(header[i]);
}
oos.writeInt(textLength);
} | 1 |
public void updateItemDisplay(
Model itemModel, float amount, float xoff, float yoff
) {
ItemStack match = null ;
for (ItemStack s : stackFX) if (s.itemModel == itemModel) match = s ;
if (amount < 1) { if (match != null) stackFX.remove(match) ; return ; }
if (match == null) stackFX.add(match ... | 5 |
protected static NodeInstallInformation getNodeInstallationInformation(String version, File directory) throws MojoExecutionException {
String baseURL = "http://nodejs.org/dist/v" + version + "/";
String basePath = directory.getAbsolutePath() + File.separator;
String arch;
if (Os.isArch("x86") || Os.isArch("i386... | 9 |
*/
public static void unassertProposition(Proposition self) {
if (self != null) {
{ boolean equivalenceP = self.kind == Logic.KWD_EQUIVALENT;
if (Proposition.trueP(self)) {
if (equivalenceP) {
Proposition.updateEquivalenceProposition(self, Logic.KWD_RETRACT_TRUE);
}
... | 7 |
private boolean isAURIMatch(Request request) {
for (String uri : getRouteKeySet(request)) {
if (request.getURI().equals(uri)) {
return true;
}
}
return false;
} | 2 |
public void setADe(TNumeroInt node)
{
if(this._aDe_ != null)
{
this._aDe_.parent(null);
}
if(node != null)
{
if(node.parent() != null)
{
node.parent().removeChild(node);
}
node.parent(this);
... | 3 |
public void cellDraw(int x, int y){
if(!sedna.getSelected() ||sedna.getSelection(x,y)){
if(cellfillflag){
switch(cft){
case 0: populate(x,y,1); break;
case 1: mainBrain.getCell(x, y).setOption(toolstring[3], opval[3]); break;
case 2: mainBrain.getCell(x, y).setParameter... | 9 |
public static int getElementCount(Compoundable compound, Element e)
{
int count = 0;
//System.out.println(compound);
if(compound instanceof Atom && ((Atom)compound).getElement().equals(e))
{
count = 1;
}
else if(compound instanceof Compound)
{
Compoundable[] temp = compound.getElements();
for... | 8 |
public String getPrenom() {
return prenom;
} | 0 |
* @Post: no changes
* @Return: Returns whether or not a current point is under attack by the enemy
*/
private boolean isUnderAttack(Point pointToCheck) {
// TODO Auto-generated method stub
return knightsCanAttack(pointToCheck)||diagonalCanAttack(pointToCheck)||lineCanAttack(pointToCheck)||pawnCanAttack(pointTo... | 4 |
int [] getCliqueTree(int [] order, Set [] cliques, Set [] separators) {
int nNodes = order.length;
int [] parentCliques = new int[nNodes];
//for (int i = nNodes - 1; i >= 0; i--) {
for (int i = 0; i < nNodes; i++) {
int iNode = order[i];
parentCliques[iNode] = -1;
if (cliques[iNode] != null && separato... | 7 |
public void fillSuccessors() {
if (jump != null)
flowBlock.addSuccessor(jump);
StructuredBlock[] subs = getSubBlocks();
for (int i = 0; i < subs.length; i++) {
subs[i].fillSuccessors();
}
} | 2 |
public byte getCHRMappedMemory(int address, boolean isDirect) {
// read BEFORE we potentially bank switch
byte b = chrData[((address < 0x1000) ? lowBank : highBank) * 0x1000 + (address & 0xFFF)];
if(! isDirect) {
//PPU reads $0FD0 through $0FDF: latch 0 is set to $FD for subsequent reads... | 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 Object setAccelerator(String section,String tool,KeyStroke key) {
int i;
for(i=0;i<_tb.size() && !_tb.get(i).name().equals(section);i++);
if (i==_tb.size()) {
return null;
} else {
toolbarSection sec=_tb.get(i);
for(i=0;i<sec.size() && (sec.get(i)==null ? true : (!sec.get(i).getName().equals(too... | 8 |
public void setSaleTime(Timestamp saleTime) {
this.saleTime = saleTime;
} | 0 |
public static boolean polygonIntersectPolygon(Polygon p1, Polygon p2) {
Point p;
for (int i = 0; i < p2.npoints; i++) {
p = new Point(p2.xpoints[i], p2.ypoints[i]);
if (p1.contains(p))
return true;
}
for (int i = 0; i < p1.npoints; i++) {
p = new Point(p1.xpoints[i], p1.ypoints[i]);
if (p2.conta... | 4 |
@Test(groups = {"Regression", "Smoke"})
public void testNavigatingToRepeatingTab() throws Exception {
// Initialize the servers
initializeDriver();
// Define variables
String userName = GenericFunctions.props.getProperty(CommonConstants.DEFAULT_LOGIN_USER_NAME);
String email... | 2 |
public String toString() {
if (!reversed) {
reverse();
}
Element tmp = firstElement;
String result = "";
while (tmp != null) {
result += tmp.getValue() + " ";
tmp = tmp.getNextElement();
}
return result;
} | 2 |
public void saveToFile(File f) {
try {
File out = new File(f.getPath() + System.getProperty("file.separator") + getRuleName() + ".rule");
try (BufferedWriter bw = new BufferedWriter(new FileWriter(out, false))) {
bw.write(getRuleName()); bw.newLine();
bw.w... | 2 |
protected ConclusionType evaluateAmbiguousConclusionsByModality(Literal literal, ConclusionType conclusionType, //
Collection<Literal> conflictLiterals) throws ReasoningEngineException {
// no need to perform literal modal operators comparisons if the conclusion type is already negative
if (conclusionType.isNega... | 7 |
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.