method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
bfb29280-e6c8-4808-a9b5-17f33d58b462 | 2 | private void resetArgs() {
if (Options.Size == GameSize.C8) {
R8.setSelected(true);
}
else if (Options.Size == GameSize.C7) {
R7.setSelected(true);
}
else {
R6.setSelected(true);
}
} |
5dc6eb2e-7a31-428a-a9df-55af6974dd4e | 9 | public ArrayList<Person> getPersonV2(String value) {
ArrayList<Person> fundnePersoner = new ArrayList<>();
for (Person p : personer) {
if (p.getCpr().equalsIgnoreCase(value)) {
fundnePersoner.add(p);
return fundnePersoner;
} else if (p.getFornavn()... |
ee654660-2ff3-45fc-9b4d-03afbb52cc77 | 0 | public PBKDF2ParameterType.Salt createPBKDF2ParameterTypeSalt() {
return new PBKDF2ParameterType.Salt();
} |
199c762c-a21f-49f9-a94e-10d368074564 | 2 | public static void setOutputFilePath(String outputFilePath)
{
if (CommonUtil.isNull(outputFilePath))
{
return;
}
if (!outputFilePath.endsWith("/"))
{
outputFilePath += "/";
}
CrawlerManager.outputFilePath = outputFileP... |
47b19eee-9df3-4057-8233-131fc3ee9ead | 2 | public void SetAPIHost(String apiHost) {
if (null == apiHost || apiHost.length() < 2)
throw new IllegalArgumentException("Too short API host.");
_requestUri = "http://" + apiHost + ".alchemyapi.com/calls/";
} |
866f52e0-a691-4b3a-9584-5571acdf457c | 5 | public static void add(ArrayList<Track> newSongs) {
boolean lastTrackCase = false;
if(newSongs == null)
return;
if(playQueueTracks.size() != 0) {
if(currentTrack.equals(playQueueTracks.get(playQueueTracks.size()-1))) {
lastTrackCase = true;
}
... |
bef2407e-9153-4b6e-a309-8f4d7f639306 | 6 | public static ClassInfo forName(String name) {
if (name == null || name.indexOf(';') != -1 || name.indexOf('[') != -1
|| name.indexOf('/') != -1)
throw new IllegalArgumentException("Illegal class name: " + name);
int hash = name.hashCode();
Iterator iter = classes.iterateHashCode(hash);
while (iter.hasN... |
30291c99-3fa0-43f8-b62b-d7f4dcca2725 | 6 | public static String escape(String string) {
StringBuffer sb = new StringBuffer();
for (int i = 0, length = string.length(); i < length; i++) {
char c = string.charAt(i);
switch (c) {
case '&':
sb.append("&");
break;
cas... |
d4410bba-ebbf-4216-84a7-b7ccc8c678b4 | 6 | public ListNode rotateRight(ListNode head, int n) {
if(head==null||n<=0){
return head;
}
ArrayList<ListNode> box = new ArrayList<ListNode>();
ListNode temp = head;
while(temp !=null){
box.add(temp);
temp = temp.next;
}
if(n>=box... |
4bdc9166-26d5-4ba5-bc2b-2e7a324d3a10 | 6 | public void focusGained(FocusEvent e)
{
Object oggetto = e.getSource();
for (int i=0; i<calcoli; i++)
{
if (oggetto.equals((Object)txtSpazio.get(i)))
{
JTextField tmp = txtSpazio.get(i);
tmp.selectAll();
txtSpazio.set(i,... |
70540648-2f6d-423b-8644-41abb0146fd2 | 2 | public boolean belongsTo(GUIComponent component) {
return (this == component) || (superGroup != null && superGroup.belongsTo(component));
} |
88eb7f79-7586-4511-b3fc-553f9e954bc8 | 7 | @Override
public long whereCantWear(MOB mob)
{
long where=super.whereCantWear(mob);
final Wearable.CODES codes = Wearable.CODES.instance();
if(where == 0)
{
for(long code : codes.all())
{
if((code != 0)
&& fitsOn(code)
&&(code!=Item.WORN_HELD)
&&(!CMath.bset(where,code)))
{
if(h... |
80071817-d68b-4ba9-bad5-bab4482734c0 | 5 | public void draw() {
UI.clearGraphics(false);
UI.setColor(c);
for (int h = 0; h < map.length; h++) {
for (int w = 0; w < map[0].length; w++) {
if (map[h][w] != null) UI.fillRect(w * Cell.CELL_WIDTH, h * Cell.CELL_HEIGHT, Cell.CELL_WIDTH, Cell.CELL_HEIGHT, false);
}
}
if (charX >= 0 && charY >= 0) U... |
6ee6b6b3-b118-41f6-9a7a-2d17cec4e352 | 5 | private final void method779(boolean bool) {
anInt1301++;
anInt1291 += ++anInt1294;
for (int i = 0; (i ^ 0xffffffff) > -257; i++) {
int i_13_ = anIntArray1296[i];
if ((i & 0x2) != 0) {
if ((0x1 & i ^ 0xffffffff) == -1)
anInt1293 ^= anInt1293 << -853467134;
else
anInt1293 ^= anInt1293 >>> 13... |
e8d6097a-bba2-4a87-a3b0-f3b0b4aedeab | 1 | public void updatePhysics() {
clock++;
if(clock > fullTime) {
activated = false;
climber.lostPower(getState());
}
} |
dff6af8e-c86a-4bce-9d54-a6084323aa7e | 1 | @Override
public void documentAdded(DocumentRepositoryEvent e) {
// local vars
int whichOne = isThisOneOfOurs(PropertyContainerUtil.getPropertyAsString(e.getDocument().getDocumentInfo(), DocumentInfo.KEY_PATH));
// if it's one of ours ...
if (whichOne != DOCUMENT_NOT_FOUND) {
// mark it open
docOp... |
54e9eeda-6c95-4f16-9db2-5ed9ff8e2834 | 9 | private static Set<EEnum> getAllEEnumerations(EClass sysmlClass,
LinkedHashSet<EEnum> linkedHashSet) {
for (EAttribute eAttribute : sysmlClass.getEAllAttributes()) {
if (eAttribute.getEType() instanceof EEnum) {
EEnum eEnum = (EEnum) eAttribute.getEType();
linkedHashSet.add(eEnum);
}
}
for (ERef... |
20f0dd9e-934a-4df0-83fc-f5dbaeaae412 | 2 | protected void quitterTerritoire(Territoire t) {
this.territoiresOccupes.remove(t);
t.setOccupant(null);
if (this.enDeclin && this.territoiresOccupes.size() == 0) {
joueur.pertePeupleEnDeclin();
Partie.getInstance().remettreBoite(this);
}
} |
07aaae81-1f78-4be9-8c8c-2658e93c9fb3 | 7 | public static void main(String... args) throws IOException {
MyScanner sc = new MyScanner();
int h = sc.nextInt();
int w = sc.nextInt();
int k = sc.nextInt();
int counter = 0;
int max = 0;
int a = 1;
int b = 1;
int t = 1;
for (int i = 1; i... |
cfc40029-80b8-4786-b673-b447184eb959 | 5 | @Override
public void deserialize(Buffer buf) {
super.deserialize(buf);
short flag1 = buf.readUByte();
showExperience = BooleanByteWrapper.getFlag(flag1, 0);
showExperienceLevelFloor = BooleanByteWrapper.getFlag(flag1, 1);
showExperienceNextLevelFloor = BooleanByteWrapper.get... |
bd7aeb25-8c08-4097-b907-0ba75fe3e0af | 4 | private STNode<Key, Value> balance(STNode<Key, Value> x)
{
switch (getShape(x))
{
case LLEFT:
return rotateRight(x);
case LRIGHT:
x.left = rotateLeft(x.left);
return rotateRight(x);
case RRIGHT:
return rotateLeft(x);
case RLEFT:
x.right = rotateRight(x.right);
return rotateLeft(x);
defa... |
296dc206-853a-41d9-bba4-0e97482703c3 | 9 | public static ArrayList<Node> execute(Node node) {
ArrayList<Node> results = new ArrayList<Node>();
// If defining a constant, then add it to the runtime stack. If defining a procedure, do nothing.
if (node.getToken() != null && node.getToken().getType() == TokenType.KW_DEFINE) {
St... |
2d95945a-6d8a-4bf7-af85-5a2bf0998eac | 8 | public boolean displayModesMatch(DisplayMode mode1,
DisplayMode mode2)
{
if (mode1.getWidth() != mode2.getWidth() ||
mode1.getHeight() != mode2.getHeight())
{
return false;
}
if (mode1.getBitDepth() != DisplayMode.BIT_DEPTH_MULTI &&
mode2... |
ba0f3e93-d152-423c-a5ef-a46914e5e7e5 | 0 | public Component getFirstComponent(Container container) {
return m_Components[0];
} |
eb1a745e-87b8-4fe8-85f9-0d2301c4df58 | 2 | public static void main(String[] args)
{
LinkedListNodeIterator<String> list = new LinkedListNodeIterator <String>();
list.addFirst("p");
list.addFirst("a");
list.addFirst("e");
list.addFirst("h");
System.out.println(list);
LinkedListNodeIterator<String> twin = list.copy3(... |
e69aac16-2fc0-4b39-bb65-d2711bf3d685 | 2 | public boolean fromDiscard(Game g, Rack r)
{
int index = indexer.index(g, r);
int newDrawState = index;
int newDrawAction = drawStates[index].getLeastVisited();
if (oldDrawState != -1)
{
drawStates[oldDrawState].updateReward(drawStates[newDrawState], oldDrawAction);
}
oldDrawState = newDrawState;
ol... |
b98b09f3-8be8-4837-91d4-258bbdf151c0 | 8 | @Override
public void sendRequest(String request) throws Exception {
int retriesLeft = REQUEST_RETRIES;
while (retriesLeft > 0 && !Thread.currentThread().isInterrupted()) {
LOGGER.info("Sending request " + request);
requester.send(request);
int expect_reply = 1;
while (expect_reply >... |
395ce2bd-eba9-41e7-a240-0500dbd9f6fc | 5 | public static boolean deleteRecursively(File root) {
if (root != null && root.exists()) {
if (root.isDirectory()) {
File[] children = root.listFiles();
if (children != null) {
for (File child : children) {
deleteRecursively(child);
}
}
}
return root.delete();
}
return false;
... |
c9ea32aa-c2ee-4b09-95dd-6099738f53e9 | 4 | public static int[] removeDuplicates(int[] input){
int j = 0;
int i = 1;
//return if the array length is less than 2
if(input.length < 2){
return input;
}
while(i < input.length){
if(input[i] == input[j]){
i++;
... |
4648e7d9-4302-40f0-b9b8-0e86d5fe4277 | 4 | private void addCustomIngredient(){
Ingredient ingredient;
try{
ingredient = db.retrieveIngredient(ingredientTextField.getText());
} catch (DataStoreException e){
showErrorMessage("There was a problem retrieving the ingredient from the data store", "Data store error");
... |
98c04c3e-09d4-4a84-8240-14301f771fd5 | 1 | public void setCatchBlock(StructuredBlock catchBlock) {
this.catchBlock = catchBlock;
catchBlock.outer = this;
catchBlock.setFlowBlock(flowBlock);
if (exceptionLocal == null)
combineLocal();
} |
2c346a69-ded4-4d47-b5ba-2595fae4dffb | 4 | private void moveWindow(Packet pkt){
int seqNum = pkt.getSeqnum();
if (windowBuffer.peek().getSeqnum() > pkt.getSeqnum()){
return; //ack for an old packet
}
Packet head = windowBuffer.poll();
while (head != null && head.getSeqnum() != seqNum){
head = windowBuffer.poll();
}
aBase = (head == null) ? a... |
b4f5c9e8-fd0b-4034-b8c6-6b140f5792b3 | 1 | public CommandGroup addUngroupedCommands(Command... command)
{
for(Command c : command)
{
ungroupedCommands.add(c);
}
return this;
} |
1cb2be50-166d-4b01-b7b4-acbbf17e820c | 4 | private void drawTerrain() {
int width = UIGlobals.getScreenWidth();
int height = UIGlobals.getScreenHeight();
int cameraX = UIGlobals.camera_x;
int cameraY = UIGlobals.camera_y;
int tileSize = UIGlobals.tileSize;
int xOff = -(tileSize + ((cameraX % tileSize) - tileSize));
int yOff = -(tileSize + ((cam... |
4b6fb44a-37f4-462a-9f84-40ebed061409 | 9 | public static void affecter(GestItineraire gestItineraire, Plan plan,
NoeudItineraire entrepot, PlageHoraire plageHoraireInitiale)
{
List<Livraison> livraisonsInitiales = plageHoraireInitiale.getLivraisons();
List<List<Livraison>> clusters = kmeans(livraisonsInitiales,2);
boolean clustersValides = fals... |
ed8ac6f9-b8db-4095-874e-e7774d46b3a8 | 3 | @Override
public boolean equals(Object obj) {
return obj != null &&
obj instanceof Token &&
((Token) obj).character == character &&
((Token) obj).type == type;
} |
b4807299-18f5-4c6f-84d6-cae31ce62864 | 6 | public void executeEvents(){
if(activeEvents.isEmpty())
return;
for(Job event : activeEvents){
if(event instanceof InterruptableEvent && ((InterruptableEvent)event).shouldEnd() || event instanceof RecurringEvent){
continue;
}
if(((DatedEven... |
93feaa10-866a-4224-8b98-74a4f15751df | 3 | public static void close(){
try
{
rs.close();
} catch (SQLException e)
{
System.out.println("Close ResultSet Failed :" + e);
e.printStackTrace();
}
try
{
stmt.close();
} catch (SQLException e)
{
System.out.println("Close Statement Failed :" + e);
e.printStackTrace();
}
... |
cdcf1082-2434-4bc5-88ad-67ed8042cd80 | 0 | public static EllipseEquation newInstance(float a, float b, float h, float k) {
return new EllipseEquation(a, b, h, k);
} |
95397da8-fbe5-41fd-bc19-cabe34ec33ad | 0 | public void setUitleningen(List<Uitlening> uitleningen) {
this.uitleningen = uitleningen;
} |
b31bb312-cc18-4e58-8786-b3688194869c | 3 | public static void main(String[] args) {
Scanner s = new Scanner(System.in);
Integer2 i2 = new Integer2();
System.out.println("Enter a number: ");
String str = s.nextLine();
int i = Integer.parseInt(str);
i2.setValue(i);
System.out.println("The n... |
7c40301d-2ec2-49f9-9ac4-a38a8699b979 | 9 | public static BanEntry func_73688_c(String par0Str)
{
if (par0Str.trim().length() < 2)
{
return null;
}
String as[] = par0Str.trim().split(Pattern.quote("|"), 5);
BanEntry banentry = new BanEntry(as[0].trim());
int i = 0;
if (as.length <= ++i)
... |
55030cfb-c412-4c15-8f71-3eb38562c485 | 1 | public boolean open( )
{
state = State.PROCESSING;
setVisible(true);
while (state == State.PROCESSING);
return(state == State.OKAY);
} |
0e63fe5a-3ffb-4972-b987-e937d65063a9 | 7 | protected boolean approachingTurn(Segment s) {
Segment overlappingSegment = findOverlappingSegment(s);
if (desire == Desire.STRAIGHT) {
return false;
}
if (desire == Desire.TURN_LEFT && !vehicle.getLane().canTurnLeft()) {
return false;
}
i... |
2fe38b2a-c4fb-4c1c-9cf8-82726beed841 | 5 | private void clearOldBlocks(Player player, boolean effTimeUp){
Iterator<Block> iceIter = null;
final HashSet<Block> nearPlayer = new HashSet<Block>(9);
Block startBlock = player.getLocation().getBlock().getRelative(BlockFace.DOWN);
for(BlockFace bFace : bCheck){
nearPlayer.add(startBlock.getRelative(bFace));... |
efcf6448-50d0-4eef-9b66-da6da1c4a634 | 2 | public void setSurfaceChargeDensity(double sigma){
if(this.psi0set){
System.out.println("You have already entered a surface potential");
System.out.println("This class allows the calculation of a surface charge density for a given surface potential");
System.out.println("or ... |
636b0c5f-037a-4d8e-8817-5a7702302a07 | 7 | public static void main(String a[]) throws IOException {
TreeMap<BigInteger, BigInteger> map = new TreeMap<BigInteger, BigInteger>();
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int test = Integer.valueOf(br.readLine());
while(test!=0) {
int N = Integer.valueOf(br.re... |
b252314f-7358-4d5b-94c7-c4209bc02999 | 5 | private void drawPlayers(Graphics g){
g.setColor(Color.BLACK);
for(int i=0; i<grid.length; i++){
for(int j=0; j<grid[0].length; j++){
for(GameMatter itm: grid[i][j].getItems()){
if(itm instanceof Bandit){
if(itm.equals(player))
g.setColor(Color.MAGENTA);
g.fillRect(j*widthBlock+paddin... |
245c76e9-ba8a-40fb-943b-bd3c3f6b7597 | 2 | private void calculateEnabledState(JoeTree tree) {
if (tree.getComponentFocus() == OutlineLayoutManager.ICON) {
setEnabled(true);
} else {
if (tree.getCursorPosition() == tree.getCursorMarkPosition()) {
setEnabled(false);
} else {
setEnabled(true);
}
}
} |
0e87696b-21a7-4bb0-9ee7-552095037b35 | 5 | public synchronized boolean openSlot(int slotID) {
if (!_isOpen) {
return false;
}
if ((slotID < 0) || (slotID >= _slots.size())) {
return false;
}
if (!_slots.get(slotID).isClosed()) {
return false;
}
_slots.get(slotID... |
820c0f10-d6f8-4281-b726-1a8b0d4bbd18 | 5 | @Override
public ElectionState getElectionState() {
// gets the current date
Date date = new Date();
if (openNominationsDate == null || date.before(openNominationsDate))
return ElectionState.NOT_STARTED;
else if (date.before(startDate))
return ElectionState.NOMINATIONS_OPEN;
else if (date.before(endDat... |
6bbb8607-fb1f-477d-8dfd-8c0750d04c1f | 7 | public static List<GraphNode> generateGraph(List<String> values) {
GraphNode head = null;
List<GraphNode> nodes = new ArrayList<GraphNode>();
for (int i = 0; i < values.size(); i++) {
GraphNode node = new GraphNode(values.get(i));
if (null == head) head = node;
nodes.add(node);
}
for (Gra... |
bfa10fe8-f083-4349-9ffc-782952b12620 | 6 | @Override
public void checkAssocAddRestriction(ClassSubInstance source,
ClassSubInstance target, ModelSubInstance m)
throws RestrictionException {
Iterator<Map.Entry<Integer, AssociationSubInstance>> it = m.assocs.entrySet().iterator();
while(it.hasNext()) {
AssociationSubInstance a = it.next().getValue();... |
284bed83-f309-4233-8b23-9bf20a4b49cd | 5 | public void update(Observable o, Object arg) {
// update garage.occupancy and the garage.isOpen status as needed
// the garage observes both the entry and exit in order to
// keep occupancy correct
if ((String)arg == "entry") {
currentOccupancy++;
} else if ((String)arg == "exit") {
currentOccupanc... |
bbda7c3d-861e-4861-8815-535d080bda4b | 8 | public RobotType getRobotType(IRobotItem robotItem, boolean resolve, boolean message) {
IRobotClassLoader loader = null;
try {
loader = createLoader(robotItem);
Class<?> robotClass = loader.loadRobotMainClass(resolve);
if (robotClass == null || java.lang.reflect.Modifier.isAbstract(robotClass.getModifier... |
4cf23c2c-c109-47e4-aa99-87bcb9a9d79c | 7 | @Override
public void update(final int delta) {
if (!isActive && !Game.getInstance().getCurrentLevel().isWon())
return;
pos.y -= 400. * delta / DURATION;
timeLeft -= delta;
if (timeLeft < 0) {
kill();
if (Game.getInstance().getCurrentLevel().getLevelType() == Level.LEVEL_COMPLEX) {
World.getIns... |
38c4f5b2-e98c-4be5-9e19-a85b4e9b3958 | 1 | public void sendMessage(byte[] message) {
try {
to_peer.write(message);
to_peer.flush();
} catch (IOException e) {
System.err.println("Error sending message: " + message.toString() +
"/nto peer located at: " + peer_ip);
}
} |
17e36787-6a72-4824-9f99-97f7c5bceaf9 | 5 | public void update(Map userCredentials) throws AuthenticationException {
if (passwordFile == null)
throw new AuthenticationException("update()", new IllegalStateException());
try {
String userName = (String) userCredentials.get(Registry.SASL_USERNAME);
String password = (String) ... |
f4f321bf-41c2-42c5-ad13-23cbbd9615b8 | 8 | private static String getRelativeLink( String fromDir, String toDir )
throws IOException
{
StringBuffer toLink = new StringBuffer(); // up from fromDir
StringBuffer fromLink = new StringBuffer(); // down into toDir
// create a List of toDir's parent directories
List parent... |
b6b6c31e-4118-4641-ac22-f003c7e7eaa8 | 7 | private static Code[][] convertStringArrayToCodeArray2D(String[] strArray) {
int len = strArray.length;
// Make histogram of sizes
int[] codeLengths = new int[64];
for (int i = 0; i < len; i++) {
int entryLength = strArray[i].length();
codeLengths[entryLength]++;... |
24fc1f29-74e4-4ba3-9852-91b564c9c0f3 | 5 | public static void randomVector(Configuration conf) {
FSDataOutputStream output = null;
BufferedWriter outputBR = null;
try {
FileSystem hdfs = FileSystem.get(conf);
output = hdfs.create(EntityDriver.randomVectorPath, true);
outputBR = new BufferedWriter(new OutputStreamWriter(output,"UTF-8"));
Rand... |
edb82973-9953-4225-b8dd-b3ca647a1562 | 2 | public Acceptor(int port, ConcurrentLinkedQueue<AIConnection> globalClients, int backlogArg, boolean isGraphicsManagerArg, GraphicsContainer graphicsContainer){
try {
acceptorSocket = new ServerSocket(port);
acceptorSocket.setReuseAddress(true);
graphics = graphicsContainer;
backlog = backlogArg;
... |
fc79bc3b-cae5-4a10-b413-a742a7a90efa | 2 | /* */ public static void close()
/* */ {
/* 187 */ for (Map.Entry entry : playerMap.entrySet())
/* */ {
/* 189 */ ArrayList<BlockState> blockStateList = (ArrayList<BlockState>)entry.getValue();
/* */
/* 191 */ for (BlockState blockState : blockStateList) {
/* 192 */ bloc... |
75bf2178-93a9-4907-a99d-ae68b760e6f8 | 6 | public static void test3()
{
String databaseName = "mytest";
MySQLIdentity mytestAtMytest = MySQLService.createMyIdentity("localhost",databaseName, "mytest", "password");
try {
MySQLService.createConnectionPool(mytestAtMytest);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStack... |
5c7cec4f-4212-4f3a-9258-0ed114aa0d6e | 1 | public JMenuItem getMntmDesconectar() {
if (mntmDesconectar == null) {
mntmDesconectar = new JMenuItem("Desconectar");
}
return mntmDesconectar;
} |
03a363e6-26f2-4777-ab19-56033d8ceed9 | 4 | protected void updateList(List<Hunter> hunters) {
if(log.isLoggable(Logger.INFO))
log.log(Logger.INFO, "updateList(), size: " + hunters.size());
this.model = hunters;
rowData = new String[10][4];
for (int i=0; i<10; i++) {
tableModel.setValueAt("", i, 0);
tableModel.setValueAt("", i, 1);
... |
0273fd02-697c-4a29-9a7e-9bfbb9a69619 | 7 | protected void loadJarURLs() throws Exception {
state = 2;
String jarList = "lwjgl.jar, jinput.jar, lwjgl_util.jar, client.zip, " + mainGameUrl;
jarList = trimExtensionByCapabilities(jarList);
StringTokenizer jar = new StringTokenizer(jarList, ", ");
int jarCount = jar.countTokens() + 1;
urlL... |
723242e1-d4ae-4268-8a35-da04b082eb0e | 2 | public void changeHeight(int height)
{
for(int i=0;i<markers;i++)
{
if(marker[i].isSelectedHeight())
{
marker[i].changeHeight(height);
}
}
} |
602af59b-8d2e-4595-ab49-c34e4ce44097 | 3 | public String[] getLatLon(int id){
/*
* epistrefei tis suntetagmenes enos oximatos
*/
String[] oxima=new String[2];
try {
pS = conn.prepareStatement("SELECT * FROM oximata WHERE id=?");
pS.setInt(1, id);
rs=pS.executeQuery();
if(rs.next()){
oxima[0]=rs.getString("lat");
oxima[1]=rs.getSt... |
81009ce9-2331-4384-90c6-fcc60bf7b7c5 | 3 | private void jButton1ActionPerformed(ActionEvent evt) {
try {
socket = new Socket("127.0.0.1",2009);
login = jTextField1.getText();
password = new String(jPasswordField1.getPassword());
LoginCheck lc = new LoginCheck(socket);
IDcheck = lc.Check(login, p... |
8f14d2fd-38a9-46ee-a4a1-5877241586c2 | 2 | public void saveUser(User user) {
File f = new File(users, user.getUserID() + ".sav");
try {
if (!f.exists())
f.createNewFile();
ObjectOutputStream out = new ObjectOutputStream(
new FileOutputStream(f));
out.writeObject(user);
out.flush();
out.close();
} catch (Exception ex) {
ex.printS... |
fec0a77f-6b4c-4c20-9141-26b8a9955994 | 8 | private void showTP() {
Object o = logic
.showTPStatus(((DeptVO) deptChooser.getSelectedItem()).deptName);
if (o instanceof Feedback) {
JOptionPane.showMessageDialog(null, ((Feedback) o).getContent());
} else if (o instanceof TPDeptVO) {
if (((TPDeptVO) o).isCommitted) {
lb.setLabelText(((TPDeptVO) ... |
d17c6737-92e8-493a-9c3c-c747c920c332 | 9 | public ImmReg(ImmRegOp operation, long leftOperand, Register rightOperand) {
switch(rightOperand.width()) {
case Byte:
if(leftOperand < Byte.MIN_VALUE || leftOperand > Byte.MAX_VALUE) {
throw new IllegalArgumentException("immediate operand does not fit into byte");
}
break;
case Word:
if(l... |
b3930e0f-954e-4d51-92b4-629d249e1be9 | 1 | public static void main(String arg[]) throws IOException{
Xls_Reader datatable = null;
datatable = new Xls_Reader("C:\\CM3.0\\app\\test\\Framework\\AutomationBvt\\src\\config\\xlfiles\\Controller.xlsx");
for(int col=0 ;col< datatable.getColumnCount("TC5"); col++){
System.out.println(datatable.g... |
3c6ba56f-71d5-44bb-ac16-3637257654f2 | 7 | public boolean intersects(Dimension d) {
int x1 = (int) source.drawx;
int y1 = (int) source.drawy;
int x2 = (int) destination.drawx;
int y2 = (int) destination.drawy;
return (((x1 > 0 || x2 > 0) && (x1 < d.width || x2 < d.width)) && ((y1 > 0 || y2 > 0) && (y1 < d.height || y2 < d.height)));
} |
314f6127-e2aa-4240-91d6-46afbbfc8d1b | 7 | public static AccessToken getAccessToken(String path, Configuration config) {
AccessToken at = null;
String token = "325878645-W8s04eclPdOy1QOjyh4WTcdHkeCNttPYTiUIDlAZ";
String tokenSecret = "3M0lrV45DRqZCd5BxCrDHEik5wThOLmkrhc7yqWZYjs";
at = new AccessToken(token, tokenSecret);
... |
31f4c6f0-0e1c-42f4-baab-91e29088478c | 7 | public void deleteUser(User user) {
System.out.println(users);
System.out.println(user);
System.out.println("Started delete user");
if(users.contains(user)) {
int i = 0;
System.out.println("delete user: " + user);
while(i<categories.size()) {
... |
1a07ff47-a710-460d-ad77-5d037f15f941 | 1 | private void notifyListeners()
{
for (ScoreListener listener : listeners)
listener.onScoreChanged();
} |
beb90d9d-991a-45a7-9b05-bf885c4eade3 | 8 | public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String line = in.readLine();
int n = Integer.parseInt(line);
int arr[] = atoi(in.readLine());
int i = 0;
int res = 0;
ArrayList<Integer> lista = new ArrayList<Integer>();
... |
e1e985c0-b403-426e-b31e-987196e489a5 | 7 | public boolean concatenateAligned(BitOutputStream src) {
int bitsToAdd = src.totalBits - src.totalConsumedBits;
if (bitsToAdd == 0) return true;
if (outBits != src.consumedBits) return false;
if (!ensureSize(bitsToAdd)) return false;
if (outBits == 0) {
System.arrayco... |
e4aef1d4-21bc-4a8d-bfb2-1e94c819c19c | 9 | public static void main(String... args) throws IOException {
MyScanner sc = new MyScanner();
int n = sc.nextInt();
int m = sc.nextInt();
PriorityQueue<Integer>[] p = new PriorityQueue[n];
for (int i = 0; i < n; i++) {
p[i] = new PriorityQueue<>();
}
i... |
69719c7f-732f-4776-ae1d-f30cfc1ebc20 | 8 | private void computePositions() {
// Determine time for rendering
if (fConf.getInt("fixedTime") == 0) {
// No fixed time.
// final long lTimePassed = System.currentTimeMillis() - fsStartTime;
// fCurrentTime = fsStartTime + (long) (fConf.getDouble("timeWarpFactor") * lTimePassed);
fCurrentTime = System.... |
54f7fa41-297d-4db8-9b1f-73deeaff7f44 | 5 | public final SymbolraetselASTNormalizer.num_return num() throws RecognitionException {
SymbolraetselASTNormalizer.num_return retval = new SymbolraetselASTNormalizer.num_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
CommonTree _first_0 = null;
CommonTree _last ... |
bb8d10ed-f947-46c5-ad09-0282fc926cae | 3 | protected void cellsAdded(Object[] cells)
{
if (cells != null)
{
mxIGraphModel model = getGraph().getModel();
model.beginUpdate();
try
{
for (int i = 0; i < cells.length; i++)
{
if (!isSwimlaneIgnored(cells[i]))
{
swimlaneAdded(cells[i]);
}
}
}
finally
{
m... |
ccaa64d2-3b42-438d-bd74-da53e82bc0a3 | 9 | @Override
public void reduce(Text key, Iterator<Node> values,
OutputCollector<Text, Node> output, Reporter reporter)
throws IOException {
int min = Integer.MAX_VALUE;
Node node = null;
while (values.hasNext()) {
Node distance = values.next();
if(LOGGER.isDebugEn... |
36a1ed32-aae1-432a-b0f3-d9bb4209a21e | 3 | public SignatureVisitor visitSuperclass() {
if (type != CLASS_SIGNATURE || (state & (EMPTY | FORMAL | BOUND)) == 0) {
throw new IllegalArgumentException();
}
state = SUPER;
SignatureVisitor v = sv == null ? null : sv.visitSuperclass();
return new CheckSignatureAdapter(TYPE_SIGNATURE, v);
} |
98c2c220-21fe-4a10-bc0f-b8eab370260a | 8 | public void addControlLogic() {
Action run = new AbstractAction() {
public void actionPerformed(ActionEvent e) {
run();
}
};
runButton.addActionListener(run);
Action clear = new AbstractAction() {
public void actionPerformed(ActionEven... |
21a9bccd-e5b1-4fb4-81fa-fc4e91b52bfd | 8 | public void seguridadMenus() {
@SuppressWarnings("static-access")
String mcodusr = mcod_usr;
try {
rs = sql.executeQuery("SELECT permission FROM perfil INNER JOIN admg02 ON admg02.id_perfil = perfil.id_perfil WHERE admg02.cod_usr = '" + mcod_usr + "'");
if (rs.next()) {
... |
084335c1-c0a5-4de9-a334-5ec682b8b9fb | 8 | private WriteConcern buildWriteConcern(final Boolean safe, final String w,
final int wTimeout, final boolean fsync, final boolean journal) {
if (w != null || wTimeout != 0 || fsync || journal) {
if (w == null) {
return new WriteConcern(1, wT... |
02a2a751-0f48-4b6a-b9c5-b449e5f93682 | 5 | private final void pop(char c) throws JSONException {
if (this.top <= 0) {
throw new JSONException("Nesting error.");
}
char m = this.stack[this.top - 1] == null ? 'a' : 'k';
if (m != c) {
throw new JSONException("Nesting error.");
}
this.top -= 1;... |
06447c3d-e79d-4f1b-8daa-3f29baa04376 | 2 | public void dailyBonus(Player player)
{
//for (List<WorldMapObject> s: p2o.objects()) {
for (WorldMapObject o: p2o.objects()) {
o.dailyBonus(player);
}
for (WorldMapObject o: p2h.objects()) {
o.dailyBonus(player);
}
//}
} |
cc79bddf-41a4-4077-9874-97a2e61ad487 | 3 | @Override
public void deserialize(Buffer buf) {
id = buf.readShort();
if (id < 0)
throw new RuntimeException("Forbidden value on id = " + id + ", it doesn't respect the following condition : id < 0");
finishedlevel = buf.readShort();
if (finishedlevel < 0 || finishedlevel... |
60e76761-1f6f-4be4-bdcb-f6e42ce12c5b | 0 | public boolean isCellEditable(int row, int column) {
return false;
} |
bc9bc01f-1cc8-44d5-b36a-064ad6979ea9 | 5 | private void doConversion(int startPosition, int stepAlgorithm) {
int block[] = new int[BLOCK];
int col = 0;
int row;
int x = 0;
int y = 0;
int position = startPosition;
for (int i = 0; i < HEIGHT; i += SIZE_BLOCK) {
row = i + STEP;
for (in... |
7213422d-d89e-4308-8e3b-c9c653f88044 | 3 | public void Download10KbyCIKList(String filename) {
try {
FileReader fr = new FileReader(filename);
BufferedReader br = new BufferedReader(fr);
String str = br.readLine();
while (str != null) {
Download10KbyCIK(str, false);
str = br.readLine();
}
br.close();
} catch (FileNotFoundException ... |
73225b38-a173-4e6d-916c-149df4f17b06 | 9 | private void findChromosomeRegionItems(RPTreeNode thisNode, RPChromosomeRegion selectionRegion,
ArrayList<RPTreeLeafNodeItem> leafHitItems) {
int hitValue;
// check for valid selection region - ignore request if null
if (selectionRegion == null)
... |
a70c56f0-33c8-465c-acfa-701f82d97eb3 | 0 | public Bomb getBomb() {
return bomb;
} |
66dfba71-79c2-4740-af79-da2c3a67c513 | 7 | @Override
public boolean onCommand(CommandSender commandSender, Command command, String strLabel, String[] vArgs)
{
if (commandSender instanceof Player)
{
KaramPlayer player = m_plugin.playerManager.addOrGetPlayer((Player)commandSender);
if (vArgs.length == 1)
... |
7a9f2c6c-105d-43d5-9a81-24b39a8378bc | 5 | public int removeElement(int[] A, int elem) {
// if (A.length==0) return 0;
int n = -1;
for (int i = 0; i < A.length; i++) {
while (i < A.length && A[i] == elem) {
i++;
}
if (i < A.length && A[i] != elem) {
n = n + 1;
A[n] = A[i];
}
}
return n + 1;
} |
ec2e213e-9f22-4d28-aa97-87077e0297d2 | 1 | public boolean shouldDeconstruct() {
if (dist > Asteroids.getScreenDims()[0])
return true;
return false;
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.