method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
3adddf6b-e9ee-4df7-bc0c-53ebd16572d9 | 9 | @Override
public void run() {
while (true) {
if (playing && !gameOver) {
try {
Thread.sleep(1000 / 30); // sleep for 1/30 second
moveBall();
try {
playerOne.movePaddle(player1FlagUp, player1FlagDown);
playerTwo.movePaddle(player2FlagUp, player2FlagDown);
repaint();
} catc... |
7b5c0201-b117-49d9-9efd-408aa635b1d3 | 1 | @RequestMapping(value = "/hall-event-all-partner-list/{hallEventId}", method = RequestMethod.GET)
@ResponseBody
public PartnerListResponse hallEventAllPartnerList(
@PathVariable(value = "hallEventId") final String hallEventIdStr
) {
Boolean success = true;
String errorMessage = n... |
3d30de62-caec-47d6-9b21-1a6dad90fdf0 | 6 | private void updateLevel()
{
// Distance between the traps:
int minDistance = 40;
int maxDistance = 400;
if (Math.abs(player.vel.x) > 1) {
maxDistance *= Math.abs(player.vel.x / 2);
minDistance *= Math.abs(player.vel.x);
}
int sinceLastUpdate = (int) Math.abs(mainCamera.position.x - lastCamera);
... |
d87e3eae-e80d-4696-9713-bec0f9969a23 | 7 | public boolean dialog(){
Font font1 = new Font("Default", Font.PLAIN, 12);
Font font1small = new Font("DefaultSmall", Font.PLAIN, 12);
//creates the dialog
Dialog = new JFrame("Macro Runner Settings");
directory = new JTextField("",20);
macrotorun = new JTextField("",20);
JLabel labeldir = new JLabel("D... |
b21096e0-321d-4fab-9684-f8c8fd1bed36 | 8 | public static void drawLine(int startX , int startY , int endX , int endY , byte data[]) {
int pos;
double xLength = endX - startX;
double yLength = endY - startY;
double step = (yLength != 0 ? xLength/yLength : xLength);
step = ((int)step == 0 ? 1 : (int)step);
double slope = (xLength != 0 ? yLength/... |
89614dc2-f698-4152-8aa4-1851b4d73626 | 2 | @Override
public void actionPerformed(ActionEvent e) {
for (Voiture voiture : vehicules) {
if (voiture != null) {
voiture.toggleForcerSortie(voieDeSortie);
}
}
} |
87fbbf14-4f45-45ef-ae7b-18b201edfd84 | 6 | public C4TwoDArrays() {
scan = new Scanner(System.in);
System.out.print("Enter your gender");
for (int i = 0; i < info[0].length; i++) {
System.out.print(" - " + i + " - for " + info[0][i]);
}
System.out.println();
int gender;
while ((gender = inputInt()) > info[0].length - 1 || gender < 0) {
Syst... |
8ba8610e-e9d6-4ecc-ae24-d3ae1bdf34b6 | 8 | protected void layout(Composite composite, boolean flushCache) {
Rectangle clientArea = composite.getClientArea();
Control[] ws = composite.getChildren();
// Lay out the separator, the tool bar control, the cool bar
// control, the status line, and the page composite.
// The following code assumes that... |
5a3eda65-07fc-4600-8ed9-d17192f0b541 | 4 | public static void main(String[] args) {
String strIndicePile1;
String strIndicePile2;
int indicePile1 = 0;
int indicePile2 = 0;
Scanner sc = new Scanner(System.in);
Jeu jeu = new Jeu();
boolean redemander;
while(jeu.estPasT... |
c68926db-5a1b-4a31-b846-82ab92d4c2f0 | 2 | public static void main(String[] args) {
// TODO Auto-generated method stub
try {
InputStreamReader fw = new InputStreamReader(System.in);
BufferedReader pw =new BufferedReader(fw);
if (pw.readLine() != null) {
System.out.println(pw.readLine());
} else {
System.out.println("No argument is pr... |
03b3c553-2daf-4b6d-84ba-a2a178876de2 | 7 | public int [] SortAndSearch(int [] arrA, int [] arrB){
//create an Aux array and copy all the elements of arrA
// create another boolean array, visited[] of size arrA[]
// Initialize visited[] = false
// Sort the Aux array using Merge sort.
// Navigate through the arrB, taking one element at a time, say x
/... |
de45a951-beee-4c20-8c62-6114eeaad83f | 3 | * @return Returns true if the cell label should be clipped.
*/
public boolean isLabelClipped(Object cell)
{
if (!isLabelsClipped())
{
mxCellState state = view.getState(cell);
Map<String, Object> style = (state != null) ? state.getStyle()
: getCellStyle(cell);
return (style != null) ? mxUtils.getS... |
eacead88-0a35-48be-af90-06b6f6093739 | 5 | protected static Image readMap8(FileInputStream fs,BitmapHeader bh) throws IOException
{
Image image;
// Have to determine the number of colors, the clrsused
// parameter is dominant if it is greater than zero. If
// zero, calculate colors based on bitsperpixel.
int nNumColors = 0;
if (bh.ncl... |
9f86f266-7669-4de1-8ea5-304fb9dab41a | 0 | public ArrayList<Message> getFilemessages() {
return filemessages;
} |
4e31571c-42f5-4896-ac2f-bfa3c5b46903 | 7 | @Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
if(width!=this.getWidth() || height!=this.getHeight()) {
width = this.getWidth();
height = this.getHeight();
displayBuffer = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
dBufferG = displayBuffer.creat... |
57a990bb-c8d6-4eff-9db6-c679fa8a8554 | 5 | private void assignAsset() {
if (asset.equals("25")) {
tex = td.getAsset(TextureDistributor.TEXTURE_HEALTH25);
} else if (asset.equals("nail")) {
tex = td.getAsset(TextureDistributor.TEXTURE_NAILS);
} else if (asset.equals("50")) {
tex = td.getAsset(TextureDi... |
0686421e-7305-4ba6-b866-553bfdcfafcd | 3 | public double harmonicMean_as_double() {
double mean = 0.0D;
switch (type) {
case 1:
double[] dd = this.getArray_as_double();
mean = Stat.harmonicMean(dd);
break;
case 12:
BigDecimal[] bd = this.getArray_as_BigDecimal();
mean = (Stat.harmonicMean(bd)).doubleValue();
bd = null;
break;
cas... |
a28b6a5f-58f0-4e92-927c-16f0b89cabcf | 8 | private List<Movie> deserialize(String json) {
List<Movie> movies = new ArrayList<>();
try {
JSONObject response = new JSONObject(json);
JSONArray movieObjects = response.getJSONArray("movies");
for (int i = 0; i < movieObjects.length(); i++) {
JSONObj... |
5614ea85-39df-404b-a2ab-1243696ec816 | 9 | public String toString() {
String formula = "";
for (int exponent = coeffs.length-1; exponent >= 0; exponent--) {
if (coeffs[exponent] != 0.0) {
if (Math.abs(coeffs[exponent]) != 1.0 || exponent == 0)
formula += Math.abs(coeffs[exponent]);
... |
7b1f4799-fa87-4149-b916-6551391765ee | 3 | public boolean checkForIntersection(Rectangle rect)
{
return ! ( rect.left > right
|| rect.right < left
|| rect.top > bottom
|| rect.bottom < top);
} |
d008495c-b2b3-4d88-a371-8e92cd087ba8 | 0 | public String adminCreateNewProduct() {
this.product = new Product(this.name, Float.parseFloat(this.price),
this.quantity, this.code.toUpperCase(), this.desc);
this.adminFacade.createNewProduct(this.product);
return "adminProductDetails";
} |
d02e2410-1e47-4fc1-9e1d-6fd4caceb063 | 0 | @Override
public PreferencesGUITreeComponent getPreference(int i) {
return (PreferencesGUITreeComponent) prefs.get(i);
} |
11c04122-99fe-4bc8-9119-a08657117774 | 2 | public void collectTreasure() {
if(type == TileType.TILE_TREASURE) {
type = TileType.TILE_FLOOR;
for(IBomber b : bombers) {
b.awardPoints(match.pointsPerTreasure / bombers.size());
}
}
} |
06ad909f-6070-434d-8143-a16ba06e068c | 2 | public boolean isNameAvailable(String s) {
for (ClientAgent a : handlers) {
if (s.compareTo(a.getClientName()) == 0)
return false;
}
return true;
} |
c8a0f53e-a63a-4f28-9be7-372a1d4b8dd8 | 4 | private void generateMaze(int clength, int cwidth) {
DIR[] dirs = DIR.values();
Collections.shuffle(Arrays.asList(dirs));
for (DIR dir : dirs) {
int nlength = clength + dir.dlength;
int nwidth = cwidth + dir.dwidth;
if (between(nlength, length) && between(nwidth, width) && (maze[nlength][nwidth] == 0)) {... |
b0e7194b-d49f-49ee-9222-89feb3ce03e8 | 9 | public static void end_current_run() {
if (anim_stopped) {
running = false;
}
if (incomplete && (output_analysis_type == BATCH_MEANS) && (!anim_stopped)) {
// A termination condition of interval accuracy is being used
running = true;
} else {
// Allow all entities to exit their b... |
40312e39-23fa-4991-ad59-d2489ac3de4c | 8 | private void samplePIn()
{
final PInSampler sampler = graph.getSamplerForNewPIn();
final List<Double> pInValues = graph.getGroundTruth().getPIn();
if (PInSampler.MEAN == sampler || pInValues.size() == 1)
{
this.firstResultingPIn = initialCluster.getPIn();
this.secondResultingPIn = initialCluster.getPIn(... |
b6cb2270-b6d5-49ba-9f4d-391aba538f8a | 9 | public static String addLanguage(String eadfile, String language, String langCode)
throws XMLStreamException, FactoryConfigurationError, IOException {
String outputfile = eadfile.replace(".xml", SUFFIX + ".xml");
FileInputStream fileInputStreamEAD = new FileInputStream(eadfile);
X... |
ed9560ab-6fd9-48e0-9991-03ed33242499 | 0 | public void run() {
mediator.consultation(this);
} |
dbc9679f-391c-48b0-bc77-45472aa2f8fc | 0 | public void setPaciente(Paciente paciente) {
this.paciente = paciente;
} |
de728db5-affe-4059-8233-dae293212196 | 4 | private void endActionUpdate() {
decrementLifetime();
if (getLifetime() == 0 && getGrid().getElementPosition(this) != null) {
getGrid().removeElement(this);
} else if (getLifetime() == -1) {
final Position newTertiaryPos = getTertiaryPowerFailurePosition();
if (getGrid().validPosition(newTertiaryPos... |
2aac5eb0-b333-4484-b7a5-8ebf9d2a2852 | 8 | public static boolean isRatAndPiperAtSameRegion(int id, Point rat){
double angle=Math.toDegrees(Math.atan((rat.x-Global.GATE.x)/(rat.y-Global.GATE.y)));
if(angle<0)
angle*=-1;
else
angle=(180-angle);
if(id==0&&angle>=Global.thetas[id]){
return true;
}else if(id==Global.npipers-1&&angle... |
bc0c5e88-6aef-4069-ac73-dc87488be98b | 5 | public void viewResult(){
System.out.println("\n Geselecteerde quiz: " + selectedQuiz);
System.out.println("Quizzen met gemeenschappelijke opdrachten:");
for (Opdracht opdracht : opdr1) {
for (Quiz quiz : quizList) {
for (Opdracht opdracht2 : quiz.getOpdrachten()) {
if (opdracht2.equals(opdracht)) {
... |
be0f235b-d464-42d5-888c-373343744b54 | 4 | @Override
public InputStream getInputStream(String path) {
File file = new File(PATH + path);
try {
return file.exists() && file.isFile() && file.canRead() ? new FileInputStream(file) : null;
} catch (FileNotFoundException e) {
e.printStackTrace();
return null;
}
} |
e01cf801-5e77-4bbf-8113-4da78a9ef65c | 2 | public void parseExpression(CharSequence expression, Handler handler) {
Id leftId = null;
String relationExpr = null;
Matcher matcher = EXPR_LEFTSIDE.matcher(expression);
while(matcher.find()) {
State state = parseState(matcher.group(1));
Id rightId = handler.emi... |
c724cd71-42b9-4843-a98e-8d645301c9b1 | 7 | public List<Integer> getVehicleIdList(int userId, int uprofile) {
List<Integer> list = new ArrayList();
String queryLISTMSISDN = "";
if (uprofile == 3) {
queryLISTMSISDN = "select vehicleid from vehicle";
} else {
queryLISTMSISDN = "select vehicleid from vehicle w... |
7b1c2fb3-6c37-4d63-930e-d49ab44bdca2 | 6 | public int[] getExplicitIntArrayArgument(String name, boolean required){
if(M.containsKey(name))
{
String a = M.get(name).trim();
if("iI".indexOf(a.charAt(0)) == -1){illFormedArray(a," expected integer array");}
if(a.charAt(1) != '[' || a.charAt(a.length()-1) != ']'){... |
e0a348d0-e7f9-4244-8291-012239918fb8 | 2 | public Boolean checkType(int type){
for(int i=0; i<types.length;i++){
if (type == types[i]){
return true;
}
}
return false;
} |
3b5ca6ee-87a6-46ec-bde9-6b6c1cf9bf6f | 8 | @Override
public double convertTo(int type) {
switch (type) {
case UnitConstants.FEET_SECOND:
return getValue() * 0.0166666;
case UnitConstants.FEET_MINUTE:
return getValue();
case UnitConstants.MILES_MINUTE:
return getValue... |
4411a3a5-5d7d-473d-b495-f250d8d55124 | 0 | @Test
public void deleteWorksAtBeginning() {
initializeWithABC();
l.delete(a);
assertEquals(b, l.min());
assertEquals(null, l.pred(b));
} |
d4718296-4686-4341-915d-5973fffd6043 | 3 | private void trieTableur(String motACoder)
{
chaine = new ArrayList<Integer>(ascii.conversionASCII(motACoder));
//Ajout du mot dans la premiere ligne du tableur
tableurNonTrie.add(0,chaine);
//on boucle pour toutes les autres lignes du tableur pour décaler à chaque fois un c... |
e7b79e8d-52e5-438f-8a80-0363dbc1e275 | 3 | public void goDijkstra(int x,int y) {
int profondeur = 0;
Stack<Point> toDo = new Stack<Point>();
toDo.add(new Point(x, y));
for(int j=0;j<taille_envi;j++){
for(int i=0;i<taille_envi;i++){
dijkstra[i][j]=-1;
}
}
dijkstra[x][y]=profondeur;
while(!toDo.isEmpty()){
profondeur++;
Point p = toD... |
98b95334-e921-4c66-94de-6d9868141977 | 2 | @Override
public void run() {
if(saving){
Nostalgia.broadcastMessage(SavingMSG, true);
}
Nostalgia.saveAll();
if(saved){
Nostalgia.broadcastMessage(SavedMSG, true);
}
} |
fbf76d31-08d5-4323-995e-d39f9170ebf0 | 8 | public void removeAt(Stella_Object key) {
{ KeyValueMap self = this;
{ Stella_Object map = self.theMap;
int crossover = self.crossoverPoint;
if (crossover == 0) {
StellaHashTable.stellaHashTableRemoveAt(((StellaHashTable)(map)), key);
}
else {
{ KvCons cur... |
daa3f9fe-ab5f-425e-afa7-901fbcf6b4e6 | 3 | public static boolean hasTag(String eadfile, String tag) throws FileNotFoundException, XMLStreamException, FactoryConfigurationError{
boolean result = false;
FileInputStream fileInputStreamEAD = new FileInputStream(eadfile);
XMLEventReader xmlEventReaderEAD = XMLInputFactory.newInstance()
.createXMLEventR... |
56dc38ae-3162-4a57-95aa-ff6274af4dbf | 7 | * @param match
* The BracketMatch instance for this match attempt.
*/
private void findMatchBackward(int row, int col, BracketMatch match) {
int y = row;
int blockType = 0;
StringBuilder sb = code.getsb(y);
// Figure out what kind of block we're in, if any.
ArrayList<... |
dc9d8a30-8c8f-46f9-ae44-639c5b9a0060 | 6 | private void formWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowOpened
try {
List<Commercial> pp1 = RequetesCommercial.selectCommercial();
for (Commercial commercial : pp1) {
jComboBoxInterlocuteurCommercial.addItem(commerc... |
a13b64d6-0215-4651-852b-2827abe9b15e | 5 | private boolean colDectLEFT() {
if (Controler.left) {
colBox.x -= Game.pSpeed;
xPrev += Game.pSpeed / 4;
}
colBox.setBounds(colBox.x, colBox.y, colBox.width, colBox.height);
for (int i = 0; i < world.tiles.length; i++) {
for (int j = 0; j < world.tiles[0].length; j++) {
if (colBox.intersects(wor... |
68623181-8b79-4471-a5fa-b76364a252de | 3 | public static TextureObject fromStream(InputStream s)
{
DataInputStream d=new DataInputStream(new BufferedInputStream(s));
d.mark(Integer.MAX_VALUE);
try
{
TextureObject ret = new TextureObject(d.readUTF(), d.readInt(), d.readInt());
int animations = d.readInt();
for(;animations > 0; animations--)
... |
2d5b4010-1f34-4867-afdd-578ef0865365 | 7 | void chooseMaxSufferage() {
/* Find the min makespan in one class, and then find the max one */
double tmpMinMakespan = Double.MAX_VALUE;
double tmpSecondMinMakespan = Double.MAX_VALUE;
double tmpMinCost = Double.MAX_VALUE;
double tmpMaxSufferage = -1;
int iTmpMinClass = 0;
int iTmpMinSite = 0;
int iTm... |
47245c2c-14ad-4973-8d1f-fa3772348bce | 5 | public static boolean deleteDirectory(File dir)
{
if (Utils.isNull(dir, false) || !dir.exists() || !dir.isDirectory()) throw new IllegalArgumentException("'dir' Must exist and Must be a directory!");
final String[] files = dir.list();
for (final String file : files)
{
final File f = new File(dir, file);
... |
17845d5d-4cfb-4d4f-9626-fc09ce6e005d | 7 | public static void main(String[] args) throws Exception {
CSG a = new CubeBrush(new Vector3f(-0.25f, -0.25f, -0.25f), new Vector3f(1f, 1f, 1f));
CSG b = new SphereBrush(new Vector3f(0.25f, 0.25f, 0.25f), 1.3f, 16, 8);
CSG boxOut = a.subtract(b);
// Now let's get our polygons
Polygon[] polys = boxOut.getPolygo... |
f58ef63e-8957-4596-9311-3547077d3073 | 0 | public Vertex getEnd() {
return end;
} |
5fd18585-b6ed-4e6a-a331-fda68de3be5a | 0 | public void setSector(String sector) {
Address.setSector(sector);
} |
a51d4f8f-029e-4506-80d3-87b80d6d8cc2 | 6 | public static boolean checkOutBounds(String name,int appositionX,int appositionY){ //apposition: position après le déplacement
boolean ret = true;
if(appositionX >=SIZE && name.equals("X")) {
ret = true;
}
else if(appositionX < 0 || appositionX >= SIZE || appositionY < 0 || appositionY >= SIZE){
System.o... |
0d2e49bf-9e67-44b5-a164-6700b90cc338 | 1 | @Override
public Object execute(HttpServletRequest request, HttpServletResponse response) throws Exception {
Contexto oContexto = (Contexto) request.getAttribute("contexto");
oContexto.setVista("jsp/mensaje.jsp");
HiloBean oHiloBean = new HiloBean();
HiloParam oHiloParam = new HiloPa... |
a5eedb45-e256-4c02-81b8-a9ab85c623be | 9 | private int asrW(int dest, int n) {
clearFlags(SR_N, SR_Z, SR_V, SR_C);
boolean hibitSet = msbSetW(dest);
boolean hasOverflow = false;
int result = dest;
boolean msbSet;
for (int i = 0; i < n; i++) {
msbSet = msbSetW(result);
if (msbSet) setFlags(SR_X, SR_C);
else clearFlags(SR... |
46053d1b-c7a6-4d06-8b54-6be0701dd9cd | 5 | private void processDocument() {
//Iterates through every line in the document using the provided DocumentReader class.
while (document.hasLines()) {
//Increases the line count.
lines++;
//Splits each word in the document into a string index.
String[] parseString = document.getLine().split("\... |
192a38a1-aeac-457b-addc-33f79342c335 | 3 | private void alignScrollPane() {
stage.setWidth(
stage.icon.getImage().getWidth()
+ Math.max(
stage.messageLabel.getWidth(),
(stage.stacktraceVisible
? Math.max(
stage.stacktraceButto... |
fada01f1-0061-4cae-bcf2-1450652c5383 | 9 | public boolean checkStalemate(boolean white) {
for (int y = 0; y < 8; y++){
for (int x = 0; x < 8; x++){
if (board[x][y] != null) {
if (board[x][y].isWhite() == white) {
for (int yy = 0; yy < 8; yy++){
for (int xx = 0; xx < 8; xx++){
boolean isNewSpotEmpty = true;
if (board... |
2a7deb41-7781-4528-8377-b7f9e75a2de4 | 4 | @Override
public void handleMouseWorld(int x, int y, int flag) {
if (!Game.currentGame.isActiveScene(this)) return;
if (Mouse.isButtonDown(1)) {
if (!Mouse.isGrabbed()) Mouse.setCursorPosition(Display.getWidth() / 2, Display.getHeight() / 2);
Game.currentGame.mouseGrabbed = true;
if (Mouse.isButton... |
5337e903-db22-4b0a-bf2f-5f415372ba84 | 7 | protected Map<String, Class<?>> fillSupportedOperations() {
Map<String, Class<?>> nameToClass = new HashMap<String, Class<?>>();
for (String name : getSupportedWriteOperations()) {
String simpleName;
if (name.startsWith("class")) {
simpleName = name.split(":")[1];... |
61711e0c-ba84-4c97-966a-6c6a0997b233 | 3 | private static void verifySourceCodeHasCorrectPackageName(File currentFolder,
PackDetails packDetails) throws IOException {
final File srcFolder = new File(currentFolder, "src");
if (packDetails.KeyboardSourceCodeFile != null)
verifySourceCodeFileHasCorrectPackageName(new File(sr... |
d3edfde3-d45b-4ac1-890e-e9e98ad3a0c4 | 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... |
7873997e-130c-432c-9695-d1ddaf5c5b4b | 0 | public Person() {
Name = " ";
LastName = "";
ID = "";
Phone = "";
Mobile = "";
Email = "";
sex = "";
Birth = "";
this.Address = new Address("", "", "", "", "", "","");
Nationality = "";
YearsExperience = 0;
CertTitles= new ArrayList<String>();
} |
3705612a-377c-4284-8eaf-ca2eca89f8e8 | 0 | public String getSigla() {
return sigla;
} |
ff245cce-3490-45ed-9c7e-823feb1f624e | 6 | public void write(TSLWriter writer,String name) throws IOException
{
if(objects_map.isEmpty() && strings_map.isEmpty())
{
return;
}
TSLUtil.validateValueName(name);
writer.startObject(name);
writer.pushFormatter();
writer.getFormatter().setNewLine(!objects_map.isEmpty());
for(Map... |
151eb07f-504f-4743-aa9a-87ba34be0607 | 4 | private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
// TODO add your handling code here:
liceu.Secretar s = new liceu.Secretar();
s.delClasa((String)clasaDeSters.getSelectedItem());
clasaDeSters.removeAllItems();
Buffere... |
fa8022fc-7d58-4917-af56-805021a32a12 | 0 | public RoomEvent getRoomEvent() {
return roomEvent;
} |
2e77ca72-23b2-4b71-88bf-4943aabfcc51 | 2 | private static boolean checkUserNamePassword(String userPass){
List<String> pass = xmlParser.getPasswordUser();
for (String s: pass){
if (s.equals(userPass))
return true;
}
return false;
} |
791adfc5-f2de-40a9-a3f2-3b99877d10d6 | 8 | public boolean containsValue( Object val ) {
byte[] states = _states;
V[] vals = _values;
// special case null values so that we don't have to
// perform null checks before every call to equals()
if ( null == val ) {
for ( int i = vals.length; i-- > 0; ) {
... |
22216239-3894-4fe9-8aa4-586c7bff3327 | 7 | private Object readJSON() throws JSONException {
switch (read(3)) {
case zipObject:
return readObject();
case zipArrayString:
return readArray(true);
case zipArrayValue:
return readArray(false);
case zipEmptyObject:
return new JSONO... |
52675bfa-bbe5-4a8e-a7ed-cf4e780cd693 | 9 | public static void vystupMapa(List<Mesto> list, List<Letiste> list2, File f, int bezSous) {
// TODO Auto-generated method stub
FileOutputStream stream;
try {
stream = new FileOutputStream(f);
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(stream));
writer.append(String.valueOf(bezSou... |
a3d48fa4-bc55-4e01-b642-ebddd1af646a | 1 | public void setMaxLocals(final int maxLocals) {
if (code != null) {
code.setMaxLocals(maxLocals);
}
} |
f23e5e3c-ebd8-4567-aa29-74681a47af2a | 7 | 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... |
af725e02-2bfa-4aa0-aca3-d672941f8de8 | 2 | private String parameterValueStringApiValue(final CycSymbol key, final Object val) {
final Object cycListApiValue = parameterValueCycListApiValue(key, val);
if (isProblemStoreSpecification(key, cycListApiValue)) {
return problemStoreStringApiValue((List) cycListApiValue);
}
if (cycListApiValue ins... |
188d9405-bc48-40be-ac82-e57c9654f977 | 0 | public CipherReferenceType getCipherReference() {
return cipherReference;
} |
c638b277-072d-4672-b4aa-3fa8c69641da | 8 | private void setListener() {
rBtn1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
showSelectTable();
}
});
rBtn2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
showCourseTable();
}
});
selectBtn.addAction... |
5d6c52c4-3fc6-4d20-a4d4-8c61ebe9dd2a | 7 | private void updateLineContent(String content, boolean rendered) {
String[] lineContents = content.split("\n");
if (lineContents.length == 0) {
// lines.clear();
return;
}
if (node instanceof Line) {
Line line = (Line) node;
line.setConten... |
b1242098-956d-4f39-88b4-dc71beea40ee | 3 | @SuppressWarnings("unchecked")
public static <K> K[] remove(K[] original, int removeIndex) {
K[] returned = (K[]) new Object[original.length - 1];
if (removeIndex >= original.length)
removeIndex = original.length - 1;
for (int i = 0; i < removeIndex; ++i)
returned[i... |
710798ee-a8ee-4f3c-a34c-0e2e7bcdfea0 | 3 | public static void assertEquals(double[] expected, List<Double> actual) {
if (expected.length != actual.size()) {
Assert.fail("Array and list have different size. " +
"Expected array: " + Arrays.toString(expected) +
" Actual list: " + actual.toString());
}
for (int i = 0; i < expected.length; i++) {... |
510b8903-1760-4fe6-85ae-e7ab97a9c6af | 0 | public ConfigParserTest() {
} |
a8e163d7-0f82-4b1c-bc84-f1bdf798a654 | 7 | protected void startGame() {
notifyNewGame();
discardCards();
shuffle();
community.clear();
doAntes();
doBlinds();
doneFlop = false;
doneTurn = false;
doneRiver = false;
dealPlay... |
7c72e145-377a-4fe0-b25a-80346a0380c6 | 1 | public void parseAssert(boolean condition, String message)
throws ParseException {
if (!condition) {
throw new ParseException(message + " (line " + lineNumber + ")",
lineNumber);
}
} |
b4fdcb38-3e54-442c-ad39-74d50f4ce61e | 9 | void loadMotif() {
if (verbose) Timer.showStdErr("Loading Motifs and PWMs");
//---
// Sanity checks
//---
String pwmsFileName = config.getDirDataVersion() + "/pwms.bin";
if (!Gpr.exists(pwmsFileName)) fatalError("Warning: Cannot open PWMs file " + pwmsFileName);
String motifBinFileName = config.getBaseF... |
376f3ec9-283f-4953-8a47-5d27a085cd1e | 4 | @Override
public void execute(CommandSender sender, String[] args) {
if (!CommandUtil.hasPermission(sender, PERMISSION_NODES)) {
sender.sendMessage(plugin.NO_PERMISSION);
return;
}
if (args.length < 1) {
sender.sendMessage(ChatColor.RED + "/"+plugin.tpaHere+" (playername)");
return;
}
Proxi... |
77299e32-4f6f-4807-af89-b301d635e564 | 4 | @Override
public void draw(SpriteBatch batch, float parentAlpha) {
if (MyStage.isCameraView(stage, x, y)) {
update(Gdx.graphics.getDeltaTime());
if (isDead) {
batch.draw(deadTexture, x - 32, y - 32, originX, originY, width, height, 1, 1, rotation);
} else ... |
18e8b919-070d-4be8-b9bd-c59e6019b0a9 | 6 | public void loadMap(String name){
tiletypes = new ArrayList<Character>();
try {
String dir = "/resources/";
String imagefile1 = "bush.png";
String imagefile2 = "grass.png";
String imagefile3 = "stone.PNG";
URL url = (getClass().getResource(dir+name));
if(GameGui.debug){
System.out.pr... |
b37726c6-4e03-491e-8849-959b95a51ac6 | 3 | public Node getNode( int id ){
if( nodes.size() > 0 ){
for( Node node : nodes ){
if( node.getID() == id ){
return node;
}
}
}
return null;
} |
1ba56b8e-6ff2-4264-bbbe-29fa6d0723da | 8 | @SuppressWarnings("resource")
@Override
public void run() {
int count = 0;
String insert = "insert into outauthor(paperid,name,outauthors)values(?,?,?)";
try {
PreparedStatement statement = sqLconnection.conn
.prepareStatement(insert);
for (String id : IDS) {
List<String> citationIDs = getCitedID... |
b554cf30-206e-4381-90b6-cb3a58f7778c | 7 | private void changeMachine() {
boolean checkAll = false;
outer:for (int i = 0 ; i < this.lobby.getMachines().size(); i++) {
if (this.lobby.getMachines().get(i).isOn()) {
checkAll = true;
break outer;
}
}
if (this.currentMachine != null) {
this.currentMachine.setInUse(false);
this.mone... |
48633cfd-3863-4514-946e-862cdd28fe30 | 8 | int readUtah(int row, int column, int numRows, int numColumns) {
int currentByte = 0;
if (readModule(row - 2, column - 2, numRows, numColumns)) {
currentByte |= 1;
}
currentByte <<= 1;
if (readModule(row - 2, column - 1, numRows, numColumns)) {
currentByte |= 1;
}
currentByte <<=... |
cb080b49-e969-4a66-a8a6-1889136a1ecd | 3 | @Override
public void run() {
isRunning = true;
while (isRunning) {
try {
Thread.sleep(5L);
StringBuilder line = null;
while ((line = new StringBuilder(reader.readLine())) != null) {
network.addInboundMessage(Message.createClientMessage(null, line.toString()));
}
} catch (IOException | ... |
bda5499c-689a-4edb-bde7-92b6b733421c | 4 | public void testBinaryCycAccess3() {
System.out.println("\n**** testBinaryCycAccess 3 ****");
CycAccess cycAccess = null;
try {
try {
if (connectionMode == LOCAL_CYC_CONNECTION) {
cycAccess = new CycAccess(testHostName, testBasePort);
assert cycAccess.getCycLeaseManager() ... |
9344741c-1ea7-4ec6-a5ac-675013a9e125 | 0 | public void notifyObserver(String str) {
/*
* if(str.matches("^0[0-9]+")) str = str.substring(1, str.length());
*
* for(Observer obs : listObserver) obs.update(str);
*/
} |
d4e681c5-1058-4f01-87b3-0ec293698517 | 4 | public boolean isPackage(char[][] parentPackageName, char[] packageName) {
String fullName = CharOperation.toString(parentPackageName);
if (packageName != null) {
if (fullName.length() > 0)
fullName += ".";
fullName += new String(packageName);
}
if (findType(fullName) != null)
return ... |
6b8b7394-3f76-4954-9943-da2f891a84f1 | 5 | public static void addSign(Arena arena, Sign sign){
if(sign != null){
ArrayList<Sign> arenaSigns = new ArrayList<Sign>();
if(signs.get(arena) != null){
arenaSigns = signs.get(arena);
if(signs.get(arena).contains(sign)) return;
}
arenaSigns.add(sign);
signs.put(arena, arenaSigns);
File fichi... |
edcddc81-00c3-4aa7-9225-c72c5eade3e2 | 2 | public RealPlayer(BufferedImage image, int x,int y){
this.image = image;
this.x=x;
this.y=y;
try {
this.defualt=ImageIO.read(new File(FileLoader.class.getResource("spr_main.png").toURI()));
} catch (IOException e) {
e.printStackTrace();
} catch (URISyntaxException e) {
e.printStackTrace();
}
... |
62f2ba64-863b-45a0-9576-250c93a4e9c8 | 5 | private void pintarHistogramaRGB(short matrizR[][],short matrizG[][],short matrizB[][]) {
Graphics g;
Color color;
imagen = createImage(getWidth(), getHeight());
g = imagen.getGraphics();
for(int i = 0; i < matrizR.length; i++) {
for(int j = 0; j < matrizR[0].length; ... |
1eac3e58-3424-42a7-a4fb-a3ded96ce040 | 7 | public List<InlineLink> searchInlineLinks(InlineLink searchCriteria, String orderBy, Pagination pagination) {
logger.info("start searchInlineLinks");
// convert to map
Map<String, String> parameters = new HashMap<String, String>();
if(StringUtils.isNotBlank(searchCriteria.getTopicId())) ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.