method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
dbe0f5ae-3dc3-41bb-bb63-e73725dfba70 | 5 | /* */ public void createCover()
/* */ {
/* 353 */ Random r = new Random();
/* 354 */ for (int j = 0; j < 7; j++)
/* */ {
/* 356 */ new EnemyRow((j * 200 + 100) * -1, j);
/* */
/* 358 */ for (int i = 0; i < 3; i++)
/* 359 */ switch (i) {
/* */ case 0:
/* 3... |
be6ba56d-03f4-4d42-bf05-bd30d488fb58 | 4 | private void partition() {
// We've already split this space. No worries, carry on.
if(!isLeaf()) {
return;
}
assert nodes == null;
final float nodeWidth;
final float nodeHeight;
if(width > height) {
nodeWidth = width * tree.maxScaleRat... |
246854be-b3cd-4ade-b808-2de595fa150a | 7 | @Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
MOB target=mob;
if((auto)&&(givenTarget!=null)&&(givenTarget instanceof MOB))
target=(MOB)givenTarget;
if(!super.invoke(mob,commands,givenTarget,auto,asLevel))
return false;
final boolean... |
16a4a84e-7239-488e-98eb-ffe2615fce10 | 9 | private void transcribeLyrics(Staff staff) {
if (transcriber.getCurrentColumn() > 0) transcriber.newLine();
transcriber.printString(new TextPart());
Syllabic lastSyllabic = null;
for (Event event: staff) {
if (event instanceof Note) {
Lyric lyric = ((Note)event).getLyric();
if (lyr... |
533138f5-1355-4de1-b8e6-b33f5a75eaa4 | 8 | public void importarResultados(File file) throws FileNotFoundException {
BufferedReader reader = null;
Rodada rodada = null;
Turno turno;
Jogo jogo;
Equipe mandante;
Equipe visitante;
try {
try {
reader = new BufferedReader(new InputSt... |
96312f2e-1a50-4289-9543-555bad382509 | 0 | @Test
public void EnsurePathMatchesExactNonWildCardPattern() {
Path path = new Path("alan/likes/warbyparker");
Pattern pattern = new Pattern("alan,likes,warbyparker");
assertTrue(path.match(pattern));
} |
587c854c-e556-498e-8cf2-344b618f8f93 | 4 | private synchronized TaskHolder nextTask() {
do {
long currentTime = System.currentTimeMillis() - timeDiff;
for (int i = 0, n = list.size(); i < n; i++) {
TaskHolder h = (TaskHolder) list.get(i);
if (h.time <= currentTime) {
list.remove(i);
return h;
}
}
try {
wait(1000);
} c... |
93a3518c-063c-49f9-a703-63f9d9c85a87 | 2 | public void render(Graphics g) {
g.setColor(new Color(118, 217, 245));
g.fillRect(0, 0, gameController.getMapWidth(), gameController.getMapHeight());
Background background = null;
for (int i = 0; i < backgrounds.size(); i++) {
background = backgrounds.get(i);
ba... |
d0fe9448-c5ad-41a4-beaf-35867fc12e74 | 6 | private void addComment(String comment) {
if (page == null || comment == null || comment.isEmpty())
return;
MetaData metadata = page.getMetaData();
if (metadata != null) {
String comments = metadata.getComments();
if (comments == null)
comments = "";
if (!comments.isEmpty())
comments += "\r... |
af0454a5-4a14-43b1-a78d-9a3f0c49ed1e | 6 | @Override
public void finalWrite(ChannelEvent event)
{
if( !writeQueue.isEmpty() )
{
writeQueue.offer(event);
return;
}
boolean result = false;
try
{
result = handleOutgoingEvent(event);
}
catch(Exception e)
{
event.getFuture().onException(e);
return;
}
if( !result && isWritable... |
dd276415-bfda-4b85-afd6-4dbec6ca302a | 1 | @Override
public String valueToString(Object value) throws ParseException {
return value instanceof Dice ? value.toString() : ""; //$NON-NLS-1$
} |
4b8f4d57-812b-4379-8207-3d3835748ae4 | 1 | * @return the list of future meeting(s) scheduled with this contact (maybe empty).
* @throws IllegalArgumentException if the contact does not exist
*/
@SuppressWarnings("unchecked")
public List<PastMeeting> getPastMeetingList(Contact contact) throws IllegalArgumentException
{
if(!isContactValid(contact))
{
... |
82dbc53e-0d77-4a32-8409-bca9a8a53ea6 | 4 | public E dequeue(){
if(total ==0) throw new NoSuchElementException();
E e = arr[first];
arr[first] = null;
if(++first == arr.length) first = 0;
if(--total >0 && total == arr.length / 4) resize(arr.length/2);
return e;
} |
7d1687bf-a837-48f6-876c-58aba50d1ef7 | 4 | public List<User> findFriend(String friendToAdd)
{
//Possibly extract first and last name
String firstName = null;
String lastName = null;
if (friendToAdd.contains(" "))
{
firstName = friendToAdd.substring(0, friendToAdd.indexOf(" ") - 1);
lastName = friendToAdd.substring(friendToAdd.indexOf(" ") - ... |
70d4a6ec-4d40-427c-a730-0ebf0c424e28 | 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;
... |
d5b25a48-bdea-45d2-bd0a-ceb3738e3c5d | 5 | public static ListNode removeElements(ListNode head, int val) {
ListNode p = head;
ListNode q = null;
while (null != p && val == p.val) {
p = p.next;
head = head.next;
}
if (null == head) return null;
p = head.next;
q = head;
while (null != p) {
if (val == p.val) {
... |
f3d01f15-c25f-47cd-8215-d3221fa7ed86 | 5 | protected void commonExpressionChangeToMove(Block root) {
HashMap<Block, HashMap<SSAInstruction, Integer>> blockInstructionHistroy = new HashMap<Block, HashMap<SSAInstruction, Integer>>();
Queue<Entry<Block, HashMap<SSAInstruction, Integer>>> queue = new LinkedList<Entry<Block, HashMap<SSAInstruction, Integer>>>();... |
d8638f6e-3e67-47c1-a144-55dedf4e71e1 | 4 | public static boolean checkIfPortAvailable(int checkport) {
ServerSocket ss = null;
DatagramSocket ds = null;
try {
ss = new ServerSocket(checkport);
ss.setReuseAddress(true);
ds = new DatagramSocket(checkport);
ds.setReuseAddress(true);
return true;
} catch (IOException e) {
//e.printStackTra... |
c39b2c23-75f6-48bd-8b94-1546f483daa6 | 2 | static double det(double[][] A){
double det = 0;
if(A.length == 1){
det = A[0][0];
}else{
for(int i = 0; i < A.length; i++){
det += Math.pow(-1,i)*det(minor(A,i,0))*A[i][0];
}
}
return det;
} |
9be98dcd-3477-477e-a71d-5158e7b71c16 | 8 | protected void calculateInput() {
move = -oi.getRawAnalogStickALX();
move = Math.abs(move) > threshold ? move : 0;
turn = oi.getRawAnalogStickALY();
turn = Math.abs(turn) > threshold ? turn : 0;
double moveR = -oi.getRawAnalogStickARX()* 3 / 4; //I changed this because the r... |
9cc62509-0689-462b-a862-85838f0237e6 | 3 | public void initOperatorPanels(){
Application.mediator.parseLSA();
Operator curr = Application.mediator.parser.first;
int posX = 1;
int posY = 1;
while(curr != null){
if(!curr.isConnection()){
if(curr.type == X){
curr.panel = new ... |
0b0255ec-7f15-4099-a62d-5fbd6575bc8c | 3 | public void keyPressed(int key) {
if(key == Input.KEY_LEFT ||
key == Input.KEY_RIGHT) {
inMoveStack.add(key);
if(key == Input.KEY_LEFT) dir = "left";
else dir = "right";
}
inputStack.add(key);
} |
d26117f9-d154-4a5f-a101-aac8e7090fb2 | 8 | private void loadProperties() {
InputStream is = null;
Throwable error = null;
try {
String configUrl = getConfigUrl();
if (configUrl != null) {
is = (new URL(configUrl)).openStream();
}
} catch (Throwable t) {
// Ignore
... |
4c0c9b3e-ea7e-4838-83c9-1cfa7000a76b | 6 | public Index indexDocumentBlob(File blobFile, int numberOfDocuments) throws IOException, FileNotFoundException{
Trie<IDocument> indexImplementation = new Trie<IDocument>(suggestionCacheSize, hasSortedIndex);
HashSet<String> indexTermSet = new HashSet<String>();
try {
Scanner scanner... |
ce083d3a-9c3f-44b2-9106-07034bf87fd5 | 7 | public void handle(Input input, Robot robot) {
float moveForce = 50;
// setup the player's moving flag, this control the animation
robot.setEnMouvement(false);
if (input.isKeyDown(get_key()) && robot.getEnergie() > 0
&& !robot.getPlusEnergie()) {
robot.setEnMouvement(true);
robot.applyForce(-moveForce... |
eec9a6ae-ca4a-4cd8-9e67-78ccb1d5f58d | 0 | @Override
public void init() {
addConnectListener(new ConnectListener() {
@Override
public void OnConnectEvent(ConnectEvent evt) {
fireConnect(evt);
}
});
addReceiveDataListener(new IReceiveDataListener() {
@Override
public void OnReceiveDataEvent(ReceiveDataEvent evt... |
bafd362f-0eb6-4c49-9de1-7fa5e8dc8238 | 4 | @EventHandler
public void onBlockDamage(BlockDamageEvent event)
{
KaramPlayer player = m_plugin.playerManager.addOrGetPlayer(event.getPlayer());
if (player != null)
{
String strMessage = "Set %s block position at %s";
if (player.isSelectMode(SelectMode.FirstBlo... |
84a06663-4124-446e-ad5e-61c8978ace1b | 2 | public double[] mean_std(double[] x) {
double[] ms = new double[2];
int N = x.length;
ms[0] = 0;
for (int i = 0; i < x.length; i++) {
ms[0] += x[i];
}
ms[0] /= N;
ms[1] = 0;
for (int i = 0; i < x.length; i++) {
ms[1] += (x[i] - ms... |
8c2dc288-756f-4a26-a82f-d60b38c9ff5f | 4 | public void push(int x) {
if(s.size()==0){
s.push(x);
}else{
while(!s.empty()){
l.add(s.pop());
}
if(log){
print(l);
}
s.push(x);
while( l.size()>0 ){
s.push(l.remove(l.size()-1 ) );
}
}
} |
3703bfc3-e16d-4d24-95d3-b91251ab5ade | 1 | public void removeNextGlied() {
SchlangenGlied oldNextGlied = nextGlied;
nextGlied = null;
if (oldNextGlied != null) {
nextGlied.removePreviousGlied();
}
} |
44464f2b-c04f-4b3d-8e16-bc1a583cc55e | 1 | private void saveProperties() {
try{
controller.storePropertiesToFile(propertyFile);
} catch (Exception e){
JOptionPane.showMessageDialog(this,
"Can't save properties.",
"Properties warning",
JOptionPane.WARNING_MESSAGE)... |
0439edbd-0f7b-4005-b873-0863b1c160b2 | 9 | public void runGame() {
while (!isGameOver()) {
//Checking to see that the move can be made (not overflowing a column)
boolean moveIsSafe= false;
Move nextMove= null;
while (!moveIsSafe) {
Move[] bestMoves= activePlayer.getMoves(board);
... |
0f487776-49c4-48ab-85ab-8d0b522480d0 | 6 | static protected void UpdateLineColumn(char c)
{
column++;
if (prevCharIsLF)
{
prevCharIsLF = false;
line += (column = 1);
}
else if (prevCharIsCR)
{
prevCharIsCR = false;
if (c == '\n')
{
prevCharIsLF = true;
}
else
line += (column = ... |
f374795e-4cf3-4c1b-a9c5-f936d70f1755 | 9 | public void updateInfo(object.GameObject in) {
nameLabel.setVisible(false);
nameLabel.setText("Nome: " + in.getName());
nameLabel.setVisible(true);
openLabel.setVisible(false);
openLabel.setText("");
onLabel.setVisible(false);
onLabel.setText("");
locationLabel.setVisible(false);
locationLabel.setT... |
e95c3028-2ae3-41b3-ad25-56920ff6f6a2 | 1 | TestLinkUriResolver(URI baseUri) {
final String asciiUri = baseUri.toASCIIString();
if (asciiUri.endsWith("/")) {
this.baseUri = baseUri;
} else {
this.baseUri = URI.create(asciiUri + "/");
}
} |
3d093d81-64c6-4475-89f8-a02b57d6d1b0 | 8 | public void GeneratePrime(int n)
{
if(!Prime.isEmpty())
{
Prime.clear();
}
PrimeTable = new long[n];
PrimeTable[0] = NO_PRIME;
PrimeTable[1] = NO_PRIME;
PrimeTable[2] = PRIME;
Prime.add(2);
int limit = (int)(Math.sqrt(n));
f... |
a32d8717-e0b2-4e6e-a652-126210751e28 | 3 | public boolean retainAll(Collection<?> arg0) {
boolean result = false;
for (T object : this) {
if (!arg0.contains(object)) {
remove(object);
result = true;
}
}
return result;
} |
fc46223a-e72b-459c-b95e-14b51e00021a | 5 | private void updateTeams() {
for (Player p : pCon) {
for (Player q : optTeam1)
if (p.getName().equals(q.getName()))
p.setTeam(q.getTeam());
for (Player q : optTeam2)
if (p.getName().equals(q.getName()))
p.setTeam(q.getTeam());
}
} |
a5f8e777-0acc-4b14-804d-52fadcb2688b | 1 | public void initializeAccount() throws FileNotFoundException
{
Random rand = new Random();
int randomNum = rand.nextInt(ONE_HUNDRED) + NUMBER_ONE;
while(Database.getCustomers().containsKey(randomNum))
{
rand = new Random();
randomNum = rand.nextInt(ONE_HUNDRED) + NUMBER_ONE;... |
004c40a7-14b5-466f-8e69-6221d3075fff | 4 | private boolean expired() {
if (orderDate == -1) return false ;
final int maxTime = World.STANDARD_DAY_LENGTH * 10 ;
if (actor.world().currentTime() - orderDate > maxTime) return true ;
final boolean
ongoing = shop.stocks.specialOrders().includes(order),
hasItem = shop.stocks.hasItem(item) ;... |
016f7dbf-938c-408b-acee-a515cd1c1a6c | 0 | public void setBeverage(Beverages beverage) {
this.beverage = beverage;
} |
f2504c3a-f910-4046-8917-0e98344c9aa1 | 2 | public void setDAO(String daoLine) {
if (daoLine.equals("Mock")) {
dao = new MockDAO();
}
else if (daoLine.equals("MySQL")) {
dao = new MySQLDAO();
}
} |
5bf9c39a-8d10-4355-8267-ae602631ecf8 | 8 | @Override
public int getOrder_IDByUser_IDandMaxDate(String userID) {
Connection conn = null;
PreparedStatement stmt=null;
int order_ID=0;
ResultSet rs = null;
try {
conn = dataSource.getConnection();
stmt = conn.prepareStatement("SELECT ORDER_ID FROM... |
53672d40-5aa7-439a-afdb-62434c93611d | 8 | void resizeManipulableTo(Manipulable m, float x, float y, float w, float h, float x0, float y0) {
w = Math.max(model.getLx() / nx, w);
h = Math.max(model.getLy() / ny, h);
Shape s = m.getShape();
if (s instanceof Rectangle2D.Float) {
Rectangle2D.Float r = (Rectangle2D.Float) s;
r.setRect(x, y, w, h);
} ... |
7df05497-6c6c-4784-9894-8f2a0259bdab | 0 | public void mouseClicked(MouseEvent e)
{
System.out.println("Click Mouse !");
} |
b3e92e1e-2d3d-4bf8-aec8-85cefa3b1bca | 5 | public static void update(){
for(int i = 0; i < 4; i++){
if(i == 0) prev[KeyEvent.VK_LEFT] = pressed[KeyEvent.VK_LEFT];
if(i == 1) prev[KeyEvent.VK_RIGHT] = pressed[KeyEvent.VK_RIGHT];
if(i == 2) prev[KeyEvent.VK_UP] = pressed[KeyEvent.VK_UP];
if(i == 3) prev[KeyEvent.VK_DOWN] = pressed[KeyEvent.VK_DOWN];... |
d08ab2b3-6971-45ed-a856-a1be6ea57ec5 | 7 | public void periodicityReport (String outputName) throws IOException {
if (!fileExists(outputName)) {
FileWriter output = new FileWriter (outputName);
output.write("#This is the periodicity report\n\n");
putMetaData(output);
for (Node n: graph.getNodes()) {
for (Edge e: n.getAdj()) {
output.write... |
b2b08dcb-c6b8-40a4-a66e-3983796bd5b0 | 4 | private static void writeMetrics(String sampleDir, String sampleName,
String prefix, int sampleCount, int k, String posfix) {
String topicString = ((posfix == null || posfix == "0") ? "" : "_"
+ posfix);
for (int i = 1; i <= k; i++) {
for (int j = 1; j <= sampleCount; j++) {
MetricsCalculator.calculat... |
b5809bd0-403c-4385-9c8b-76b780f29a0a | 9 | public void itemStateChanged(ItemEvent e) {
Object source = e.getItemSelectable();
int value = e.getStateChange();
if (source == boostCheck) {
if ( value == ItemEvent.DESELECTED) {
parent.do_our = false;
}
else if ( value == ItemEvent.SELECTED) {
parent.do_o... |
cddcde26-ed5d-449e-9ed7-5ab6c8c81165 | 0 | public int size()
{
return accounts.length;
} |
26a230a3-6cf9-49bc-bf37-cb9851a932e9 | 3 | private void saveStatsToFile(){
System.out.println("saveMenuListener");
try {
BufferedWriter writer = new BufferedWriter(new FileWriter(myWords));
Collections.sort(wordList);
for (WordStructure word:wordList) {
writer.write(word.getWord()+"/");
... |
d63d3e47-e1fe-477d-b391-1f91a38411f5 | 7 | @Override
public void calculateInitDist() {
/* calculate processing rate of each site */
double tmp = 0, rest = 0;
double[] daProcRateByClass = new double[iClass];
for (int i = 0; i < iClass; i++) {
tmp = 0;
System.out.print("ProcessRate[" + i + "]");
for (int j = 0; j < iSite; j++) {
dmProcessRat... |
4d275549-992c-469f-be7e-2403a399d6eb | 7 | private long calculateDavIdentification() {
if(isValid()) {
if(getAspect().getPid().equals("asp.anfrage")) {
if(getAttributeGroup().getPid().equals("atg.konfigurationsAnfrage")) {
return AttributeGroupUsageIdentifications.CONFIGURATION_READ_REQUEST;
}
else if(getAttributeGroup().getPid().equals("a... |
b14d0b7c-5c11-4563-b1c7-0e5959b1da3a | 0 | public PircBot() {} |
68a2eeaa-e83e-4cde-a592-fbd809c533a3 | 3 | public void loadLibrary() {
final String libraryFilePath = dlgLibrary.open();
if (libraryFilePath != null) {
Yaml yaml = new Yaml();
InputStream stream = null;
try {
stream = new FileInputStream(libraryFilePath);
} catch (FileN... |
a6f620fe-a1e7-48f3-af1c-9fa730558ffa | 1 | public boolean opEquals(Operator o) {
return o instanceof PutFieldOperator
&& ((PutFieldOperator) o).ref.equals(ref);
} |
49f4df43-f61e-40e7-b164-f42ba9254cfe | 4 | private HtmlText makeText() throws MalformedHtmlException{
assert !tree.isEmpty() : "Missing HtmlDocument from root";
assert chars.length()>0 : "Empty buffer";
//Construct text and chop trailing whitespaces if necessary
String text = chars.toString();
chars.setLength(0);
lastCharIsWS = true;
//Len must... |
72d3a023-af6d-4999-b2d1-9e9f1facfb0e | 3 | private boolean isLocalAvailable(Local cls) {
// TODO Auto-generated method stub
for(Local l: b.getLocals()){
if(l.toString().equals(cls.toString()) && l.getType().equals(cls.getType()))
return true;
}
return false;
} |
e38e5f58-4ae8-42c3-a758-8e5b28810c81 | 2 | @Override
public boolean remove(Widget w) {
int index = getWidgetIndex(w);
if (index != -1 && w instanceof DragButton) {
DragButton clone = ((DragButton) w).cloneButton();
dragController.makeDraggable(clone);
insert(clone, index);
}
return super.remove(w);
} |
67a59fe0-6567-40a3-89bb-70bfcff99076 | 2 | public void testPropertyCompareToDay() {
LocalDate test1 = new LocalDate(TEST_TIME1);
LocalDate test2 = new LocalDate(TEST_TIME2);
assertEquals(true, test1.dayOfMonth().compareTo(test2) < 0);
assertEquals(true, test2.dayOfMonth().compareTo(test1) > 0);
assertEquals(true, test1.da... |
88b58b8d-9ec4-4ade-a1a3-761327eefd54 | 9 | static void doubleQuickSort(double a[], int index[], int lo0, int hi0) {
int lo = lo0;
int hi = hi0;
double mid;
if ( hi0 > lo0) {
mid = a[ ( lo0 + hi0 ) / 2 ];
while( lo <= hi ) {
while( ( lo < hi0 ) && ( a[lo] < m... |
b4558ad1-3f07-46d6-b1d1-766e2dac120e | 8 | public static double[][] generateRandomSymetricProbabilistMatrix(int n, int max_par_ligne) {
double[][] matrix = new double[n][n];
// la valeur maximum que peut prendre la somme des colonnes pour chaque ligne
int[] max_ligne = new int[n];
List<Integer> lignesNonVide = new ArrayList<>();
... |
7cdda6d4-1524-4967-96ce-6f8838ce9685 | 2 | @Override
public void closePath() throws ParseException {
if(!coordinates.getFirst().equals(coordinates.getLast())){
coordinates.add((Coordinate) coordinates.getFirst().clone());
}
if(processingShell){
shellCoordinates = coordinates;
processingShell=false;
} else {
holes.add(coordinates);
}
coo... |
f42be371-15ea-45f8-9ed9-5bb6a26b34ee | 7 | private void freezePlayer(Player p) {
List<Item> itemsInInventory = p.getInventoryItems();
for (int i = 0; i < itemsInInventory.size(); i++) {
server.queuePlayerUpdate(new RemoveFromInventoryEvent(0), p.getID());
}
List<Location> dropLocs = p.getSurroundingLocations();
int i = 0;
for (Item item: itemsInI... |
204fcbda-579e-400f-9e78-3688025c7d86 | 2 | public static void merge(CSProperties base, CSProperties overlay) {
for (String key : overlay.keySet()) {
if (base.getInfo(key).containsKey("public")) {
base.put(key, overlay.get(key));
} else {
throw new IllegalArgumentException("Not public: " + key);
... |
eebffb5e-a33f-49f7-a4e7-206babc91a53 | 3 | public <T> ListPage<T> paginate(List<T> inputList, int page, int itemsPerPage) {
List<T> paginatedList = new ArrayList<T>();
int nItems = inputList.size();
int nPages = nPages(nItems, itemsPerPage);
if (page < 1) {
page = 1;
} else if (page > nPages) {
page = nPages;
}
int start = (page - 1) *... |
ff343e0f-64e6-40f9-a067-374aef3b3fac | 8 | public synchronized void exerciseOptions( int tickerId, Contract contract,
int exerciseAction, int exerciseQuantity,
String account, int override) {
// not connected?
if( !m_connected) {
notConnected(... |
3bbbb850-f2b1-477d-b3ce-fc1f23ce3984 | 0 | protected int getMaxAge()
{
return max_age;
} |
1a5fcf2d-a6aa-4d97-acd2-1d1fa2a96971 | 2 | @Override
public void actionPerformed(ActionEvent e) {
if (searchText.getText() != null && searchText.getText() != "") {
handler.addHighscorePlayer(new HighscorePlayer(searchText.getText(), 0));
table.setListData(handler.getUsers());
table.repaint();
}
} |
b1fd74b1-7e20-4431-8b49-a53ad01959b2 | 1 | public void hoverGlobe() {
if(!globerHovered) globe.setIcon(makeImageIcon("/images/globe_hover_small.png"));
else globe.setIcon(makeImageIcon("/images/globe_small.png"));
globerHovered = !globerHovered;
} |
c8266404-9537-4314-b5e5-d9bdd719a882 | 7 | protected Look(VorbisStream source, Mode mode) {
int dim = 0, maxstage = 0;
map = mode.getMapping();
parts = Residue.this.getClassifications();
fullbooks = source.getSetupHeader().getCodeBooks();
phrasebook = fullbooks[Residue.this.getClassBook()];
... |
7fb5e0b7-3f97-459e-a235-d2e82d8e00b2 | 9 | public boolean equals(Node n)
{
Parser.condense(this);
Parser.condense(n);
if( !data.equals( n.data ) || child.size() != n.child.size() )
return false;
if(child.size() == 0)
return true;
boolean[] found = new boolean[child.size()];
for(int i = 0; i<child.size(); ++i)
{
for(int j = 0;... |
d788c98f-a881-4aab-bbb4-4038b959aa15 | 2 | private final void step2() { if (ends("y") && vowelinstem()) b[k] = 'i'; } |
44d807ff-e992-4550-b4b3-9646f80655c1 | 9 | public static void readMatrix(String file, double[][] dataMatrix, double[] labels) {
try {
BufferedReader inFile = new BufferedReader(new FileReader(file));
for (int i = 0; i < dataMatrix.length; i++) {
String line = inFile.readLine();
char[] chars = line.toCharArray();
boolean isIn = false... |
7e815465-1923-4fea-8a90-0ea1d4afb008 | 6 | public void records(){
boolean bul = true;
do{ switch(recordsMenu()){
case 1: listAccounts();
break;
case 2: showAccounts();
break;
case 3:totalRetDep("retiros");
totalRetDep("depositos");
totalRetD... |
a06f9b7f-69a4-4eaf-998a-7c3fb7f91973 | 9 | @Override
public boolean doISellThis(Environmental thisThang, ShopKeeper shop)
{
if(thisThang instanceof PackagedItems)
thisThang=((PackagedItems)thisThang).peekFirstItem();
if(thisThang==null)
return false;
if((thisThang instanceof Coins)
||(thisThang instanceof DeadBody)
||(CMLib.flags().isChild(thi... |
4c911a85-cccb-4c8f-9e2a-b0e6cbec9bd9 | 0 | public void setOldBlock(State state) {
myOldBlock = state;
} |
4c528387-8a10-42e0-a730-aa8bb146a2a4 | 8 | @SuppressWarnings("deprecation")
@Override
public boolean onCommand(CommandSender cs, Command cmd, String string,
String[] args) {
if (string.equalsIgnoreCase("myboom")) {
if (!(cs instanceof Player)) {
cs.sendMessage("This is a player only command!");
} else {
Player player = (Player) cs;
... |
96c3538e-79f3-4e59-bac1-dc22d4e7dd51 | 7 | public BinomiKeko union(BinomiKeko eka, BinomiKeko toka) {
BinomiKeko keko = new BinomiKeko();
keko.root = merge(eka, toka);
if (keko.root == null) {
return keko;
}
keko.keonKoko = eka.keonKoko+toka.keonKoko;
BinomiNode prev = null;
BinomiNode current ... |
4bc8d122-a986-418d-8873-fc29e5c90a9b | 6 | public static boolean cycleMouse() {
Stack<Point> s = new Stack<Point>();
boolean[] visit = new boolean[n + 1];
s.push(new Point(hmouse, 1));
visit[hmouse] = true;
while (!s.isEmpty()) {
Point cur = s.pop();
visit[cur.x] = false;
if (cur.x == hmouse && cur.y >= 2)
return true;
for (int i = 0; ... |
5001e695-2641-4592-9f22-3a78ade35c5f | 6 | @EventHandler (priority = EventPriority.HIGHEST)
public void preProcess(final PlayerCommandPreprocessEvent evt) {
String msg = evt.getMessage();
if (msg.equalsIgnoreCase("/plugins") || msg.equalsIgnoreCase("/pl")) {
if (evt.getPlayer().hasPermission("masters.debug")) {
return;
} else {
evt.getPlayer... |
d862cdf2-69a0-4550-a0c0-4cbb9f68bb22 | 5 | public CheckResultMessage check29(int day) {
int r1 = get(39, 5);
int c1 = get(40, 5);
int r2 = get(43, 5);
int c2 = get(44, 5);
BigDecimal b = new BigDecimal(0);
if (checkVersion(file).equals("2003")) {
try {
in = new FileInputStream(file);
hWorkbook = new HSSFWorkbook(in);
b = getValue(r2 +... |
54d1419c-048c-4db6-bf0d-3e50d42ad71a | 7 | public boolean isTrue(String subject, String variable) {
String s=getValue(subject,variable);
if ( null == s ) {
if ( null != memcache ) {
/* add this value to memcache */
String key="PCTAP_" + subject + "_" + variable;
key = key.toUpperCase();
memcache.set(key,memcacheTimeout,"0");
Syste... |
56f84b2f-8366-4764-bc0d-ae5f0619c932 | 9 | public Set<WorldArea> getOverlappingWAs(Vect3D searchCenter, float radius) {
// go to root
WorldArea root = this;
while (root.hasParent()) {
root = root.getParent();
}
Set<WorldArea> matchingAreas = new HashSet<>();
List<WorldArea> currentlyExaminedAreas = new ArrayList<>();
List<WorldArea> tempAreas... |
0f6d4c09-d2e1-41ed-9775-13291fc82baa | 0 | public void setFoo(Integer foo)
{
this.foo = foo;
} |
4cd3fd60-a8c5-4be9-a10d-14e970deb9b4 | 9 | @Override
public void runMStep() {
Set<String> semanticWords = this.mtModule.getSemanticWords();
Set<String> naturalWords = this.mtModule.getNaturalWords();
WordParam wp = this.mtModule.getWp();
DistortionParam dp = this.mtModule.getDp();
int maxNatural = this.mtModule.getMaxNaturalCommandLength();
... |
7187c257-4100-4263-8418-1de09177421c | 1 | public Rectangle getRectangle(String key) {
try {
return Geometry.toRectangle(getString(key));
} catch (NumberFormatException nfe) {
return new Rectangle();
}
} |
fbfa12f0-50e3-48fd-a27f-30aa86292439 | 7 | private void handle() throws FileNotFoundException, IOException {
String ext = FileUtil.getExtensionName(file.getName());
Ioperate operate = null;
if (FILE_TYPE_XLSX.equalsIgnoreCase(ext)) {// 2007 2010
wb = new XSSFWorkbook(new FileInputStream(file));
log.debug("file is 2007+");
operate = new handleXSSF... |
e143a398-2c68-475b-a2b3-80e18fc20776 | 2 | private void delete(int odigosId,int index){
/*
* diagrafei ton epilegmeno odigo apo thn vash kai epistrefei to katallilo minima
*/
String query="delete from odigoi where id=?";
try {
con.pS=con.conn.prepareStatement(query);
con.pS.setInt(1, odigosId);
} catch (SQLException e) {
e.printStackTrace... |
1db96009-192f-40f3-b3d7-ca1d80b46229 | 6 | public int GetObject(int X, int Y, int ObjectID) {
for(int i = 0; i < server.objectHandler.MaxObjects; i++) {
if (server.objectHandler.ObjectID[i] > -1) {
if (X == server.objectHandler.ObjectX[i] && Y == server.objectHandler.ObjectY[i]) {
if (ObjectID != -1) {
if (ObjectID == server.objectHandler.Ob... |
58e824fc-df99-4913-ab41-5e758dedc4c2 | 6 | public boolean controlarRegistros(){
try {
r_con.Connection();
ResultSet rs=r_con.Consultar("select pc_fecha_cierre,pc_fecha_impresion_diario,pc_fecha_inicio from parametros_contables");
rs.next();
Fechas fechas=new Fechas();
String fechaCierre... |
e646a266-b4e4-4279-8ca4-8483768ec7cf | 6 | @Override
public void keyPressed(KeyEvent keyEvent) {
Rectangle rect = this.getBounds();
int xDirection = 0, yDirection = 0;
if (keyEvent.getKeyCode() == KeyEvent.VK_UP) {
xDirection = rect.x - (int) (VELOCITY * Math.cos(Math.toRadians(angle)));
yDirection = rect.y -(... |
fe0c1619-b21a-478c-b6b8-e79f3c979e8d | 2 | public static String md5(String word) {
String md5 = "";
try {
MessageDigest md = MessageDigest.getInstance("md5");
md.update(word.getBytes());
byte[] bytes = md.digest();
//char[] a = new char[100];
//for(int i = 0; i < bytes.length; i++) a[i]... |
c5c88aef-5d74-4cc1-90d4-8dca60262cf1 | 2 | private Timer createTimer(int timeTic) {
ActionListener action = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (!game.fillGrid() && !removeAlignments())
animationTimer.stop();
}
};
return new Timer(timeTic, action);
} |
b12f18d5-c875-4766-8304-5b63117be500 | 4 | @Override
public boolean equals(Object obj) {
if (this == obj) return true;
if (obj == null || this.getClass() != obj.getClass()) return false;
Disciplina d = (Disciplina) obj;
return sigla.equalsIgnoreCase(d.sigla) && sigla.equalsIgnoreCase(d.sigla);
} |
ae3380d7-b484-4af1-8e77-bb88ded2b322 | 0 | @Override
public void actionPerformed(ActionEvent e) {
scroller.repaint();
scroller.append("Testing: " + new Date() + "\n");
} |
ba432234-5611-4501-ae1b-f320192e2462 | 4 | public void checkPlayerTileCollision(){
//for(Tile blockTile : blockTiles){
player.setY(player.getY()-player.getDy()); // move from collision
player.setX(player.getX()-player.getDx()); // move from collision
player.setY(player.getY()+player.getDy());
for(Tile t1 : blockTiles){
if(player.getBounds... |
7d925f79-5a7a-46cf-925e-f1edf7c76e86 | 3 | private static String[] getArrayOfCardFileNames() {
String[] cardImageFileNames = new String[TOTAL_NUMBER_OF_CARDS + 1];
int suitNum = 0;
int cardValue = 0;
for (int i=0; i < cardImageFileNames.length; i++) {
if( cardValue < 10 ) {
cardImageFileNames... |
ee32b223-2692-4ee5-a52c-be4c282f2b01 | 0 | @Override
public JSONObject main(Map<String, String> params, Session session)
throws Exception {
JSONObject rtn = new JSONObject();
rtn.put("rtnCode", this.getRtnCode(200));
Appointment.findById(11L).sendInitiatedNotification();
return rtn;
} |
95f0b132-bd3f-4f81-9142-ef9c576f12a1 | 8 | static public CPArtwork read(InputStream is) {
try {
if (!readMagic(is)) {
return null; // not a ChibiPaint file
}
InflaterInputStream iis = new InflaterInputStream(is);
CPChibiChunk chunk = new CPChibiChunk(iis);
if (!chunk.is(HEAD)) {
return null; // not a valid file
}
CPChibiHeader h... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.