method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
67cd859d-db77-4b77-bcfe-c6adc6e3fe03 | 3 | private static void printHorizBound(int width, int printWidth, int startX) {
if (startX > 0) // Handle an extra column of "..."s at the beginning.
System.out.print("----");
for (int x = 0; x < printWidth; x++)
System.out.print("-------");
if (printWidth < width) // Handle an extra column of "..."s at the en... |
a61cc695-2e45-4d95-849e-d5c56c8bf303 | 3 | @Override
public String toString() {
String ret = "[Person] : \n";
for(Person pers : getAllPersons()){
ret += pers + "\n";
}
ret += "\n[Relations] : \n";
for(Relationship rel : GlobalGraphOperations.at(graphDb).getAllRelationships()){
String propert = "";
for( String currentKey : rel.getPro... |
e3c44e52-68bf-4eaa-bd21-3820318be381 | 3 | public boolean startGame() {
if (getplayernum() < this.minplayer) {
return false;
}
spawnBoss();
bossliving = true;
for (Player p : players) {
if (p != boss)
livingplayers.add(p);
p.teleport(playerspawn);
p.setGameMode(GameMode.ADVENTURE);
plugin.sendtoplayer(p, "15뵹ʱ");
}
final Stri... |
4e6f464f-a328-4881-bc64-e242bccfc019 | 6 | private CityGraph updateGraph(CityGraph cityGraph, CityEntity cityEntity, int recursionDepth) {
if (recursionDepth > 0) {
cityGraph.addNode(cityConverter.disassemble(cityEntity));
cityGraph.addEdges(roadConverter.disassembleList(cityEntity.getRoads()));
for (RoadEntity roadEn... |
64c17167-a3e2-49e0-b915-25ddcb0e3daa | 8 | public void setSuccessors() {
for(String key1: this.getActiveKeys()) {
long min = 10000007L;
long max = 0L;
long temp = 10000007L;
String result = "";
for(String key: this.getActiveKeys()) {
if(!this.getMember(key).isDeletable()) {
if(getHashValue(key) < min) {
min = getHashValue(key);
... |
3e907d9d-12dc-4faa-ae17-396922d95057 | 8 | public void setFieldValue(_Fields field, Object value) {
switch (field) {
case FIRST_NAME:
if (value == null) {
unsetFirstName();
} else {
setFirstName((String)value);
}
break;
case LAST_NAME:
if (value == null) {
unsetLastName();
} else {
... |
b7b57fe0-b475-4f4a-9592-f92f8a747bb1 | 0 | private String getMessage(String name)
{
return "hello " + name;
} |
502618d4-a31c-4676-8d56-8659d3f862a0 | 1 | protected void sendListOfMessages(String target, List<String> output) {
for ( String line : output )
sendMessage(target, line);
} |
3e25e623-23b7-4610-9f35-6be85e3892b4 | 8 | private void addProjectionsToQuery(Query query, ColumnFamily colFamily,
Table table) {
for (Column column : colFamily.getColumns()) {
if (column.isChecked()) {
QueryAttribute qa = new QueryAttribute(column.getTable(),
column.getName());
query.addProjection(qa);
}
}
String extBaseTableName ... |
00f1b938-8569-4617-9a36-d54b014ec2af | 5 | public void InitFromFile(File lab) throws FileFormatException {
Scanner laby;
try {
laby = new Scanner(lab);
} catch (FileNotFoundException ex) {
throw new FileFormatException();
}
if (lab.length() == 0) {
throw new FileFormatException();
... |
1a2b2bdf-9727-42a7-a2f7-bb5d7b752d70 | 3 | public LocalVariable paramAt(final int index) {
if ((index >= params.length) || (params[index] == null)) {
final LocalVariable local = new LocalVariable(index);
if (index < params.length) {
params[index] = local;
}
return (local);
}
return params[index];
} |
b1ec5df6-c07b-47ec-9d6c-d2c9401dd21b | 4 | private void rotateToPosition(int position) {
while (rotation != position) {
try {
Thread.sleep(200);
} catch (InterruptedException e) {}
if (rotation > position) rotation--;
else rotation++;
rotate();
repaint();
}
try {
Thread.sleep(1000);
} catch (InterruptedException e) {}
pathwayO... |
e3cb7b0b-2308-4b99-ae5b-8998a54542bc | 3 | @Override
public boolean equals(Object obj) {
if (this == obj) return true;
if (obj == null || this.getClass() != obj.getClass()) return false;
Sala s = (Sala) obj;
return codigo.equalsIgnoreCase(s.codigo);
} |
7c0a3608-e3f1-4493-816d-5dec4ee181ae | 0 | public JLabel getjLabelChercher() {
return jLabelChercher;
} |
7739275d-58ae-470f-b91c-4d2408410ccf | 2 | @Override
public boolean isRecoverying(String resource) {
ResourceLock thisLock = locksOfR.get(resource);
if (thisLock == null || thisLock.getType() != LockType.RECOVERY)
return false;
return true;
} |
9835eb10-22b1-4d5d-911f-18edcf05783e | 7 | public void run() {
log("Worker thread up");
while(true){
lock.lock();
Token token = null;
try {
token = workQueue.remove();
working++;
}catch(NoSuchElementException e){
to... |
10d85944-2444-409a-a5f1-aca2a580eef5 | 1 | public static void loadSounds(){
try {
menuBackground = AudioLoader.getAudio("WAV", ResourceLoader.getResourceAsStream("res/sound/background/MenuBackground.wav"));
menuClick = AudioLoader.getAudio("WAV", ResourceLoader.getResourceAsStream("res/sound/effects/MenuClick.wav"));
equip = AudioLoader.getAudio(... |
140146d3-7286-4b3a-b49d-5183067cc520 | 7 | public static void highlightPlace(
Rendering rendering, World world, BaseUI UI
) {
final Tile t = UI.selection.pickedTile() ;
if (t == null) return ;
final Tile placeTiles[] = world.pathingCache.placeTiles(t) ;
final Tile placeRoutes[][] = world.pathingCache.placeRoutes(t) ;
if (plac... |
16c06516-86a8-4cb8-acca-ee35d8b803d9 | 9 | public Vector<TIntObjectHashMap<TIntDoubleHashMap>> getContext(
ContextDocument doc) {
Vector<TIntObjectHashMap<TIntDoubleHashMap>> all_cxt = new Vector<TIntObjectHashMap<TIntDoubleHashMap>>();
TIntObjectHashMap<TIntDoubleHashMap> cxt_w_id = new TIntObjectHashMap<TIntDoubleHashMap>();
int radius = rad;
int[]... |
287f4100-2dab-4cc9-ac35-723eebce90bb | 0 | @Override
public void startSetup(Attributes atts) {
super.startSetup(atts);
Outliner.menuBar.editMenu = this;
} |
f68003e8-acd0-4875-9b29-94fff07e11ea | 1 | public void move() {
x += vx;
y += vy;
if (vx == 0) {
toCenter();
}
} |
b76a381f-e030-4233-8f6a-879b40e144f9 | 7 | public void indication(final FrameEvent e)
{
final CEMILData f = (CEMILData) e.getFrame();
final int ctrl = f.getPayload()[0] & 0xfc;
if (ctrl == 0) {
final KNXAddress dst = f.getDestination();
if (dst instanceof GroupAddress)
// check for broadcast or group
fireFrameType(f, dst.getRawAddre... |
30377d16-aeb3-4d83-8d3c-7bb37e6fdfcd | 9 | private int buildZone(int x, int maxLength) {
int t = random.nextInt(totalOdds);
int type = 0;
for (int i = 0; i < odds.length; i++) {
if(odds[ODDS_JUMP] <= t*2+30){
type = ODDS_JUMP;
break;
}
if (odds[i] <= t) {
type = i;
... |
7b45538c-bdf2-4cf8-8802-e3d216dca32b | 0 | public final HashCounter hash(final K key) {
return new HashCounter(key);
} |
f23e4380-f21f-4709-bf20-43e13f8d98bc | 1 | public void setDefaultGraph(String graph){
if(graph == null){
((SPARQLConnection) this.con).setDefaultGraphs(null);
}
LinkedList<String> graphs = new LinkedList<String>();
graphs.add(graph);
((SPARQLConnection) this.con).setDefaultGraphs(graphs);
} |
26cfd1e2-53dc-4541-a132-1549cd331d52 | 0 | public void setY(int a){
y = a;
} |
dc2f4d1f-ae98-4ea0-9726-de2a758b3b9b | 9 | public BufferedImage redHSVFilter(){
this.redImage = originalImage;
Color actualPixel;
int actualRedValue;
int actualGreenValue;
int actualBlueValue;
float numberOfRedPixels = 0f;
for (int i = 0; i < originalImage.getWidth(); i++) {
for (int j = 0; j < originalImage.getHeight(); j++) {
actualPixel ... |
9d201267-bf40-48b8-8509-0a30d93506dc | 7 | CursorableSubList(CursorableLinkedList<E> list, int from, int to) {
if(0 > from || list.size() < to) {
throw new IndexOutOfBoundsException();
} else if(from > to) {
throw new IllegalArgumentException();
}
_list = list;
if(from < list.size()) {
... |
b68c14c4-b0da-46df-822c-c78970aa08ec | 1 | public void groupDone(GroupSettings group)
{
mWaiting.remove(group);
if(mWaiting.isEmpty())
output();
} |
b17d0967-eaa4-4ed9-ae2f-85b2529a9c8d | 1 | public static void main(String[] args) {
List<Integer> list = new List<>();
list.addToEnd((Integer)5);
list.addToEnd((Integer)10);
list.addToEnd((Integer)15);
try {System.out.println(list.getValue(3));}
catch (NotExistException exception) {
System.out.println(... |
31a152d8-2a50-4e30-9dff-d1844abd137d | 9 | private void storeStats() {
frameCount++;
statsInterval += period;
if (statsInterval >= MAX_STATS_INTERVAL) { // record stats every MAX_STATS_INTERVAL
long timeNow = System.nanoTime() ;
timeSpentInGame = (int) ((timeNow - gameStartTime)/1000000000L); // ns --> secs
long realElapsed... |
bf7df99e-951b-4cfa-9156-f02807b77b20 | 8 | public final TimerAction addAction(TimerAction action) {
// The next couple of checks are to prevent cyclic graph.
if (action == this) {
// Same action. Just return.
return action;
}
if (action.nextAction != null) {
// If the new action already has a ... |
20b3d183-8676-4ad9-8ef5-d9e5cadcfe5f | 2 | public static ResultSet getResultSet(String query) throws SQLException {
if (s == null) {
String dbUser = "cz2276"; // enter your username here
String dbPassword = "coms4111"; // enter your password here
try {
OracleDataSource ods = new oracle.jdbc.pool.OracleDataSource();
ods.setURL("jdbc:oracle:thi... |
92401d85-781f-4051-be8f-a53fc0171fd8 | 0 | public List findByDescription(Object description) {
return findByProperty(DESCRIPTION, description);
} |
89903262-8416-4f21-86b0-f62775c2f0c5 | 5 | public Fastq build() {
if( description == null ) { throw new IllegalStateException("description must not be null"); }
if( sequence == null ) { throw new IllegalStateException("sequence must not be null"); }
if( quality == null ) { throw new IllegalStateException("quality must not be null"); }
if( variant == nul... |
931bddd5-f82f-487c-8cc2-71f16eca3a61 | 1 | public void setWorkingDirectory(File dir) {
if (!dir.exists()) {
throw new IllegalArgumentException(dir + " doesn't exist.");
}
pb.directory(dir);
} |
3b3a1a80-9ddc-4696-91c8-9376eb29ef03 | 2 | public void fromJSONObject(JSONObject o) {
try {
setID((String) o.remove(KEY_ID));
setFirstName((String) o.remove(KEY_FIRST_NAME));
setLastName((String) o.remove(KEY_LAST_NAME));
setTribe((String) o.remove(KEY_TRIBE));
setPicture((String) o.remove(KEY_PICTURE));
setCastDate(Utils.numToInt(o.remove(K... |
0555b142-5f5d-4be8-8b28-a40990b1b4e9 | 5 | public void applyForce(float x, float y) {
body.addForce(new Vector2f(x * vitesseX, y));
// if the force applied is up into the air the actor is
// considered to be jumping
if (y < 0) {
saut = true;
}
// if the actor has just changed direction kill the x velocity
// cause thats what happens in platfo... |
0e9b77c7-6761-406c-bbd9-023b38536b66 | 5 | public Point getSpawnLocation(){
Point p = new Point(0,0);
if(blocksForeground != null){
for(int x = 0; x < blocksForeground.length; x++){
for(int y = 0; y < blocksForeground[x].length; y++){
if(blocksForeground[x][y] != null){
if(blocksForeground[x][y] instanceof BlockSpawn){
p.x = blocks... |
6e1e6ae4-eb3f-48f4-b1f2-6dcb51a6e6d8 | 0 | public void setResting(int resting) {
this.resting = resting;
} |
79a5a4fd-1d06-4244-b2bf-c1bc3e2ba97b | 1 | public double[] nextDoubleArray() throws Exception {
String[] line = reader.readLine().trim().split(" ");
double[] out = new double[line.length];
for (int i = 0; i < line.length; i++) {
out[i] = Double.valueOf(line[i]);
}
return out;
} |
eae858d3-a8e3-4ea6-b4b7-7c6295b66336 | 6 | public void createOutline(int i) {
this.selectedShape = shapes.get(i);
isShapeSelected = true;
if (selectedShape instanceof Square) {
createOutlineForSquare((Square) selectedShape);
}
else if (selectedShape instanceof Rectangle) {
}
else if (selectedShape instanceof Circle) {
}
else if (sel... |
6d0d0479-9166-495f-9223-f39cfc3374f0 | 5 | public boolean isSyncMark(int headerstring, int syncmode, int word)
{
boolean sync = false;
if (syncmode == INITIAL_SYNC)
{
//sync = ((headerstring & 0xFFF00000) == 0xFFF00000);
sync = ((headerstring & 0xFFE00000) == 0xFFE00000); // SZD: MPEG 2.5
}
else
{
sync = ((headerstring & 0xFFF80C00) ==... |
82680bd1-8d8d-4f75-ad16-45a268996c7a | 8 | public static Highscore [] load(InputStream in)
throws IOException {
Vector highscores=new Vector(20,40);
InputStreamReader inr = new InputStreamReader(in);
String line;
while ( (line=jgame.impl.EngineLogic.readline(inr)) != null ) {
Vector fields = new Vector(5,10);
// XXX we use "`" to represent empty ... |
40eb3042-9ea3-4d34-871b-2555599e4b2b | 5 | public void firstClassify() {
// 根据初始向量分类
for (int i = 0; i < InstanceNumber; i++) {
float min = 0f;
int clsId = -1;
for (int j = 0; j < classData.length; j++) {
// 欧式距离
float newMin = calDis(classData[j], data[i]);
if (clsId == -1 || newMin < min) {
clsId = j;
min = newMin;
}
... |
57a8a96d-51e2-496c-8850-7d35f1a6dded | 0 | public int getY() {
return y;
} |
4905ca50-4929-477c-bdb7-477adce70adf | 1 | public void mergeInfo(Instruction instr, StackLocalInfo info) {
if (instr.getTmpInfo() == null) {
instr.setTmpInfo(info);
info.instr = instr;
info.enqueue();
} else
((StackLocalInfo) instr.getTmpInfo()).merge(info);
} |
18e8f905-229c-45dc-b31e-255700e0a21a | 5 | @Override
public void execute(TransitionEvent event) throws Exception {
System.out.println("Sending data so Server");
if(this.out == null) {
this.out = this.bean.getOut();
}
if(this.sender == null) {
initializeDataSender();
}
if(Statics.ACK.equals(event.getIdentifier())) {
Object parameter = ev... |
97acdc09-430e-4b60-9255-6e5dc697f3aa | 3 | public Type getSubType() {
if ((clazz == null && ifaces.length == 1) || ifaces.length == 0)
return tRange(this, tNull);
/*
* We don't implement the set of types, that are castable to some of the
* given classes or interfaces.
*/
throw new jode.AssertError(
"getSubType called on set of classes and... |
b9584fea-88c2-4fc6-9723-2ee59d2b4c04 | 2 | public boolean triggerEvent(String identifier)
{
for(Event e: events){
if(e.getIdentifier().equals(identifier))
return e.triggerEvent();
}
return false;
} |
ed82db29-770d-4ab1-9627-fcaf8613f851 | 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 ItItem)) {
return false;
}
ItItem other = (ItItem) object;
if ((this.itSerie == null && other.itSerie != null) ... |
34f830e8-2e96-4d41-a654-930624879a5d | 8 | public static boolean isOpposite(Types.ACTIONS a1, Types.ACTIONS a2){
if(a1 == Types.ACTIONS.ACTION_LEFT && a2 == Types.ACTIONS.ACTION_RIGHT){
return true;
}
if(a2 == Types.ACTIONS.ACTION_LEFT && a1 == Types.ACTIONS.ACTION_RIGHT){
return true;
}
if(a1 == Types.ACTIONS.ACTION_U... |
25a056ab-9371-4f07-95f3-aac2275772ac | 0 | public boolean isProcessed()
{
return processed;
} |
7254ec77-2822-4b2b-a35f-516892455a16 | 4 | private static void buildSinCosTables() {
final double result[] = new double[2];
/* Use taylor series for 0 <= x <= 6/8 */
for (int i = 0; i < 7; i++) {
double x = i / 8.0;
slowSin(x, result);
SINE_TABLE_A[i] = result[0];
SINE_TABLE_B[i] = result... |
ff71dfb6-6a9b-4b0a-a640-c8410a3b60d8 | 9 | public void lisaaNappulatLaudalle() {
for (int i = 0; i <= 7; i++) {
if (i == 0 || i == 7) {
Torni mtorni = new Torni("musta");
Torni vtorni = new Torni("valkoinen");
ruudukko[0][i].asetaNappula(mtorni);
ruudukko[7][i].asetaNappula(vtor... |
cc8930ad-b8c9-42f2-a748-73c6fb07bfb0 | 3 | double rate(Board board)
{
int[] through = new int [board.getWidth()];
int troughCount = 0;
for(int x = 0; x < board.getWidth(); x++)
{
int height = board.getColumnHeight(x);
//store the hieght for each coloumn
if(height > 0 && board.getGr... |
047251e2-3d21-4e3d-be9b-8ddb6b5b0c25 | 1 | public Statement conexion()
{
try
{
Connection conector = null;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver") ;
conector = DriverManager.getConnection("jdbc:odbc:bdproductos");
Statement consulta = conector.createStatement();
retu... |
7dc6e34f-a642-4071-8d95-4311a84085eb | 4 | void kill ()
{
if (MacOSX.trace)
System.err.println ("kill bus" + this);
// notify any listeners that the bus died, and
// clear backlinks that we control
//if (listeners.size () > 0) {
synchronized (devices) {
if (MacOSX.trace)
System... |
5790c1c0-8098-4635-b5c1-c44432d103dd | 9 | private String getRoleFromSRL(View srlvu, String verb, int start, int end) {
String role="";
List<Constituent> consts = srlvu.getConstituents();
for (Constituent conIns : consts ) {
if (conIns.getSurfaceString().equals(verb)) {
List<Relation> incomRel = conIns.getOutgoingRelations();
for( Relation re... |
e005da60-de0a-48d9-8676-ffac0e7f02da | 8 | private void loadNodesFromXMLNode(Node graphElement) {
NodeList moleculenodes = graphElement.getChildNodes();
for (int i = 0; i < moleculenodes.getLength(); i++) {
Node moleculenode = moleculenodes.item(i);
// Graph/Nodes/Node
if (moleculenode.getNodeName().equals("No... |
a5c8551c-279c-4b39-9e35-7bfc092cba93 | 4 | @SuppressWarnings("resource")
public static JarEntry[] getJarEntriesIn(File jarFile)
{
final ArrayList<JarEntry> entries = new ArrayList<JarEntry>();
if (!jarFile.toString().endsWith(".jar")) throw new IllegalArgumentException("File isn't a Jar! " + jarFile.toString());
try
{
final JarFile jar = new JarF... |
7bc2803c-976e-47e4-be5c-97fbca313a81 | 4 | @Override
public void run() {
BackupFile file = DistributedBackupSystem.fManager.getFileByName(filename);
if(file != null) {
byte[] fileID = file.getFileID();
FileManager.returnTypes result = DistributedBackupSystem.fManager.deleteFile(fileID);
if(result != FileManager.returnTypes.FAILURE) {
result = ... |
82d8bd68-6b07-4f4a-bf85-7efbee699288 | 9 | public void translate(Object cell, double dx, double dy) {
Rectangle2D rect = getBounds(cell);
if (isMoveable(cell) && rect != null) {
int numChildCells = model.getChildCount(cell);
boolean hasChildren = false;
for (int i = 0; i < numChildCells; i++) {
Object childCell = model.getChild(cell, i);
if... |
991597c0-a7d7-4529-a0b3-4024963f249e | 3 | public static Long getLongNullable(ByteBuffer in)
{
int a = in.get() & 0xFF;
if (a == NULL)
{
return null;
}
int sign = (a & BYTE_SIGN_NEG);
long value = (a & 0x1FL);
int shift = -2;
while ((a & BYTE_MORE) != 0)
... |
79fdec0d-b411-4072-bef9-fa13fcc8affa | 0 | public FloorTile(Sprite sprite, String id){
super(sprite, id);
} |
7a9869ef-625b-4fa9-a06e-6c04ff4f6258 | 2 | @Override
public ParseResult<T, List<A>> parse(LList<T> tokens) {
List<A> results = new ArrayList<A>();
LList<T> restTokens = tokens;
for(Parser<T,A> p : this.parsers) {
ParseResult<T, A> r = p.parse(restTokens);
if(r.isSuccess()) {
restTokens = r.getRestTokens();
results.add(r.getValue());
} el... |
3d3c3915-faf0-4137-b89f-eecace108b35 | 0 | public String methodWithArg(String arg)
{
return "arg";
} |
c842e63a-3647-4ebc-ac54-61e3e80a0def | 6 | @Override
void update(int delta) {
super.update(delta);
if (!HeroInfo.INSTANCE.isHeroAlive()) {
stateMachine.changeState(StateName.toCastle);
return;
}
if (!stateMachine.isHeroWithinAggroRangeAndReachable()) {
stateMachine.changeState(StateName.toCastle);
return;
}
if (!enemy.isRangedAttacker... |
ad024be5-a7ac-4597-9f33-2dc72d4805f5 | 0 | public OPMLFileFormat() {
super();
} |
3355d780-f216-4895-bb31-4d4cd86ea96a | 3 | public void layoutContainer(Container parent) {
Debug.println("layout","layoutContainer:");
if (!validWidths)
return;
Component[] components = parent.getComponents();
Dimension contSize = parent.getSize();
int x = 0;
for (int i=0; i<components.length; i++) {
int row = i / COLUMNS;
int col = i % COL... |
fb0a4a1e-cce5-4614-9809-f179e221e8ad | 0 | public int x()
{
return x;
} |
85c9f675-d8c2-41d9-ba96-e65a045be216 | 6 | public String getArgs() {
int count = 0;
for (int i = 0; i < targets.size(); i++) {
Target curTarget = targets.get(i);
curTarget.target.setArgument(curTarget.text.getText());
if (!curTarget.target.getArgument().equals(""))
if (valueOf(curTarget.repeat.getText()) > 0)
count += valueOf(curTarget.... |
231dc411-f8e6-47e8-b0eb-3ba2fb3707af | 8 | public LogDescriptor parseDescriptor() throws XMLStreamException{
int event = reader.next();
boolean splitterDone = false;
boolean parserDone = false;
LineSplittingStrategy splitter = null;
LogItemParser parser = null;
while(!foundItemEnd(event,"logDescriptor")){
... |
53180456-8c68-498a-a733-0905172c7d9f | 4 | public void draw(Graphics2D g2)
{
logicSolve();
setColor();
for(int i=0; i<9; i++)
{
for(int j=0; j<9; j++)
{
grid[i][j].draw(g2);
}
}
for(int i=0; i<3; i++)
{
for(int j=0; j<3; j++)
... |
8c981c0e-b142-417e-817b-356c469137ad | 1 | private void addOximata(){
/*
* vazei ta oximata tis vashs sthn lista
*/
ArrayList<String> oximata=con.getOximata();
for(int i=0;i<oximata.size();i++){
oximataBox.addItem(oximata.get(i));
}
} |
04aab009-3717-4d61-ac05-efde964cfc00 | 3 | public void AlteraUsuario() {
Usuario usuario = new Usuario();
BotaoAcao bt = new BotaoAcao(this);
if(jTTabela.getSelectedRow()!= -1){
usuario.setNome(jTNome.getText());
usuario.setDtcadastro(jDtCadastro.getDate());
usuario.setDtnascimento(jDtNascimento.getDate());
... |
61bc0065-34a4-441e-8bff-fe32f460ed2d | 4 | public void drawSprites() {
// loop through the sprites to draw the lights (want the under all sprites)
for (int i = 0; i < sprites.size(); i++) {
// load the sprite
PlayerSprite s = sprites.get(i);
// always draw from identity transform
try {
g2d.setTransform(identity);
}... |
4ff6a634-7e6d-4e68-bc71-105862a9dfe0 | 8 | public String input(String data, cServ serv, Printer print, Serial sr) {
String[] input = data.split(" ");
if (data.equals("stop")) {
System.out.println("stopping server...");
serv.stop();
} else if (data.equals("debug")) {
boolean tmp;
print.set(tmp = !print.get());
if (tmp) {
System.out.pri... |
2c1730d3-4885-4683-a285-93136e1db87b | 0 | public boolean childReady() {
return dynamicStats.get(StatType.D_EATEN).getValue() >= 30.0;
} |
3e38add5-094a-4586-ac77-9f404e1b0235 | 0 | public boolean isStaff() {
return _prefix.indexOf('s') >= 0;
} |
8e5d4a88-908c-4f42-9475-5ded422fda1c | 0 | public void setPriority(int priority)
{
this.priority = priority;
} |
3aa88e14-a496-4dbd-ad3c-ccf04780ed63 | 2 | @Override
public void paintComponent (Graphics g) {
if (isEnabled()) {
if (isHovered)
HOVER.paintIcon (this, g, 0, 0);
else ACTIVE.paintIcon (this, g, 0, 0);
} else INACTIVE.paintIcon (this, g, 0, 0);
} |
0ede5262-83a4-41bd-b905-40a90e2206e2 | 1 | public void clean() {
Iterator<Agent> it = agents.iterator();
Agent agent;
while (it.hasNext()) {
agent = it.next();
agent.removeConnection(this);
}
} |
3806ccf7-4d4a-4973-8812-5a7120489694 | 2 | public static ArrayList<QuizCreatedRecord> getRecentQuizCreatedRecord() {
ArrayList<QuizCreatedRecord> records = new ArrayList<QuizCreatedRecord>();
String statement = new String("SELECT * FROM " + DBTable);
PreparedStatement stmt;
try {
stmt = DBConnection.con.prepareStatement(statement);
ResultSet rs = ... |
2e3bb77a-f0ab-434f-a556-980f3ff22b31 | 9 | public Tex rendered() {
if (rnm == null) {
boolean hv = (type & 2) != 0;
BufferedImage nm = null;
if (name.length() > 0)
nm = Utils.outline2(nfnd.render(name, BuddyWnd.gc[group]).img, Utils.contrast(BuddyWnd.gc[group]));
int w = 0, h = 0;
... |
ad908559-5117-48af-9fed-37922623d62b | 0 | private void program()
{
nextToken();
declarationList();
expect(Token.Kind.EOF);
} |
1c977a5f-8936-4a20-9233-ea1d2cbf2bb0 | 1 | public void addRetPhis(final Subroutine sub) {
final Iterator paths = sub.paths().iterator();
while (paths.hasNext()) {
final Block[] path = (Block[]) paths.next();
addRetPhi(sub, path[1]);
}
} |
30f6fa3f-6022-4e16-89d5-b72267b91493 | 5 | @Override
public void executeTask() {
setTaskId("QueryRoutingTableTask");
try {
dataGramSocket = new DatagramSocket(PORT);
dataGramSocket.setSoTimeout(5000); // 3 seconds
selfClient = new Client();
selfClient.setCurrentIP(InetAddress.getLocalHost().getHostName());
selfClient.setRouterName(queryUse... |
3aa2d7b1-3e9b-464b-82cf-49c82f97f39f | 9 | @Override
public CMMsg postWeaponAttackResult(MOB source, MOB target, Item item, boolean success)
{
if(source==null)
return null;
if(!source.mayIFight(target))
return null;
Weapon weapon=null;
int damageInt = 0;
if(item instanceof Weapon)
{
weapon=(Weapon)item;
damageInt=adjustedDamage(source,... |
dc2c514e-3065-46ef-9e61-03a95f00fe99 | 4 | private String displaySize(int iSize){
int divby =0;
while(iSize>=1024){
iSize = iSize/1024;
divby++;
}
switch(divby){
case 0:
return iSize+""; //bytes
case 1:
return iSize+"kB";
case 2:
return iSize+"mB"; //bytes
}
return "0";
} |
b4af1652-60ad-4d47-b246-8e5dba4ad04c | 5 | @Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Point point = (Point) o;
if (x != point.x) return false;
if (y != point.y) return false;
return true;
} |
824139fb-bb93-4127-b689-6ff065ea4216 | 7 | public RomanNumeral(char numeral) {
this.numeral = numeral;
if (numeral == 'I')
value = 1;
if (numeral == 'V')
value = 5;
if (numeral == 'X')
value = 10;
if (numeral == 'L')
value = 50;
if (numeral == 'C')
value = 100;
if (numeral == 'D')
valu... |
2da28f79-1cc2-48a5-9598-af243b60e01e | 2 | public int isThisOneOfOurs (String docPathName) {
/* TODO:
* this stoopid brute search works fine for extremely small sets
* but it'll bog quickly as doc set sizes grow > 10
*
* stan sez he'll fix this Real Soon
*
* his cheap solution: an ordering array ...
* int docAlfaOrder[sizeOfDocSet... |
3ba64513-a0e3-4b5e-96e2-05f22f2a1805 | 8 | @Override
public void executeMsg(final Environmental myHost, final CMMsg msg)
{
super.executeMsg(myHost,msg);
if((affected instanceof MOB)
&&(msg.amISource((MOB)affected))
&&((msg.sourceMinor()==CMMsg.TYP_LOOK)||(msg.sourceMinor()==CMMsg.TYP_EXAMINE)))
{
final Environmental target=msg.target();
if((in... |
9b75e968-c3ac-4bd4-85d9-e0c8780ed417 | 2 | private void process() {
while(!destructibles.empty()) {
((Destructible) destructibles.pop()).destroy();
System.gc();
try {Thread.sleep(SLEEP_SHORT);} catch (InterruptedException e) {}
}
} |
18026df2-1d2a-44bb-932b-144200c2971e | 5 | public int getAccountTypeAsInt() {
int typeInt;
if (accountType==Type.INSTRUCTOR) {
typeInt = 4;
}
else if (accountType==Type.TATMMARKER) {
typeInt = 5;
}
else if (accountType==Type.ACADEMICADMIN) {
typeInt = 2;
}
else i... |
f7f0c486-2871-4071-acf9-c2df7b7266be | 3 | @Override
public void keyReleased(KeyEvent ke) {
if ((ke.getSource().equals(xPos)) || (ke.getSource().equals(yPos))) {
Integer x = Integer.decode(xPos.getText());
Integer y = Integer.decode(yPos.getText());
setupData.setAnchorPoint(new Point (x, y));
}
if (ke.getSource().equals(fWidth)) {
setupData.s... |
f2ed453f-3e4d-48f1-85d5-ff5b913f510c | 7 | public double run(int iterations, int sleeptime)
{
c.reset();
hit_obstacle = false;
boolean successful_last_move = true;
for (int i = 0; i < iterations; i++){
try {
Thread.sleep(sleeptime);
} catch (InterruptedException e) {
// Auto-generated catch block
e.printStackTrace();
}
//System.... |
2c3063b8-0375-43a3-8b80-46e3c13df292 | 8 | public String toString() {
String res;
switch (getSuit()) {
case CLUBS:
res = "Clubs";
break;
case DIAMONDS:
res = "Diamonds";
break;
case HEARTS:
res = "Hearts";
break;
... |
7da33945-ef0a-4c75-8f33-a4e3dcd0e8c6 | 3 | private static void walk(File path) throws IOException
{
if(path.isDirectory())
{
for(File child : path.listFiles())
{
walk(child);
}
}
else if(path.getName().endsWith(".jar"))
{
byte[] xz = compress(path);
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.