method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
62f7c9a1-0fb8-4db1-8c8b-9a3bf1a4d674 | 7 | 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... |
a52bba57-30bb-4330-a63c-b681350c6f61 | 9 | 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... |
d4a0124c-ef87-46a1-b377-de444274352c | 5 | 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... |
8b998f45-85ea-4cab-af24-aba899a2cd6d | 0 | public void setAgents (Vector v) {
agents = v;
} |
ff2dc88e-7749-4946-83e6-f1fc75294b48 | 4 | 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... |
c51ac198-df3d-41bf-9509-edc81ee69785 | 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
{
... |
aa43f33d-c142-45bb-9654-0d603405f113 | 2 | 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;
} |
0321ad12-9833-46a0-b9d7-075f269fb0b7 | 6 | 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... |
95d197a7-298b-43a2-813c-73c53bc96f45 | 1 | public Placeable getPlaceableById(String id) {
if (placeables.containsKey(id)) {
Placeable placeable = placeables.get(id);
return placeable;
} else {
return null;
}
} |
80d7f1b5-c084-478e-9e67-81b6d1cb511d | 8 | 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.... |
4b6f716f-78b8-44b0-837c-ac60fc573b36 | 9 | 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... |
b141ee55-a0fe-48e4-b2ca-8c9255847694 | 1 | 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();
} |
62e4b98b-4f7b-4363-8193-bae6df3429bd | 5 | 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++)... |
0cca9855-f327-491e-b663-1fba930fc3ff | 1 | public boolean ModificarDetallePunto(DetallePunto p){
if (p!=null) {
cx.Modificar(p);
return true;
}else {
return false;
}
} |
9f254215-6e9c-4dee-88cc-d66204ecb372 | 7 | 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)... |
c470fb5f-b194-4106-aafe-f5fa6da118ad | 0 | @BeforeClass
public static void setUpClass() {
} |
9f1bcac4-9a3b-4c3c-95c8-7d493751f1db | 6 | 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;
... |
51a09d73-583e-4fc3-b766-2cbbf9fe359f | 4 | 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... |
2bea63cb-241c-4bc4-a8fa-abdbecaf05d6 | 0 | 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);
} |
70f63f6d-5d68-408d-b678-e3a400f2d486 | 6 | @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... |
cb5226aa-e1a2-409a-aabd-36bc1256396a | 7 | 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) {... |
7b386b9b-8930-435c-9586-92fe4959bfc0 | 2 | public BigDecimal getResult() throws CalculatorException, BinaryOperatorException {
while (!expressionStack.operatorStack.isEmpty()) {
evaluateOperator();
}
if (!expressionStack.bracketStack.isEmpty()) {
throw new BinaryOperatorException("missing closed bracket");
... |
a2264ad3-bf7f-4f52-8667-efd007622339 | 9 | @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... |
d78c2070-aa06-44f0-ae05-8c5ceca4b853 | 0 | public String getPatientID(){
return HKID;
} |
c59106cd-aea1-484b-8d32-85133e6ec26f | 5 | 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... |
3c4b6f81-74f3-4c80-869d-c95925ef4d5d | 4 | 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... |
44a7c047-b917-4166-9030-2ecd78e47c3b | 0 | public String getType()
{
return TYPE;
} |
1cf87430-df2d-471b-bd2d-feedc1835aaf | 9 | @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... |
4063aa35-cc59-44ab-8937-7c02cb14f706 | 1 | 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;
} |
87889ce9-7200-41bb-8f7c-5211ff6c4263 | 7 | 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 ... |
c1bc6289-1ba5-4d5a-81d4-fc36194ed04c | 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++) {
... |
c665e64d-b35a-4e52-8b67-a699ea8717f7 | 0 | public void playStartSound()
{
startClip.start();
} |
92f00600-4c32-41a1-bc67-495e3614d506 | 1 | 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();
... |
b93d152f-0b17-455c-9c90-64b4d3f4d30b | 8 | @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());
... |
674e4243-92f9-48bf-ab30-7aa691508e83 | 9 | 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... |
b65345d0-dee1-4fee-a651-74c2eca25746 | 3 | 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... |
67339cfa-ea60-4d2c-951b-cdec63e12850 | 0 | public String getAuthority() {
return this.authority;
} |
1adfd910-7b6d-4518-8e69-12ceada5e7ab | 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);
} |
7888d583-0654-46ea-bd5e-38ec93c8c332 | 7 | 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(... |
b510b5b7-31d3-4f9c-bb4a-1c39ec58d721 | 8 | 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... |
d43912d7-a810-49b7-8d89-f47308e7f2c6 | 3 | 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 (... |
62f6f87c-13d0-48c4-ac9c-e1ebbadf9ccd | 7 | 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;
... |
3162c73a-89f2-4dc2-8823-6c091a3d44f1 | 0 | public long getFileSize() {
return this.fileSize;
} |
d3a4e4b9-7ab8-4e94-84a2-0aa773db8ac0 | 5 | 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 = ... |
84cd781a-3f74-459a-b3db-051e8dd61d48 | 4 | public supplier browseSupplier(String supplierName) throws SQLException{
supplier searchedSupplier=null;
try{
databaseConnector=myConnector.getConnection();
stmnt=(Statement) databaseConnector.createStatement();
SQLQuery="SELECT * FROM familydoctor.supplier W... |
dc83d4ae-a91f-4d97-9cfb-cea992f20543 | 5 | 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"))... |
35e2f32f-775e-4ede-a2dc-848f37f06869 | 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[... |
1b53f71c-c098-4b8d-ace5-1318130a81e0 | 6 | 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... |
07f24f01-9c56-402e-ba4b-e295bd1668a7 | 4 | 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;
}... |
da9db72d-92d8-4e3a-a668-530ff4b536db | 3 | 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... |
602836e7-a580-4170-ab1c-27f05e1f6fe1 | 4 | 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();
}
} |
1c631ce6-3edb-408b-a144-e2a4d758c4d5 | 8 | 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), ... |
72a17236-ab2f-48d9-b69d-1e25b68e588e | 7 | 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){
... |
b6212597-a252-42bf-9403-a311c637aef3 | 6 | public void entitiesModified(Iterable<SimpleEntity> entities) {
for (SimpleEntity entity : entities) {
if (entitiesInIndex.contains(entity)) {
if (!entity.exists) {
entitiesInIndex.remove(entity);
} else if (!hasAllComponents(entity)) {
... |
7d587d2a-6178-45c3-8189-4376a189429f | 8 | 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;
... |
b621d056-b630-4e52-9109-bf0baa157e6b | 5 | 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... |
72de487c-6bab-4384-b5f2-4ff1937e2111 | 7 | 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... |
cbef129c-0668-4389-873b-ff399d7830fc | 6 | 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... |
94b6ba30-6737-48b3-82c8-f22efdba130f | 7 | public boolean addItemStackToInventory(ItemStack par1ItemStack)
{
int var2;
if (par1ItemStack.isItemDamaged())
{
var2 = this.getFirstEmptyStack();
if (var2 >= 0)
{
this.mainInventory[var2] = ItemStack.copyItemStack(par1ItemStack);
... |
954a5f68-6149-43f7-be2b-d01ba617f3b2 | 7 | public static boolean partialArgumentsUnifyWithArgumentsP(Proposition subproposition, Proposition referenceproposition) {
{ PatternRecord patternrecord = ((QueryIterator)(Logic.$QUERYITERATOR$.get())).currentPatternRecord;
int ubstackoffset = patternrecord.topUnbindingStackOffset;
boolean successP = fal... |
f70fb24b-1171-44f8-aa3e-f8488ccfe0fb | 0 | public String goToAdminUpdateProduct() {
this.product = this.userFacade.getProductById(this.id);
this.setPropertyFromProduct();
return "adminUpdateProduct";
} |
b761db9a-0f5d-43f2-8567-4547def8258b | 0 | public void setMessage(String message){ this.Message = message; } |
713b2994-3a00-4b6e-91ae-52e4293e4f33 | 1 | public void visitEnd() {
super.visitEnd();
if (mv != null) {
mv.visitEnd();
}
} |
42bf39fc-1c89-47b9-ac88-98066399e9d6 | 3 | @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... |
79f3f2b2-b6f8-4cd8-8a0d-46d6e55a1ca3 | 6 | 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 =... |
59fb0cd6-60a1-44fb-af84-3557c348194e | 2 | 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... |
2eb42010-5ab3-4481-908a-4eaef1d18be3 | 1 | @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();
}
} |
efffec3f-ad5f-4d15-8d01-46787942b79e | 9 | 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... |
7400a496-f8e6-4e5c-89be-84f746516b87 | 3 | 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);
... |
4ee823fb-7390-484d-a870-d638e247796e | 0 | public String getFooter() {
return footer;
} |
275dcc60-7465-4d4f-81b3-f2436c33ea8d | 9 | public DERObject getDERObject()
{
if (seq == null)
{
ASN1EncodableVector vec = new ASN1EncodableVector();
for (int i = 0; i != ordering.size(); i++)
{
ASN1EncodableVector v = new ASN1EncodableVector();
DERObjectIdentifier ... |
7f7fbe4f-b795-4118-9662-f46be4fae1fa | 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);... |
37fe2efd-e08c-48c3-831b-4dde3d35b09d | 4 | 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... |
c12c6ba7-306b-4c52-9482-4b1f0b9fdb73 | 5 | /* */ @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(... |
ad1533c3-5842-40e7-9fa4-172fc6656f3c | 9 | 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... |
221f0996-30b7-487c-a0dc-c59d7aa16194 | 6 | @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(... |
7d855861-0be1-4a1a-8d3e-03f4d5a8359d | 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;
} |
dbaf1974-f6f0-4a9e-9007-1b972a22276c | 0 | public boolean getEcho() {return this.echoToConsole;} |
efb025d4-08ba-4236-8915-2b58dbcbb4fa | 3 | @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... |
26a804d2-fcc0-42f0-80b1-55e5047f871f | 1 | private static void writeHeader(ObjectOutputStream oos, int[] header) throws IOException
{
for(int i = 0; i < 128; i++)
{
oos.writeInt(header[i]);
}
oos.writeInt(textLength);
} |
2288b274-dc52-4eba-9afd-a562bc612b78 | 5 | 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 ... |
5fe3f79b-65dd-48e1-a961-023a590f173b | 9 | 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... |
3992c269-b39f-4d70-b0f5-807cf1b74d1c | 7 | */
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);
}
... |
a813adef-a799-4937-8a97-3dae8ca57da3 | 2 | private boolean isAURIMatch(Request request) {
for (String uri : getRouteKeySet(request)) {
if (request.getURI().equals(uri)) {
return true;
}
}
return false;
} |
ea001047-9322-4fbe-8731-af254b2fff92 | 3 | 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);
... |
a36eb9a6-454a-40cd-af5f-cbbac46bb3bb | 9 | 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... |
8856d092-64c4-454d-aa9b-0f5f0efa1020 | 8 | 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... |
431a0273-f0b8-4b97-8354-999cb4776096 | 0 | public String getPrenom() {
return prenom;
} |
4af5b4a7-45f2-4175-a032-18a1e8b46017 | 4 | * @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... |
0542bcae-4cc6-492e-8a4c-d8f2340f2c63 | 7 | 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... |
c4803f26-8d26-4afe-9956-db58f2133ce9 | 2 | public void fillSuccessors() {
if (jump != null)
flowBlock.addSuccessor(jump);
StructuredBlock[] subs = getSubBlocks();
for (int i = 0; i < subs.length; i++) {
subs[i].fillSuccessors();
}
} |
8c5be155-c6ee-468b-b033-01c543f9d232 | 6 | 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... |
66f7b80b-4f5c-4952-9406-29836171876b | 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... |
c1f956ed-4e7a-472c-9817-6c51f2a2429d | 8 | 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... |
92438148-09ad-467d-b2a5-6320e8b50bcb | 0 | public void setSaleTime(Timestamp saleTime) {
this.saleTime = saleTime;
} |
d4cd60ad-1e36-4fef-9d1b-9a251143294d | 4 | 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... |
575b2648-c2a5-43a1-bdce-b94521ea3052 | 2 | @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... |
cbf93b1c-bf85-467e-8444-ab5b815a2a03 | 2 | public String toString() {
if (!reversed) {
reverse();
}
Element tmp = firstElement;
String result = "";
while (tmp != null) {
result += tmp.getValue() + " ";
tmp = tmp.getNextElement();
}
return result;
} |
66258c64-123d-47c8-a1b1-0457fb2fca21 | 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... |
e421128c-6533-448e-b1c2-1b8bc13af16c | 7 | 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.