method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
18e30dbc-748c-47b0-b268-6e50ed1a08ee | 7 | public static boolean discoverMissingValues(ArrayList<LearningObject> learningSet, ArrayList<Attribute> attributes, ArrayList<ClassCategory> classes){
//apply algorithm if and only in only one attribute has missing values in learning set
//let the class become ordinary attribute
//new classes from attribute... |
1902db3c-5fea-45da-8412-bec504a2c2ff | 5 | private static boolean onlyDigits(String s) {
if (s == null || s.length() == 0) {
return false;
}
for (int i = 0; i < s.length(); i++) {
char c = s.charAt(i);
if (c < '0' || c > '9') {
return false;
}
}
return true;
... |
76cfe063-30be-4331-a1e2-264fa64cfb72 | 3 | public static byte[] gzip(String input) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
GZIPOutputStream gzos = null;
try {
gzos = new GZIPOutputStream(baos);
gzos.write(input.getBytes("UTF-8"));
} catch (IOException e) {
e.printStackTrace();
... |
5fc3beab-8287-4467-bdf2-8f229c194e59 | 1 | public void uimsg(String msg, Object... args) {
if(msg == "p") {
text = Text.renderf(FlowerMenu.pink, "%d%%", (Integer)args[0]);
} else {
super.uimsg(msg, args);
}
} |
13cab793-6d00-46f8-b08f-9f0424472164 | 8 | public void writeTwoBools(boolean[] tree, boolean[] message) throws IOException {
LinkedList<Boolean> boolList = new LinkedList<Boolean>();
for(boolean b : tree)
boolList.add(b);
for(boolean b : message)
boolList.add(b);
ArrayList<Byte> byteBuffer = new ArrayList<Byte>();
int length = tree.length +... |
4ab18d9b-6ae8-4dba-a5a3-128fe3fe36b7 | 5 | public void mousePressed() {
Marker hitMarker = map.getFirstHitMarker(mouseX, mouseY);
if (hitMarker != null) {
pointedState = hitMarker.getProperties().get("NAME").toString();
for (int i = 0; i < climateArray.length; i++) {
if (hitMarker.getProperties().get("NAME").toString()
.equalsIgnoreCase(cl... |
7935038c-a960-4d32-b067-8ca822417ec6 | 5 | public static void main(String[] args)
{
if (args.length == 1)
{
try
{
chargenTCP(args[0]);
}
catch (IOException e)
{
e.printStackTrace();
System.exit(1);
}
}
else... |
cc915e0a-22f3-4a36-a5ec-974b2e36d04e | 6 | @Override
public Authentication attemptAuthentication(HttpServletRequest request,
HttpServletResponse response) throws AuthenticationException {
if (postOnly && !request.getMethod().equals("POST")) {
throw new AuthenticationServiceException("Authentication method not supported: " + re... |
9a04f84c-896e-4041-b8c1-6ad7036cb52e | 1 | public void go()
{
do
{
play();
} while(check());
turnInfo();
gameInfo();
} |
33e11728-a1b2-4728-8d71-f4e9dd199242 | 9 | private static Class getClassMatchingAllChildren(OgnlContext context, Node[] _children) {
Class[] cc = getChildrenClasses(context, _children);
Class componentType = null;
for (int j = 0; j < cc.length; j++) {
Class ic = cc[j];
if (ic == null) {
componentTy... |
3c610cc1-3bd2-4615-8662-1631a45f3f62 | 7 | @Override
public void unInvoke()
{
if(canBeUninvoked())
{
if(affected instanceof MOB)
{
final MOB mob=(MOB)affected;
if((buildingI!=null)&&(!aborted))
{
amountMaking=amountMaking*(baseYield()+abilityCode());
if(messedUp)
commonEmote(mob,L("<S-NAME> ruin(s) @x1!",buildingI.name())... |
49013682-bd02-424e-a9a3-e394b54e0f7e | 6 | @EventHandler
public void EnderDragonHarm(EntityDamageByEntityEvent event) {
Entity e = event.getEntity();
Entity damager = event.getDamager();
String world = e.getWorld().getName();
boolean dodged = false;
Random random = new Random();
double randomChance = plugin.getEnderDragonConfig().getDouble("EnderDr... |
3ee74940-aaad-45bc-8ec9-8439c03fd36c | 2 | public void addEffectsToGrid(List<Effect> effects) {
if (effects == null)
throw new IllegalArgumentException("Effects can't be null!");
for (Effect effect : effects) {
addEffectToGrid(effect);
}
} |
d28b9b46-a4f5-40d6-9665-1e6a32b449cf | 2 | public void testGet() {
MonthDay test = new MonthDay();
assertEquals(6, test.get(DateTimeFieldType.monthOfYear()));
assertEquals(9, test.get(DateTimeFieldType.dayOfMonth()));
try {
test.get(null);
fail();
} catch (IllegalArgumentException ex) {}
tr... |
f4676306-88c1-4650-9f40-95d77f2d106e | 3 | public double[][] Dmxm(double a[][], double b[][]) {
double w;
double c[][] = new double[3][3];
TRACE("Dmxm");
/* Multiply into scratch matrix */
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
w = 0.0;
for (int k = 0; k < ... |
f4fbca03-f77b-41cf-beb6-3e6218d3c90a | 1 | public void getBytes(int len, int off, byte buf[]) { // readBytes
for (int i = off; i < off + len; i++) {
buf[i] = payload[offset++];
}
} |
7aabe9ba-84db-4c47-bc4c-a1f18a927353 | 9 | public static void main(String[] args) {
if(args.length != 2) {
System.err.println("Syntax: RemoteControl <target IP> <command>");
System.exit(1);
}
String ip = args[0];
String cmd = args[1];
checkIP(ip);
// Send the command to the other s... |
d97d60a8-9e97-4c86-9bea-65d1b3280822 | 9 | public String stSendEmailWithCaptcha(int dataId,int ExpVal,String flow )
{
int actVal=1000;
String returnVal=null;
hm.clear();
hm=STFunctionLibrary.stMakeData(dataId, "Email");
String action = hm.get("Action");
STCommonLibrary comLib=new STCommonLibrary();
Vector<String> xPath=new Vec... |
06f4045e-ba7c-4c3b-a4db-6e009027480a | 0 | public String getFromDate() {
return fromDate;
} |
20982c7c-8272-449a-8c7c-eddc5d48927d | 6 | public void download() {
// This is the core web/download i/o code...
InputStream input = null;
StringBuilder contents = null;
try {
URL url = new URL(urlString);
URLConnection connection = url.openConnection();
// Set connect() to throw an IOException
// if connection does not succeed in this m... |
c16a1134-0452-41e4-8a00-ef2976506031 | 3 | @Override
public String execute() {
if (databaseContext.table == null) {
return "no table";
}
try {
Storeable storeable = ((DataBase) databaseContext.table).putStoreable(arguments.get(1), jsonStr);
if (storeable == null) {
return "new";
... |
c8c4f9fe-eb9e-4a72-b57a-1b938c1481f4 | 7 | @Override
public void initializeEdge() {
// TODO Auto-generated method stub
super.initializeEdge();
double dist = startNode.getPosition().distanceTo(endNode.getPosition());
//System.out.println("Distancia na edge: "+dist);
if(dist < 399){
setParam(0.001f, 0.24f, 11.f);
return;
}
if(dist >= 399 &... |
f2f31913-2d70-4358-8a0d-cbb57ba2da42 | 3 | public static Texture2D load2DTexture(URI uri) {
BufferedInputStream bis = null;
ByteBuffer texCoords = null;
try {
File file = new File(uri);
//Idiot checking
if(!file.exists() || !file.isFile()) {
System.err.println("File doesn't exist or was not a File, aborting!");
return null;
}
... |
1d9703b0-9b03-4d31-83a7-4d91d60453ff | 9 | public static void shop(Character character, Scanner console) throws FileNotFoundException {
System.out.println();
character.getInventoryManager().printInventory(); //////////
System.out.println("Welcome to the shop. Feel free to browse.");
System.out.print("Would you like to buy, sell, or exit? ");
Scanner n... |
67c8a1be-74cd-4a55-981e-94899416f2b6 | 0 | public void windowClosed(WindowEvent e) {
System.out.println("Die Anwendung wurde geschlossen...");
} |
f1536269-7387-4be7-bb1b-e6b04888f7fa | 3 | public static void main(String[] args) {
ArrayList<Card> cardsAvalible = addCards();
ArrayList<Card> randDeck;
double trials = 500;
double avgTurns;
double bestAvgTurns = 20;
while(true){
Deck d1 = new Deck();
d1.randomDeck((ArrayList<Card>) cardsAvalible.clone());
randDeck = d1.getCard... |
1d024090-719f-4351-bfc9-2db202f77ada | 9 | protected void writeData(XMLStreamWriter writer, Grid<?> s) throws XMLStreamException {
writer.writeStartDocument();
writer.writeStartElement("VTKFile");
writer.writeAttribute("type", "ImageData");
writer.writeStartElement("ImageData");
writer.writeAttribute("WholeExtent", "0 " + (s.getRange(0)) + " 0 " + (s.... |
4534bddc-1126-4422-9d2a-0fac5a89c508 | 7 | public Measurement[] getModelMeasurements() {
List<Measurement> measurementList = new LinkedList<Measurement>();
measurementList.add(new Measurement("model training instances",
trainingWeightSeenByModel()));
measurementList.add(new Measurement("model serialized size (bytes)",
... |
c7d1318d-b32c-43b1-9169-5034c0031c68 | 7 | private void btSalvarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btSalvarActionPerformed
Editor e = new Editor();
if (!(txCodigo.getText().equals("")) || (txCodigo.getText().equals(null))){
e.setId_editor(Integer.parseInt(txCodigo.getText()));
}
... |
c4d0eae5-0e23-4f19-9580-239cd6761e48 | 8 | public String command(final CommandSender sender, Command command, String[] args) {
sender.sendMessage(Formatting.replaceAmpersand(plugin.getString(Language.IMPORT_LOADING)));
try {
BufferedReader banlist = new BufferedReader(new FileReader("banned-players.txt"));
String p;
... |
2abef843-ecc9-4b97-bff0-f45cc192a9b6 | 2 | public void disable() throws IOException {
// This has to be synchronized or it can collide with the check in the task.
synchronized (optOutLock) {
// Check if the server owner has already set opt-out, if not, set it.
if (!isOptOut()) {
configuration.set("opt-out"... |
37e2ea29-a305-4a75-bf49-8434c038c9aa | 9 | public static List<Class<?>> processJarfile(String jarPath) {
List<Class<?>> classes = new ArrayList<Class<?>>();
JarFile jarFile;
try {
jarFile = new JarFile(jarPath);
// get contents of jar file and iterate through them
Enumeration<JarEntry> entries = jarFile.entries();
while (entries.hasMoreE... |
c1e51ba5-9000-4ad1-a5e5-8259e49e5dc4 | 1 | private double[] calculateSocialVelocity(int particle, double r2) {
double[] socialVelocity = new double[position[particle].length];
int nBest = neighbourhood.neighbourhoodBest(particle);
for(int k = 0; k < socialVelocity.length; k++){
socialVelocity[k] = socialConstant * r2 * (personalBest[nBest][k] - positio... |
c48ba805-2501-4c26-ae82-f4a1ea292ce6 | 3 | private void timeMove(double voltage, double seconds) {
long milis = (long)(seconds * 1000);
long time = System.currentTimeMillis();
while (System.currentTimeMillis() < time + milis) {
drive.GoForward(voltage);
if (System.currentTimeMillis() - time > 10)
try {
Thread.sleep(10);... |
6fbe576c-ec4c-4927-a520-70bfa967f9e2 | 0 | public void setPrpEstado(String prpEstado) {
this.prpEstado = prpEstado;
} |
c7ab20f2-a394-4cdf-b4ad-fc1a99879c1e | 3 | public static void main(String[] args) {
try {
if (args.length > 0) {
List<HashMap> responses = GoEuroClient.getInfo(args[0]);
String csvFileName = "output.csv";
if (args.length > 1)
csvFileName = args[1];
System.ou... |
f95b2e19-c527-410f-9f47-cce78b5907ca | 9 | public void render(Vector2 pos, Vector2 dim)
{
switch(renderType)
{
case SOLID:
Renderer.drawRect(pos, dim, color, alpha);
break;
case TEX:
if(tex != null)
{
if(tex.isLinearScaling() != linearScaling)
tex.setLinearScaling(linearScaling);
if(tex.isRepeat() != repeat)
tex.setRepeat(... |
1f688c72-abe6-4f64-ae94-a09e468c6212 | 6 | public void blinkparticle() {
if (untouchable > 0) {
if (blink > 15 && blink <= 30) {
setImage(invin);
}
else if (blink >= 0 && blink <= 15) {
setImage(empty);
}
}
else if (untouchable == 0) {
getWorld()... |
32909f53-824a-4553-baec-7fd9fe372ae1 | 5 | public void makeflavor() {
fo.clear();
Coord c = new Coord(0, 0);
Coord tc = gc.mul(cmaps);
for (c.y = 0; c.y < cmaps.x; c.y++) {
for (c.x = 0; c.x < cmaps.y; c.x++) {
Tileset set = sets[tiles[c.x][c.y]];
if (set.fla... |
69ffdf91-3d7d-4672-9251-aa5052f8e2d1 | 0 | public Osoba getOsoba(int index) {
return data.get(index);
} |
51e99e22-fdb5-47c2-b22c-2bfe4976f901 | 2 | public <T> Collection<T> filter(Collection<T> collection, Predicate<T> predicate){
ArrayList<T> temp = new ArrayList<T>();
for(T t : collection){
if(predicate.evaluate(t)){
temp.add(t);
}
}
return temp;
} |
9ca11ac6-9bd7-45cd-a66f-751bdaa7d958 | 1 | private void startMatrix() {
if (!timer1.isRunning()) {
timer1.start();
timer2.start();
}
} |
c4fda2da-228e-45d7-8b7e-f151f8c30d5b | 3 | private static void printIt2(ParseResult<Token, DataBlock> v6) {
if(!v6.isSuccess()) {
print("oh noes, parsing failed: ");
print("tokens left: " + v6.getRestTokens().size());
LList<Token> toks = v6.getRestTokens();
int i = 0;
for(Token t : toks) {
if(i > 20) break;
print(t.type + ", " + t.value... |
8cbcc29b-a7c1-443f-95b7-af4df5f6ea2a | 0 | @Override
public void fetch() {
Thread fetcher = new FetcherThread();
fetcher.start();
} |
e88949cb-a997-4e6b-9ad5-9fc9aa8b59f6 | 2 | private static <T> T[] toObjectArray(Object array) {
if (!array.getClass().getComponentType().isPrimitive())
return (T[]) array;
int length = Array.getLength(array);
Object[] ret = new Object[length];
for(int i = 0; i < length; i++)
ret[i] = Array.get(array, i);
... |
11337e15-0fe9-413b-a053-5a1a21ed0961 | 0 | public static String getWebClassesPath() {
String path = WebUtils.class.getProtectionDomain().getCodeSource()
.getLocation().getPath();
return path;
} |
07e170ff-e896-473c-842c-f8fec2af0b48 | 2 | public boolean keyExists(String key) {
try {
return (this.containsKey(key)) ? true : false;
} catch (Exception ex) {
return false;
}
} |
3f41ae98-c5fc-4eb4-aabe-2cfae0f0b427 | 6 | public static double runATrial(int patientIDToLeaveOut) throws Exception
{
BufferedReader reader = new BufferedReader(new FileReader(new File(ConfigReader.getChinaDir()
+ File.separator + "phylum_taxaAsColumnsLogNorm_WithMetadataNonRare.txt")));
reader.readLine();
File outFile = new File(ConfigReader... |
6e0c2dbf-75ed-4bd3-bad8-b096f2d1b346 | 4 | public synchronized UUID bind( InetAddress address,
int port,
//Map<String,BasicType> bindSettings
Environment<String,BasicType> bindSettings
)
throws IOException,
GeneralSecurityException {
if( bindSettings.get(Constants.CONFIG_SERVER_PROTOCOL) == null )
bindSettings.put( ... |
b45c069f-8f0f-480e-b530-6efa4064462e | 6 | @Override
public FileHandle openFile(String path, boolean read, boolean write)
throws PathNotFoundException, AccessDeniedException, NotAFileException {
File open = getFile(path);
if (!open.exists())
throw new PathNotFoundException(path);
if (!open.isFile())
throw new NotAFileException();
if (write ... |
7c1ee1ac-1efb-4bf8-acd6-75f9022e8038 | 8 | @Override
public void paint(Graphics g) {
super.paint(g);
player.draw(g);
Font font = new Font("Courier New", Font.PLAIN, 32);
g.setFont(font);
g.setColor(Color.WHITE);
Graphics2D g2d = (Graphics2D) g;
FontRenderContext frc = g2d.getFontRenderContext();
... |
348499c6-da71-441b-b064-a3d04aa56c89 | 0 | public ProtocolSignUp(String username, int port) {
mUserName = username;
mPort = port;
} |
afa8a778-1800-440e-aab3-cd12129d7f54 | 0 | public static void start() throws Exception {
_poolManger = ServiceManager.getServices().getRequiredService(
ITicketPoolManager.class);
// 在disruptor启动之前打开日志
openJournal();
startDisruptor();
} |
4cc01a98-83db-46e4-9e30-789edff1b63b | 8 | private Object getAdditionParameterInfo(byte type, String additionalInfo) {
Object returnValue = additionalInfo;
if(type==Query.CONSECUTIVE_MONTH) {
try {
returnValue = Integer.parseInt(additionalInfo);
} catch(NumberFormatException e) {
System.err.println("Illegal parameter for ConsecutiveMonth: " + ... |
e6ee17b6-ee97-493d-92d6-0f3a57fce09c | 7 | public void combine(String IP_PORT,String apiKey){
DBService dbService = new DBService();
HashMap data = null;
if(this.link.contains("tiaoshi")){
PageTiaoshi pageTiaoshi = new PageTiaoshi();
data = pageTiaoshi.getInfo(this.link);
}
FileService fileService ... |
21680a9b-1178-49cb-b4f6-7fd3a87139e5 | 1 | public void revive(){
if(this.estaDestruido()){
setDestruido(false);
}
} |
0d5abde9-d821-486c-9ac0-a3109932cfac | 3 | public void removeDisciplina(String codigo)
throws DisciplinaInexistenteException {
boolean teste = false;
for (Disciplina e : disciplina) {
if (e.getCodigo().equals(codigo)) {
disciplina.remove(e);
teste = true;
break;
}
}
if (teste == false) {
throw new DisciplinaInexistenteException("... |
a2e55ceb-b512-40b7-86ed-a97408b2db97 | 7 | public void updateUI(String tableName)
{
if (model != null)
{
table.setName(tableName);
System.out.println("------- TablePanel UpDate Initiated ---------");
/* get the data from the database and load it into the table model */
/* when data is loaded into the data model... |
50606174-4a87-491d-9d44-d94bd40180e2 | 8 | public void renderPlayer (int xp, int yp, Sprite sprite) {
xp -= xOffset;
yp -= yOffset;
for (int y = 0; y < 16; y++) {
int ya = y + yp;
for (int x = 0; x < 16; x++) {
int xa = x + xp;
if (xa < -16 || xa >= width || ya < 0 || ya >= height) break;
if (xa < 0) xa = 0;
int... |
ab42ac5c-d9c8-4e6d-8cf0-1edeeff4000e | 9 | @Override
public Rectangle getCellRect(int row, int column, final boolean includeSpacing) {
final Rectangle sRect = super.getCellRect(row, column, includeSpacing);
if ((row < 0) || (column < 0) || (getRowCount() <= row)
|| (getColumnCount() <= column)) {
return sRect;
}
final CellSpan cellAtt = (CellSp... |
3bceb1a8-faa8-4ae1-a743-1106b8123fb7 | 9 | public boolean isSubtype(ConcreteType that) {
if (rawType.desc.equals(RawType.coreBottom))
return true;
SuperType[] myGenericArgsForThat = rawType.superGenerics.get(that.rawType);
if (myGenericArgsForThat == null)
return false; // the raw types don't even fit
//... |
35d10a55-0a14-4364-8489-c51d3717bb94 | 7 | public Item getSpecificItem(Quality q, String name){
ArrayList<ItemInfo> list = null;
if (q == Quality.COMMON){
list = ipx.getListOf(Quality.COMMON);
}
else if (q == Quality.UNCOMMON){
list = ipx.getListOf(Quality.UNCOMMON);
}
else if (q == Quality.RARE){
list = ipx.getListOf(Quality.RARE)... |
c6916e67-b56a-4dc9-b46b-6fe6075f7c06 | 7 | public static void main(String[] args) {
final int value = 1000;
Map<Integer, String> firstDigit = new HashMap(10);
firstDigit.put(0,"");
firstDigit.put(1,"one");
firstDigit.put(2,"two");
firstDigit.put(3,"three");
firstDigit.put(4,"four");
firstDigit.put(... |
9c7d3793-7b4c-40b7-9cc1-88eda3f6722a | 6 | @Override
public void run(final String... args) {
final CommandLine line = parseArguments(args);
final String destinationFolder = line.getOptionValue(FOLDER_SHORT, System.getProperty("user.dir"));
// FIXME: Have some way to add Mp3Metadata for individual songs/artists
if (line.hasOption(SONG_SHORT)) {
for ... |
22c6d3b6-2e69-49fd-ac48-f5df908c12e9 | 1 | protected boolean canChange(int value){
Controller c = gui.getController();
if (centerCause(c.getX1(), c.getX2(), value, c.getY2(), c.getR1(), c.getR2())){
return true;
}
else{
showCenterWarning();
return false;
}
} |
e28ac70a-88f2-4b3b-af42-b97cf6dbb9c1 | 4 | public void start()
{
synchronized (optOutLock)
{
// Did we opt out?
if (isOptOut())
{
return;
}
// Begin hitting the server with glorious data
taskId = plugin.getServer().getScheduler().scheduleAsyncRepeatingTask(plugin, new Runnable()
{
private boolean firstPost = true;
public ... |
e5dcc711-46ae-40b4-96d5-846f01fa9f84 | 5 | public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
FrameLogo frame = new FrameLogo();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
try {
Clip sonido = AudioSystem.getClip();
File a = new ... |
a8007a70-b9d8-43ad-9457-11a335fde1e4 | 8 | public Emage buildEmage(Timestamp lastEmageCreationTime, long windowSizeMS) {
filterPointQueueByWindow(windowSizeMS);
this.pointQueue.addAll(this.pointStream.getAndClearNewPointsQueue());
Iterator<STTPoint> pointIterator = this.pointQueue.iterator();
GeoParams geoParams = this.pointStream.getGeoPar... |
edc3f684-4ac4-4041-971b-1bb2e4791cd1 | 4 | @Override
public void run() {//Is called only once with thread.start()
long beforeTime, timeDiff, sleep;
beforeTime = System.currentTimeMillis();
while(inGame){
repaint();
try {
checkCollision();
} catch (Exc... |
8f2e71ba-1c2a-41e2-8571-c86f673d691c | 2 | public static DaysOfWeekEnumerationx fromValue(DayTypeEnumeration v) {
for (DaysOfWeekEnumerationx c: DaysOfWeekEnumerationx.values()) {
if (c.value.equals(v)) {
return c;
}
}
throw new IllegalArgumentException(v.toString());
} |
84e9c67f-9edb-4089-b8f1-b527d80a8572 | 9 | public void run()
{
// システム情報取得
String str = System.getProperty("os.name");
mOSName = str;
str = System.getProperty("os.arch");
mOSArch = str;
str = System.getProperty("os.version");
mOSVersion = str;
str = System.getProperty("user.name");
mUserName = str;
DebugLog("user name:" + str);
DebugLo... |
e278df0b-9642-453d-ba47-92d733c40dc3 | 1 | public static SettingsWindow getInstance() {
if (instance == null)
instance = new SettingsWindow();
return instance;
} |
0d4d6197-62f8-4e44-898c-0870186755b1 | 8 | private void calculateMinesTouched(int coordX, int coordY) {
if (cellArray[coordX][coordY].type != Cell.CellType.MINE) {
int startingValueX = -1;
int startingValueY = -1;
int endingValueX = 1;
int endingValueY = 1;
int nbOfMinesTouched = 0;
if (coordX == 0) {
startingValueX = 0;
} else if (... |
1e4c1f1b-56c3-4b6b-a05c-b27107500c65 | 7 | private void configureComponents()
{
minimumSize = new Dimension(100, 60);
preferredSize = new Dimension(200, 60);
maximumSize = new Dimension(3000, 60);
notesButton = new JButton("");
notesButton.setIcon(new ImageIcon("images/Notes.jpg"));
notesButton.setToolTipText("Click this ... |
56f4a302-b39c-4f00-8ad1-bd47a6d5bc88 | 0 | public Transferencia(Cuenta destino, String concept, float importe){
super(concept, importe);
this.tipo = "transferencia";
this.destino = destino;
} |
c0e89ad6-d518-4c2a-9293-60857fb4eb3c | 9 | public boolean loadLastLevel(Component parentComponent, boolean selectMode) {
String str = editorSettings.getLastLevelFileName();
if(!selectMode && (str == null || str.trim().length() == 0)){
return false;
}
if(str == null || str.trim().length() == 0){
return loadLevel(parentComponent);
}
File select... |
e3ef806b-a783-4aca-807d-195f177eedf1 | 7 | private void populate()
{
Random rand = Randomizer.getRandom();
field.clear();
int Number_of_foxes = 0;
int Number_of_rabbits = 0;
int Number_of_korenwolfs = 0;
for(int row = 0; row < field.getDepth(); row++) {
for(int col = 0; col < field.getWidth(); col+... |
f792e69e-af73-4c9a-8ad1-b1b8c0ee9c1a | 5 | public ArrayList<MatchScheduling> scheduleSemiFinals() throws SQLException
{
ArrayList<MatchScheduling> matches = new ArrayList();
ArrayList<Team> s1Teams = new ArrayList();
ArrayList<Team> s2Teams = new ArrayList();
for (int k = 0; k <= 1; k++)
{
int homeTea... |
db7e9064-08ac-4c61-baaf-d2c12d3e78da | 9 | void compress(int init_bits, OutputStream outs) throws IOException {
int fcode;
int i /* = 0 */;
int c;
int ent;
int disp;
int hsize_reg;
int hshift;
// Set up the globals: g_init_bits - initial number of bits
g_init_bits = init_bits;
// Set up the necessary values
clear_flg = false;
n_bits =... |
8b787380-9ca4-4e97-9954-aeaa65914acb | 9 | final public ASTProgram Start() throws ParseException {
/*@bgen(jjtree) Program */
ASTProgram jjtn000 = new ASTProgram(JJTPROGRAM);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
try {
Expression();
jj_consume_token(0);
jjtree.closeNodeScope(jjtn000, true);
jjtc000 = false;
... |
474cc200-f15d-4c2d-a195-d37d5c74d687 | 0 | public PartC getPartC() {
return partC;
} |
0bb05fd1-1533-47e5-9ac6-aea98fa73f7f | 4 | public ArrayList<Prestamos> getById(Prestamos p){
PreparedStatement ps;
ArrayList<Prestamos> rows = new ArrayList<>();
try {
ps = mycon.prepareStatement("SELECT * FROM Prestamos WHERE id=?");
ps.setInt(1, p.getId());
ResultSet rs = ps.executeQuery();
... |
d0364264-ba36-421b-85c0-4581560e2102 | 4 | public boolean checkState() throws Exception
{
boolean result = false;
this.input = new FileInputStream(this.device.getAbsolutePath());
this.output = new FileOutputStream(this.device.getAbsolutePath());
this.output.flush();
Thread.sleep(this.MAX_INTERVAL * 3);
Sys... |
61319fd1-e114-4b33-a52e-2906a7871fe7 | 1 | public static DatabaseTestHelper getInstance(){
if(instance == null){
instance = new DatabaseTestHelper();
}
return instance;
} |
47911bc1-d8a5-4628-9377-12345ea9adf6 | 9 | @Override
public NewCharNameCheckResult newCharNameCheck(String login, String ipAddress, boolean skipAccountNameCheck)
{
final boolean accountSystemEnabled = CMProps.isUsingAccountSystem();
if(((CMSecurity.isDisabled(CMSecurity.DisFlag.NEWPLAYERS)&&(!accountSystemEnabled))
||(CMSecurity.isDisabled(CMSecurity.... |
8f2fd5dd-fa7d-4253-9925-34b8ec71f8bf | 7 | public static void main(String[] args) {
// Create a variable for the connection string.
String connectionUrl = "jdbc:sqlserver://localhost:1433;" +
"databaseName=AdventureWorks;integratedSecurity=true;";
// Declare the JDBC objects.
Connection con = null;
Statem... |
6eb43a5a-123a-4029-baac-69403ae8e87d | 4 | private static DateModel<?> createModelFromValue(Object value) {
if (value instanceof java.util.Calendar) {
return new UtilCalendarModel((Calendar) value);
}
if (value instanceof java.util.Date) {
return new UtilDateModel((java.util.Date) value);
}
if (val... |
e5e29759-07b5-49cd-89da-bd68e31ada08 | 2 | public MyList filter(ListFilter lf) {
MyList newlist = new MyList();
Iterator it = iterator();
while(it.hasNext()) {
Object o = it.next();
if (lf.test(o)) newlist.add(o);
}
return newlist;
} |
695e679f-5e66-4a25-bef7-ca37e2adbfe1 | 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... |
6e8eecec-0b86-498d-a403-3d75a3ac7e25 | 7 | public static void main(String[] args) throws InterruptedException, IOException{
while (true)
{
System.out.print("Input: ");
BufferedReader getInput = new BufferedReader(new InputStreamReader(System.in));
String Input = getInput.readLine();
if (Input.equals("Ping"))
{
System.out.println("Pong");
... |
e10882b4-b479-4b78-9e0b-e32e999022e2 | 8 | @Test
public void testTorbenGusevAlgorithm() throws Exception {
PrintStream out = System.out;// new PrintStream(new File("results.txt"));
// Note: Uncomment opCount and loopCount counters in HistogramBasedMedianFinder class to get statistics
boolean warmUp = false;
// Note: Change nRanges from 2 to 100 wit... |
acc9e02b-c1c7-44a7-a9bb-e638e3ef43cf | 9 | private void jj_rescan_token() {
jj_rescan = true;
for (int i = 0; i < 6; i++) {
JJCalls p = jj_2_rtns[i];
do {
if (p.gen > jj_gen) {
jj_la = p.arg;
jj_lastpos = jj_scanpos = p.first;
switch (i) {
... |
1bd4c8bd-69e2-42fc-8587-1ab6df8cf7b6 | 2 | public Integer[] getSelected() {
ArrayList<Integer> selectedIndex = new ArrayList<Integer>();
for(int i = 0; i < selected.size(); ++i) {
if(selected.get(i)) {
selectedIndex.add(i);
}
}
return (Integer[]) selectedIndex.toArray();
} |
83e0ef9e-ca0b-4018-bce0-02441080fe52 | 7 | @Override
public void makePeace(boolean includePlayerFollowers)
{
final MOB myVictim = victim;
setVictim(null);
for (int f = 0; f < numFollowers(); f++)
{
final MOB M = fetchFollower(f);
if ((M != null) && (M.isInCombat()) && (includePlayerFollowers || M.isMonster()))
M.makePeace(true);
}
if (my... |
96dd70da-98bf-469b-8456-5f9aa669e959 | 6 | public Map<Integer, Double> getValueProbsForID(int id, boolean topicCreation) {
Map<Integer, Double> terms = null;
if (id < this.docList.size()) {
terms = new LinkedHashMap<Integer, Double>();
Map<Integer, Double> docVals = this.docList.get(id);
for (Map.Entry<Integer, Double> topic : docVals.entrySet()) {... |
4ff170f8-9f63-4b24-947e-4a21fbe183e2 | 2 | @Override
protected void done() {
try {
//System.out.println("loaded image");
image.setIcon(get());
} catch (InterruptedException ex) {
System.out.println(ex);
} catch (ExecutionException ex) {
System.out.println(ex);
}
} |
2e22878d-488b-475e-8519-6b3b3fa1456f | 6 | public void actionPerformed(ActionEvent e) {
Locale locale = Locale.getDefault();
Date date = new Date(e.getWhen());
String s = DateFormat.getTimeInstance(DateFormat.SHORT, locale).format(date);
if (!model.isEmpty()) {
model.clear();
}
if (e.getID() == ActionEvent.ACTION_PERFORMED) {
model.addEleme... |
39aea9ec-3b9b-4ebc-851c-3253731e1e3c | 4 | @Override
public final void run() {
// Reset, Job Object Data
this.failureObject = null;
this.returnObject = null;
this.finished = false;
this.success = false;
// ---------------------- EXECUTION ---------------------- //
System.out.println("[JOB] Execution of Job -> " + this.jobName);
Object job... |
5091c4e6-982e-4928-b28c-312ac8168e06 | 7 | public boolean contains(Temporal temporal) {
if (null == temporal) return false;
if (this == temporal) return true;
if (isTimeInstance()) {
return temporal.isTimeInstance() ? startTime == temporal.startTime : false;
} else {
if (temporal.isTimeInstance()) return !(startTime > temporal.startTime || tempora... |
b4750308-a3f0-4955-a69f-1d61c22d4e44 | 9 | protected static Ptg calcEOMonth( Ptg[] operands )
{
try
{
GregorianCalendar startDate = getDateFromPtg( operands[0] );
int inc = operands[1].getIntVal();
int mm = startDate.get( Calendar.MONTH ) + inc;
int y = startDate.get( Calendar.YEAR );
int d = startDate.get( Calendar.DAY_OF_MONTH );
if( mm... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.