method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
cb7124f8-62af-4a8e-b03f-c46580e1e9ba | 7 | public static void _init(){
try{
String RunId = GlobalProperties.items.getRunID();
String wd = GlobalProperties.items.getWorkingDirectory();
String logFolder = wd+"log", TempFolder = wd+"temp", ResultFolder = wd+"result";
String RunIDinResult = ResultFolder + "/" + RunId + "/";
String LogFile = l... |
3e65bab6-447f-45f5-8818-3097e13f1b03 | 7 | void readZrlePackedRLEPixels(int tw, int th, int[] palette)
throws Exception {
int ptr = 0;
int end = ptr + tw * th;
while (ptr < end) {
int index = zrleInStream.readU8();
int len = 1;
if ((index & 128) != 0) {
int b;
do {
b = zrleInStream.readU8();
len += b;
} while (b == 255);... |
42246eeb-dc58-4fc4-9ee6-582c23bf9cc4 | 6 | public boolean move(int newX, int newY) {
boolean movementOK = false;
/*update graphics if wanted*/
if (useGraphics) {
picture.updateGraphics();
}
for (direction d : direction.values()) {
if ((currentCell.locX() + d.xOffset()) == newX
&& (currentCell.l... |
857963a0-eb38-4c82-a6f8-4865eb65ad78 | 9 | public static void initCommandLineParameters(String[] args,
LinkedList<Option> specified_options, String[] manditory_args) {
Options options = new Options();
if (specified_options != null)
for (Option option : specified_options)
options.addOption(option);
Option option = null;
OptionBuilder.with... |
37849dcf-cfb1-4af5-966b-f11930c3e22c | 4 | void mainDiagonal(){
int[][] arrDouble = new int[9][9];
//заполняем массив элементами
for (int i = 0; i < 9; i++){
for (int j = 0; j < 9; j++){
arrDouble[i][j] = (int) (0 + Math.random() * 10);
//System.out.println("Индекс : " + i + " значение :" + ar... |
3752f7b3-4393-4e16-b231-54ab13355315 | 2 | public static boolean isCglibProxyClass(Class<?> clazz) {
return (clazz != null && isCglibProxyClassName(clazz.getName()));
} |
cf63f704-5aeb-4fda-8313-cd5ec007569d | 6 | public void adjustBeginLineColumn(int newLine, int newCol)
{
int start = tokenBegin;
int len;
if (bufpos >= tokenBegin)
{
len = bufpos - tokenBegin + inBuf + 1;
}
else
{
len = bufsize - tokenBegin + bufpos + 1 + inBuf;
}
int i = 0, j = 0, k = 0;
int nextColDiff = ... |
ef3e7254-f681-47cc-8c6c-6cd53f8f5752 | 9 | public String getNewLine() throws Exception {
String line = cp.getTextField().getText();
String[] split = line.split(" ");
int caretPos = cp.getTextField().getCaretPosition();
String currWord = getWord(line, caretPos, split);
ArrayList<String> names = cp.getUserlist().getList().... |
f8dc45e6-55e7-4190-980d-9b936cef13b2 | 1 | public void setVisible(boolean visible) {
if(frame == null) buildGUI();
frame.setVisible(visible);
} |
161080b8-0bf1-456e-b497-b90138c48ac4 | 1 | public Double get_count_sallary(int IdP)
{
Double result = 0.0;
Double wage = 0.0;
Double coeff = 0.0;
wage = t_должностиID_to_t_должностиСтавка( t_должностьId_from_t_людиID(IdP) );
coeff = get_coeffs_expertizes(IdP);
if(wage<0.01) return 0.0... |
365b890f-480a-4189-acf6-3de2a6075687 | 7 | private final boolean cons(int i)
{ switch (b[i])
{ case 'a': case 'e': case 'i': case 'o': case 'u': return false;
case 'y': return (i==0) ? true : !cons(i-1);
default: return true;
}
} |
799e1d36-9455-41d3-8ed7-244d615397cd | 7 | @Override
public Character[] convertFromString(Class<? extends Character[]> cls, String str) {
if (str.length() == 0) {
return EMPTY;
}
Character[] array = new Character[str.length()];
int arrayPos = 0;
int p... |
62b33998-ef95-4ff9-adc1-87643a182987 | 0 | public void setMoveUp(boolean a){
moveUp = a;
} |
aa9c7ba7-49db-405b-a008-384fbea465c4 | 4 | private static void verifyProperty4(RBTreeNode<?, ?> node) {
if (nodeColor(node) == Color.RED) {
assert nodeColor(node.left) == Color.BLACK;
assert nodeColor(node.right) == Color.BLACK;
assert nodeColor(node.parent) == Color.BLACK;
}
if (node == null) return;
... |
61b22547-e61d-485c-a2d5-ffdfe5dc8d6a | 4 | private int compareConnectors(Territory a, Territory b, Continent c)
{
Territory[] tA = a.getEnemyConnectors(this);
Territory[] tB = b.getEnemyConnectors(this);
int count = tA.length;
main: for (Territory t : tA)
{
for (Territory tt : tB)
{
if (t == tt || !c.hasTerritory(t))
{
count--;
... |
35ef8b55-1782-4992-806d-821a9be34d32 | 7 | public void keyReleased(KeyEvent keyEvent) {
Iterator<PComponent> it = components.iterator();
while (it.hasNext()) {
PComponent comp = it.next();
if (shouldHandleKeys) {
if (comp.shouldHandleKeys())
comp.keyReleased(keyEvent);
}
... |
224fcd02-355d-4772-a1de-9d1cbf947ceb | 3 | public void handleAddInputButton() {
if(inputView.getInputList().getSelectedIndex() != -1){
String symbol = (String)inputView.getInputList().getSelectedValue();
if (symbol.equals("Blank Symbol")) symbol = "|_|";
int cell = inputView.getSlider().getValue(); ... |
d89e0148-c701-46b8-be28-294276beb394 | 7 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (!(obj instanceof PostID))
return false;
PostID other = (PostID) obj;
if (author == null) {
if (other.author != null)
return false;
} else if (!author.e... |
594d2052-068b-41ef-8721-2a161a85ca93 | 9 | private void handleKeyPressed(KeyEvent e) {
switch(e.getKeyCode()) {
case KeyEvent.VK_LEFT:
case KeyEvent.VK_KP_LEFT:
handleToStackAction();
break;
case KeyEvent.VK_RIGHT:
case KeyEvent.VK_KP_RIGHT:
//handleHardStackAction();
handleFromStackAction();
break;
case KeyEvent.VK_DOWN:
... |
e0079a1f-c4dd-4c9b-a311-3fa4c66bdd83 | 8 | public String convert(String s, int nRows) {
if(nRows == 1)
return s;
String resultString = "";
int counter = 0;
boolean reverse = false;
String[] stringsArr = new String[nRows];
for(int i = 0; i < nRows; ++i){
stringsArr[i] = "";
}
for(int i = 0; i < s.length(); ++i){
if(counter == -1){
c... |
3c7c983b-46f4-41da-ada8-5d79247d971b | 5 | public void readFile(String imagePath , String imageDescPath) {
BufferedImage image = null;
try {
URL url = AssertManager.class.getClassLoader().getResource(
imagePath);
image = ImageIO.read(url);
} catch (IOException e) {
e.printStackTrace();
System.out.println("读取图片出错");
return;
}
images... |
d10172b6-8700-40f2-b338-caecba660f25 | 2 | public synchronized void runTask(Runnable task) {
if (!isAlive) {
throw new IllegalStateException();
}
if (task != null) {
taskQueue.add(task);
notify();
}
} |
c40623bd-ec7a-44a7-a07e-ee528744db82 | 4 | public void update()
{
if(requestLoad)
{
mc.setLoading(true,loadSpaces);
if(!mc.isLoading()){requestLoad=false;}
}
else if(requestSave)
{
mc.setSaving(true);
if(!mc.isSaving()){requestSave=false;}
}
else
{
updating=true;
mc.update();
updating=false;
}
} |
10587dc1-27a9-4b5c-a703-6a73f7764774 | 5 | public static void main(String[] args) throws IOException {
HashMap<Integer, BigInteger> hm = new HashMap<Integer, BigInteger>();
BigInteger big = new BigInteger("0");
BigInteger aux = new BigInteger("0");
for (int i = 0; i < 50000; i++) {
big = new BigInteger(String.valueOf(i + 1));
big = big.pow(3);
... |
12ba31f0-6c0e-4312-b3b6-b6be9c16b59d | 9 | @Override
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (!super.equals(obj)) {
return false;
}
if (!(obj instanceof XYLineAnnotation)) {
return false;
}
XYLineAnnotation that = (XYLineAnnotation) o... |
2a5ab540-64fd-499c-b060-b45eb46d7794 | 8 | private Element createPersonalInfo() throws ProfilerException {
Element personalInfo = doc.createElement("details");
if (request.getParameter("gender") != null && !request.getParameter("gender").isEmpty()) {
personalInfo.appendChild(createSimpleElement(request.getParameter("gender"), "gende... |
e8eabf66-35ac-4939-b15b-d6fac3b3ab17 | 0 | public void raiseSalary(double byPercent)
{
double raise = salary * byPercent / 100;
salary += raise;
} |
c9e49a59-5a5c-4fda-b48f-e58e77a58630 | 4 | public static void main(String[] args){
Scanner in = new Scanner(System.in);
int max = 0;
StringBuilder sb = new StringBuilder();
while(in.hasNext()){
String numbers = in.next();
sb.append(numbers);
}
String s = sb.toString();
for(int i=0;i<s.length()-4;i++){
int p = 1;
for (int j=0;j<5;j++) p... |
4189b989-d82d-42ec-a2ea-16d8787814b9 | 7 | @Override
public void paintComponent(Graphics g) {
super.paintComponent(g);
for (Section s : sections) {
if (s.isOpened()) {
if (s.isBomb()) {
g.setColor(Color.RED);
} else
g.setColor(Color.GREEN);
} els... |
a88728d7-291f-48aa-bce2-75f4403f55df | 6 | @Override
protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
switch (setField_) {
case SHORT_VALUE:
Short short_value = (Short)value_;
oprot.writeI16(short_value);
return;
case INT_VALUE:
Integer int_va... |
5a257968-b518-4c39-b396-a5ccd5d9336c | 2 | private double computeNodeConfidenceScore() {
// this is a simple and unoptimized way of doing this
// basically we construct a BlockChain type from Leaf-to-Root path
// then compute the ConfidenceScore
Node currentNode = this;
BlockChain thisChain = new BlockChain(this.block);
while (currentNode... |
7c8ef7c4-2f3c-4465-98c5-814de1ce6265 | 3 | public static void main(String[] args) {
SomeClassWithData some_object = new SomeClassWithData();
for (int i = 9; i > 0; --i) {
some_object.add(i);
}
// get_data() has been removed.
// Client has to use Iterator.
SomeClassWithData.Iterator it1 = some_object.cr... |
2fab0023-9380-427e-b78e-d043d38c0eb9 | 3 | public void show(){
for(int i=1; i<=size; i++){
for(int j=1; j<=i; j++){
System.out.print(pascalsTriangle[i][j]);
if(j!=i){
System.out.print(",");
}
}
System.out.println();
}
} |
b6411fb3-5b9c-4068-b750-32a9c574db63 | 2 | public static void createConfig() {
// Audio
setProperty("music", "" + SoundStore.get().getMusicVolume());
setProperty("sfx", "" + SoundStore.get().getSoundVolume());
// Video
setProperty("fullscreen", "" + Camera.get().isFullscreen());
setProperty("vsync", "" + Camera.get().isVSyncEnabled());
// Ke... |
37821983-4438-477d-9d8b-8dc9ba09d472 | 8 | public boolean isOk() {
if(depth<=0.0){
return false;
}
if(time<=0.0){
return false;
}
if(gas.He>1.0||gas.N2>1.0||gas.O2>1.0||gas.He<0||gas.N2<0||gas.O2<0.01){
return false;
}
return true;
} |
7058bf72-3edd-4edc-95d1-be9cb1f8b51e | 9 | public static Ai parse(char c, Board board, int x, int y) {
Ai ai = new Ai(x, y, board);
ai.setIdentity(c);
ai.setInteractionKeys();
switch (c) {
case TileKeys.fireGas:
ai.setBrain(new GasBrain(ai, board));
ai.setColor(TileKeys.lightRed);
ai.decisions = new GasElementDecisions(ai)... |
5469953c-77e1-4670-be80-2b06ebd3be9c | 2 | public DefaultResponse deleteAssociation(String asId, String asIdType) {
if (!UtilityMethods.isValidString(asId)) {
throw new IllegalArgumentException("Id parameter is null");
}
Map<String, String> lhtParameters = new HashMap<String, String>();
if (UtilityMethods.isValidStri... |
a117f482-be2f-49c5-9c8c-d4f2950a769e | 9 | protected void changeNeuronWeight(int neuronNumber, double[] vector, int iteration){
double[] weightList = networkModel.getNeuron(neuronNumber).getWeight();
int weightNumber = weightList.length;
double weight;
if(showComments){
String vectorText="[";
for(i... |
3f6322dc-d68d-4ea4-a456-fb3a6c5d84ae | 3 | @Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof Player)) {
return false;
}
Player player = (Player) o;
if (!name.equals(player.name)) {
return false;
}
return number.... |
492d06b7-773d-421e-987e-7c510d1830d4 | 6 | private String get_sub_ct(char[][] pt, int start_col,int end_col,int[][] key_square)
{
int row=pt.length;
char[][] result_ct=new char[row][end_col-start_col];
StringBuilder sb=new StringBuilder();
for(int i=start_col;i<end_col;i++)
{
//find the correct position for each column
for(int j=0;j<row;j++)... |
7a6a3621-32ae-4b95-8b2f-9eb37ed0463e | 7 | private void checkOSStarted(VirtualMachine virtualMachine)
throws Exception {
String startTimeout = virtualMachine.getProperty(
VirtualMachineConstants.START_TIMEOUT);
boolean checkTimeout = startTimeout != null;
int remainingTries = 0;
if (checkTimeout) {
remainingTries = Integer.parseInt(start... |
0b8e7a18-92c3-47f6-9cbc-189eedb7b9e3 | 0 | public void setUpdatedAt(final Long updatedAt) {
this.updatedAt = updatedAt;
} |
a54346ed-1253-4541-ab69-d00e5cdda3ba | 5 | private static int[] merge(int[] array1, int[] array2) {
int[] result = new int[array1.length + array2.length];
int index = 0;
int index1 = 0;
int index2 = 0;
while(index1 < array1.length && index2 < array2.length) {
if(array1[index1] < array2[index2]) {
result[index] = array1[index1];
index1... |
281087f0-6f43-42ad-9653-a3d113eb163e | 8 | public void handleExternalPlugins()
{
if (vault != null)
{
loadVault();
isVaultEnabled = true;
pluginsEnabled.add("Vault");
}
if (worldedit != null)
{
isWorldEditEnabled = true;
wep = (WorldEditPlugin) worldedit;
portExecutor.setWorldEditPlugin(wep);
pluginsEnabled.add("WorldEdit");
}... |
bb27d2df-0505-4441-8e44-618e17321227 | 2 | public void setAnalyzerActive (GlobalContext context, boolean arg) {
for (IStringAnalyser analyzer : stringAnalysers) {
if (context == analyzer.getGlobalContext()) {
analyzer.setActive(arg);
}
}
} |
1a202fe5-40d0-4b72-93b9-7d673f940d25 | 1 | public CouldNotSendConnectRequestException(CouldNotSendPacketException e) {
super("Could not send connect request" + (e == null ? "." : "--" + e.getMessage()));
wrappedException = e;
} |
e6ace858-9ac1-47d9-92d4-aa9befca1c43 | 5 | @Override
public Boolean[] segment(Utterance utterance, boolean training, boolean trace) {
Boolean[] segmentation = utterance.getBoundariesCopy();
int baseIndex = 0;
while (baseIndex < utterance.length) {
ArrayList<Word> prefixes = lexicon.getPrefixWords(utterance, baseIndex);
if (!prefixes.isEmpty()) {
... |
1277bc8b-c6a4-4041-8513-312700e5ffff | 1 | public boolean isAnyRecordFormatSpecified() {
return xmlRecordElements != null && !xmlRecordElements.isEmpty();
} |
a23569e2-44b8-4c44-a27b-552bfa26170a | 9 | private void ochosMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ochosMouseClicked
// TODO add your handling code here:
try {
if (conexion == true && enviando == 0) {
enviando = 1;
int opciones;
if (esinicio != 0 && 8 <= esini... |
c48306ed-9920-425a-ac5f-b5c52b2a89e4 | 3 | protected void initialize()
{
if (GameApplet.thisApplet != null)
{
super.initialize();
this.initialOrientation = 180;
this.newName = "Arachnae Prototype";
this.chassis = "Arachnae";
String[] arrayOfString = { "sensor.VidSensor", "assembly.Launcher" };
this.parts = arrayOfSt... |
715a14c6-e65a-45d5-951f-6ab112ef2c7a | 3 | private static File findFile(String filename, LinkedList files) {
File temp;
int i = 1;
temp = (File) files.get(0);
while ((i < files.size()) && (!filename.equals(temp.getName()))) {
temp = (File) files.get(i);
i++;
}
if (temp.getName().equals(fi... |
7867f18a-4790-4389-afc1-60cf5204f9bd | 1 | @Override
public final String toString()
{
return "Bencoding Exception:\n"+(this.message == null ? "" : this.message);
} |
81e95619-9f56-4822-a677-05f0e44f7d13 | 8 | private void btn_okActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_okActionPerformed
// Initialisation des variables.
String message;
boolean controle = false;
// Controle sur formulaire
if(text_name.getText().isEmpty()
|| text_adr_... |
e1b24c53-5e85-4926-a0f6-8f133e195088 | 3 | private void deleteCategory(Map<String, Object> jsonrpc2Params) throws Exception {
Map<String, Object> params = getParams(jsonrpc2Params,
Constants.Param.Name.TYPE,
Constants.Param.Name.CATEGORY_ID);
String type = (String) params.get(Constants.Param.Name.TYPE);
... |
e940e949-7f5c-4e20-af51-4e3bc8e07cd0 | 0 | public PowerUp(int speed, int xvalue, int yvalue, int dirX, int dirY){
setV(speed);
setX(xvalue);
setY(yvalue);
//setDirectionY(dirY);
//setDirectionX(dirX);
option = (int)(Math.round(Math.random()))+1;
} |
4be32c06-c2c8-4afc-a232-49be3748ca69 | 0 | public Id3v2URLFrame(Property property, PropertyTree parent) {
super(property, parent);
} |
a63a3dbf-96c0-4217-88c1-8c0caa993cfd | 5 | public static void simpleSearch(ArrayList<StringSequence> database,String pattern)
{
for(int sequence = 0;sequence<database.size();sequence++)
{
ArrayList<Integer> foundInCurrent = new ArrayList<Integer>();
database.get(sequence).setPattern(pattern);
String current=databas... |
31b3b997-6daa-449a-993e-683ee7ca26d3 | 9 | public void poistaTaydetRivit() {
int taysiaRiveja = 0;
for (int i = RuudunKorkeus - 1; i >= 0; --i) {
boolean RiviTaysi = true;
for (int j = 0; j < RuudunLeveys; ++j) {
if (tetrominonMuoto(j, i) == Tetrominot.EiMuotoa) {
RiviTaysi = false;
... |
e781422f-0f0f-4b80-9451-47ff2b4c8789 | 8 | @Override
public SourceValue newOperation(final AbstractInsnNode insn) {
int size;
switch (insn.getOpcode()) {
case LCONST_0:
case LCONST_1:
case DCONST_0:
case DCONST_1:
size = 2;
break;
case LDC:
Object cst = ((LdcInsnNode... |
8b192e9e-42ba-4e57-b6d4-f1f3491f66e6 | 1 | public void printAttributes() {
System.out.println("###[BLUEPRINT]###");
System.out.println("# BID:" + BlueprintID + "\t BName:" + BlueprintName);
System.out.println("# PID:" + ProductID + "\t PName:" + ProductName);
System.out.println("# PTime:" + ProductionTime + "\t PSize:" + PortionS... |
8d969780-6884-4333-b936-479a7f21b700 | 1 | public void setPan(int pan) {
if (clip.isControlSupported(FloatControl.Type.PAN)) {
FloatControl panControl = (FloatControl) clip.getControl(FloatControl.Type.PAN);
panControl.setValue(pan);
}
} |
5ddec557-8016-46b8-9365-f845125a4cff | 2 | public void render(GameContainer gc, Graphics g) throws SlickException {
g.setFont(titleFont);
g.drawString(game.getTitle(), 100, 100);
g.resetFont();
for (int i = 0; i < buttons.size(); i++) {
int x = buttonsX;
int y = buttonsY + i * buttonHeight;
if (i == choice) {
g.setColor(Color.darkGra... |
93f4a7d8-25be-4986-b418-1b2502d3240d | 7 | public final boolean equals(Object par1Obj)
{
if (!(par1Obj instanceof IntHashMapEntry))
{
return false;
}
else
{
IntHashMapEntry var2 = (IntHashMapEntry)par1Obj;
Integer var3 = Integer.valueOf(this.getHash());
Integer var4 = In... |
d3c1ec61-be24-41cd-8589-2345122e5078 | 8 | public void mousePressed(MouseEvent e){
Dimension size = fComponent.getSize();
if( e.getX() >= size.width-7 && e.getY() >= size.height-7
&& getSelectionState()==2 ) {
if(DEBUG)System.out.println("ImageView: grow!!! Size="+fWidth+"x"+fHeight);
Point loc = fComponent.getLocationOnScreen();
fGrowBase = ne... |
a276e43f-cdf9-4c73-8ba0-4ed70068aa45 | 7 | public void addRecordArray(Object[] aobj) throws JDBFException {
if (aobj.length != fields.length)
throw new JDBFException("Error adding record: Wrong number of values. Expected " +
fields.length + ", got " + aobj.length +
".");... |
01c1e89d-8e23-42bf-bb36-1afc9615e662 | 2 | public boolean getBoolean(String key, boolean def) {
if(fconfig.contains(key)) {
return fconfig.getBoolean(key);
}
else {
fconfig.set(key, def);
try { fconfig.save(path); } catch (IOException e) { e.printStackTrace(); }
return def;
}
} |
da92eab7-7aa2-48e8-b6af-27bafb3c1267 | 2 | public static void main(String[] args) {
new Thread(new Runnable() {
@Override
public void run() {
Server.start();
}
}).start();
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
... |
a44e3780-61c0-4de0-91b6-ed471bb05c05 | 4 | final public CycVariable sentenceDenotingVariable(boolean requireEOF) throws ParseException {
CycVariable val = null;
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case SIMPLE_VARIABLE:
val = sentenceDenotingSimpleVariable(false);
break;
case META_VARIABLE:
val = sentenceDenotingMetaVariable(f... |
f2839322-307e-41fc-b4ad-cb3e51f8fe81 | 0 | GraphPrimitive(int x, int y, int width, int height, int widthDest, int heightDest, String name) {
super(x, y, width, height, widthDest, heightDest);
this.name = name;
} |
a2cc3d66-49f8-470d-bb61-fd178608cc33 | 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... |
5276376f-5da1-4ba6-b9cd-4001628b65fd | 8 | public String find(String word) {
for (int i = 1; i < word.length(); i++) {
if (word.charAt(i) == word.charAt(i - 1)) {
return "Dislikes";
}
}
for (int i = 0; i < word.length() - 3; i++) {
for (int j = i + 1; j < word.length() - 2; j++) {
... |
bb8d33e5-f540-47a3-960d-1a10cf6a3baa | 2 | private void setTopic(String topic) {
if (topic == null || topic.trim().length() == 0)
topic = HTML.italic("Diskusní téma není nastaveno.");
else
topic = HTML.bold(topic);
topicPanel.setText(topic);
} |
dda5723d-f817-4287-a533-cc5e3aa71837 | 6 | public void playSound(InputStream inputStream) {
InputStream is = inputStream;
try {
audioStream = AudioSystem.getAudioInputStream(is);
} catch (Exception e){
e.printStackTrace();
}
audioFormat = audioStream.getFormat();
DataLine.Info info = ne... |
8c6bf37e-5d36-41e0-9dd0-b944acd7ed97 | 7 | public static void call(final String data) throws Exception {
BufferedReader br = null;
FileReader fr = null;
final File textFile = new File(data);
String line = null;
List elements = null;
try {
fr = new FileReader(textFile);
br = new BufferedRea... |
c70e384c-dcf0-458e-aaf3-711886e39a07 | 7 | @Override
public void update() {
//assume game is over only if there are walls present and the game is being played
boolean gameOver = walls.size() > 0 && Game.state == State.PLAY_LEVEL;
for(Ball ball : balls){
ball.update();
if(!ball.isAlone())
gameOver = false;
}
if(gameOver && !isAnyWallGrowing(... |
5bd6718d-c453-49f7-9020-142cc268e723 | 6 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Corretor other = (Corretor) obj;
if (codigo == null) {
if (other.codigo != null)
return false;
} else if (!codigo.equals(other.codigo))
... |
b2fd4353-86a4-44c2-9c6e-f3dc396302ed | 7 | public void load(String filename) throws Exception
{
BufferedReader reader;
String line = null;
reader =
new BufferedReader(new FileReader(new File(filename)));
while ((line = reader.readLine()) != null)
{
if (line.length() > 0 && line.charAt(0) != '#') // i... |
8d9d4cfc-811e-411e-b05f-938db796fa0f | 0 | public int getCurconnected() {
return curconnected;
} |
f44eb588-8e10-466f-a21b-ca8aae079015 | 6 | public static <GItem> List<GItem> reverseList(final List<GItem> items) throws NullPointerException {
if (items == null) throw new NullPointerException("items = null");
return new AbstractList<GItem>() {
@Override
protected void removeRange(final int fromIndex, final int toIndex) {
final int size = items.... |
b0fe9794-d18f-41fa-a11e-3794299266e1 | 1 | protected boolean canChange(int value){
Controller c = gui.getController();
if (centerCause(c.getX1(), c.getX2(), c.getY1(), c.getY2(), c.getR1(), value)){
return true;
}
else{
showCenterWarning();
return false;
}
} |
0b2e98ef-fec1-4ab1-9704-d15394d64a91 | 7 | public ArrayList<OrderDetail> createVerifiedOrderDetails(int resTypeID, int requestedQty, Order o) {
//Hvis der er nok på lager 1:
ArrayList<OrderDetail> odl = new ArrayList<>();
String startDate = o.formatDateToString(o.getStartDate());
String endDate = o.formatDateToString(o.getEndDat... |
e9fcf219-473d-44b0-bb57-844401c2ac98 | 7 | @Override
public void trainOnInstanceImpl(Instance inst) {
//Init Perceptron
if (this.reset) {
this.reset = false;
this.numberAttributes = inst.numAttributes();
this.numberClasses = inst.numClasses();
this.weightAttribute = new double[inst.numClasses(... |
44fe17af-d251-4369-bd61-a412fde25641 | 9 | public void eventEnd() {
Point check;
LineSegment p1=null, p2=null;
LineSegment tmp;
int i=0;
if(currentEvent.a.start.y == currentEvent.a.end.y){
return;
}
for ( i = 0; i < SweepStatus.size(); i++) {
tmp = SweepStatus.get(... |
34b33ba3-d037-41da-8e91-fa44e98aec7e | 5 | private void displayMonth() {
if(currentMonth< 1){
currentMonth++;
}
if(currentMonth > 3){
currentMonth--;
}
Month tempMonth = months[currentMonth];
displayMonth.setText(tempMonth.getName());
for (int i = 0; i < tempMonth.getStartDay(); i++) {
dayPanel[i].deactivate(months[currentMonth-1].getTot... |
6aae79d7-7c24-495f-ba1c-359b761f3072 | 2 | protected boolean contains(TileObjectDisplayData displayData){
return characterData == displayData ||
itemData.contains(displayData) ||
edgeData.values().contains(displayData);
} |
3a17b326-18f3-40e1-a3e7-fbdd2e2f5c03 | 7 | protected static List<JavaInfo> findMacJavas() {
List<String> javaExecs = Lists.newArrayList();
String javaVersion;
javaVersion = getMacJavaPath("1.6");
if(javaVersion != null)
javaExecs.add(javaVersion + "/bin/java");
javaVersion = getMacJavaPath("1... |
d3ff8ba3-6e7f-4034-881d-89e88d50af9f | 2 | public Grid nullIfPreviousState(){
String thisState = this.gridToString();
for(Grid g: previousGrids){
if(thisState.equals(g.gridToString())){
return null;
}
}
return this;
} |
86e1312a-8316-48a1-9d95-630b1a5c8f4a | 7 | public static void main(String[] args) throws Exception {
System.setProperty("webdriver.chrome.driver", "D:\\Download\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
driver.manage().window().maximize();
File bankNames = new File("E:\... |
cab6fab4-df44-4fcf-b537-5c8eb204a3d1 | 7 | @Override
public Object getValueAt(int indiceLigne, int indiceColonne) {
switch(indiceColonne){
case 0 :
return compteRendus.get(indiceLigne).getNomPraticien() ;
case 1 :
return compteRendus.get(indiceLigne).getPrenomPraticien() ;
case 2 :
return compteRendus.get(indiceLigne).getVillePraticien() ;
... |
ca1a2ce0-3089-405f-812e-318cd8075d06 | 5 | @Override
public void parse() {
if (peekTypeMatches("NEQ")) {
matchTerminal("NEQ");
inverseOp = "breq";
op = "neq";
}
else if (peekTypeMatches("EQ")) {
matchTerminal("EQ");
inverseOp = "brneq";
op = "eq";
}
else if (peekTypeMatches("LESSER")) {
matchTermin... |
a8fcad1c-c20e-4275-87f9-65720d1709f4 | 4 | public void blockBreak(List<String> materialList, Boolean mode){
if (materialList != null){
Material materialet;
for (String material : materialList){
materialet = Material.getMaterial(material);
if (materialet != null){
blockBreak.add(materialet);
}
}
}
if (mode != null){
blockBreakM... |
01ba872b-8c19-4441-bbd4-974329054ef7 | 2 | public void remove (final Body b) {
runnableManager.add(new Runnable() {
public void run () {
if (b != null) {
if (b.getUserData() != null) {
Objects.world.destroyBody(b);
b.setUserData(null);
}
} else {
System.out.println("Body seems to be null");
}
}
});
} |
d31da5f5-f28d-4a17-95b4-f379be426477 | 0 | public void setFunAaaa(int funAaaa) {
this.funAaaa = funAaaa;
} |
d6c8882d-e042-4a9b-909c-eac6cc05cf6c | 0 | public long getId() {
return id;
} |
d545dac2-9574-41d5-99f0-1c9699476a6e | 9 | static void fill(char[][] A, int i, int j, char toFill){
if(i<0 || i>=n || j<0 || j>=m || A[i][j]!='.') return;
A[i][j]=toFill;
fill(A, i-1, j, toFill=='W'?'B':'W');
fill(A, i, j+1, toFill=='W'?'B':'W');
fill(A, i+1, j, toFill=='W'?'B':'W');
fill(A, i, j-1, toFill=='W'?'B':'W');
} |
1a949d66-cbfa-433c-92c2-39de6292112e | 0 | @Id
@Column(name = "person_id")
public int getPersonId() {
return personId;
} |
cfa393d2-c837-4d87-9c4a-db539915ff26 | 7 | public static AudioPoint simplify(short[] in, double threshold, int begin, int end){
AudioPoint ret = new AudioPoint(-1, 0);
final AudioPoint head = ret;
//find a repeating pattern in the audio sample.
int lastX=-1;
int lastY=0;
double sumOfAngles=0;
Point beginPoint=new Point(-1,0);
Point lastPoint=new... |
0486853b-9592-44aa-ad5c-cf6bf97cf703 | 2 | private Rectangle union( Rectangle a, Rectangle b ){
if( a == null ){
return b;
}
if( b == null ){
return a;
}
return a.union( b );
} |
bbe1e048-f992-49de-ae34-ccd7b7d510ec | 9 | private List<URL> getRequiredLibsFromHome() {
List<URL> urls = new ArrayList<URL>();
try {
// Make sure Groovy, Gant, Ivy and GPars are on the classpath if we are using "griffonHome".
File[] files = new File(home, "lib").listFiles(new FilenameFilter() {
public bo... |
c0018b9b-b276-443b-8a64-dd4d3c0f14a5 | 3 | public static final void equals(Object obj, Object another, String message) {
isTrue((obj == null && another == null) || (obj != null && obj.equals(another)), message);
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.