method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
b8f372dd-6fe1-45b6-874e-4c9fae859969 | 0 | @Override
public void onFinish() {
} |
fa99aaa5-d8e8-4184-9894-57f7aa42ab46 | 1 | public void moveLeft() {
if (ducked == false) {
speedX = -MOVESPEED;
}
} |
3fb8f4e4-bde6-432f-b6c7-69870876314a | 9 | @Override
public boolean write(DummyObjectList dummyObjects, TileMap tileMap) {
try {
FileOutputStream f = new FileOutputStream(path);
// byte 1:
// number of objects
f.write((byte)dummyObjects.size());
// byte 2 -> 2+(byte 1)*12 (12 bytes per object)
// objects data
/... |
ce5cac69-f7f6-407d-b803-7d937c1d5d93 | 8 | private static int getMax(String s, int start)
{
char color = 'x';
int cur;
for (cur=start; cur<s.length(); cur++) {
char bead = s.charAt(cur);
if (bead != 'w') {
if (color == 'x')
color = s.charAt(cur);
else if (bead != color)
break;
}
}
... |
8c996bf1-a427-4afa-974f-cde006f2fdef | 9 | public int parseCryptInfo(RdpPacket_Localised data)
throws RdesktopException {
// logger.debug("Secure.parseCryptInfo");
int encryption_level = 0, random_length = 0, RSA_info_length = 0;
int tag = 0, length = 0;
int next_tag = 0, end = 0;
int rc4_key_size = 0;
rc4_key_size = data.getLittleEndian32(); //... |
1d7da2c6-14d6-4430-aef6-d47fb3b46873 | 7 | public static double getSimilarity(String fileName1, String fileName2)throws IOException
{
double score=0;
HashMap<String, Double> weightmap1 = new HashMap<String, Double>();
HashMap<String, Double> weightmap2 = new HashMap<String, Double>();
ArrayList<String> lines=new ArrayList();
try{
InputStream ip... |
25c64624-192e-46e4-aced-465199ad301a | 0 | @Override
public void deiconifyFrame(JInternalFrame f) {
//System.out.println("deiconifyFrame");
super.deiconifyFrame(f);
updateDesktopSize(false);
} |
78c62348-88d2-473a-b3ca-4ebb06fb0319 | 1 | public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
Persistence.getInstance();
MainWindow frame = new MainWindow();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
} |
8c41c709-9a1b-4d60-ae70-90864658ed50 | 8 | protected List<Integer> getAllPrimes() {
boolean[] sito = new boolean[N];
mapa = new int[N];
for (int i = 1; i < sito.length; i++) {
sito[i] = true;
mapa[i] = 1;
}
ArrayList<Integer> list = new ArrayList<Integer>();
for (int i = 0; i < sito.length; i++) {
if (sito[i]) {
int i1 = i + 1;
l... |
e6f6799f-94b2-4acb-bec6-7300edde517b | 2 | public RegExFind(String args[]) {
// Get input from the console
String startingPath = ConsoleTools.getNonEmptyInput("Enter starting path: ");
String query = ConsoleTools.getNonEmptyInput("Enter Regular Expression: ");
String[] fileExtensions = ConsoleTools.getSeriesOfInputs("Enter file extension to match: ")... |
163c3e7f-5857-4c43-9193-4dd7d85a7e32 | 5 | public void setOn(boolean paramBoolean)
{
if (this.OnImage != null)
{
if ((paramBoolean) && (!this.On))
{
this.On = true;
super.setImage(this.OnImage);
return;
}
if ((!paramBoolean) && (this.On))
{
this.On = false;
super.setImage(this.Nor... |
9b67c31b-5875-4fd6-9588-317b5fe42bd3 | 1 | public static ArrayList<Platform> getPlatformSector(Point p) {
if(platformMap.containsKey(p)) {
return platformMap.get(p);
} else {
return new ArrayList<Platform>();
}
} |
564c0f8d-6a4b-44b5-bc5b-f5b8b5ccb3ec | 1 | private boolean jj_2_2(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_2(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(1, xla); }
} |
e12cf1db-d06c-4dd5-a692-792caa8ffec0 | 3 | @Override
public String process(String content) throws ProcessorException {
pipeline = new SimpleAuthenticationPipeline();
context = new UnAuthorizeContext();
pipeline.setBasic(new LogoutEntryValve());
pipeline.addValve(new DecoderValve());
pipeline.addValve(new ValidationValve());
pipeline.addValve(new Un... |
616c64a5-dafb-46ae-be4e-ef4bfcf23131 | 1 | public Karel()
{
this.setTitle("Karel");
initComponents();
InitUI();
Timer Gemupdater = new Timer(49, new ActionListener()
{
@Override
public void actionPerformed(ActionEvent evt)
{
StepCount.setText("" + world.getStepCount());
... |
12fe1208-b7fe-4e6a-8611-0c4ebf898496 | 7 | public void update() {
System.out.println("Updating resultpanel");
hashedFiles = controller.getFiles();
ArrayList<HashedFile> trackTemp = new ArrayList<>();
for(HashedFile hashedFile : hashedFiles){
if(hashedFile.amITracked() && myLocation == 1){
trackTemp.ad... |
b36e30e2-04ed-4a5f-b86b-53d7093a42f7 | 5 | public ListItem binarySearchArray(String targetItem) {
System.out.println("Binary Search for " + targetItem + ".");
ListItem currentItem = null;
boolean isFound = false;
int counter = 0;
int low = 0;
int high = items.length - 1;
while ((!isFound) && (low <= high)) {
int mid = Math.round((high + low) /... |
0c873f49-95e4-4245-ad48-8dcc81cc7d5a | 4 | public Simulateable findCollidingElement(Simulateable me) {
for (PhysicsElement e: elements)
if ( e instanceof Simulateable) {
Simulateable b = (Simulateable) e;
if ((b!=me) && b.collide(me)) return b;
}
return null;
} |
0fa5a442-6c92-494a-9432-91f2895166d5 | 9 | void createControlGroup () {
/*
* Create the "Control" group. This is the group on the
* right half of each example tab. It consists of the
* "Style" group, the "Other" group and the "Size" group.
*/
controlGroup = new Group (tabFolderPage, SWT.NONE);
controlGroup.setLayout (new GridLayout (2, tr... |
90649369-c8b8-4a15-a5cf-965810b2dcfb | 4 | private void initialiseRandom() {
int N = (int)(double)network.params.get("N");
double p = (double)network.params.get("p");
IndividualNetworkAgent[] vertices = new IndividualNetworkAgent[N];
for (int i = 0; i < N; i++) {
IndividualNetworkAgent v = new Individ... |
19b443ea-c1bb-4ad5-947b-fb3bcb8b45f9 | 9 | @Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Movie movie = (Movie) o;
if (director != null ? !director.equals(movie.director) : movie.director != null) return false;
if (name != null ? !na... |
30713cc8-e75f-4f5a-b017-98e193060a99 | 3 | public List<Horario> pesquisaHorariosProfessor(String matriculaProf)
throws ProfessorInexistenteException {
List<Horario> horarioDoProfessor = new ArrayList<Horario>();
boolean flag = false;
for (Professor prof : this.professores) {
if (prof.getMatricula().equals(matriculaProf)) {
horarioDoProfessor = p... |
ede5f4b4-9128-4665-8551-d759ca1219db | 7 | @Override
public void actionPerformed(ActionEvent e) {
//System.out.println("HomeAction");
OutlinerCellRendererImpl textArea = null;
boolean isIconFocused = true;
Component c = (Component) e.getSource();
if (c instanceof OutlineButton) {
textArea = ((OutlineButton) c).renderer;
} else if (c instance... |
ca191921-23dc-4d04-812b-d49f705aa36a | 0 | public void setCap(String cap) {
this.cap = cap;
} |
dd7b8882-606e-4c28-bb8f-a23fcb22f8a4 | 0 | public Location randomAdjacentLocation(Location location)
{
List<Location> adjacent = adjacentLocations(location);
return adjacent.get(0);
} |
ece10800-b6e9-4e20-ab85-c264fd4f8efd | 3 | private void free() {
if (pane != null) {
coords = block.getCoords();
for (Point p : coords) {
if (pane.insertAt().x != -1) {
pane.cell(maxFall.y + p.y, location.x + p.x).Clear();
}
pane.cell(location.y + p.y, location.x + p.x).Clear();
}
}
} |
d1c18b6f-8656-49d0-ad16-60e98190f094 | 3 | public void addRoll(int pins) {
rolls.add(newRoll(pins));
if(rolls.size() == 2){
if(isSpare() || isStrike())
this.MAX_ROLL++;
}
} |
0868eee9-708b-4fa5-ab20-8444da4fc1c1 | 7 | private void jButtonAddUsuarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAddUsuarioActionPerformed
// TODO add your handling code here:
if(jTextFieldCod.getText() == null || jTextFieldCod.getText().equals("")){
jLabelErro.setErrorText(WORDS.getString("ERRO-CODI... |
57cf08fb-76f5-4b53-bace-cb6f4a9c036f | 2 | public void unloadHUD(String n) {
HUD hud = null;
//start from the top and work our way down to "layer" the huds
for (int i = (huds.size() - 1); i >= 0; i--) {
hud = huds.get(i);
if (hud.getName().equals(n)) {
hud.shouldRender = false;
hud... |
ee5136f6-8c4e-40a2-9c3f-b99121173a86 | 0 | public void setContract(String contract) {
this.contract = contract;
} |
ed1ea137-73dc-4fdd-9717-1f3fb8f396fa | 4 | public static void main(String[] args)
{
HashMap<String, String> test_map = new HashMap<String, String>();
test_map.put("1", "test1");
test_map.put("2", "test2");
test_map.put("3", "test3");
test_map.put("4", "test4");
Set mapset = test_map.entrySet();
... |
1e36775a-f744-408b-9833-f2c4fba218a9 | 2 | public void testAddPeriodConverterSecurity() {
if (OLD_JDK) {
return;
}
try {
Policy.setPolicy(RESTRICT);
System.setSecurityManager(new SecurityManager());
ConverterManager.getInstance().addPeriodConverter(StringConverter.INSTANCE);
fai... |
38a679f0-f0a5-4f63-ad94-06ada2fb17e0 | 2 | public boolean isInfinite() {
return Double.isInfinite(x) || Double.isInfinite(y) || Double.isInfinite(z);
} |
b7b1c6b0-c820-468e-8552-3ec7ab153158 | 9 | @Override
public int compare(String t1, String t2)
{
int result;
switch (type)
{
case SERVER:
Server s1 = Preferences.getInstance().getServer(t1);
Server s2 = Preferences.getInstance().getServer(t2);
// If both are enabled, sort by name
if (s1.isEnabled() && s2.isEnabled() || (!s1.isEnabled()... |
1f46726a-bdd9-4757-b810-0ff6ba783a70 | 8 | @Override
public boolean okMessage(final Environmental myHost, final CMMsg msg)
{
if(!(affected instanceof MOB))
return true;
final MOB mob=(MOB)affected;
// when this spell is on a MOBs Affected list,
// it should consistantly prevent the mob
// from trying to do ANYTHING except sleep
if(msg.amISour... |
c5f43cca-ad1b-4815-9b53-e2859df8b0b8 | 9 | public long get(int desde, int hasta) {
pasos++;
if(flag)
propagar(setValue);
if(desde==cotaDesde&&hasta==cotaHasta)
return value;
if(izq!=null&&izq.cotaDesde<=desde&&izq.cotaHasta>=hasta)
return izq.get(desde, hasta);
else if(der!=null&&der.cotaDesde<=desde&&der.cotaHasta>=hasta)
retu... |
2e91bafc-8ef7-4161-8c9f-9824b80f6a1c | 9 | public Creep findCreep() {
if (locked && lastCreep != null && tower.getContext().getCreeps().contains(lastCreep) && lastCreep.isValidTarget()) {
float distanceMin = tower.getRange() * tower.getRange();
float dX = (lastCreep.getX() + Grid.SIZE / 2) - (tower.getGrid().getLocation()[0] + Gr... |
16b77025-c637-41e5-8360-cf2f13fc3237 | 6 | public static void addByChance(LivingEntity entity, MobAbilityConfig ma)
{
if (ma == null || entity instanceof Creeper == false)
return;
if (ma.chargedRate <= 1.0 && ma.chargedRate != 0.0)
{
// If the random number is lower than the angry chance we make shit angry
if (ma.chargedRate == 1.0F || Random... |
e83ab7b2-3876-4652-a83b-406b0f4510ba | 5 | public Matrix inverse() {
if(!isInvertable())
throw new IllegalArgumentException("Cannot invert matrix");
Matrix inv = new Matrix(numRows, numColumns);
if(numRows == 1) {
inv.set(0, 0, 1 / elements[0][0]);
return inv;
}
float det = getDeterminant();
for(int i = 0; i < numRows; i++) {
for(i... |
b782cd36-7ca0-4caf-a828-afc8db6918cd | 0 | @XmlTransient
public Collection<Paciente> getPacienteCollection() {
return pacienteCollection;
} |
f701cf52-4fa4-4dcf-b396-52ea9ced9cd9 | 0 | public void execute() {
receiver.turnOff();
} |
5c46b15f-640e-45dd-bb4d-e07135c12976 | 2 | public ClassAnalyzer getInnerClassAnalyzer(String name) {
/** require name != null; **/
int innerCount = inners.length;
for (int i = 0; i < innerCount; i++) {
if (inners[i].name.equals(name))
return inners[i];
}
return null;
} |
aea8fd74-c730-4363-ac03-cb92afd8776a | 3 | @Override
public void update(final Observable o, final Object arg) {
if (!SwingUtilities.isEventDispatchThread()) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
update(o, arg);
}
});
... |
dbf661e5-ebe8-4a54-8427-b5e9938e37e2 | 7 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Address other = (Address) obj;
if (ipAddress == null) {
if (other.ipAddress != null)
return false;
} else if (!ipAddress.equals(other.ip... |
362d6bc1-4df4-42db-9aad-d4634ebb128b | 6 | @Override
public boolean accept( File file ) {
if ( file.exists() ) {
if (file.isDirectory() ) return true;
if ( !file.isFile() ) return false;
}
if ( exts == null ) return true;
String filename = file.getName();
for (int i=0; i < exts.length; i++) {
if ( filename.endsWith(exts[i]) ) return true;
... |
664f4a1f-b661-4cc6-85ba-6546bc522628 | 4 | private LynkStaticIntelliHints(JTextField textField, List<?> items, int comboBoxNum) {
super(textField, comboBoxNum);
this.items = items;
textField.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
super.mouseClicked(e);
if(SwingUtilities.isLeftMouseButton(e) ... |
89391994-76ae-4419-8594-fd6caef491a2 | 4 | @Override
public byte[] getData()
{
if (ptr != 0) {
return null;
} else {
if (isConstant()) {
if (length > getMaxSizeOf32bitArray()) return null;
byte[] out = new byte[(int) length];
for (int i = 0; i < length; i++) {
... |
bb12f526-c5a2-42d6-978f-bbcdf253d171 | 6 | public static void main(String args[]) throws Exception{
/* 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.
* Fo... |
62750026-55b2-4caa-b9ab-7a5075a6864e | 4 | @Override
public void execute() {
seq(new EflSelectPcMonOperationSegment(PC_MON_DEPOSIT));
seqSample(() -> {
int numMons = curGb.readMemory(curGb.pokemon.numPartyMonAddress);
for (int i = 0; i < numMons; i++) {
int curMon = curGb.readMemory(curGb.pokemon.numPartyMonAddress + i + 1);
... |
0741a32f-b490-4282-bdef-d25a29c0725c | 9 | private String doExportString( String text ) {
Matcher localMatcher = LOCALHOST_REGEX.matcher( text );
if ( localMatcher.matches() ) {
return localMatcher.group( 1 ) + host_ + localMatcher.group( 3 );
}
else if ( exportFiles_ && FILE_REGEX.matcher( text ).matches() ) {
... |
f672ec22-301f-4dca-a5e7-b2374325d6d1 | 9 | public static Stack<MrUrl> buildJobs() {
Stack<MrUrl> jobStack = new Stack<MrUrl>();
Logger log = null;
try {
Properties PropertyHandler = new Properties();
PropertyHandler.load(new FileInputStream(propertiesMain));
String logPath = PropertyHandler.getProperty("logPath");
PropertyConfigurator.config... |
99572607-374a-435b-ae35-9589a907e577 | 7 | private void formMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_formMouseClicked
if ( this.card != null && !this.card.isMatched() && this.card.isPlayable() ) {
// Set the clicked card as selected.
game.setSelected(game.selectCard(this.card));
// Check if th... |
b6280d10-2f2c-4b84-9ca9-bfa701355658 | 7 | public int Connect()
{
System.out.println(Adapter_to_config.getInstance().GetActiveConnect());
if(ourInstance.log_reader != null && ourInstance.log_reader.IsConnected() && !conected_to.equals(Adapter_to_config.getInstance().GetActiveConnect()))
Disconnect();
if(ourInstance.log_... |
6e57a55b-e862-4bd2-9a64-36d59532331b | 0 | public String toString() {
return " at " + this.index + " [character " + this.character + " line " +
this.line + "]";
} |
a06cb03a-23cc-40cc-84d2-f491f2bab6ff | 3 | private int pickFruit()
{
// generate a prefix sum
int[] prefixsum = new int[FRUIT_NAMES.length];
prefixsum[0] = currentFruits[0];
for (int i = 1; i != FRUIT_NAMES.length; ++i)
prefixsum[i] = prefixsum[i-1] + currentFruits[i];
int currentFruitCount = prefixsum[FR... |
1ceaeb23-a767-4311-962f-42fc66582bc3 | 1 | public void disconnect() {
for (ConnectionProcessor pipe : pipes) {
pipe.disconnect();
}
} |
62f194a0-7927-4d30-98a0-03d0f8f1faca | 1 | private void batch() {
for (int r=0; r<RUNS; r++) {
TIME = System.nanoTime();
createFht();
insert();
fht.prune();
System.out.println(fht.toString());
get();
System.gc();
TIME = mem(TIME);
}
} |
1cc24584-5b23-4c12-912b-b6c599b364aa | 8 | @Override
public void update(GameContainer gc, int DELTA) throws SlickException {
Input input= gc.getInput();
level.Update(DELTA, x, y);
if(input.isKeyDown(Input.KEY_LEFT) && x < 0) x+=4;
if(input.isKeyDown(Input.KEY_RIGHT) && x > -768) x-=4;
if(input.isKeyDown(Input.KEY_DOWN) && y > - 512) y-=4;
if(inp... |
8586f31b-07e8-4a8b-96ea-a4261ae54d47 | 1 | public static void spawnZombieGiant (Location loc, int amount) {
int i = 0;
while (i < amount) {
Giant giant = (Giant) loc.getWorld().spawnEntity(loc, EntityType.GIANT);
giant.setHealth(100);
giant.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 2147483647, 3... |
e5e7d7f7-a267-492a-9de0-82cc4ac3a46d | 6 | @SuppressWarnings("unchecked")
private Map<OrderPreviewField, String> getMarketPreviewOrderPaths(Document doc) throws UtilityException
{
Map<OrderPreviewField, String> toReturn = new HashMap<OrderPreviewField, String>();
for (OrderPreviewField f : OrderPreviewField.values())
{
String path = f.getPath();
i... |
bde5f2b4-5748-410b-813e-1085870bf01c | 2 | public void addLast(Item item) {
if (item == null)
throw new NullPointerException();
if (isEmpty())
addFirst(item);
else {
Node<Item> node = new Node<Item>();
node.item = item;
node.prev = last;
last.next = node;
... |
f4436fb8-c4aa-4988-acfd-a78bdb51aec2 | 9 | private boolean checkTextFields() {
if(firstnameField.getText().length() == 0 || lastnameField.getText().length() == 0 ||
emailField.getText().length() == 0 || addressField.getText().length() == 0 ||
cityField.getText().length() == 0 || stateField.getText().length() == 0 ||
zipField.getText().length() == ... |
ef92ff91-6e0b-4fe0-9c0d-fd34ae43185f | 1 | private static void initBilinear(Composite inComposite, int heightHint) {
final Composite toolbar = new Composite(inComposite, SWT.BORDER);
final Composite imageContainer = new Composite(inComposite, SWT.BORDER);
GridData toolbarGridData = new GridData(GridData.FILL_HORIZONTAL);
toolbarGridData.grabExcessHoriz... |
d6d7ee7b-7945-4ff4-9593-e17bde9daf62 | 7 | @Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
final Room target=mob.location();
if(target==null)
return false;
if(target.fetchEffect(ID())!=null)
{
mob.tell(L("This place is already under a blessing of mercy."));
return false;
}
... |
6668c4ce-16c2-4615-b1ea-f1f4be858e7e | 4 | public void kornErntenUndVerteilen()
{
int anzahlFelder = zaehleGebaeude( 1 );
int anzahlKornkammern = zaehleGebaeude( 3 );
int maxLagerMengeInKornkammer = new Kornkammer().getMaxLagermenge();
int ernteMitDuenger = 0;
int benoetigteKornkammern = 0;
int ernte = anzahlFelder * new Feld().getKornProRunde();
... |
f5a412fc-1a81-47b1-b8ea-7eaba702cd7a | 1 | public void fixContainer(Role container){
if(this.container == null){
this.container = container;
} else {
System.out.println("erreur de logique 1");
}
} |
cbb3c28d-bd08-487f-80a2-52c0ee88d188 | 6 | public List<List<SetCard>> findMatches() {
//don't even bother if there aren't enough cards
if (cards.size() < 3) {
return null;
}
/*
* iterate through all of the cards, getting all possible permutations
* of SetCards...
*/
for (int i = 0; i < cards.size(); i++) {
SetCard card1 = cards.ge... |
ad410311-a06c-4349-9797-fd33049dfeb0 | 1 | public void save() {
input = "@Input:";
if(chckbxIntegersOnly.isSelected())
input += "true";
else
input += "false";
} |
006a8b23-2a91-41a5-8f60-3b048cfc42da | 7 | public static boolean loadMapsFromConfig(){
maps.clear();
String mapNames = PKSQLd.getUnparsedData(";ALLMAPNAMES;");
if(mapNames == null || mapNames.length() == 0) return false;
String[] split = mapNames.split(";");
if(split.length == 0) return false;
for(String s : split){
if(!s.equals("")){
String ... |
2cc55577-2829-4b6a-bab7-61f8e93e72af | 4 | private static boolean rightOrder(String one, String two) {
for(int i = 0; i < Math.min(one.length(), two.length()); i++) {
char onechar = one.charAt(i);
char twochar = two.charAt(i);
if(onechar > twochar)
return false;
else if(twochar > onechar)
return true;
}
return (one.length() >... |
6c507ef8-f59f-4555-a54f-1ac9d76fb1c6 | 5 | public static ArrayList<BookCopy> searchBookByAuthor(String author){
try {
if(conn == null || conn.isClosed()){
conn = DatabaseConnection.getConnection();
}
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
ArrayList<BookCopy> books... |
16ef6dd8-648c-4cdd-baa6-e7f9a84d0475 | 8 | public int readBits(int numBits) {
if (numBits < 1 || numBits > 32) {
throw new IllegalArgumentException();
}
int result = 0;
// First, read remainder from current byte
if (bitOffset > 0) {
int bitsLeft = 8 - bitOffset;
int toRead = numBits < bitsLeft ? numBits : bitsLeft;
... |
b4e28358-0af4-41ca-ba8e-4d9b5b8620c3 | 6 | private boolean hasSufficientSimilarity(float coverage, PDFEntryHolder entryHolder, boolean isMalformed)
{
float minCoverage = 0.99f;
// text does have difference min coverage depending on their length
if(entryHolder instanceof PDFTextHolder)
{
// SIMPLE mode
if(isSimpleComparison)
{
// broken ... |
8f6e63c6-5da3-4fe6-bde1-38d4beedf9a2 | 2 | private int[][] initSubMatrix(final int[][] origin, int iStart, int iEnd, int jStart, int jEnd) {
int[][] subMatrix = new int[iEnd - iStart][jEnd - jStart];
for (int i = iStart; i < iEnd; ++i)
for (int j = jStart; j < jEnd; ++j)
subMatrix[i-iStart][j-jStart] = origin[i][j];
... |
6e358c7d-83f3-4bcb-8054-f237b026f473 | 7 | private void attackUpdate(Vector3f orientation, float distance){
double time = ((double)Time.getTime())/((double)Time.SECOND);
double timeDecimals = time - (double)((int)time);
if(timeDecimals < 0.25) {
canAttack = true;
material.setTexture(animations.get(4));
}
... |
99c78887-4d06-4592-8d8a-303560c8e260 | 9 | @Override
protected void processElement(final XMLStreamReader reader, final Stat item)
throws XMLStreamException {
switch (reader.getNamespaceURI()) {
case NAMESPACE:
switch (reader.getLocalName()) {
case "Geometrie":
Utils.... |
0fea992a-5315-4c50-8b28-fe4b66627817 | 8 | public int assignExistingCardToNewPerson(CsvBean bean) {
if (isEmpty(bean.dateStart) || isEmpty(bean.cardNr))
return 0;
if (isEmpty(bean.dateEnd))
bean.dateEnd = "21001231";
try {
cn.setAutoCommit(false);
String sql;
if (checkPersonExist(bean.personNr)) {
sql = "Delete from hPerson WHERE ... |
ad3a72e5-2519-451a-9fc6-6caaadcc4111 | 1 | private void compute_pcm_samples3(Obuffer buffer)
{
final float[] vp = actual_v;
//int inc = v_inc;
final float[] tmpOut = _tmpOut;
int dvp =0;
// fat chance of having this loop unroll
for( int i=0; i<32; i++)
{
final float[] dp = d16[i];
float pcm_sample;
pcm_sample = (float)(((vp[3 + ... |
d969ee76-00c6-4048-972e-1115203acae7 | 7 | private boolean doAction(final String action, final SceneObject obj) {
if(Players.getLocal().getAnimation() == -1 && !Players.getLocal().isMoving()) {
if(obj.getLocation().distanceTo() > 5) {
Walking.walk(obj.getLocation());
} else {
if(!obj.isOnScreen()) {
Camera.turnTo(obj);
} else {
if(... |
8240ee5f-c44d-424a-ab1d-e242181e84e2 | 5 | private void manageStringMessage(int senderID, StringMessage msg) throws NetworkMessageException {
msg.setSender(senderID);
//Message for everybody
if (msg.getAcceptor() == 0) {
for (int i = 0; i < clients.size(); i++) {
if (clients.get(i).getID() == msg.getSender()) {
continue;
}
clients.get(... |
836a55db-6b08-4559-97ad-4582081f74f1 | 1 | public void keyTyped(KeyEvent e) {
if (e.getKeyChar() == 'f') {
showFps = !showFps;
} else {
stageManager.keyTyped(e);
}
} |
06d2bfa7-4b2a-4b76-8d44-299617159318 | 8 | public static final boolean serviceAvalible() throws RestartLater,
FatalError {
if (Config.getDebug()) {
Output.println("Teste Außendienst möglich", 2);
}
String page;
do {
try {
page = Utils.getString("quests/start", "quests/wait");
break;
} catch (LocationChangedException e) {
Contro... |
63a8755d-fd03-47bf-bfd5-68b0048e1077 | 0 | public int getPhysicalWidthDpi() {
return physicalWidthDpi;
} |
a5b440b6-98c5-4560-933d-f48946786138 | 9 | public void spawnMonster(List<Monster> monster){
int numberMonster = 0;
for(int i = 0; i < monster.size(); i++){
if(monster.get(i).getSpawner() == true){
numberMonster++;
}
}
if(numberMonster < 5){
cdTick(5);
}
else{
setCooldown(0);
}
if(getCooldown() == 40 && numberMonster < 5){
int ... |
0fa0e4fe-23a9-4c25-9d08-4e427d5542a3 | 6 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
StringNode other = (StringNode) obj;
if (strVal == null) {
if (other.strV... |
c55ddc96-a6ee-4c35-8efb-c00340fbd34c | 1 | public static void close() {
flush();
try { out.close(); }
catch (IOException e) { e.printStackTrace(); }
} |
e59c93e5-3b63-4171-a296-0679b91a37a6 | 1 | @Override
public void keyTyped(KeyEvent e) {
if (e.getKeyChar() == '\n') {
LoginFrame.this.btnLogin.doClick();
}
} |
41064ccf-0cdb-47e2-a4c2-45005bfd01b9 | 0 | public TimeCal(long interval) {
this.interval = interval;
} |
00ce7d33-769d-4d3a-8241-4c03cf8196be | 5 | @Override
public void draw(Graphics2D g2, XYPlot plot, Rectangle2D dataArea,
ValueAxis domainAxis, ValueAxis rangeAxis,
int rendererIndex, PlotRenderingInfo info)
{
PlotOrientation orientation = plot.getOrientation();
RectangleEdge domainEdge = Plot.resolveDomainAxisLocation(plot.getDomainAxisL... |
745d15a2-172f-4ed9-b12a-ecb6caabb8a1 | 7 | public void func_73075_a()
{
field_73100_i++;
if (field_73097_j)
{
int i = field_73100_i - field_73093_n;
int k = field_73092_a.getBlockId(field_73098_k, field_73095_l, field_73096_m);
if (k == 0)
{
field_73097_j = false;
... |
53c193bf-2747-4418-ad2d-b152a0329146 | 1 | void checkMatches(MTest[] tests, boolean oneWord) {
for (int i = 0; i < tests.length; i++) {
checkMatch(tests[i], oneWord);
}
} |
3e61e901-2ba0-4a55-9113-e694f920f24c | 9 | public Annotation(Library l, Hashtable h) {
super(l, h);
// type of Annotation
subtype = (Name) getObject(SUBTYPE_KEY);
// no borders for the followING types, not really in the
// spec for some reason, Acrobat doesn't render them.
canDrawBorder = !(SUBTYPE_LINE.equals(s... |
14500184-1674-4cd4-a501-4675a2bf492f | 9 | public short[] lock() {
short[] newBoard = board.clone();
byte[][] curData = getData();
for (int y = 0; y < HEIGHT; y++) {
for (int x = 0; x < WIDTH; x++) {
if (curData[y][x] == 1) {
int boardX = x + offsetX;
int boardY = y + offsetY;
if (boardY < 0 && boardX < 5)... |
7f8aee84-9f79-4fb6-87a8-a5f366f590c3 | 7 | private static <T extends JComponent> T getComponentFromList(Class<T> clazz,
List<T> list, String property, Object value)
throws IllegalArgumentException {
T retVal = null;
Method method = null;
try {
method = clazz.getMethod("get" + property);
} catch (NoSuchMethodException ex) {
try ... |
ba2e4118-758f-4010-b177-9d7c7936610a | 1 | public double angle(Coordinate that) {
double res = Math.acos(this.dot(that)/this.magnitude()/that.magnitude());
return this.cross(that) < 0? res: -res;
} |
54ad1c98-e383-4b33-ad78-217070897135 | 7 | public void drawScaledString(Bitmap image, int xPos, int yPos, int xo, int yo, int w, int h, int col, double scale) {
w *= scale;
h *= scale;
for(int y = 0; y < h; y++){
int yPix = y+yPos;
if(yPix < 0 || yPix >= height)continue;
for(int x = 0; x < w; x++){
int xPix = x+xPos;
if(xPix < 0 || xPix >... |
c048d376-b5f7-4f28-8ed3-3d7994120123 | 0 | public String getPhoneNumbers() {
return phoneNumberText.getText();
} |
16a9e52a-b558-49b4-9083-3380077eb432 | 6 | private boolean equipUnitIfPossible(UnitLabel unitLabel, AbstractGoods goods) {
Unit unit = unitLabel.getUnit();
if (unit.hasAbility(Ability.CAN_BE_EQUIPPED)) {
for (EquipmentType equipment : freeColClient.getGame().getSpecification()
.getEquipmentTypeList()) {
... |
eb0a144b-06c5-41fc-89b3-6503be7e0bf6 | 6 | public void manualPositionUpdate(int row, int column, Grid grid){
// Every cell between the previous cell and the new one is presumed to be searched.
if (cell.getRow() < row)
for (int i = cell.getRow(); i<row; i++) grid.getCellAt(i, cell.getColumn()).setSearched();
else
for (int i = cell.getRow(); i>row; ... |
325ab049-1313-4763-b121-fd39433626a6 | 0 | public void tankDrive(double leftValue, double rightValue){
_drive.tankDrive(-leftValue, -rightValue);
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.