method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
61a71299-1b0e-4d67-9056-510dbfaf294f | 0 | public int getHeight() {
return height;
} |
8eb492b9-c4bb-4786-b588-227291208b69 | 2 | private boolean jj_3_36() {
if (jj_3R_53()) return true;
if (jj_3R_54()) return true;
return false;
} |
4d02da4d-d26d-4da0-88b8-233d957684ae | 5 | private static boolean isPrimitiveOrString(Object target) {
if (target instanceof String) {
return true;
}
Class<?> classOfPrimitive = target.getClass();
for (Class<?> standardPrimitive : PRIMITIVE_TYPES) {
if (standardPrimitive.isAssignableFrom(classOfPrimitive)) {
return true;
... |
2c74f4eb-ee2e-45de-a9d7-e10603dba38c | 9 | void ChangeSwitchTexture(line_t line, boolean useAgain) {
int texTop;
int texMid;
int texBot;
int i;
int sound;
if (!useAgain)
line.special = 0;
texTop = LL.sides[line.sidenum[0]].toptexture;
texMid = LL.si... |
7d38550c-2ace-4f0f-98cd-f7cc20b8565e | 5 | public void draw(Graphics2D g){
for(int h = 0; h < tiles.length; h++){
for(int w = 0; w < tiles[0].length; w++){
if(tiles[h][w] != null){
tiles[h][w].draw(g);
}
}
}
if(character != null){
character.draw(g);
character.getFeetHitbox().draw(g);
}
for(Bullet b: bullets){
b.draw(g... |
427479f4-b5bf-42cd-bf88-0b9bad4fb0d3 | 5 | public static List <String> savedFiles(String prefix) {
final List <String> allSaved = new List <String> () ;
final File savesDir = new File("saves/") ;
for (File saved : savesDir.listFiles()) {
final String name = saved.getName() ;
if (! name.endsWith(".rep")) continue ;
if (prefix =... |
edd639b1-baad-4705-ba56-ec5b5ae5258b | 9 | private void connect() {
if(server!=null) {
stop();
return;
}
String ip=ipField.getText();
String port=portField.getText();
if(ip==null || ip.equals("")) {
JOptionPane.showMessageDialog(SocketTestServer.this,
"No IP Address.... |
ebdba70e-d18f-457c-ae28-ee8ad6dd8487 | 3 | public int[] _getChildInformation(int key) throws RegistryErrorException
{
try
{
return (int[])queryInfoKey.invoke(null, new Object[] {new Integer(key)});
}
catch (InvocationTargetException ex)
{
throw new RegistryErrorException(ex.getMessage());
}
catch (IllegalArgumentExcepti... |
ffb3200d-a0a0-462d-9145-c930c78d02aa | 0 | protected Icon getIcon() {
java.net.URL url = getClass().getResource("/ICON/expand_group.gif");
return new ImageIcon(url);
} |
6a60bcd3-3272-4718-9d87-f6bd655522e9 | 9 | public void updateEvt(){
xfond-=1;
if(keysPressed[KeyEvent.VK_UP])
p.setDeplacement(Player.SAUT);
p.update();
for(int i=0;i<plateformes.size();i++){
if(p.boundingBox.intersects(plateformes.get(i))){
switch(plateformes.get(i).PositionRelative(p)){... |
133fa417-600e-4925-9d1d-9e14be541f38 | 4 | static private int jjMoveStringLiteralDfa7_0(long old0, long active0)
{
if (((active0 &= old0)) == 0L)
return jjStartNfa_0(5, old0);
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
jjStopStringLiteralDfa_0(6, active0);
return 7;
}
switch(curChar)
{
cas... |
4eb29fc8-106e-4763-a760-fb06dc2351a1 | 7 | public void testPresent1() {
try {
TreeNode result = contains(new TreeNode("node"), mkChain(new String[]{ "node" }));
assertTrue(null, "Failed to locate the only node of a leaf!",
result != null
&& result.getData() != null
&& result.getDat... |
fde79433-054c-42ae-997d-7d151d07f659 | 6 | public void schreibeLevelRaeume(List<Raum> raumListe)
{
readRaeume();
//ID Liste der vorhandenen Räume
List<Integer> idSammlung = new ArrayList<Integer>();
for(Raum raum : _sammlParser.getSammlung())
{
idSammlung.add(raum.getId());
}
// komplett neue Räume hinzufügen
for(Raum raum : raumListe)
{... |
1adfc269-7ca4-4db4-a40a-f52ae397a9d9 | 9 | private static TreePath findPath(JTree tree, TreePath root, String[] nodes, int depth) {
GenomeTreeNode node = (GenomeTreeNode)root.getLastPathComponent();
GenomeTreeNode child = null;
TreePath parent = root;
TreePath node_path = null;
String cur_node_name = nodes[depth].trim().replaceAll... |
b3ee3281-05a3-4a1c-9b93-cbddb3e5398f | 9 | public List<Contato> buscaDocumentos(String condicao) {
List<Contato> listaContatos = new ArrayList<Contato>();
JSONObject json, documento, dadosContato;
JSONArray arrayDocumentos;
String url = getHost() + ":" + getPorta() + "/" + getNomebanco() + "/"
+ getLocalBusca();
/*
* Verifica a url usada para ... |
a32f94e8-8bf3-41fb-b20a-784cc11662b1 | 1 | public void testGetPartialConverter() {
PartialConverter c = ConverterManager.getInstance().getPartialConverter(new Long(0L));
assertEquals(Long.class, c.getSupportedType());
c = ConverterManager.getInstance().getPartialConverter(new TimeOfDay());
assertEquals(ReadablePartial.cl... |
79de8512-ec28-4771-996c-acbaa782fe89 | 8 | public static void main(String[] args) {
try {
final Class<?> clazz = Class.forName("com.effectivejava.rtti.PrivateClass");
showPrivateFields(clazz);
callPrivateMethods(clazz);
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (Secu... |
6ded8538-5754-4d68-b612-c84ed151e1d1 | 0 | public void gamble()
{
} |
528c2e27-a657-4006-bb08-4886fd440e62 | 6 | @Override
public String toString() {
String result = getName() + ", average=" + getAverage()
+ ", " + getProgram() + ", Undergrad, ";
if (this.universityOne != null)
result += this.universityOne + "-" + (this.universityOneAccept ? "admitted" : "rejected") ;
if (this.universityTwo != null)
result... |
e3811f92-9ece-41ab-ad7f-cce12fb49ecd | 4 | protected void addHandled(Handled h)
{
// Handled must be of the supported class
if (!getSupportedClass().isInstance(h))
return;
if (h != null && !this.handleds.contains(h))
{
this.handleds.add(h);
// Also starts the handler if it wasn't already
if (!this.started)
this.started = true;
... |
3f97cc0b-d4e3-4b00-80b1-e19cd67ea857 | 5 | public void kanondoda()
{
for(int i = 0;i < feedback.size();i++)
{
for(int j = 0;j < kp.size();j++)
{
for(int k = 0;k < robotar.size();k++)
{
if(kp.get(j).touches(robotar.get(k)) && kp.get(j).getID() != robotar.get(k).getID(... |
12e8656e-6fed-4900-b232-09a492d7275f | 6 | public ResultSet preencherTabelaATividadeGESTAO(String codDepartamento) throws SQLException {
Connection conexao = null;
PreparedStatement comando = null;
ResultSet resultado = null;
try {
conexao = BancoDadosUtil.getConnection();
comando = conexao.prepareStat... |
50ef502e-9ffa-4e7c-8955-3ca17ee86c74 | 4 | public Transferable createTransferable(JComponent comp) {
TreePath[] paths = cardTree.getSelectionPaths();
if (paths != null) {
ArrayList<DefaultMutableTreeNode> copies = new ArrayList<DefaultMutableTreeNode>();
DefaultMutableTreeNode node = (DefaultMutableTreeNode) paths[0].getLastPathComponent();
Default... |
eee7f55b-b34a-4848-8eff-c390ef2ad081 | 6 | @Test
public void testLoadPeople() {
//set up test variables
HumanPlayer human = game.getHuman();
boolean equal = false;
java.awt.Point testLocation;
java.awt.Color testColor;
ArrayList<ComputerPlayer> computers = game.getComputer();
ComputerPlayer testComp;
//test human player
//set to human name... |
e9ab4534-dfb8-4a57-bdf9-b48c94e111d7 | 4 | private String urlEncode(Map<String, String> map) {
StringBuilder sb = new StringBuilder();
for (String key : map.keySet()) {
if (sb.length() > 0) {
sb.append("&");
}
sb.append(key);
String value = map.get(key);
if (value != nul... |
a4d38ee5-b387-4aec-ab04-9dc66c3c85b9 | 4 | public static void filledEllipse(double x, double y, double semiMajorAxis, double semiMinorAxis) {
if (semiMajorAxis < 0) throw new RuntimeException("ellipse semimajor axis can't be negative");
if (semiMinorAxis < 0) throw new RuntimeException("ellipse semiminor axis can't be negative");
double ... |
59b2145f-260f-4fce-b977-53067d9af911 | 7 | public static void delete(JoeTree tree, OutlineLayoutManager layout, boolean deleteMode) {
Node youngestNode = tree.getYoungestInSelection();
if (youngestNode == null) {
return;
}
Node parent = youngestNode.getParent();
CompoundUndoableReplace undoable = new CompoundUndoableReplace(parent, deleteMode... |
88461dac-42ca-4aea-a247-8392df39914f | 8 | protected synchronized void showCatPage(int page) {
int pageStart = page * tabPageSize;
if (pageStart > tabButtons.size()) {
throw new IllegalArgumentException("Illegal tab page number: " + page);
}
int p = 0;
for (GenericButton b : tabButtons) {
if (p >= pageStart && p < pageStart + tabPageSize) {
... |
94fef019-bd73-45dc-910b-34644c2ad523 | 3 | static private int jjMoveStringLiteralDfa15_0(long old0, long active0)
{
if (((active0 &= old0)) == 0L)
return jjStartNfa_0(13, old0);
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
jjStopStringLiteralDfa_0(14, active0);
return 15;
}
switch(curChar)
{
... |
b26aaaa5-621a-4973-b68c-22ca6d6e40eb | 7 | public boolean isValid(String s) {
Stack<Character> stack = new Stack<Character>();
HashMap<Character, Character> hm = new HashMap<Character, Character>();
hm.put('(', ')');
hm.put('[', ']');
hm.put('{', '}');
for (int i = 0; i < s.length(); i++) {
char c = s.charAt(i);
if (... |
a96635a6-ef11-4320-862e-88aece657a79 | 0 | public void loseHealth(double damage){
headArmorSlot.reduceDamage(damage);
bodyArmorSlot.reduceDamage(damage);
hero.applyDamage(damage);
} |
aa0e3422-c471-41d1-b632-22631b890afa | 7 | public Vector searchWidth(int id){
int visitados[][] = new int [thisVert.size()][2];
Vector<Integer> fila = new Vector<Integer>();
Vector<Integer> adjacents = new Vector<Integer> ();
Vector<Integer> ordem = new Vector<Integer> ();
int v;
int aux = -1;
for (int i=0;i<thisVert.size();i++)
{
if(thisVert... |
5b7cad39-1324-421b-b34a-272b7876927b | 4 | public static long[] radixSort2(long[] a) {
int w = 64;
int d = 1;
long[] b = null;
for (int p = 0; p < w/d; p++) {
long c[] = new long[1<<d];
// the next three for loops implement counting-sort
b = new long[a.length];
for (int i = 0; i < a.len... |
3f0da744-1ffc-4696-a0c5-9e1fa5c860bb | 6 | protected void readSampleData()
{
boolean read_ready = false;
boolean write_ready = false;
int mode = header.mode();
int i;
do
{
for (i = 0; i < num_subbands; ++i)
read_ready = subbands[i].read_sampledata(stream);
do
{
for (i = 0; i < num_subbands; ++i)
write_ready... |
e0703c13-e340-4f6c-b8e6-c5ec1e84a60f | 4 | public static CellHandle[] getCellHandlesFromSheet( String strRange, WorkSheetHandle sheet )
{
CellHandle[] retCells;
StringTokenizer cellTokenizer = new StringTokenizer( strRange, "," );
ArrayList cells = new ArrayList();
do
{
String element = (String) cellTokenizer.nextElement();
if( element.contains... |
792813ac-cff0-426a-b29b-72f13762f27f | 9 | public ArrayList<ArrayList<Course>> removeConflicts(ArrayList<ArrayList<Course>> list)
{
boolean[] switches = new boolean[list.size()];
int boolCounter = 0;
boolean done = false;
for(ArrayList<Course> temp: list)
{
for(int k = 0; k < temp.size() && done == fa... |
b5d8d4d0-0c29-43d0-83a4-0ed286ad620b | 4 | @Override
public String getOutput(int id) {
switch (direction) {
case "n":
return "solid\n"
+ " {\n"
+ " \"id\" \" " + id++ + "\"\n"
+ " side\n"
+ " {\n"
+ "... |
f61073ef-8acc-4c82-abd0-b7768fb4f088 | 2 | public void writePlayers(String key, Iterable<? extends Player> players) throws KeyNotUpdatedException, KeyNotFoundException {
List<? extends Player> sortedPlayers = Lists.newArrayList(players);
Collections.sort(sortedPlayers, this.ordering);
target.writePlayers(key,sortedPlayers);
} |
c9c62bae-cffe-41f7-b645-49bfb8fec566 | 1 | public static final synchronized BundleInfo getDefault() {
if (DEFAULT == null) {
DEFAULT = new BundleInfo(BundleInfo.class);
}
return DEFAULT;
} |
580401ba-4783-47f9-9a16-447a9ccc9b4d | 6 | public static void agentmain(String agentArgs, Instrumentation inst) throws ClassNotFoundException,
UnmodifiableClassException, InterruptedException {
Class<?>[] allLoadedClasses = inst.getAllLoadedClasses();
inst.addTransformer(new HiroTransformer(), true);
for (Class<?> clazz : allLoadedClasses) {
try {
... |
88d47de3-d3aa-427d-85f9-fdc8e0601be4 | 2 | public void buildMainPanel(List<MyFile> filesList) {
if (filesList.isEmpty()) {
buildInfoPanel("Le répertoire est vide");
} else {
if (infoLabel != null) {
infoLabel.setVisible(false);
}
tableau = new JTable(new MyJTableModel(filesList));
mainPanel.add(tableau.getTableHeader(), BorderLayout.N... |
dbba7a2d-408c-4184-abae-5860e575a9eb | 5 | @Override
public void saveArrayToFile(String path, List<Integer> list) {
// checking input parameter for null
if (path == null || list == null) {
throw new IllegalArgumentException("ERROR: url is not specified!");
}
try {
File file = new File(path);
... |
0ca1222d-dd87-4dfb-ad6c-d9db8315e885 | 9 | public String toString() {
switch(this) {
case HUMAN: return "Human";
case ELF: return "Elf";
case DWARROW: return "Dwarrow";
case GOBLIN: return "Goblin";
case ANCIENT: return "Ancient";
case CULTIST: return "Cultist";
case CRONK: return "Cronk";
case SORCEROR: return "Sorcero... |
56136505-243e-42d7-ad59-096a3876c151 | 5 | public void obfuscateProject() {
String obfuscatedContent;
int totalSizeTransfert = 0;
int numberOfFiles = 0;
int fileSizeTransfert;
createDestinationDirectories();
for (FileObfuscationStructure structure : projectFileObfuscationStructureList) {
File obfuscatedFile = new File(destinationDir + "\\... |
ec2aa614-f7e9-4035-9e82-25d8b7e48db3 | 8 | private Element verifyLicense(HttpServletRequest request, Element elResult) {
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
Element elResponse = new Element ("response");
long now = (new Date()).getTime();
String method = request.getMethod();
logger.info("connection method is " + me... |
0b6c4442-4e0c-4026-aa73-bcc84bb814fb | 1 | @Override
public void draw(Graphics page)
{
BulletImage.drawImage(page, xLocation, yLocation);//Draws the plane on the component
//Draws the collision Border
if(this.getBorderVisibility())
{
drawCollisionBorder(page,xLocation,yLocation,BulletImage.getWidth(),BulletImage.getHeight());
}
} |
59624dac-6840-40a1-86a7-4db621120b82 | 8 | @Override
public SeekStatus seekCeil(BytesRef text)
throws IOException {
if (ord < numTerms && ord >= 0) {
final int cmp = term().compareTo(text);
if (cmp == 0) {
return SeekStatus.FOUND;
} else if (cmp > 0) {
reset();
}
}
// linear scan
... |
995a38b0-ec2a-4b5f-b2d6-beebbbff03f5 | 7 | @Override
public int read() throws IOException {
// We still have data left from before
if(currentIndex < inflatedBytes) {
// convert signed byte to unsigned int
int val = o[currentIndex] < 0 ? o[currentIndex] + 256 : o[currentIndex];
currentIndex++;
... |
21d76747-4123-4a8f-b0f7-8f2ce1a161b9 | 4 | @Override
public void handle(HttpExchange exchange) throws IOException {
System.out.println("In build city handler");
String responseMessage = "";
if(exchange.getRequestMethod().toLowerCase().equals("post")) {
try {
//TODO verify cookie method
String unvalidatedCookie = exchange.getRequestHeade... |
80c2fe6e-0e2c-42ef-9d71-57f47160706a | 0 | public void setjButtonQuitter(JButton jButtonQuitter) {
this.jButtonQuitter = jButtonQuitter;
} |
c472c78f-dc1b-4694-8f6f-09d4de64a55a | 1 | @Override
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
getStageManager().setStatge(StageManager.STAGE_MENUE, null);
}
} |
b156392f-a152-4c80-983d-e06325ce7175 | 1 | public void draw() {
for(int x = 0; x<downfall.size(); x++) {
downfall.get(x).draw();
}
} |
26641a8d-fba1-4f38-8d22-3ab2ea17e852 | 6 | public static ArrayList<Media> checkMediaReservation(ArrayList<MediaCopy> mediaList) {
try {
if(conn == null || conn.isClosed()){
conn = DatabaseConnection.getConnection();
}
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
ArrayLi... |
ae4b769d-6f59-4a3c-8e01-1db49117bcd4 | 3 | public static ArrayList<User> getUsers() {
ArrayList<User> users = new ArrayList<User>();
File f = new File("users.txt");
try {
FileReader fr = new FileReader(f);
BufferedReader br = new BufferedReader(fr);
String s = "";
while ((s = br.readLine()) != null) {
if (s.trim().length() > 5) {
... |
2c50ce47-7658-46da-ba77-90d7edd1da92 | 3 | private void save() {
String path="";
try {
path = SBStringUtils.getAppPath("data");
File file = new File(path, fileName);
CSVWriter writer = new CSVWriter(new FileWriter(file));
for (int i=0;i<defaults.size();i++){
ArrayList<String> d = defaults.get(i);
for (int j=0;j<d.size();j++)
wri... |
a1f5eb2a-133d-4a2d-ad44-62db0b981d17 | 4 | public void printLevelOrder(Node x) {
if (x != null) {
LinkedList list = new LinkedList(x);
Node nykyinen = list.getHeadNode();
while (list.getSize() != 0) {
System.out.println(list.getHeadKey());
// Jos jonon päällä on vasen lapsi, laitetaan s... |
e5153832-bbe1-4a1b-a5f2-7092751b0553 | 9 | public void acceptTrainingSet(final TrainingSetEvent e) {
if (e.isStructureOnly()) {
// no need to build a classifier, instead just generate a dummy
// BatchClassifierEvent in order to pass on instance structure to
// any listeners - eg. PredictionAppender can use it to determine
// the... |
dc97dc70-20c8-4d2c-b897-6b276dfda4dc | 7 | public String purchaseOrderAdd(double total, int vendorno, ArrayList<PurchaseOrderLineItemDTO> items, DataSource ds) {
PreparedStatement pstmt;
Connection con = null;
String msg = "";
Date date = new Date();
java.sql.Date sDate = new java.sql.Date(date.getTime());
int poN... |
16be5633-a0fb-451b-8d7b-cab61b4a7654 | 3 | public void clean(){
List<String> unuseds = new ArrayList<String>();
for(String path : expanded.keySet()){
if(! new File(ProjectMgr.getAssetsPath(), path).exists()){
unuseds.add(path);
}
}
for(String unused : unuseds){
... |
e7d387be-4bea-40e4-a70d-fcdfb3d7325f | 2 | public void render(Graphics g) {
g.setFont(new Font("Tahoma", Font.BOLD, 8));
level.render(g);
for (Entity e : entities) {
e.render(g);
}
player.render(g);
inv.render(g);
if (paused) {
g.setColor(new Color(0, 0, 0, 155));
g.fillRect(0, 0, Main.getDrawableWidth(), Main.getDrawableHeight());
... |
832920eb-af14-4f1b-9166-c93354dc2dc3 | 2 | @Override
public void setValueAt(Object uusi, int rivi, int sarake) {
if (sarake >= 0 && sarake < sarakeNimet.length)
{
elokuvalista.paivita(uusi, rivi, sarake);
// ilmoittaa datan muutoksesta JTable-komponentille
fireTableCellUpdated(rivi, sarake);
... |
41300826-b611-454a-87f4-2d6089e47d52 | 9 | public void actionPerformed(ActionEvent arg0) {
//find our super parent frame -- needed for dialogs
Component c = this;
while (null != c.getParent())
c = c.getParent();
if(arg0.getActionCommand().equalsIgnoreCase("SAVE")){
chooser.setCurrentDirectory(new File("boards"));
int returnVal = chooser.sh... |
b83849e5-bc4b-4fd4-8bff-9a0526bf0805 | 0 | @Basic
@Column(name = "CTR_MOA_TIPO")
public String getCtrMoaTipo() {
return ctrMoaTipo;
} |
97ea07b1-962f-4c21-b90d-fcd8c69ea0fa | 0 | @Test
public void test_static_replacer() throws Exception {
stop_tunnel_in(1000);
final String lipsum = StringUtils.lipsum(20);
final long start = System.currentTimeMillis();
new StringTrafficker(getInt("static_replacer_local_port"),
getInt("static... |
87c42f48-0b0d-4f03-a982-4efa7775cf4d | 0 | @Test
public void testGroupWithEmptyDataCanBeCreated() throws Exception {
GroupObject emptyDataGroup = new GroupObject("", "", "");
createGroup(emptyDataGroup);
} |
663977d5-ed69-4db0-b1ba-218d06ad430a | 4 | public synchronized void gridletResume(int gridletId, int userId, boolean ack)
{
boolean status = false;
// finds the Gridlet in the execution list first
int found = gridletPausedList_.indexOf(gridletId, userId);
if (found >= 0)
{
// removes the Gridlet
... |
39570b20-90a4-4fd7-b5a3-b8527bcccb5d | 7 | private void getEvidenceList(String actionType) {
titleDLM.removeAllElements();
evidenceResultList = evidence.getEvideceList(fileName, actionType, teamType);
if (evidenceResultList.size() != 0) {
for (int i = 0; i < evidenceResultList.size(); i++) {
titleDLM.addElement(evidenceResultList.get(i).getTitle())... |
492bcb01-30ed-4eea-9005-59fd87bc4872 | 8 | protected void handleMouseClick(MouseEvent paramMouseEvent)
{
if (this.clear)
{
Position localPosition = getPosition();
getEnvironment().removeObject(this);
if (this.state != null)
{
Robot localRobot = new Robot(GameApplet.thisApplet);
try
{
localRobo... |
5b4af5bc-fcf4-46b9-abbf-fa066ca77ee1 | 6 | private void updateViews() {
// make sure our view of the model is up-to-date:
for(Actor actor : model.actors) {
if (!actorToView.containsKey(actor)) {
actorToView.put(actor, new ActorView(actor));
}
}
for(Node node : model.nodes) {
if (!nodeToView.containsKey(node)) {
// TODO: come up with a h... |
5f04840e-a9a3-4f83-81bc-4d95db6b7f17 | 1 | public static String convertToRepresentationString(BigInteger irepresentation,char[] alfabet){
String out = null;
StringBuilder sb = new StringBuilder();
BigInteger leftNumber = irepresentation;
BigInteger base = BigInteger.valueOf(alfabet.length);
whil... |
2e41cebe-23af-429d-b85a-301dc226990b | 1 | public void laskeVaikeustasoa(){
if (this.alkutaso <= 1){
return;
}
this.alkutaso--;
laskeTaso();
paivitaPisteetJaTaso();
} |
c78dfca6-6f48-4c58-8d9f-ad95cb88e519 | 7 | @Test
public void testPartyStats() {
TreeMap<String, PartyStat> partyStats = new TreeMap<>();
// setup parties
determineParties(partyStats);
// loop on all bills, including resolutions
for ( String id: Bills.keySet() ) {
Bill bill = Bills.get(id);
if ( determinePassed(bill) ) {
String legislatorId ... |
971e3597-50f9-42ef-a211-9f196c780318 | 7 | @Override
public void createSomeObjects() {
this.addUser(new User("worker", "password", GroupType.WORKER));
this.addUser(new User("Gumby", "MyBrainHurts", GroupType.WORKER));
this.addUser(new User("manager", "password", GroupType.MANAGER));
ProductType pt = new ProductType("Skumbananer"), pt2 = new ProductType... |
7e26a9c7-5dc8-4c86-a94f-375cbb3c69ab | 0 | public NewAttributeDialog() {
super(Outliner.outliner, NEW_ATTRIBUTE, true);
OK = GUITreeLoader.reg.getText("ok");
CANCEL = GUITreeLoader.reg.getText("cancel");
NEW_ATTRIBUTE = GUITreeLoader.reg.getText("new_attribute");
ATTRIBUTE = GUITreeLoader.reg.getText("attribute");
VALUE = GUITreeLoader.reg.getTex... |
ffeaad01-9980-490e-92f5-357c9394935a | 3 | public static void main(String[] args) {
Scanner input = new Scanner(System.in);
while (true) {
String num = input.next();
if (num.equals("0")) return;
int answer = 0;
int pow = 2;
for (int i = num.length() - 1; i >= 0; --i) {
answer += (num.charAt(i) - '0') * (pow - 1);
pow *= 2;
}
... |
526cf658-d582-4abd-9806-88739deebb09 | 2 | private static final byte[] encodeString(ByteBuffer string)
{
int length = string.array().length;
int num_digits = 1;
while((length /= 10) > 0)
{
num_digits++;
}
byte[] bencoded_string = new byte[length+num_digits+1];
bencoded_string[num_digits] = ... |
663def43-7d77-441c-b783-04fa3949b570 | 3 | public void write(String summaryOutputFile, String detailsOutputDirectory,
List<CalendarObject> myCalendarObjects) throws IOException {
mainHTML = new Html();
summaryPageHeader = new Head();
summaryPageBody = new Body();
dayToEventMap = new HashMap<String, ArrayList<Div>>();... |
8229c331-d8fe-459b-ab0c-e38d02eb5bf4 | 8 | public void reset() {
for (JTextArea valueArea : wrappedLabelMap.values())
valueArea.setText("");
for (JLabel valueLbl : labelMap.values())
valueLbl.setText("");
for (JTextField valueField : stringMap.values())
valueField.setText("");
for (JTextField valueField : intMap.values())
valueField.setTe... |
0e572224-a8b6-45bb-b01a-e57f7471acbe | 6 | @Override
public boolean run() {
// Load config
if (config == null) loadConfig();
// Load Db
loadDb();
// Build db
if (verbose) Timer.showStdErr("Building interval forest...");
snpEffectPredictor = config.getSnpEffectPredictor();
snpEffectPredictor.buildForest();
if (verbose) Timer.showStdErr("done... |
353791aa-4a8e-4347-9063-4be7260ebf65 | 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://download.oracle.com/ja... |
7e3a05ab-6040-439e-8ffd-561cc817c20f | 1 | public final void setShip(Ship ship) {
this.ship = ship;
if(ship != null)
{
setFieldState(eFieldState.Filled);
ship.setFieldReference(this);
}
else
setFieldState(eFieldState.Empty);
} |
0507fc07-d42a-47f4-bd06-b09b4afb5199 | 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... |
14cb5133-b9ef-4fc8-bfcf-d2b166c0aa4a | 9 | private void quickSort0(int[] a, int low, int high) { //the valid elements of the list are [low, high]
if (high - low <= 1)
return;
if (high - low == 2) { //efficient!
if (a[low] > a[low + 1])
swap(low, low + 1);
return;
}
// if (high... |
11443184-689c-46c8-b9ae-e298a11b47f2 | 6 | public void receive(IPInterfaceAdapter iface, Datagram msg)
throws Exception {
// Raw listeners are called for any (IP) protocol, even if
// the datagram's destination is not this node
for (IPInterfaceListener l: rawListeners)
l.receive(iface, msg);
// Datagrams addressed to this node
if (hasAddress(ms... |
29cc70bc-7918-4ba9-82d8-322dbb42fddb | 1 | @Override
public int getPages(int intRegsPerPag, ArrayList<FilterBean> hmFilter, HashMap<String, String> hmOrder) throws Exception {
int pages;
try {
oMysql.conexion(enumTipoConexion);
pages = oMysql.getPages("usuario", intRegsPerPag, hmFilter, hmOrder);
oMysql.de... |
8b2aa9ab-2b31-49b7-bbe9-8ee2a36fd58f | 2 | private void load() {
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
pixels[x + y * width] = spritesheet.getPixel((this.x + x) + (this.y + y) * spritesheet.getSize());
}
}
} |
0cff4017-21c0-4fad-9fc2-c536db4b603c | 4 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
DimensionLevelPair other = (DimensionLevelPair) obj;
if (dimensionOrderNo != other.di... |
76e6c4dd-6b39-4b32-a2fc-291fd1670287 | 4 | public void insert( double addVal )
{
if ( leftHeap.size() == 0 || addVal < leftHeap.peekMax() )
leftHeap.add( addVal );
else
rightHeap.add( addVal );
//balance heaps if sizes differ by >1 element
if ( leftHeap.size()-rightHeap.size() > 1 )
rightHe... |
ee116dcf-823e-4f09-aff7-a8c4713ffb90 | 6 | private void splitAndFill(String[] trackPropertiesValues) {
int valuesRead = 0;
for (String propertyValue : trackPropertiesValues) {
String[] trackValue = propertyValue.split("=");
switch (trackValue[0].trim()) {
case ("RaceLaps"):
this.laps... |
3a1f7cb0-e13d-4420-811c-f2ce730278d7 | 7 | public static void main(String[] args) throws IOException {
Scanner in = new Scanner(new File("wormhole.in"));
PrintWriter out = new PrintWriter(new FileWriter("wormhole.out"));
N = in.nextInt();
wormholes = new point[N + 1];
next_on_right = new int[N + 1];
wormholes[0] ... |
2708babf-c672-4352-9074-cbb3d0d48ebf | 6 | public static List<String> unpackTIPP(String tippFile, String outputFolder) throws IOException {
List<String> fileList = new ArrayList<String>();
byte[] buffer = new byte[1024];
try {
//create output directory is not exists
File folder = new File(OUTPUT_FOLDER);
... |
7aadbdfe-3bbc-4804-9afe-909bb9faf3e6 | 5 | private static final BigInteger RSADP(final RSAPrivateKey K, BigInteger c) {
// 1. If the representative c is not between 0 and n - 1, output
// "representative out of range" and stop.
final BigInteger n = K.getModulus();
if (c.compareTo(ZERO) < 0 || c.compareTo(n.subtract(ONE)) > 0) {
... |
83e02e3b-2c9f-48b1-bbeb-66dade6cf796 | 4 | public boolean addBuddy(String user, String buddy, int sentBy) {
boolean retVal = db.addBuddies(user, buddy);
if((sentBy == ServerInterface.CLIENT) && (backupServer != null) && (retVal == true)) {
try {
backupServer.ping();
backupServer.addBuddy(user, buddy, ServerInterface.SERVER);
} catch(Excepti... |
8442c0a9-b402-4d09-abe0-72f677230da4 | 6 | @SuppressWarnings("deprecation")
@Override
public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
if(sender instanceof ConsoleCommandSender) {
sender.sendMessage("§cThis command can only be run in game!");
return true;
}
if(args.length==1)
return false;
else... |
d6b92be6-d44b-4e2b-b3de-22a12fc102d7 | 4 | protected static boolean isUSASummer(int date) throws Exception {
int[] USADSTSequence = {20070101, 20070311, 20071104, 20080309, 20081102, 20090308, 20091101, 20100314, 20101107, 20110313, 20111106, 20120311, 20121104, 20130310, 20131103, 20140309, 20141102, 20150308, 20151101, 20160313, 20161106, 20170312, 20171105... |
f5053ae9-6de3-455b-af2d-19d8ec4a93c4 | 1 | public boolean getPasteEnabled() {
return this instanceof ClipboardInterface && pasteEnabled;
} |
03273a54-3266-4fb3-bea3-1de17553c91b | 8 | public boolean equals(final Object ref)
{
if(ref instanceof GRect)
{
final GRect r = (GRect)ref;
final boolean isempty1 = isEmpty();
final boolean isempty2 = r.isEmpty();
return ((isempty1 || isempty2) && isempty1 && isempty2)
|| ((xmin == r.xmin) && (xmax == r.xmax) &&... |
e9861344-90e8-41a1-9478-021e424f095e | 2 | public static PeerSession newSession (PeerConnection conn, ExecutorService eventExec, ExecutorService connExec) {
boolean shutdownEvent = false;
ExecutorService ee = eventExec;
ExecutorService ce = connExec;
if (ee == null) {
ee = Executors.newSingleThreadExecutor();
... |
29e9c884-c4da-4cd5-8096-6f71f8ed2501 | 1 | @Override
public void mouseReleased(MouseEvent event) {
mouseDragged(event);
mShowBorder = mPressed;
mInMouseDown = false;
MouseCapture.stop(this);
if (mPressed) {
mPressed = false;
click();
}
repaint();
} |
07e64e31-052b-4062-b481-49e7773a8620 | 6 | @SuppressWarnings("unchecked")
public void load() {
//Load markets, revenue and deliveries
//If they cannot be loaded set them to null and they can be constructed by onEnable
//Load markets
try {
ObjectInputStream ois = new ObjectInputStream(new FileInputStream(Conf.dataFolder + "markets.bin"));
Objec... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.