method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
70b94a8c-f85d-43db-8445-bf94637eeb03 | 0 | public Philosopher(Chopstick left, Chopstick right, int ident, int ponder) {
this.left = left;
this.right = right;
id = ident;
ponderFactor = ponder;
} |
e3a04c94-098e-4ee3-841e-1c12f3e95a49 | 6 | public boolean equals(Object obj)
{
// check if obj is a type of BultItem
if (obj instanceof BulkItem)
{
BulkItem otherBulkItem = (BulkItem) obj;
// check to see if fields match
if (this.food.equals(otherBulkItem.food)
&& this.unit.equals(otherBulkItem.unit)
... |
b38798a7-0af6-48e6-827b-fe28c4b19a4c | 6 | public ResourceFileReader(String Platform_fileName, String Node_fileName) throws IOException {
if (Platform_fileName == null || Platform_fileName.length() == 0) {
throw new IllegalArgumentException("Invalid Platform file name.");
}
if (Node_fileName == null || Node_fileName.length()... |
b0c58754-3063-4643-99fc-71149d71c545 | 1 | private void initGUI() {
try {
diagCDB = new ConnectDB(this);
file = new JFileChooser();
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
{
jTabbedPane = new JTabbedPane();
getContentPane().add(jTabbedPane, BorderLayout.CENTER);
{
jTabbedPaneRDB = new JPanel();
button ... |
67d936bf-a863-4eb9-8532-50ac413ee6d0 | 3 | public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7) {
if(var7 != 1) {
return false;
} else {
int var8 = var3.getBlockId(var4, var5, var6);
if(var8 == Block.tilledField.blockID && var3.isAirBlock(var4, var5 + 1, var6)) {
... |
3c360f1b-221b-4a35-844f-e972ac0c057e | 0 | public String getBook() {
return book;
} |
d5b79b0f-6e48-4b2b-bcc7-fdf2b5e3f11d | 3 | public static void bfs(mxAnalysisGraph aGraph, Object startVertex, mxICellVisitor visitor)
{
if (aGraph != null && startVertex != null && visitor != null)
{
Set<Object> queued = new HashSet<Object>();
LinkedList<Object[]> queue = new LinkedList<Object[]>();
Object[] q = { startVertex, null };
queue.add... |
fd890f23-d7d7-4c8c-ac40-422ea9d38306 | 9 | public int[] worstScore(Combination guess) {
int[] scores = new int[scoreCount];
if(remainingCombos.size() == 0) {
ComboMaker builder = new ComboMaker(charSet, length);
for(char[] combo: builder) {
try {
Combination judge = new Combination(combo, charSet);
int[] score = judge.judge(guess.clone()... |
af705db9-4431-46e1-a80d-51dff0f80436 | 2 | public void test_05() {
System.out.println("\n\nSuffixIndexerNmer: Building the first 5K bases from A.Thaliana's genome");
String fileName = "tests/a_thaliana_test/assembly_test.fa";
String result = Gpr.readFile("tests/a_thaliana_test/assembly_test.result");
// Create an index
SuffixIndexerNmer<DnaAndQuality... |
728a65aa-c533-4684-95f0-e0fb92995398 | 7 | public String compute(int firstDigits, String[] largeValues)
{
//各位の和の中に10以上の値が存在するか否か
boolean existOverTen = false;
//各位の和を入れるための配列
int[] sumEachDigits;
//位の和に位を掛けた値を入れるための文字列配列
//ex) 百の位の値の和が20 -> String("2000")
String[] strValues = largeValues;
do
{
existOverTen = false;
//各桁の和を入れるための配列
... |
c0e452e5-a48e-4126-b1b5-8a2094701378 | 8 | @Override
public void onUpdate(Level level) {
direction=vectorAsAngle(velocity)+currentOffset;
double turnRate = level.getWorldDeltaTime()*360;
if(Math.abs(targetOffset-currentOffset)<turnRate){
currentOffset=targetOffset;
}else{
if(targetOffset>currentOffset){
currentOffset+=turnRate;
}else{
... |
7eb55321-ed36-49c4-8a17-25cccce6339c | 1 | public void testGet_DateTimeFieldType() {
DateTime test = new DateTime();
assertEquals(1, test.get(DateTimeFieldType.era()));
assertEquals(20, test.get(DateTimeFieldType.centuryOfEra()));
assertEquals(2, test.get(DateTimeFieldType.yearOfCentury()));
assertEquals(2002, test.get(Da... |
8f7f434a-a20a-4849-a5ca-afb3e75cc9b4 | 9 | public void mouseDragged(MouseEvent e){
mX = e.getX();
mY = e.getY();
int loop;
if (!holdingTurret){
//Buys new turret
for(loop = 0; loop < 5; loop++){
if (glassDisplay[loop].overTurret(mX, mY)){
if (glassDisplay[loop].turretType() == "Gun"){
turretBuilder.add(new GunTurret(mX-13, mY-13)... |
1c669d43-894f-4e81-a137-efd661ef4844 | 3 | public void notifyAdmins( String msg )
{
Player players[] = getServer().getOnlinePlayers();
for ( Player p : players )
{
if ( p.hasPermission( "iadmin.admin" ) || p.isOp() )
{
p.sendMessage( ChatColor.RED + "[iNations] " + ChatColor.WHITE + msg );
}
}
} |
2dc99940-087a-42ba-87bb-b7359224d5f7 | 5 | public boolean run() {
while (!isBusted() && !isBlackjack()) {
printStatus();
System.out.print("Would you like to hit or stand: ");
char selection = scan.nextLine().toLowerCase().charAt(0);
if (selection == 'h') {
hit();
} else if (sele... |
2bed1af1-20e4-454e-9749-fdd20ef9624b | 1 | public void setImgPath_Window(Path img) {
this.imgWindow = handleImage(img, UIResNumbers.WINDOW.getNum());
if (img != null) {
this.windowImgChanged = true;
} else {
this.windowImgChanged = false;
this.imgWindow = UIDefaultImagePaths.WINDOW.getPath();
... |
d777af97-2ce1-4ce5-ba4c-6ebfd2010bea | 0 | public static void after(PrintWriter out){
out.println("</table>"+
"</body>"+
"</html>");
} |
fe973c07-cb33-4ee5-adb3-061a935bee2e | 0 | public static void setupMicroProgram() {
new ProgramSetupThread(programPath).start();
} |
6aab9240-2401-430b-9a03-744520d0abdc | 4 | public AbstractPuzzle(List<Integer> data, int side, int boxSize) {
this.data = new ArrayList<Integer>(data);
this.side = side;
this.boxSize = boxSize;
if (side * side != data.size()) {
throw new IllegalArgumentException(
"Only perfect sqare data allowed");
}
for (int value : data) {
if (value > ... |
69639cea-7846-4f24-a8d5-22b3c90d03e5 | 9 | @Override
public boolean equals(Object obj)
{
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
final Parameter that = (Parameter) obj;
i... |
a28aeff2-4687-4b8d-8002-7a8d8f280755 | 5 | * @param data the new data for that version
* @param mergeSharedVersions if true merge all versions sharing the
* same text in the original to the replacement text
*/
private void revise( Graph original, short version, char[] data,
boolean mergeSharedVersions ) throws Exception
{
... |
a428fdcf-71d2-42e3-88f0-027ec35857af | 0 | public JComboBox getjComboBoxVisiteur() {
return jComboBoxVisiteur;
} |
9264ce8b-ce6d-4db3-bb08-26494630676d | 7 | public static void main(String args[]) {
//Define array to hold all cells
boolean cell[] = new boolean[1000];
//Loop for all cells
for (int h = 0; h < 1000; h++) {
//set them all to locked
cell[h] = true;
}
//Code to set which ones are locked and which are not locked
for (int i = 0; i < 1000; i+... |
5c7cdf3a-8b4f-4f2d-aa01-4197d98db43d | 7 | public static <TKey extends TKeyT, TKeyT> Map<? super TKey, Integer> mergeMapWithAdd(Map<TKeyT, Integer> target, Map<? extends TKey, ? extends Integer> source) {
for (Entry<? extends TKey, ? extends Integer> entry2 : source.entrySet()) {
TKey key2 = entry2.getKey();
int val2 = entry2.get... |
d6055457-70c7-4968-a5ff-25018cca2e2e | 8 | public void setVariable(String name, Object value) {
if (value instanceof String) {
setString((String) value);
} else if (value instanceof Character) {
setString(value.toString());
} else if (value instanceof Byte) {
setLong(((Byte) value).longValue());
... |
469048d7-d8bf-4c3c-b74f-a9647ab11710 | 5 | public boolean close() {
if (environment.isDirty()) {
File file = environment.getFile();
String title;
if (file == null)
title = "untitled";
else
title = file.getName();
int result = JOptionPane.showConfirmDialog(this, "Save " + title
+ " before closing?");
if (result == JOptionPane.CA... |
c1fa42e4-965c-4e4d-bbd8-6040ae2a71c7 | 1 | @Test
public void removingSingleVertexThatHasNeighbours() {
l.addVertex(v);
l.addVertex(k);
l.addEdge(v, k);
l.removeVertex(0);
assertTrue(l.getNeighbours(0).contains(k)
&& !l.getNeighbours(0).contains(v));
} |
673ad253-eb6f-4ef1-b7a4-db322b42ee10 | 5 | @Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException,
IOException {
String creationForm = "creationForm";
String create = "create";
String take = "take";
String submit = "submit";
String action = request... |
a8c754be-290c-4179-b5a3-07cb4a01eae0 | 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... |
740a6ecc-d6f3-4ddb-b01c-2b0b824fe584 | 5 | @Override
protected void ismovelegal(HantoPieceType pieceType, HantoCoordinate from,
HantoCoordinate to) throws HantoException {
// basic checks
super.ismovelegal(pieceType, from, to);
// Gamma specific checks
// cannot place next to opposite color
if(from == null && turncount > 2) {
if(!super.ne... |
cb5ab944-847e-471c-8b81-dfc95e9d00c2 | 3 | public static String toString(JSONObject jo) throws JSONException {
boolean b = false;
Iterator keys = jo.keys();
String string;
StringBuffer sb = new StringBuffer();
while (keys.hasNext()) {
string = keys.next().toString();
if (!jo.isNull(s... |
2ae0b931-ecca-4e15-ac33-555025919443 | 5 | public int compareTo (Property o) {
int comparison = name.compareTo(o.name);
if (comparison != 0) {
// Sort id and name above all other fields.
if (name.equals("id")) return -1;
if (o.name.equals("id")) return 1;
if (name.equals("name")) return -1;
if (o.name.equals("name")) return 1;
}
... |
1ab45c4a-0f78-4110-8be2-64e54c698bb5 | 2 | public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new GridLayout(1, false));
Composite composite = new Composite(shell, SWT.NONE);
composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
composite.setLayout(new GridLay... |
673a0cdd-59af-4597-86a9-9602a9b3889f | 4 | private static void setLookAndFeel() {
try {
OUTER:
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
//System.out.println(info.getName());
switch (info.getName()) {
case "Windows":
... |
464a1e75-06be-4b3a-865e-41a1e124fe52 | 9 | public Arbre residuel(char c){
boolean test = false;
for(Arbre k : premiers){
if(k.egale(new Feuille(c))){
test = true;
break;
}
}
if(!test) return null;
Arbre a = this.residuelBis(c);
if(a!=null){
boolean b = false;
if(a.symbole == '+'){
Binaire tmp = (Binaire) a;
b = tmp.droit.... |
bf0db507-d990-4111-bf4c-68944fa01897 | 7 | private static Object js_push(Context cx, Scriptable thisObj,
Object[] args)
{
if (thisObj instanceof NativeArray) {
NativeArray na = (NativeArray) thisObj;
if (na.denseOnly &&
na.ensureCapacity((int) na.length + args.length))
... |
3395a3f8-26d4-487a-8105-5cf1af139b4a | 3 | private static void calcNoOfNodes(Node node) {
if (node instanceof Parent) {
if (((Parent) node).getChildrenUnmodifiable().size() != 0) {
ObservableList<Node> tempChildren = ((Parent) node).getChildrenUnmodifiable();
noOfNodes += tempChildren.size();
f... |
461c73b2-814e-4f0b-a8f4-7d8c7cb8c4cd | 9 | public static FinalCard checkEffCardType(ArrayList<Card> list) {
assert(list.size() == EFFECTIVE_CARD_NUM);
Collections.sort(list);
if (isStraightFlush(list) >= 0) {
return new FinalCard(list, FinalCardType.STRAIGHT_FLUSH);
}
if (isKingKong(list) >= 0) {
return new FinalCard(list, FinalCardType... |
2e689572-968f-42e6-9370-ff00faa00652 | 0 | public void setBlockTransition(boolean block) {
blockTransition = block;
} |
80525dae-1d18-4077-ab69-b00392048249 | 5 | @Override
public boolean[] convertFromString(Class<? extends boolean[]> cls, String str) {
if (str.length() == 0) {
return EMPTY;
}
boolean[] array = new boolean[str.length()];
for (int i = 0; i < array.length; i++) {
... |
433b9b0f-3ae0-4859-9cde-788175ffd9e1 | 4 | public Token andExpr() throws ParentesiParsingException, OperazioneNonValidaException, ExtraTokenException, OperatoreMissingException, OperandoMissingException
{
Token x = notExpr();
if(!(point>text.size()-1))
{
while(peek().ritornaTipoToken().equals(Tok.AND))
{
consume();
Token y = notExpr();
... |
ab3ff831-50f9-49ff-a777-868fdd8ec378 | 6 | @Override
public void move(){
if(!engine.getPhysics().canMove(this, this.getLocation().getX(), this.getLocation().getY()+5)){
if(side == true){
if(!engine.getPhysics().canMove(this, this.getLocation().getX()+5, this.getLocation().getY()+5))
engine.getPhysics().usePhysics(th... |
81662557-fd4b-488b-9d0b-c0532fe90e5a | 6 | @Override
public void executeInternal(int minValue) {
if (player && !noCheckObedience)
seqMetric(new EflCheckObedience());
seqUnbounded(new EflTextSegment(Move.A)); // player mon uses attack
// System.out.println("EflHitMetricSegment: size=" + sb.size());
seq(new CheckMetricSegment(new EflCheckMoveDamag... |
51c2c00e-6d59-424b-98a7-4f343f0bdb47 | 3 | @EventHandler(priority = EventPriority.NORMAL)
public void onExpBottleEvent (ExpBottleEvent event)
{
for (MetadataValue meta : event.getEntity().getMetadata(
"expbottlelevel"))
{
if (meta == null)
return;
if (meta.getOwningPlugin() != plugin)... |
eafd33a8-dc59-4163-9d02-68310b581142 | 4 | private File generateNewFile(File sourceFile, java.io.File file, FileType fileType, Connection dbConnection) throws SQLException {
long size = file.length(); // size of file in bytes
Timestamp currentTimestamp = new Timestamp(System.currentTimeMillis());
PreparedStatement s = dbConnection.prepareStatement("INSERT... |
5c7098d9-4af3-422e-a959-34aaa0c2a539 | 3 | @RequestMapping("listaDeDesejos")
public ModelAndView listaDeDesejos() {
ModelAndView mav = new ModelAndView();
if (loginController.isLogado() || adminController.isLogado()) {
Usuario usuario = loginController.usuario;
if (usuario == null) {
usuario = adminController.usuario;
}
mav.setViewNam... |
510ea97d-76b7-496d-83f4-fa173fc54733 | 0 | public void move(Point2D p)
{
myBottomLeft.x += p.getX();
myBottomLeft.y += p.getY();
} |
2c2cb634-62e7-4208-8760-7378a5ddebb7 | 3 | public CLI(CLC controller, String... args) {
br = new BufferedReader(new InputStreamReader(System.in));
this.innerController = controller;
this.controller = new CLIController();
try {
if(args.length > 0) {
String[] scriptArgs = new String[args.length + 1];
scriptArgs[0] = "run";
for(int i = 0; i ... |
bef3c845-8154-43d7-a7ed-d10031920fbb | 4 | public List<Trip> getTripsByUser(User user) throws UserNotLoggedInException {
List<Trip> tripList = new ArrayList<Trip>();
User loggedUser = UserSession.getInstance().getLoggedUser();
boolean isFriend = false;
if (loggedUser != null) {
for (User friend : user.getFriends()) {
if (friend.equals(loggedUser)... |
70ff9029-608e-41af-b56d-b9bf77e5f54e | 4 | private Token numberValue() {
Token result;
Number value;
StringBuilder sb = new StringBuilder();
char ch = currentChar();
while (Character.isDigit(ch)) {
sb.append(ch);
ch = nextChar();
}
if (ch == '.') {
sb.append(ch);
... |
70cd2b01-a0d7-43e7-be78-ae91dfcaa21d | 0 | public String[] getBossClasses()
{
String []classes = {"","","",""};
classes[0] = config.getString("BossOption.ClassLevel1");
classes[1] = config.getString("BossOption.ClassLevel2");
classes[2] = config.getString("BossOption.ClassLevel3");
classes[3] = config.getString("BossOption.ClassLevel4");
return... |
f9a272df-dcd3-4a20-b78a-e796a4c1496c | 7 | void insertFixUP(final RedBlackNode justInsertedNode)
{
RedBlackNode z = justInsertedNode;
while(z.parent.color == RED)
{
if(z.parent == z.parent.parent.left)
{
RedBlackNode y = z.parent.parent.right;
// case 1
if(y.color == RED)
{
z.parent.colo... |
e5dabe80-d41a-494d-a7ea-f1fb720459fd | 7 | public static Stella_Object updateInContext(Stella_Object oldvalue, Stella_Object newvalue, Context homecontext, boolean copytochildrenP) {
{ CsValue csvalue = null;
if ((oldvalue != null) &&
(oldvalue.primaryType() == Stella.SGT_STELLA_CS_VALUE)) {
csvalue = ((CsValue)(oldvalue));
}
... |
27b6a601-6280-4639-8619-a88beff56ae3 | 7 | public Login() throws FileNotFoundException, IOException {
initComponents();
loginError.setVisible(false);
SQLConnection m = new SQLConnection();
File file=new File("C:/windows/journal.txt");
boolean exists = file.exists();
Writer output = null;
if(!exists){
output = ... |
7f21c2c8-35b4-45f3-a6f7-f79286f7e2a7 | 0 | protected void makeRoom(int add) {
ensureSpaceFor(index+add);
} |
7e6cc572-2b17-4ae8-8cc7-cccc81875dd6 | 9 | public int checkIMV()
{
if(cornerMap.get("I").equals("I")
&& cornerMap.get("M").equals("M")
&& cornerMap.get("V").equals("V"))
{
return SOLVED;
}
if(cornerMap.get("I").equals("V")
&& cornerMap.get("M").equals("I")
&& cornerMap.get("V").equals("M"))
{
return CW;
}
if(cornerMap.get("I... |
1b5f4fa2-fdc5-4c47-be4c-bef807f816d4 | 8 | private void StartTimerForGameStart(Player p)
{
if (!plugin.AlreadyCountingDown)
{
new BukkitRunnable()
{
public void run()
{
if (plugin.PlayersInGame.size() > 0)
{
plugin.AlreadyCountingDown = true;
if (plugin.reminaingTimeUntilGameStart == 120)
{
SendMessageToPlay... |
c5de1b18-feed-48c9-99c7-600335810636 | 3 | @Override
public void actionPerformed(ActionEvent e) {
OutlinerDocument doc = (OutlinerDocument) Outliner.documents.getMostRecentDocumentTouched();
OutlinerCellRendererImpl textArea = doc.panel.layout.getUIComponent(doc.tree.getEditingNode());
if (textArea == null) {
return;
}
Node node = textArea.n... |
a8838922-f8a9-4ab6-a221-456ed67dd014 | 5 | private char [] xOr (char [] Origen, char [] Operando){
char [] salida = new char[Origen.length];
for(int i = 0 ; i < salida.length ; i++){
if((Origen[i]=='0'&& Operando[i]=='0')||(Origen[i]=='1'&& Operando[i]=='1')){
salida[i]='0';
}else
sali... |
6d2520cb-e50f-4335-b237-53d988782965 | 2 | public static int getTotalQuizCreatedRecord() {
int totalRecords = 0;
try {
String statement = new String("SELECT COUNT(id) FROM " + DBTable);
PreparedStatement stmt = DBConnection.con.prepareStatement(statement);
ResultSet rs = stmt.executeQuery();
if (rs.next())
totalRecords = rs.getInt("COUNT(id)... |
3a8d0496-9519-45ad-8d2f-3b387a9e960b | 7 | public void connect(String host, int port) throws Exception {
//
if(!this.connected.compareAndSet(false, true)) {
return;
}
//
if(isVerbose() && LOGGER.isInfoEnabled()) {
LOGGER.info("connecting to host: {}, port: {}", host, port);
}
//
this.socket = this.socketFactory.create(host, port);
... |
4249882d-d711-4509-8b37-7f60d518f846 | 3 | public static void main(String args[]) {
//---
// Parse command line arguments
//---
if ((args.length != 2) && (args.length != 3)) {
System.err.println("Usage: " + CompareToEnsembl.class.getSimpleName() + " genomeName ensemblFile [transcriptId]");
System.exit(1);
}
String genomeName = args[0];
Stri... |
b0cef041-e8ae-4820-b11e-a0554e96cd25 | 0 | public void setTeam(boolean setting)
{
this.team = setting;
} |
efc56755-a848-40ee-8de6-71e1a25ab37e | 8 | public static byte getUnitSuperClass(byte unitType) {
if (unitType >= Unit.INFANTRY && unitType <= Unit.PIPERUNNER) {
return Unit.LAND_CLASS;
}
if (unitType >= Unit.FIGHTER && unitType <= Unit.BLACK_BOMB) {
return Unit.AIR_CLASS;
}
if (unitType >= Unit.BAT... |
91e47cae-99d2-4a64-bf87-2ba356c54cf3 | 9 | public Object getValueAt(int rowIndex, int columnIndex) {
assert((columnIndex >= 0) && (columnIndex <= 2));
Iterator i = scoreSet.iterator();
int j = 0;
while(i.hasNext()) {
if(j == rowIndex) {
Object... |
09eae0e5-2105-44ae-9d29-6d485bb8fce2 | 7 | public final void updateMode()
{
// WE'LL NEED THESE GUYS
Poseur singleton = Poseur.getPoseur();
PoseurStateManager state = singleton.getStateManager();
PoseurState mode = state.getMode();
PoseurFileManager fileManager = singleton.getFileManager();
// IN THIS MODE TH... |
e21eef4e-d371-4fb6-9af1-65f6a263da94 | 8 | @Override
public Success<Statement> parse(String s, int p) {
// Parse "if".
Success<String> resIf = IdentifierParser.singleton.parse(s, p);
if (resIf == null || !resIf.value.equals("if"))
return null;
p = resIf.rem;
p = optWS(s, p);
// Parse the '('.
... |
2790d2f0-2e13-46e3-87f6-2f98f269044c | 1 | public void generarEquipos() {
if (this.validarInscripcion() == -1) {
throw new BusinessException("Hubo un error");
}
this.distribuirEquipos(this.ordenarEquipos());
estado = "G";
} |
af961c49-c15f-40d8-95e0-8fbb31305308 | 2 | public int[] deletedPersonsIndices(){
if(!this.dataPreprocessed)this.preprocessData();
if(this.nDeletedPersons==0){
System.out.println("Method - deletedPersonsIndices: there are no deleted persons; null returned");
return null;
}
else{
ArrayMaths am1 =... |
5ac63bea-2acf-47fc-bff4-5f473614203b | 6 | public static void startupIdlOutput() {
{ Object old$Module$000 = Stella.$MODULE$.get();
Object old$Context$000 = Stella.$CONTEXT$.get();
try {
Native.setSpecial(Stella.$MODULE$, Stella.$STELLA_MODULE$);
Native.setSpecial(Stella.$CONTEXT$, ((Module)(Stella.$MODULE$.get())));
if ... |
372aef88-d498-4b83-b38b-5c63fa8b90ad | 8 | private void openExperiment() {
int returnVal = m_FileChooser.showOpenDialog(this);
if (returnVal != JFileChooser.APPROVE_OPTION) {
return;
}
File expFile = m_FileChooser.getSelectedFile();
// add extension if necessary
if (m_FileChooser.getFileFilter() == m_ExpFilter) {
if... |
966ee09a-c736-4c7d-b1e2-0789a4b2f509 | 0 | public void removeNodeAfter( )
{
link = link.link;
} |
aad78286-2398-4a5b-ba4f-aac5b248ab89 | 5 | public static boolean accept(Object object) {
return object == null || object instanceof SizeObject || object instanceof String || object instanceof Boolean || object instanceof Number || object instanceof Iterable;
} |
909dabc3-581b-4f19-8d44-1cc33558ffda | 9 | public String convertFac (String entireBooking) { //Modtager en String, deler den op og konventerer derefter Facilitetstypen til et Facilitets ID
String[] split = entireBooking.split(" ");
String facType = split[1];
switch (facType){
case "BADMINTON,": return "1";
case "... |
89525844-bf5c-4ff2-b9e6-4bbe85dc7bf5 | 8 | public void relayMdMessage(MdMessage mdMessage) {
if (mdMessage.getMessage().equals(MdMessageConstants.MD_PANEL_UPDATEMENU)) {
this.updateMenuBar();
this.menuBar.repaint();
} else if (mdMessage.getMessage().equals(MdMessageConstants.FINDCONDITIONDIALOG_SHOW)) {
if (mdMessage.getData() != null) {
String... |
9ae7a6c4-8b00-4313-9872-b6a97e020182 | 3 | void setExampleGroupBackgroundMode () {
if (backgroundModeGroup == null) return;
String modeString = backgroundModeCombo.getText ();
int mode = SWT.INHERIT_NONE;
if (modeString.equals("SWT.INHERIT_DEFAULT")) mode = SWT.INHERIT_DEFAULT;
if (modeString.equals("SWT.INHERIT_FORCE")) mode = SWT.INHERIT_FORCE;
ex... |
0c3c0474-041b-41c4-826f-9d2b0d477d98 | 2 | public static boolean anyKeyPress() {
for (int i = 0; i < NUM_KEYS; i++)
if (keys[i]) return true;
return false;
} |
7499af4c-be20-40fe-8828-cbb39c2b4fe6 | 4 | private void deleteCase3(RBTreeNode<K,V> node) {
//If parent, sibling, and both sibling's children are black
if (nodeColor(node.parent) == Color.BLACK &&
nodeColor(node.sibling()) == Color.BLACK &&
nodeColor(node.sibling().left) == Color.BLACK &&
nodeColor... |
da82859d-d827-4598-86fa-89dfa04069ff | 1 | private static synchronized Date getDate() {
if (date == null) {
date = new Date();
} else {
date.setTime(System.currentTimeMillis());
}
return date;
} |
53b92505-cced-4045-899e-0dff32b44a1c | 0 | public HashEntryNotFoundException(Exception e, String name){
super(e, name);
} |
c996209b-e0c0-470e-b5b7-b3cea68eec35 | 4 | private void viewBotonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_viewBotonActionPerformed
int index = estrategyT.getSelectedRow();
if(index>=0){
String est = (String)estrategyT.getModel().getValueAt(index, 0);
Estrategia e = null;
... |
0c0478fd-07b0-4b67-892f-1a89ca3a0092 | 7 | public double calculateCo2Consumption(Vehicle vehicle) {
double co2 = 0;
System.out.println(vehicle.getCargo());
for (Route route : routeList) {
if (vehicle instanceof Truck) {
co2 += (route.getKm() * ((vehicle.getAverageConsumption() * (vehicle.getTypeOfFuel() == Fue... |
be3d9f3c-9d1e-4933-abaa-3e401208f9d1 | 4 | protected Validator_interface getValidator(int maxsteps,
Map<String, BasicHantoPiece> board,
HantoCoordinate startlocation, HantoCoordinate destination, HantoPieceType type) {
Validator_interface ret = null;
if(type.equals(HantoPieceType.BUTTERFLY)) {
ret = new HantoWalkValidator(maxsteps, board, sta... |
efe3e37b-adf0-4cac-8f57-79efa6fbb72c | 9 | @Override
public void draw()
{
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glColor3f(1, 0, 0);
if (this.target != null && this.firingCount > 0)
{
Game.getInstance().tessellator.start(GL11.GL_LINES);
Vector2d vec = this.position.copy().add(this.size.copy().mul... |
68293865-8da5-435b-97f4-aecf33d9e417 | 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 Link)) {
return false;
}
Link other = (Link) object;
if ((this.id == null && other.id != null) || (this.id != n... |
b649103c-fcce-4b4e-b544-f9c6cf629026 | 6 | @Override
public boolean execute(RuleExecutorParam param) {
Rule rule = param.getRule();
List<String> values = Util.getValue(param, rule);
if (values == null || values.isEmpty()) {
return false;
}
boolean retValue = true;
for (String value : values) {
String compareValue = rule.getValue();
if (ru... |
a9a57985-84de-42f8-a606-a3f3fd9d464e | 9 | protected void loadFields(com.sforce.ws.parser.XmlInputStream __in,
com.sforce.ws.bind.TypeMapper __typeMapper) throws java.io.IOException, com.sforce.ws.ConnectionException {
super.loadFields(__in, __typeMapper);
__in.peekTag();
if (__typeMapper.isElement(__in, Contact__typeInfo)) {
... |
013e3b3b-4d2b-4bf0-b189-498e26fd5603 | 1 | public void setId(int id) throws CarException {
if (id < 0) {
throw new CarException("Id is under zero");
}
this.id = id;
} |
59e56a39-2cc2-41a9-b2f6-f0b4aa71eb48 | 8 | @Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
MOB target=mob;
if((auto)&&(givenTarget!=null)&&(givenTarget instanceof MOB))
target=(MOB)givenTarget;
if(target.fetchEffect(this.ID())!=null)
{
mob.tell(target,null,null,L("<S-NAME> <S-IS-... |
c8d4f35e-cf98-4f59-a51c-5425a3c91412 | 5 | public boolean onCommand(Player player, String[] args) {
File fichier_language = new File(OneInTheChamber.instance.getDataFolder() + File.separator + "Language.yml");
FileConfiguration Language = YamlConfiguration.loadConfiguration(fichier_language);
if(player.hasPermission(getPermission())){
if(args.length >... |
6b5445ff-bb8c-4890-877c-e9e124c44515 | 4 | public void setMoodleCourseContentField(String name, String value) {
if (name.equals("id")) setId(Long.parseLong(value));
if (name.equals("name")) setName(value);
if (name.equals("visible")) setVisible(!value.equals("0"));
if (name.equals("summary")) setSummary(value);
} |
9df16c23-9ec1-485c-a5ba-29dfbd375870 | 9 | @Override
public boolean equals(Object object) {
if (this == object) {
return true;
}
if (object instanceof Map.Entry) {
Map.Entry<?, ?> entry = (Map.Entry<?, ?>) object;
return (key == null ? entry.getKey() == null : key.equals... |
b3c96366-be14-461f-a9c9-f02d646c8e4e | 6 | public static boolean hasTransitionedToFinal() {
log.trace("MessageListener.hasTransitionedToFinal() start ...");
Event event = StateHandler.INSTANCE.getLastSuccessfulEvent();
if (event == null) {
log.trace("MessageListener.hasTransitionedToFinal() getLastSuccessfulEvent null.");
... |
79a73741-3d05-4514-95af-c6ee5e9ab374 | 2 | public Set getSet(int row, int column) {
String s = (String) getValueAt(row, column);
Set set = new TreeSet();
for (int i = 0; i < s.length(); i++) {
if (s.charAt(i) == '!') {
set.add("");
continue;
}
set.add(s.substring(i, i + 1));
}
return set;
} |
ca26460b-b717-4a6f-b61b-f642833887af | 5 | public String toString() {
try {
String st = "DIRECOES DA SALA:\n";
for (int i = 0; i < 6; i++)
if (conexoes[i] != null)
st += "\t" + Direcao.converte(i) + " " + conexoes[i]
+ "\n";
if(itens.size() > 0){
st += "ITENS DA SALA:\n";
for(Item i : itens)
st += "\t" + i + "\n";
}
... |
3c5082fd-13ff-446a-8562-47650e1e68ed | 8 | @Override
public String toString() {
return "StnClass {"
+ (extReferences != null ? " extReferences [" + extReferences + "]" : "")
+ (cls != null ? " cls [" + cls + "]" : "")
+ (recommendedValue != null ? " recommendedValue [" + recommendedValue + "]" : "")
+ (quality != null ? " quality [... |
d3ed6410-95e4-45b0-bdae-866d8e73a501 | 8 | public static boolean createGoalCacheP(ControlFrame frame) {
{ Proposition goal = frame.proposition;
KeyValueList table = Proposition.findGoalCacheTable(goal);
if (table == null) {
table = KeyValueList.newKeyValueList();
{ Keyword testValue000 = goal.kind;
if ((testValue000 =... |
60fb559e-a4ff-43e1-af2e-7b38c4a47d9a | 9 | static boolean [][] createTabMasque(String [] info, String key) throws UnknownServiceException, CharConversionException {
int i, j, k, port;
String ip, masque, question, reponse = "";
boolean [][] tabMasque = null;
for ( i=0 ; i<info.length ; i++){
ip = info[i].split(":")[0];
port = Integer.parseIn... |
37b41ff1-9459-4d2b-b373-271f04280a8a | 6 | public static void startupGeneralQuery() {
{ Object old$Module$000 = Stella.$MODULE$.get();
Object old$Context$000 = Stella.$CONTEXT$.get();
try {
Native.setSpecial(Stella.$MODULE$, Stella.getStellaModule("/ONTOSAURUS", Stella.$STARTUP_TIME_PHASE$ > 1));
Native.setSpecial(Stella.$CONTEX... |
728b9b01-3c46-43d8-a446-7fc33cd66ae8 | 4 | public int addShard(String address, int port) throws IOException {
httpHosts.add(new HttpHost(address, port));
++shardAmount;
for (int i = 0; i < httpHosts.size(); i ++){
String keysString = getKeysFromShard(i);
if (keysString == "4")
return 4;
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.