method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
ff88bba7-481e-4b95-bfc6-30169ad92bb8 | 0 | public void setAnswerSide(AnswerSide answerSide)
{
this.answerSide = answerSide;
notifyListeners();
} |
4c6fae6c-b627-45fe-aaeb-1b9dd20cd7f6 | 5 | public static boolean isBoolean(String s) {
s = s.toUpperCase();
return s.equals("0") || s.equals("1") ||
s.equals("FALSE") || s.equals("TRUE") ||
s.equals("NO") || s.equals("YES");
} //isValidPloidy |
ca59a480-793a-4a0c-96e9-1e84faa9bf7a | 2 | public JSONObject append(String key, Object value) throws JSONException {
testValidity(value);
Object object = this.opt(key);
if (object == null) {
this.put(key, new JSONArray().put(value));
} else if (object instanceof JSONArray) {
this.put(key, ((JSONArray) obje... |
60903c0d-a5e3-46a7-845a-4797b7c62bf4 | 8 | @Override
protected void abstractWrite(Object value) {
if (value == null) {
return;
}
BindAddr bindAddr = (BindAddr) value;
switch (bindAddr.getBindStyle()) {
case V4ONLY:
radioButtonList[0].setSelected(true);
break;
case V6ONLY:
radioButtonList[1].setSelected(true);
break;
case V46... |
19be55f9-4926-4d76-b1f6-fa80b2515b63 | 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... |
bd86be9a-37c5-4147-ab74-7972e91fbf46 | 6 | private String[] expandArgs(String[] originalArgv)
{
List<String> vResult1 = Lists.newArrayList();
//
// Expand @
//
for (String arg : originalArgv)
{
if (arg.startsWith("@"))
{
String fileName = arg.substring(1);
vResult1.addAll(readFile(fileName));
}
else
{
List<String> expan... |
c49d9775-0604-4e0a-a9aa-14a73686b3a0 | 3 | public int readPlayerId(String playerName) {
int idPlayer = 0;
try {
ResultSet rs = _sqLite.query("SELECT id FROM player WHERE playername = '" + playerName + "';");
if (rs.next()) {
try {
idPlayer = rs.getInt("id");
} catch (SQLException e) {
e.printStackTrace();
}
}
} catch (SQLExc... |
09a6b7ac-3385-4ff6-918b-a79c0eb4bda4 | 1 | public Object clone() {
try {
VerifyInfo result = (VerifyInfo) super.clone();
result.stack = (Type[]) stack.clone();
result.locals = (Type[]) locals.clone();
return result;
} catch (CloneNotSupportedException ex) {
throw new AssertError("Clone not supported?");
}
} |
0661d716-7599-4fc3-b593-4f36780a4da2 | 3 | @Override
public void map(LongWritable key, Text value,org.apache.hadoop.mapreduce.Mapper.Context context)throws IOException, InterruptedException {
getParameters(context);
String[] word=value.toString().split("\t");
int number=-1;
if(word.length>2){
number=Integer.parseInt(word[word.length-1]);
for(int... |
02916e36-d377-48f4-9de9-2cae7a0a7d5b | 3 | public String predictClass(ArrayList<ArrayList<String>> datas, ArrayList<String> testT) {
Map<String, ArrayList<ArrayList<String>>> doc = this.datasOfClass(datas);
Object classes[] = doc.keySet().toArray();
double maxP = 0.00;
int maxPIndex = -1;
for (int i = 0; i < doc.size(); i... |
cbe8508a-8390-4cea-b26a-07f66ee32774 | 3 | private GameState parrotDay(GameState state, Card card)
{
Color faction = card.getFaction();
Player p = state.getPlayer(faction);
if(p.getHand().isEmpty())
{
GameState end = new GameState(state);
end.getBoard().removeCard(card);
end.getPlayer(faction).addToDiscard(card);
state.log(Faction.getPir... |
282676ec-f6ac-4d1e-a052-76cbc1e0c682 | 7 | public node delete_tree(node elem,int data) {
node elem1;
if(elem.data==data) {
if(elem.left==null && elem.right==null) {return null;}
else if(elem.left==null) {return elem.right;}
else if(elem.right==null) {return elem.left;}
else {
elem1=min(elem.right);
elem1.right=deletemin(... |
d7708e23-a5cc-4123-82f6-df6f3c184128 | 3 | @Override
public void paint(Graphics g) {
g.setColor(super.getBackground());
g.fillRect(0, 0, this.getWidth(), this.getHeight());
if(autosize)
{
if(mouseOver)
{
Image tmp = this.icon_hover.getImage().getScaledInstance(this.getWidth(), this.getHeight(), java.awt.Image.SCALE_SMOOTH);
g.drawImag... |
c45de902-9ad4-41c7-b10f-5cb0f0b8c1c0 | 9 | public List<VariantCandidate> emitWindow(String contig, int start, int end) throws Exception {
if (! refReader.containsContig(contig)) {
//throw new IllegalArgumentException("Reference does not have contig : " + contig);
System.err.println("Warning, reference does not contain contig: " +... |
74ca49af-7e42-438a-bf81-41c883b71fd2 | 6 | public Set<Map.Entry<K,Character>> entrySet() {
return new AbstractSet<Map.Entry<K,Character>>() {
public int size() {
return _map.size();
}
public boolean isEmpty() {
return TObjectCharMapDecorator.this.isEmpty();
}
p... |
801f6829-4cc8-409f-adee-26eee1396e2f | 6 | public static AdjListNode[] genRandomUndirectedGraph(int vertexCount) {
if(vertexCount <= 0) {
return null;
}
AdjListNode[] graphList = new AdjListNode[vertexCount];
Random random = new Random();
for(int i=0;i<vertexCount;i++) {
if(graphList[i] == null) {
graphList[i] = new AdjListNode(String.val... |
000ad809-1225-4ca8-87cc-ca829ab929b3 | 2 | public final void removeChildren() {
//Removes all children.
HashMap<String, HashSet<ChunkyObject>> reposess = this.getOwnables();
this.ownables = new HashMap<String, HashSet<ChunkyObject>>();
for (String key : reposess.keySet()) {
for (ChunkyObject co : reposess.get(key)) {... |
34981798-7b2a-4aa2-9a55-a3b15343f8f3 | 2 | public void renderBackground(int xScroll, int yScroll, Screen screen){
int xo = xScroll >> 4;
int yo = yScroll >> 4;
int w = (screen.w + 15) >> 4;
int h = (screen.h + 15) >> 4;
screen.setOffs(xScroll,yScroll);
for (int y = yo; y <= h + yo; y++){
for (int x = xo; x <= w + xo; x++){
getTile(x,y).... |
521d19df-f482-458c-b132-11b8c4932741 | 8 | protected void process(Object o) {
if (o instanceof AddEntity) {
EntityData data = ((AddEntity) o).data;
Entity e = null;
if (data.type == EntityType.CREATURE) {
e = new Creature(data.x, data.y, this);
} else if (data.type == EntityTyp... |
e2cd49d1-6e8a-4b5c-ac3e-212fc2427082 | 5 | private boolean zzRefill() throws java.io.IOException {
/* first: make room (if you can) */
if (zzStartRead > 0) {
System.arraycopy(zzBuffer, zzStartRead,
zzBuffer, 0,
zzEndRead-zzStartRead);
/* translate stored positions */
zzEndRead-= zzStartRe... |
34ddaeee-7392-45a4-9155-ff04310543ce | 9 | private boolean checkTitleInputs() {
//first check if the user has entered text to be overlaid
if (titleText.getText().equals("")) {
JOptionPane.showMessageDialog(null, "Please enter text to overlay on video", "Missing Input",
JOptionPane.WARNING_MESSAGE);
//otherwise if text has been entered, continue wi... |
7cf72e8f-0418-47fb-87c5-f791b5ef1821 | 1 | public String getString(int index) throws JSONException {
Object object = this.get(index);
if (object instanceof String) {
return (String)object;
}
throw new JSONException("JSONArray[" + index + "] not a string.");
} |
1ef80f62-82a8-4758-b361-9226432190dd | 7 | public Direction hitObj(GameObj other) {
if (this.willIntersect(other)) {
double dx = other.pos_x + other.width /2 - (pos_x + width /2);
double dy = other.pos_y + other.height/2 - (pos_y + height/2);
double theta = Math.atan2(dy, dx);
double diagTheta = Math.atan2(height, width);
if ( -diagTheta <= ... |
4d350efe-f07c-46d0-9930-9e423a77998d | 0 | public String getLineEnding() {return lineEnding;} |
a3d1eadf-cb47-40db-8458-63f2eb086111 | 5 | private Point vicinity(Line l){ //return value of crossing point if mouse is near enough
float x1 = vertices[l.a].x,
y1 = vertices[l.a].y,
x2 = vertices[l.b].x,
y2 = vertices[l.b].y,
x3 = mouseX,
y3 = mouseY,
x4, y4,
x, y;
if(x2 == x1){
x4 = mouseX +10;
y4 = mouseY;
}else if... |
cac4dcca-0df8-4ce8-85ea-f7fda896c321 | 3 | private static final void listContext(Context context, String indent)
{
try
{
NamingEnumeration list = context.listBindings("");
while (list.hasMore())
{
Binding item = (Binding) list.next();
String className = item.getClassName();
String name = item.getName();
System.out.println(""... |
14a85d59-b4d6-4436-8702-c6ff7ae841d7 | 4 | public static void generateTMCode( String inputFileName, SemanticAction programNode )
{
for( SemanticAction def: programNode.getBranches() ){
if( def.getName().equals("main") ){
for( SemanticAction child: def.getBranches() ){
if( child.getType() == SemanticAction.TYPE.FORMAL ){
... |
0a577f78-4e10-4cc7-b5f4-0b8a1662b86a | 0 | public void paint(Graphics g) {
g.drawImage(splashImage, BORDERSIZE, BORDERSIZE, imgWidth, imgHeight,
this);
} |
2d91c35e-86e3-4598-96d2-edec159b7cd1 | 7 | public POMInfo searchMatchingPOM(Dependency dependency) {
if (dependency == null) {
return null;
}
POMInfo pom = getPOM(dependency);
if (pom != null) {
return pom;
}
Map<DependencyRule, POMInfo> potentialMatches = new TreeMap<DependencyRu... |
c902dbfd-2102-464a-b7d7-d180bcb2402f | 2 | public static void main( String[] args ) {
//loading...
YoRPG game = new YoRPG();
int encounters = 0;
while( encounters < MAX_ENCOUNTERS ) {
if ( !game.playTurn() )
break;
encounters++;
System.out.println();
}
System.out.println( "Thy game doth be over." );
/*================================... |
af9a4c3f-b96d-4ce9-a14e-94f44e00c5b6 | 0 | public void setDescription(String description) {
this.description = description;
setDirty();
} |
dfe553c0-df14-48fc-9ce3-dcf1a0f21b57 | 0 | public OutlinerFileChooser(FileSystemView fsv) {
super(fsv);
} |
91dad213-1392-4784-a323-e8f19ef74a71 | 9 | public void upgradeEquipment(Player p){
int n = -1;
String head = "Upgrade Equipment";
String textBlock = "Choose one of your Equipment Cards to upgrade.";
ArrayList<String> strList = new ArrayList<String>();
ArrayList<Card> inv = new ArrayList<Card>();
for(Card item: p.inventory){
if(!item.ultimate && !... |
951c38e8-d149-42f0-99a1-201ebf1b6c7b | 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... |
4c039c2d-d9fc-4c26-abec-aa1c03fb9cd2 | 4 | public boolean isOverControl(int xpos, int ypos) {
boolean answer = false;
if ((xpos >= x && xpos <= x+width) && (ypos >= y && ypos <= y+height)){
answer = true;
}
return answer;
} |
48afd096-dcdb-40bd-8ccd-ef54be67c41d | 2 | public void doAll()
{
for(int i = 0; i < myAllCases.size(); i++)
{
if(!myDoneCases.contains(myAllCases.get(i)))
myDoneCases.add(myAllCases.get(i));
}
} |
0c25b971-15b8-4f30-a2a2-a445a2c557dc | 8 | public int maximalRectangle(char[][] matrix) {
if (matrix.length == 0)
return 0;
int maxArea = 0;
int[] height = new int[matrix[0].length + 1];
for (int i = 0; i < matrix.length; i++) {
Stack<Integer> s = new Stack<Integer>();
for (int j = 0; j < matrix[0].length; j++) {
if (matrix[i][j] == '0')
... |
6630f097-9168-4aa9-ab82-99f5315acc81 | 4 | public void removeTileset(TileSet tileset) {
// Sanity check
final int tilesetIndex = tileSets.indexOf(tileset);
if (tilesetIndex == -1)
return;
// Go through the map and remove any instances of the tiles in the set
for (Tile tile : tileset) {
for (MapLay... |
b38bd5b8-336b-4021-8021-bdee17bf4f3d | 2 | @Test
public void next_100Threads1000Numbers_NoDuplicatesAndMissingVal() {
ExecutorService es = Executors.newFixedThreadPool(100);
ConcGeomProgression cgp = new ConcGeomProgression();
GeomProber.setCounter(1000);
for (int i = 0; i < 100; ++i) {
es.submit... |
296a9b1b-b403-4d6e-b5c4-6fb561bed51d | 6 | public void refreshView()
{
Player player = model.getActivePlayer();
//Player name
view.setPlayerName(player.getName());
//Center row
for(int i = 0; i<GameModel.CENTER_ROW_SIZE; i++)
{
Card card = model.getCenterRow().get(i);
view.setCenterRowCard(i,card.name);
}
//Player hand
view.cle... |
c07a0882-c544-417d-b1e1-7dd01db0e44d | 6 | public void execute() {
if (pins[3].value && !lastClock) {
pins[1].value = pins[0].value;
pins[2].value = !pins[0].value;
}
if (hasSet() && pins[5].value) {
pins[1].value = true;
pins[2].value = false;
}
if (hasReset() && pins[4].va... |
93558e30-bf2a-477a-9db8-e9fd462fc23c | 9 | public boolean changedCategory() {
if ((originalProduct == null) && (changedProduct == null))
return false;
else
if ((originalProduct == null) || (changedProduct == null))
return true;
else
if ((originalProduct.getCategory()==null) && (... |
31c39c36-cd21-4ade-bcea-c94c4a230f8d | 5 | public String bestWToString() {
String string = "";
for (HardwareSetAlternative hardwareSetAlternative : hardwareSystem.getHardwareSetAlternatives()) {
string += hardwareSetAlternative + " hosts ";
for (DeployedComponent deployedComponent : deploymentW.getDeployedComponents())
if (deployedComponent.getHar... |
17ae2098-025d-4c52-942d-0032643faeec | 8 | 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... |
52aa8a0e-f3d9-473f-9b5b-e8fdc12e7ac9 | 3 | public void run() {
while (true) {
try {
newData = receiver.getData();
if (newData != null){
System.out.println("Trololol this is newData: " + newData);
gameLogic = new GameLogic(newData);
gameWindow = new GameWindow(gameLogic);
} else {}
sleep(1000);
} catch (InterruptedE... |
78bac7f5-695e-4a95-887e-1761fa6e13ca | 1 | private File invokeOsmarenderXsltProc() throws IOException, InterruptedException {
final String osmarender = "lib/osmarender.xsl";
File osmarenderOutput = File.createTempFile("map", ".svg");
String[] command = new String[5];
command[0] = "xsltproc";
command[1] = "-o";
command[2] = osmarenderOutput.getCan... |
488db9ee-9c54-40fe-a58b-dc27072ab108 | 2 | private static void dumpStack(NumberStack<?> stack) {
for (Number n : stack.getStack()) {
System.out.println(n);
}
} |
17da21c4-02ca-46bb-89d0-8d1a1c60d08d | 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... |
47679bdc-68a4-4106-9b8e-78bac8cd3904 | 0 | public void driver() {
System.out.println("audo drive");
} |
981fee70-2383-470c-b53f-19867f7cad58 | 3 | public double[] do100baudFSKHalfSymbolBinRequest (CircularDataBuffer circBuf,int start,int bin0,int bin1) {
double vals[]=new double[2];
// Get the data from the circular buffer
double samData[]=circBuf.extractDataDouble(start,40);
double datar[]=new double[FFT_160_SIZE];
// Run the data through a Blackman wi... |
061169a3-7225-4e6e-b2b0-6ef43555225f | 4 | public static void main(String[] args) {
int result = 0;
int oldNumber = 0;
for (int count = 113383; count < 1000000; count++) {
long answer = count;
int number = 0;
while (answer != 1) {
number++;
if (answer % 2 == 0) {
answer /= 2;
}
else {
answer = 3*answer+1;
}
}
i... |
b544be19-944a-4965-82c9-ab2dd54cae74 | 8 | private void refreshAllTabs() {
synchronized (m_refreshLock) {
// disable the ChangeListener of m_tabbedPane
m_refreshInProgress = true;
// disable the user to modify m_tabbedPane while processing
m_tabbedPane.setEnabled(false);
// remove all tabs
m_tabbedPane.removeAll();
// load eve... |
983ca9cf-71be-42fe-9df4-4b4e37be87df | 9 | public void mover(){
int tamanio = this.cuerpo.size()-1;
Punto posicionDeLaPrimeraParte = this.cuerpo.get(0).getPosicion();
Punto posicionDeLaUltimaParte = this.cuerpo.get(tamanio).getPosicion();
int inicioX= posicionDeLaPrimeraParte.obtenerX();
int inicioY = posicionDeLaPrimeraParte.obtenerY();
int finX... |
d8fedb9c-b80e-4c19-a318-514a002d82e4 | 4 | public static void main(String args[]) throws ParserConfigurationException, SAXException, IOException {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder documentBuilder = factory.newDocumentBuilder();
InputSource inputStream = new InputSource();
// For parsing XML document... |
03b0baaf-f5f5-4c21-8aa5-a80f62bee8cc | 5 | public boolean set_data(byte[] ar, long startSector){
int i;
int j;//=242;
FileRecord fileRec = new FileRecord();
String size = "NTFS Sizer Error";
String attrib="";
Offset_to_Update_Sequence_Array = Utils.hexToInt(Utils.hex(ar[20]), Utils.hex(ar[21]));
... |
463f2325-c055-48aa-91e0-342a6d0e3791 | 2 | public static Supplier getByNumber(final Long number) {
JSONArray fetchByNumber = null;
try {
fetchByNumber = fetchByNumber(ApiProperties.get().getToken(), object, number);
} catch (IOException e) {
e.printStackTrace();
}
List<Supplier> formatOutputs = formatOutputs(fetchByNumber);
if (formatOutputs.s... |
e3405c13-e125-4b45-9ba6-2e9fcc525989 | 4 | public boolean attackCompatible(Territory t1, Territory t2){
if(!t1.hasConnection(t2) || t1.getOwner().getID() == t2.getOwner().getID() || t1.getNbrOfUnits() < 2 || t2.isProtected()){
return false;
}
return true;
} |
15910a05-efb2-4e9f-97db-ec0f2ba0ae13 | 5 | @Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Departamento)) {
return false;
}
Departamento other = (Departamento) object;
if ((this.getId() == null && other... |
257d4302-5f26-4a10-bcd4-39dc0747520b | 2 | public Player getOpponentPlayer() {
for (int playerIndex = players.length - 1; playerIndex >= 0; --playerIndex) {
Player player = players[playerIndex];
if (!player.isMe()) {
return player;
}
}
return null;
} |
cd38ef51-a521-4f35-a697-28c0ad1e1118 | 8 | private void encodeRefresh(ItemInfo itemInfo, Object[] orderEntries, boolean completed, boolean solicited)
{
OMMMsg outmsg = _mgr.getPool().acquireMsg();
outmsg.setAttribInfo(itemInfo.getOMMAttribInfo());
outmsg.setItemGroup(0);
// Set the message type to be refresh respons... |
fff2be8f-bd88-48a0-a995-1279408986ec | 0 | protected static Map<String, String> getColumns() {
Map<String, String> columns = SQLPermissionBase.getColumns();
columns.put("inheritence", "TEXT");
columns.put("default", "BOOLEAN");
columns.put("rank", "INTEGER");
return columns;
} |
3871cf86-ced8-45ea-9b9f-19ecf847e406 | 8 | public static boolean computeCell(boolean[][] world, int col, int row)
{
// liveCell is true if the cell at position (col,row) in world is live
boolean liveCell = getCell(world, col, row);
// neighbours is the number of live neighbours to cell (col,row)
int neighbours = countNeighbours(world, col... |
93b2ad13-9d09-4b37-bbae-eec3a071a407 | 1 | public static void main(String[] args) {
try {
GroupsDialog dialog = new GroupsDialog();
dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
dialog.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
} |
d465fbbb-fa54-4b06-b0ba-c569e9e4e5b9 | 2 | private synchronized MAC getHMACSHA1(){
if(hmacsha1==null){
try{
Class c=Class.forName(jsch.getConfig("hmac-sha1"));
hmacsha1=(MAC)(c.newInstance());
}
catch(Exception e){
System.err.println("hmacsha1: "+e);
}
}
return hmacsha1;
} |
86cdd1b7-30f3-4fc6-935b-941c7cc184bc | 6 | @Override public Icon getIcon() {
boolean jetUp = checkStateFlag(S_BOTTOM_THRUSTER_ON);
boolean jetForward = checkStateFlag(S_BACK_THRUSTER_ON);
boolean feetOnGround = checkStateFlag(S_FEET_ON_GROUND);
boolean facingLeft = checkStateFlag(S_FACING_LEFT);
Icon icon =
jetUp && jetForward ? icons... |
30509239-b266-48cb-a50c-3eadf8726b33 | 4 | FieldWriter(final ClassWriter cw, final int access, final String name,
final String desc, final String signature, final Object value) {
super(Opcodes.ASM4);
if (cw.firstField == null) {
cw.firstField = this;
} else {
cw.lastField.fv = this;
}
c... |
e488f3ca-7a08-4f44-a83d-b749f857e30a | 0 | public int getSearchSentenceLength()
{
_read.lock();
try
{
return _searchSentenceLength;
}
finally
{
_read.unlock();
}
} |
0d0a74cf-0b6f-4d0b-af01-d2ca54be25c4 | 8 | private boolean collision(Tile[][] piece)
{
if (piece == null)
return false;
Tile origin = piece[0][0];
for (int i = 0; (i + origin.getX()) < grid.length && i < piece.length; i++)
{
for (int j = 0; (j + origin.getY()) < grid[i].length && j < piece[i].length; j++)
{
if ((grid[i + origin.getX()][j +... |
9a8e5590-740a-438b-a96e-72a5b11b6731 | 8 | int select(SelectableChannel channel, int ops, long timeout)
throws IOException {
SelectorInfo info = get(channel);
SelectionKey key = null;
int ret = 0;
try {
while (true) {
long start = (timeout == 0) ? 0 : System
.currentTimeMillis();
key = channel.register(info.selector, ops... |
11f912af-9998-4b91-a2a4-633c1b4877d3 | 0 | @Override
public void addQuestAnswer(String answ) {
questAnswer.add(answ);
} |
753655b0-8b4b-4c5c-bc93-cdf7ed3fe509 | 0 | private void init() {
containers = null;
container = null;
} |
70230009-f626-4841-8f53-933126a0859d | 5 | @Command(command = "rank",
arguments = {"target player[s]"},
description = "tells you the rank of the target player[s]",
permissions = {"rank"})
public static boolean rank(CommandSender sender, String targetPlayer) throws EssentialsCommandException {
// get a list of all target players
ArrayList<Player> t... |
107b5267-38d1-47de-8ee4-9f4b8a598d5c | 2 | public static int findIndexInVec(Vector thisVec, String ID) {
for (int i = 0; i < thisVec.size(); i++) {
if (((String) thisVec.get(i)).equals(ID))
return i;
}
return -9;
} |
d5e3299a-876c-43f8-b9b1-d6233f990523 | 5 | public static void main(String [] args) {
// instantiate some elements
IntSeq i1 = new IntSeq();
IntSeq i2 = new IntSeq();
IntSeq i3 = new IntSeq(88);
IntSeq i4 = new IntSeq(97, 55);
IntSeq i5 = new IntSeq(102, 103, 101, 107, 109);
IntSeq i6 = new IntSeq(41, 42, 43, 44);
IntSeq i9 = new... |
c8dc2311-d40d-45aa-b00d-9649080dea71 | 2 | @Override
public ArrayList<Labo> getAll() throws DaoException {
ArrayList<Labo> result = new ArrayList<Labo>();
ResultSet rs;
// préparer la requête
String requete = "SELECT * FROM LABO";
try {
PreparedStatement ps = Jdbc.getInstance().getConnexion().prepareStatem... |
ac4754b6-887d-4651-9e28-54325eadbec4 | 0 | public AgeCategories getAgeCategory() {
return ageCategory;
} |
2c304a23-309c-4f89-b921-7b62e6fbe2ec | 4 | private JSONObject getJson(String method, String url, JSONObject data) {
JSONObject jo = null;
HttpResponse response = null;
try {
response = doHTTPRequest(method, url, data);
if (data != null) {
BmLog.debug("HTTP Request body=\n\n\n" + data.toString() + ... |
7392f1d7-4e0e-4bef-9728-66f3099f31f7 | 4 | @Override
public void onDisable() {
PluginDescriptionFile pdfFile = this.getDescription();
if (this.getConfig().getBoolean("use-mysql")) {
if (dbManageMySQL != null) {
dbManageMySQL.close();
this.log.info("[" + pdfFile.getName() + "] MySQL database conne... |
c235ca34-0897-4fde-9798-0ef003fffec8 | 9 | static public ParseException generateParseException() {
jj_expentries.clear();
boolean[] la1tokens = new boolean[39];
if (jj_kind >= 0) {
la1tokens[jj_kind] = true;
jj_kind = -1;
}
for (int i = 0; i < 8; i++) {
if (jj_la1[i] == jj_gen) {
for (int j = 0; j < 32; j++) {
... |
5a171971-1d15-468f-bee0-2f60d121e392 | 0 | public DocumentListener[] getDocumentListeners() {
return (DocumentListener[]) documentListeners.toArray();
} |
4bfef5c2-ec47-4682-80cc-07f098a3761c | 6 | @SuppressWarnings("unchecked")
public void removeAt(int index) {
E[] temparray = (E[]) new Object[array.length - 1];
if (index == 0) {
// Copy everything except first element
System.arraycopy(array, 1, temparray, 0, array.length - 1);
} else if (index == array.leng... |
b8817cb7-e6d5-41fe-981a-75e87c8492f4 | 1 | @RequestMapping(value = "/room-event-creative-material-list/{roomEventId}", method = RequestMethod.GET)
@ResponseBody
public CreativeMaterialListResponse allRoomEventCreativeMaterialList(
@PathVariable(value = "roomEventId") final String roomEventIdStr
) {
Boolean success = true;
... |
9948de3e-5f52-433e-add3-407e98262d2d | 6 | public static String numberToString(Number number)
throws JSONException {
if (number == null) {
throw new JSONException("Null pointer");
}
testValidity(number);
// Shave off trailing zeros and decimal point, if possible.
String string = number.toString();
... |
891c2c49-875f-4f2c-b3d5-ac61e52f2e15 | 6 | public static Sweeper createSweeper(int aSweeperId, Viewer aViewer)
{
switch (aSweeperId)
{
case 0 :
return new HexSweeper(aViewer);
case 1 :
return new OctSweeper(aViewer);
case 2 :
return new DodecaSweeper(aViewer);
case 3 :
return new TriSweeper(aViewer);
case 4 :
return new N... |
501e7be9-1283-41ab-9074-d176c182f443 | 9 | public static GraphColoringLevel getLevelInstance(int levelNumber) {
switch (levelNumber) {
case 1:
return generateLevelOne();
case 2:
return generateLevelTwo();
case 3:
return generateLevelThree();
case 4:
return generateLevelFour();
case 5:
return generateLevelFive();
case 6:
... |
9f1b59f2-e40e-47d1-b2fe-2f70521eeecf | 9 | private void printRecord(String s)
{
StringReader sr = new StringReader(s);
LineNumberReader lnr = new LineNumberReader(sr);
Font typeface = new Font("Monospaced", Font.PLAIN, 12);
Properties p = new Properties();
PrintJob pjob = getToolkit().getPrintJob(this, "Print report", p);
if (pjob != nul... |
2a1c0a00-9e2b-498e-80ee-609e08cfd9b0 | 8 | public void DeleteUsuario(Usuario usuario) throws SQLException, excecaoDeletarElemento {
Connection conexao = null;
PreparedStatement comando = null;
try {
conexao = BancoDadosUtil.getConnection();
if ("Gerente".equals(usuario.getTipo())) {
comando = con... |
6c14c7b2-35b9-44db-95b2-e9f0fe4a2444 | 3 | void showAll() {
int width = x + 2;
for (int i = 1; i <= y; i++) { // 由上而下
int tmp = i * width;
for (int j = 1; j <= y; j++) { // 由左而右
int tt = tmp + j;
if ((map[tt] & BOMB) != 0) { // 畫上標示
map[tt] |= MARK;
} else {
map[tt] = (byte) ((map[tt] | VISIT) & ~MARK); // 設為按過,
... |
f6aa5dfb-a135-49d0-a157-4f7dbcf9c9b8 | 0 | public AbstractView() {
propertyChangeSupport = new PropertyChangeSupport(this);
} |
616410dc-525f-44d6-8f20-6120d593dda8 | 2 | @Override
public List Listar() {
Session session = null;
List<Cuentas> cuenta = null;
try {
session = NewHibernateUtil.getSessionFactory().openSession();
Query query = session.createQuery("from Cuentas");
cuenta = (List<Cuentas>) query.list();
... |
bd8df836-5a7e-447b-aa35-9a11628a49f5 | 2 | @Override
public List<ValidateException> validate(String parameter) {
List<ValidateException> validateExceptionList = new LinkedList<>();
if ((!parameter.equals("yes")) && (!parameter.equals("no"))) {
String exMsg = "entered wrong confirm value";
validateExceptionList.add(ne... |
9d2fdff0-144c-44ef-985d-5de0a18a195a | 7 | public static int CMMNo(int[] dimension){
int size = dimension.length - 1;
int[][] array = new int[size][size];
String[][] sequence = new String[size][size];
int min;
int temp;
for(int i = 0; i < size; i++){
array[i][i] = 0;
sequence[i][i] = "" + i;
}
for(int i = 0; i < size; i++){
for(int j = ... |
68cd3dde-2bc2-4d0e-b07d-9defb7658a26 | 2 | public void setVolume(double v)
{
if(getVolume() == Log.VOLUME && v != Log.VOLUME)
{System.out.println("ERROR: Attempted to change volume of log " + getName() + ".");}
super.setVolume(Log.VOLUME);
} |
b29746e1-a0a8-4b82-9f8e-4949012f3fc3 | 0 | public SelectionEvent(Object object) {
super(object);
} |
b27d088d-83d0-4a13-80cf-16ad1b86bcad | 0 | public static void drawBox(double left, double right, double top, double bottom, double back, double front) {
glBegin(GL_QUADS);
glVertex3d(left, top, back);
glVertex3d(right, top, back);
glVertex3d(right, bottom, back);
glVertex3d(left, bottom, back);
glVertex3d(left, bottom, front);
glVertex3d... |
76ee0bb0-f6e4-4743-93aa-419e1f181305 | 4 | public ArrayList<Libros> getByAutor(Libros l){
PreparedStatement ps;
ArrayList<Libros> libros = new ArrayList<>();
try {
ps = mycon.prepareStatement("SELECT * FROM Libros WHERE autor LIKE ?");
ps.setString(1, "%"+l.getAutorlibro()+"%");
ResultSet rs = ps.execu... |
8313920e-4d70-4669-ae8b-ebefaf7103d1 | 2 | public static boolean buscaMusica(int indice, HashMap<Integer, Musica> tablaMusica)
{
boolean encontrado = false;
int key;
Set<Entry<Integer,Musica>> s = tablaMusica.entrySet();
Iterator<Entry<Integer, Musica>> it=s.iterator();
Entry<Integer, Musica> m = null;
while (it.hasNext()) // Buscamos disco e... |
0ce2b08c-b6a4-40e6-858a-bbfe2a5cd760 | 6 | public static boolean deleteTaskTree() {
Data data=new Data("SomeData");
IDGenerator generator = new IDGenerator();
TaskTree tree = new TaskTree(generator, data);
TaskTree tree1 = new TaskTree(generator, data);
TaskTree tree2 = new TaskTree(generator, data);
tree.add(tree... |
a5ee6a10-6ee8-44f2-875f-2157718f7d0e | 0 | @AfterMethod
public void tearDownMethod() throws Exception {
} |
aeca3ec1-263f-4881-9f25-e08ff8bccbdf | 1 | public OptionsMenu(Boolean town) {
mainOptions = new SelectBox(true);
mainOptions.setStill(true);
mainOptions.showCursor(false);
if(town) // Change between normal save and field save
mainOptions.buildText("Options:;Toggle Mute;Save Game;Load Game;Quit to Desktop");
else
mainOptions.buildText("Options:;T... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.