method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
5cae243f-9f21-4f74-a84d-1e647eb726bf | 3 | private void jbtnClose_ActionPerformed()
{
if (this.socket != null && ! this.socket.isClosed())
{
try
{
this.socket.close();
}
catch(Exception e)
{
EzimMain.showError(e.getMessage());
EzimLogger.getInstance().warning(e.getMessage(), e);
}
}
this.saveConf();
this.unregDispose();... |
e504d0de-ba7c-436e-8f94-a837418bfa7d | 1 | @Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + deptId;
result = prime * result + (int) (id ^ (id >>> 32));
result = prime * result + ((name == null) ? 0 : name.hashCode());
return result;
} |
e63a80ea-df58-4a48-a460-84b8eddea1fd | 1 | @SuppressWarnings("unchecked")
public void addQustionToDB() {
String questionStr = getConcatedString((ArrayList<String>) question);
String answerStr = getConcatedString((ArrayList<String>) answer);
// add to database
try {
String statement = new String("INSERT INTO " + DBTable
+ " (quizid, position, q... |
ceec2a1a-8c3a-4128-84bc-221d6c1e6ff2 | 2 | public IComponent getComponentFast(Class<?> clazz, Entity entity) {
HashMap<Entity, IComponent> entityComponentMap = registeredComponents.get(clazz);
if (entityComponentMap != null) {
return entityComponentMap.get(entity);
}
return null;
} |
d2e2a636-97fd-4966-b962-679ffcede8f8 | 2 | public void loadClass(File file)
{
String fileName;
fileName = file.getName();
//check if file is in the folder
if(fileName.contains(".java"))
{
className = fileName.replace(".java", " ").trim();
className = className.concat(".class");
... |
3eebb07e-75d2-4bb8-8c3f-8a061fd9f5e4 | 0 | public void setAllowStay(boolean t) {
turingAllowStay = t;
turingAllowStayCheckBox.setSelected(t);
TMTransitionCreator.setDirs(t);
} |
db11a1d3-faad-4e49-9d8e-ffb2af5a68d6 | 6 | public void render(Graphics g){
g.setColor(Color.WHITE);
g.setFont(JudokaComponent.bigFont);
for (int i = 0; i < items.length; i++) {
if(selectedItem == 1){
if(i == selectedItem)
g.drawString("> " + items[i] + " " + difficulty + " <" , JudokaComponent.WIDTH / 2 - (items[i].length() + 6) * 10 + 200, 5... |
9fdf8033-7e9a-4e06-911a-f4627d5c2368 | 9 | public boolean equals(final Object obj) {
if (obj == null) {
return false;
}
if (obj instanceof RSAPrivateKey) {
final RSAPrivateKey that = (RSAPrivateKey) obj;
return super.equals(that) && d.equals(that.getPrivateExponent());
}
if (obj instanceof RSAPrivateCrtKe... |
2f7cafd7-d4cf-4a5b-934d-850ef5d73bee | 2 | private double average(int[] record){
int sum=0;
int i;
double avg;
int ct = 0;
for (i=0;i<record.length;i++){
sum = sum+record[i];
System.out.printf("\n the %d th record is %d\n",i, record[i]);
if (record[i]!=0)
ct=i;
}
avg = sum/(ct+1);
System.out.printf("\n the avg score is %f\n", avg);
... |
d2f4ea75-68da-455d-9934-85653abcab88 | 0 | public void setBilan(String bilan) {
this.bilan = bilan;
} |
d1938bdc-3ca2-41f5-a46d-a391a21fcf56 | 8 | @Override
public Token read(DocumentReader scanner) throws ScannerReadException {
String buffer = "";
if (pattern.matcher("").matches()) {
//we will not allow for a pattern that matches the empty string
return null;
}
while (scanner.hasMore() && buffer.length(... |
a7c8fc92-9f63-41fd-8b42-78fdcfa9778d | 9 | @Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
final MOB target=getTarget(mob,commands,givenTarget);
if(target==null)
return false;
if(!super.invoke(mob,commands,givenTarget,auto,asLevel))
return false;
final boolean success=proficien... |
b5fb6b42-8161-4b21-b96b-706f0aeefe5b | 3 | private AcctsRecTransRec parseChangeTransaction() {
String mastID;
AcctsRecTransRec result;
if (tokens.length > 1) {
mastID = tokens[1];
if (tokens.length != 3) {
result = new AcctsRecIllFormedTransRec(mastID, line.getBytes());
}
else {
tr... |
7401cac7-bd17-4de5-83b7-f4b58dd3d250 | 6 | @Override
public int evaluate(Stock stock) {
int value = 0;
int step = 10;
if(stock.movingUp(step)){
while (step < 200) {
if(stock.movingUp(step)){
++value;
}
step *= 2;
}
}
else if(stock.movingDown(step)){
while (step < 200) {
if(stock.movingDown(step)){
++value;
}
... |
beb507f2-673e-465b-8b7c-12c9f58ca4c0 | 0 | public void setDepartmentId(int departmentId) {
this.departmentId = departmentId;
} |
64e0236a-4422-4cda-974e-85ac67b83952 | 3 | public Response starttls(String server) {
greet(server);
if (!hasExtension("starttls"))
throw new SMTPException("STARTTLS not supported by server.");
Response response = doCommand("STARTTLS");
if (response.code != 220)
return response;
try {
so... |
e0a1b266-423f-4c1f-8b26-2fb8ce2cfb5f | 9 | private int clearRows()
{
boolean check = true; // Used to determine if the row is full
boolean deletionMode = false;
int rowsCleared = 0;
// Navigate through the grid, starting with columns
for (int j= 0; j < GRID_HEIGHT; j++)
{
// Navigate through the current row
for (int i = 0; i < GRID_WIDTH; i+... |
461a5434-a235-465e-a618-634af9254161 | 5 | @Override
public boolean controls(final ChessCoord coord) {
// First check for general reasons that we don't control the position.
// This includes checking that we are not placed on the coordinate
// ourselves. This is important to know for the following checks.
if (!super.controls(... |
5390a435-b72b-4773-afa0-166807176be5 | 6 | public void addBanditAtCanvasLocation(int canvasX, int canvasY)
{
// FIRST MAKE SURE THE ENTIRE INTERSECTION IS INSIDE THE LEVEL
if ((canvasX - 17.5) < 0) return;
if ((canvasY - 17.5) < 0) return;
if ((canvasX + 17.5) > viewport.levelWidth) return;
if ((canvasY + 17.5) > view... |
c1dac872-7557-4fc8-bad8-69e8f7a0da02 | 9 | static protected void FillBuff() throws java.io.IOException
{
if (maxNextCharInd == available)
{
if (available == bufsize)
{
if (tokenBegin > 2048)
{
bufpos = maxNextCharInd = 0;
available = tokenBegin;
}
else if (tokenB... |
713f5b37-dfd2-4e5c-b017-e7e23a750b8d | 0 | @Override
public void startSetup(Attributes atts) {
super.startSetup(atts);
addActionListener(this);
} |
316875b9-e2ef-4c31-878e-fbedccd47946 | 3 | private void saveSettings()
{
// Font Smoothing
dialog_settings.setFontSmoothingValue(font_smoothing_selector.getSelectedItem());
// Editor Settings
dialog_settings.editor_use_env = editor_use_env_checkbox.isSelected();
dialog_settings.editor_path = editor_path_field.getText();
... |
d0557fbc-3cbd-4de8-98a7-09329821bd2f | 0 | public void setAge(int age) {
this.age = age;
} |
274d1e39-f978-489f-b20c-68ee416a572e | 7 | protected void notifyReceivedAck(MqttAck ack) throws MqttException {
final String methodName = "notifyReceivedAck";
this.lastInboundActivity = System.currentTimeMillis();
// @TRACE 627=received key={0} message={1}
log.fine(className, methodName, "627", new Object[] {
new Integer(ack.getMessageId()), ack })... |
d5725b7e-f30b-487c-8fa3-1d6bb3ae8374 | 5 | public VariableStack mapStackToLocal(VariableStack stack) {
VariableStack newStack;
int params = instr.getFreeOperandCount();
if (params > 0) {
exprStack = stack.peek(params);
newStack = stack.pop(params);
} else
newStack = stack;
VariableStack lastStack = newStack;
for (int i = 0; i < caseBlocks.l... |
b67aa20f-400d-464c-8b21-9efea741196a | 1 | @Override
public void hoistDepthChanged(OutlinerDocumentEvent e) {
if (e.getOutlinerDocument() == Outliner.documents.getMostRecentDocumentTouched()) {
updateText(e.getOutlinerDocument());
}
} |
0437ed1a-f592-4e70-9971-5f58a9c485af | 2 | protected static boolean numeroTrajetOK(int n, ArrayList<Trajet> trajets){
for(Trajet t : trajets){
if(n==t.getID()){
return true;
}
}
return false;
} |
7664eb67-98fe-4bfc-8d46-6240b0d8d5af | 0 | @SuppressWarnings("unchecked")
public List<Order> getAllPendingOrdersOf(Customer customer) {
return (List<Order>)this.em.createNamedQuery("findAllPendingOrders").setParameter("paramCustomer", customer.getId());
} |
094fe505-0fdf-48f6-9adf-40176d7be20c | 8 | protected static Object primitiveInstance(Class type) {
Object r = null;
if (type.equals(Boolean.TYPE)) {
r = false;
} else if (type.equals(Integer.TYPE)) {
r = 0;
} else if (type.equals(Short.TYPE)) {
r = 0;
} else if (type.equals(Byte.TYPE))... |
faa85fe1-b9d0-4c44-a75e-bf99e5c1c2bd | 1 | @PUT
@Path("/v2.0/networks/{networkId}")
@Produces(MediaType.APPLICATION_JSON)
public Response updateNetwork(@PathParam("networkId") String networkId, final String request) throws MalformedURLException, IOException{
Object net;
net = JsonUtility.fromResponseStringToObject(request,ExtendedNetwork.class);
//Conv... |
bb156564-63ac-4686-913c-25ee4e982ee8 | 1 | private void throwException( String additionalMsg ) {
StringBuilder caret = new StringBuilder();
for ( int i = 0; i < tokenizer.getCol(); i++ ) {
caret.append( " " );
}
caret.append( "^" );
throw new IllegalArgumentException( "\nError in file: " + fileName + " on li... |
faa52ceb-74e6-4cb8-816c-b3e76d732fb3 | 6 | public void update() {
// update position
getNextPosition();
checkTileMapCollision();
setPosition(xtemp, ytemp);
// check flinching
if (flinching) {
long elapsed = (System.nanoTime() - flinchTimer) / 100000;
if (elapsed > 400) {
flinching = false;
}
}
// if we hit a wall, go the other way!... |
852d3436-114a-4212-a2ca-fb3c41160bdd | 3 | @Override
public Float get(int index) {
switch(index) {
case 0: return x;
case 1: return y;
case 2: return z;
default: throw new IndexOutOfBoundsException();
}
} |
2cfa5934-24fe-4210-9a02-cbde1ca6151f | 2 | public static List<String> getHeadLines()
{
List<String> events = new ArrayList<String>();
Document doc;
try {
doc = Jsoup.connect("http://en.wikipedia.org/wiki/Main_Page").timeout(10*1000).get();//gets the page source
Elements newsHeadlines = doc.select("#mp-itn li");//# indicates the id and li indicat... |
9a947011-b54c-4d8d-97e5-30f82a46da3c | 8 | public double[][] predictIntervals(double conf) {
// Update the bandwidth
updateWidth();
// Compute minimum and maximum value, and delta
double val = Statistics.normalInverse(1.0 - (1.0 - conf) / 2);
double min = m_TM.firstKey() - val * m_Width;
double max = m_TM.lastKey() + val * m_Width;
... |
28c9e40f-c1d0-4576-a69d-b04206b5d690 | 9 | public int compareTo( Object obj ) {
if( obj == null ) {
return( 1 );
}
else if( obj instanceof GenKbRuleCartByNameIdxKey ) {
GenKbRuleCartByNameIdxKey rhs = (GenKbRuleCartByNameIdxKey)obj;
if( getRequiredTenantId() < rhs.getRequiredTenantId() ) {
return( -1 );
}
else if( getRequiredTenantId() ... |
4e0e2814-f4e7-445c-b051-c0004bde7c67 | 3 | private Connection getDBConnection() {
try {
if (connection != null && !connection.isClosed()) {
return connection;
}
DriverManager.registerDriver((Driver) Class.forName("com.mysql.jdbc.Driver").newInstance());
connection = DriverManager.getConnect... |
f9175e2c-8d3a-4b32-b246-7905078730c2 | 3 | @EventHandler
public void playerConnect (PlayerJoinEvent e){
if(TeleportsManager.pendingTeleports.containsKey(e.getPlayer().getName())){
Player t = TeleportsManager.pendingTeleports.get(e.getPlayer().getName());
TeleportsManager.pendingTeleports.remove(e.getPlayer().getName());
if(!t.isOnline()){
e.getP... |
31420f3d-3a96-4881-86f7-e8ab99d6aa9b | 3 | public CorridorSet(String savefile, int savesize) {
this.corridors = new Corridor[savesize];
if (savefile.length() == 0) {
return;
}
String[] corridorList = savefile.split("\n");
for (int i=0; i<corridorList.length; i++) { //last empty line not counted
if (corridorList[i].split(" ").length == 4) {
... |
6b3a2e8a-32b2-4b69-b878-9377e20be358 | 8 | public void testValidEdge5() {
try {
TreeNode tree = new TreeNode("tree", 3);
TreeNode subtree1 = new TreeNode("spare-subtree1");
TreeNode subtree2 = new TreeNode("spare-subtree2");
tree.setBranch(new TreeNode[]{ subtree1, new TreeNode("subtree"), subtree2 });
... |
8ce8e5b8-b89b-49f4-89f7-2d1b5d0f5933 | 1 | int getIntModify() {
int returnedValue = 10;
try {
String[] students = {"Benjamin", "Joe"};
System.out.println(students[5].toString());
} catch (Exception e) {
System.out.println("About to return " + returnedValue);
return returnedValue;
... |
8846f704-090d-4eb8-a48c-3a7d04e0e00c | 7 | public int[][] getPiece(int cheat) {
switch (cheat) {
case (1):
return Piece1;
case (2):
return Piece2;
case (3):
return Piece3;
case (4):
return Piece4;
case (5):
return P... |
f0097d09-e82f-4d5c-b662-557a6353ae38 | 2 | public void Search(String IndexFile){
IndexReader ir;
try {
//Opens the file already indexed as FCTH
ir = DirectoryReader.open(FSDirectory.open(new File(IndexFile)));
ImageSearcher searcher = ImageSearcherFactory.createFCTHImageSearcher(10);
//TODO this returns a sorted list of images that are 'si... |
d4b6ca98-5bf5-485f-bbf9-a20a9d0b6dc2 | 3 | public synchronized void enQueueUrl(urlObj urlObj) {
if (!mQueue.contains(urlObj)) {
if (!urlObj.getUrl().equals("") && !urlObj.equals(null)) {
mQueue.add(urlObj);
notifyAll();
}
}
} |
214380ea-ccaf-4f11-a8aa-d15e01a64373 | 6 | public static Model loadModel(File f){
BufferedReader reader = null;
Model m = new Model();
try {
reader = new BufferedReader(new FileReader(f));
String line;
while((line = reader.readLine()) != null){
if(line.startsWith("v ")){
float x = ... |
b8bc9b3a-24b2-4f35-bbb6-ab9c6c8fc31c | 9 | public static void doCounting() {
Timestamp startDay = Timestamp.valueOf("2011-01-01 00:00:00.0");
Timestamp nextDay = new Timestamp(startDay.getTime() + oneDayLong);
final Timestamp endDay = Timestamp.valueOf("2012-05-01 00:00:00.0");
while (startDay.before(endDay)) {
System.out.println(startDay); // pri... |
6ce21e13-22da-4773-90c8-de3ebee96b8f | 2 | @Override
protected void repondreExtension(HttpServletRequest requete, HttpServletResponse reponse, String action, Utilisateur utilisateur) throws ServletException, IOException {
if (requete.getParameter("utilisateur") == null) {
reponse.sendError(404);
return;
}
Uti... |
e6ad02cd-cdc3-43fb-9eef-cd8248d7fe82 | 4 | public boolean collide(Poly poly1, Poly poly2) {
firstPoly = poly1;
secondPoly = poly2;
for (int j = firstPoly.getCount() - 1, i = 0; i < firstPoly.getCount(); j = i, i++) {
Vector v0 = firstPoly.getVertices()[j];
Vector v1 = firstPoly.getVertices()[i];
Vector edge = new Vector(0, 0);
edge.x = v1.x ... |
c5a5f99f-1b93-4f62-af3c-c06eb1bb4194 | 7 | public static String fixText( String s ) {
// Strip of trailing punctuation marks and spaces
if ( s.charAt( s.length()-1 ) == '?'
|| s.charAt( s.length()-1 ) == ':'
|| s.charAt( s.length()-1 ) == '!'
|| s.charAt( s.length()-1 ) == ','
... |
777dc737-d4f2-40dd-9cbc-f136cc3e1d85 | 8 | @Override
public TerminalSize getPreferredSize()
{
int width = preferredSize.getColumns() > 0 ? preferredSize.getColumns() : longestLine + 1;
int height = preferredSize.getRows() > 0 ? preferredSize.getRows() : lines.size() + 1;
if(maximumSize != null) {
if(width > maximumSiz... |
ff76cb1c-a299-494a-8e20-19052a6af9c5 | 8 | public static <Task extends ITask> Deque<Task> getPlan(SimulationMap m, Person p, Collection<Task> tasks, Task goalTask) throws Exception{
PLPlan plan = new PLPlan();
plan.setAlgorithm(EnumAlgorithm.GRAPHPLAN);
Collection<String> requiredFacts = getFacts(goalTask);
for(String f: required... |
816d9992-9afa-4391-adc2-2d7fcedcc3bd | 0 | public void setIntelligence(double intelligence) {
this.intelligence = intelligence;
} |
3eafcddd-de64-400a-b602-0a97ebc743c4 | 0 | private final void removeAllChannels() {
synchronized(_channels) {
_channels = new Hashtable();
}
} |
7cff6ee0-4b1a-4218-8739-a0a9ec537c8e | 2 | public void update(GameContainer gc, int delta) throws SlickException {
Input input = gc.getInput();
for (int i = 0; i < buttons.size(); i++) {
int x = buttonsX;
int y = buttonsY + i * buttonHeight;
if (isMouseOnButton(x, y, input.getMouseX(), input.getMouseY())) {
choice = i;
}
}
} |
e9421137-9e0a-4f80-bc0c-1336f876c442 | 3 | @Override
public void onToggle(Key key, boolean pressed) {
if (key == InputHandler.getInstance().back && pressed) {
if (pauseMenu == null)
pauseGame();
else
unPauseGame();
}
} |
b751a3e7-effd-4a4b-bcbe-76cac527e744 | 1 | @Override
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
if (qName.equalsIgnoreCase("can:candyBox")) System.out.println("Start element can:candyBox");
else System.out.print(qName + ":");
} |
5b718b16-41a0-404a-91c6-7de9850ed6f1 | 9 | public void actionPerformed(ActionEvent e) {
JComponent source = (JComponent) (e.getSource());
/* Oeffnen eines neuen Bildes */
if (source == (JComponent) openitem) {
JFileChooser d = new JFileChooser();
d.setCurrentDirectory(new File("./"));
d.setFileFilter(new PictureFilter());
int returnVal = d.... |
b8bfd152-16c0-4fce-859b-1f61da80fa33 | 0 | @Override
protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
performTask(request, response);
} |
b38325b3-2300-46f7-940c-b5b7c3a0e93d | 6 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Cliente other = (Cliente) obj;
if (cpf == null) {
if (other.cpf != null)
return false;
} else if (!cpf.equals(other.cpf))
return fals... |
bf045733-c25c-4d69-99aa-bb240cc8936c | 7 | private void checkVariableName(String varName) throws UnparsableExpressionException {
char[] name = varName.toCharArray();
for (int i = 0; i < name.length; i++) {
if (i == 0) {
if (!Character.isLetter(name[i]) && name[i] != '_') {
throw new UnparsableExpressionException(varName + " is not a valid variab... |
dc39a30f-1411-4fa2-bea6-35af4a657487 | 1 | public void update() {
if (StartingClass.gameMode.equals("halloween"))
r.setRect(centerX + 55, centerY + 10, 60, 50);
else
r.setRect(centerX + 30, centerY + 10, 60, 50);
} |
02242477-85e6-4d21-98c7-da71c30749a9 | 4 | public void drawAllMap(Scene scene, List<Station> allStations) {
app.pushMatrix(); // Etat 0: pour préserver ControlP5
app.translate(X0, Y0, 0);
// Pour toutes les stations:
for (Station station : allStations) {
app.pushMatrix(); // Etat 1: (x0,y0)
// 1. Dessiner des sphères
double[... |
a96aea55-6a73-4659-ad39-ede4f66723d4 | 9 | private ArrayList<Function> computation() throws Exception
{
Function main = new Function();
globals = new GlobalMemoryRegion();
ArrayList<Function> rval = new ArrayList<Function>();
env.enter();
if(scan.sym == Token.main) {
scan.next();
// variable de... |
47af2dff-daad-4ed1-89ec-5272235f06de | 1 | public boolean ready() throws IOException {
if(p)
return(true);
return(back.ready());
} |
f971d0af-ad9b-46f7-b15d-7a3c8f563797 | 1 | public int getHeight() {
return item.length > 0 ? item[0].length : 0;
} |
5ee817fd-cc9f-438b-a382-3a6c5ce2bd02 | 7 | public static void main(String[] args) throws FileNotFoundException
{
//Alternate these comments for running on 20x20 boards or 50x50 boards
//WARNING ----- Running the large loop on the large board takes a LONG time (~40 minutes)
GameBoard[] boards = {new GameBoard(mediumBoard1),new GameBoard(mediumBoar... |
767e85b5-e10a-4db9-8a33-db06a619c83c | 3 | public static AbstractDao getInstance(ClientType type) throws DaoInitException {
switch(type) {
case GUEST: return new MysqlGuestDao();
case USER: return new MysqlUserDao();
case ADMIN: return new MysqlAdminDao();
default: throw new DaoInitException(type.toString(... |
1abea6cd-eb2b-49e3-9fa6-9de750757a5f | 0 | public PartC() {
System.out.println("PartC builded");
} |
0761c5e7-a39b-468a-906f-2b1eca2d0e9f | 7 | public void printTotals() {
// -- Totals --
System.out.println(" == Totals for individual elements ==");
System.out.println();
// Codon totals
System.out.println(" -- Total numbers of each codon composition --");
System.out.println("| - | -AA | -AC | -AG ... |
c1da176a-5a1a-4500-9cb0-2c5178ae9298 | 0 | private void jButton1MouseMouseClicked(MouseEvent event) {
UpdateFrame uf = new UpdateFrame();
uf.setDefaultCloseOperation(UpdateFrame.EXIT_ON_CLOSE);
uf.setTitle("UPDATE");
uf.getContentPane().setPreferredSize(uf.getSize());
uf.pack();
uf.setLocationRelativeTo(null);
uf.setVisible(true);
this.dispose()... |
8326478c-e419-492a-9df2-bc87bd46f8dc | 7 | public void swap(int s1, int s2)
{
if(s1 >= 0 && s2 >= 0 && s1 < size && s2 < size)
{
Item temp = itemList[s1];
itemList[s1] = itemList[s2];
itemList[s2] = temp;
int n = size;
for(int i = Math.min(s1, s2); i < n; i++)
{
... |
1683969d-c815-4f19-8b56-2d97ffc94302 | 3 | public static byte[] encode(byte[] message) {
int length = message.length - 1;
byte[] len;
if (length < 128) {
len = new byte[] { (byte) length };
} else {
int count = 0;
while (32 << (count + 1 << 3) <= length) {
count++;
}
count++;
len = new byte[count + 1];
len[0] = (byte) (count ... |
b7d61ae0-5136-4127-a5b3-d839800e7a92 | 7 | public static void main( String args[] ){
MiniDB db = new MiniDB( "minidb" );
BufMgr bm = db.getBufMgr();
int size = 8;
BPlusTree bpt = null;
try{
bpt = db.createNewBPlusTreeIndex( "table", "val", 8 );
int iters = 50;
MiniDB_Record insertedRecords[] = new MiniDB_Record[iters];
... |
a6cd499b-f98f-4d97-9935-d6b894a36415 | 1 | public List<Author> getAuthors() {
if(authors == null){
authors = new ArrayList();
}
return authors;
} |
8f974b5d-8839-417b-a33d-4c24f6bf831d | 5 | boolean SOUTHhasCraftedBlock(Location startLocation)
{
boolean res = false;
int validCraftBlockRows = 0; // amount of horizontal rows that have been successfully checked for crafted blocks.
// Check SOUTH =========================================================
// Check if there is a block ... |
937a0e9b-af29-453d-918f-d6c194c45ac7 | 6 | private void run(){
isRunning=true;
int frames=0;
double frameCounter=0;
game.init();
double lastTime = Time.getTime();
double unprocessedTime=0; // Keeps track of how much time still needs to be processed (IN SECONDS).
// MAIN GAME LOOP:
while(isRunning){
boolean render=false;
dou... |
51b3c0d4-fe66-48fb-a236-5eaae1892d74 | 4 | public void getSurroundings(int x, int y, int Width, int Height, byte[][] Map) {
if (x < Width - 1 && x > 0 && y < Height - 1 && y > 0) {
var.surArray[0] = Map[x - 1][y - 1];
var.surArray[1] = Map[x][y - 1];
var.surArray[2] = Map[x + 1][y - 1];
var.surArray[3] = M... |
23234d03-b6af-4e79-8b69-1892e49b33d5 | 1 | protected final ConfigurationSection getData(String section, String name) {
ConfigurationSection sec = yamlConfiguration.getConfigurationSection(section + "." + name);
if (sec == null) {
sec = yamlConfiguration.createSection(section + "." + name);
}
return sec;
} |
1ef9ceb2-d98a-4749-adc5-1a771b4457be | 6 | public static void main(String[] args) {
if (args.length != 2) {
System.out.println("Invalid parameters!\n" + "Syntax:\n"
+ "java meketre <result rdf-file> <mapping file>");
return;
}
// check, if the input-files exist
if (!new File(args[1]).exists()) {
System.out.println("File \"" + args[1] + "\... |
f6608db6-ae8a-405a-8718-d8d8d30ae393 | 9 | public ArrayList<Spot> getData() throws EmptyFieldsException, SpotDurationException {
ArrayList<Spot> spotArrayList = new ArrayList<Spot>();
for (int i = 0; i < rows; i++) {
if ((!fieldClientSpotDuration[i].getText().trim().isEmpty())
|| (!fieldPartnerSpotDuration[i].getText().trim().isEmpty())
|| (... |
bc074fbd-3322-406d-8bae-8c551ebec13e | 0 | @Override
public void destroy() {
node = null;
} |
010c85ab-ff3e-47b1-950b-88dfb3eee42a | 5 | private void drawNumbers(Graphics g){
for (int x = 0, i = 0; x < 400 && i<9; x += 40) {
for (int y = 40, j=0; y < 400 && j < 9; y += 40) {
if(sudokuArray[j][i]!= 0){
g.drawString(sudokuArray[j][i]+"", x + 15, y - 12);
}
j++;
... |
423d173b-a88a-4666-b619-ffc72eef1bec | 1 | public void update() {
camera.update();
if(bi != null) {
synchronized(t) {
t.update(bi);
}
}
} |
474cfd03-69f8-43a1-9b55-f00ba313bd13 | 0 | TrackingSlip(String s) {
id = s;
} |
66096176-ff07-4875-8691-9d542ac3dd7b | 6 | private void loadDirectory(File file) {
if(file.isDirectory()){
for(File dir : file.listFiles()){
if(dir.getName().endsWith(".mp3") || dir.getName().endsWith(".wav") || dir.getName().endsWith(".mid")|| dir.getName().endsWith(".aif")){
list.put(count, dir.getAbsolutePath());
count++;
}
}
... |
4d40b2f4-373e-40d7-8ee1-857378623a4b | 9 | private double[] lookUpWordEffect(int n, double baseDamage, int healing) {
double[] results = new double[2];
switch(n) {
case 1:
CombatLog.println("FIRE!");
if (this.hasDominantEffect) {
baseDamage *= 2;
this.hasDominantEffect = false;
}
else baseDamage *= 1.5;
break;
... |
355527df-bca8-4ad3-8260-a11021df395a | 3 | public void test() {
double leftTemp = leftScale;
double rightTemp = rightScale;
CommandGroup test = new DriveTest(1.0);
test.start();
while (test.isRunning()) {
Timer.delay(0.01);
}
if (leftScale != leftTemp || rightScale != rightTemp) {
t... |
24e2f6ce-0204-4076-b440-04c0c80b3c6d | 8 | @Override
public FieldVisitor visitField(final int access, final String name,
final String desc, final String signature, final Object value) {
String s = remapper.mapFieldName(className, name, desc);
if ("-".equals(s)) {
return null;
}
if ((access & (Opcodes.A... |
ea8678bf-75c1-4df2-9be9-d9a94965d598 | 2 | public static Integer myRandom(int low, int high) {
int rand = 0;
while (rand >= 0 && rand <= 255) {
rand = (int) (Math.random() * (high - low) + low);
}
return rand;
} |
969e0ce4-c7fa-42e4-bcc9-78a0415676d2 | 3 | public static String removeEnd(String str, String remove) {
if (isEmpty(str) || isEmpty(remove)) {
return str;
}
if (str.endsWith(remove)) {
return str.substring(0, str.length() - remove.length());
}
return str;
} |
2dd2c1db-6c44-494e-9519-bafef8b0809a | 4 | public static String buscarArchivoMayor(String dir) {
int max = 0;
int bytes = 0;
String tempLine = "";
String line = "";
BufferedReader br = FicherosLib.abrirFicheroLectura(dir);
try {
while ((tempLine = br.readLine()) != null) {
bytes = Integer.parseInt(tempLine.split("-")[1]);
// System.out... |
c0373dcf-b829-4b05-b9ea-15fdb1f43377 | 8 | public static void mult_aux( DenseD2Matrix64F a , DenseD2Matrix64F b , DenseD2Matrix64F c , double []aux )
{
if( a.numCols != b.numRows ) {
throw new MatrixDimensionException("The 'a' and 'b' matrices do not have compatible dimensions");
} else if( a.numRows != c.numRows || b.numCols != ... |
05333f97-94b5-4457-825b-8587ab208845 | 3 | private void initHandlers(){
//set up the tooltip
String tipurl = "images/trees/" + prestige + "/tooltips/" + prestige + "_" + id + ".jpg";
final HTMLPanel html = new HTMLPanel("");
// html.getElement().setAttribute("style","padding: 0px;"); // set some style
// html.add(new Image(tipurl));TODO: unc... |
1d8429aa-19a6-4f0b-981f-d4dba6f5444c | 2 | private static String getHeaderValue(HttpResponse resp, String name) throws CloudAPI.ResolverException {
Header h = resp.getFirstHeader(name);
if (h != null && h.getValue() != null) {
return h.getValue();
} else {
throw new CloudAPI.ResolverException("header " + name + " ... |
58869a3a-dc6d-4211-bb43-9f1eda070963 | 4 | protected Texture2D(InputStream in, ByteBuffer texCoords) {
this.texID = GL11.glGenTextures();
this.texCoords = texCoords.asDoubleBuffer();
try {
this.decoder = new PNGDecoder(in); //Set up the decoder
if(this.hasAlpha()) { //If the png file has an alpha channel or a tRNS chunk, use 4 (R,G,B,A)
this.tex... |
88490350-2ac0-455a-a057-7ca1c327b167 | 6 | @Override
public void mouseUp(MouseEvent e, int x, int y) {
Position newPosition = GfxConstants.getPositionFromXY(x, y);
boolean negativeX = newPosition.getColumn() >= 0;
boolean negativeY = newPosition.getRow() >= 0;
boolean outOfBounceX = newPosition.getColumn() <= GameConstants.W... |
80e5984d-d867-4fa5-a09c-93905d8ef53b | 9 | private DataElement traverseTree(TripleBuilder builder, WordTree tree, TreeElement current) {
Map<Integer, DataElement> cache = new HashMap<Integer, DataElement>();
List<TreeElement> childs = tree.getChildsOf(current);
boolean isFork = childs.size() > 1;
for (TreeElement element : chi... |
7115acca-235d-4b36-963a-47a2af953db8 | 3 | public boolean cadastrar() {
EntityManager em = conectar();
try {
if (em != null) {
AgendaPK a = new AgendaPK(dataHora, idMedico, idExame, idPaciente);
Agenda agenda = new Agenda();
agenda.setAgendaPK(a);
agenda.setObs(obs);
... |
4f345352-30ce-4631-8ffa-3ddff1b41e7a | 5 | @Override
public void received(Connection connection, Object object)
{
// Check if this is the first message from that connection.
if(!server.clientsByIP.containsKey(connection))
{
// New connection, add it to the client list, and do it concurrently
Client new_client = new Client();
Client previous_val... |
81db3be8-8914-4552-8871-6b84e5efdb05 | 3 | public static String getURL(String entityName,String methodName,String paramers,String url){
StringBuilder sb = new StringBuilder();
if(!isBlank(entityName)){
sb.append(entityName).append("!").append(methodName);
}else if(!isBlank(url)){
sb.append(url);
}
if(!isBlank(paramers)){
sb.append("?").app... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.