method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
46690546-2e71-419f-bbdb-93ce8bb1f5dd | 8 | private void getActionsResults(String actionItem) {
titleDLM.removeAllElements();
switch (actionItem) {
case "Claims":
getClaimList();
break;
case "Sub Claims":
getSubClaimList();
break;
case "Evidence":
getEvidenceList("evidence");
break;
case "Counter Claims":
getCounterClaimList();
... |
9ac71257-bfde-4f8c-8647-1e9eab5601ac | 7 | public boolean containsPrefix(String s) {
if(dictArray.isEmpty()){
return false;
}
boolean searching = true;
int start = 0;
int end = dictArray.size();
while (searching)
{
int mid = (end + start) / 2;
int comparison;
if (dictArray.get(mid).length() >= s.length()) {comparison = s.compareToIgnoreCase(d... |
aeffe414-b0cf-464e-9f58-e2e30f73e2f8 | 9 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
final ReadAccessSpecification other = (ReadAccessSpecification) obj;
if (listOfProper... |
cb93598d-1a1e-4726-9663-214e6042d537 | 6 | protected void updateDisplay() {
LinkedList<Student> visibleStudents = new LinkedList<Student>();
if (showAll)// ʾѧ?
visibleStudents = students;
else if (filterByName) {// ʾnameOrNoѧ
for (Student stu : students)
if (nameOrNo.equals(stu.name))
visibleStudents.add(stu);
} else {// ʾѧnameOrNoѧ
f... |
ece965df-afff-47ed-8ec1-fe41bb2da617 | 3 | public static void sendScore() {
try {
if (isWorldScorePosted(Game.currentGame.worldCreated)) {
JOptionPane.showMessageDialog(null, "Du hast deinen Punktestand auf dieser Karte bereits in der Bestenliste platziert!", "Bereits platziert!", JOptionPane.ERROR_MESSAGE);
return;
}
String response = He... |
cbd321fe-b041-4dfd-8283-46bb43d4c8a6 | 9 | int editDistanceLesserSpace(String s1, String s2){
if(s1==null && s2==null)
return 0;
else if(s1==null)
return s2.length();
else if(s2==null)
return s1.length();
else {
int l1 = s1.length();
int l2 = s2.length();
int... |
a8be1f30-83e9-4d77-a743-9e9cac037199 | 7 | public int compareTo(Segment o) {
if(this.direction != o.direction){
if(this.direction == Direction.VERTICAL) return 1; else return -1;
} else{
if(this.direction == Direction.HORIZONTAL){
if(this.start.y != o.start.y) return (this.start.y - o.s... |
2181aa47-7def-4701-970c-b89367a794ba | 8 | Binding getBinding0(char[] name, int mask) {
Binding binding;
if ( (mask&(Binding.VARIABLE|Binding.FIELD))!=0)
{
binding=getBinding1(name,Binding.VARIABLE|Binding.FIELD);
if (binding!=null)
return binding;
}
if ( (mask&(Binding.TYPE))!=0)
{
binding=getBinding1(name,Binding.TYPE);
if (binding!=null)
... |
9e3a6275-1b49-4acc-9e6f-7672b62257e8 | 6 | public static BigDecimal subgraftetthet(boolean[][] nabomatrise, int startnode, int len){
int antallKanter = 0;
int antallNoderMed = 0;
noderMed = new boolean[len];
dfs(nabomatrise, startnode, len);
for (int i = 0; i < len; i++) {
if (noderMed[i]) continue;
antallNoderMed++;
boolean[] row ... |
bb838a13-35bb-41a5-b081-40938f235c60 | 4 | public boolean checkRow(int row) {
int count = 0;
for(int i = 1; i < 10; i++) {
count = 0;
for(int j = 0; j < 9; j++) {
if(i == Integer.parseInt(entries[row][j].getText())) {
count++;
}
if( count >= 2) {
System.out.println("checkRow() returned false at i: " + row + " j: " + j + " with " ... |
8ca9ec64-7f1f-4dda-a9f0-45a81864f258 | 4 | public void writeTypesArray(Object[] array) {
// A big ol' case statement in a for loop -- what's polymorphism mean,
// again?
// I really wish I could extend the base classes!
for (int i = 0; i < array.length; i++) {
if (array[i] == null) {
} else if (Boolean.TRUE.equals(array[i])) {
// Create a way... |
a4497a21-2162-4594-ad6e-906d8505dc1f | 3 | private void push(Queue<SimNode> que, int itemID, double sim, int k) {
SimNode t = new SimNode(itemID, sim);
if (que.size() >= k && que.peek().getSim() < sim) {
que.poll();
que.add(t);
} else if (que.size() < k) {
que.add(t);
}
} |
dd9002e1-6e73-4504-851a-b0a15b0ddd6e | 8 | protected void readSegment() throws IOException {
DataInputStream dataIn = new DataInputStream(in);
try {
// ensure that segment header is valid
// and read it (segment size and frequency table
int magic = dataIn.readInt();
if (magic != HuffmanConsts.HUFFMAN_MAGIC1) {
throw new IOException("Can't... |
81578a30-7732-47da-a863-406ad30d0dbc | 3 | public JSONWriter array() throws JSONException {
if (this.mode == 'i' || this.mode == 'o' || this.mode == 'a') {
this.push(null);
this.append("[");
this.comma = false;
return this;
}
throw new JSONException("Misplaced array.");
} |
05c481d9-c08d-4b75-bc33-293d493f9e99 | 7 | public byte[] decrypt(byte[] textEncrypted, String key){
byte[] decrypted = null;
try{
//keygenerator.init(bits); // 192 and bits bits may not be available
byte[] keyPadded = new byte[bits / 8];
for(int i = 0; i < bits / 8 && i < key.length(); i++){
keyPadded[i] = (byte)key.charAt(i);
}
/*... |
49fbbca8-9e36-4faf-beab-07108843132b | 3 | public static String getRetType(String desc) {
int i = desc.indexOf(')');
if (i < 0)
return "java.lang.Object";
char c = desc.charAt(i + 1);
if (c == '[')
return desc.substring(i + 1);
else if (c == 'L')
return desc.substring(i + 2, desc.lengt... |
9651f891-3428-4fa5-b2ef-ca5fcb788405 | 3 | public HashMap<String, Integer> getPartialFrequenzies(
HashMap<String, String> partialDecitions) {
HashMap<String, Integer> result = new HashMap<String, Integer>();
for (String key : frequenzy.keySet()) {
result.put(key, 0);
}
for (HashMap<String, String> row : rows) {
if (includes(row, partialDecition... |
1f81362b-4ba4-4f13-8cdf-031c705fa665 | 2 | public static void main(String [] args){
int sumOfSquares = 0;
int squareOfSum = 0;
int sum = 0;
for(int i =1; i<=100; i++){
sumOfSquares = sumOfSquares + (i*i);
}
for(int j = 1; j<=100; j++){
sum = sum + j;
}
squareOfSum = sum*sum;
System.out.println("Sum of Squares is: " + sumOf... |
8f33499b-750b-42f2-aa69-ee8820b973ba | 8 | void close() throws IOException {
if (!dirty.isEmpty()) {
commit();
}
txnMgr.shutdown();
if (!inTxn.isEmpty()) {
showList(inTxn.valuesIterator());
throw new Error("In transaction not empty");
}
// these actually ain't that bad in a pr... |
09b2ae89-f3a1-434e-b771-f60f4cc0470b | 8 | public String play(String me, String him){
int myAmmo = findAmmo(me);
int hisAmmo = findAmmo(him);
//Start
if(me.length() == 0){ return "R";}
if(me.length() == 1 || me.length() == 2){ return "B"; }
if(me.length() == 3){ return "R"; }
//reload if empty, and just shot at
if(myAmmo < 1 && him.char... |
f274fa17-b8a2-40a3-897d-75e06d605361 | 5 | public static Object runPzConverter(final Properties classXref, final String value, final Class<?> typeToReturn) {
final String sConverter = classXref.getProperty(typeToReturn.getName());
if (sConverter == null) {
throw new FPConvertException(typeToReturn.getName() + " is not registered in p... |
82ef43dc-a93d-45ac-be2c-a3164a902844 | 1 | public ArrayList<Card> drawN(int n){
ArrayList<Card> cards = new ArrayList<Card>();
for(int i = 0; i < n; i++)
cards.add(this.cardList.remove(0));
return cards;
} |
0b815663-c19f-495d-a7fd-32cd32879df7 | 1 | public void setInEditor(boolean b)
{
if (inEditor)
level.Save_Level();
else
level.setWaypoints(waypoints.getWaypoints());
inEditor = b;
level.setInEditor(b);
} |
77cd605f-5196-455e-be2f-185d0c0ea142 | 8 | public void removeDownload(final int gid) {
// Deletion of download is different for different sates
switch (downloads.get(gid).getStatus()) {
case COMPLETE:
case ERROR:
case REMOVED:
taskManager.removeDownloadResult(gid);
break;
case NEW:
... |
5e2c8e9c-00f1-4a3d-b19d-0de86c5bf91d | 8 | public static void countMatches(double minIDF, double minTFIDF) {
allDocPairs.clear();
Iterator it2 = dictionaryMap.entrySet().iterator();
while (it2.hasNext()) {
Map.Entry termEntry = (Map.Entry) it2.next();
String token = (String) termEntry.getKey();
ArrayL... |
bd6e35b7-7e4e-41a3-bae9-ad6b25a2c222 | 7 | void jButton_postjson_actionPerformed(ActionEvent e) {
try {
String imapName = imageMap.getName();
String response = null;
String postdata = null;
boolean success = false;
//while (!success) {
if (imageMap.getId() < 0 ||
imageMap.getName() == null ||
imageMap.getName().equalsIgnoreC... |
69fe6ac6-76d6-48bc-ab25-a8a8877f52f0 | 7 | public boolean isEnabled(JMenuItem pItem, Action pAction) {
String hookName = ((NodeHookAction) pAction).getHookName();
logger.fine("Enabled for " + hookName);
if (SearchInMapForNodeTextAction.NODE_CONTEXT_PLUGIN_NAME
.equals(hookName)) {
return true;
}
... |
078b818f-5add-4bf1-bcfb-f5bcd2bc9b92 | 5 | private boolean BuildingInRange(units.Base unit) {
for (int i = 0; i < unit.map.size(); i++) {
for (buildings.Base bld : Game.builds) {
if (bld.owner!=unit.owner) {
if (bld.x == unit.map.get(i).x && bld.y == unit.map.get(i).y) {
building = unit.map.get(i);
return true;
}
}
}
}
... |
0477ec55-6fd7-40a4-bc9c-efdffa552584 | 8 | public ArrayList<Organism> getOthersWorld(int x,int y,String wor)
{
ArrayList<Organism> end=new ArrayList<>();
for(int i=0;i<organisms.size();i++)
{
if((organisms.get(i).getX()<=x+8)&&(organisms.get(i).getX()>=x-8))
{
if((organisms.get(i).getY()<=y+8)&&(organisms.get(i).getY()>=y-8... |
c204b2dd-5886-4eb6-a2b5-cbb6d32bc857 | 0 | public void setEncargo(Encargo encargo) {
this.encargo = encargo;
} |
65971785-fa1d-4c46-b58c-3626e5ff2e21 | 4 | public static void validateProfileReq(ProfileRequest profileRequest)
throws BeanstreamApiException {
Gateway.assertNotNull(profileRequest, "profile request object is null");
Card card = profileRequest.getCard();
Address billing = profileRequest.getBilling();
Token token = profileRequest.getToken();
if (... |
e0e61502-5cfa-4e41-8bb5-f510278a4b88 | 9 | @Override
public void onChange(String imsi, int days, int daysThreshold) {
if (days >= daysThreshold) {
if (!workers.contains(imsi)) {
workers.add(imsi);
if (tourists.contains(imsi)) {
tourists.remove(imsi);
listener.removeT... |
06d6a58c-6872-45a1-9353-950184b839af | 2 | public Boolean login(String login, String pwd) throws SOAPException {
// Create SOAP Connection
SOAPConnectionFactory soapConnectionFactory = SOAPConnectionFactory.newInstance();
SOAPConnection soapConnection = soapConnectionFactory.createConnection();
// Send SOAP Message to SOAP Serv... |
a43ab2e4-0d13-440f-a408-60f3dc6bde9e | 8 | void renderScene(char[][] gameMap, Graphics g) {
// gameMap is not matrix indexed, instead, the first index is the x value, the 2nd is the y value
int sizeX = gameMap[0].length;
int sizeY = gameMap.length;
for(int i=0; i<sizeY; i++) { // i is x positions
for(int j=0; j<sizeX; j++) { // j is y positions
... |
806e4955-ba00-4a57-b8b9-5f7aef43c258 | 8 | public static final Color checkAlphaColour(int red, int green, int blue, int alpha)
{
if (red < 0)
red = 0;
else if (red > 255)
red = 255;
if (green < 0)
green = 0;
else if (green > 255)
green = 255;
if (blue < 0)
blue = 0;
else if (blue > 255)
blue = 255;
... |
fdc0f7f3-ff7b-404d-a176-ffb176cb2261 | 5 | private void method89(SceneObject object) {
int i = 0;
int j = -1;
int k = 0;
int l = 0;
if (object.anInt1296 == 0) {
i = sceneGraph.getWallObjectUid(object.anInt1295, object.anInt1297, object.anInt1298);
}
if (object.anInt1296 == 1) {
i = ... |
7a46d3f1-605f-47bb-a1fb-860cf860e75f | 9 | @Override
public synchronized ResultMessage delGoodsClass(long id) {
if(!this.goodsClassCanDel(id)) return ResultMessage.delete_failure;
ArrayList<GoodsClassPO> child = new ArrayList<GoodsClassPO>();
gcIter = goodsClassList.iterator();
GoodsClassPO gc;
GoodsClassPO thisPO = null;
while(gcIter.hasNext())... |
26515cee-2f5f-4a16-b3cc-a288317ef526 | 8 | private boolean parseResponseStatusLine() {
// Are there header lines at all?
if( this.list.size() == 0 )
return false;
// Try to locate the header beginning AT THE END
// (usually the latest headers were added to the end of the list, and so
// if there are duplicates the latest one override the predecess... |
73835675-44ff-45bc-beaf-af2a44f4369e | 9 | private void button4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_button4ActionPerformed
if (order1code3tf.getText().equals("1001"))
{
o1c3destf.setText("Chicken Nugget");
}
if (order1code3tf.getText().equals("1002"))
{
o1c3de... |
642d412c-c351-4731-b21f-e1446daec69c | 6 | @Override
public boolean equals(Object obj)
{
if (this == obj)
{
return true;
}
if (obj == null)
{
return false;
}
if (this.getClass() != obj.getClass())
{
return false;
}
Transition other = (Transition) obj;
if (this.character != other.character)
{
return false;
}
... |
383aa711-38da-4f9c-8b68-ac84efaccece | 8 | protected void toggleDiagonals(int row, int col, List<Piece>[][] cells, int n, boolean b){
int i = row;
int j = col;
while (i >= 0 && j >= 0){
addOrRemoveAsEating(i, j, cells, b);
i--;
j--;
}
i = row;
j = col;
while (i < n && j ... |
0672dc89-351e-4a8c-bffd-2f0192906b7f | 7 | public static String timeToString3(Date date) {
if (date == null)
return "无";
long milliSecond = System.currentTimeMillis() - date.getTime();
int ss = 1000;
int mi = ss * 60;
int hh = mi * 60;
long day = hh * 24;
long month = day * 30;
long year = month * 12;
long years = (milliSecond) / year;
l... |
840dbc43-4217-42a4-a9fa-6ed739868905 | 2 | public String sayHello ()
{
org.omg.CORBA.portable.InputStream $in = null;
try {
org.omg.CORBA.portable.OutputStream $out = _request ("sayHello", true);
$in = _invoke ($out);
String $result = $in.read_string ();
return $result;
... |
61337938-5f93-471d-bb6a-be5404b50457 | 0 | public String getArea() {
return area;
} |
78b05310-997c-4851-b14d-3eef28b81e46 | 8 | private boolean r_postlude() {
int among_var;
int v_1;
// repeat, line 75
replab0: while(true)
{
v_1 = cursor;
lab1: do {
// (, line 75
... |
020d473f-6071-426a-b947-337f3be185d8 | 6 | public static ClassFile Load(String fileName) throws ClassFileLoaderException, FrameException
{
DataInputStream mainInput = getMainInputStream(fileName);
ClassFile classFile;
try
{
classFile = new ClassFile();
classFile.setMagic(mainInput... |
25c65089-38f4-47ce-a485-413fc7bf7b8f | 4 | public static void setEarliestAndLatest(ArrayList<Tache> taches){
ArrayList<Tache> start = new ArrayList<Tache>();
for(Tache tache : taches){
if(tache.getDependances() == null){
tache.setDatePlusTard(tache.getDuree());
tache.setDatePlusTot(tache.getDu... |
c272bf4c-eed4-4352-bb88-d3cfabe91756 | 1 | @Override
public void closeRequestSession() {
SqlSession session = thSession.get();
if (session != null) {
try {
session.close();
} finally {
thSession.remove();
}
}
} |
64c5aca2-c67e-46d5-9900-420b86817aed | 5 | private void InitializePlugins()
{
Grizzly.WriteOut("");
for(File Plugin : PluginsList)
{
try
{
Configuration PluginConfig = new Configuration();
PluginConfig.Load((Grizzly.class.getProtectionDomain().getCodeSource().getLocation().getPath() + "plugins").replace("/bin", "") + "/plugin.prope... |
328f2620-6569-48c8-b0ab-894e40c063ab | 4 | public boolean showPlayer(Player player) {
if (!this.hiders.contains(player)) return false;
//Event
ShowPlayerEvent event = new ShowPlayerEvent(player);
Bukkit.getPluginManager().callEvent(event);
if (event.isCancelled()) return false;
this.hiders.remove(player);
for (Player p : Bukkit.getOnlinePlay... |
7c9f3cfa-39fb-4e85-85e3-6294cdb8f235 | 0 | public void setRegtime(Timestamp regtime) {
this.regtime = regtime;
} |
c459c5dd-7302-4323-a5ac-e97e01099cb4 | 2 | private void btnEliminarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEliminarActionPerformed
int res = JOptionPane.showConfirmDialog(
this,
"Seguro que deseas eliminar el personal",
"Advertencia",
JOptionPane.YES_NO_OPTION
);
... |
3c2f53c6-f059-4113-a8a5-8390e0b9d6ea | 7 | @Override
public boolean tick(Tickable ticking, int tickID)
{
if((!super.tick(ticking,tickID))||(!(affected instanceof MOB)))
return false;
final MOB M=(MOB)affected;
if(M==null)
return false;
final Room R=CMLib.map().roomLocation(M);
if(R==null)
return false;
int ct=0;
synchronized(singers)... |
9db76569-5478-4d0c-b659-bb36d3ef67dd | 7 | private Szo fonevRagozastVegignez(Mondat mondat, List<Szo> potencialisSzavak, FonevRag targyRag) {
Szo ret = null;
//TODO refactor az egeszet, hatalmas ganyolas
List<FonevRag> birtokosok = new ArrayList<>();
birtokosok.add(BIRTOKOS_EGYES_SZAM_ELSO_SZEMELY);
birtokosok.add(BIRTOKO... |
07013273-3d49-42fc-a807-35f529a35915 | 8 | @Override public Object read(JsonReader in) throws IOException {
JsonToken token = in.peek();
switch (token) {
case BEGIN_ARRAY:
List<Object> list = new ArrayList<Object>();
in.beginArray();
while (in.hasNext()) {
list.add(read(in));
}
in.endArray();
return list;
... |
ed52e60d-5a3c-4d60-ab8d-e817ffccad37 | 6 | private void addRelations(Element parent, Relations relations) {
if (relations == null || relations.isEmpty())
return;
Element relationsNode = doc.createElementNS(getNamespace(), DefaultXmlNames.ELEMENT_Relations);
parent.appendChild(relationsNode);
Set<ContentObjectRelation> set = relations.exportRela... |
e9091590-3190-4b0f-9651-cf51720f0421 | 1 | public void paintComponent(Graphics g)
{
g.setColor(Color.black);
g.drawArc(centerX-Peg.width*2, centerY-Peg.height*2, Peg.width*4, Peg.height*4, -45, 270);
String text;
if (type == 0) { // clockwise
// get the points by the ellipsis equation
int arrowX = (in... |
4c09750b-baa6-475e-acbb-3bd51150046b | 4 | public void setCRCData(byte[] CRCData) throws IllegalStateException
{
if (!extendedHeaderPresent)
throw new IllegalStateException("CRC Data may not be set in the ID3v2.3 extended tag header when the extendedHeaderPresent flag is false.");
if (CRCData == null || CRCData.length == 0)
{
... |
b023d019-0f8d-46e0-8440-c7dec93e7e4b | 9 | @Override
public int iterate() throws Exception {
// make sure we have a page to render
if (this.page == null) {
return Watchable.COMPLETED;
}
// check if this renderer is based on a weak reference to a graphics
// object. If it is, and the graphics is no longer va... |
8e3ab197-183c-480e-85d6-ea61ee82550a | 4 | private Point getComputersSelection() throws Connect4Exception {
Point coordinate;
try {
coordinate = this.findWinningLocation(game.getCurrentPlayer());
if (coordinate != null) { // winning location found for computer
return coordinate;
}
... |
564859a5-2319-4212-80cb-b2cdda465477 | 9 | private static HashSet<String> getTaxaToInclude(OtuWrapper rdpWrapper, OtuWrapper krakenWrapper,
OtuWrapper kraken16SWrapper,HashSet<String> samples)
throws Exception
{
HashSet<String> taxa = new HashSet<String>();
taxa.addAll(rdpWrapper.getOtuNames());
taxa.addAll(krakenWrapper.getOtuNames());
taxa.ad... |
253bcb64-59fd-49ae-92ca-2f3aea4fe969 | 1 | public static boolean isSetter(String name){
if(name.contains("set"))
return true;
else return false;
} |
ccab01f5-497d-4cc3-8d8d-9d7e8892d712 | 2 | boolean checkForChannel(String cname) {
boolean returned = false;
for (Channel c: channels) {
if (c.getName().equals(cname)) {
return true;
}
}
return false;
} |
18b7b063-2714-4434-a429-40317b0277ff | 4 | private void init(){
running = true;
mapheight= 6000;
mapwidth = 6000;
debugInfo = false;
double toRadian = Math.PI/(180*trigScale);
sin = new float[(90*trigScale) + 1];
for(int i=0;i<sin.length;i++){
sin[i] = ((float)Math.sin(((double)i) * toRadian));
}
//cosine
cos = new float[(90*t... |
ddc316fb-8d6e-47d3-b1f1-9d61054995a3 | 5 | public static void initialize() throws VersionIncompatibleException {
if (initialized) {
return;
}
try {
version = Integer.parseInt(Character.toString(PackageType.getServerVersion().charAt(3)));
if (version > 7) {
enumParticle = PackageType.MINECRAFT_SERVER.getClass("EnumParticle");
}
... |
6b237322-d230-49bf-8dc1-322464b994fc | 0 | public void setTickets(Ticket[] value) {
this._tickets = value;
} |
954f2804-6da3-465b-b4f9-0dd1ff9ed376 | 3 | public String get(final String key) {
if (deleted.get().contains(key)) {
return null;
}
if (diff.get().containsKey(key)) {
return diff.get().get(key);
}
readLock.lock();
try {
if (old.containsKey(key)) {
return old.get... |
9afdbbf8-5951-4372-9716-ecf0b2f3ee3a | 7 | public ClientConnection() {
InetAddress serverAddress = null;
try {
serverAddress = InetAddress.getByName(addressToServer);
} catch (UnknownHostException e1) {
e1.printStackTrace();
}
try {
connection.connect(serverAddress, remotePort);
} catch (SocketTimeoutException e) {
e.printStackTrace();
... |
aa6cd36d-d99e-497e-80a6-2b0d5a32f723 | 1 | public boolean isPickUpAble() {
return !isActive() && !this.isExploded();
} |
dcf6ed78-2f33-43d6-bc32-155182842312 | 0 | public void setMemoryLimit(Integer memoryLimit) {
this.memoryLimit = memoryLimit;
} |
ab4b9b97-6eb8-41b9-a262-2a00e015998e | 6 | private boolean solveEnvHasOneUnknownCardInGroup(int l, int r)
throws ContradictionException {
boolean tableModified = false;
int minuses = 0;
for (int i = l; i < r; ++i) {
if (table[i][ENV_COL] == Resolution.Minus) {
++... |
04b11f99-bc54-4a58-a6d4-d622fc3108c3 | 0 | @Test
@TestLink(internalId=1)
@Ignore("Just ignore this")
public void testIgnored() {
assertTrue(true);
} |
fc0bcc77-9d5b-44de-9f84-d5e7407b4b6c | 8 | private int readByte(int data, long cycles,
boolean restart, boolean timeout) {
boolean dataOut = (data & SERIAL_DATA_OUT) != 0;
boolean clkOut = (data & SERIAL_CLK_OUT) != 0;
if (restart) {
// Set everything to "low" and go...
rbCtr = 0;
rbByte = 0;
rbState = WAIT_BIT;
... |
d7ced819-3ac8-4613-9b01-cfaa23bbffc3 | 1 | public void testWithPeriodType3() {
Period test = new Period(1, 2, 3, 4, 5, 6, 7, 8, PeriodType.standard());
try {
test.withPeriodType(PeriodType.dayTime());
fail();
} catch (IllegalArgumentException ex) {}
} |
f67c9537-3082-41fd-acac-6f31b40c9326 | 2 | public static List<List<Double>> transposition(List<List<Double>> A) {
List<List<Double>> T = new ArrayList<List<Double>>();
for (int i = 0; i < A.get(0).size(); i++) {
List<Double> temp = new ArrayList<Double>();
for (int j = 0; j < A.size(); j++) {
temp.add(A.g... |
6de30b47-797f-40dd-b38d-697dff5f0206 | 1 | @Override
public void setGoTo(String []goTo) {
goToList.clear();
for(int i=0;i<goTo.length;i++)
{
goToList.add(goTo[i]);
}
} |
3bfc4408-89cf-455d-819b-69140dce7f2f | 5 | private void downloadJar (MapRedTask task, String jid) throws IOException {
try {
Registry NameNodeR = LocateRegistry.getRegistry(Hdfs.Core.NAME_NODE_IP, Hdfs.Core.NAME_NODE_REGISTRY_PORT);
NameNodeRemoteInterface NameNodeS = (NameNodeRemoteInterface) NameNodeR.lookup(Hdfs.Core.NAME_NODE_SERVICE_NAME);
... |
cac87605-c406-4418-812f-4894f1efc121 | 6 | public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://down... |
38d27d23-6ebf-4147-95e8-eccfb17441c7 | 5 | public void filterFileList(String projID){
fileResultList = fileService.readAll();
//System.out.println(fileResultList.size());
String currentID="";
int i = 0;
while(i < fileResultList.size()) {
try{
currentID = fileResultList.get(i).getColumnData(1);
if(!projID.equals(currentID))
{
fil... |
731658e7-ea98-43ba-9ef2-62491595cb2a | 0 | public String getMinorVersion() {
return minorVersion;
} |
435ae5cb-868a-4084-b8e8-0f638e85369a | 8 | public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String line = "";
do {
line = in.readLine();
if (line == null || line.length() == 0 || line.equals("0"))
break;
int[] sizer = retInts(line);
int[] front = retInts(i... |
32b2515b-2739-4f47-9bc7-057278b3c61a | 9 | protected void createContents() {
shell = new Shell();
shell.setImage( iconProgramOffline ); //$NON-NLS-1$
shell.setSize(711, 655);
prefs = Preferences.userNodeForPackage(this.getClass());
FkManager.getInstance().sortById( prefs.getBoolean(PREF_SORT_BY_ID_KEY, false) );
mySelf = this;
shell.setLayout... |
91ace0d1-b8c8-4e56-ba2b-e2cc7c935dda | 6 | public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://down... |
6af3918c-18b2-431c-a75b-458c788c1bc4 | 2 | public void setEventAsRepeating(String identifier)
{
for(Event e: events){
if(e.getIdentifier().equals(identifier))
e.setEventAsRepeating();
}
} |
84fe364e-5e14-4844-a91b-094c22587b7e | 3 | @Test
public void test_solvable_matrix_size_2_solve2() throws
ImpossibleSolutionException,UnsquaredMatrixException,
ElementOutOfRangeException{
int height=2;
int width=2;
float[][] matrix;
float[] resultVector;
float[][] knownMatrix = new ... |
cd77d577-5052-4c02-b98a-e722927e8f7e | 8 | public Frame2() {
try{
Class.forName(JDBC_DRIVER);
conn = DriverManager.getConnection(DB_URL,USER, PASS);
statement = conn.createStatement();
}catch(SQLException se){
se.printStackTrace();
}catch(Exception e){
e.printStackTrace();
}
setTitle("Blok A, 1 - 23");
setDefaultCloseOperation(JFram... |
d70f0aca-3c02-4755-ba8c-948f01e3197c | 8 | public static DecisionStump buildStump(List<DataEntry<double[], Integer>> data_set, double[] weight){
int M = data_set.size();
int N = data_set.get(0).data_vec.length;
int[] labels = new int[M];
for(int i=0;i<M;i++){
labels[i] = data_set.get(i).label;
}
DecisionStump ret_stump = new DecisionStump();
do... |
602dc268-01ab-4788-b794-1b2a2465f50e | 0 | public Set<String> getWorlds() throws DataLoadFailedException {
return dataHolder.getWorlds();
} |
6cd0a234-7fff-4728-bd2d-e88b236432fd | 1 | private final void r(String s) { if (m() > 0) setto(s); } |
8b66fcb6-ab31-4014-af30-737f3e7edc19 | 8 | private void timer() {
for (World w : gmtWorlds) {
String name = w.getName();
// only switch if there are players in the world
if (gmtPlayerCount.containsKey(name)) {
Long now = w.getTime();
Long time = getConfig().getLong("worlds." + w.getName... |
fdad9873-59bd-40b5-b1ab-1aef75882b2f | 1 | @Override
protected Dimension getSizeSelf(LayoutSize type) {
if (mOnlyPreferredSize) {
type = LayoutSize.PREFERRED;
}
return type.get(mComponent);
} |
1e131d2d-3cc8-4abf-a17c-54505eb092cc | 4 | protected static Ptg calcOct2Dec( Ptg[] operands )
{
if( operands.length < 1 )
{
return new PtgErr( PtgErr.ERROR_NULL );
}
debugOperands( operands, "OCT2DEC" );
long l = (long) operands[0].getDoubleVal(); // avoid sci notation
String oString = String.valueOf( l ).trim();
// 10 digits at most (=30 bits... |
d227cb7f-eafd-4808-b010-f79a1f002ebb | 8 | @Override
public void affectPhyStats(Physical affected, PhyStats affectableStats)
{
super.affectPhyStats(affected,affectableStats);
if((newRace!=null)&&(affected instanceof MOB))
{
affectableStats.setSensesMask(affectableStats.sensesMask()|PhyStats.CAN_NOT_SPEAK);
affectableStats.setName(CMLib.english().s... |
edc36b2b-6340-4fd7-b23f-85a7d19de9bb | 7 | public static void main(String[] args) {
int counter = 1;
long startTimeMillis = System.currentTimeMillis();
boolean c1 = false, c2 = false, c3 = false, c4 = false;
while((c4 = getDistinctPrimeFactors(counter+3).size() != 4) ||
(c3 = getDistinctPrimeFactors(counter+2).size() != 4) ||
(c2 = getDis... |
4ca45fd3-3a54-4972-a696-94f0fa7512b5 | 4 | public Room changeRoom(String name){
for (Cine movieTheatre : movieTheatres) {
if(movieTheatre.getName().equals(name)){
return movieTheatre;
}
}
for (Theatre theatre : theatres) {
if(theatre.getName().equals(name)){
return theat... |
ced3c31b-58c2-47a6-854a-d26aca4e56f7 | 2 | private void navigatingToRepeatingTab() throws Exception {
// Navigate to Sales Screen
print("Navigating to 'Sales' window.");
driver.findElement(By.id("Accounts")).click();
waitTillElementLoad(By.partialLinkText("Sales"));
driver.findElement(By.partialLinkText("Sales")).click();... |
6d6f3fa6-1274-4315-8f63-32032a766c8e | 1 | public Expression simplify() {
for (int i = 0; i < subExpressions.length; i++) {
subExpressions[i] = subExpressions[i].simplify();
subExpressions[i].parent = this;
}
return this;
} |
6e0fc396-353b-4d32-b470-8c0a97069c89 | 8 | public boolean lowerThan(VectorClock other){
for (Entry<String, Integer> entry : vclock.entrySet()) {
String pid = entry.getKey();
if(!other.vclock.containsKey(pid)){
other.vclock.put(pid, 0); //zero is default value
}
}
for (Entry<String, Integer> entry : other.vclock.entrySet()) {
String pid ... |
c1c82673-914d-4fea-a29e-f572278e1c32 | 1 | private JTextField getJTextFieldSourceFilename() {
if (jTextFieldSourceFilename == null) {
jTextFieldSourceFilename = new JTextField();
}
return jTextFieldSourceFilename;
} |
d909396e-95ed-4ab3-b148-d4b6b5961368 | 7 | */
public void setCurrentPlayer(Player player) {
logger.finest("Entering client setCurrentPlayer: " + player.getName());
Game game = freeColClient.getGame();
game.setCurrentPlayer(player);
if (freeColClient.getMyPlayer().equals(player)
&& freeColClient.getFreeColServer()... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.