method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
7fb0c7f4-2e81-4e58-843c-726213c6cf04 | 3 | public String describe(int indent) {
StringBuilder sb = new StringBuilder();
for(int i = 0; i < indent; i++)
sb.append(" ");
String className = getClass().getName();
className = className.substring(className.lastIndexOf(".") + 1);
sb.append(className);
sb.app... |
b486a952-158c-40cf-9d0f-2428ab61743c | 2 | public ParseTree parse(List<TokenTuple> tokens) {
prepareToParse(tokens);
while (tokensRemain() && dfa.notInErrorState())
processNextToken();
return tree;
} |
27f9fc40-7afc-47f7-9845-e40e54b97d96 | 0 | @Override
public void mousePressed(MouseEvent e) {} |
177ab966-1924-41f2-8880-369afca78ccf | 8 | public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Journal other = (Journal) obj;
if (name == null) {
if (other.name != null)
... |
a37d0fa4-097d-4c4b-85d1-1a537df96e20 | 3 | private void merge(List<List<Stat>> stats) {
Iterators<Stat> iterators = new Iterators<Stat>(stats);
while (iterators.hasValues()) {
List<Stat> nextValues = iterators.getNextValues();
Date minDate = getMinDate(nextValues);
for (int i = 0; i < iterators.count(); i++) {... |
6af03ca2-8da5-4f6e-895f-88d5228591c0 | 7 | public int hashCode()
{
int _hashCode = 0;
_hashCode = 29 * _hashCode + id;
_hashCode = 29 * _hashCode + (idModified ? 1 : 0);
_hashCode = 29 * _hashCode + senderId;
_hashCode = 29 * _hashCode + (senderIdModified ? 1 : 0);
_hashCode = 29 * _hashCode + receiverId;
_hashCode = 29 * _hashCode + (receiverIdM... |
b3d4f2a9-b7ba-4180-8d46-3be12061dfc1 | 9 | @Override
public Room getStartRoom(Environmental E)
{
if(E ==null)
return null;
if(E instanceof MOB)
return ((MOB)E).getStartRoom();
if(E instanceof Item)
{
if(((Item)E).owner() instanceof MOB)
return getStartRoom(((Item)E).owner());
if(CMLib.flags().isGettable((Item)E))
return null;
}
... |
bf28016a-1092-4461-a0d7-6897ae675b8c | 6 | public static final int getHomeTown(byte village) {
int i = 0;
switch (village) {
case 0:
break;
case 1:
i = 240000000;
break;
case 2:
i = 260000000;
break;
case 3:
... |
4f463af0-6ada-4bd3-b149-66816cdef1d1 | 5 | private boolean oneExit() {
int j = 0;
if(getNExit() != null)
j++;
if(getSExit() != null)
j++;
if(getEExit() != null)
j++;
if(getWExit() != null)
j++;
if(j == 1)
return true;
return false;
} |
fe531249-5b3a-4427-9e04-6e7776a2194b | 5 | public T getFirst() {
if (leftBranch != null && !leftBranch.isEmpty()) { // if there's non-empty left sub-tree
return leftBranch.getFirst(); // return its first element
}
else if (node != null) { // if the node is not empty
return node; ... |
d5713495-f48a-4ba1-94f5-b8edc53ab72f | 0 | public ClusterNode getLeftBranch() {
return this.leftBranch;
} |
a56b51ac-e1d9-4551-93b2-a93a7c2518b3 | 5 | private void recieveFrame() {
byte newestByte = this.buffer.get();
if (newestByte == START_OF_FRAME) { // Beginning of Frame
this.currentFrame = null;
} else if (newestByte == END_OF_FRAME) { // End of Frame
String textFrame = null;
// currentFrame will be n... |
3b5426dc-8c67-44f0-bb09-e62252eccb53 | 3 | public boolean isOnScreen(Level level)
{
return (x >= 0 && x < level.width && y >= 0 && y < level.height);
} |
2644192c-b0cf-4ae0-98f1-34d78c0cc1cb | 7 | public static ByteBuffer inputBufferFrom(final Object object) throws IOException {
if (object instanceof ByteBuffer) return (ByteBuffer)object;
if (object instanceof File) return IO._inputBufferFrom_((File)object);
if (object instanceof FileChannel) return IO._inputBufferFrom_((FileChannel)object);
if (object i... |
6aacaac6-a8a2-457a-ac31-ea417d8fadcd | 4 | public void draw(Graphics g) {
if (System.currentTimeMillis() < time + 3500) {
g.drawImage(splash1, 0, 0, null);
g.drawImage(splash2, 0, 0, null);
return;
}
g.drawImage(startScreen, 0, 0, null);
int stringWidth, count;
Font mediumFont = new Font("SansSerif", Font.BOLD, 16);
Font smallFont = new... |
fb18d3a9-6755-4971-b780-5d5e0ed59510 | 9 | public Object processSaveState(FacesContext context) {
if (context == null) {
throw new NullPointerException();
}
if (this.isTransient()) {
return null;
}
Object[] stateStruct = new Object[2];
Object[] childState = EMPTY_ARRAY;
pushCompon... |
45db24f5-37b4-430e-a793-aa78794b2f75 | 0 | public int getIconWidth() {
return width;
} |
bbf99f34-0cd3-4b12-b9fe-b031d7160e3d | 7 | public static int[] loadSource(String filepath, int maxSources, boolean looping) {
// Load wav data into a buffer.
//AL10.alGenBuffers(buffer);
int buffer = AL10.alGenBuffers();
int error = AL10.alGetError();
if(error != AL10.AL_NO_ERROR) {
System.err.println("Encountered AL error code " + error + "!");
... |
a604c9fe-8abf-4c2d-8d4a-0b27e3039270 | 1 | public static int getCharWidthWithFont(Font font, char ch) {
if (font == null) {
return 0;
}
FontMetrics fm = getFontMetrics(font);
return fm.charWidth(ch);
} |
b0192184-f843-4195-b64d-b6e692b57715 | 8 | private static String initialise(Token currentToken,
int[][] expectedTokenSequences,
String[] tokenImage) {
String eol = System.getProperty("line.separator", "\n");
StringBuffer expected = new StringBuffer();
int maxSize = 0;
for (int i = 0; i < expe... |
27695e9b-06b6-4899-9cbd-295dd9b59532 | 5 | @Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final VersionString other = (VersionString) obj;
if (this.version != other.version && (this.version == null || ... |
e6351ce9-7806-4ffa-9c75-719f03f022bf | 9 | private void checkPolls(Calendar cal) {
Polls[] polls = DBHandler.getAllPolls();
boolean wasChange;
for (Polls poll : polls) {
wasChange = false;
if (!poll.isWas_handled()) {
for (Recipient recipient : poll.getRecipientsArray()) {
if (!recipient.isWasFirstSent()) {
sendRecipientPoll(poll,r... |
29642732-7c8a-4926-9e69-79dd7d217de8 | 3 | private void countPath () {
Point currentCell = endCell;
path.add(currentCell);
while (!(field[currentCell.x][currentCell.y] instanceof StartCell)) {
Point parentCell = field[currentCell.x][currentCell.y].getParent();
if (currentCell.x == parentCell.x || currentCell.y =... |
1d146586-86aa-4da0-afe8-af09be1d3eea | 2 | @Override
public int compareTo(GroupOfUnits o)
{
System.out.println("compare "+this.type.name+", "+o.type.name);
int result = turn - o.turn;
if (result != 0) {
System.out.println(result);
return result;
}
result = wait - o.wait;
if (result != 0) {
System.out.println("wait"+result);
return resu... |
b80fb95b-4c43-4127-9ce9-b141afd34e32 | 7 | public void move(double dt) {
player.move(dt);
switch (player.motion) {
case FALLING:
if (player.v.y >= 0)
return;
for(Platform platform : platforms) {
if (!platform.xIntersec(player.loc.x)) {
// System.out.println("player at " + player.loc + " does not X intersect with " + platform);
... |
2a2d47ab-6381-41e9-87a9-6c15b8e20ed3 | 2 | public final synchronized short readShort(){
this.inputType = true;
String word="";
short ss=0;
if(!this.testFullLineT) this.enterLine();
word = nextWord();
if(!eof)ss = Short.parseShort(word.trim());
retur... |
23d5e377-6862-4ea8-9d87-0c9b113feb93 | 6 | static public void main(String[] e)
{
SSHInstanceExecuter ssh = new SSHInstanceExecuter();
ssh.setIpNumber("10.10.10.250");
ssh.setUserName("rix");
ssh.setPassWord("rix");
CommandPattern commandPattern = new CommandPattern();
ArrayList<CommandsBO> commandList = new ArrayList<CommandsBO>();
Commands... |
c9033afa-7443-4896-9a09-c8023d6fc40f | 3 | @Override
public Class getColumnClass(int column) {
Class returnValue;
if ((column >= 0) && (column < getColumnCount())) {
if (getValueAt(0, column) == null) {
return String.class;
}
returnValue = getValueAt(0, column).getClass();
} else {
... |
2c2436fd-e675-43b9-b746-995a60a4c219 | 6 | public static boolean isBinaryTreeABinarySearchTree(bNode root){
if(root == null) return true;
if(root.left != null){
if(root.left.data > root.data) return false;
}
if(root.right != null){
if(root.right.data <= root.data) return false;
}
return is... |
ad7f1d5e-1a49-4f1d-b8a9-908c6744e38d | 8 | public static HashSet<String> getCofactorTypedNamesByGenericProcessID(String gpid, PathCaseRepository repository) {
HashSet<String> set = new HashSet<String>();
ArrayList<ProcessToMoleculesTable.ProcessToMoleculesTableEntry> rows = repository.genericProcessToMoleculesTable.getRows(gpid);
if (ro... |
1b24072f-29ee-41f8-a970-18b61bc4afdf | 8 | public void visit_fstore(final Instruction inst) {
final int index = ((LocalVariable) inst.operand()).index();
if (index + 1 > maxLocals) {
maxLocals = index + 1;
}
if (inst.useSlow()) {
if (index < 256) {
addOpcode(Opcode.opc_fstore);
addByte(index);
} else {
addOpcode(Opcode.opc_wide);
... |
bc6a3700-fb8b-4b53-a5e4-ab8200c01db9 | 7 | public ArrayList<User> joinGameOffMenu(SearchGamesTask jgtl)
throws InterruptedException, InvalidSubscriptionException,
IOException {
this.jgt = jgtl;
Subscription gameFullSub;
Subscription gameAdvertisementSub;
//We want to repeatedly clear the screen, and print out the available
//games and a prompt... |
fdd235ba-f03b-4aa3-ae42-f8be22b9b4a7 | 1 | public Block pdomParent(final Block block) {
if (domEdgeModCount != edgeModCount) {
computeDominators();
}
return block.pdomParent();
} |
f601f466-7a3a-42c0-b2df-89cc91db8e05 | 2 | public void prettyPrint() {
int cell_width = getMaxLength();
int left_spaces, right_spaces;
String cell_row_line = "+" + IOGeneric.multiplyString("-", cell_width);
String row_line = IOGeneric.multiplyString(cell_row_line, width) + "+\n|";
for (int j=0; j<height; j++) {
... |
5c4feca4-5482-4e46-9549-575a3b8b8fd3 | 7 | private boolean hypothesize(State state1, State state2, Map matching) {
{
// Does state one already have a counterpart?
State counterpart = (State) matching.get(state1);
// If it does, is it the same?
if (counterpart != null)
return counterpart == state2;
// We haven't visited this node yet.
// ... |
ba231bcf-0830-4ecc-99d7-58aefd3cf749 | 4 | public final INode getNext() {
if (currentIdx > 0 && current != set.elements()[currentIdx - 1]) {
INode node = current;
current = node.prev();
return node;
}
while (currentIdx > set.elements().length) {
INode node_1 = set.elements()[currentIdx++].prev();
if (set.elements()[currentIdx - 1] != node_1... |
b208ae9b-8af2-41c6-92be-d0af42d52193 | 2 | public boolean isOccupied(String old_pos,String new_pos)
{
String convert_old_pos = CUtil.pos_Finder(old_pos);
String convert_new_pos = CUtil.pos_Finder(new_pos);
int nfile = Integer.parseInt(convert_new_pos.substring(0,1));
int nrank = Integer.parseInt(convert_new_pos.substring(1));
int ofile = Integer.pa... |
9d945a5c-a5c1-4f98-b20d-014caf63c197 | 0 | public String getAlgorithm() {
return algorithm;
} |
3fb63f39-50c6-4be6-bc89-da95ceb4193e | 5 | private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
// TODO add your handling code here:
if (("".equals(jTextField6.getText()))){
this.msj_usuario_Error("Complete TODOS los Campos.");
}
else{
r_con.Connec... |
1830c7d3-bcaf-4df1-b22c-28364cd4db4f | 2 | public double[] standardizedPersonMeans(){
if(!this.dataPreprocessed)this.preprocessData();
if(!this.variancesCalculated)this.meansAndVariances();
return this.standardizedPersonMeans;
} |
56c35a3b-f24c-4bd7-a1ce-fb70b270f2f1 | 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... |
c235cb87-fb5f-4a9f-980e-027832c62249 | 1 | public void open(AudioFormat fmt) throws JavaLayerException {
if (!isOpen()) {
setAudioFormat(fmt);
openImpl();
setOpen(true);
}
} |
f4184a52-8ac4-41d2-a940-b1b7a37f71f4 | 4 | private long consumeIncomingData()
throws IOException {
InputStream in = this.getSocket().getInputStream();
int length;
long total_length = 0;
byte[] buffer = new byte[256]; // Not too large here
while( in.available() > 0
&& (length = in.read(buffer)) > 0 ) {
// Print to stdout?
for( int i ... |
bb41df54-ed64-40b7-92c7-ea4627dd974e | 6 | public Matrix getQ() {
Matrix X = new Matrix(m, n);
double[][] Q = X.getArray();
for (int k = n - 1; k >= 0; k--) {
for (int i = 0; i < m; i++) {
Q[i][k] = 0.0;
}
Q[k][k] = 1.0;
for (int j = k; j < n; j++) {
if (QR[k][k] != 0) {
double s = 0.0;
for (int i = k; i < m; i++) {
s +... |
7788e362-6f5e-44a3-b534-8bcd51623ce4 | 7 | public static final long getMillisOfUnit(int field) {
switch (field) {
case Calendar.DAY_OF_YEAR:
case Calendar.DAY_OF_MONTH:
return MILLIS_OF_DAY;
case Calendar.HOUR:
case Calendar.HOUR_OF_DAY:
return MILLIS_OF_HOUR;
case Calendar.MINUTE:
return MILLIS_OF_MINUTE;
case Calendar.SECOND:
return ... |
f825a730-4a6c-4574-9f3a-f1f0086964d0 | 4 | public final ApiResult genResult() {
ApiRequest apiRequest = getRequest();
ViewerContext viewerContext = genViewerContext(apiRequest);
ControllerRequest controllerRequest = createControllerRequest(apiRequest);
controllerRequest.setViewerContext(viewerContext);
// TODO: this look not cool
if (get... |
2aaf8bd0-28e3-4fd3-8e1d-54cdc7a00dc4 | 4 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!(obj instanceof Token))
return false;
Token other = (Token) obj;
return this.type == other.type && this.text.equals(other.text) && this.position.equals(other.position);
} |
eddd3ea4-7e50-4839-a519-c42d6d51987d | 3 | public static void main(String[] args) {
try{
Display.setDisplayMode(new DisplayMode(Standards.W_WIDTH, Standards.W_HEIGHT));
Display.setTitle("Generic Zombie Apocalypse");
Display.create();
} catch (LWJGLException e){
e.printStackTrace();
}
//TODO add a check to see if the save directory already ... |
f122b29b-2d96-4bba-bad9-d10a14b5181c | 6 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Imovel other = (Imovel) obj;
if (codigo == null) {
if (other.codigo != null)
return false;
} else if (!codigo.equals(other.codigo))
r... |
b87bf593-6d2a-4fcd-9948-41977a3d0c67 | 7 | private JSONWriter append(String string) throws JSONException {
if (string == null) {
throw new JSONException("Null pointer");
}
if (this.mode == 'o' || this.mode == 'a') {
try {
if (this.comma && this.mode == 'a') {
this.writer.write('... |
4d4672b7-a5bc-4425-92a6-f72bc41f1dcc | 9 | public void setEditedBlock(JBlock b) {
if(b==editing) return ;
editing=(logoBlock)b;
reset();
for(ComboText c: commands){
if(c.getValue().equals(editing.command)){
command.setSelectedItem(c);
break;
}
}
logoObj.setTe... |
b49cc2ca-8fb2-44ec-b150-6e2a7609fd11 | 6 | public boolean matches(ArrayList<Critere> criteres, ArrayList<MotClef> mots) {
//Critères
ArrayList<Critere> criteresDocument = new ArrayList<Critere>();
for (Note n : notes) {
if (!criteresDocument.contains(n.getCritere())) {
criteresDocument.add(n.getCritere());
}
}
for (Critere c : criteres) {... |
3dbd50a3-dae5-491a-b8e2-bb1558f1ea7e | 9 | public static void saveDataAsTable(File file) throws Exception {
check();
String query = "SELECT aname, mname, COUNT(date) FROM namedata n LEFT JOIN artistname a ON n.aid = a.aid LEFT JOIN medianame m ON m.mid = n.mid GROUP BY aname, mname;";
String out[][] = sc.getStringArrayByQuery(query);
if (!fi... |
989b3183-3427-4cdb-8fb9-17d5731e3812 | 9 | @Override
public String getSVG( HashMap<String, Double> chartMetrics, HashMap<String, Object> axisMetrics, ChartSeries s )
{
double x = chartMetrics.get( "x" ); // + (!yAxisReversed?0:w); // x is constant at x origin unless reversed
double y = chartMetrics.get( "y" );
double w = chartMetrics.get( "w" );
do... |
cfb75e3e-46a1-4b54-b3a6-5c26429362ef | 1 | public static void closeConnection(){
try {
System.out.println("closing connection");
conn.close();
} catch (SQLException e) {
System.out.println("error closing connection within process class");
e.printStackTrace();
}
} |
b59616aa-dd1b-4912-8ac2-40f184e7a145 | 2 | private void createCommandMap() {
map = new CommandMap();
map.add("exit", new Command() {
@Override
public void execute() {
frame.dispose();
}
});
map.add("exchange", new Command() {
@Override
public void execu... |
5fa61b4b-c732-4957-b1c2-23622e850ffa | 2 | private void setArray() {
if (this.isString || this.isObject) {
throw new RuntimeException(JSON__STATUS__ERROR);
}
this.isArray = true;
} |
659d4b43-20dc-4e27-b3ad-61c491b3b303 | 3 | private String assemble(KmersGenerator kmersGenerator, int oneKmerLength, int kmersOverlapLength, int graphDegree) throws IOException {
List<String> kmers = kmersGenerator.getKmers(oneKmerLength, kmersOverlapLength);
String inputSequence = kmersGenerator.getInputSequence();
String resultSequence = null;
Lo... |
dffce6d7-5ea0-4ac5-87ef-46039810f1bd | 2 | @Override
public boolean equals(Object obj)
{
if(obj instanceof ObjectRepresentation)
{
ObjectRepresentation other = (ObjectRepresentation)obj;
if(other.getRepresentedClass().getCanonicalName().equals(getRepresentedClass().getCanonicalName()))
{
return true;
}
}
return false;
} |
f0c829c3-ddfa-4c11-bf63-6791a035ed9c | 7 | final public void Variable() throws ParseException {
String identString = "";
ASTVarNode jjtn001 = new ASTVarNode(JJTVARNODE);
boolean jjtc001 = true;
jjtree.openNodeScope(jjtn001);
try {
identString = Identifier();
jjtree.closeNodeScope(jjtn001, true);
jjtc001 = false;
if (jep.symTab.containsKey(... |
33da3349-6271-4399-a986-377b58536666 | 7 | public boolean equals(Object other) {
if ( (this == other ) ) return true;
if ( (other == null ) ) return false;
if ( !(other instanceof RelIgualaHermanoId) ) return false;
RelIgualaHermanoId castOther = ( RelIgualaHermanoId ) other;
return (this.getIdiguala()==castOther.getIdiguala())
... |
6b7650e3-3161-419a-b3e6-75ebffb59023 | 7 | @Override
public void buttonStateCheck(Input input) {
int mX = input.getMouseX();
int mY = input.getMouseY();
if (pointContains(getX(), mX, getX() + sliderBar.getImage().getWidth())
&& pointContains(getY(), mY, getY()
+ sliderBar.getImage().getHeight())) {
if (input.isMouseButtonDown(Input.MOUSE_LE... |
7bfd004d-945d-4e6e-9741-28610ba0bda7 | 5 | public static void main(String args[]) {
File entrada = null;
Scanner sc = null;
FileWriter salida = null;
PrintWriter pw = null;
ArrayList<Jugador> listaJugadores = null;
try {
entrada = new File(args[1]);
sc = new Scanner(entrada);
... |
c4364a22-6b8f-45db-b908-b8b1b302dac7 | 5 | @RequestMapping(value = "del", method = RequestMethod.POST)
@ResponseBody
public Map del(@RequestParam int[] id) {
Map<String, Object> map = new HashMap<>();
List<String> l1 = new ArrayList<>();
List<String> l2 = new ArrayList<>();
List<String> l3 = new ArrayList<>();
f... |
6f8f08ee-7576-4830-83c1-78cc289456e7 | 3 | public QueryPanel addQuery(String nick, boolean select) {
int index = indexOfTab(nick);
if (index == -1) {
QueryPanel queryPanel = new QueryPanel(this, nick);
tabs.add(queryPanel, nick);
if (select)
tabs.setSelectedComponent(queryPanel);
tabs.revalidate();
if (!sele... |
ae4b2488-eb98-4dd7-9cb5-5d977c2c5bda | 9 | private Type resolveJavaType(Class<?> clazz, List<String> classParameterTypes, java.lang.reflect.Type javaType)
{
if (javaType instanceof Class)
{
// The base case. A plain normal class type.
String rawClass = ((Class) javaType).getCanonicalName();
Type type = Type.getType(rawClass);
if (!type.equals(... |
288c4f8e-3b86-4527-91d8-f3210fb5dc9c | 3 | private boolean allocateQueueGridlet()
{
boolean success = false;
// if there are many Gridlets in the QUEUE, then allocate a
// PE to the first Gridlet in the list since it follows FCFS
// (First Come First Serve) approach. Then removes the Gridlet from
// the Queue list... |
28699001-9726-4920-aa5f-767df1bdf311 | 1 | public static void main(String args[]) throws Exception {
//URL url1 = new URL("C:\\Users\\AARON\\Desktop\\musica\\Boom Boom (Official Remix) (ElCorilloRD.Com) [Magnate & Valentino Ft J Alvarez & Nova & Jory - ].mp3");
Reproductor rep = new Reproductor("C:\\Users\\AARON\\Desktop\\musica\\Boom Boom (Official Re... |
508ace7c-471b-4f6e-93dc-4ef6d0662a34 | 6 | public JFormatter id(String id) {
switch(mode) {
case PRINTING:
p(id);
break;
case COLLECTING:
// see if there is a type name that collides with this id
if(collectedReferences.containsKey(id)) {
if( !collectedReferences.get(id).getC... |
2b9614df-99e5-40b5-9f3d-34c0030f6ab7 | 1 | public void remove(int index) {
RangeCheck(index);
int numMoved = size - index - 1;
if (numMoved > 0) {
System.arraycopy(data, index + 1, data, index, numMoved);
}
--size;
} |
e571d734-61ad-4ea9-9a07-b371179f620b | 0 | public void setPartitaIva(String partitaIva) {
this.partitaIva = partitaIva;
} |
6e09bcf2-bea0-49ca-aa7f-1c64186fd4e9 | 9 | @Override
public void initWithMessage(String messageString) {
Matcher matcher = PATTERN.matcher(messageString);
if (matcher.matches()) {
if (!matcher.group(1).equals("null")) {
this.setplayerPositionID1(Integer.parseInt(matcher.group(1)));
}
if (!... |
97f5ed9c-1e12-4696-a9f5-eacfdf491706 | 1 | public void toggleRepeat(Boolean repeating) {
alarm.setRepeating(repeating);
if(repeating) {
dayRepeatButtons.setDisable(false);
} else {
dayRepeatButtons.setDisable(true);
}
} |
1cff8b40-e79d-4678-83eb-31b6a2054fb3 | 8 | public String paint()
{
long startTime = new Date().getTime();
if (words.size() == 0)
{
return "No Keywords Found!";
}
for (int time = 0; time < img.length; time ++)
{
currentTime = time;
//reset min_size for next frame
min_size.x=0;
min_size.y=0;
g = img[time].createGraphics();
g.s... |
afd3ba05-0ac7-4515-8182-c26618679b62 | 4 | private void musicPlayerLoop() {
if(!mediaPlayer.isPlaying() && loopingGlobal && startedAllreadyGlobal && !isPausedGlobal) {
mediaPlayer.playMedia(playingPathGlobal, ":start-time=" + startTimeGlobal, ":stop-time=" + endTimeGlobal);
startTimer();
}
} |
e9385cf3-01d8-4d63-9b48-e7f4f80391c7 | 5 | int getMoney(int cardID, String password, float getMoneyNumber) {
int errorNumber = 0;
if (hasMember(cardID)) {
if (isPasswordRight(cardID, password)) {
for (Member a : userList) {
int index;
if (a.cardID == cardID) {
... |
fcb541bf-b4bc-474b-b5ce-838872d2997f | 3 | public
String getTrackFileName() {
String title = getTitle();
if ((title == null) || (title.isEmpty())) return null;
try {
return Paths.get(saveTo, getFSSafeName(title) + ".mp3").toString();
} catch (IOException e) {
return null;
}
} |
45d56562-ae0e-4ec4-ab8e-a2cd726d6429 | 9 | private static String checkValidShortName(String shortname) {
String message = "";
boolean valid = false;
if(shortname == null || shortname.equals("") || !ModPack.isValidKey(shortname)) {
message = "Shortname is not valid, pick a new key";
} else if(Globals.getInstance().list... |
8257dfbc-8046-498a-b436-36d87d580ff4 | 2 | public void writeFooterFor(ByteBuffer bb) throws IOException {
if (rawOut.getBytesWritten() != 0)
throw new IllegalStateException("writeFooterFor can only be called at a footer boundary.");
ByteBuffer source = bb.duplicate();
byte[] bytes;
if (source.hasArray()) {
... |
87dd1feb-c6be-4f83-94ec-a18fe8e5b388 | 3 | public void remove(Entity entity) {
if(entity instanceof Prop) {
props.remove((Prop) entity);
} else if(entity instanceof Actor) {
cast.remove((Actor) entity);
} else if(entity instanceof Projectile) {
effects.remove((Moving) entity);
}
PropQuad.get().removeProp(entity);
scenery.remove(entity);
} |
80a99885-bc9a-460f-ba7f-73d5da898469 | 0 | public static void main(String[] args) {
int x = 0;
//some ops
assert x != 0;
} |
b6473964-bd11-4e24-8ec4-83a837ecddda | 7 | public static void main(String[] args) {
String datamodel = args[0];
String testfile = args[1];
String predictionsOutput = args[2];
DataModel model = null;
try {
model = new FileDataModel(new File(datamodel));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
re... |
c9bffcf5-6fd8-48ce-b63c-9570f56653aa | 7 | public RequeteExtend() throws SQLException {
tableaux.clear();
srids.clear();
taillePixel.clear();
nomCouches.clear();
nomCouches=FenetreExtend.getNomShape1();
srids= FenetreExtend.getSrids();
System.out.println("size: "+srids.size());
for(String siz : srids){
System.out.println("siz "+... |
c1bf5876-6b67-477e-95b4-85d157815588 | 5 | public static Vector2f lineIntersect(Vector2f a1, Vector2f a2, Vector2f b1, Vector2f b2)
{
Vector2f line1 = a2.sub(a1);
Vector2f line2 = b2.sub(b1);
float cross = line1.cross(line2);
Vector2f pointDistance = b1.sub(a1);
if(cross == 0)
return null;
float crossFactor1 = pointDistance.cross(lin... |
8c7b4bb9-56f4-4689-bd38-7433dd1330f4 | 7 | private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
try{
boolean isToken = false;
if(jTextArea1.getText().length()<1){
JOptionPane.showMessageDialog(this, "Error in cash purse import. Empty purse","E... |
5e418eb1-4475-4021-9262-f04c84113716 | 8 | public static final double calcAngle(float x, float y, float sngCenterX, float sngCenterY) {
double sngAngle = Math.atan((x - sngCenterX) / (sngCenterY - y)) * (180 / Math.PI);
if ((x > sngCenterX) && (y > sngCenterY)) { // 0-90
sngAngle = sngAngle + 90;
} else if ((x < sngCenterX) && (y > sngCenterY)) { // 90... |
47a996f9-4059-4539-8144-892c7aa5d0a9 | 6 | @Override
public void actionPerformed(ActionEvent e) {
if (e.getSource().equals(buttonLancer)) {
isNotDisabled = false;
buttonLancer.setEnabled(isNotDisabled);
buttonLoadFile.setEnabled(isNotDisabled);
nbTour = 0;
nbDeplacement = 0;
nbSourisEnCours = 0;
nbSourisArrivees = 0;
nbSourisSorties =... |
fb4c8b21-3c3e-45e9-83c6-904a89f9ba16 | 7 | private void drawChart(Context2D context) {
if (renderer != null) {
double offsetTop = calculateOffsetCausedByTitleAndSubtitle(context);
double chartWidth = width - paddingLeft - paddingRight;
double chartHeight = height - offsetTop - paddingBottom;
c... |
82e71c88-c638-4d5e-8360-6bc6b7407de6 | 0 | public void setExponent(byte[] value) {
this.exponent = value;
} |
da9838dc-d23e-4a47-8953-ba42abcbf1e4 | 0 | @Override
public void execute(DebuggerVirtualMachine dvm) {
dvm.setRunning(true);
} |
fb8b550f-7cdc-4de9-9d7c-dc95d1a87cea | 6 | public List<Method> getMListeners(Class<?> l1, Class<?> l2){
//L1 == object, L1 == Listener
List<Method> methods = new ArrayList<Method>();
for(Method m: l2.getDeclaredMethods()){
if(m.isAnnotationPresent(EventHandler.class)){
if(m.getParameterTypes().length == 1){
if(m.getParameterTypes()[0].eq... |
ef21c4b1-c970-44f3-a25f-a8d0d9e2b328 | 4 | private void drawMap(Graphics graphics) {
BufferedImage buffer = new BufferedImage( getWidth(), getHeight(), BufferedImage.TYPE_INT_RGB );
Graphics g = buffer.getGraphics();
g.setColor( Color.white);
g.fillRect( 0, 0, getWidth(), getHeight() );
if (myMap != null) {
fo... |
ec331d2e-c33b-4933-8d7e-a46d7da67a4a | 2 | public void trigger(T message) {
int l = this.listeners.size();
for (int i = l - 1; i >= 0; i--) {
this.listeners.get(i).onMessage(message);
if (!message.doesBubble()) return;
}
} |
ea192af0-2992-4711-bb62-4222f9419bbe | 7 | public void service(HttpServletRequest hreq,HttpServletResponse hres)
{
try
{
//System.out.println("does requested session is valid:"+hreq.isRequestedSessionIdValid());
if(hreq.isRequestedSessionIdValid())
{
HttpSession hss=hreq.getSession(true);
if(!hss.isNew())
hss.invalidate();
}
String lmail=hreq.getParameter("lmai... |
8f397aa3-2261-408b-beba-7980befc467d | 8 | public int DownloadUrlPool(String destinationFolder, String fileName,
JProgressBar bar) {
int availableURLs = 0;
int retval = -1;
int counter = 0;
String[] urls;
urls = getUrlList();
if (urls == null) {
logger.error("Cant read ... |
469e0b81-d994-4971-91bb-53a4afeb864e | 8 | @Override
public LinkedList<Integer> sort(LinkedList<Integer> toSort) {
LinkedList<Integer> sorted = new LinkedList<Integer>();
if (!toSort.isEmpty()) {
sorted.addFirst(toSort.getFirst());
toSort.removeFirst();
}
if (!toSort.isEmpty()) {
for (Integer toInsert : toSort) {
int index = 0;
for (In... |
bf83d73a-2a22-48ed-8aa6-e52402f4eed4 | 4 | public AxisAlignedBB getSelectedBoundingBoxFromPool(World var1, int var2, int var3, int var4) {
int var5 = var1.getBlockMetadata(var2, var3, var4);
float var6 = 0.125F;
if(var5 == 2) {
this.setBlockBounds(0.0F, 0.0F, 1.0F - var6, 1.0F, 1.0F, 1.0F);
}
if(var5 == 3) {
this... |
fb19fc1a-3e56-49af-9835-30ea40eee569 | 8 | public static void main(String[] args) {
int n=7;
double min,psum;
double[][] A= new double[n][n];
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
A[i][j]=0;
}
}
double[] p={0.05,0.4,0.08,0.04,0.1,0.1,0.23};
for(int s=0;s<(n-1);s++){
for(int i=0;i<n;i++){
min=10;
psum=0;
for(int... |
527d064a-de0c-4fe0-886f-19f046575a5d | 1 | public LineNumberDebugInfo[] lineNumbers() {
if (code != null) {
return code.lineNumbers();
}
return new LineNumberDebugInfo[0];
} |
458f856a-1f11-4200-8a32-e3ecc7c14340 | 2 | public Category getCategory(String name) throws SQLException {
if (refresh)
execute();
if (exists(name))
return categories.get(name);
else
return null;
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.