method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
f9244b32-c32b-4beb-bb17-8b1b3f791e8f | 0 | public int getMsgType() {
return MsgType;
} |
2eca7d49-a0ee-43dc-8993-19fa0bca5566 | 5 | private void FireSale ( int j, Housedata tAISYOUHOUSE, List<HPAdata> iFurnitureList, HPAdata taisyouHPA, int k, int l, ReadFile RF ) { //ϋvx̒Ⴂ𓊂肵܂
if ( j >= 2 ) { //_uĂƂ̂ݓ\bh
int Dur = Integer.MAX_VALUE; //ϋvxp̃L[
int II = Integer.MAX_VALUE; //Lpi
for ( int i = 0; i < getdoubleList().size(); i++ ) {
if (... |
f75ea426-f224-4290-8ac1-c0e3b07dfe4a | 3 | public static void writeString(byte[] data, int offset, int length, String string) {
if(data.length < offset + length) {
throw new IllegalArgumentException("Not enough space for writing a String at " + offset + " of length " + length);
}
for(int i = 0; i < length; i++) {
... |
72096dfb-a918-4151-b60f-2686501a5fdd | 4 | public State evalGame() {
// don't show anything, just return the final state
// shameless code copying...
// Actually play the game
// as long as there are empty squares
while (s.getnEmpty() > 0) {
Move m;
// ask the right player to make a move
if (s.whoseTurn().equals("red"))
m = red.chooseMo... |
6282c7c3-6f8f-4ce6-b4b2-1441533d9ca8 | 1 | public void increment() {
count++;
if (count > maxPublCount)
maxPublCount = count;
} |
b40e8d3b-a285-4c1c-923f-2bfa8fdc10a1 | 6 | public void nodeLeft(String gs)
{
maintenance = true;
System.out.println("Node down! Overlay repair in progres..");
/*String tmp = this.getUrl() + " Known clusters: ";
for (String s : resourceManagerLoad.keySet())
{
tmp += s + ", ";
}
logger.info(tmp);*/
for (String s : resourceManagerLoad.keySet())... |
5204cff8-4730-4c62-89d7-9a9a20b6f325 | 2 | public static Date DateParse(String str){
if(MyStringUtil.isBlank(str)){
return null;
}
try{
return format.parse(str);
}catch(Exception e){
e.printStackTrace();
}
return null;
} |
7b2d135c-2734-447b-92c7-29a2b0511ece | 7 | public SeleksiPegawaiView(SingleFrameApplication app) {
super(app);
initComponents();
// status bar initialization - message timeout, idle icon and busy animation, etc
ResourceMap resourceMap = getResourceMap();
int messageTimeout = resourceMap.getInteger("StatusBar.messageTime... |
0ae5233b-235d-4c26-b940-4ca8e0df848d | 8 | @Override
public void actionPerformed(ActionEvent e) {
switch(e.getActionCommand()){
case RUN:
Application.mediator.parseLSA();
LSAmatrix m = Application.mediator.matrix;
Application.mediator.writeInfo(m.toString());
break;
... |
f8dc9d85-ab64-444b-9bc1-b99ee017190b | 6 | public void setExit(String direction, Room neighbor, boolean blockedUntilOpened)
{
if(direction == "north")
northBlocked = blockedUntilOpened;
if(direction == "south")
southBlocked = blockedUntilOpened;
if(direction == "east")
eastBlocked = blockedUntilOpened;
if(direction == "west")... |
0b2a96c6-ced5-4667-932a-573baac3d732 | 7 | void parseLoopParameters(String[] fields) throws Exception {
fieldCount = 0;
for (int i = 0; i < fields.length; i++)
propertyReferenced[i] = false;
propertyCount = fields.length;
while (true) {
String str = tokenizer.peekToken();
if (str == null) {
fieldCount = 0;
brea... |
af103244-1a2e-42ef-ace9-8edff99a93e5 | 5 | public void paste(World world, int x, int y, int z)
{
if(valid)
{
for(int xPos = x; xPos < x+width; x++)
{
for(int zPos = z; zPos < z+length; z++)
{
for(int yPos = y; yPos < y+height; yPos++)
{
populator.setBlockWithData(world, xPos, yPos, zPos, materialList[structure[x][y][z]], mater... |
d9155d0d-1d05-4cc6-a710-fdb47fccd385 | 4 | public static boolean checkForBust(Dealer dealer, Player player) {
int playerScore = player.getDefaultScore();
int dealerScore = dealer.getDefaultScore();
// Both busted.
if(playerScore > twentyOne && dealerScore > twentyOne) {
System.out.println("Both have busted hands, so tie!");
tieSituation(player)... |
80f6e9ec-0dc5-4820-a0b6-0d305778d32b | 7 | private void reInit() {
// fix/normalize url if possible
String newURL = AbstractPage.fixURLString(null, textFieldURL.getText());
//TODO: add normalization to path, creation of non-existing dirs request and such.
String newDir = textFieldDirectory.getText();
if (newURL == null) {
// fix failed, resto... |
7e19af53-8bea-4b43-ad76-d1d20c7cd9b5 | 1 | @Test
public void testLargeAmountOfNumbers(){
for(int i = 0; i < 2000; i++){
int input = (int)(Math.random()*100)*i;
int output = HashUtilities.shortHash(input);
int expected = input % 1000;
assertEquals(output, expected);
}
} |
0e28d77a-c13e-415d-b031-7f4c13f04877 | 2 | public Event getEvent(String s) {
if (s.length() == 3 && Info.isInteger(s)) {
return fetchEvent(Integer.parseInt(s));
}
return fetchEvent(s);
} |
9cd9c09f-b7c3-4ac4-b08d-055a52628fdf | 7 | public ListNode deleteDuplicates(ListNode head) {
if (head == null) {
return null;
}
if (head.next == null) {
return head;
}
ListNode itr = head;
ListNode itrNext = head;
ListNode itrPrev = head;
// {1,1}
// {1,1,1,1}
//1 1 2
while (itr.next != null) {
itrNext = itr.next;
itrPrev = itr... |
ceecf14b-fcb1-431b-a594-7dc7df4e6ef4 | 8 | public void addBlock(String mat, BlockData blockData) {
String name = mat ;
if( blockData == null ) {
blockData = new BlockData(this) ;
}
// Register the MBean
ObjectName oName ;
try {
oName = new ObjectName("org.dkhenry.minejmx:type=BlockData,name="+name);
if( mbs.isRegistered(oName) ) {
mbs.u... |
3ed806e7-75d6-42f4-8b93-c9d73cb4d706 | 7 | @Override
public void update(GameContainer gc, StateBasedGame sbg, int delta)
throws SlickException {
// gestion de la souris
Input input = gc.getInput();
sourisX = input.getMouseX();
sourisY = input.getMouseY();
// parcours les items des options, pour voir si on est dessus
for (int i = 0; i < itemMor... |
88bf59ee-d216-4cd2-b2f9-87df74ef74ed | 2 | public boolean isSelectedWidth()
{
for(int i=0;i<markers;i++)
{
if(marker[i].isSelectedWidth())
{
return true;
}
}
return false;
} |
0f4571e5-0af7-4b5c-be46-ef958184b54c | 1 | public String toString() {
String arrayString = "";
Occurrence temp = head;
while (head != null) {
arrayString = head.getDocName() + " " + head.getTermFrequency() + "; " + arrayString;
head = head.next;
}
head = temp;
return arrayString;
} |
c8375920-af0e-43ab-82cb-edf93d6de7fc | 0 | public void setStock(int stock) {
this.stock = stock;
} |
d6de0307-e50e-43f4-a321-92a0c741c482 | 5 | @Override
public void actionPerformed(ActionEvent a) {
if(a.getSource() == TypeSel){
Clear();
switch(TypeSel.getSelectedIndex()){
case posCartLine:
initCartesianLine();
break;
case posVecLine:
initVectorLine();
break;
case posCartPlane:
initCartesian();
break;
case posVecPla... |
9bd73a8b-a19f-40b0-a37e-a83327b744ed | 0 | public void removeKey(String c) {
synchronized(keychain) {
keychain.remove(c);
numKeys--;
}
} |
43dabc5a-1107-46b1-a6ea-1aee2fc4b65b | 5 | private MobileIdNameQuery<Npc> getAncestor() {
return ctx.npcs.select().select(new Filter<Npc>() {
@Override
public boolean accept(Npc npc) {
if (Arrays.binarySearch(ANCESTOR_IDS, npc.id()) >= 0) {
final Actor interacting = npc.interacting();
return (interacting == null || !npc.inCombat() || (inte... |
30e108aa-7714-4267-ac12-a4d46a502034 | 5 | public static List<String> getLocalIPs() {
Enumeration<NetworkInterface> interfaces;
try {
interfaces = NetworkInterface.getNetworkInterfaces();
} catch (SocketException e) {
return null;
}
List<String> ips = new ArrayList<String>();
while(interfaces.hasMoreElements()) {
NetworkInterface curren... |
98bfe577-58e7-4937-8ac5-904b37fab36e | 3 | public int count(String key) {
if(key.equals(Defines.CURRENCY_NAME)){
return rangs;
}
int count = 0;
for(Item i : items){
if(key.equals(i.getName())){
count++;
}
}
return count;
} |
50092f00-e6e6-498e-9994-aff752a80d1f | 3 | @SuppressWarnings("static-access")
@EventHandler(priority = EventPriority.HIGH)
public void onMobDamage (EntityDamageByEntityEvent event) {
Entity entity = event.getEntity();
Entity damager = event.getDamager();
if (entity instanceof Player) {
if (damager instanceof Wolf) {
... |
b729bb2b-56eb-49fa-9afc-d6376ca1f9c6 | 0 | public Point3 neg(){
x = -x;
y = -y;
z = -z;
return this;
} |
f621233e-5917-484c-afd1-2a18737a88c4 | 4 | public ConnectedComponents(Graph<?> G) {
this.initId = 0;
this.id = new ListOrderedMap<>();
this.marked = new ListOrderedMap<>();
for (Object x : G.getAllVertices()) {
this.marked.put(x, false);
}
for (Object x : marked.keySet()) {
if (!this.... |
e428a417-9327-44e2-a50c-dafed96afba5 | 2 | public static List<String> readLines(InputStream in, Charset cs) throws IOException {
List<String> result = new ArrayList<String>();
cs = cs != null ? cs : Charset.defaultCharset();
BufferedReader lineReader = new BufferedReader(new InputStreamReader(in, cs));
try {
for (String line; ((line = lineReader.read... |
c07aa311-9af3-42f0-80e1-6bf5a572a3df | 5 | private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton7ActionPerformed
// TODO add your handling code here:
liceu.Administrator admin = new liceu.Administrator();
try {
admin.addMaterie(materieDeAdaugat.getText());
} catch (IOException... |
ffa0a47d-d1e4-43aa-b5c2-10f499abe750 | 0 | public test()
{
// TODO Auto-generated constructor stub
} |
2144c54c-fa29-4693-a6d7-b82123c25ec4 | 0 | public void setWidth(int w){
width = w;
} |
00688040-f08a-41f3-9113-ac273cececa9 | 2 | public boolean canPlaceSettlement(VertexLocation vertLoc) {
//TESTING BUILDING ROAD, SETTLEMENT, CITY
// clientModel.getServerModel().getPlayers().get(0).setBrick(5);
// clientModel.getServerModel().getPlayers().get(0).setWood(5);
// clientModel.getServerModel().getPlayers().get(0).setWheat(5);
// clientModel.get... |
70dea20a-9d1b-4dfe-a2f2-8d9be22a8c5a | 5 | public void removeNonUserRecords() throws SQLException
{
Collection<User> users = User.getUsers();
Collection<Integer> recordNumbers = GetRecords.create().getRecordNumbers();
Collection<Integer> toBeDeleted = new LinkedList<Integer>();
for (Integer recNumber : recordNumbers)
{
... |
16406b83-3ff5-4f1f-83d3-061113874890 | 9 | @Override
public final boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof CommandKey)) {
return false;
}
CommandKey other = (CommandKey) obj;
if (main == null) {
if (other.main != null) {
... |
8d85b4f0-d641-44b9-ad82-591740ccc1b9 | 9 | public String readLine() throws Exception {
int thisCode;
char thisChar;
String finalLine="";
// If our position is less than zero already, we are at the beginning
// with nothing to return.
if ( this.position < 0 ) {
return null;
}
for(;;) {... |
9ea3d835-5c70-42aa-8491-2b80c56e51db | 3 | static final public Map<String,Object> propMapOf(Object... objs) {
HashMap<String, Object> m = new HashMap<>();
for (int i = 0; i < objs.length; i += 2) {
//String key = objs[i].toString();
Object keyObj = objs[i];
String key = (keyObj instanceof String)?(String)keyObj:keyObj.toString();
if (i + 1 < ob... |
b3df6813-fd1b-4936-99b7-f133547cbbc1 | 4 | private Spatial drawRingRopes() {
//TODO: Refactor this shit into a loop
Cylinder rope1 = new Cylinder(5, 5, 0.15f, 28, true);
Quaternion deg90 = new Quaternion();
deg90.fromAngleAxis(FastMath.PI / 2, new Vector3f(0f, 1f, 0f));
Node ropesNode = new Node("ropes");
//left
... |
2b9b5571-57e6-49b2-9b42-c87d0c1ca159 | 6 | public static void main(String[] args) {
String inputFileName = null;
String outputFileName = null;
IParser parser = null;
INode root = null; // Root of the parse tree.
StringBuilder builder = null;
FileOutputStream stream = null;
OutputStreamWriter writer = null;
try {
try {
if (args.length <... |
2eef3141-6aa5-478a-a2f4-f63513dae14f | 1 | @Override
public void removeItems(Collection<String> items) {
try {
fTPConnector.deleteFiles(items);
items.removeAll(items);
} catch (IOException ioe) {
throw new RuntimeException(ioe);
}
} |
a6f96a64-b8c5-4de5-a365-c0061e7b69d0 | 5 | private static int[][] convertTo2D(BufferedImage image) {
final byte[] pixels = ((DataBufferByte) image.getRaster().getDataBuffer()).getData();
final int width = image.getWidth();
final int height = image.getHeight();
final boolean hasAlphaChannel = image.getAlphaRaster() != null;
int[][] result = new int[h... |
9878afb8-2451-432f-b353-71dd1a5cf4be | 5 | public static void unwrap(final String sourcePdfFile) throws FileNotFoundException, IOException
{
if (StringUtils.isBlank(sourcePdfFile))
{
throw new IllegalArgumentException();
}
Path sourcePath = Paths.get(sourcePdfFile);
if (Files.exists(sourcePath))
{... |
d149872f-d423-4ba1-984b-0239963309ee | 5 | public Report callProbLogicEval_Module(Report report, String parameters, boolean onlyLocalHypotheses,int [] selectedItens ){
int countSelected=0;
int numberOftotalPOs = this.getNumberOfProofObligations();
for (int numberPo = 1; numberPo <= numberOftotalPOs; numberPo++) {
if( countSelected<selectedIten... |
12eb74dd-a581-411b-8abe-e045349b91ef | 6 | public static boolean justificationEqlP(Justification just1, Justification just2) {
return ((just1 == just2) ||
((just1.inferenceRule == just2.inferenceRule) &&
((just1.reversePolarityP == just2.reversePolarityP) &&
((((!(just1.inferenceRule == Logic.KWD_PRIMITIVE_STRATEGY)) &&
(!... |
56680161-3770-4fe8-99b8-349532724304 | 7 | public SimpleCommand request_next_move(boolean last_valid)
{
SimpleCommand c = new SimpleCommand();
if(next_move % 5 ==0)
{ //go forward, plow left
c.a = true;
c.b = true;
c.plow_left = true;
if(next_move % 10 == 0)
c.plow_left = false;
c.plow_straight = false;
}
else if(next_move % 5 ==1)... |
6b46df68-0674-4d51-944e-de6a0719ee14 | 5 | @Test
public void testForSmoke() throws Exception {
final List<String> messages=new ArrayList<String>();
//WebSocket ws=new WebSocket("ws://echo.websocket.org");
//ws.addRequestHeader("Origin", "http://websocket.org");
WebSocket ws=new WebSocket("ws://localhost:4080/echoserver");
ws.addRequestHeader("Orig... |
2fe1e1f1-4cea-480d-b199-1ac6378d6aa4 | 4 | @Override
public void recieveEvent(Event event) {
if (event.getEventType() == EventType.INPUT
&& !event.isHandled()) {
String input = (String) event.getData();
for(String trigger : triggers) {
if(input.startsWith(trigger)) {
emit(... |
2aaee4c7-4595-497d-ac16-b38cf9531d40 | 5 | public static void main(String[] args) {
ArrayList<Integer> list = new ArrayList<Integer>();
for (int i = 0; i < 100; i++) {
list.add((int)(Math.random() * 50));
}
for (Integer value : list) {
System.out.println(value);
}
ArrayList<Integer> elderPe... |
571efce5-5027-498e-a024-7190de4489bf | 2 | @Override
protected void paintComponent(Graphics g){
super.paintComponent(g);
setBackground(Color.BLACK);
PaintTiles(g);
g.setColor(Color.WHITE);
if (status==GameStatus.SHOTHIT)
g.drawString("You got 'em! YAAAY!", 120, 480);
else if (status==GameStatus.SHOTMISSED)
g.drawString("I'm gonna die down her... |
beed862e-0e22-4e92-9fbb-c78373cd7d37 | 2 | public DefaultListModel<String> buildItemList() {
DefaultListModel<String> listModel = new DefaultListModel<String>();
for(int x = 0; x<itemDatabase.size(); x++) {
String[] temp = itemDatabase.get(x).split(";");
if(temp[0].startsWith("1"))
listModel.addElement(temp[0] + ": " + temp[1]);
}
return li... |
9ce7ce4e-a7b4-457e-ad9b-58db92726188 | 7 | public void run() {
// get line and buffer from ThreadLocals
SourceDataLine line = (SourceDataLine)localLine.get();
byte[] buffer = (byte[])localBuffer.get();
if (line == null || buffer == null) {
// the line is unavailable
return;
... |
e7631fd2-37f2-4248-9926-24c119133fd6 | 4 | public Object getValueAt(int rowIndex, int columnIndex) {
switch (columnIndex) {// parcour par colonne
case 0://colonne id_Stock
return Service.get(rowIndex).getId_sr();
case 1://colonne id_Stock
return Service.get(rowIndex).getPrix_sr();
case... |
8ad217c7-e581-44ba-8e47-441d4c80b9bc | 7 | public static MethodInvoker XMLToMethod(String _xmlString) {
SAXBuilder sxb = new SAXBuilder();
try {
InputStream stream = new ByteArrayInputStream(_xmlString.getBytes("UTF-8"));
Document doc = sxb.build(stream);
Element racine = doc.getRootElement();
String nomMethode = racine.getAttributeValu... |
50afc581-2d50-467f-b3fc-462b64591ff9 | 2 | public List<Contato> listarContatos() {
try {
List<Contato> contatos = new ArrayList<Contato>();
PreparedStatement stmt = this.conexao.prepareStatement("select * from contato");
ResultSet rs = stmt.executeQuery();
while (rs.next()) {
// criando o objeto Contato
... |
0c4446e6-bd5f-4b56-8514-5d99c20e1863 | 5 | @Override
public void mouseDragged(float x, float y, MouseEvent e) {
if (active == null) {
// deligiere an moegliche untergruppen weiter
for (PolygonGroup i : subGroupsToInform) {
i.mouseDragged(x, y, e);
}
}
if (active != null) {
... |
77b8b14a-5667-48f8-8c48-ab2f1560332b | 7 | public void addEdge(S2Point v0, S2Point v1) {
// If xor_edges is true, we look for an existing edge in the opposite
// direction. We either delete that edge or insert a new one.
if (v0.equals(v1)) {
return;
}
if (options.getXorEdges()) {
Multiset<S2Point> candidates = edges.get(v1);
... |
84a25925-51bb-4d85-9d12-47cca7229970 | 0 | public void clearGyro(){
_gyro.reset();
} |
6f69b2f6-168a-46da-b2e5-c5085e251e49 | 2 | @Override
public void keyReleased(KeyEvent e) {
int code = e.getKeyCode();
if (code > 0 && code < keys.length) {
keys[code] = false;
typed[code] = true;
}
} |
5549dcfc-1ff5-4f55-9e32-e9736782c191 | 9 | private boolean checkForEnd(byte data[]) {
if(data[0]==0&&data[1]==DATA) {
int i;
for(i = 4; i < data.length; i++) {
if(data[i] == 0) {
exitNext = true;
return false;
}
}
} else if(data[0]==0 && data[1]==ACK && exitNext) {
return true;
} else if(data[0]==0 && data[1]==5) {
return ... |
b5501555-3b6c-4c75-b8a5-07a9901bcbb8 | 7 | public static int redTicket( int a, int b, int c )
{
if ( a == 2 && b == 2 && c == 2 )
{
return 10;
}
if ( a == b && b == c )
{
return 5;
}
if ( a != b && a != c )
{
return 1;
}
return 0;
} |
f8f3dd5f-73e6-426c-8c99-815f9b9e944b | 5 | protected void writeHWReg(Size size, int addr, int value) {
int reg = addr - 0x2000;
if(mmap[reg] == null) {
mmap[reg] = new UnimplementedHardwareRegister();
Log.err(String.format("Write Memory Mapped register 0x%04x not implemented.", addr));
if (Settings.get(Settings.MEM_THROW_INVALID_ADDR).equals("tr... |
d40c7644-f40b-4957-9762-9e82c993bf41 | 1 | public static void remove() {
if (installed != null) {
Toolkit.getDefaultToolkit().removeAWTEventListener(installed);
}
installed = null;
} |
c307e1c1-6f1e-4ec4-82d4-49a8428f7e7f | 2 | private void parse(byte[] message) {
String[] exploded = explodeMessage(message);
function = Function.valueOf(exploded[0]);
if(exploded.length > 1)
uuid = exploded[1];
for (int i = 2; i < exploded.length; i++) {
parameters.add(Integer.parseInt(exploded[i]));
... |
16e0e0ce-3e8c-48ec-a8df-b33a1bde4482 | 7 | private int getTypeAccordingToFillMethod(TextGrid grid){
if(size() == 0) return TYPE_OPEN;
CellSet tempSet = copyCellSet(this);
tempSet.translate( -this.getMinX() + 1, -this.getMinY() + 1);
TextGrid subGrid = grid.getSubGrid(getMinX() - 1, getMinY() - 1, getWidth() + 3, getHeight() + 3);
AbstractionGrid ab... |
9462758a-a535-4b55-bde2-86fffb86ca8e | 0 | @Override
public void run() {
this.setPreferredSize(new Dimension(1024, 800));
this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
luoKomponentit(this.getContentPane());
this.pack();
this.setVisible(true);
} |
180411b0-b401-40ad-a7cb-ebcee7f09675 | 9 | public static String post(String adress,List<String> keys,List<String> values) throws IOException
{
String result = "";
OutputStreamWriter writer = null;
BufferedReader reader = null;
try
{
String data="";
if(keys != null && values != null)
... |
0a4880bb-6bd3-4e0d-91ed-ff9f77d32df3 | 3 | @EventHandler
public void onSignChangeEvent(SignChangeEvent event) {
if (event.getLine(0).trim().equalsIgnoreCase("[filter]")) {
BlockFace direction = plugin.getSignBack(event.getBlock());
if (direction == null || event.getBlock().getRelative(direction).getType() != Material.HOPPER... |
60d99440-4ead-4dc8-86bd-7f7aecbb152c | 2 | private void permute2Rec(int level, List<Integer> num, List<List<Integer>> res){
if (level == num.size()) res.add(new ArrayList<Integer>(num));
for (int i = level; i < num.size(); ++i){
Collections.swap(num, i, level);
permute2Rec(level + 1, num, res);
Collections.sw... |
159ceb0c-f78e-4dc6-8936-0702a0fa01e9 | 1 | @Test
public void testMissingType() throws Exception {
final Properties p = new Properties();
p.setProperty("type", "BOGUS");
final Properties[] configs = new Properties[]{p};
final FilterFactory ff = new FilterFactory(configs);
try {
final Filter[] filters = ff.g... |
046209f4-9699-443f-965c-c66779928e31 | 7 | public void run() {
// to loop until LOGOUT
boolean keepGoing = true;
while(keepGoing) {
// read a String (which is an object)
try {
cm = (ChatMessage) sInput.readObject();
}
catch (IOException e) {
display(username + " Exception reading Streams: " + e);
break;
}
catc... |
3b9f3446-6d99-4fff-8f01-bda73ac23773 | 0 | public int getHP()
{
return hp;
} |
d794f65c-e7e3-47c1-8af1-0ec582826637 | 6 | public VgerBibData getBibData()
{
VgerHoldingDataGenerator holdingGen;
VgerItemDataGenerator itemGen;
makeConnection();
bibData = new VgerBibData();
bibData =
( VgerBibData ) new JdbcTemplate( ds ).queryForObject( BIB_QUERY,
... |
9c4fe9f4-060d-4432-a676-c3953bbf8872 | 9 | public FinishedJobRecord(String str) {
StringTokenizer st = new StringTokenizer(str, ":");
int tokNumber = 0;
while (st.hasMoreElements()) {
tokNumber++;
String val = st.nextToken();
// We only get what we need, fields which are not used by
// p... |
12992d16-83b1-4f6c-938a-71f47dfd3c59 | 5 | private void initGraphics() {
startX = PREFERRED_WIDTH * 0.114;
startY = PREFERRED_WIDTH * 0.112;
stepX = PREFERRED_WIDTH * 0.072;
stepY = PREFERRED_WIDTH * 0.08;
font = Font.loadFont(getClass().getResourceAsStream("/eu/hansolo/enzo/fonts/din.otf"), PREFER... |
adf2c0c3-25be-4536-b15b-30f2aec61662 | 3 | public static ArrayList<Rating> getTestSet(String file) {
ArrayList<Rating> testset = new ArrayList<Rating>();
InputStream fis = null;
BufferedReader br;
try {
fis = new FileInputStream(file);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
br = new ... |
394aaff0-1888-489f-8d3f-92063e2d289b | 6 | @MCCommand(cmds = { "addOptions" }, op = true, usage = PORT_ADD_OPTIONS)
public boolean portAddOptions(CommandSender sender, Port port, String[] args)
{
List<String> portOptions = new ArrayList<String>();
for (int i = 2; i < args.length; i++)
{
String op = args[i];
if (!Port.checkOption(op))
{
send... |
6be62807-2e1a-4b75-ab99-664f62ec2308 | 6 | public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://down... |
89b8da4b-1930-4fcd-a2d3-e6bc7ef31781 | 8 | public String getCardTypeString()
{
String ret = "";
switch (cardType)
{
case HERO_FRONT:
ret = "Hero Front"; break;
case HERO_BACK:
ret = "Hero Back"; break;
case HERO_CARD:
ret = "Hero Card"; break;
case VILLAIN_FRONT:
ret = "Villain Character"; break;
case VILLAIN_BACK:
ret = "Vill... |
e1d8f1a5-f045-4ce0-879b-f6d6631c97f6 | 9 | public void nextFrame() {
if (loopCount < 0)
return;
int n = images != null ? images.length : 0;
if (n <= 1)
return;
if (gifDecoder == null)
return;
currentTime = System.currentTimeMillis();
if (previousFrameTime != 0L) {
if (currentTime - previousFrameTime >= getDelayTime(frameCounter)) {
... |
c5e97da1-8267-43b2-804e-9089b37deb5c | 8 | protected Point2D checkWallCollision(float newX, float newY) {
float fromX = Math.min(getPosition().getX(), newX);
float toX = Math.max(getPosition().getX() + getWidth(), newX + getWidth());
float fromY = Math.min(getPosition().getY(), newY);
float toY = Math.max(getPosition().getY() + getHeight(), newY + ge... |
c93eb8ed-b834-4014-8443-b08b3282365b | 4 | public String the(String field)
{
String newField = "", number = "";
if(field.substring(0, 1).equals(" "))
{
field.substring(1);
}
for(int i = 1; i <= field.length(); i++)
{
if(isNumber(field.substring(i - 1, i)))
{
... |
bef3ab73-bf4c-411d-8198-4f47819ca547 | 2 | public boolean clicked() {
if(key.isPressed() && !key.isHeld())
return true;
else
return false;
} |
320526ee-7e2f-454b-afad-c8f77998802e | 7 | private static void initialize(int size) {
greatestFactor = new int[size];
// wheel factorization (sort of...)
greatestFactor[1] = 1;
for (Integer seed : seeds) {
for (int i = seed; i < size; i += seed) {
greatestFactor[i] = seed;
}
}
... |
dba3ba07-ea32-4e93-a8c2-0ca3ad9b4822 | 7 | protected void generateInstructions(List<Instruction> instructions) {
for (Instruction instruction : instructions) {
m_currentInstruction = instruction.toString();
print(LABEL_PREFIX + m_instructionCounter++ + ": # " + m_currentInstruction);
indent();
if (instruction instanceof Assign) {
generateAssig... |
7baebc9a-5897-4a70-90d9-891c9e086916 | 5 | public void initTable () {
int[] fArray = {45,120,80,45,150,150,45,150,150,150,200,150,150,150,150,150,150};
for (int i=0; i<= table_fullticket.getColumnCount()-1; i++) {
table_fullticket.getColumnModel().getColumn(i).setPreferredWidth(fArray[i]);
}
int [] cArray = {... |
6990f636-7db9-41a2-9e6b-fa60ff41eb54 | 8 | protected static Request createRequest(RequestType type) {
switch(type) {
case COMPARE_AND_SET: return new CompareAndSetRequest();
case ADD_AND_GET: return new AddAndGetRequest();
case UPDATE: return new UpdateRequest();
case G... |
52cff926-6a8a-4ef0-a2bb-74908cba1b11 | 6 | public void amountDecremented(int ID)
{
switch (ID)
{
case 0:
case 1:
case 2:
case 3:
bonusStats++;
characterStr.updateMaxStats(characterStr.count + bonusStats, 18);
characterInt.updateMaxStats(characterInt.count + bonusStats, 18);
characterDex.updateMaxStats(characterDex.count + bonusStats, 18... |
fc7b2908-6d94-4d3a-ae9f-a4cd9265ffc0 | 3 | public void updatePrintField(){
ArrayList<LinkedList<Steinchen>> spielfeld = controller.getPlayground().getField();
for(int i = 0; i < 24; i++){
for(int j = 0; j < spielfeld.get(i).size(); j++){
if(spielfeld.get(i).get(j) != null){
print(spielfeld.get(i).get(j).getSteinchenID());
... |
64326ca6-3067-456d-a501-2722293299a5 | 3 | public boolean offScreen() {
return x + xMap + width < 0 || x + xMap - width > Game.WIDTH
|| y + yMap + height < 0 || y + yMap - height > Game.HEIGHT;
} |
d238e684-a0cc-4734-82e5-6b71779fe672 | 2 | public boolean listEntry(int value) {
ListElement current = head;
while (current != tail.next) {
if (current.value == value) {
return true;
}
}
return false;
} |
4a0091dd-2c19-4668-a1c4-712aff6f6d5c | 1 | public int getPrice()
{
int price;
if (_shots > 0)
{
price = _price;
} else
{
price = GameSettings.SOLD_OUT_PRICE;
}
return price;
} |
d6a68758-4fb2-4ff4-bbd6-65f7be714318 | 9 | @Override
public ClusteringOperation next()
{
byte opCode = this.opCodes.get(++opIndex);
ClusteringOperation result = null;
if (opCode == 0)
{
result = ClusteringOperation.newNextStepOp();
}
else if (opCode == 1 || opCode == 2 || opCode == 3 || opCode == 4)
{
int arg0 = this.... |
cd3f61d0-3f6e-4e4a-9403-9277750530b6 | 6 | private void vakautaKeko() {
/* taulukon koko pitäisi teoriassa olla oikeasti:
keon suurinasteisen puun aste +1 */
FibonacciSolmu[] A = new FibonacciSolmu[keonKoko];
FibonacciSolmu kasiteltava = min;
kasiteltava = kasiteltava.getLeft();
int juurienMaara = 1;
wh... |
3eb27224-c10b-4aeb-b336-e02fcf811384 | 8 | public static int countNeighbours(boolean [][] world, int col, int row){
int total = 0;
total = getCell(world, col-1, row-1) ? total + 1 : total;
total = getCell(world, col , row-1) ? total + 1 : total;
total = getCell(world, col+1, row-1) ? total + 1 : total;
total = getCell(world, col-1, row ) ? total + 1... |
4ba8f82e-8921-4ce1-a00e-76bf49c5f6f7 | 9 | public synchronized void piece(int index, int begin, byte[] block, Peer peer) {
RequestExtended request = null;
Set<RequestExtended> pendingRequests = null;
pendingRequests = peerPendingRequests.get(peer);
if (pendingRequests != null){
for (RequestExtended re : pendi... |
28b04664-1374-4512-8911-114013c1f4a8 | 5 | @Override
public void buttonPerformed(String name) {
if (name.equals("Choose Colour")) {
Color temp = JColorChooser.showDialog(null, "Choose your line color", c);
if (temp != null) {
c = temp;
}
} else if (name.equals("Save")) {
writeMap();
} else if (name.equals("Place Character")) {
setChar ... |
c6be1660-c879-4341-b796-75bbf5bb2441 | 6 | public static void loadSQLStatements(List<SQLStatement> sqlStatementsToLoad) {
Connection connection = null;
try {
connection = ConnectionPoolUtils.getConnectionFromPool();
if (connection == null) {
// just for testability: during normal execution we will never g... |
3f2b066f-d781-4d9b-b8ce-529e0ad46984 | 5 | private static void setFinder(Entry entry) {
// Eat any exception we might encounter - if this fails it'll just revert to creating
// a new JAXBContext each time. This is slow but works.
try {
Method method = entry.getClass().getDeclaredMethod("setFinder", JAXBContextFinder.class); ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.