method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
49bb9f12-9600-4de5-ba8e-a1684d7017f5 | 3 | public void printGridletList(boolean detail)
{
LinkedList list = receiveList_;
String name = name_;
int size = list.size();
Gridlet gridlet = null;
String indent = " ";
System.out.println();
System.out.println("============= OUTPUT for " + name + " ======... |
6e4e9884-1824-4ed5-85ca-fbf9a18dde12 | 1 | private boolean isYCoordInsideWindow(int yCoord) {
return (yCoord >= Math.abs(yOffset))
&& (yCoord <= (windowDimension.height + Math.abs(yOffset)));
} |
fc0ac6f6-26f4-406b-a3a5-ec7e599e8026 | 1 | public void initializeDependencyGraph(VariableDependencyGraph graph,
Grammar grammar) {
// StatePlacer sp = new StatePlacer();
String[] variables = grammar.getVariables();
for (int k = 0; k < variables.length; k++) {
// Point point = sp.getPointForState(graph);
double theta = 2.0 * Math.PI * (double) k
... |
a9a91c04-b92b-49ae-b27b-16d36544e3fd | 3 | static void printMatrix() {
String str = "\t";
DecimalFormat df = new DecimalFormat();
df.setMaximumFractionDigits(2);
for (int i = 0; i < MATRIX_SIZE; i++) {
for (int j = 0; j < MATRIX_SIZE; j++) {
if (matrix[i][j] < 0)
str += df.format(matrix[i][j]) + "\t";
else
str += " " + df.format(mat... |
e3f59ce7-7617-43c1-bbdd-41bf3301473e | 5 | @SuppressWarnings("deprecation")
public void validUserPass(){
userObj.setUser(userTF.getText());
userObj.setPassword(passwordTF.getText());
if((userObj.getUser().isEmpty()) || (userObj.getPassword().isEmpty())){
JOptionPane.showMessageDialog(null, "Invaild Username or Password");
if(userObj.getPassword().i... |
a1f1865a-def7-4609-8184-1a6e217d905f | 2 | public void setup() {
size(1200, 800, OPENGL);
noFill();
colorMode(HSB, 100);
sp = new ArrayList<Spinner>();
for (int i = 0; i < initialAgents; i++) {
if (i < agents/2) {
sp.add(i, new Spinner(maxId,0,initialE));
} else {
s... |
14ba1880-d469-4800-aaad-801b469ef6fc | 3 | public void setXFormula(String[] formula) throws OrderException,
ParseException, ConnectException {
stateNum = formula.length;
outputX.setDim(stateNum);
if (fod == null)
fod = new FOD(formula, this);
else
fod.setFormula(formula);
if (x0 == null || x0.getRowDimension() != stateNum)
x0 = new ColumnM... |
5b9c44f2-2e15-48ca-991b-249dbce59f10 | 6 | public boolean saveAsProject(Component parentComponent, NESModelListener listener){
File selectedFile = FileUtilities.selectFileForSave(parentComponent);
if(selectedFile == null){
return false;
}
boolean ret = saveProjectToFile(selectedFile);
projectFileName = selectedFile.getAbsolutePath();
if(ret) {
... |
d047ef51-f9b6-4d88-8381-a38c62456f92 | 3 | private void setSpecificMutationsFields() {
for (Mutation mutation : mutationsOps) {
if (mutation instanceof SpecieReplaceMutationForProgram1) {
((SpecieReplaceMutationForProgram1) mutation).setRuleRepository(ruleRepository);
} else if (mutation instanceof InsertionForProgramImpl) {
((InsertionForProgra... |
44218d5e-44b4-4db3-8164-31350e366e27 | 3 | public String getRoomExits (Integer id) {
String exits = "";
Boolean first = true;
for (Map.Entry<String, String[]> exit : environmentExits.entrySet()) {
if (exit.getKey().startsWith(id + ":")) {
String[] tempArray = exit.getValue();
if (!first) {
... |
c757331c-c1d5-4500-bc4b-e362f2683a9c | 8 | public int performRead(int address, long cycles) {
System.out.println("TFE_CS8900: read " + Integer.toString(address, 16));
switch (address) {
case PPDATA:
break;
case PPDATA + 1:
break;
case PACKET_PP:
break;
case PACKET_PP + 1:
break;
case TXCMD:
break;
ca... |
1ab0130d-f205-4cbd-b442-73d38308b6b7 | 4 | public void filledEllipse(double x, double y, double semiMajorAxis, double semiMinorAxis) {
if (semiMajorAxis < 0) throw new RuntimeException("ellipse semimajor axis can't be negative");
if (semiMinorAxis < 0) throw new RuntimeException("ellipse semiminor axis can't be negative");
double xs = sc... |
0bd539b3-56a8-4d16-9dcd-27010172b317 | 2 | protected void displayAustinResults(){
ShopElement[] shopListInfo= decisionProcess.getShopListInfo();
String storeInfo = "Total number of Stores: " + shopListInfo.length + "\n";
if (shopListInfo != null){
for (int i=0;i<shopListInfo.length;i++){
storeInfo += "\n " + (i+1) + "). Store: \n============... |
1cf68316-15d3-4a44-a717-6333caddac27 | 6 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (!(obj instanceof Tag))
return false;
Tag other = (Tag) obj;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return false;
return... |
3b85ca5b-be02-4364-9c8d-6f56a2db2a42 | 8 | private ChatRemoteManager() {
addListener(new ActionListener() {
@Override
protected TaskAction getListenAction() {
return TaskAction.QUIT;
}
@Override
protected void onAction(HashMap<String, String> params) {
if(conne... |
8c46ba51-156a-4a79-96cd-44f61c6b64fe | 7 | public void delete(LinkSetNode n) {
if (n == null)
return; // Key not found, do nothing
if (n.left != null && n.right != null) {
// Copy key/value from predecessor and then delete it instead
LinkSetNode pred = maximumNode(n.left);
n.s = pred.s;
... |
5a90d525-ca2c-4e10-a2c1-942f6dfab7ec | 8 | public List<FacebookProfile> getUserFromSearch(String searchQuery) {
CloseableHttpClient httpClient = HttpClients.custom().setConnectionManager(this.cm).build();
HttpGet httpget = null;
try {
httpget = new HttpGet("https://www.facebook.com/search/results.php?type=users&q="
+ URLEncoder.encode(searc... |
ea11fd4d-185b-4fb9-ac0e-423004702f88 | 3 | public static void calculchemin(Node source)
{
source.minDistance = 0.0;
Chaine file = new Chaine();
file.push(source);
while (!file.isEmpty()) {
Node u = file.pop();
file.print();
for (Edge e : u.lien)
{
... |
d78b8050-3bf7-4ccc-9549-65c29d5f7a78 | 7 | public static void dropTables() {
ResultSet result;
try {
result = MySqlConnection.sqlQuery("SELECT COUNT(*) FROM information_schema.TABLES"
+ " WHERE table_name = 'User' and table_schema = 'MuseumInfoSystem'");
result.next();
if (result.getInt(1) > 0) {
MySqlConnection.sqlUpdate("DROP TABLE Us... |
81c7d242-8899-4e56-b019-770aa2d827c8 | 1 | @SuppressWarnings("unchecked")
List<Operation> getGuessOperation(String coderId, String guesserId, String guess,
Map<String, Object> lastState) {
List<Operation> guessMove = new ArrayList<Operation>();
guessMove.add(new SetTurn(coderId));
guessMove.add(new Set(CURRENTMOVE,FEEDBACK));
guessMove.... |
82cb2242-cba1-42c1-bf16-927bd76518e9 | 1 | public void testConstructor_ObjectStringEx1() throws Throwable {
try {
new YearMonthDay("T10:20:30.040");
fail();
} catch (IllegalArgumentException ex) {
// expected
}
} |
e2375e41-dd05-4bc5-a733-e2748bcaf95d | 6 | private void verifyMetaDataAndReciever(String className, boolean sawMetadata, String humanName) {
if ((className == null || className.length() == 0) && sawMetadata)
throw new InvalidPackConfiguration(FILENAME, humanName+" metadata has been seen, but no receiver intent-filter found!");
else i... |
ba094700-d774-478b-b69d-40ca04de150f | 1 | private void disableVoteButtons(JButton confirmButton) {
voteList.removeAll();
confirmButton.setVisible(false);
Enumeration<AbstractButton> allButtons = buttonGroup.getElements();
while (allButtons.hasMoreElements()) {
allButtons.nextElement().setVisible(false);
}
... |
35923399-baeb-4b1e-83e8-49d9d7074596 | 8 | public static String getSelectedLetters(char[][] array, int x1, int y1, int x2, int y2) {
String s = "";
if(x1 == x2 && x1 >= 0 && x1 < array.length) {
for(int i=Math.min(y1, y2);i<=Math.max(y1, y2);i++) {
s = s + array[x1][i];
}
} else if(y1==y2 && y1 >= ... |
ed0fb5a1-f20e-4477-b1e7-bed7ebaa1beb | 1 | @Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + rank.value;
result = prime * result + ((suit == null) ? 0 : suit.hashCode());
return result;
} |
ffe6ed65-5382-46ca-a032-973de67e16d8 | 3 | public Clip loadAudioClip(InputStream file) {
Clip playableClip = null;
AudioInputStream inputStream;
try {
inputStream = AudioSystem.getAudioInputStream(file);
DataLine.Info info = new DataLine.Info(Clip.class, inputStream.getFormat());
playableClip = (Clip) AudioSystem.getLine(info);
playableCli... |
bcde4717-5711-42ce-86cd-fda740ed5b54 | 5 | public static void render( Graphics2D G )
{
G.setColor( background );
G.fillRect( 0 , 0 , display.xSize , display.ySize );
G.setColor( infoColor );
GraphicsWrap GW = new GraphicsWrap( G , display.xHalf , display.yHalf );
if( wrap!=null )wrap.rend(GW);
G.setColor(infoColor);
int y=20;
if( isShowF... |
15eb2b8a-ad1e-4b98-ad5b-89f173b8188d | 3 | public void engageInterlock()
{
if (modeLock == false && ModeStatus.equals(PumpMode.INTERLOCK))
{
modeLock = true;
stop = false;
stopped = false;
pumpNotice.setText(ModeStatus.toString() + " Mode - " + (stop == true ? "PCA On : Stopped" : "PCA On"));
}
} |
f97f000d-3cd8-4b2e-bc17-a3d304bccc8e | 9 | public Material dropPicker() {
int next = plugin.getSingleRandom().nextInt(10);
switch (next) {
case 1:
return plugin.getItemAPI().getHelmet();
case 2:
return plugin.getItemAPI().getChestPlate();
case 3:
return plugin.getItemAPI().getLeggings();
case 4:
return plugin.getItemAPI().getBoots();
c... |
0541679c-3b9a-4c16-969e-ff0ac149c8f5 | 2 | @Override
public boolean removeValues(int i) {
boolean retCode = false;
for(Integer iObj:list) {
if(iObj == i) {
list.remove(iObj);
retCode = true;
}
}
return retCode;
} |
6084e781-ed1b-4c17-a0bd-e22a30fee5b0 | 5 | public static void execute(Player p, String[] a) {
if (!p.isOp()) {
p.sendMessage(CTF.TAG_RED + "You don't have the permission to do this!");
return;
}
if (a.length!=2) {
p.sendMessage(CTF.TAG_BLUE + "Usage: /ctf setspawn <red/blue/exit>");
} else {
... |
626e8fb4-152f-46ea-a574-dc06b44f20d8 | 3 | public V addIfNew(long key, V value) throws Exception {
if (!Reconciler.validKey(key)) throw new Exception("Key not in range");
V old = putIfAbsent(key, value);
if((old != null) && !old.equals(value)) throw new Exception("Key collision");
return old;
} |
29be12e4-cc7e-4d7d-baa4-2b78a0795f54 | 7 | public void connect(String url, String user, String pass) throws ConnectionException {
if(url == null || url.equals("") ) throw new IllegalArgumentException("Illegal url: " + url);
if(user == null || user.equals("")) throw new IllegalArgumentException("Illegal user: " + user);
if(pass == null || pass.equals("")... |
eec070d9-7257-46e2-8fae-c7115d41e3be | 5 | public Writer write(Writer writer) throws JSONException {
try {
boolean commanate = false;
Iterator keys = this.keys();
writer.write('{');
while (keys.hasNext()) {
if (commanate) {
writer.write(',');
}
... |
477c9cf4-4c1f-4223-bae3-9aae9944f4ee | 1 | public List<String[]> getAttributes() {
List<String[]> l = new ArrayList<String[]>();
String[] s = new String[2];
if (refCatastral != null) {
s[0] = "catastro:ref";
s[1] = refCatastral;
l.add(s);
}
s = new String[2];
s[0] = "CAT2OSMSHAPEID";
s[1] = getShapeId();
l.add(s);
return l;
} |
9ad787ea-1582-4d67-9f5a-195b81d10e3b | 7 | private static boolean isValid(int[][] array, int size) {
boolean[] found = new boolean[size*size];
for (int i = 0; i < size*size; i++) {
//rows
for (int j = 0; j < size*size; j++) {
found[array[i][j] - 1] = true;
}
for (int x ... |
61674daf-bff9-4d04-8c70-99a703f001cf | 9 | public int parseSection(int off, byte qtype, int sectiontype, int rrcnt, java.net.InetSocketAddress remote_addr, MessageCallback handler)
{
boolean skip = false;
for (int idx = 0; idx != rrcnt; idx++) {
// This initial NAME field will be overwritten by parseRDATA() below in most circumstances, but since we
/... |
d2e7ca65-ccca-41b6-ae9e-a249d21c5f12 | 1 | public boolean setUsertileImageHeight(int height) {
boolean ret = true;
if (height <= 0) {
this.usertileImage_Height = UISizeInits.USERTILE_IMAGE.getHeight();
ret = false;
} else {
this.usertileImage_Height = height;
}
somethingChanged();
... |
6d19daa5-069d-4c1b-bca2-d94f557b426c | 0 | public int getFileDeletedMask() {
return JNotify.FILE_DELETED;
} |
9b2e02d2-7860-4f6c-a401-e5ea2713eaf8 | 1 | public static void main (String[] args){
Scanner in = new Scanner(System.in);
BigInteger sum = new BigInteger("0");
while(in.hasNext()){
String s = in.next();
BigInteger n = new BigInteger(s);
sum = sum.add(n);
}
System.out.println(sum.toString());
} |
ddab5f88-8be2-47f9-a1b4-b45df0312955 | 6 | public final void lifeLost() {
if (!inGameState("InGame") || inGameState("LevelDone")
|| inGameState("LifeLost") || inGameState("GameOver") ) return;
// System.err.println(
// "Warning: lifeLost() called from other state than InGame." );
//}
clearKey(key_continuegame);
removeGameState("StartLevel");
rem... |
a2f517ee-7cb8-4214-82c6-48540b287fdf | 0 | public String getDataType() {
return dataType;
} |
8ba4b5df-81be-47a1-9caa-32a6a0db2be2 | 9 | public final void method209(Frame frame, int i, int i_0_, int i_1_,
int i_2_) {
aDisplayMode158 = aGraphicsDevice157.getDisplayMode();
if (aDisplayMode158 == null)
throw new NullPointerException();
frame.setUndecorated(true);
frame.enableInputMethods(false);
method212(frame, (byte) 51);
if (0 == i_2_)... |
3863683f-3dd3-4ac1-be89-e3c4ae62f2ae | 7 | @EventHandler
public void onClick(PlayerInteractEvent event)
{
if(plugin.getConfig().getBoolean("Chest.RedstoneTrap.Enabled") == true)
{
Action action = event.getAction();
if(action == Action.RIGHT_CLICK_BLOCK)
{
Block block = event.getClickedBlock();
Material mat = block.getType();
if(mat =... |
bf83ddd9-d17b-40e9-9616-dffde8290dcc | 8 | @Override
public void visitLdcInsn(final Object cst) {
Item i = cw.newConstItem(cst);
// Label currentBlock = this.currentBlock;
if (currentBlock != null) {
if (compute == FRAMES) {
currentBlock.frame.execute(Opcodes.LDC, 0, cw, i);
} else {
... |
8d94665b-8d38-4b92-bb4d-197be7c25350 | 7 | public static Tile createTile(int id, int x, int y, World world) {
int xx = x;
int yy = y;
if (id == grassId) return new TileGrass(xx, yy, world);
if (id == waterId) return new TileWater(xx, yy, world);
if (id == treeId) return new TileTree(xx, yy, world);
if (id == stone... |
72c3f211-aaab-46af-9b47-d91d0538bc53 | 7 | public final void assert_stmt() throws RecognitionException {
try {
// Python.g:244:13: ( 'assert' test ( COMMA test )? )
// Python.g:244:15: 'assert' test ( COMMA test )?
{
match(input,71,FOLLOW_71_in_assert_stmt1810); if (state.failed) return;
pushFollow(FOLLOW_test_in_assert_stmt1812);
test();
... |
d69e2f8d-a4bc-48d1-90ab-774b85a5fc51 | 7 | private void loadTile(Tile t){
for (Item i : t.getInventory()){
if (i instanceof Weapon){
addWeapon((Weapon) i);
}
else {
addItem(i);
}
}
Character c = t.getCharacter();
if (c instanceof Player){
addPlayer((Player) c);
}
else if (c instanceof Monster){
addMonster((Monster) c);
}
... |
6c8fb9d4-5a3b-4ed4-bf09-e721bcd3915c | 2 | public void onCommand(CommandSender sender, ChunkyCommand command, String label, String[] args) {
if (!(sender instanceof Player)) {
Language.IN_GAME_ONLY.bad(sender);
return;
}
if (args.length != 1) {
Language.CMD_ADDFRIEND_HELP.bad(sender);
retu... |
1f3ceee0-7aea-4c1c-90a9-2aa6b339deef | 9 | public boolean onCommand(CommandSender sender, Command cmd,
String commandLabel, String[] args) {
Player victim;
String mod;
String reason;
int display = 0;
if (commandLabel.equalsIgnoreCase("ban")) {
if (sender.hasPermission(SeruBans.BANPERM) || sender.is... |
86232850-a959-411e-b433-d3985265dd8d | 8 | private boolean allowsAnyString(Pattern p) {
while (p instanceof RefPattern)
p = si.getBody((RefPattern)p);
if (p instanceof TextPattern)
return true;
if (!(p instanceof DataPattern))
return false;
DataPattern dp = (DataPattern)p;
if (dp.getParams().size() != 0)
return false... |
d1118d69-c7bb-4389-b3f2-da8943202e10 | 6 | void initPtga()
{
if( expression == null )
{
init();
}
if( (expression == null) || (expression.size() == 0) )
{
return;
}
Ptg p;
//if the usual case of 1 reference-type (area, ref, memfunc...) ptg:
if( expression.size() == 1 )
{
p = (Ptg) expression.get( 0 );
if( p.getIsReference() )
... |
8889ea7d-09a9-42f1-b15b-8373ff865167 | 3 | private void validateDirectory()
{
char end = directory.charAt(directory.length() - 1);
if (end != '/' && end != '\\')
directory = directory + '/';
File directoryFile = new File(directory);
if (!directoryFile.exists())
directoryFile.mkdirs();
} |
2637f508-12c4-407b-b47b-2a3eb06b488e | 3 | public void insertString(int offset, String str, AttributeSet attr)
throws BadLocationException
{
if (maxLength > 0 && getLength() + str.length() > maxLength)
{
Toolkit.getDefaultToolkit().beep();
}
else
{
try
{
Integer.parseInt(str);
super.insertString(offset, str, attr);
}
catch (... |
6db226e0-9877-4ac3-a459-bc7b18aec224 | 4 | @Override
public void mouseClicked(MouseEvent e) {
p = e.getPoint();
if(hideBtn.contains(p) && !hide){
hide = true;
}else if(hideBtn.contains(p) && hide){
hide = false;
}
} |
2084d059-299e-4eb2-92f5-0a4f23d1541f | 9 | private void writeValue(Object value) throws JSONException {
if (value instanceof Number) {
String string = JSONObject.numberToString((Number) value);
int integer = this.valuekeep.find(string);
if (integer != none) {
write(2, 2);
write(integer,... |
040c1d4c-a155-462e-9070-912d555cac96 | 6 | public boolean pickAndExecuteAnAction() {
try{
/* //new food arrived
if (mFoodArrived){
synchronized(mOrders){
for (SmilehamWaiter iWaiter : mWaiters){
iWaiter.msgNewMenu(mFoodsOut);
}
}
mFoodArrived = false;
return true;
}
*/
//Cook orders
for (Order iOrder : mOrders)... |
f407e594-6313-454a-bd53-9241fba48672 | 6 | private void produceHeightmap() {
if (details)
System.out.println("Producing overview. It can be found in: output/"+name+"/overviews.");
int dimx = MyzoGEN.DIMENSION_X * chunksX;
int dimy = MyzoGEN.DIMENSION_Y * chunksY;
NoiseMap overviewnoise = null;
try {
overviewnoise = new NoiseMap(dimx, dimy);
... |
56757e87-89e4-4739-b43f-48bcd8d1a8f5 | 8 | @Override
public void e(float sideMot, float forMot) {
if (this.passenger == null || !(this.passenger instanceof EntityHuman)) {
super.e(sideMot, forMot);
this.W = 0.5F; // Make sure the entity can walk over half slabs,
// instead of jumping
return;
}
EntityHuman human = (EntityHuman) this.passe... |
080df63e-f385-4d9d-afaa-f8cb79eb0cd8 | 6 | public static void main(String[] args) {
File f = new File("registro2.txt");
BufferedReader reader = null;
int mayor = 0, actual = 0;
String[] valor = null;
try {
reader = new BufferedReader(new InputStreamReader(
new FileInputStream(f)));
String line = reader.readLine();
while (line != null) {
... |
4aad5136-cd10-44c6-8dd1-6a8797ebf2a2 | 5 | @Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (args.length < 4) {
return false;
}
String worldName;
String zoneName = args[0];
String typeString = args[1].toUpperCase();
String matString = args... |
8aacc20f-5d15-4587-ba0f-25792545f20a | 1 | public boolean retainAll(final Collection<?> c) {
return queue.retainAll(c);
} |
efdc2dd4-f3e9-470c-9133-74726574ea97 | 2 | public void initSearch(String req) {
search = req;
try {
url = new URL(wiki+"/w/index.php?search=" + URLEncoder.encode(search, "UTF-8"));
} catch (MalformedURLException e) {
} catch (UnsupportedEncodingException e) {
}
} |
5677ee22-f818-403c-8281-45ba28c4db9e | 0 | public float getAspectRatio() {
return this.aspectRatio;
} |
049c7ae4-44c4-46c7-b516-022d5072c8a5 | 7 | static public boolean isImageMimeType(String mimeType) {
if(mimeType==null)
return false;
return(mimeType.equals("image/jpeg")
|| mimeType.equals("image/jpg")
|| mimeType.equals("image/png")
|| mimeType.equals("image/gif")
|| mime... |
21aa2940-a16f-4da0-94be-ca0a6b459a0c | 3 | public boolean puedoRetirar(double cantidad){
if(cantidad > saldo){
if(cuentaAhorro == null)
return false;
else if((cantidad-saldo) > cuentaAhorro.getSaldo() )
return false;
else
return true;
}
else
return true;
} |
fb46ac59-ff43-463b-97e1-f3c29a30916f | 7 | public int queryRows(String queryString)
{
DBConnection DBToUse=null;
int Result=0;
try
{
DBToUse=DBFetch();
try
{
final ResultSet R=DBToUse.query(queryString);
if(R==null)
Result=0;
else
while(R.next())
Result++;
}
catch(final Exception sqle)
{
if(sqle instanceo... |
7345faeb-8b91-4f38-a285-c91891d29b01 | 0 | @Test
public void testParseFile()
{
// FileParser fparser = new FileParser();
//
// assertTrue(fparser.parseFile(1)); //TXT-Datei mit Leerstring
// assertTrue(fparser.parseFile(2)); //TXT-Datei mit Inhalt
// assertTrue(fparser.parseFile(3)); //PDF-Datei mit Leerstring
// assertTrue(fparser.parseFile(4)); ... |
60cdae91-19ed-4f2d-bbc0-cffb06bb9071 | 4 | @Override
public CacheResponse get(URI uri, String rqstMethod, Map<String, List<String>> rqstHeaders) throws IOException
{
File localFile = getLocalFile(uri);
if (localFile == null)
{
// we don't want to cache this URL
return null;
}
if (!localFile.exists())
{
// the file isn't already in ... |
b38be57a-62ab-4741-b9a6-3b71f6f6c9d3 | 5 | @Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Movie)) {
return false;
}
Movie other = (Movie) object;
if ((this.id == null && other.id != null) || (this.id !... |
627716e7-0bb6-4b09-9743-b58b68f74dd1 | 7 | public KjStroke getSimplified(){
KjStroke result = new KjStroke();
KjStroke reduced = removeSamePoint();//getReducedNoise().removeSamePoint();
if (reduced.size()<=2){
for(int i=0;i<reduced.size();i++){
result.addPoint(reduced.getPoint(i));
}
} else {
result.addPoint(reduced.getPoint(0));
... |
ac81d953-407c-4588-a642-37b9124d9a7c | 0 | public List<Osoba> getWszystkieOsoby() {
return oo.getWszystkieOsoby();
} |
c648abf5-e73f-41fc-916f-c2de2aec089f | 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 fe... |
5d71868d-983b-427d-985d-adbeda9136ab | 1 | @Override
public void show() {
System.out.println(name + ", here are your search results:");
Auction[] auctionResults = as.search(input);
for(Auction auc : auctionResults){
System.out.println(auc.toString());
}
System.out.println("Enter the item id to increase the bid by $1. Otherwise, enter another sear... |
587520cd-e9a6-4979-bf55-c5c7b5a897a6 | 0 | @Override
public void startSetup(Attributes atts) {
String listName = atts.getValue(A_LIST);
// Set the Component
JComboBox component = new JComboBox();
addList(listName, component);
setComponent(component);
super.startSetup(atts);
component.addItemListener(new ComboBoxListener(component, getPreferenc... |
ad5835dc-61ea-4edb-91ca-6a371eac502d | 9 | public boolean isValidSocket(String[] s) {
try {
int p = Integer.parseInt(s[1]);
String[] ip_s = s[0].split("\\.");
int[] ip = { Integer.parseInt(ip_s[0]), Integer.parseInt(ip_s[1]),
Integer.parseInt(ip_s[2]), Integer.parseInt(ip_s[3]) };
boolean isValid = (p >= 0 && ip[0] >= 0 && ip[1] >= 0 && ip[2]... |
e0ff77ba-d5e2-4cac-916f-77f30c6b1464 | 8 | protected void testEvents() {
startTest("Event test");
//simuleer dat Jacco joined en weer weggaat
client.updateNetwork((Byte) Byte.valueOf((byte) 0x0E),NetworkMessage.JOINED);
try { Thread.sleep(3000);} catch (InterruptedException e) { } //de 3 sec delay
client.packetReceived(parseDatapacket("... |
20c6ae3b-9cd9-497f-b337-50c72ab64538 | 2 | public static boolean isFullHelm(int itemID)
{
for (int i=0; i<fullHelm.length; i++)
if (fullHelm[i] == itemID)
return true;
return false;
} |
1a586848-ffd3-4fe8-baf8-046052e2d8f1 | 5 | public static void calculatePlayCountZScore(ArrayList<Song> songs) // error exists here
{
double sum=0;
double mean;
double var;
double sd;
double zScore;
int count=0;
for(int i=0; i<songs.size(); i++)
{
if(songs.get(i).getPlayCount()>1)
sum=sum+songs.get(i).getPlayCount();
else
count++;
... |
df86421e-93e4-420c-828c-220f955d3c38 | 9 | public void target() {
GameActor t = getTargetedActor();
if(t != null && withinRadius(t)) {
PhysicsComponent tPC = (PhysicsComponent)t.getComponent("PhysicsComponent");
if(tPC != null) {
PhysicsComponent ownPC = (PhysicsComponent)getOwningActor().getComponent("Phy... |
bc14e832-ddad-4835-992b-13dcce66802c | 6 | @Override
public void run() {
if (Updater.this.url != null) {
// Obtain the results of the project's file feed
if (Updater.this.read()) {
if (Updater.this.versionCheck(Updater.this.versionName)) {
if ((Updater.this.versionLink != null)
&& (Updater.this.type != UpdateType.NO_DOWNLOAD)) {
... |
dc849b68-d4c0-4261-b4d7-762001ce5d02 | 8 | private void listagemSala() {
final Main m = new Main();
JLabel NomeSala = new JLabel("Salas:", JLabel.CENTER);
String[] v5 = new String[m.salas.size() + 1];
v5[0] = " ";
for (int i = 1; i < m.salas.size() + 1; i++) {
v5[i] = m.salas.get(i - 1).toStringSigla();
... |
d747facd-8437-4a90-bd50-f4a157788f26 | 8 | public void LoadMarkers() { // loads a marker-file and generates a new set of marker list from it
URL myurl=null;
try {
if (markerInfilename == null)
System.out.println("Markerfile == null !?\n");
//if (applet instanceof View5D)
//myurl = new URL(((View5D) applet).getDocum... |
1381049a-35ca-4069-8a51-aeb8308de62d | 1 | public final String getMD5(String s)
{
try
{
MessageDigest md5 = MessageDigest.getInstance("MD5");
md5.update(s.getBytes(), 0, s.length());
signature = new BigInteger(1, md5.digest()).toString(16);
}
catch(NoSuchAlgorithmException e)
{
... |
eee55c3d-6ce6-4b29-983c-ffc44a90c29f | 6 | public static byte[] getFormattedImageData(BufferedImage image) throws IOException
{
ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
byte format = Byte.parseByte(Configuration.getSetting("format"));
ImageIO.write(image, format == 0 ? ("PNG") : (format == 1 ? ("JPG") : ("GIF")), byteStream);
byt... |
43e62df5-f1a3-431c-9f46-31f8ca8eb77f | 0 | public void clear(){
this.filled = 0;
this.elements.clear();
} |
53e30f48-2391-4240-867f-2f0cd81368a3 | 5 | @Override
public int aziona() {
if (this.isAcceso() && detersivo && sale>0 && programma>0) {
this.programma--;
this.sale--;
int consumo = this.getConsumo(1);
if (this.programma == 0) {
this.spegni();
}
return consumo;
} else {
return 0;
}
... |
047fd0a8-c37d-4868-98e9-2e86b0e2e8b5 | 3 | public Key delete(int i)
{
if (i > pq.length - 1 || i < 1)
return null;
Key key = pq[i];
pq[i] = pq[N--];
if (less(pq[i], key))
sink(i);
else
swim(i);
return key;
} |
40523117-fbce-4249-b3bd-1321fa6dc604 | 4 | @Override
public boolean equals(Object other) {
boolean result;
if (this == other)
result = true;
else if (other == null)
result = false;
else if (other instanceof Integer)
result = (this.getId() == (Integer) other);
else if (!this.getClass().isInstance(other))
result = false;
else
result =... |
93b2634a-2ec7-4c96-915b-35dcf2f43b9c | 8 | private CellStyle createStyle(short align, boolean isBold, boolean isNumber, short isSummary) {
CellStyle style = workbook.createCellStyle();
style.setFont(isBold ? fontBold : fontNormal);
switch (isSummary) {
case 0: case 1: style.setBorderBottom(CellStyle.BORDER_THIN); break;
... |
3741c973-074f-4266-aff5-422fcb7ae694 | 3 | static public char readChar() throws java.io.IOException
{
if (inBuf > 0)
{
--inBuf;
if (++bufpos == bufsize)
bufpos = 0;
return buffer[bufpos];
}
if (++bufpos >= maxNextCharInd)
FillBuff();
char c = buffer[bufpos];
UpdateLineColumn(c);
return c;
} |
46539bd1-428f-4072-bd5e-6eb5787d3b66 | 9 | public boolean skipPast(String to) throws JSONException {
boolean b;
char c;
int i;
int j;
int offset = 0;
int length = to.length();
char[] circle = new char[length];
/*
* First fill the circle buffer with as many characters as are in the
... |
0cd3eef5-75f9-4427-a036-03d00b931934 | 8 | private void buttonEditActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonEditActionPerformed
String agcoopCompany = "maininterface.ViewCompany";
String agcoopMember = "maininterface.ViewMember";
String agcoopSupplier = "maininterface.ViewSupplier";
String agcoopNo... |
3286b6a0-f580-4839-b6cb-5a507f9c707e | 4 | public static void main(String[] args) {
Scanner s = new Scanner(System.in);
String sentence1, sentence2;
char letter;
int count = 0;
System.out.println("Please enter a sentence below:");
sentence1 = s.nextLine();
System.out.println("Now pl... |
5375a286-a999-4903-886f-0966e4dad376 | 9 | public void onValidate() {
if (model.isGamePaused()) {
menuHandler.validate();
if (model.getPrioritaryDisplayedMenu() == null) {
model.setGamePaused(false);
}
}
else if (!moveHandler.isMoving()) {
if (model.getPlayer().isInFrontOfA... |
ebf3bea4-385a-4a69-875b-e73bdb8e66b1 | 3 | @Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final SpEmployee other = (SpEmployee) obj;
if (!Objects.equals(this.szEmployeeId, other.szEmployeeId)) {
... |
1ff5e5c9-3737-418e-ab57-be001c4ce4bf | 5 | String alignmentString (int align) {
switch (align) {
case SWT.LEFT: return "LEFT";
case SWT.RIGHT: return "RIGHT";
case SWT.TOP: return "TOP";
case SWT.BOTTOM: return "BOTTOM";
case SWT.CENTER: return "CENTER";
}
return "DEFAULT";
} |
e48c6d94-b4ba-4e44-b401-d8895f3b9ee2 | 2 | public void nextFrame(){
this.frameNumber++;
if(this.frameNumber >= frames.size()){
if(this.looping == true){
this.frameNumber = 0;
}else{
this.frameNumber = this.frames.size()-1;
this.isDone = true;
}
}
} |
ef2d8eb7-aa52-4823-9def-a5c26584cdd5 | 2 | private void initGameForm()
{
this.getContentPane().removeAll();
// Creating and adding panels
topPanel = new JPanel();
middlePanel = new JPanel();
bottomPanel = new JPanel();
this.add(topPanel); this.add(middlePanel); this.add(bottomPanel);
// Adding Score, ... |
be1b682a-a811-498b-9422-525512ea0371 | 1 | public void transferDeckContentsTo(Deck d)
{
for(card c : deck)
{
d.addCard(0, c);
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.