method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
960c29f1-ed95-42a8-a1cb-824fd497139a | 1 | public static void debug(String string) {
if ( SheepFeed.debug ) {
log.info("SheepFeed DEBUG: "+ string);
}
} |
1705c74f-62e4-49e9-a694-329b82e4ed06 | 0 | public int getBreakWordLongerThan()
{
return _breakWordLongerThan;
} |
cc0a042e-7744-458f-9dc7-544ec3ed16ed | 9 | private void BuildModel(ClassElem klass, ClassDocumentation klassDoc,
List<Integer> codeQMatches, List<Integer> codeAMatches,
List<Integer> linkAMatches, HashSet<Integer> ansSet,
Hashtable<Integer, Integer> AnswerIdToParentId,
HashSet<Integer> qSet,
Hashtable<Integer,ThreadElement> ThreadMap // Shared ac... |
ff5cecd1-4235-4e38-ab3a-fc600da1ee5a | 2 | public boolean tileCollision(double x, double y, double xa, double ya, int size) {
int xt;
int yt;
for (int c = 0; c < 4; c++) {
xt = (((int) x + (int) xa) + c % 2 * size / 2 - 5) / 16;
yt = (((int) y + (int) ya) + c / 2 * size / 2 + 6) / 16;
if (getTile(xt, ... |
8178c025-bb2a-4b88-8521-6911a70c7d60 | 7 | private int calculateBadWorkingHoursTeacherIIIAndIV() {
int penaltyPoints = 0;
List<LinkedHashMap> teachersAllDay = getAllDaysTeacherTimeTable();
for (LinkedHashMap<String, LinkedHashMap> daysTimeTable : teachersAllDay) {
// Very dirty hack because of rush
int weekDayNu... |
5c0f2b75-7bdc-424a-896f-374d06a796cf | 8 | public void XbIDX16 (int n, int Dir, String Step2){
String ff,ee = "0",sum;
int ln;
switch(n)
{
case 0:
Step2 = Step2.replace("xb", "E2");
ff = Integer.toHexString(Dir);
ln = ff.length();
if(ln == 3)
{
ee = "0"+ ff.charAt(0);
ff = ff.substring(1,3);
sum ... |
22f6b06d-6b2f-4b5d-b75a-d925fea4ae13 | 1 | private void fireReceiveMessagetEvent(ReceiveMessageEvent evt) throws Exception {
if (invokeHandler == null) {
throw new IllegalStateException("InvokeHandler not assigned on client side");
}
localConnectionInfo.remove();
localConnectionInfo.set(evt.getConnectionInfo());
new Reflexia().invoke(i... |
00ff2d14-eb35-4000-9ead-25f214110a63 | 4 | @Override
public String toString() {
String acc = "[\n";
for (int i = 1; i <= m; i++) {
acc += "[";
for (int j = 1; j <= n; j++) {
acc += this.get(i, j) + ((j <= (n - 1)) ? "," : "");
}
acc += "]" + ((i <= (m - 1)) ? ",\n" : "");
}
return acc + "\n]";
} |
f55db096-ebb0-4095-ac5c-a9c06834502d | 3 | private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
int index = estrategyT.getSelectedRow();
if(index>=0){
String nombre = (String)estrategyT.getModel().getValueAt(index,0);
for(int i=0;i<contenedorEstrategia.ge... |
18ef66ea-35a3-4de8-af2e-4828c14610c6 | 2 | public void colorizeNodes(Map<Node, Color> nodeColors){
if(nodeColors == null) {
return;
}
for (Map.Entry<Node, Color> nodeColor : nodeColors.entrySet()) {
colorizeNode(nodeColor.getKey(), nodeColor.getValue());
}
} |
0c49164a-0b8a-49a7-aaaa-2a435a8cc585 | 1 | public boolean isDigit(int token) {
return (token >= 0x30 && token <= 0x39);
} |
3358f042-c8b1-43be-bdcc-37b34d2f2686 | 6 | public void run()
{
isRunning = true;
int frames = 0;
long frameCounter = 0;
final double frameTime = 1.0 / FRAME_CAP;
long lastTime = Time.getTime();
double unprocessedTime = 0;
while(isRunning)
{
boolean render = false;
long startTime = Time.getTime();
long passedTime = startTi... |
7b3a6cea-897d-4758-b049-70f012e89219 | 4 | @Override public Dimension preferredLayoutSize(Container parent) {
int mapSize = fieldCardComponents.size();
Dimension dimension = new Dimension(0, 0);
//rounds up the map size if the amount of cards is divisible by four
if(fieldCardComponents.size() % 4 != 0) {
switch(mapSize % 4) {
case 1:
mapSize... |
bada02c7-049e-4fac-8ae3-1f8c8ffdb796 | 0 | @RequestMapping(value = "/edit/employee/skills", method = RequestMethod.POST)
public String editEmployeeSkillRatings(@RequestBody UserSkillSet userSkillSet ) {
ObjectMapper objectMapper = new ObjectMapper();
ObjectNode objectNode = objectMapper.createObjectNode();
employeeDao.editEmployeeSkills(userSkillSet);
... |
90231bca-4284-4cb8-b46b-b3972f15bacd | 1 | public static String getStringForException(Throwable e) {
if (e == null) { return "<no exception>"; }
StringWriter writer = new StringWriter();
PrintWriter out = new PrintWriter(new BufferedWriter(writer));
e.printStackTrace(out);
out.flush();
return writer.getBuffer().toString();
} |
5224e660-76b0-48ce-99a7-5a87c7d46565 | 0 | public EventPost(String username, Event tipoEvento)
{
super(username);
this.tipoEvento = tipoEvento;
} |
c7a1b8db-6e66-4318-a66d-a48413ebb436 | 2 | public void mouseReleased(MouseEvent arg0) {
if(unitSlider.getValue() != 25) {
int result = JOptionPane.showConfirmDialog(model.getView().getFrame(),
"Are you sure you want to change the unit size?\n" +
"Warning: it'll probably screw up the game. In a big way.",
"Warning!", JOptionPane.YES_NO_... |
49a6daa7-4668-4ac0-83a5-57b59ca04d96 | 7 | public DSolve(Puzzle solving){
int row = 0;
int column = 0;
int value =0;
boolean done = false;
boolean failed = false;
int counter = 0;
//This part of the method goes through each of the puzzle's 81 squares (at worst) 81 times and applies the class's methods each time.
//Th... |
99af00ef-9e9e-4da8-9ab4-760be7b75607 | 8 | static UBytePtr update_palette() {
char[] mo_map = new char[16];
char[] pf_map = new char[16];
int i, j;
/* reset color tracking */
memset(mo_map, 0, sizeof(mo_map));
memset(pf_map, 0, sizeof(pf_map));
palette_init_used_colors();
/* update color usage fo... |
1d026ce4-cf7d-49a0-997b-e5b881d39f2e | 6 | @Override
public void updateRecord()
{
byte[] tmp = new byte[PTG_REF3D_LENGTH];
tmp[0] = record[0];
byte[] ix = ByteTools.shortToLEBytes( ixti );
System.arraycopy( ix, 0, tmp, 1, 2 );
byte[] brow = ByteTools.cLongToLEBytes( rw );
System.arraycopy( brow, 0, tmp, 3, 2 );
if( fRwRel )
{
col = (short) ... |
6540237f-452c-4c48-8dbd-8979d18f03df | 9 | protected static int extractInt(int[] data, int startBit, int length) {
if (data == null) {
throw new IllegalArgumentException("data == null");
}
if (startBit < 0) {
throw new IllegalArgumentException("startBit < 0");
}
if (length <= 0) {
throw... |
ec4657c1-22c2-4f6f-84be-cee136294b64 | 7 | public boolean hasSolid(HitBox hb)
{
int x = hb.x;
int y = hb.y;
int w = hb.width;
int h = hb.height;
int rightBound = x + w;
int bottomBound = y + h;
if (x < 0)
x = 0;
if (y < 0)
y = 0;
if (rightBound ... |
ae540af2-4c8c-41f5-8f96-8eecc1a4100c | 5 | public static void main(String[] args) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringBuilder sb = new StringBuilder();
String line;
int length;
boolean up;
while((line = br.readLine()) != null && line.length() > 0){... |
e4d69898-1877-4c95-9437-a64566cebcce | 4 | public synchronized void run() {
while (true) {
if(channel == null) {
try {
wait();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
try {
handleRequest();
... |
3b493803-b01f-487a-9c57-b1cc3d60db07 | 9 | private void findNN(Node node, ResultSet resultSet, int[] query,
int[] checks, int maxChecks, PriorityQueue<Branch<Node>> heap,
BitSet checked) {
// Terminal node.
if (node.children.isEmpty()) {
if (checks[0] >= maxChecks && resultSet.full())
return;
for (int i = 0; i < node.points.size(); i++) {
... |
869bb2ac-ae22-4893-989e-cc9d4af19e44 | 7 | public void paint(GC gc, int width, int height) {
if (!example.checkAdvancedGraphics()) return;
Device device = gc.getDevice();
// array of coordinate points of polygon 1 (region 1)
int [] polygon1 = new int [] {10, height/2, 9*width/16, 10, 9*width/16, height-10};
Region region1 = new Region(device);
region1.a... |
d7085245-7ef9-4323-925e-1f880513719a | 7 | public LinkedList<int[]> search(int size) {
LinkedList<int[]> mappers = new LinkedList<int[]>();
LinkedList<int[]> s = new LinkedList<int[]>();
s.push(new int[0]);
int[] allNums = new int[size];
for (int i = 0; i < size; i++)
allNums[i] = i;
int[] poped = ... |
6f4e5830-39fb-45ea-bb4e-79676b34018c | 4 | public static void main(String[] args) {
String urlStr = null;
try {
ModifiedCentralizedExceptionHandlerApp app = new ModifiedCentralizedExceptionHandlerApp();
app.openDataFile("src.txt");
app.readData();
reader.close();
} catch (FileNotFoundException e) {
System.out.println("Specified file not fou... |
87a47fbb-7376-4aa3-812c-724a26979539 | 1 | public DefaultBox<?> getTargetItem() {
return targetItem;
} |
4899a0f9-bb96-4473-9f3e-7032fda4c920 | 8 | public final int partitionByBarCode(int lb, int ub) { // for an outline of how this works, see the partition method for name
Person pivotElement = allPersons[lb];
int max = logicalSize;
int left = lb, right = ub;
Person temp;
while (left < right) {
while ((allPersons[left].getBarCode() <= pivotElement.get... |
ca5dbca5-4f88-4347-b55f-759d37974d9c | 7 | private static List<String> splitTopLevel(String s, String separator) {
int balance = 0;
int[] balances = new int[s.length()];
List<String> result = new ArrayList<String>();
StringBuilder token = new StringBuilder();
for (int i = 0; i < s.length(); i++) {
if (s.charAt... |
917d54cc-f97f-416d-8aa2-87d31f6c6ae5 | 8 | public List<Chunk> findVerbChunk(SenData sen) {
List<Chunk> ls = new ArrayList<>();
int i = 0;
Chunk c, prev = null;
while (i < sen.chunks.size()) {
c = sen.chunks.get(i);
if (c.type.equals("VP") && !appoSet.contains(c.txt)
&& !(prev != null &&... |
5c06826c-a2f3-4111-90ab-cb62d3b65233 | 9 | public boolean equals(final Object a, final Object b) {
if ((a == null) || (b == null)) {
return a == b;
}
if (a.getClass().isArray()) {
if (!b.getClass().isArray()) {
return false;
}
if (a.getClass().getComponentType() != b.getClas... |
6188e051-b7d8-4f0c-b036-f24ff94cfa52 | 9 | void comboEvent(Event event) {
switch (event.type) {
case SWT.Dispose:
removeListener(SWT.Dispose, listener);
notifyListeners(SWT.Dispose, event);
event.type = SWT.None;
if (popup != null && !popup.isDisposed()) {
list.removeListener(SWT.Dispose, listener);
popup.dispose();
}
Shell shell ... |
8e67c90e-68fb-4b20-9c5d-6978ad059587 | 8 | private static void checkSatisfy(BswabePolicy p, BswabePrv prv) {
int i, l;
String prvAttr;
// TODO: parallelize here
p.satisfiable = false;
if (p.children == null || p.children.length == 0) {
for (i = 0; i < prv.comps.size(); i++) {
prvAttr = prv.comps.get(i).attr;
// System.out.println("prvAtt:" ... |
b09e8c31-4ead-4ea8-9a25-f100e853be20 | 8 | protected void generateReferenceModelWithXVal(){
m_allWordFrequencyWithXVal = 0;
for(_Doc d: m_corpus.getCollection()){
if(d instanceof _ParentDoc){
for(_SparseFeature fv:d.getSparse()){
int wid = fv.getIndex();
double val = fv.getValue();
m_allWordFrequencyWithXVal += val;
if(m... |
7faf881b-e746-4548-92ae-3b1ce7e2d01c | 9 | public void setLocation(int x, int y) {
//Fix the Location of the MasterTile. The MasterTile
//Can only be in one of the four corners of its parent
if(isOnDesktop()) {
Dimension _size = desktopService.getDesktopSize();
if(x>(_size.width/2) && y < (_size.height/2)) setGri... |
c695c06e-4150-4ef6-a6e5-5ddd3702b60f | 8 | @Post("txt")
public String _post(Representation body) {
if (body == null) return "";
String txt = textify(body);
if ("".equals(txt) || txt == null) return "";
String ret = "";
for (int i = 0; i < REGEXES.length; i++) {
Pattern p = Pattern.compile(REGEXES[i][0]);
... |
b2d3e23c-4b87-49f2-b7d5-df0313a7b460 | 7 | public void saveMod(Path path, Mod mod) throws IOException
{
Path dir = path == null ? mod.getSourceFolder() : path;
if(dir == null)
throw new IllegalArgumentException("No path was provided");
if(Files.notExists(path))
Files.createDirectory(dir);
ModInfo info = mod.getInfo();
Util.writeJsonToFile(info.... |
50bbab81-1f9c-42a9-92d1-735c28f5bb11 | 8 | protected boolean computeCell(int col, int row)
{
boolean liveCell = getCell(col, row);
int neighbours = countNeighbours(col, row);
boolean nextCell = false;
if (neighbours < 2) nextCell = false;
if (liveCell && (neighbours == 2 || neighbours == 3)) nextCell = true;
if (liveCell && neighbours... |
99ea071d-13fd-4b09-94a5-0d9a25f66c65 | 9 | private void setWrappedIcon(Style style, Icon icon, String text) {
if (Page.wrapIconWithComponent(icon)) {
IconWrapper wrap = new IconWrapper(icon, page);
wrap.setIndex(indexOfComponent++);
if (text != null) {
boolean needCache = ConnectionManager.sharedInstance().isCachingAllowed() && page.isRemote();
... |
3bb57de9-b6db-429a-8ac8-90459e055655 | 4 | @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onBlockFromTo(BlockFromToEvent event) {
String world = event.getToBlock().getWorld().getName();
Long from = plugin.hashLocation(event.getBlock().getLocation());
Long to = plugin.hashLocation(event.getToBlock(... |
058a4320-6be0-46d3-8059-865cf24c5fdb | 5 | private void lblRolesEditMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblRolesEditMouseClicked
//handle if we are currently updating or want to update the roles when the label is clicked
switch (lblRolesEdit.getText()) {
case "Klar/uppdatera":
if (cbAdminist... |
443e0d41-9ac4-4021-9af5-d20343f35152 | 5 | static double eval() {
double loss = 0;
@SuppressWarnings("rawtypes")
Iterator userIter = DataInfo.userTest.iterator();
@SuppressWarnings("rawtypes")
Iterator ItemIter = DataInfo.itemTest.iterator();
@SuppressWarnings("rawtypes")
Iterator rateIter = DataInfo.rateTest.iterator();
while(userIter.has... |
443bf514-ca80-4ac7-8214-c69c2f36c296 | 0 | public SocketClientConnection(EndPoint endPoint) throws UnknownHostException, IOException {
super(new Socket(
endPoint.getAddress(),
endPoint.getPort()), 0);
} |
434236a9-8eb6-48dd-ac1c-80576d5dc0c4 | 4 | public void sortPieces() {
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>Pawns
for (int j = 0; j < 16; j++) {
if (j < 8) {
this.pawns[j] = new Pawn(true, j);
} else {
this.pawns[j] = new Pawn(false, 15 - j);
}
}
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>> kings & Queens
for (int j = 0; j < 2; j++) {
boolean ... |
db9441c1-e1ad-449d-9e5b-eac2a76c102e | 0 | public AbstractOutlinerMenu() {} |
38219a26-7610-4b87-84b6-83fca75bd978 | 2 | @Override
public int compareTo(AstronomicalObject o) {
return (this.mass < o.mass) ? -1 : (this.mass > o.mass) ? 1 : 0;
} |
b4cc22d1-22c9-4c21-ae71-70d4ddd16835 | 6 | protected void hitBall(final Ball ball) {
// If the ball is intersecting the paddle
if (ball.getY() + (2 * ball.getRadius()) > this.getY() //top
&& ball.getY() < this.getY() + PADDLEHEIGHT //bottom
&& ball.getX() + (2 * ball.getRadius()) > this.getX() //left
... |
abb13289-f4a1-4f19-9546-e98d494d6394 | 6 | @Override
public boolean keyDown(int keycode) {
switch (keycode) {
case (Keys.UP):
if (choiceSelected != 1) {
choiceSelected -= 1;
}
break;
case (Keys.DOWN):
if (choiceSelected != 3) {
choiceSelected += 1;
}
break;
case (Keys.SPACE):
startAction(choiceSelected);
bre... |
40d0f3d9-66db-4919-95c6-629f32edd70d | 6 | @EventHandler
public void CaveSpiderStrength(EntityDamageByEntityEvent event) {
Entity e = event.getEntity();
Entity damager = event.getDamager();
String world = e.getWorld().getName();
boolean dodged = false;
Random random = new Random();
double randomChance = plugin.getCaveSpiderConfig().getDouble("CaveS... |
80409f4d-ade5-4a70-b41e-2df790d0d946 | 0 | public int getItemIndex() {
return this.itemIndex;
} |
5a24f802-3640-419a-bf13-8390803326e0 | 2 | public static void main(String [] args){
int sum=0;
int term=1;
while(fibonacci(term) <=4000000){
int currentTerm =fibonacci(term);
if(currentTerm % 2 ==0){
sum += currentTerm;
}
term++;
}
System.out.println(sum);
} |
3f910975-a3b8-449a-a548-cb3c973b6ea9 | 0 | @Override
public int create(Labo unLabo) throws Exception {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
} |
8da083aa-9aab-4f77-9a15-53203ec0cb1c | 8 | private boolean handleBreakBlocked(Player player, Block block) {
if (WorldRegionsPlugin.getInstanceConfig().ENABLE_BLOCKED_BREAK && WGCommon.willFlagApply(player, WorldRegionsFlags.BLOCKED_BREAK)) {
// Disabled?
if (WGCommon.areRegionsDisabled(player.getWorld())) return true;
// Bypass?
if (!WGCommon.... |
f3f578f5-f133-4984-bcec-6f3ece557186 | 8 | public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
// 打开socket通道
SocketChannel socketChannel = SocketChannel.open();
// 设置为非阻塞方式
socketChannel.configureBlocking(false);
// 打开选择器
Selector selector = Selector... |
2ce28d68-e8a0-4aec-9bcb-4e9606471699 | 4 | public void testBigCycList() {
System.out.println("\n**** testBigCycList ****");
CycAccess cycAccess = null;
CycList cycList = null;
try {
try {
if (connectionMode == LOCAL_CYC_CONNECTION) {
cycAccess = new CycAccess(testHostName, testBasePort);
} else if (connectionMode... |
f670e2c5-a2e5-4fd2-92c9-1fe27355c96a | 1 | private void sendNameToServer() {
// First, we validate the input.
errorLabel.setText("");
String textToServer = nameField.getText();
if (!FieldVerifier.isValidName(textToServer)) {
errorLabel.setText("Please enter at least four characters");
return;
}
// Then, we send the input to th... |
b5524280-57ad-4d44-9900-96a94527743a | 1 | private void updateEntities(int delta){
for(Entity entity:entities){
entity.update(delta);
}
} |
b3a9a013-66c9-492a-a5f1-affc3a01ad66 | 4 | public static ArrayList<Long> loadIsbns(String filename) {
ArrayList<Long> toBeAdded = new ArrayList<Long>();
try {
Scanner fileIn = new Scanner(new File(filename));
int lineNum = 1;
while (fileIn.hasNextLine()) {
String line = fileIn.nextLine();
Scanner lineIn = new Scanner(line);
lineIn.us... |
29462032-d042-43e1-a7be-0229240cc737 | 8 | public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null || !(obj instanceof Makler))
return false;
Makler other = (Makler)obj;
if(other.getId() != getId() ||
!Helper.compareObjects(getName(), other.getName()) ||
!Helper.compareObjects(getAdresse(), other.getAdresse... |
afa5be21-dc78-4ead-a660-2cc54dbd425a | 2 | public void giveWeapon()
{
int material1=weapon.getMaterial1();
int material2=weapon.getMaterial2();
int enchantment=weapon.getEnchantment();
weaponStrength= material1+material2+enchantment;
updateDamage();
returnValues();
if(damage > 20)
{
... |
6d102986-8a56-456e-abfa-76dbcd9b88ad | 6 | public static void main(String[] args) throws SocketException, IOException {
if (args.length != 2 && args.length != 4) {
System.out.println("Usage: MessageThreading <hostname> <groupname> [<user> <password>]");
return;
}
String hostname = args[0];
String newsgro... |
1e838e5f-bb06-473a-af35-c974d9b52aca | 3 | public static double nashSutcliffe(double[] obs, double[] sim, double pow, double missingValue) {
sameArrayLen(obs, sim);
int pre_size = sim.length;
int steps = pre_size;
double sum_vd = 0;
double size = 0;
for (int i = 0; i < obs.length; i++) {
if (obs[i] >... |
1f0eb516-159d-4623-b850-f8aef0b4235f | 4 | public Edg randomEdge() {
Set<Integer> nodes = adjList.keySet();
int item = new Random().nextInt(nodes.size() - 1);
int i = 0;
for (int obj : nodes) {
if (i == item)
break;
i = i + 1;
}
List<Edg> edges = adjList.get(i);
ite... |
e8ce6b43-f0ec-428c-9f19-78b22e29181c | 0 | public void run(){
update();
utilities();
keyMapMovement();
mouseMapMovement();
mapEdge();
} |
a319f571-53ea-4aa2-a950-9fe6dd2a2083 | 7 | private void configureGtfsRealtimeBeanDefinition(CommandLine cli,
Map<String, BeanDefinition> beanDefinitions) {
boolean tripUpdates = cli.hasOption(WebappCommon.ARG_GTFS_REALTIME_TRIP_UPDATES_URL);
boolean vehiclePositions = cli.hasOption(WebappCommon.ARG_GTFS_REALTIME_VEHICLE_POSITIONS_URL);
boolean... |
70cdb6a6-6adb-41a7-a971-0a51a308fc53 | 4 | protected static void checkStatus(Block root) {
Queue<Block> queue = new LinkedList<Block>();
queue.add(root);
HashSet<Block> visited = new HashSet<Block>();
while (!queue.isEmpty()) {
Block blk = queue.remove();
if (blk == null || visited.contains(blk)) {
continue;
}
visited.add(blk);
if (!b... |
701e71c2-07ec-4e10-9a5e-25d4bf3dd3f9 | 8 | public List<Integer> allPicturesIds() {
PreparedStatement stmt = null;
Connection conn = null;
ResultSet rs = null;
List<Integer> picturesIds = new ArrayList<Integer>();
try {
conn = DbConnection.getConnection();
stmt = conn.prepareStatement(ALL_PICTURE_IDS_STMT);
rs = stmt.executeQuery();
whil... |
203a54ba-d478-4317-a18c-abc1a2fcbcd9 | 9 | public boolean setIsBBatom(){
if ( name.equalsIgnoreCase("N") || name.equalsIgnoreCase("CA") || name.equalsIgnoreCase("C") || name.equalsIgnoreCase("O")
|| name.equalsIgnoreCase("OXT") || name.equalsIgnoreCase("H")
|| name.equalsIgnoreCase("H1") || name.equalsIgnoreCase("H2") || name.equalsIgnoreCase("H3"... |
3a4840c1-db9a-4d5e-a704-4c878f9928cf | 3 | @Override
public void run() {
// TODO spravit krajsie
final JFrame frame = new JFrame("ViDA");
GUI.frame = frame;
frame.setLayout(null);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
graphLoader = new JFileChooser("./");
... |
ae897fb4-9bb4-4115-9bdc-c5475689dd5e | 3 | public static void main(String[] args)
{
int codigo;
char x;
String a="";
String Cadena1, aux;
Cadena1=JOptionPane.showInputDialog("Ingrese Frase");
int longitud1 = Cadena1.length();
char [] frase1= Cadena1.toCharArray();
for (int i = ... |
21ac7664-03b9-4fb7-aba9-fb5320e59528 | 1 | private void reloadServerList() {
tabLabels = new ArrayList<>();
tabPanel.removeAll();
servers = storage.load();
for (Server s : servers) {
Form form = new Form(this) ;
form.setTitle( s.get("title") );
form.setAddress( s.get("address") );
f... |
e14f072c-87b5-44fb-8f64-5843805e6c33 | 1 | public void doFixedLengthWithPZMap() {
try {
final String mapping = ConsoleMenu.getString("Mapping ", FixedLengthWithPZMap.getDefaultMapping());
final String data = ConsoleMenu.getString("Data ", FixedLengthWithPZMap.getDefaultDataFile());
FixedLengthWithPZMap.call(mapping,... |
596a78c2-55f0-497b-9e36-4edc16798215 | 2 | @Override
public boolean shouldKeepAlive(int i, int j) {
return (getCell(i, j).isAlive())
&& (numberOfNeighborhoodAliveCells(i, j) == 2 || numberOfNeighborhoodAliveCells(i, j) == 3);
} |
9d17df68-ee4b-44fe-8925-09a344d101b3 | 7 | private int handleSC(String value,
DoubleMetaphoneResult result,
int index) {
if (charAt(value, index + 2) == 'H') {
//-- Schlesinger's rule --//
if (contains(value, index + 3,
2, "OO", "ER", "EN", "UY", "ED", ... |
3540cf0c-1680-4611-8c0f-17e8c23e86f6 | 6 | public void unloadFriend(OfflinePlayer p){
if(!friends.containsKey(p.getName())) return;
Friend f = friends.get(p.getName());
//Save
File pconffold = new File(plugin.getDataFolder() + File.separator + "userdata");
File pconfl = new File(plugin.getDataFolder() + File.separator + "userdata" + File.separator ... |
b6272eb0-52c3-4b03-ba3c-5299447ca48a | 9 | @Test
public void testMultipleJobsWithMultipleClientsWithDataRequests() {
System.out.println("multipleJobsWithMultipleClientsWithDataRequests");
final Random rnd = new Random();
final Counter totalCounter = new Counter();
final Counter requestCounter = new Counter();
final ... |
48fb869e-5e28-4d32-a608-ada7a7640b5c | 0 | public void pushTimesOperator(){
((Vector)operatorStack).add(0, new TimesOperator());
} |
c96265b1-d168-43d3-a2c9-b21cbb6727f4 | 3 | public static void main(String[] args) throws Exception{
workbook = new ExcelReader("TestSuite.xlsx");
for(int i=1;i<workbook.getRowCount("Main");i++){
if(workbook.getCellStringData("Main", i, 1).toLowerCase().equals("true")){
Reporter.startReport(workbook.getCellStringData("Main",i,0));
LOGGER.debug("E... |
9a0f6ade-2a06-4b89-8fde-fd51ec8423ec | 6 | @Override
public void mouseEntered(MouseEvent e)
{
if (e.getSource() == sideButtons[0]) {
sideButtons[0].setText("Begin!");
} else if (e.getSource() == sideButtons[1]) {
sideButtons[1].setText("Conquor!");
} else if (e.getSource() == sideButtons[2]) {
sideButtons[2].se... |
037703d9-cc62-4703-8277-49c1a708ebd3 | 7 | public void PasswdCardInserted(CardActionEvents ce) {
System.out.println("Inserted passwd manager card.");
long timeElapsed = 0;
try {
BasicService service = ce.getService();
service.open();
Reader reader = new Reader();
if (service != null) {
PasswdEnterDialog passwd = new PasswdEnterDialog(reade... |
ea077b9d-736a-45d5-b4f9-d57a41852b4d | 0 | public void setLastAccessTime(long lastAccessTime) {
this.lastAccessTime = lastAccessTime;
} |
dedd0405-e73d-4c38-84a4-4b2aa5be8239 | 4 | private void parseTruthTable(Gate cur_gate) throws ParseError {
int out_bit;
// expecting 2^ninput output bits (0/1)
for (int i = 0; i < (1 << ninputs); i++) {
out_bit = parseToken(false);
if ((out_bit != 0) && (out_bit != 1)) {
throw new ParseError("Par... |
9cf9d176-2f98-4ff2-b1eb-73227ddb1bea | 3 | public void stopGame() {
// Setting isRunning to false will
// make the thread stop (see run())
this.isRunning = false;
// Unset the game model...
this.view.setModel(null);
// Stop listening for events
this.view.removeKeyListener(this.keyListener);
// Make sure we wait until the thread has stopped...... |
7e8044c1-543f-48f5-bba3-f7a82ed63349 | 5 | public boolean isTrue()
{
switch (operator)
{
case EQUAL_TO:{
return firstProperty.getValue().compareTo(( secondProperty.getValue() )) == 0;
}case GREATER_OR_EQUAL_TO:{
return firstProperty.getValue().compareTo(( secondProperty.getValue() )) >= 0;
}case GREATER_THAN:{
return firstProperty.get... |
3c4ed80f-b2f3-4b98-8d9c-ebdd9f6a40b8 | 3 | public JPanel createLogTablePanel() {
int size = w.getDeposits().size() + w.getWithdraws().size();
transitions = new String[size][4];
tableHeaders = new String[4];
tableHeaders[0] = "Type";
tableHeaders[1] = "Amount";
tableHeaders[2] = "Reason";
tableHead... |
f136d5f8-81da-4eee-8a5c-3da444766453 | 4 | public static ZMsg load(DataInputStream file) {
if (file == null)
return null;
ZMsg rcvMsg = new ZMsg ();
try {
int msgSize = file.readInt();
if (msgSize > 0) {
int msgNbr = 0;
while (++msgNbr <= msgSize) {
... |
e76c211c-05df-49b0-9104-a6cad208d60f | 0 | @Override
public Item copyItem() {
return weaponItem;
} |
fffb9d7e-a768-46ab-b256-6662bf22664b | 1 | public ZombieWalrus(MonsterManager mm, Registry rg, String im, String st, int x, int y, int minDist, int maxDist) {
super(mm, rg, im, st, x, y, minDist, maxDist, false);
name = "ZombieWalrus";
displayName = "Zombie Walrus";
monsterManager = mm;
difficultyFactor = 0.80f;
... |
7e3e923e-d0ab-4719-a0df-21e02c5d03f6 | 3 | private void doLogin() {
if (tfPassword != null && tfUser != null) {
if (takeLogin()) {
MainFrame frame = new MainFrame(userLoggedIn);
PanelHelper.setMainFrame(frame); // set the currently active Mainframe
frame.initMainFrame(); // init the mainframe w... |
8cb42727-9023-46d2-9ad4-d6dcb55d32c0 | 9 | public void randomlyInitializeParams()
{
//initializes the initial state parameters
double dsum = 0;
probinit = new double[numstates];
for (int ni = 0; ni < probinit.length; ni++)
{
probinit[ni] = theRandom.nextDouble();
dsum += probinit[ni];
}
for (int ni = 0; ni < probinit.length; ni++)
{
... |
15d4ee5b-5165-4376-bdf5-431533c14cd7 | 2 | @Override
public void changedQLFiles(File[] files){
int i = 0;
for(JButton btn : quick_btns){
if(files[i] != null){
FileSystemView fsv = FileSystemView.getFileSystemView();
Icon ico = fsv.getSystemIcon(files[i]);
btn.setText("");
btn.setToolTipText(files[i].getName() + " - Drag somthing here OR... |
5871d709-5930-46b4-92f9-2e3f0cf15bab | 2 | public void volcarDatos(ArrayList<Prestamos> rows){
DefaultTableModel model = (DefaultTableModel) jTable1.getModel();
while(model.getRowCount()>0)model.removeRow(0);
for(Prestamos row : rows){
Object[] fila = {
row.getFecha(),
row.getEstado(), ... |
30527c74-3320-4df4-99e2-7e8b698f3384 | 5 | */
public Dval insertDvalRec()
{
if( getDvalRec() != null )
{
return getDvalRec();
}
Dval d = (Dval) Dval.getPrototype();
d.setSheet( this );
int insertIdx = win2.getRecordIndex() + 1;
// correct position for DV block is before sheet protection records (if any)
// or before EOF
int opc = ((BiffRe... |
5425ae1c-fc36-4fa1-b620-28fe048cb442 | 2 | public static void main(String[] args) {
// wap to check if no is armstrong
int j=371,sum=0,rev=0;
int num2=j;
while(j>0){
rev=j%10;
sum=sum+rev*rev*rev;
j=j/10;
}
if(num2==sum)
{
System.out.println("the entered number is armstrong "+num2);
}
else{
System.out.println("the no is not armstrong");
}
} |
1296eda9-66f3-49cc-8014-e0fb29015142 | 0 | public void destroy() {
textArea = null;
} |
1e17c1b6-f78d-4332-a335-55c518d03ff5 | 3 | @Override public Palikka haePalikka(Sijainti sijainti)
{
try {
for(Palikka palikka : palikat)
if(/*palikka != null &&*/ ((TetriminoPalikka)palikka).sijainti().equals(sijainti))
return palikka;
} catch(ConcurrentModificationException e) {}
... |
c546876a-b9bc-48fe-ab62-7bbd8659268b | 9 | @SuppressWarnings("unchecked")
public Constructor<T> constructor(Object... args) {
try {
if (null == args || args.length == 0) {
Constructor<T> c = clazz.getDeclaredConstructor();
if (!Modifier.isPrivate(c.getModifiers())) {
return c;
}
}
Class<?>[] argTypes = Lang.evalToTypes(args);
... |
d178478a-e5ca-44f3-818a-46114df5ccbc | 9 | public String aplyTo(final String source)
{
// false = 0;
// true = 1;
if(null == source)
{
return null;
}
final Vector<Boolean> bits = getBitsFromString(source);
String res = "Found " + bits.size() + " bits / " + bits.size()/8 + " bytes in Data !... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.