method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
5cc70594-2c82-4b13-867c-83c3787a8560 | 3 | @Override
public void actionPerformed(ActionEvent e) {
JButton button = (JButton)e.getSource();
if (button.equals(distress))
{
if (distressed == true)
{
patient.setDistressed(false);
distressed = false;
distress.setText("=)");
distress.setBackground(green);
}
else if (distressed == fa... |
691848c7-6e03-4aa8-8643-e25c66361a6c | 4 | private void btnTestAction() {
File file = new File("data/" + txtFile.getText());
if (file.exists()) {
for (LinkKNN knn : knns) {
knn.testType((String) lstTypes.getSelectedValue());
}
Datasource.getInstance().playRecording(file);
for (Link... |
02cc329f-0a5c-4ec7-a55b-8e018361de12 | 8 | public Network createBindTestPattern() {
final Network network = new Network();
final int inputChanels = 20;
final int hiddenNeurons = 15;
final int outputChanels = 10;
final Layer layer10 = new Layer();
for (int i = 0; i < inputChanels; i++) {
layer10.addNeuron(new Neuron(Type.INPUT));
}
networ... |
482cd3c8-ae1e-40b9-b863-3b48e7e7a4c0 | 3 | public String play() {
logger.clear();
initParticipiants();
logger.addToLog("Participants count: " + participants.size());
logger.addToLog("Max rounds: " + maxRounds);
while(participants.size() > 1 && currentRound < maxRounds)
{
playRound();
log... |
4bf207f8-9d3a-4801-b354-e066166476cb | 2 | public void drawParticles(Graphics graphics) {
for (int particleIndex = 0; particleIndex < particleArray.length; particleIndex++) {
if (particleArray[particleIndex] != null) {
particleArray[particleIndex].draw(graphics);
}
}
} |
5413c891-53c8-45e5-a263-8b6fef10ef3e | 7 | private void flipColors(Node h) {
// h must have opposite color of its two children
assert (h != null) && (h.left != null) && (h.right != null);
assert (!isRed(h) && isRed(h.left) && isRed(h.right)) || (isRed(h) && !isRed(h.left) && !isRed(h.right));
h.color = !h.color;
h.left.color = !h.left.color;
h.right... |
61115e7b-73b2-4316-9b8c-ce8507ddc6eb | 0 | public Canny(double thresh, double perc, double sigma){
this.thresholdRatio = thresh;
this.percentNotEdges = perc;
this.sigma = sigma;
} |
2ad59a3b-60f7-445f-8002-0768782aa3ff | 5 | public void validMove(int originLetter, int originNum, int newLetter, int newNum)
{
if(originNum - newNum == 1)
{
validMove2(originLetter, originNum, newLetter, newNum);
}
else if(originNum == newNum)
{
if(originLetter - newLetter == 0)
{
placePiece(originLetter, originNum, newLetter, newNum, ki... |
591f17e1-5072-4b14-a832-8515df4d973e | 1 | public String getClassForFirst() {
return markFirst ? "first" : "";
} |
19b709cf-9fd1-40d8-bc38-b7fd7cea3518 | 1 | public void exit()
{
System.out.println(myInputString);
if (myIsTuringMachine) {
// configs = ((TMSimulator) simulator).getInitialConfigurations(s);
} else {
Configuration[] configs = mySimulator.getInitialConfigurations(myInputString);
myAction.handleInteraction(myAutomaton, mySimulator, configs, myInpu... |
78ff8d8f-e338-4e5a-a3c7-f9c3386311b3 | 6 | public Element handle(FreeColServer server, Player player,
Connection connection) {
ServerPlayer serverPlayer = server.getPlayer(connection);
Game game = server.getGame();
Unit unit;
try {
unit = player.getFreeColGameObject(unitId, Unit.class);
... |
a69fa4ce-4b36-41fb-bfc4-efd4e734b8c2 | 7 | private void cleanUp(){
File SKIN_DIR = skin_file.getParentFile();
for(int i = surface_names.size()-1; i >= 0; i--){
File texture = texture_paths.get(i);
File parent = texture;
//search for the right entry folder in the given path of the skinfile
ArrayList<String> folder_names = new ... |
d798db17-8d6c-4b69-bb86-3ed7a9a775e2 | 2 | protected int strikeAdditionalScore() {
int nextFrameScore = 0;
nextFrameScore = getNextFrame().getFrameScore();
if (getNextFrame().isStrike()) {
if (getNextFrame().getNextFrame() == null) {
nextFrameScore = getNextFrame().getFrameFirstScore();
} else {
nextFrameScore += getNextFrame().getNextFram... |
711fc2db-4e9e-4a99-8fa8-c21a29c79e30 | 1 | @Override
public Component getTableCellEditorComponent(JTable table, Object value,
boolean isSelected, int row, int column) {
//System.out.println("EditeurBoutonLocation::getTableCellEditorComponent()") ;
this.ecouteur.setRow(row) ;
this.ecouteur.setColumn(column) ;
this.ecouteur.setTable(table) ;
i... |
e14ed16f-5145-469a-a921-3530880a9f1f | 7 | @Override
public PostOffice getPostOffice(String chain, String areaNameOrBranch)
{
for (final PostOffice P : postOfficeList)
{
if((P.postalChain().equalsIgnoreCase(chain))
&&(P.postalBranch().equalsIgnoreCase(areaNameOrBranch)))
return P;
}
final Area A=findArea(areaNameOrBranch);
if(A==null)
... |
59d5dc8e-a876-4780-842c-d907c37ac4ba | 9 | public static void main(String[] args) {
String baseDirectory = System.getProperty("user.home")
+ System.getProperty("file.separator")
+ ".ScreenCapture"
+ System.getProperty("file.separator");
String config = baseDirectory + "config.txt";
for (... |
42621e47-aa34-4f3d-82eb-9f35987490b5 | 0 | public int getCombinacion() {
return combinacion;
} |
2f81f5e5-441a-47e5-8c0a-f6e216d5c019 | 7 | public boolean lookup(Plugin[] plugins) throws IOException, InvalidConfigurationException{
String data = "";
String response;
// we have to clear the lists first
supported.clear();
needUpdate.clear();
unsupported.clear();
for(int i = 0; i < plugins.length; i++){
String version = plugins[i].getDescripti... |
5d3c0bf2-4148-4828-b5e6-52643005033e | 5 | public void freeResources() {
if (stockImages != null) {
for (int i = 0; i < stockImages.length; ++i) {
final Image image = stockImages[i];
if (image != null) image.dispose();
}
stockImages = null;
}
if (iconCache != null) {
for (Enumeration<Image> it = iconCache.elements(); it.hasMoreElements... |
7683f656-e8cf-43a1-b11c-ac723bee0233 | 6 | public static List<List<Integer>> permute(int[] num) {
List<List<Integer>> res = new ArrayList();
if(num.length<=0){
return res;
}else if(num.length==1){
List tmp = new ArrayList();
tmp.add(num[0]);
res.add(tmp);
return res;
}else{
//add first
List<Integer> first = new LinkedList();
for... |
a42cbd55-e7b4-4b2d-9ff1-637ab9a340a2 | 4 | protected synchronized void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
if (oldValue != null && newValue != null && oldValue.equals(newValue)) {
return;
}
for (PropertyChangeListener listener : propertyChangeListeners) {
listener.propertyC... |
6dcb32eb-176f-44fe-9f6c-fcdaa03d0522 | 4 | public void keyReleased (KeyEvent e){
int key = e.getKeyCode();
for (int i = 0; i<objectHandler.object.size();i++){
GameObject tempObject = objectHandler.object.get(i);
if (tempObject.getId() == ObjectId.Player){
if(key == KeyEvent.VK_RIGHT) tempObject.setVelocityX(0);
if(key == KeyEvent.VK_LEFT) ... |
126bb6e4-aa4d-4c3e-84e2-5fc603459cc4 | 6 | public boolean buildProduct(String productName){
for(ManufacturedProduct mfp : this.getManufacturedProductList()){
if(mfp.getProductName().equals(productName)){
for(String rm : mfp.getRawMaterialList()){
for(RawMaterial rm1 : this.getRawMaterialList()){
... |
58a830eb-92b3-446e-92e5-9d93d21fcac0 | 2 | private void setDelayedSetters(BeanType o) {
for (Map.Entry<SetProperty<BeanType, Object>, Object> entry : delayedSetters.entrySet()) {
try {
SetProperty<BeanType, Object> setter = entry.getKey();
Object value = entry.getValue();
setter.accept(o, value... |
c3f563b8-b606-4d4b-b3e5-142673b9c60a | 0 | public City getCity(int id){
return cityList.getCityByID(id);
} |
ca2286e6-550e-4418-b0bb-ab1388a7e164 | 0 | public void load(Section section){
this.attachChild(section);
this.section[section.getID()] = section;
} |
44f50d1a-19be-47bf-bba9-e82c9e0df14f | 1 | public void testGetInstantConverter() {
InstantConverter c = ConverterManager.getInstance().getInstantConverter(new Long(0L));
assertEquals(Long.class, c.getSupportedType());
c = ConverterManager.getInstance().getInstantConverter(new DateTime());
assertEquals(ReadableInstant.cla... |
54b8b242-6785-46e9-907d-b555739913fb | 2 | public boolean addUpgrade(Upgrade upgrade){
if(upgrade.getType() == this.type){
int position = this.nextFreePositon();
if(position == -1) return false;
this.upgrades[position] = upgrade;
return true;
}
return false;
} |
b06de936-714b-4fc2-9038-b8778e0c6686 | 6 | public Boolean cadastarNovo(Emprestimo emprestimo) {
Boolean sucesso = false;
Connection connection = conexao.getConnection();
try {
String valorDoComandoUm = comandos.get("cadastarNovo" + 1);
String valorDoComandoDois = comandos.get("cadastarNovo" + 2);
Strin... |
a278fc0d-7b92-4732-8a15-7d5029779e5f | 6 | @Override
public void mouseReleased(MouseEvent e)
{
if (start != null)
{
if (zoomGesture)
{
double dx = e.getX() - start.getX();
double w = finderBounds.getWidth();
final JScrollBar hs = graphComponent
.getHorizontalScrollBar();
final double sx;
if (hs != null)
{... |
b9c0503d-4e08-4906-829a-0658f6d816e9 | 5 | public void generateOres(int x,int y){
TileType t = ores[rand.nextInt(ores.length)];
int size = 3;
for(int i=x;i<size+x;i++){
for(int j=y;j<size+y;j++){
if(i>=SIZE || j>=SIZE) continue;
if(rand.nextInt(30)>5){
world[i][j] = t;
... |
cebe6b71-131f-4998-b607-16a2c33e5607 | 5 | public static String encode(byte[] raw) {
StringBuilder ret = new StringBuilder();
int concat = 0;
int count = 0;
for (byte b : raw) {
concat = (concat << 8) | (b & 0xff);
count += 8;
if (count == 24) {
append(ret, concat, count);
count = 0;
concat = 0;
}
}
if (count == 8) {
conca... |
1e57ef4d-aabb-4a89-b091-68e16a8736e9 | 3 | public static ArrayList<String> explodeRegEx(String split, String str, int limit) {
ArrayList<String> output = new ArrayList<String>();
if (str == null) return output;
if (split == null) {
output.add(str);
return output;
}
String[] data;
//data = str.split(Pattern.quote(split),limit);
data = str.sp... |
66ae8e99-2acf-47c9-b7eb-0180261fc959 | 2 | @SuppressWarnings("deprecation")
public void onProjectileLand(ProjectileHitEvent event){
//Gets EXACT location that the projectile landed
BlockIterator iterator = new BlockIterator(event.getEntity().getWorld(), event.getEntity().getLocation().toVector(), event.getEntity().getVelocity().normalize(), 0.0D, 4);
... |
5c5ceb60-77f1-47d2-8a8b-df3225b698f7 | 0 | public int getCoefiente(){
int r, p1 = 0, p2 = 0, p3 = 0;
p1 = Fatorial.calcular(n);
p1 = Fatorial.calcular(k);
p1 = Fatorial.calcular(n - k);
r = (p1/(p2 - p3));
return r;
} |
3f26cb46-0381-4524-af2e-4455d15a0f6f | 6 | public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case RHINO_ID:
return isSetRhinoId();
case TITAN_ID:
return isSetTitanId();
case PROPERTIES:
return isSetProperties();
case OUT_EDGES:
return isS... |
2e58726e-2981-4511-8ff2-2664f50f15c1 | 9 | private static void validateUriHashes(Archive archive,
String uri,
boolean allowNoParents) throws IOException {
String[] fields = uri.split("/");
if (fields.length != 2) {
throw new IOException("Couldn't pars... |
3c438d04-94d3-474d-99ec-80eb2a2b8dc4 | 5 | @Override
public String getOOXML()
{
StringBuffer ooxml = new StringBuffer();
ooxml.append( "<c:dPt>" );
ooxml.append( "<c:idx val=\"" + idx + "\"/>" );
if( !invertIfNegative )
{
ooxml.append( "<c:invertIfNegative val=\"0\"/>" ); // default= true
}
if( marker != null )
{
ooxml.append( marker.get... |
70f2fd1e-8b23-4e1f-a0b1-73dee2483740 | 9 | @Override
public int hashCode() {
int result = partitionexecutionid != null ? partitionexecutionid.hashCode() : 0;
result = 31 * result + (stepexecutionid != null ? stepexecutionid.hashCode() : 0);
result = 31 * result + (version != null ? version.hashCode() : 0);
result = 31 * resul... |
7e15d21c-0d5c-49e4-ad45-d17108a5ae93 | 9 | @Override
public void run() {
// only process listeners and triggers if the received interrupt event
// matches the pin number being tracked my this class instance
if (this.pin.getPin().equals(event.getPin())) {
if (event.getEventType() == PinEventType.DIGITAL_STATE_CHANGE) {
... |
93c56b27-8fe9-4edd-84bf-2873e5305be0 | 5 | @SuppressWarnings({ "unchecked", "rawtypes" })
public BeanIndexer<K> addSortedIndex(String property,
Comparator<?> comparator) {
Map<Object, Set<K>> holder = index.get(property);
if (holder instanceof NavigableMap<?, ?>) {
return this;
}
if (holder != null) {
removeIndex(property);
}
holder = n... |
38ce8642-9551-40d1-ba32-cf97d6ab6caa | 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... |
86c49e3b-bb36-4c86-a03e-02151761a35f | 2 | public Set<BankAccount> getAccountsSatisfying(Checker<BankAccount> checker) {
Set<BankAccount> result = new HashSet<>();
for (BankAccount account: accounts)
if (checker.check(account))
result.add(account);
return result;
} |
d418128b-c1f7-4122-9045-7eec3929c25c | 2 | public void visitLabel(final Label label) {
if (mv != null) {
mv.visitLabel(label);
}
if (labels == null) {
labels = new ArrayList(3);
}
labels.add(label);
} |
cf3206c9-5259-4266-8168-355fac5e0336 | 3 | public ArrayList<String> getMeetingAdminsByMeetingID(int meetingID) {
ArrayList<String> meetingAdmins = new ArrayList<>();
for(MeetingAdmin meetingAdmin : meetingAdmins().getMeetingAdmins()){
if(meetingAdmin.getMeetingID() == meetingID && !meetingAdmins.contains(meetingAdmin.getUsername()))... |
1ce21935-c5e9-4946-b236-202e44c75034 | 0 | public ByteBuffer getData() {
return this.data;
} |
c7710e23-1168-47f5-820e-2a6995880c14 | 7 | private String startSetToString() {
StringBuffer FString = new StringBuffer();
boolean didPrint;
if (m_starting == null) {
return getStartSet();
}
for (int i = 0; i < m_starting.length; i++) {
didPrint = false;
if ((m_hasClass == false) ||
(m_hasClass == true && i != m_... |
8342798b-b273-4456-87f6-5d005fb51e63 | 2 | public boolean globtype(char key, KeyEvent ev) {
for (Widget wdg = child; wdg != null; wdg = wdg.next) {
if (wdg.globtype(key, ev))
return (true);
}
return (false);
} |
d2a34ff2-6bba-4201-be5e-841abcfb634b | 6 | public static void drawNetwork(Network network, Renderer renderer, int xOffset, int yOffset, double compensationFactor, Color backgroundColor)
{
ArrayList<Layer> layers = network.getLayers();
int width = 0;
/**
* Calculate the maximum width of the layers.
* This wi... |
5d550359-e6bc-40f3-98c7-8dbc86bdbde1 | 7 | public static void findCombosMemoize(int[] ar) {
// build hash
HashMap<Integer, List<Integer>> map = new HashMap<Integer, List<Integer>>();
for(int i=0; i<ar.length; i++) {
List<Integer> entry = map.get(ar[i]);
if (entry == null) {
entry = new LinkedList<I... |
3b7c8af2-88c8-4d7a-9654-ca0986835cc2 | 4 | private boolean escribir(File fichero, String texto)
{
boolean res=false;
PrintWriter writer = null;
try {
String f = fichero.toString();
//verifica que extension exista sino lo agrega
if(!f.substring( f.length()-4, f.length()).equals(".txt") )
... |
630fd8ae-f4f2-4d17-96e9-1d0351545346 | 3 | static int getUV(String glyphName) {
Integer UV = h.get(glyphName);
if (UV != null)
return UV;
if (glyphName.startsWith("G")) {
try {
String s = glyphName.substring(1);
return Integer.parseInt(s);
} catch (Exception ex) {
... |
d8060f46-69b6-4ade-b792-8fb6aefaf736 | 8 | public static boolean pairEquals(Object... objects)
{
if (objects.length % 2 != 0)
{
throw new IllegalArgumentException("Method requies an even number of arguments to compare");
}
for (int i = 0; i < objects.length; i += 2)
{
if (objects[i] == null || objects[i+1] == null)
{
if ((objects[i] != ... |
6fd26256-9826-433c-957b-394902eacc7d | 2 | public synchronized int exportObject(String name, Object obj)
throws CannotCompileException
{
Class clazz = obj.getClass();
ExportedObject eo = new ExportedObject();
eo.object = obj;
eo.methods = clazz.getMethods();
exportedObjects.addElement(eo);
eo.identifie... |
0661c5e7-047d-45e3-b477-28e0abea7415 | 1 | public static void toCollection(long[] a, Collection<Long> c) {
c.clear();
for(long l:a) {
c.add(l);
}
} |
9b464874-5df4-45b1-8779-1b180a8eb956 | 4 | public static void filledRectangle(double x, double y, double halfWidth, double halfHeight) {
if (halfWidth < 0) throw new RuntimeException("half width can't be negative");
if (halfHeight < 0) throw new RuntimeException("half height can't be negative");
double xs = scaleX(x);
double ys ... |
663fce78-216d-44f2-8c98-c938fd729b1c | 9 | public int getScore(String s, int boardSize){
switch (s.length()) {
case 0:
case 1:
case 2:
return 0;
case 3:
return boardSize <= 4 ? 1 : 0;
case 4:
return 1;
case 5:
return 2;... |
32516f4d-24d5-451a-9b82-8ccf49dad55c | 1 | public void clearSelection() {
for(ClickableObject selectedObject : selection) {
System.out.println(selectedObject);
selectedObject.setSelected(false);
}
selection.clear();
} |
c911ebac-3027-4805-8cc9-b4cec828e72f | 8 | public static void main(String args[]) throws IOException{
try {
GenData data = new GenData();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
HITS hits = new HITS();
HashSet<User> users = new HashSet<User>(GenData.getUserMap().values());
HashSet<Business> busine... |
4581dd4f-f672-40ed-9003-f10ce3910e1e | 6 | private int getMaxValueForest(Model mod, Color col){
int max = 0;
Posizione temp = null;
for(int i=0;i<mod.getDamiera().getDim();i++)
for(int j=0;j<mod.getDamiera().getDim();j++){
temp = new Posizione(i,j);
if(!mod.getDamiera().isFreePos(temp) && !mod.getDamiera().getPezzo(temp).isNullAM())
if(... |
dd64bf3f-7a48-4e5a-84cf-a090f89a44fa | 6 | private void evalLDC(int index, Frame frame) throws BadBytecode {
int tag = constPool.getTag(index);
Type type;
switch (tag) {
case ConstPool.CONST_String:
type = STRING_TYPE;
break;
case ConstPool.CONST_Integer:
type = Type.INTEGER;
... |
43c9285e-747c-4467-950c-4016b32de98e | 1 | private void getCurrencies() {
ArrayList<String> currencyList = new ArrayList<>();
for (Currency currency : CurrencySet.getInstance()) {
currencyList.add(currency.getCode());
}
currencies = currencyList.toArray(new String[0]);
} |
2fe38416-ca64-483f-bdcf-6dff16cad799 | 8 | public boolean lookUp(int key)
{
TreeNode node=parentHead.left;
if(node==null)
return false;
while(node.key>key||node.key<key) //left or right subtree
{
if(node.key>key)
{
if(node.left!=null)
node=node.left;
else
return false;
}else if(node.key<key)
{
if(node.right!=null)
... |
9d270a0a-b9ab-4bce-bb10-b77c79a6a544 | 0 | public void actionPerformed(ActionEvent e) {
} |
934ec71b-f2a8-49d7-9946-c860e32192d1 | 7 | @Override
public Pane getPane() {
gridPane = new GridPane();
FlowPane flowplane = new FlowPane();
/* Grid pane and flow pane parameters */
flowplane.getChildren().add(gridPane);
gridPane.setStyle("-fx-font: bold 18pt \"Times New Roman\";");
gridPane.setHgap(5); gridPane.setVgap(5);
gridPane.getStyleCla... |
8981c472-19fe-416e-8a67-bb16f8116741 | 4 | public static final void echoUDP(String host) throws IOException
{
int length, count;
byte[] data;
String line;
BufferedReader input;
InetAddress address;
EchoUDPClient client;
input = new BufferedReader(new InputStreamReader(System.in));
address = In... |
fd420736-bbe6-4600-82af-c56b1f718672 | 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... |
2a887dc9-f397-4294-abc4-7784f406af39 | 7 | protected void rehash(){
while(load() > loadRehashThreshold) {
//If we've completed all rehashing, we need to expand the table & reset
//the counters.
if(rehashComplete.compareAndSet(nLocks, nLocks+1)){
completeExpansion(0);
return;
}
//Otherwise, we attempt to grab the next index to proces... |
b5efb909-88f9-4512-b02f-48137d2d3a4a | 4 | public boolean equals(RPChromosomeRegion testRegion) {
if (startChromID == testRegion.startChromID && startBase == testRegion.startBase &&
endChromID == testRegion.endChromID && endBase == testRegion.endBase)
return true;
else
return false;
} |
93f63f6a-b202-41b6-b29b-1cbbb17c3ea0 | 1 | public static String getElementType(String typeSig) {
if (typeSig.charAt(0) != '[')
throw new IllegalArgumentException();
return typeSig.substring(1);
} |
2f41dd51-3a0b-4b0f-8d88-9b6acf3d53e6 | 2 | public void SetListener(union.CustomMenu.MenuElemetUseListener lst) {
//Kerri: fixed param by java tip (quick fix)
if (UI.instance != null && action.length > 1) UI.instance.menugrid.listeners.put(action[1], lst);
} |
a3c28005-0963-45b6-8cf8-01692a582760 | 1 | public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
AnnotationVisitor av;
av = super.visitAnnotation(remapper.mapDesc(desc), visible);
return av == null ? null : createRemappingAnnotationAdapter(av);
} |
61e06363-5602-4d5d-b686-48258c155a85 | 2 | public void changeScene(int Index)
{
if(Scenes.size() > Index || Scenes.size() == Index)
{
this.SceneIndex = Index;
}
} |
9b0a5cde-2a74-4f08-852b-67db12e9955d | 2 | public long size() {
// If we haven't seen k elements yet, the size is exactly the size of ts
if (intersectable && ts.size() < k) {
return ts.size();
}
return (long)Math.round(estimateSize(M, a));
} |
10537429-d264-4b58-807f-7254e93d36fe | 1 | public boolean laskettavatAsetettu() {
return etujasen != null && takajasen != null;
} |
76d3b040-2387-4eea-a3be-87d144910edd | 4 | public static Result[] callSegmenter(String trainPath, String testPath, String outPath,
String propsPath){
long startTime = System.currentTimeMillis();
// Decide whether we're going to separate test and training data
boolean useTestData = !NO_TEST_FILE.equals(testPath.toLowerCase());
// Load gold utterance... |
6552983d-e637-47ce-b039-519ae7e8cac2 | 8 | protected void doCataclysm() {
// kill all cells on one side
int x, y;
for (x = (on_right ? n_x / 2 : 0); x < (on_right ? n_x : n_x / 2); x++) {
for (y = 0; y < n_y; y++) {
if (!cell_grid[x][y].queryEmpty())
cell_grid[x][y].getOccupant().killSelf(c... |
30fbb551-c07b-4dc2-a44f-76a612e40171 | 6 | void qbCharacters(String s){
if (currentElement.equalsIgnoreCase("GRAIN")){
m.setName(s);
}
else if (currentElement.equalsIgnoreCase("HOP")){
h.setName(s);
}
else if (currentElement.equalsIgnoreCase("miscingredient")){
r.setYeastName(s);
// TODO: there is more data in the yeast record, and th... |
53a5069f-7dd3-4c64-a9d4-08ca54c304b0 | 2 | @Override
public void fill(ParametricCommandDescriptor descriptor, InvokableMethod origin)
{
Alias alias = origin.getMethod().getAnnotation(Alias.class);
if (alias != null)
{
List<AliasConfiguration> aliasList = new ArrayList<>();
for (String name : alias.value())... |
5e638aec-3234-42ca-a89c-8fae92e914b4 | 5 | private boolean jj_3R_17() {
Token xsp;
xsp = jj_scanpos;
if (jj_3_70()) {
jj_scanpos = xsp;
if (jj_3_71()) {
jj_scanpos = xsp;
if (jj_3_72()) {
jj_scanpos = xsp;
if (jj_3_73()) return true;
}
}
}
if (jj_3R_18()) return true;
return false;
} |
09ba6521-1390-467f-9e02-8ab054ad61ae | 6 | public double[] predictDistribution() {
int[] fruitCounts = new int[12];
int totalFruit = 0;
double[] fruitProbabilities = new double[12];
for (int i = 0; i < firstRoundBowlHistory.length; i++) {
for (int j = 0; j < firstRoundBowlHistory[i].length; j++) {
fru... |
a42572cf-518f-48bb-8cda-a2dbba797983 | 2 | public int hashCode () {
return (component1 == null ? 0 : component1.hashCode()) + (component2 == null ? 1 : component2.hashCode());
} |
41585603-f8d5-4f6b-90d6-d8cd246325af | 9 | public static boolean isLeftBower(int cardNum, char trump) {
if(random.card.DeckFunctions.getBaseNumber(cardNum) == 'J') {
//*********************
if(trump == 'S' && random.card.DeckFunctions.getSuit(cardNum) == 'C') {
return true;
} else if(trump == 'C' && random.card.DeckFunctions.getSuit(cardNum) == ... |
872746cc-493d-4c5d-9ae9-fa7ae3890b10 | 5 | private String bidForAuction() {
if (user.isOnline()) {
int auctionID = 0;
double amount = 0.0;
if (stringParts.length < 3) {
return "Error: Please enter the bid- command like this: " +
"!bid <auction-id> <amount>";
}
try {
auctionID = Integer.parseInt(stringParts[1]);
amount = Do... |
dca4a175-3d12-4b2a-ab65-55b299d627b3 | 2 | public void mouseReleased(MouseEvent event) {
// Did we even start at a state?
if (first == null)
return;
State state = getDrawer().stateAtPoint(event.getPoint());
if (state != null) {
controller.transitionCreate(first, state);
}
first = null;
getView().repaint();
} |
76f80ff4-89c6-4db7-a0ca-45922f1846a8 | 7 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Teacher other = (Teacher) obj;
if (facultyNumber != other.facultyNumber)
return false;
if (name == null) {
if (other.name != null)
re... |
26b0b047-862e-4787-9921-136b4e5361a1 | 1 | protected void setDead()
{
alive = false;
if(location != null) {
field.clear(location);
location = null;
field = null;
}
} |
c36c17de-c963-4541-824d-4827a7d3d4ce | 0 | public void setTimeDrift(IntDataType value) {
this.timeDrift = value;
} |
a4f803ce-4e61-4026-b612-a3e6eb90ce29 | 7 | protected boolean isKeyInTable(String tableName,
ResultProducer rp,
Object[] key)
throws Exception {
String query = "SELECT Key_Run"
+ " FROM " + tableName;
String [] keyNames = rp.getKeyNames();
if (keyNames.length != key.length) {
throw new Exception("Key names and key values of... |
75f2ac59-ada8-46c4-9d00-d784f5db4d6a | 0 | public InetAddress getAddr() {
return addr;
} |
ab847e3a-7637-443e-912f-44ac14bf0a8a | 0 | public int getRosas() {
return rosas;
} |
d2efb4fb-a725-4683-a626-3fae8d35b508 | 7 | public void viewUser() {
int id_userTmp = -1;
System.out.println("ID :");
id_userTmp = Integer.parseInt(sc.nextLine());
ArrayList<CarnetDB> list = null;
ArrayList<NoteDB> list2 = null;
UserDB user = null;
user = new UserDB(id_userTmp);
try {
us... |
2221787f-37df-4c3a-b40e-7bfb435b0678 | 7 | public int findSubset(int[] numbers){
HashSet<Long> set = new HashSet<Long>();
ArrayList<Pair> bags = new ArrayList<Pair>();
bags.add(new Pair(0, 1));
for(int number : numbers){
ArrayList<Pair> newBags = new ArrayList<Pair>();
for(Pair pair : bags){
... |
70db7370-b153-4fff-b7a7-55f736060cb8 | 1 | public synchronized boolean remover(int i)
{
try
{
new CursoDAO().remover(list.get(i));
list = new CursoDAO().listar("");
preencherTabela();
}
catch (Exception e)
{
return false;
}
return true;
} |
3e93f309-3c88-48c3-b67e-2c22d5f65bdf | 0 | public void setName(String name) {
this.name = name;
} |
2ea37552-3fcf-4514-8f6e-67952953375b | 3 | private static Iterator collectVars(final FlowGraph cfg) {
// SSAConstructionInfo objects for cfg
final Map infos = new HashMap();
cfg.visit(new TreeVisitor() {
// Visit all statements in the CFG. Remove any pre-existing
// PhiStmts.
public void visitTree(final Tree tree) {
final Iterator iter = tre... |
b4e46ee9-92b9-4e05-a6c3-9d77540c3f78 | 1 | public static Task[] append(Task[] array, Task task){
Task[] newArray = new Task[array.length+1];
for(int i=0; i<array.length; i++){
newArray[i] = array[i];
}
newArray[array.length] = task;
return newArray;
} |
afeffd2c-c472-44ee-9559-c00f888b4715 | 7 | private Stack<Symbol> handleParentheses(String inputExpression, int index, Stack<Symbol> masterParseTree,
String parseTreeType) {
accumulatedPrecedence += Symbol.parenPrecedence;
Stack<Symbol> localParseTree = new Stack<>();
// Process the input expre... |
5bee6773-29b9-47c6-a3a7-d12e697266a8 | 2 | public HTSPClient(ClientInfo serverInfo, HTSPMonitor monitor){
this.serverInfo = serverInfo;
this.monitor=monitor;
this.chan = new ClientTVChannels();
this.tags = new ClientTags();
this.events = new ClientEvents();
this.subscriptions = new ClientSubscriptions(monitor);
this.sequence = new MagicSequence();... |
7ceac6d3-ecaf-49da-97ec-651d587ff9c3 | 6 | public static HashMap<String, List<String>> getOTUToSeqIDMap( String filepath )
throws Exception
{
HashMap<String, List<String>> map = new LinkedHashMap<String, List<String>>();
BufferedReader reader = new BufferedReader(new FileReader(new File(
filepath)));
String nextLine = reader.readLine();
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.