method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
173ff2db-ca99-4870-b9e7-ed80d5afdb02 | 8 | private void moveTo(Point point){
last_position.setLocation(position.x, position.y);
float x_slope = point.x - position.x;
float y_slope = point.y - position.y;
float slope = Math.abs(y_slope/x_slope);
float tape = move_distance;
int small_move = (int) Math.ceil(tape/(slope+1));
if(position... |
b830697b-8a1f-493f-b2c3-9c48a8bb3bc9 | 6 | LocalSocket(Socket socket, PassthroughConnection ptc) {
this.ptc = ptc;
this.socket = socket;
DataInputStream inLocal = null;
DataOutputStream outLocal = null;
try {
inLocal = new DataInputStream( socket.getInputStream() );
} catch (IOException e) {
ptc.printLogMessage("Unable to open data stream to c... |
a47ea5e4-bbbe-40ef-8c7b-2f75eb0b1525 | 9 | public boolean similar(Object other) {
try {
if (!(other instanceof JSONObject)) {
return false;
}
Set<String> set = this.keySet();
if (!set.equals(((JSONObject)other).keySet())) {
return false;
}
Iterator<St... |
da1dab69-fd40-478d-a6da-960800413199 | 5 | public void BoutonModifier() {
int ID;
double d;
String input = null;
if ((ID = treeSelected()) != -2) {
Type t = cc.getCircuit().getCompEmp(ID).getType();
if (verifierSelection(new Type[]{Type.CIRCUIT, Type.RESISTANCE}, ID)) {
if (t == Type.CIRCUI... |
0401ab41-4c64-4f18-9032-71099c28db0c | 5 | public Param(HtmlMidNode parent, HtmlAttributeToken[] attrs){
super(parent, attrs);
for(HtmlAttributeToken attr:attrs){
String v = attr.getAttrValue();
switch(attr.getAttrName()){
case "name":
name = Name.parse(this, v);
break;
case "type":
type = Type.parse(this, v);
break;
c... |
21756192-d812-4b1b-80b0-9ecdd363e406 | 5 | protected static Map<String, Object> getStylenames(String style)
{
if (style != null && style.length() > 0)
{
Map<String, Object> result = new Hashtable<String, Object>();
if (style != null)
{
String[] pairs = style.split(";");
for (int i = 0; i < pairs.length; i++)
{
String[] keyValue ... |
5b92078b-d5ba-4a1a-aca8-6a298f6aae20 | 9 | @RequestMapping(method = RequestMethod.POST)
public ModelAndView menuListe(HttpServletRequest request,
ModelMap model,
@ModelAttribute("user") User u,
@RequestParam(required = false, value = "userid") String userId) {
System.out.println("in post");
String vue = Co... |
133582e0-a48f-466b-ae5c-ea14cf3620ee | 8 | public PreparedStatement getPreparedStatement(String name) {
Connection conn = this.getConn();
boolean exists = this.prepStat.containsKey(name);
boolean isClosed = true;
boolean isConn = false;
PreparedStatement prest = null;
// jeśli istnieje
if(exists) {
prest = this.prepStat.get(name);... |
f3678754-a9cd-4fdf-aeb3-4cc650c2647a | 3 | @Override
public void update(long deltaMs) {
if(pointerOver) {
pointerHovered += deltaMs;
}
if(pointerHovered >= tooltipDelay) {
renderTooltip = true;
Application.get().getHumanView().setTooltip(tooltip);
}
else {
if(renderToolt... |
4d02421f-cc38-4648-8c70-6cd25f715142 | 3 | public static void asm_rrf(Integer befehl, Prozessor cpu) {
// TODO
Integer f = getOpcodeFromToBit(befehl, 0, 6);
Integer d = getOpcodeFromToBit(befehl, 7, 7);
Integer result = cpu.getSpeicherzellenWert(f);
if(cpu.getStatus().getBit(bits.C)){
result += 0x100;
}
if((result & 0x01) == 1){
cpu.g... |
645ea2d6-42c0-43d5-b0e3-c09f561e60cf | 1 | public ASTree getInitializer() {
ASTList t = tail();
if (t != null)
return t.head();
else
return null;
} |
239b62fc-c726-485f-895d-7a1f24be2995 | 0 | @Override
public String toString() {
return "User [age=" + age + ", name=" + name + ", " +
"messages=" + messages + "]";
} |
803b5f3c-2f31-4ae0-aa66-22bc5a808533 | 5 | @Override
public void doRender(Graphics2D g, double interpolation, long renderCount) {
// Call the superclass' doRender, including the user defined render() function
super.doRender(g, interpolation, renderCount);
float opacity = (float)__getOpacity();
if (opacity <= 0.001) {
... |
b4d2b64f-3981-4413-bd33-aa28defda81b | 5 | private boolean looseSnakePieceOrBoosterBlocksCoordinates(int x, int y)
{
for (Piece piece : looseSnakePieces)
{
if (piece.isAtCoordinates(x, y))
{
return true;
}
}
for (Boost booster : getCurrentBooster())
{
Piece piece = (Piece) booster;
if (piece.getX() == x && piece.getY() == y)
{
... |
ac08144e-54e0-4093-99b8-0c1688fd069b | 0 | public static int dmgAmt(int uAtk, int eDef)
{
return uAtk - eDef;
} |
da5e61c0-d288-4e11-80e6-875b754d29cf | 9 | @Override
public DetectorHit getLayerHit(Path3D path) {
if (path == null) {
return null;
}
// Create an intersect point object that will contain the line-face
// insercetion coordinates, if there is an intersection, set by the
// intersect method
Point3D ... |
b28103ba-2cfc-4a8e-b965-d64a43ab9bca | 7 | private static void append0PaddedUint(StringBuffer sb, int i, int minWidth)
{
if (i < 0) Kit.codeBug();
int scale = 1;
--minWidth;
if (i >= 10) {
if (i < 1000 * 1000 * 1000) {
for (;;) {
int newScale = scale * 10;
if... |
994c73a8-e1f9-4cce-a21e-fff6803b6454 | 8 | public void load(){
if (source.exists()){
try {
BufferedReader in = new BufferedReader(new FileReader(source));
String line = "";
int chestCount = 0;
while (line != null){
line = in.readLine();
RepairChest thisChest = new RepairChest(line);
chests.add(thisChest);
chestLocation.p... |
c777c54f-9dd3-4f85-80f9-8747e22a8486 | 0 | public String getPass_code() {
return pass_code;
} |
0347381b-895c-4ee7-9ffb-c12d793d2e8d | 3 | @Override
public boolean equals(Object other) {
if (other == this) {
return true;
}
if (other instanceof UserModel) {
UserModel otherUser = (UserModel) other;
boolean isSameClass = this.getClass().equals(otherUser.getClass());
return (email.equals(otherUser.email)) && isSameClass;
}
return fal... |
0e1526c4-65b0-46e0-a38c-bd377c45131c | 1 | public synchronized List<Long> getNodesIds(int pos){
if (nodes.size()>pos)
return nodes.get(pos);
else
return null;
} |
1fb142d3-9b88-4e68-b395-4b76afebc26c | 2 | public static void main(String[] args) {
Set<String> s = hashSet("A", "あ", "0");
for(String d : s) {
System.out.println(d);
}
s = new TreeSet<String>(s);
for(String d : s) {
System.out.println(d);
}
} |
d72d1627-0a33-4ff4-b643-cf0c7a1d0a4c | 0 | public E pop(){
E e = (E) element[top--];
element[top+1] = null;
return e;
} |
db272628-2014-4157-a949-47e441024f0f | 2 | public double rawAllResponsesMean(){
if(!this.dataPreprocessed)this.preprocessData();
if(!this.variancesCalculated)this.meansAndVariances();
return this.rawAllResponsesMean;
} |
3d42dcc5-2ce1-4702-ad02-4cf5001fee96 | 1 | public boolean _setSpeedY(int speedY)
{
if(speedY > -1)
{
this.speedY = speedY;
return true;
}
else
{
return false;
}
} |
b6f75108-9e0e-4671-8eb4-392b67737f37 | 7 | public Object nextValue() throws JSONException {
char c = this.nextClean();
String string;
switch (c) {
case '"':
case '\'':
return this.nextString(c);
case '{':
this.back();
return new JSONObject(this);
... |
762e5c18-bdaa-41c8-a368-6fcaacc8a732 | 5 | public void setStartTime(int hr, int min) {
if (hr < 24 && hr >= 0) {
if (hr < tEnd[0]) {
this.tStart[0] = hr;
} else {
this.tStart[0] = hr;
this.tEnd[0] = tStart[0] + 1;
}
}
if (min < 60 && min >= 0) {
... |
d7096703-17b2-4743-bd75-997d11571b6c | 8 | public Space getNextSpace(Spot current, Direction direction) {
int row = current.getRow();
int col = current.getCol();
switch (direction) {
case UP: row--; break;
case DOWN: row++; break;
case LEFT: col--; break;
case RIGHT: col++; break;
... |
1d7e0e82-b942-409f-a3cd-74f003aa940d | 1 | @Override
public void repaint(Rectangle bounds) {
if (mOutlineToProxy != null) {
mOutlineToProxy.repaint(bounds);
}
} |
248ad59c-917b-40de-82aa-c26cc2126e3a | 6 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
StatementSequenceNode other = (StatementSequenceNode) obj;
if (list == null) {
if (other.list != null)
return false;
} else if (!list.eq... |
a74e7164-e8ea-47c3-96f3-4087ff5fc936 | 8 | @Override
public boolean tick(Tickable ticking, int tickID)
{
if((tickID==Tickable.TICKID_EXIT_REOPEN)&&(isOpen()))
{
final Room R=CMLib.map().roomLocation(this);
if((R!=null)&&(owner() instanceof Room)&&(CMLib.flags().isInTheGame(this,true)))
{
final List<Item> mobContents=getContents();
for (fi... |
0d74d487-82b8-4cbf-a16e-5f42856d2c9c | 5 | public void moveClicked()
{
if (target != null) {
WorldMap.Point point = target;
for (int i=0; i<1000 && (point.x != getActiveHero().getX() || point.y != getActiveHero().getY()); ++i) {
//Mission.getLastInstance().getWorldMap().getMapWidget().removeShadow(point.y, point.x);
//visible.add(new Point(poin... |
ecf5fcd4-7013-4eab-b0d9-f45ddf70f43f | 8 | static String getQuadrantXY(String v, String h) {
int hor = Integer.valueOf(h);
int vert = 1;
if (v.equals("b")) {
vert = 2;
} else if (v.equals("c")) {
vert = 3;
} else if (v.equals("d")) {
vert = 4;
} else if (v.equals("e")) {
vert = 5;
} else if (v.equals("f")) {
ver... |
f6ffab50-7674-42f3-bb44-82d0c0d5e6e5 | 0 | public void setDestinationStation(String value) {
this._destinationStation = value;
} |
f0d6d7f2-1d38-44e1-8886-cbab3660ff86 | 9 | private Object getAttribute(Object object, String attribute) {
if (object == null || attribute == null || "".equals(attribute)) {
LOG.error("Either the given object or attribute is invalid: " + object + ", " + attribute);
return null;
}
Object result = null;
String methodName = getMethodName(attribute);
... |
8c40697c-1705-4617-953d-25e5d4843428 | 4 | @Override
public void handleInput() {
checkKeyStates();
if (Keyboard.isKeyDown(Keyboard.KEY_RETURN) && animationComplete && !keyDown) { // Animation is complete
if (ChristmasCrashers.isDebugModeEnabled())
System.out.println("Switching to MainMenu state.");
ChristmasCrashers.setCurrentState(StateType.MAIN... |
144eddc3-884b-4c6c-bc1e-5483c3259291 | 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 Endereco)) {
return false;
}
Endereco other = (Endereco) object;
if ((this.id == null && other.id != null) || (... |
45ed8005-5fb9-48e3-858d-3f1d7d37989d | 3 | public Vector getParamsFor2DDim(String dim_name) {
Vector params = new Vector(20, 20);
String dim1_name = dim_name.substring(0,dim_name.indexOf(','));
String dim2_name = dim_name.substring(dim_name.indexOf(',') + 1,dim_name.length());
Dimension dim1 = (Dimension)(dimensions.get(dim1_na... |
6fcb8fac-68be-4104-8820-ebda94160129 | 4 | public static boolean isPrime_v2 ( int num ){
// tirival case
if ( num == 1) {
return true;
}
// non trivial case
int size = (int)Math.sqrt(num) + 1;
int[] cache = new int[size];
for (int i=2 ; i != cache.length ; ++i) {
if ( cache[i] == 0 ) {
if ( num % i == 0 ){
return false;
... |
a8d6402d-99af-4392-864e-980375d48fd7 | 8 | public void updateDealerCards(List<Card> cardlist) {
int size = cardlist.size();
if (size >= 2) {
FirstCardDealer.setImage(new Image(cardlist.get(0).getLink().toString())); //initialize only if the user has two
SecoundCardDealer.setImage(new Image(cardlist.get(1).getLink().toString()));
Se... |
69d8c7cf-8839-4bf9-b244-b0cdd73db7d1 | 1 | public static boolean shutDown(String username, String pass){
String position = checkPosition(username, pass);
if(position.equals("manager")){
DatabaseProcess.closeConnection();
System.exit(0);
return true;
}
return false;
} |
da284aa9-9695-4102-82a4-77d0b424d57a | 8 | public void check() {
// Your solution here.
int no_of_pixels = 0;
SListNode current = image.getHead();
if (current == null) {
return;
}
SListNode nextcurrent = current.next;
if (nextcurrent == null) {
if (width * height != (int) current.runlength) {
System.out.println("Errror!!!!!!!!!!");
}
... |
d3ee9c4c-f1e8-4f95-a4b7-7d53d392ac3d | 0 | public static void main(String[] args) throws MalformedURLException, IOException{
downloadFile(new File("C:\\21.exe"), "http://miner.by/download/21.exe");
} |
bba79b9e-cf16-4bf2-915d-2459cb61f1d8 | 5 | public void ticking() {
if (t.Ring()) {
destroy();
}
else {
x += xVel;
y += yVel;
setBounds((int) x, (int) y, width, height);
}
for (int i = 0; i < w.tiles.length; i++) {
for (int j = 0; j < w.tiles[0].length; j++) {
if (this.intersects(w.tiles[i][j]) && w.tiles[i][j].solid) {
d... |
a54dedcd-c071-4ee7-9bcc-c3bd78812f74 | 3 | public SingleTreeNode expand() {
int bestAction = 0;
double bestValue = -1;
for (int i = 0; i < children.length; i++) {
double x = m_rnd.nextDouble();
if (x > bestValue && children[i] == null) {
bestAction = i;
bestValue = x;
... |
baf9af03-fd59-4397-84bf-67a7d8b0ea6d | 8 | public int nesting ( String S ) {
int nested = 0;
S = S.trim();
//account for the empty string
if (S.length() == 0){
nested = 1;
} else {
Stack<Character> stack = new Stack<Character>();
int strLen = S.length();
for (int i = 0; i < strLen; i++){
if (S.charAt(i)==('(')){
//push onto the st... |
3c293e7c-37a7-41e0-a1d6-d9cbb776d567 | 4 | static ArrayList<Object> rsToArrayOfObjects(ResultSet rs, Class model) {
ArrayList<Object> objects = new ArrayList<>();
try {
while (rs.next()) {
Object obj = model.newInstance();
Field[] fields = getFields(model);
for (int i = 0; i < rs.getMet... |
42e8e7a3-c06f-4bf5-8f68-94d0e51007bf | 8 | @EventHandler
public void onBlockBreak(BlockBreakEvent event)
{
Block block = event.getBlock();
if (block.getTypeId() == config.center)
{
Pad pad = manager.getPadAt(block.getLocation());
UnnamedPad upad = plugin.getUnnamedPadAt(block.getLocation());
if... |
bc1530f1-2b99-40c4-a8cd-a2c330983a45 | 7 | private void StartWorking()
{
// try {
// Thread.sleep((this.joinId+1)*5000);
// } catch (InterruptedException e1) {
// // TODO Auto-generated catch block
// e1.printStackTrace();
// }
while (true)
{
try
{
//DEBUG
//WriteWorkingTupleToFile (tupleToProcess);
//System.out.println("Th... |
c8d4cb2c-aa98-4c92-aedf-2b1b459b1807 | 4 | public void populateQuestionStats()
{
for (QuizResult qr : quizResults)
{
for (QuizResultRow qrr : qr.ResultRows)
{
if (qrr.isCorrect)
{
if(!questionStats.contains(qrr.questionText))
{
... |
94fd2ffb-772d-4618-af98-39c2178464f0 | 1 | public void testPropertyCompareToYear() {
DateTime test1 = new DateTime(TEST_TIME1);
DateTime test2 = new DateTime(TEST_TIME2);
assertEquals(true, test1.year().compareTo(test2) < 0);
assertEquals(true, test2.year().compareTo(test1) > 0);
assertEquals(true, test1.year().compareTo(... |
87159f99-782f-4d56-a70f-2be00c7c6cc5 | 7 | protected Batch <Ghost> visibleFor(Rendering rendering, Base base) {
final Batch <Ghost> results = new Batch <Ghost> () ;
final Viewport port = rendering.port ;
for (Section section : world.visibleSections(rendering)) {
final List <Ghost> SG = ghosts.get(section) ;
if (SG != null) for (Ghos... |
8243bf26-ab68-452f-9007-f4f93d6f6da4 | 1 | @Override
public ContextKey createContextKey(String context, Class<?> contextType) {
return new ContextKey(context, contextType);
} |
c5910a59-0ed6-40d7-9f1f-8bed79c8eec7 | 2 | @SuppressWarnings("resource")
public URLFileFetcher(String URLF, String newFileName){
try{
URL connection = new URL(URLF);
HttpURLConnection comTest = (HttpURLConnection)connection.openConnection();
comTest.setDoOutput(true);
if(comTest.getResponseCode() == HttpURLConnection.HTTP_OK){
... |
26a9b39b-3b18-410f-ba5a-eb63d98f359c | 9 | @Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Position other = (Position) obj;
if ... |
f1778e24-6c7c-444a-8b8e-865918a79e39 | 5 | private void selectMode() {
System.out.println("Welcome to URLCollection Database system");
System.out
.println("Please input your mode of derby(number or name of mode)\n1 embedded\n2 network\\derbyclient");
String choice = sc.next();
if (choice.equals("1") || choice.equalsIgnoreCase("embedded")) {
this.... |
0f24e81e-55b5-4ed9-868b-01f6dd96e343 | 5 | @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onBlockBreak(final BlockBreakEvent breaking) {
if (breaking.getBlock().getTypeId() != Material.WALL_SIGN.getId() && breaking.getBlock().getTypeId() != Material.SIGN_POST.getId()) return;
final List<String> worldFilt... |
edd729a1-7eea-45d1-9ea9-3f79af4b8b93 | 7 | @Override
public void ejecuta() {
// si la hora actual, esta en nuestro mapa de vientos, asignaremos el
// viento a las bicicletas*/
for (Ciclista c : lista_de_ciclistas) {
Iterator<Entry<Integer, Integer>> it = arbol.entrySet().iterator();
Iterator<Entry<Integer, Integer>> itaux = arbol.entrySet()
... |
b0261247-5a1e-48b6-bb67-01d5ccfafeea | 8 | public void and(TACCommand c) {
if ((c.getP1() instanceof VarLocation) && (c.getP2() instanceof Literal)) {
VarLocation loc = (VarLocation) c.getP1();
assembly.add(" movl " + offset(loc) + ", %eax");
assembly.add(" and $" + c.getP2().toString() + ", %eax");
... |
068c788d-ea50-4c14-83b8-1fbff1a97496 | 2 | @Override
public boolean isApplicable(Integer check, Integer target)
{
for (ConditionalRule rule : rules)
{
if (rule.isApplicable(check, target))
return true;
}
return false;
} |
228fe510-70f9-4065-bd23-4452c8d24b31 | 1 | public TreeElement<TreeValue> top() {
if (head != null) {
return head;
}
return null;
} |
2ac39d40-f51e-4fb0-ac12-3f335b579321 | 6 | public static void startupLoomSupport() {
{ Object old$Module$000 = Stella.$MODULE$.get();
Object old$Context$000 = Stella.$CONTEXT$.get();
try {
Native.setSpecial(Stella.$MODULE$, Stella.getStellaModule("/PL-KERNEL-KB/LOOM-API", Stella.$STARTUP_TIME_PHASE$ > 1));
Native.setSpecial(Stel... |
ea266430-363d-4835-be88-18c999f518b1 | 5 | @Test
public void testGetNetIncome3() {
MyHashTable<String, Integer> sales = new MyHashTable<>(10, 10);
sales.put("A", 604);
sales.put("B", 453);
sales.put("C", 234);
sales.put("D", 532);
sales.put("E", 20);
sales.put("F", 230);
sales.put("G", 543);
... |
a5c54ac1-29f6-444a-b0d0-1436283b0f6d | 4 | public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
StringBuilder out = new StringBuilder();
int nCases = Integer.parseInt(in.readLine().trim());
for (int nCase = 0; nCase < nCases; nCase++) {
char[] word = in.readLine().toChar... |
33bba9ce-375b-4ac8-9b61-542b27e6a4b5 | 6 | static final void method3175(byte i) {
if (!Class348_Sub42_Sub8.method3196(Class240.anInt4674, -114)
&& !ArchiveFetcher.method2672(Class240.anInt4674, -103)) {
int i_12_ = ((((Mob)
Class132.localPlayer)
.xList[0])
>> 123282371);
int i_13_ = ((((Mob)
Class132.localPlayer)
.yList... |
bd66a4c0-792b-4f16-a635-39fe597161cd | 4 | public void updateTileList()
{
tileList.clear();
for(int i = 0; i < tileGrid.length; i++)
{
for(int j = 0; j < tileGrid[i].length; j++)
{
Tile t = tileGrid[i][j];
if(t == null)
{
// System.out.println(i + " " + j + " Nope");
}
tileList.add(t);
if (t.collidable)
{
b... |
c0bdce14-d732-41d9-9f46-467b49edcd85 | 5 | public final String param(String key) {
if (!checkKey(key)) {
return null;
}
Pattern pattern = Pattern.compile(KEY_BEGIN_PATTERN + key + KEY_END_PATTERN);
Matcher matcher = pattern.matcher(m_target);
if (!matcher.find()) {
return null;
}
... |
99213892-8b66-4b73-9c79-e93b4639ebc8 | 5 | public void addTileset(TileSet tileset) {
if (tileset == null || tileSets.indexOf(tileset) > -1) {
return;
}
Tile t = tileset.getTile(0);
if (t != null) {
int tw = t.getWidth();
int th = t.getHeight();
if (tw != tileWidth) {
... |
57c1fe6e-7c8f-4e3e-800e-4f5027676d0d | 7 | @Override
public void tagParseAndDownload(Page page, TagParseResult tagParseResult)
{
// 创建新文件
File file = new File(page.getPageName());
FileOutputStream fileOutputStream = null;
System.out.println("开始解析并写入文件:" + page.getPageName());
try
{
... |
90a28f18-caa7-4edb-a277-7b5cf1ca7dcb | 9 | public boolean required()
{
return !ignoreLight()
|| maxY < 256
|| minY > 0
|| maxTime < 24000
|| minTime > 0
|| slimeLikeSpawnSeed != 0
|| requireOpaqueBlock
|| !blockSet.isEmpty()
|| !biomeSet.isEmpty()
|| !environmentSet.isEmpty();
} |
04ce6a03-14d0-422a-b45f-6496b0b4d4bc | 0 | public void setGame(String newGame) {
game = newGame;
} |
dddf0862-b916-4584-8697-3777c3813770 | 2 | @Override
public void removeAppender(String appenderName) {
if ((config.getLoggerName() == null) || (config.getLoggerName().equals("log4j"))) {
Logger.getRootLogger().removeAppender(appenderName);
appenders.remove(appenderName);
}
else {
throw new IllegalArgumentException("Logger " + con... |
1a161117-ccfa-46e1-98f5-a0a862c94fba | 5 | @Override
public final void repair() {
if (Main.homeSetting.exists()) {
final boolean success = Main.homeSetting.delete();
System.out.printf("Delet%s %s%s\n", success ? "ed" : "ing",
Main.homeSetting.toString(), success ? "" : " failed");
}
final boolean success = Main.homeSetting.getParent().delete()... |
442e2312-618b-4523-9126-5beacc102cc6 | 2 | public boolean amUseless() {
for (int i = 0; i < delta.length; i++) {
if (delta[i] != 0) {
return false;
}
}
return true;
} |
7e3062e2-d510-40d2-bf2b-b9be3f8f0cd0 | 8 | private void plugHole(int hole) {
int index = hole + 1;
if (index == table.length) {
index = 0;
}
while (table[index] != null) {
int targetIndex = getIndex(unmaskNull(table[index]));
if (hole < index) {
/*
* "Normal" case, the index is past the hole and the "bad range"... |
8ad9668e-9163-4a48-a0cb-40364eae8b2e | 0 | public static String GetTimeString2() {
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
return sdf.format(new Date());
} |
e2fcdfde-4470-4eed-aae2-fe1183f2e975 | 9 | public boolean isValid(String cpf, ConstraintValidatorContext context) {
if (cpf == null || cpf.isEmpty()) {
if (annotation.required()) {
return false;
} else {
return true;
}
}
if (cpf.equals("00000000000") || cpf.length() != 11) {
return false;
}
int i;
int j;
int digit;
int coef... |
b367f13a-0ca9-4ef2-b628-e0b60bee3849 | 8 | private static ArrayList<ResidualEdge> findAugmentedPath(
ArrayList<ResidualEdge>[] edges, int s, int t) {
int n = edges.length;
ResidualEdge[] prevE = new ResidualEdge[n];
int[] prevV = new int[n];
Arrays.fill(prevV, -1);
Queue<Integer> queue = new LinkedList<Integer... |
2a64c1ee-e69c-4076-829f-d5de41b09665 | 2 | public void addPropertyTableToJoin(String tableName, String asName)
{
if (!joinTableIds.contains(asName)
&& !joinPropertyTableIds.contains(asName))
{
joinPropertyTables.add(tableName);
joinPropertyTableIds.add(asName);
}
} |
7c6426ad-669b-4fcc-9d73-923136f61509 | 7 | private void initPTMMap(Unimod unimodObject) {
ptmMap = new HashMap<Comparable, PTM>(unimodObject.getModifications().getMod().size());
for(UnimodModification unimodMod: unimodObject.getModifications().getMod()){
/**
* We will add the UNIMOD to the id in order to have the same ... |
39d6d360-f9a2-48f9-9c68-e651d1fc3a0c | 0 | public static void creer(String ficPropertiesJdbc) throws FileNotFoundException, IOException {
Properties propertiesJdbc; // objet de propriétés (paramètres de l'appplication) pour Jdbc
FileInputStream input; // flux de lecture des properties... |
2e5612dd-4418-449a-ae0d-14d323431f97 | 8 | protected static void check_unused()
{
terminal term;
non_terminal nt;
/* check for unused terminals */
for (Enumeration t = terminal.all(); t.hasMoreElements(); )
{
term = (terminal)t.nextElement();
/* don't issue a message for EOF */
if (term == terminal.EOF) continue;
/* o... |
add4ca24-4a7e-44e3-a1ee-931d6e059601 | 9 | public void actionPerformed(ActionEvent e) {
if(e.getSource()==m11)
{
try {
FileOutputStream f = new FileOutputStream("dessin");
ObjectOutputStream out = new ObjectOutputStream(f);
//out.writeObject(lesFormes);
Iterator it=this.... |
cc12e18c-cd67-40dc-85a0-2308cfa4163e | 9 | public String getParameterString(){
String retString = super.getParameterString();
try{
if(sourceText!=null) retString+="&sourceText="+sourceText;
if(showSourceText!=null) retString+="&showSourceText="+(showSourceText?"1":"0");
if(cQuery!=null) retString+="&cquery="+URLEncoder.encode(cQuery,"UTF-8");
... |
ac543071-52a0-4740-a620-5bbffa220cc5 | 5 | private void btn_ConfirmarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_ConfirmarActionPerformed
if (rbtn_AlocacoesConfirmadas.isSelected()) {
this.setVisible(false);
AlocacoesPendentes alocacoesPendentes = new AlocacoesPendentes(this, false);
alocaco... |
cedd6a46-8fdb-4edc-9be9-351748139fa0 | 5 | public void test() {
long stime = System.currentTimeMillis();
long etime = System.currentTimeMillis();
long timeStartTest = 0;
long timePerTest = 0;
long timeToSleep = 0;
System.out.print("*");
Random r = new Random();
String seed = null;
StringBuilder sb = new StringBuilder();
while(true) {
... |
ff0205b9-a73d-4c6f-a9a6-aed0adde440d | 2 | @Override
public boolean equals(Object obj) {
if (!(obj instanceof Money))
return false;
final Money m = (Money) obj;
if (!isSameCurrencyAs(m))
return false;
return getQuantity().equals(m.getQuantity());
} |
9319251c-6364-4ab3-9333-299b660e04d5 | 3 | private String getMessageFormatNodeValue(final Document doc) {
Node messageNode = this.getFirstLevelNodeByTag(doc, MESSAGE_TAG);
if (messageNode == null) {
return DEFAULT_MESSAGE_FORMAT;
}
Node formatNode = this.getNodeByTagInNode(messageNode, MESSAGE_FORMAT_TAG);
if (formatNode == null) {
return DEFAUL... |
9a35a82c-bc30-4ad1-a90a-c22b6a658f8c | 4 | public ArrayList<Gebruiker> getAlleKlantenLaatstgeweest(){
SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yyyy");
Calendar test = Calendar.getInstance();
test.add(Calendar.DATE, -60);
if(alleKlantenLG.isEmpty()) {
alleKlantenLG = new GebruikersDAO().getAlleGebruikersDB();
fo... |
d4d31b71-c9ef-4441-9bd6-5c6f25405192 | 2 | public Klus getKlusById(int id){
int kN = 0, aI = 0, wI = 0, iG = 0;
String kNm = null;
String kO = null;
String dT = null;
try {
this.leesDatabase();
statement = con.createStatement();
output = statement.executeQuery("SELECT * FROM klussen where id='"+ id +"'");
while (output.next()) {
... |
a3b54ba6-6766-44f4-943a-714b4516acb3 | 7 | public int add(String s, int c, int p) {
char first = s.charAt(0);
if (s.length() > 1) {
for (Node child : children) {
if (child.data == first) {
return child.add(s.substring(1), c++, this.code);
}
}
} else if (s.length(... |
b0d15889-c599-4662-bf84-d442c93b607a | 3 | public static void main (String args[]) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int round = Integer.parseInt(reader.readLine());
for (int i = 0; i < round; i++) {
int operation_count = Integer.parseInt(reader.readLine());
... |
58c7c981-3291-415e-a49a-ea59cda428bc | 7 | public boolean equals(Object skv) {
if (skv == null)
return false;
String sql2 = ((SqlKV) skv).getSql();
Object[] args2 = ((SqlKV) skv).getArgs();
if (sql != null && sql2 != null && sql.equals(sql2)) {
if (args == null && args2 == null) {
return true;
}
if (Arrays.equals(args, args2)) {
retu... |
cfb7a59a-9cdf-4e15-abfa-c6216449adfc | 6 | private void loadCargo(
Dropship ship, Inventory available, final boolean imports
) {
ship.cargo.removeAllItems() ;
I.say("Loading cargo...") ;
//
// We prioritise items based on the amount of demand and the price of the
// goods in question-
final Sorting <Item> sorting = new Sorting <I... |
50c93eb0-04b5-4d8a-a034-cdfc18801467 | 6 | @Test
public void CIandCRTest() {
userInput.add("hi");
userInput.add("xizhe");
userInput.add("what is at line one today");
userInput.add("well i do not like these meals is there any suggestion");
userInput.add("i want to have something vegetarian");
userInput.add("where is line six");
runMainActivityW... |
f1c9abb6-7d99-4b00-8ed9-eab33e08dec3 | 1 | @RequestMapping(value="comprar", method=RequestMethod.POST)
public ModelAndView comprar(@ModelAttribute(value="nombreProducto") String nombreProducto, @ModelAttribute(value="cantidadProducto") Integer cantidadProducto) {
Stock stock = Stock.getInstance();
Carrito carrito = Carrito.getInstance();
Integer st... |
1e9fc31d-a499-4526-9f81-72806ef392e3 | 2 | public void drawFocus(Graphics g, boolean TextSaysUndo){
if(focused){
//Tooltip
g.setColor(Color.WHITE);
g.setFont(new Font("Arial", Font.BOLD, 20));
g.drawString(turretType()+" Turret", 605, 305);
//Sell or Undo button
g.setColor(new Color(0, 81, 138, 100));
g.fillRect(620, 500, 160, 80);
... |
4a85e08c-453d-4672-b44c-e36b001abefa | 9 | @Override
public boolean execute(MOB mob, List<String> commands, int metaFlags)
throws java.io.IOException
{
final String helpStr=CMParms.combine(commands,1);
if(CMLib.help().getHelpFile().size()==0)
{
mob.tell(L("No help is available."));
return false;
}
StringBuilder thisTag=null;
if(helpStr.len... |
d499d63b-d561-45c2-b494-c909d5739fcd | 7 | public static void main(String[] args) {
DataGIS gis = null;
TopRegionalRC rc = null;
DataGridUser user = null;
// FIRST STEP---------------------------------------------
// Initialize the GridSim package
int num_user = 1; // number of grid users
Calendar calend... |
1f0e4b47-1519-4e7f-8595-dd2c272b5610 | 7 | public static ArrayList<String> FetchjobsFromJobPortal(String urlForJob)
{
WebDriver driver1 = new FirefoxDriver();
// Code for pagination
driver1.get(urlForJob);
ArrayList<String> listOfJobs = new ArrayList<String>();
//WebElement ulOfPagination = divForJobs.findElement(By... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.