method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
1560f290-1e29-4bbd-bda7-77d44ed4af54 | 5 | public int compareByName(HousePet housepet)
{
int returnValue = 0;
String hp1Name = this.getName();
String hp2Name = housepet.getName();
/* if this HousePet's name is the same as housepet's name, defer to compareTo()
* as tiebreaker
* Note: this also incl... |
e5ab50b9-e661-4bde-b991-136525943aab | 6 | public synchronized void write() {
if (_outData.size() == 0) {
// if nothing left in the output string, go back to read mode
switchToReadOnlyMode();
return;
}
// if there is something to send
ByteBuffer buf = _outData.remove(0);
if (buf.remaining() != 0) {
try {
_sChannel.write(buf);
} catc... |
3cff931e-a17c-4bcf-8f4f-af4444da7cf5 | 9 | private void setLookAndFeel(int choice) {
try {
switch (choice) {
case 0:
UIManager
.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeel");
break;
case 1:
UIManager
.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
break;
case 2:
... |
cffe81dd-7bd3-4c53-8629-0948abaa2400 | 6 | public Object getValueAt(int row, int col) {
Account account = getObject(row, col);
if (col == 0) return account;
else if (col == 1) return account.getDebetTotal();
else if (col == 2) return account.getCreditTotal();
else if (col == 3) {
if (account.getSaldo().compareTo(BigDecimal.ZERO) > 0) return account... |
b8dad80a-4cc2-480d-b6ea-88052c5c472f | 3 | protected void loadLevel(String path) {
System.out.print("Trying to load Level from " + path + "... ");
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(getClass().getResourceAsStream(path)));
width = Integer.parseInt(reader.readLine());
height =... |
418bf639-f771-4ca6-956c-a237d34a9d47 | 8 | private void PesquisaDevolucoesComDadosDeEntrada() {
int idFornecedor = 0;
String nomeFornecedor = "";
int idMateriaPrima = 0;
String nomeMatPrima = "";
String dataDevolucao = "";
String quantiDevolvida = "";
int devolucaoNum = 0;
String opcaoSelect = ""... |
a19bdf82-fdac-4487-8409-903ee19c7d00 | 1 | public static void takeItem() {
if (map.currentLocale.getItems().length == 0) {
System.out.println("There are no items to take");
} else {
Item locationItem = map.currentLocale.getItems()[0];
playerInventory[playerInventorySize] = locationItem;
playerInventorySize = playerInventorySize + 1;
ma... |
e31369d9-7d76-4762-ae11-841f4c215fd5 | 0 | public TrieST() { N = 0; } |
ca6407ad-df34-4337-9069-e36c0638a8cb | 2 | public boolean equals(Object o) {
if (o == this)
return true;
if (o instanceof ArrayType) {
ArrayType type = (ArrayType) o;
return type.elementType.equals(elementType);
}
return false;
} |
cab53b91-aea3-4389-ada9-e862173d439d | 7 | private void generateStrongModeSet() {
strongerModeSet.clear();
strongerModeSet.putAll(getAllModeConflictRules());
boolean isModified = false;
List<String> modeToAdd = null;
do {
isModified = false;
for (Entry<String, Set<String>> entry : strongerModeSet.entrySet()) {
Set<String> mList = entry.getV... |
90f63d82-4a2c-4608-89f9-c2094225415e | 3 | static public void printNamePartTable() {
int numberOfParts[] = new int[11];
Iterator it = Person.iterator();
Person pers;
int x;
while (it.hasNext()) {
pers = (Person) it.next();
x = pers.getNameParts().size();
if (x>10)
... |
17d2e835-42d7-46cf-852a-f085c503ed45 | 4 | public static ImageIcon getIcon(String id)
{
ImageIcon icon = iconMap.get(id);
if (icon == null)
{
icon = loadImage(root + id + ".png");
if (icon != null)
{
iconMap.put(id, icon);
}
else
... |
ac19237c-922c-46ac-9c90-a10ab6efef9b | 5 | public String getAlternativeOutput(){
String str = "";
for (int i=0; i<alts.size(); i++){
str = str + "\nentry ";
HashMap hm = (HashMap)alts.get(i);
str = str + "\"" + hm.get("name") + "\"" + "\n";
for (int j=1; j<columns.size(); j++){
str = str + "\t" + colu... |
5db0b2e7-5ce2-4c1b-a1ea-c638c68f07c9 | 1 | public void paint(Graphics graphics) {
Graphics2D g = (Graphics2D) graphics;
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
g.setColor(getBackground());
g.fillRect(0, 0, getWidth(), getHeight());
g.setStroke(new BasicStrok... |
4888d228-ec3a-4cba-a5ed-891c20d496f5 | 9 | public static String convertHarga(int harga){ // jadi tar kalo 50000 jadi 50.000 dst...
// harga = 444;
int ribuan[] = new int[10];
int counter=0;
String temphasil="";
while(harga/1000!=0){
ribuan[counter] = harga%1000;
counter++;
//temphasil = temphasil + ribuan+".";
harga = harg... |
9dbcc2b6-79c1-4bdf-8265-5fe3c8e483a5 | 2 | public static double EuclideanDistance(ArrayList<Double> l1, ArrayList<Double> l2){
if(l1.size() != l2.size()){
System.err.print("erro in input size\n");
}
int size = l1.size();
double sum = 0;
for(int i = 0; i < size; i++){
sum += (l1.get(i) - l2.get(i)) ... |
8447ea89-7235-48cd-944f-d59bec5c22ff | 7 | public static synchronized boolean init() {
if (!loaded) {
if (!checkFiles() && !updateFiles()) {
return false;
}
FileInputStream indexStream = null;
try {
indexStream = new FileInputStream(INDEX);
byte[] bytes = new... |
5cdda102-2a45-4e41-9a28-707180e3f9b7 | 2 | public static int which_side_pp(double x0, double y0, double x1, double y1, double px, double py){
int side;
double dot = (y0 - y1)*(px - x0) + (x1 - x0)*(py - y0);
if(dot < -ACCY)
side = PLANE_INSIDE;
else if(dot > ACCY)
side = PLANE_OUTSIDE;
else
side = ON_PLANE;
return side;
} |
32cb9ea7-557d-4a65-a5b7-c83edbe7ccb9 | 2 | public static void parse(String[] stateList, String gender)
{
String currentState;
for (int i = 1; i < stateList.length ; i++)
{
String[] populationList = stateList[i].split(",");
currentState = populationList[0];
for (int j = 1; j < populationList.length; j++)
{
_... |
9dbc1615-c141-4765-9544-c532661ecdb9 | 0 | public byte[] getiNES() { return iNES; } // Returns the 16 byte iNES header |
b8a533db-96a3-4ca5-acfc-4ff9e5d9ba69 | 9 | public void handleConf(CSTAEvent event) {
if ((event == null) || (event.getEventHeader().getEventClass() != 5)
|| (event.getEventHeader().getEventType() != this.pdu)) {
return;
}
this.call.replyPriv = event.getPrivData();
switch (this.pdu) {
case 24:
this.newCall = ((CSTAMakeCallConfEvent) event.g... |
7f3b3284-d74c-4be6-be7e-c1afcefdef29 | 1 | public void drawBackground(Graphics g, State state, Point point, Color color) {
g.setColor(color);
if(state.isSelected()) g.setColor(new Color(100, 200, 200));
// if (state.getInternalName() == null)
g.fillOval(point.x - radius, point.y - radius, 2 * radius,
2 * radius);
// else {
// g.fillRect(point.x ... |
416a531f-c399-4d2b-b042-088f379edd11 | 4 | public String toString()
{
StringBuffer retval = new StringBuffer( 6 * 16 + 5 + 10);
Point2D.Double v[] = new Point2D.Double[6];
v[0] = myEdge[0].getVertex0();
for (int i = 1; i < 6; i++)
{
if (enteredViaVertex0( i)) // enteredViaEdge0Minus( i))
v[i] = myEdge[i].get... |
dbe006bd-4aff-49e8-994c-b141e8e648ff | 3 | @Override
public boolean deleteLoan(Loan loan) {
if (doc == null)
return false;
Element currRoot = doc.getRootElement();
Element loans = currRoot.getChild("loans");
List<Element> listLoans = loans.getChildren();
for (Element currLoan : listLoans) {
int loanID = Integer
.parseInt(currLoan.getChil... |
a65b76dd-8da2-40ee-942a-96f54e0f0580 | 9 | protected void paintComponent(Graphics g) {
super.paintComponent(g);
if (mode.equals("Single") || mode.equals("JitterMode") || !isJitter) {
if (point == null) {
point = new Point(telepointerModel.getX(),
telepointerModel.getY());
}
if (point != null) {
g.setColor(color);
if (... |
78d30d62-41df-4116-a6fc-4abfd74a0f40 | 9 | private static String wordShapeChris4Short(String s, int len, Collection<String> knownLCWords) {
int sbLen = (knownLCWords != null) ? len + 1: len; // markKnownLC makes String 1 longer
final StringBuilder sb = new StringBuilder(sbLen);
boolean nonLetters = false;
for (int i = 0; i < len; i++) {
... |
cae43aaf-525c-47c7-9334-c40944ee1fb1 | 5 | private <T> T[] shuffle(T[] arr) {
T tmp;
if(arr.length == 2) {
if(r.nextBoolean()){
tmp = arr[0];
arr[0] = arr[1];
arr[1] = tmp;
}
return arr;
}
if(arr.length == 3) {
int i = r.nextInt(3);
tmp = arr[0];
arr[0] = arr[i];
arr[i] = tmp;
if(r.nextBoolean()){
tmp = arr[1];
... |
c597633c-0a79-4261-b927-2438fa745d39 | 1 | public void parse(String filename) throws ParserConfigurationException, SAXException {
SAXParserFactory factory = SAXParserFactory.newInstance();
SAXParser saxParser;
try {
saxParser = factory.newSAXParser();
saxParser.parse(filename, this);
} catch (Exception ex) {
ex.printStackTrace();
}
} |
bec29eb6-1f5c-49ad-beca-754ed0dda81b | 9 | public void parse(RawStreamReader receive) throws IOException {
String line; int ti0;
// Loop until response status line is found.
while (!(line = new String(receive.readLine(), HttpClient.HTTP_HEADER_CHARSET).trim()).matches(HTTP_RESPONSE_STATUS_LINE_REGEX));
if (debug[0])
System.out.println(line);
// Set... |
61bb3173-b0e8-4ed3-9957-eebccd1a58cb | 3 | public int RoomCount()
{
int roomCount = 0;
for (int index = genMin; index < genMax; index++)
{
for (int index1 = genMin; index1 < genMax; index1++)
{
if (layout[index][index1])
{
roomCount++;
}
}
}
return roomCount;
} |
da1d3853-1ea9-42ce-b4dd-aaf9173cb863 | 0 | public void setGestureName(String gestureName) {
this.gestureName = gestureName;
} |
ecfaa17a-6ccf-4031-a1b6-e47ff52b6b06 | 3 | private static void doDeleteTest()
{
System.out.print("Testing delete command ");
try
{
// create an MVD from the Blessed Damozel
File testFolder = new File( TEST_DATA+File.separator+BLESSED_DAMOZEL );
String mvdName = createTestMVD( testFolder );
File mvdFile = new File( mvdName );
// choose vers... |
72cb9189-c9b3-471a-9bba-b66753088769 | 9 | private int readFrameType(
final Object[] frame,
final int index,
int v,
final char[] buf,
final Label[] labels){
int type = b[v++] & 0xFF;
switch(type)
{
case 0:
frame[index] = Opcodes.TOP;
break;
case 1:
frame[index] = Opcodes.INTEGER;
break;
case 2:
frame[index] = Opcodes.FLOAT;
... |
886cbca8-f194-47a3-a170-cf90d38023e3 | 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 fe... |
611a7c82-03c5-45e4-9697-2e1aae039230 | 8 | public void writeHighScores(LinkedList<Score> scores, int playerScore, String playerName) throws IOException {
try (BufferedWriter out = new BufferedWriter(new FileWriter("highscore.txt"))) {
if (!scores.isEmpty()) {
for (int i = 0; i < scores.size(); i++) {
if (playerScore > scores.get(i).score) {
in... |
e96831a5-1480-4831-9cd6-a991dbecca86 | 5 | private int chooseDefaultLanguage ()
{
if (languages.length == 1)
return languages [0];
Locale dflt = Locale.getDefault ();
int retval = languages [0];
for (int i = 0; i < languages.length; i++) {
Locale current = LangCode.getLocale (languages [i]);
// return exact matches if possible
if ... |
9c856578-b97b-45c6-bb70-627b488decad | 9 | public static LucentOriginalCallInfo decode(InputStream in) {
LucentV5OriginalCallInfo _this = new LucentV5OriginalCallInfo();
_this.doDecode(in);
if ((_this.callingDevice_asn == null)
&& (_this.calledDevice_asn == null)
&& (_this.trunkGroup == null) && (_this.trunkMember == null)
&& (_this.lookaheadI... |
5b0990b7-cd58-476a-ad36-48e0ece65ae5 | 7 | public void run(){
while(true){
try{
System.out.println("\n1. Send message to a client");
System.out.println("2. Print Messages from a client");
System.out.println("3. Quit");
System.out.print("\n>>> ");
BufferedReader bufferRead = new BufferedReader(new InputStreamR... |
19ff4de6-9c7a-4236-aa48-1174994b677d | 3 | @Override
public void startElement(String uri, String localName, String qName, Attributes attrs)
throws SAXException {
if (qName.equals("key")) {
response.setAccessMask(getInt(attrs, "accessMask"));
response.setType(getString(attrs, "type"));
String expires = attrs.getValue("expires").trim();
if(expir... |
5b179c0c-9d3a-4f77-91f4-af28b8bfb5a4 | 5 | public void actionPerformed(ActionEvent event) {
if(event.getSource() == StartCalculating1){
String sNumber1 = Number1.getText();
String sNumber2 = Number2.getText();
double iNumber1 = Integer.parseInt(sNumber1);
double iNumber2 = Integer.parseInt(sNumber2);
if(operatorbox.getSelectedItem().equa... |
5802a114-7fc5-40bf-bc2e-7a7990ceefce | 6 | public String toString(){
String ch=null;
ch="la case "+abs+" "+ord+",";
if (stock.size()==0 && habitant.size()==0)
ch+=" vide ";
else{
ch+=" contient :";
if (stock.size()!=0 )
for(int i=0;i<stock.size();i++){
ch+=stock.get... |
e9a0eec7-9ae3-4e9b-8d83-8ac28b264510 | 4 | public void onStepClick()
{
if(runProgram.isAlive())
{
synchronized(BareBonesInterpreter.syncObject)
{
BareBonesInterpreter.syncObject.notifyAll();
}
try
{
Thread.sleep(16);
}
catch (InterruptedException e)
{
}
UpdateVariables();
}
else
{
BareBonesInterpreter.... |
87af8385-c336-4996-b966-d023da3e9722 | 7 | public static void main(String[] args) throws Exception {
int ponder = 5;
if (args.length > 0)
ponder = Integer.parseInt(args[0]);
int size = 3;
if (args.length > 1)
size = Integer.parseInt(args[1]);
ExecutorService exec = Executors.newCachedThreadPool();
Chopstick[] sticks = new Chopstick[size];
for (... |
2e114064-00f6-4b14-b71d-83930959c6b7 | 1 | public void addGameActions(GameAction action) {
if (!actions.contains(action))
this.actions.add(action); // only adds new actions
} |
d9bea925-4059-4596-9d41-7d52b7383d6e | 0 | private void log(final String msg) {
// System.out.debug("[[[[[NoFilter-" + Thread.currentThread().getName() + "-" + this.hashCode() + ": " + msg + "]]]]");
// System.out.flush();
} |
75717a7b-5d5a-475e-b2a3-307020e0fdd6 | 5 | public void sendMsg(String phoneNum, String msg) {
if(msg != null)
if(phoneNum == "self")
this.os.println(msg);
else
for (int i = 0; i < clientThreads.size(); i++) {
if (clientThreads.get(i) != null && clientThreads.get(i).phoneNum == phoneNum) {
clientThreads.get(i).os.prin... |
55ed5680-1c2d-46e2-81f3-93054a76980d | 5 | @Override
public boolean perform(final Context context) {
// Example: /<command> on[ <Player>]
OfflinePlayer target = Parser.parsePlayer(context, 1);
if (target == null && context.sender instanceof OfflinePlayer) target = (OfflinePlayer) context.sender;
if (target == null) {
... |
00c3f191-1b72-441b-a48f-5c614b351b18 | 3 | public void fill()
{
commands++;
int temp = capacity - (int)water;
while(water + diff / 100 < capacity)
{
water += diff;
pause();
if(water + diff / 100 > capacity)
{
water = (double)capacity;
pause();... |
84055897-4e9a-4551-bffe-df1395f882a3 | 1 | @Override
public Object clone() {
try {
return super.clone();
} catch (CloneNotSupportedException cnse) {
return null; // Can't happen.
}
} |
46742d94-fc12-4d02-83fd-b94d6f4d691f | 1 | final int getCount() {
int count = 0;
Attribute attr = this;
while (attr != null) {
count += 1;
attr = attr.next;
}
return count;
} |
4a725255-63fc-4b63-992a-393b854133fd | 1 | public void testParseInto_simple() {
MutablePeriod expect = new MutablePeriod(1, 2, 3, 4, 5, 6, 7, 8);
MutablePeriod result = new MutablePeriod();
assertEquals(20, f.parseInto(result, "P1Y2M3W4DT5H6M7.008S", 0));
assertEquals(expect, result);
try {
f.parseInt... |
c8070dda-1455-4d61-8c84-27f24155a416 | 8 | public static String posibilP(int i) {
String list="";
int r=i/8, c=i%8; //r-rand c-coloana
for (int j=-1; j<=1; j+=2) {
try {//mutare pion o casuta
if (" ".equals(chessBoard[r-1][c]) && i>=16) {
chessBoard[r][c]=" ";
chessBoard[r-... |
01b5b762-7708-4ccf-bd4c-2644df14076d | 8 | @Override
public void actionPerformed (ActionEvent e) {
JFileChooser chooser = new JFileChooser();
String choosertitle = "Please select an install location";
if (optionsPane != null) {
chooser.setCurrentDirectory(new File(Settings.getSettings().getInstallPath()));
cho... |
3a6e1bee-b1d2-4b10-9f35-7c73c779c684 | 5 | public void initialize(int pop) {
int percent = -1;
map = new DMap(this,10,Math.pow(pop,1/3.));
entityList = new ArrayList<Entity>();
for(int i = 0;i < pop;i++) {
//percentage management
int newPer = (100*i)/pop;
if(GlobalVars.debug && newPer>percent) {
percent = newPer;
System.out.println(p... |
f183d471-1a72-4593-a902-d821e24cf7ed | 8 | private void calculateButtonActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_calculateButtonActionPerformed
{//GEN-HEADEREND:event_calculateButtonActionPerformed
this.logOutput.setText(""); //clear log
IPv4Adress ip = null;
SubnetMask mask = null;
try
{
... |
0a01123a-53de-4641-ab37-b44f509f97d2 | 8 | @Override
public void run() {
try {
socket = new ServerSocket(port);
System.out.println("listening on: " + port);
socket.setSoTimeout(500);
while(!stop){
Socket newClient = null;
try{
newClient = socket.accept();
System.out.println("Accepted connection!");
InputStream in = newC... |
e21c0cc6-91ed-4b77-be5d-d2d0ce59ab9f | 2 | public void RemoveFromMenu() {
if (Glob.instance != null && Glob.instance.paginae != null) Glob.instance.paginae.remove(res);
RemoveListener();
} |
5d20d8f2-41e2-4b55-94aa-df9024900fef | 4 | public void act()
{
if(game == "lose") {
if (Greenfoot.mouseClicked(this)){
Greenfoot.setWorld(new InstructionsGame1());
}
}
else if (game == "win") {
if (Greenfoot.mouseClicked(this)){
Greenfoot.setWorld(new Havenmenu());
}
}
... |
56da1935-f755-46e6-9c56-3acdbffcfd68 | 1 | private String getNodeValue(final Node node) {
Node nodeValue = node.getChildNodes().item(0);
if (nodeValue == null) {
return "";
}
return nodeValue.getNodeValue();
} |
b2537ea9-1a7f-4535-8a0c-eaa95782e9a9 | 5 | public static final TdlConclusionUpdater getTdlConclusionUpdater() throws ReasoningEngineFactoryException {
if (null == conclusionUpdater) {
String clazzName = Conf.getTdlConclusionUpdaterClassName();
try {
if (!AppConst.isDeploy) System.out.print("generating TDL conclusion updater class [" + clazzName + "]... |
b05ba3ae-9368-485d-a198-32acf4978b04 | 5 | @Override
public ArrayList<TVenta> listarVentas() throws Exception
{
Statement query = null;
Connection connection = null;
TVenta temp = new TVenta();
ArrayList<TVenta> ret = new ArrayList<TVenta>();
ArrayList<TVenta> ret2 = new ArrayList<TVenta>();
String conte... |
e2045b28-7103-4418-8bc5-dac1a32fcc04 | 7 | private Optional<Plan> promoteConflict(Conflict conflict) {
List<List<Step>> newOrderedSteps = removeStepFromList(conflict.getStep(), orderedSteps);
int leftIndex = getStepIndex(conflict.getRelationship().getRelationship().getLeft(), newOrderedSteps).get();
int rightIndex = getStepIndex(conflic... |
fb10f2e8-5a93-4435-a70e-385a4e3ecb4c | 5 | public boolean term_endpoint(String addr_) {
if (ctx_terminated) {
ZError.errno(ZError.ETERM);
return false;
}
// Check whether endpoint address passed to the function is valid.
if (addr_ == null) {
throw new IllegalArgumentException();
... |
066258d6-f616-4803-9bd5-49bc18d09e82 | 6 | @Test
public void testRemoveQueueNotExist() {
LOGGER.log(Level.INFO, "----- STARTING TEST testRemoveQueueNotExist -----");
boolean queue_not_exist = false;
try {
server1.setUseMessageQueues(true);
} catch (TimeoutException e) {
exception = true;
}
... |
6bb715db-f0aa-48ac-b8b6-81fe53538668 | 0 | public ConnectionHandler(Connection c) {
this.c = c;
} |
5c4948bc-8ad6-4849-8e34-c71ef83c14fc | 8 | @Override
public void e(float sideMot, float forMot) {
if (this.passenger == null || !(this.passenger instanceof EntityHuman)) {
super.e(sideMot, forMot);
this.W = 0.5F; // Make sure the entity can walk over half slabs,
// instead of jumping
return;
}
EntityHuman human = (EntityHuman) this.passe... |
0f7acf77-5edb-4d90-8f2e-0634a11ed227 | 6 | void createColorAndFontGroup () {
super.createColorAndFontGroup();
TableItem item = new TableItem(colorAndFontTable, SWT.None);
item.setText(ControlExample.getResourceString ("Item_Foreground_Color"));
item = new TableItem(colorAndFontTable, SWT.None);
item.setText(ControlExample.getResourceString ("Item_B... |
1f469f3b-64d3-4740-b75a-3d0403ef0ed7 | 1 | public void removeSubMatrix(int startRow, int endRow) {
for (int i = 0; i < (endRow - startRow); i++) {
data.remove(startRow);
}
} |
ec304393-4dec-4de5-ac60-3d2b45777f98 | 1 | public ClientSendThread(Registry r, GameController gc, DatagramSocket s, InetAddress a, int p) {
registry = r;
gameController = gc;
socket = s;
address = a;
port = p;
System.out.println("ClientSendThread started");
String data = "Go!";
try {
... |
1162b639-d743-4140-ba27-c8f4c874d593 | 1 | public void calculateCoefficient() {
for (AssociationEnhanced association : associations)
coefficient += ((association.getStakeholder().getMax() + association.getStakeholder().getMin()) / 2) * association.getProbability();
} |
f72403a6-c81a-4f6d-b53c-c81934dfa866 | 6 | public void update(long time, Game game) {
if((time-start) < margin*1000) {
// Opening Margin
// Maybe find a way to display shit here
}
if((time-start) > margin*1000+length*1000) {
// Ending Margin
if(boss == false) {
int pattern[] = {0,3};
float offset[] = {250,-500... |
0008334f-f7cc-46a8-b4d8-0e4b5d24e83a | 3 | public boolean equals(Quaternion r)
{
return m_x == r.GetX() && m_y == r.GetY() && m_z == r.GetZ() && m_w == r.GetW();
} |
d81a973d-1493-4cc1-adcd-e1d70f19f685 | 1 | public Image getImage(String key) {
if (images.containsKey(key)) {
Image r = images.get(key); //If the requested image is registered, return it
return r;
} else {
return images.get("default"); //If not, use the default image
}
} |
a87a55f3-da63-452a-b151-4bd3eef00ed0 | 8 | public void look() {
if (x != 0) {
worldView[x - 1][y] = world.isSolid(x - 1, y) ? State.solid : State.empty;
}
if (x + 1 != world.getWidth()) {
worldView[x + 1][y] = world.isSolid(x + 1, y) ? State.solid : State.empty;
}
if (y != 0) {
worldView[x][y - 1] = world.isSolid(x, y - 1) ? State.solid : Sta... |
72c25407-2839-47a7-8cb1-eeff04dc2459 | 0 | public SimpleTaskAcceptorStats(TaskAcceptor<T> taskAcceptor) {
this.taskAcceptor = taskAcceptor;
taskCount = 0;
totalWaitTime = 0;
constructionTime = System.currentTimeMillis();
} |
17b32ade-e24c-42d6-a35a-f836572903ad | 6 | public void processEvent(Event event)
{
// Completion event indicates that the stream was closed by RFA
if (event.getType() == Event.COMPLETION_EVENT)
{
System.out.println(_className+": Receive a COMPLETION_EVENT, "+ event.getHandle());
return;
}
System.out.println(_classNa... |
ef9941bd-d5fe-4ea5-b20c-6c2d29e17142 | 7 | public void testConstructor_int_int_int_int_int_int_int_DateTimeZone() throws Throwable {
MutableDateTime test = new MutableDateTime(2002, 6, 9, 2, 0, 0, 0, PARIS); // +02:00
assertEquals(ISOChronology.getInstance(PARIS), test.getChronology());
assertEquals(TEST_TIME_NOW, test.getMillis());
... |
3cd8b44c-93e9-4ce4-9c2b-9190c0e46bb3 | 4 | private void reset()
{
font_smoothing_selector.setSelectedItem(dialog_settings.getFontSmoothingValue());
editor_path_field.setText(dialog_settings.editor_path);
if(editor_use_env_checkbox.isSelected() != dialog_settings.editor_use_env)
{
editor_use_env_checkbox.doClick();
}
... |
171506d1-7b26-4adb-8059-ece961d3561d | 9 | public RecordManager createRecordManager( String name,
Properties options )
throws IOException
{
RecordManager recman = new BaseRecordManager( name );
String value = options.getProperty( RecordManagerOptions.DISABLE_TRANSACTIONS, "false" );
... |
ff2d2dbd-692e-4f33-ae8a-7b3c0a6f7615 | 8 | protected List<Class> findClasses(File directory, String packageName) throws ClassNotFoundException {
List<Class> classes = new ArrayList<Class>();
if (!directory.exists()) {
return classes;
}
File[] files = directory.listFiles();
for (File file : files) {
... |
414e8eab-3575-476f-9e5b-45c3a3382ab5 | 3 | private int matrixChainOrder(int p[], int i, int j)
{
if (m[i][j] < Integer.MAX_VALUE)
return m[i][j];
for (int k = i; k < j; k++)
{
int min = matrixChainOrder(p, i, k) + matrixChainOrder(p, k + 1, j)
+ p[i - 1] * p[k] * p[j];
if (min < m[i][j])
{
m[i][j] = min;
split[i][j] = k;
}
... |
e2c940bf-aa97-424c-8db7-9da8f6d0fb66 | 9 | public static String getFieldValue(Object obj, Field field) {
String value = null;
String name = field.getName();
String methodName = "get" + name.substring(0, 1).toUpperCase() + name.substring(1);
Method method = null;
Object methodValue = null;
try {
method = obj.getClass().getMethod(methodName);
} c... |
719c6227-b08c-4011-812d-c1fea211891f | 6 | @Override
public final void render(int var1, int var2) {
String titlePrint = ProgressBarDisplay.title;
if (minecraft.session == null) {
titlePrint = "Singleplayer";
}
drawFadingBox(0, 0, width, height, 1610941696, -1607454624);
drawCenteredString(fontRenderer, "G... |
ac07347e-1e76-4dc2-b79d-00bd503163fb | 9 | public String addUser(String message, String oldname, Socket socket){
name = message.substring(6);
//Checks if the name is already in use
if(users.containsKey(name) || regnames.containsKey(name)){
try{
//Notify the user that name is in use
DataOutputStream dout = new DataOutputStream(socket.getOutputStream(... |
c5a9c017-1185-4bfe-8711-bccaca14f382 | 3 | public static byte[] encryptBloc(byte[] in) {
byte[] tmp = new byte[in.length];
byte[][] state = new byte[4][Nb];
for (int i = 0; i < in.length; i++)
state[i / 4][i % 4] = in[i%4*4+i/4];
state = AddRoundKey(state, w, 0);
for (int round = 1; round < Nr; round++) {
state = SubBytes(state);
sta... |
b4443b64-ba2a-4b98-be5c-a0a11bc55ae2 | 3 | public void saveHighScores(){
DataOutputStream file;
try{
file = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(new File(HIGHSCOREFILE),false)));
}catch (FileNotFoundException ex){
return;
}
try{
file.writeInt(highScores.size());
for (int i = 0; i < highScores.size(); i++){
... |
700a80c0-66bb-460a-b3da-08db15cb9a2b | 0 | public void hide(TreeNode node) {
defaultVisible = !defaultVisible;
show(node);
defaultVisible = !defaultVisible;
} |
2e7e89d1-c80b-472d-87bc-b8398c59feb5 | 8 | public NewGame(int bolge, String bolgeAdi) {
setLayout(null);
bolgeKodu = bolge;
s = new Soru();
soruBasligi = new JLabel();
soruBasligi.setBounds(39, 37, 420, 30);
add(soruBasligi);
// 4 secenek olustur
for( int i=0; i<4; i++ ){ SecListesi.add(new JRadioButton()); }
// 4 secenegi aray... |
770d205f-1f41-4f46-9b7c-0abb75f67f27 | 1 | public void testMinus_Hours() {
Hours test2 = Hours.hours(2);
Hours test3 = Hours.hours(3);
Hours result = test2.minus(test3);
assertEquals(2, test2.getHours());
assertEquals(3, test3.getHours());
assertEquals(-1, result.getHours());
assertEquals(1, Hours... |
9156bab4-566a-4056-91ef-a96bf67fc671 | 5 | void verify() throws MVDException
{
BitSet bs1=null,bs2=null;
if ( incoming.size() > 0 )
bs1 = checkArcs( incoming.listIterator(), "incoming" );
if ( outgoing.size() > 0 )
bs2 = checkArcs( outgoing.listIterator(), "outgoing" );
if ( bs1 != null && bs2 != null )
if ( !bs1.equals(bs2) )
throw new MV... |
4ab9b7e4-2abf-4cd5-b2b7-848760e07c36 | 1 | public void visit_i2s(final Instruction inst) {
stackHeight -= 1;
if (stackHeight < minStackHeight) {
minStackHeight = stackHeight;
}
stackHeight += 1;
} |
c7945727-40d0-4167-95ca-64fdcecc65a4 | 8 | public static Statement setStatementParameters(Statement statement,
Object[] statementParameters) {
Object wrapper = null;
Method method = null;
try {
for (int i = 0; i < statementParameters.length; i++) {
wrapper = statementParameters[i];
if (!SQLReflect.complies(wrapper.getClass())) {
throw ... |
5cfde762-2689-40ab-943c-86af7d1faa9f | 8 | public int compare(String o1, String o2)
{
String s1 = (String)o1;
String s2 = (String)o2;
int thisMarker = 0;
int thatMarker = 0;
int s1Length = s1.length();
int s2Length = s2.length();
while (thisMarker < s1Length && thatMarker < s2Length)
{
... |
5f11e184-145c-4f8d-9032-522f1e62d55f | 7 | private final void wipeTargetsAndLink() {
synchronized (this.state) {
if (this.state.upToDate) {
this.state.upToDate = false;
this.state.io.endProgress("");
}
}
this.object.getTargetContainer().removeAllLinks(this.object);
final Iterator<DropTarget<C, D, T>> tIter = this.object.clearTargets();
w... |
47d95910-5306-498c-bb0c-0ce74f67b3f4 | 8 | public void changeDirectory(String resource){
//If user is allowed access to directory change directory
if (resource.length() > 0) {
if (checkDirPermission(resource) && checkForPassword(resource)) {
if (resource.equals("..")) {
int lastIndex = workingDir.... |
1dd34a06-771b-41c1-93c1-83cb1f62099b | 4 | public static void main(String[] args) throws IOException {
System.out.println("Entry point is on Wiki Tester");
Wiki nw = new Wiki();
FileOutputStream fileOutputStream = new FileOutputStream(OUTPUT_FILE);
OutputStreamWriter outputStreamWriter = new OutputStreamWriter(fileOutputStream, C... |
6ba02941-dc8b-46aa-a56d-451539313f9f | 7 | @Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
final Item target=getTarget(mob,mob.location(),givenTarget,commands,Wearable.FILTER_ANY);
if(target==null)
return false;
if(!super.invoke(mob,commands,givenTarget,auto,asLevel))
return fals... |
a9f6fe08-fd1e-4bd1-bb47-52bb6cc9315c | 2 | @Override
public E poll()
{
try
{
return (fifo ? pollFirst( timeout, unit ) : pollLast( timeout, unit ));
}
catch (InterruptedException e)
{
return null;
}
} |
596f3a6d-e1d2-42db-97ec-604f77e59858 | 3 | static void outputIcyFiles(Logger logger) {
logger.outTitle( "Output recursive file list" );
ArrayList<File> outPut = new ArrayList<File>();
File startFile = null;
try {
startFile = new File( new java.io.File(".").getCanonicalPath() );
} catch (IOException e) {
e.printStackTrace();
... |
86e93270-3b3b-4f6f-976d-f85bf1244dfe | 3 | private boolean rewriteFreeSpace(){
PrintWriter free;
try {
free = new PrintWriter(freeSpace); //new FileWriter(pointerStorage, true)
} catch (Exception e) {
System.out.println("Can't open free space Storage");
return false;
}
try{
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.