method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
32346f31-e3bd-4844-9bf1-3dd0e718deae | 7 | @Override
public void publishInterruptibly(final long sequence, final Sequence cursor)
throws InterruptedException {
int counter = RETRIES;
while (sequence - cursor.get() > pendingPublication.length()) {
if (--counter == 0) {
if(yieldAndCheckInterrupt())
throw new InterruptedExc... |
f2ee5b6f-552c-42fe-b1b9-91b88f3a0734 | 9 | private void combinationSum2Helper(int idx, int[] num, int target,
ArrayList<ArrayList<Integer>> result, int[] times) {
if (target < 0 || (idx == num.length && target != 0))
return;
if (target == 0) {
ArrayList<Integer> ret = new ArrayList<Integer>();
for (int i = 0; i < idx; i++) {
... |
27d77d49-c6db-4f57-a3e5-6c5a7ba0f8f6 | 9 | private boolean interfaceIsSelected(RSInterface class9)
{
if(class9.anIntArray245 == null)
return false;
for(int i = 0; i < class9.anIntArray245.length; i++)
{
int j = extractInterfaceValues(class9, i);
int k = class9.anIntArray212[i];
if(class9.anIntArray245[i] == 2)
{
if(j >= k)
return ... |
d5324090-ea9a-4866-9081-07d0847e6e2c | 1 | public boolean gridHasUserCar(){
if(vehicleMap.containsKey('A')){
return true;
} else {
return false;
}
} |
ccdff362-7911-443a-85cd-895bc8b5da72 | 7 | private void setResult()
{
if(stressDistribution.size() < 100)
this.result += "Stress distribution = " + stressDistribution + "\n";
else
{
for(Integer value : stressDistribution.values())
{
int i = 10;
Integer key = 1;
while(!(value >= key && value < key * i))
key *= i;
Integer... |
471a5744-6e57-4e12-82e9-14ba6f9a9e63 | 6 | @Override
public String[][] loadCells(Settings settings) throws Exception {
SpreadsheetService service = new SpreadsheetService(APP_NAME);
String login = settings.googleLogin;
String password = settings.googlePassword;
if (login == null || login.length() == 0) {
if (Sys... |
9bc04226-5772-4738-ab96-251c6ff13ea5 | 0 | public Tape[] getTapes() {
return myTapes;
} |
850ad18b-446d-4f88-bdb0-111106209756 | 8 | private void createAndCompare(){
//Grab each chromosome file.
Sequence_DNA seq;
StringBuffer sb;
//Iterate through each chromosome file, and create all of the transcripts possible from each one
//Code is performed in this order to minize HDD reads.
for(int k = 0; k < 25; k++){
//Ignore the mitochon... |
6597a61f-1823-483d-a0e5-ac8f8eee2957 | 9 | public static void main(String[] args) {
if(args.length<2){
System.out.println("Please specify train and test file arguments");
System.exit(1);
}
else{
readFile(args[0]);
}
int threshold=50;
if(args.length==3){
threshold=Integer.parseInt(args[2]);
if(threshold%2!=0){
System.out.println("p... |
17abb951-b40d-46ff-941d-bf79a502ab80 | 5 | public static TreeMap<Integer, Integer> getShiptypesIDOccurrence(
ArrayList<Kill> killBoard, String attribute) {
TreeMap<Integer, Integer> result = new TreeMap<Integer, Integer>();
if (killBoard.isEmpty()) {
return null;
}
for (Kill K : killBoard) {
if (K.getVictim().findAttribute(attribute)) {
... |
95845c61-1ec9-4844-a51b-5573b63f9d3d | 7 | public static Constructor<?> getConstructor(String inClass, boolean touch) {
// Create a class object from the class matching the table name
Class<?> clazz = null;
Constructor<?> cons = null;
try {
clazz = Class.forName(inClass);
} catch (ClassNotFoundException ex) {
// Logger.getLogger(GTFSParser.class... |
8a37cb69-9f72-40d5-80da-33350ec98fad | 0 | public String doIt(String arg){
System.out.println("called .. demo.service.Service1.doIt(String)");
return arg;
} |
38ec2467-fe8d-4b6d-adec-10c6915d941c | 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... |
cabf18b0-a142-41b4-a8f2-a2244991eff4 | 8 | public void actionPerformed(ActionEvent e) {
if (e.getActionCommand().equals("editor_undo")) {
textComponent.undo();
} else if (e.getActionCommand().equals("editor_redo")) {
textComponent.redo();
} else if (e.getActionCommand().equals("editor_cut")) {
textComponent.cut();
} else if (e.getActionCommand(... |
d381a363-149b-4f65-8576-ef8d07fc81d6 | 3 | private void insertImmediately(TransObj obj)
{
Connection conn = null;
try {
conn = DBManager.getConnection();
/*PreparedStatement prepStatement = conn.prepareStatement(P_INSERT_STRING);
prepStatement.setInt(1, obj.getSeq());
prepStatement.setLong(2, obj.getInitTime());
prepState... |
80a983d1-49f0-4359-857e-ce14e801a5ce | 9 | private void performSwap(LeftistTreeNode root) {
if (root != null) {
LeftistTreeNode right, left, toBeSwapped;
if (root.parent != null) {
toBeSwapped = root.parent;
right = toBeSwapped.right;
left = toBeSwapped.left;
} else {
... |
d9e59846-19ea-49fd-84fd-a0b9ecef6855 | 1 | public void atualizar(PalavraChave palavrachave) throws Exception
{
String sql = "UPDATE palavrachave SET palavra = ? WHERE id = ?";
try
{
PreparedStatement stmt = ConnectionFactory.getConnection().prepareStatement(sql);
stmt.setString(1, palavrachave.getPalavra());
stmt.setLong(2, palavrachave.getId()... |
e6bc3b6f-1715-4198-90bb-0593075e8c57 | 1 | public static void awardBonusExternal() {
class AwardBonus extends RecursiveAction {
public AwardBonus(ArrayList<BankAccount> accounts, int start, int end) {
this.accounts = accounts;
this.start = start;
this.end = end;
}
priv... |
11b68f93-3d09-4689-912d-5588af7243d7 | 2 | public FieldVisitor visitField(final int access, final String name,
final String desc, final String signature, final Object value) {
StringBuffer sb = new StringBuffer();
appendAccess(access | ACCESS_FIELD, sb);
AttributesImpl att = new AttributesImpl();
att.addAttribute("", "access", "access", "", sb.toStr... |
fb6f7fac-331a-4c0b-8a82-656905c59ac3 | 8 | private void clearNetsAfterGoalSet() {
Enumeration eNum = CANT23.nets.elements();
while (eNum.hasMoreElements()) {
CANTNet net = (CANTNet)eNum.nextElement();
if ((net.getName().compareTo("VerbInstanceNet") == 0) ||
(net.getName().compareTo("NounAccessNet") == 0) ||
(net.getName()... |
658d3b33-6368-40c5-af38-f1709ddc9070 | 5 | static int KMP(char[] p, char[] t, int start, int end) {
int i = start, j = 0, m = p.length, n = end, max = 0;
while (i < n) {
while (j >= 0 && p[j] != t[i])
j = b[j];
i++;
j++;
if (i == n)
max = Math.max(max, j);
if (j == m)
j = b[j];
}
return max;
} |
81746fbf-8c8a-4492-925d-5f14dcf3dd78 | 9 | private void computeShortestPath() {
Cell goalCell = map.getGoalCell();
updateKey(goalCell);
// Cell peekedCell = expandedList.peek() == null ? new Cell() {
// {
// key = new Key(Integer.MAX_VALUE, Integer.MAX_VALUE);
// }
// } : expandedList.peek();
while (expandedList.peek() != null && cC.compare(expa... |
215b2955-6b82-4b38-ac7b-9a7141d23326 | 0 | public java.awt.Component getTableCellRendererComponent(JTable aTable,
Object value, boolean isSelected, boolean hasFocus, int row,
int column) {
JComponent c = (JComponent) super.getTableCellRendererComponent(
aTable, value, isSelected, hasFocus, row, column);
c.setToolTipText(table.getContentDescri... |
e35f73e0-613d-4e91-8c0b-502b06cecdca | 0 | public void setHost(String host) {
this.host = host;
} |
1d6a118e-1de8-49fa-9843-2fd7c9819aff | 4 | private String cleanText( String text )
{
StringBuilder sb = new StringBuilder();
for ( int i=0;i<text.length();i++ )
{
char token = text.charAt(i);
if ( token == '\n' )
sb.append(" ");
else if ( token == '\t' )
sb.append(" ... |
91e8615f-62d5-4d32-9225-c06f0935070a | 5 | public Ast compile_text(String text, String type) {
switch (type) {
case "rb":
this._parser = null;//TODO
this._visitor = null;
break;
case "py":
this._parser = null;//TODO
this._visitor = null;
break;
case "c":
this._parser = null;//TODO
this._visitor = null;
break;
case "ob":
this._parser = ... |
2c23991c-536a-4029-8e46-d8c83d5eff18 | 0 | public QueueSubscriberThread(BlockingQueue<Integer> queue) {
this.queue = queue;
} |
dcd4a444-88dd-4964-baa7-9765de866d5b | 9 | public TileEncoderImpl(String formatName,
OutputStream output,
TileCodecParameterList param) {
// Cause a IllegalArgumentException to be thrown if formatName, output
// is null
if (formatName == null) {
throw new IllegalArgumentException(
JaiI18N.getString("TileCodecDescriptorImpl0"));
}
if ... |
44da55cc-3be7-438c-9d53-3f9844051058 | 3 | public static boolean updateKayttajatunnus(Kayttajatunnus kayttaja) {
Connection con = connect();
try {
con.setAutoCommit(false);
PreparedStatement updateKayttajatunnus = con.prepareStatement("UPDATE kayttajatunnus SET kayttajanimi = ?, salasana = ?, oikeudet = ? WHERE kayttajatunnusID = ?");
updateKaytta... |
c1b39eda-a4d8-42db-b251-b091c8c3671c | 4 | public SoundPoolEntry addSound(String var1, File var2) {
try {
String var3 = var1;
var1 = var1.substring(0, var1.indexOf("."));
if(this.field_1657_b) {
while(Character.isDigit(var1.charAt(var1.length() - 1))) {
var1 = var1.substring(0, var1.length() - 1);
... |
609820d1-f709-4daf-bf11-06367a9a79e8 | 5 | public boolean hasPotentialAvailableSpace(int fileSize) {
if (fileSize <= 0) {
return false;
}
// check if enough space left
if (getAvailableSpace() > fileSize) {
return true;
}
Iterator it = fileList_.iterator();
File file = null;
... |
7f623ee7-45e7-4c86-8f68-d4bd5ed26c01 | 9 | public int calculateScore(DiceManager diceManager, int roundNumber) {
Dice dice1 = diceManager.getFirstDice();
diceManager.nextDice();
Dice dice2 = diceManager.nextDice();
Dice dice3 = diceManager.nextDice();
int score = 0;
nextToPlay = true;
if(dice1.compareTo... |
654494e6-f77e-4068-acd7-deefa09cafca | 9 | private void mainLoop(String user_name) throws IOException
{
for (;;) {
Command cmd = this._in.readCommand();
char op = cmd.getOperator();
CommandArgsIterator args_it = (CommandArgsIterator) cmd.iterator();
if (op == 'J')
this.joinCha... |
e15736d2-6db2-4ac5-ab2c-cf7273059a08 | 8 | private void horizontalCompactionRight(Digraph<BrandesKoepfNode,Boolean> graph) {
for (BrandesKoepfNode v : graph.vertices()) {
v.sink = v;
v.sink2 = v;
v.shift = Integer.MAX_VALUE;
v.x = Integer.MIN_VALUE; // undefined
}
for (BrandesKoepfNode v : graph.vertices()) {
if (v.root == v) {
placeBlo... |
0b2f6b3d-100b-4a9a-aebd-5b917ae04473 | 7 | @SuppressWarnings("unchecked")
public void onAuditEvent(AuditEvent evt){
log.info("Audit Event Arrived:" + evt.getEventId() + ":" );
String ruleID = "";
String severity = "";
String tags = "";
String source = "";
String line = "";
String file = "";
String msgStr = "";
JSONObject json = new ... |
f48c56e5-cc94-48c2-ab15-dbfd80e87c4a | 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... |
d572a7fc-4774-4d8e-9769-50bcb1bf1d5f | 1 | public void setGaussianKernelRadius(float gaussianKernelRadius) {
if (gaussianKernelRadius < 0.1f)
throw new IllegalArgumentException();
this.gaussianKernelRadius = gaussianKernelRadius;
} |
b4f1c844-dfed-4505-9797-eb2ea16de567 | 1 | @Override
public void fire() {
if(timeSinceLastShot >= timeBetweenShots) {
GameActor a = Application.get().getLogic().getActor(actor);
//WeaponsComponent wc1 = (WeaponsComponent)a.getComponent("WeaponsComponent");
PhysicsComponent pc1 = (PhysicsComponent)a.getComponent("P... |
557c9d29-df28-43f8-ba5c-d3dda134f241 | 6 | private ArrayList<Integer> generateActions(int[][] state) {
ArrayList<Integer> result = new ArrayList<Integer>();
int middle = x/2;
//TODO choose random when x is even
if (state[middle][0] == 0) {
result.add(middle);
}
for (int i=1; i <= x/2; i++){
if(midd... |
411d6b22-93c2-4e1a-b654-b75138235a31 | 0 | @Override
public void documentAdded(DocumentRepositoryEvent e) {} |
b59101cf-7f4f-43e1-bdd5-d691bd2507c3 | 9 | public static void main(String[] args) {
/** Variablen */
FileInputStream fstream;
String line;
Guitar guitar;
Scanner sc;
final int takt = 22050;
// keys to pluck a string
char[] pluckKeys = { 'm', 'k', 'o', ',', 'l', 'p' };
// keys to press a fret down, only the lower str... |
c986609b-89f5-4751-b93a-f09b8b55ace9 | 8 | * @param off offset for array
* @param len max number of bytes to read into array
* @since 1.3
*/
@Override
public void write( byte[] theBytes, int off, int len )
throws java.io.IOException {
// Encoding suspended?
if( suspendEncoding ) {
... |
0601a64e-fb0f-41a0-a6df-8177343c8726 | 0 | public float getPrice() {
return price;
} |
170ed13c-cd90-41ab-ba1b-df7b6b490ead | 9 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (!(obj instanceof UnitPlayer))
return false;
UnitPlayer other = (UnitPlayer) obj;
if (curLocation == null) {
if (other.curLocation != null)
return false;
} else if (!curLocation.equ... |
79351c3f-f269-4984-b679-dde761751e48 | 3 | public ProcessedCell(String name, ImageProcessor origImg, ImageProcessor segmented, int num,
BoundaryBox bb, int area, double mean, Point centroid){
imgName = name;
this.id = num;
this.bb = bb;
this.area = area;
this.mean = mean;
this.centroid = centroid;
origImg.setRoi(this.bb.getX(), this.bb.getY... |
261d0f2d-3498-4a76-aac2-289e17bd7c0e | 9 | public static void printBoard(int table[][]){
int rows=table.length;
int cols=table[0].length;
msg.print(" ");
for(int i=0;i<cols;i++){
if(i==0){
msg.print("0 ");
}
else{
if(i<10){
msg.print(gen[0].charAt(i-1)+" ");
}
else{
msg.print(gen[0].charAt(i-1)+" ... |
44778942-70ff-4720-8081-988ef509dc88 | 1 | public Route(final String name, final int local_port,
final String remote_address,final File log_dir,
final Properties[] filterConfigs) throws IOException {
this.name = name;
if (remote_address.indexOf(":") == -1) {
throw new Error("port missing in remote a... |
7690f47e-70a0-4efc-b4d1-adc9bfeb1f30 | 9 | public void checkBanks() {
try {
File dir = new File("characters");
if(dir.exists()) {
String read;
File files[] = dir.listFiles();
for (int j = 0; j < files.length; j++) {
File loaded = files[j];
if (loaded.getName().endsWith(".txt")) {
Scanner s = new Scanner (loaded);
int c... |
e532cf2f-34df-4389-9c62-e253c711e872 | 9 | private static List<String> canonize(String aPath)
throws CommandException
{
final String[] lPieces = aPath.split("/");
final List<String> lResult= new ArrayList<String>(lPieces.length);
for(String lPiece : lPieces)
{
if(".".equals(lPiece))
// ... |
a973507c-82b4-4c0e-a2f5-cdd881e599ec | 4 | public static int runToAddressL(int limit, Gameboy gbL, Gameboy gbR, int... addresses) {
if (!gbL.onFrameBoundaries) {
int add = dualStepUntilL(gbL, gbR, 0, 0, addresses);
if (add != 0)
return add;
}
int steps = 0;
while (steps < limit) {
int add = dualStepUntilL(gbL, gbR, 0, 0... |
8434370d-b14f-4fb1-bc36-de0735717d75 | 1 | @Override
public void update(Graphics g) {
if (image == null) {
image = createImage(this.getWidth(), this.getHeight());
second = image.getGraphics();
}
second.setColor(getBackground());
second.fillRect(0, 0, getWidth(), getHeight());
second.setColor(getForeground());
paint(second);
g.drawImage(im... |
7c87fa09-5cbf-45bf-a4a7-82534c26a4ea | 7 | public void tryRotate(Block[][] tank) {
int nextRotation = currentRotation < getRotations().length - 1 ? currentRotation + 1 : 0;
Block[][] nextLayout = getRotations()[nextRotation].getLayout();
for (int x = 0; x < nextLayout.length; x++) {
for (int y = 0; y < nextLayout[0].length; ... |
f52b295a-35fa-41e0-bc5b-a868a1b39e31 | 8 | public void sendReply_cgibin_latency_cgi(MyHTTPServer socket, List<HTTPRequestData> getData, String cookie) throws Exception
{
try
{
int width = 920;
HTTPRequestData widthData = MyHTTPServer.findRecord(getData, "width");
if (widthData != null && widthData.getData() != null)
width = Integer.valueOf(wid... |
71d3c0ae-a779-4b41-856b-6b3c657fe3b3 | 7 | static int countLinkageEdges(List<Node> positiveNodeList,
List<Node> negativeNodeList,
int[] positivePartition,
int[] negativePartition) {
int k = 0;
for (int i : positivePartition) {
k = Math... |
df33740a-08a7-4af4-8bd4-90a68dac3c2d | 1 | public void getEnabled(boolean isEnabled) {
if (isEnabled == true) {
btn_editor.setEnabled(true);
btn_add.setEnabled(true);
btn_remove.setEnabled(true);
btn_save.setEnabled(true);
}
} |
8e3ca143-c1a6-4744-ab65-3288f5d79755 | 4 | public boolean canRobotMove(Direction direction) {
boolean result = true;
/* Each case checks for 2 things: if the robot will move outside of the bounds
* and if there is a rock in the robot's path.
*/
switch(direction) {
case UP:
result &= robot.getLocation().y > 0;
break;
case DOWN:
result &=... |
bfb2a66e-29a9-4fa6-bc95-bb6e54676b92 | 4 | public void addFromFile(String fichier)
{
try{
Scanner input= new Scanner (new File(fichier));
int numberOfEntries= Integer.parseInt(input.next());
System.out.println(numberOfEntries);
NoeudRN found= null;
while (input.hasNext() && numberOfEntries >= 0) {
int a= Integer.parseInt(input.next()),... |
0461756d-2cfb-4b25-b1bc-7254309dce9e | 5 | @Override
public void trigger(Value v) {
super.trigger(v);
if (parent_ != null && parent_.getMode() == EditorMode.DEBUG) {
for (OVLine l : lines_) {
if (v.getType() == ValueType.VOID
|| v.getType() == ValueType.NONE) {
l.debugD... |
8930529d-78b6-4ecb-bb1f-f57a4dd2ef04 | 8 | public ComputStdMethodLong(long []v){
if (null == v || 0 == v.length){
mean = median = stddev = 0;
min = max = 0;
}else if (1 == v.length){
mean = median = stddev = v[0];
min = max = v[0];
}else{
long sum = v[0],sqSum=0;
min = v[0];
max = v[0];
for (int i=1;i<v.length;i++) {
//Mini... |
35719336-8a47-4308-9ebd-4b754ef845dc | 9 | public Ast.AstPredicate parse_restrrPredicate1(Ast.AstPredicate inode, SpecObject specObject, String property)
{
int at = m_current;
if (!ok())
{
return null;
}
if (next(TozeTokenizer.TOKEN_LAND))
{
Ast.AstAndP anode = m_ast.new As... |
1a405a56-de69-46ea-874b-32fc8c8d766c | 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... |
35a6bf19-6b61-420b-a582-3dec65feea0a | 0 | public void setYahooAuctionModel(YahooAuctionModel yahooAuctionModel) {
this.yahooAuctionModel = yahooAuctionModel;
} |
6bd6ed9d-cc0e-4a74-81e5-e5c674c49b7d | 4 | public static String sortByValue(Map<String, ArtistInfo> map) {
List<Map.Entry<String, ArtistInfo>> list = new LinkedList<Map.Entry<String, ArtistInfo>>(
map.entrySet());
Collections.sort(list, new Comparator<Map.Entry<String, ArtistInfo>>() {
public int compare(Map.Entry<String, ArtistInfo> o1,
Map.Ent... |
ee6f66b2-1e0f-4979-9512-521c5ae8b717 | 3 | public void exec()
{
if (WindowStack.getLastInstance() != null) {
setParent(WindowStack.getLastInstance());
}
move(400, 300);
show();
wait = true;
while (wait) {
QApplication.processEvents();
try {
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
} |
a337406d-8b99-42be-a69d-527da2992378 | 6 | private boolean define(VirtualMachine virtualMachine) throws Exception {
String memory = virtualMachine
.getProperty(VirtualMachineConstants.MEMORY);
String diskType = virtualMachine
.getProperty(VirtualMachineConstants.DISK_TYPE);
String networkType = virtualMachine
.getProperty(VirtualMachineConsta... |
1efd0e91-1f0d-47ff-9a2c-d615661e3a31 | 1 | public static void main(String[] args) {
/*
System.setProperty("sun.java2d.opengl", "true");
System.setProperty("sun.java2d.translaccel", "true");
System.setProperty("sun.java2d.ddforcevram", "true");
*/
Wuuii wuuii = new Wuuii();
wuuii.init();
//TcpBroadcast tcp =... |
b87d32e6-cc0e-43cf-8a28-c1761f304ee5 | 5 | boolean checkSyntax(){
boolean result = true;
//save the current line to set it to this point at the end again
int initialCurrentLine = this.currentLine;
this.currentLine = 0;
String output = "";
String lastOutput = "";
if(this.lines.length > 0){
lastOutput = this.computeLine();
output = lastOutput;... |
cbf265d0-c811-415f-a302-ed6460b9be78 | 9 | public JFreeChart MakeChart() {
DefaultPieDataset chartDataSet = new DefaultPieDataset();
Object[] column1Data = super.getDataset().GetColumnData(super.getAttribute1());
Object[] column2Data = super.getDataset().GetColumnData(super.getAttribute2());
boolean addDataset = true;
String err... |
fd1a9ae1-368c-4a44-bab4-b92d4c6c68b1 | 6 | public final INIToken read() throws IOException {
while (true) {
final int symbol = this._reader_.read();
switch (symbol) {
case -1:
return null;
case '[':
final String section = this._readSection_();
return INIToken.fromSection(section);
case ';':
final String comment = this._re... |
c78dd45e-5b91-4997-8910-32f6bb8015b6 | 4 | public static void noGui(Settings settings, boolean showNotifications) {
Graph graf = new Graph();
try {
graf.loadFromFile(settings.graphFileName);
} catch (FileNotFoundException ex) {
System.err.println("Błąd pliku grafu!");
System.exit(-1);
}
... |
f430ef82-5e4a-4764-b9d9-b5a51cf5c377 | 9 | private static void collectItemData(String itemPath, String split_Sign) throws IOException {
File file = new File(itemPath);
BufferedReader buffRead = new BufferedReader(new InputStreamReader(new FileInputStream(file)));
boolean flag = true;
int tmp = 0 , count = 0;
int[] itemIndex = new int[DataInfo... |
d414cbbb-72a4-4d79-902c-69f855ea74c7 | 3 | public static ScatterLocation getLocation(Player p) {
for (ScatterLocation sl : locations) {
if (sl.p == p || ScatterManager.score.getPlayerTeam(p) == sl.t) {
return sl;
}
}
return null;
} |
d50280d5-c5f8-4a60-98ac-aed5b27a0c43 | 4 | public String toJSON()
{
Map<String,Object> parameters = new LinkedHashMap<String,Object>();
parameters.put("grant_type",getGrantType());
if (GoCoin.hasValue(getCode()))
{
parameters.put("code",getCode());
}
if (GoCoin.hasValue(getClientId()))
{
parameters.put("client_id",getCl... |
330017dd-d539-4cfe-8a9e-0b58c467d2e6 | 0 | public final TMState createTMStateWithID(Point p, int i){
TMState state = new TMState(i, p, this);
addState(state);
return state;
} |
9385ea1b-660e-4eb1-b113-57feef12244b | 1 | public void printList() {
Occurrence temp = head;
while (head != null) {
head.printOcc();
head = head.next;
}
head = temp;
} |
4c9b8498-40e5-45b0-8176-9b8f80e6c502 | 1 | protected void cancelPurchaseButtonClicked() {
log.info("Purchase cancelled");
try {
domainController.cancelCurrentPurchase();
endSale();
model.getCurrentPurchaseTableModel().clear();
} catch (VerificationFailedException e1) {
log.error(e1.getMessage());
}
} |
f36bc40d-6fc5-4eb2-8193-ea69e2e08915 | 3 | private String getCommand()
{
String command = "";
if (historyIndex>=0 && historyIndex < history.size())
{
command = history.get(historyIndex);
return command;
}
// Get last command from the text area
command = textArea.getText();
int length = command.length();
if (length< lastCom... |
d7a24d24-8289-43ef-afd9-03d92adc65c6 | 8 | public void WorkingElevatorEntHist() {
if(WorkingElevator_lastState == RiJNonState)
{
EmergencyStopped_entDef();
}
else
{
WorkingElevator_subState = WorkingElevator_lastState;
switch (Work... |
7e90b6e9-7d63-4099-a54c-b88d76b64993 | 3 | public User getProfileUser(String email)
{
initConnection();
//Check password matches for given email
String preparedString = null;
PreparedStatement preparedQuery = null;
try
{
//Prepare Statement
preparedString = "SELECT email, firstname, lastname FROM users WHERE email = ?;";
preparedQu... |
51dd3809-9982-418f-8139-b7a08a20c518 | 6 | public boolean createIndex(String tableName, int atributeIdx, String attributeName) {
for(Record rec: indexesTable) {
if(!tableName.equals((String) rec.getAttributes().get(TABLE_NAME))) {
continue;
}
Integer atrIdx = (Integer) rec.getAttributes().get(ATR_IDX);
if(atrIdx == atributeId... |
83f7f8a4-f925-47b7-bf2c-549fe338af71 | 1 | public String GetImage()
{
if (bufpos >= tokenBegin)
return new String(buffer, tokenBegin, bufpos - tokenBegin + 1);
else
return new String(buffer, tokenBegin, bufsize - tokenBegin) +
new String(buffer, 0, bufpos + 1);
} |
b4389ff2-d3f6-43e3-8846-e31cc0edfdc8 | 6 | @SuppressWarnings("deprecation")
public Client(String playerName, String url, int port) throws RemoteException {
UnicastRemoteObject.exportObject(this, 0);
this.players = new ConcurrentHashMap<>();
this.playerName = playerName;
if (System.getSecurityManager() == null) {
System.setSecurityManager(new R... |
b4080dc7-b146-4fe5-ab42-4e36aa6194e8 | 1 | public JTable createBookTable() {
// Datenbankverbindung
BookDB myBookDB = new BookDB();
// Bei der erstmaligen Initialisierung des Fensters gibt es noch keine
// Darstellungsprobleme mit der Tabelle. Es werden alle Datensätze
// angezeigt
if (getSearchText().getText().matches("Bitte Suchbegriff eingeben"... |
616a0bd7-ed61-48c0-8965-13da31fa58f6 | 9 | public void readString() throws ParseException {
StringBuffer val = new StringBuffer();
while (column < line.length()) {
char c = line.charAt(column++);
if (c == '"') {
value = val.toString();
return;
}
if (c == '\\') {
c = line.charAt(column++);
switch (c) {
case 'n':
... |
15ece017-58cd-4187-beb7-4eea58a17aa9 | 0 | @Override
public void setValue(Object o) {
throw new UnsupportedOperationException("cannot yet set virtual "+this.getNodeProperty().getName());
} |
c01645db-991e-45fd-9604-ebe8d4291ce2 | 9 | @Override
public String toString()
{
StringBuilder builder = new StringBuilder(m_having ? " HAVING " : " WHERE ");
int fieldCnt = 0;
for (WhereInfo whereInfo : m_whereInfo)
{
if (whereInfo.m_startBracket)
{
builder.append('(');
continue;
}
if (whereInfo.m_endBracket)
{
builde... |
59016b80-9ae4-4594-a1ab-f1e7b0c400bd | 4 | public void update(Ship ship, int delta) {
Iterator<Invader> it = invaders.iterator();
ArrayList<Invader> invaders_to_remove = new ArrayList<Invader>();
while (it.hasNext()) {
Invader invader = it.next();
if (invader.is_alive()) {
invader.update(delta);
} else {
invaders_t... |
b81d6255-a0bb-43c9-b18c-d212efc65a23 | 6 | public synchronized void makeCustomRequest (AnalyticsRequestData argData) {
if (!enabled) {
Logger.logInfo("Ignoring tracking request, enabled is false");
return;
}
if (argData == null) {
throw new NullPointerException("Data cannot be null");
}
... |
f0ac9073-be9a-4866-b86d-9618ee13d896 | 0 | private void initTextField(){
JLabel labelName = new JLabel("Name");
labelName.setBounds(10 , scrollTable.getY()+scrollTable.getHeight()+10, 95, 25 );
textFieldName = new JTextField();
textFieldName.setBounds(labelName.getX()+labelName.getWidth()+10,
scrollTable.getY()+sc... |
5675edac-325a-4d77-9d51-98bf8aa38e34 | 3 | public Class getTypeClass() throws ClassNotFoundException {
switch (typecode) {
case TC_LONG:
return Long.TYPE;
case TC_FLOAT:
return Float.TYPE;
case TC_DOUBLE:
return Double.TYPE;
default:
throw new AssertError("getTypeClass() called on illegal type");
}
} |
cd0e8c3c-e8a1-4389-8fac-bf74c2afc60c | 6 | public void saveFile(String filename) {
try {
List<String> sections_list = new ArrayList<String>();
for (String key : map.keySet()) {
String section = key.split("\\.")[0];
if (!sections_list.contains(section)) sections_list.add(section);
}
PrintWriter writer = new PrintWriter(new OutputStreamWr... |
64527590-eba6-4e55-b724-2a927161cdd6 | 1 | public Texture getTexture() {
if(animation != null) {
return animation.getTexture();
}
return tex;
} |
8cb06492-2b1d-4793-8b6c-9c89e5b1a95f | 2 | @Override
/**
* makes the given little man perform the next action in the sequence of
* little man actions. If the little man completes the final action in the
* list, this action sequence is reset so that the next action to be
* completed is the first action in the sequence.
*
* @para... |
675f9a60-9953-4562-b863-567b352af2a4 | 3 | public boolean deleteClaim(Claim c, String actionType) {
Element claimE;
Claim claim;
boolean flag = false;
System.out.println(fileName + "Claim delete: " + actionType);
for (Iterator i = root.elementIterator(actionType); i.hasNext();) {
claimE = (Element)i.next();
System.out.println(fileName + "Claim d... |
6052158a-36ff-4449-9964-180e3adf85d3 | 2 | public void sort(Object array[])
{
if (array != null && array.length > 1)
{
int maxLength;
maxLength = array.length;
swapSpace = new Object[maxLength];
toSort = array;
this.mergeSort(0, maxLength - 1);
swapSpace = null;
toSort = null;
}
} |
989a16e7-7ec0-46dd-bd70-b0d7ba0d6c96 | 7 | private void initObjs(){
//Object Packaging...
jLabelsActvArr = initMyActvJLabelsArray(ACTV_ROW_NUM_MAX);
jTextFieldsArr = initMyJTextFieldsArray(ACTV_ROW_NUM_MAX, DAYS_TO_ROLL_NONE);
//Central Activity Rows
jCheckBoxesCol1 = initMyJCheckBoxesArray(ACTV_ROW_NUM_MAX, ROLL_1_DAY_B... |
bd6b99ef-5f71-4bc7-b030-7cc626d47230 | 2 | private PrintWriter fluxSortant() {
if (connecteur != null) {
try {
return new PrintWriter(connecteur.getOutputStream());
} catch (IOException e) {
System.out.println("Problème de récupération du flux sortant du serveur");
}
}
return null;
} |
4b18f270-e5df-4f57-814e-96935c2d06ed | 2 | public Accounting() {
accountTypes = new AccountTypes();
accounts = new Accounts(accountTypes);
journalTypes = new JournalTypes();
journalTypes.addDefaultType(accountTypes);
journals = new Journals(accounts, journalTypes);
balances = new Balances(accounts, accountTypes... |
6fee28b2-e451-4f04-8d4d-5a23cb25fd6d | 0 | private void writeObject(ObjectOutputStream stream) throws IOException {
stream.defaultWriteObject();
stream.writeObject(b);
} |
0d33d758-f789-4961-a9db-e9b1d9604527 | 0 | public void draw(Graphics g){
Color c = g.getColor();
g.setColor(Color.MAGENTA);
g.fillRect(x,y,w,h);
g.setColor(c);
move();
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.