method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
70316b34-fec3-4561-97d8-a06255e7577e | 2 | public void paintComponent(Graphics g) {
Graphics2D g2 = (Graphics2D) g;
g2.setColor(Color.black);
g2.fillRect(0, 0, WIDTH, HEIGHT);
if(menu==null){
if(story==null){
lvl.draw(g2);
}else{
story.draw(g2);
}
}else{
menu.draw(g2);
}
} |
405c67f8-94bd-43fb-8e56-8e606081f7b7 | 5 | public static ArrayList<Book> getAllBooks() {
try {
if(conn == null || conn.isClosed()){
conn = DatabaseConnection.getConnection();
}
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
ArrayList<Book> bookList = new ArrayList<Book>()... |
6d36d71f-83b8-47c3-aaa0-dd8441348a6b | 9 | static private boolean jj_3R_15() {
if (jj_scan_token(ON)) return true;
if (jj_3R_18()) return true;
if (jj_scan_token(LBRACE)) return true;
Token xsp;
while (true) {
xsp = jj_scanpos;
if (jj_3_8()) { jj_scanpos = xsp; break; }
}
while (true) {
xsp = jj_scanpos;
if (j... |
0385a423-e460-4122-b5cc-c7b01dfad5c9 | 8 | @Override
public boolean equals( Object that ) {
if ( this == that )
return true;
if ( that == null || !getClass().equals( that.getClass() ) )
return false;
OptionSet other = (OptionSet) that;
Map<AbstractOptionSpec<?>, List<String>> thisOptionsToArguments =... |
368df15a-d234-487e-9a1d-bdf52285a5c8 | 2 | public static void setVals(double[] val, Param p) {
Object o = p.getValue();
if (o.getClass() == double[].class) {
p.setValue(val);
} else if (o.getClass() == Double.class) {
p.setValue(val[0]);
}
throw new IllegalArgumentException(p.toString());
} |
7f00b5d5-9fe1-454d-8c05-c208fc1de675 | 0 | @After
public void tearDown() throws Exception {
this.terminal=null;
} |
42d92556-bc3e-480c-a049-a6b7903d1781 | 7 | public int[][] zeroSet(int[][] matrix){
int m = matrix.length;
int n = matrix[0].length;
HashSet<Integer> column=new HashSet<Integer>();
HashSet<Integer> row=new HashSet<Integer>();
for(int i=0;i<m;i++){
for(int j=0;j<n;j++){
if(matrix[i][j]==0){
column.add(i);
row.add(j);
}
}
}... |
807d4ea6-1b9c-4c4b-ba5c-431c498507a3 | 7 | public Object nextValue() throws JSONException {
char c = this.nextClean();
String string;
switch (c) {
case '"':
case '\'':
return this.nextString(c);
case '{':
this.back();
return new JSONObject(this);
... |
d237fd52-f8ec-4b91-9ef2-4d089c2df96a | 5 | private boolean checkDownRight(int _row, int _column, int _player)
{
boolean keepGoing = true;
int nbAligned = 0;
while (keepGoing == true && nbAligned < nbToAlign)
{
if (_row + nbAligned >= row || _column + nbAligned >= column)
{
keepGoing = false;
}
else if (gameGrid[_row + nbAligned][_c... |
be42aa17-4f8c-4c3c-95f6-5d3e6e5ee49c | 0 | public T getInternal() {
return internal;
} |
d1e9b34c-f68f-4ac5-830b-db49c7b3c034 | 7 | private static void configureGrid() {
String rejilla = configuration.getProperty("NadgridsPath");
if (StringUtils.isBlank(rejilla)){
rejilla = "auto:peninsula";
}
if (!rejilla.startsWith("auto")){
return;
}
File homeDir = new File(System.getProperty("user.home") + File.separator + ".cat2osm");
File ... |
f66e38c7-a63a-472d-b6b0-5869c52ceec3 | 4 | public static boolean reverseByteOrder(Class<?> libraryClass) {
if (libraryClass == null) {
errorMessage("Parameter 'libraryClass' null in method"
+ "'reverseByteOrder'");
return false;
}
if (!Library.class.isAssignableFrom(libraryClass)) {
errorMessage("The specified class does not extend class "
... |
cf9400b5-6b94-4631-b4f0-0220b036d238 | 9 | public void wordMakeSets(){
System.out.println(">> AGRUPANDO PALAVRAS POR SEMELHANCA... AGUARDE.");
TreeMap<Integer, ArrayList<String>> tree = new TreeMap<Integer, ArrayList<String>>();
for (Map.Entry<String, DisjointSet> entry : this.entrySet()) {
if (tree.get(entry.getKey().length(... |
3de06c41-17d1-4892-9a05-423ffe7288fe | 7 | public int mac() {
long ac = -1;
// Do we have it annotated as AF or MAF?
if (hasField("MAC")) return (int) getInfoInt("MAC");
else if (hasField("AC")) ac = getInfoInt("AC");
else {
// No annotations, we have to calculate
ac = 0;
for (VcfGenotype gen : this) {
int genCode = gen.getGenotypeCode()... |
4f25dd6c-0835-4732-82f8-0415e03971d3 | 9 | public double[] sweepPseudoRehearsalSerialLearning(double[][] baseinputs, double[][] baseoutputs,
double[][] serialinputs, double[][] serialoutputs, double maxerror, int popSize, int bufferSize, boolean reals, double minrange, double maxrange) {
double[] outputs = new double[serialinputs.length + 1];// new double... |
61276e1b-adf0-4b09-ae83-efb62814b1c0 | 2 | public void setTimeout(int millis) {
if (socket != null)
try {
socket.setSoTimeout(millis);
} catch (IOException exc) {
exc.printStackTrace();
}
timeout = millis;
} |
4689ab62-a2e7-4f8d-b0ee-7858a1cce714 | 2 | public String getThumbnailImageURI() {
String tumbImage = "";
if(getImagesList() != null && getImagesList().get(0) !=null ){
tumbImage = getImagesList().get(0).getImgURL();
}
return tumbImage ;
} |
731d7ed5-2824-47c0-9414-83251e1c9f53 | 4 | @Override
public int getBorderCount()
{
int bcnt = 0;
if (hasTopBorder()) bcnt++;
if (hasBottomBorder()) bcnt++;
if (hasLeftBorder()) bcnt++;
if (hasRightBorder()) bcnt++;
return bcnt;
} |
98d84753-1106-44d9-9e27-ec82fd2987d1 | 3 | private void initialize(Header header)
throws DecoderException
{
// REVIEW: allow customizable scale factor
float scalefactor = 32700.0f;
int mode = header.mode();
int layer = header.layer();
int channels = mode==Header.SINGLE_CHANNEL ? 1 : 2;
// set up output buffer if not set up by client.... |
c644831e-a6d9-4622-b573-fdd15e31508f | 9 | private void SqueezeWrap() {
double total = 0;
for (int i = 1; i < HistogramWidth; i++)
total += bins[i];
int a = 1;
int b = HistogramWidth;
int n = 0;
while (true){
n++;
a++;
int subtotal_a = 0;
for (int i = a; i < b; i++)
subtotal_a += bins[i];
a--;
b--... |
b64ca2eb-e724-4380-b92c-87613e8d0371 | 2 | @FXML
protected void login(ActionEvent event) {
loginButton.setDisable(true);
progressIndicator.setVisible(true);
progressIndicator.setProgress(ProgressIndicator.INDETERMINATE_PROGRESS);
LoginService loginService = new LoginService();
loginService.setOnSuc... |
90b91a79-7f63-4ff6-a495-5a4c680d20ee | 3 | public RealDistribution openDemand(int t, int k) throws ConvolutionNotDefinedException{
//check if k is lower or equal than t-l_max, then all orders will be open
if (k <= t-getMaxOrderLeadTime()) return totalDemand();
//check if k is bigger than t, then all orders will be realised
if (k > t) return new RealS... |
9729fc93-7bea-4e0a-a531-3d35b9e4aecf | 0 | public CMemLruCache(int maxSize) {
super(maxSize);
} |
40934a2b-28d0-4dc2-8589-b2a6357abf63 | 9 | private static void playAgainstSelfOnServer(int gameId) {
PlayChess whiteTeam = new PlayChess(Board.white, gameId, 1, "32c68cae");
PlayChess blackTeam = new PlayChess(Board.black, gameId, 2, "1a77594c");
while (true) {
System.out.println("POLLING AND MOVING FOR WHITE");
Response r = whiteTeam.poll();
Sys... |
b56dba75-9f01-4e45-9e22-8614a1acba9a | 3 | public void cargarPedHas() {
String sql = "SELECT t1.productos_idproductos, t2.nombre_producto, t2.proveedor, t1.cantidad_pedido,t2.precio * t1.cantidad_pedido "
+ "FROM productos_has_pedidos AS t1, productos AS t2 "
+ "WHERE t1.Productos_idProductos = t2.idProductos "
... |
6c17bdae-4415-46dc-9ffc-b63e2738f333 | 2 | public boolean hasBusyDoc(){
for(boolean b : this.docStates_IsBusy)
if(b)
return true;
return false;
} |
01a176ec-2f11-47b4-8134-91f05a32b9ca | 5 | public void checkOperation (String operation, org.omg.CORBA.Any[] args) throws RTT.corba.CNoSuchNameException, RTT.corba.CWrongNumbArgException, RTT.corba.CWrongTypeArgException
{
org.omg.CORBA.portable.InputStream $in = null;
try {
org.omg.CORBA.portable.OutputStream $out = _r... |
faf6b75e-dec6-4b70-ab58-6141e2c7cceb | 6 | public static void setNativesLocation() {
String libraryPath;
if (new File("lib").exists()) {
if(System.getProperty("os.name").toLowerCase().contains("linux")) {
libraryPath = new File("lib").getAbsolutePath() + File.separator + "linux";
}
else if(Sys... |
354b0f89-c260-4d63-a3a9-8a3735e11059 | 2 | public String toString() {
StringBuffer sbuf = new StringBuffer();
sbuf.append("(<");
sbuf.append(getTag());
sbuf.append('>');
ASTList list = this;
while (list != null) {
sbuf.append(' ');
ASTree a = list.left;
sbuf.append(a == null ? "... |
d5e82c0f-861b-4b0f-9e23-e4be83b53c96 | 9 | public void run() {
int numChanged = 0;
boolean examineAll = true;
while (numChanged > 0 || examineAll) {
numChanged = 0;
if (examineAll) {
// loop I over all training examples
for (int i = 0; i < model.getLength(); i++) {
numChanged += examineExample(i);
}
} else {
// loop I over ex... |
740cae36-ac97-42a8-9312-c16804e24f9c | 8 | private void reconcileStates(Connection conn) {
PointList points1 = (PointList) Animation.getInitialState(this, conn);
PointList points2 = (PointList) Animation.getFinalState(this, conn);
if (points1 != null && points1.size() != points2.size()) {
Point p = new Point(), q = new Point();
int size1 = points1... |
f40486e6-ad89-453a-9f5a-3c784da651af | 0 | public static void main(String[] args) {
System.out.println(true); // true
System.out.println(false); // false
System.out.println(1 < 2); // true
System.out.println('A' == 'B'); // false
} |
827fd0a2-80c6-4f65-8ae9-87e10736dfe4 | 1 | public boolean isEmpty() {
boolean retVal = false;
if (backPtr == -1) {
retVal = true;
}
return retVal;
} |
d439b52b-300c-4a83-afd8-1a39882c8050 | 5 | @Override
public void update()
{
super.update();
if(this.moveTime == 0)
{
this.x = this.nx;
this.y = this.ny;
if((this.world.player.x-this.x)*(this.world.player.x-this.x)+(this.world.player.y-this.y)*(this.world.player.y-this.y) > 3*3)
{
if(this.looking)
{
this.world.player.h... |
2135c855-da25-4120-a381-9144e770b582 | 8 | private static TwitterResponseWrapper sendRequestAppAuthPost(String baseUrl, Hashtable<String, String> httpParams, String authHeader) {
HttpURLConnection conn = null;
InputStream is = null;
TwitterResponseWrapper response = new TwitterResponseWrapper();
try {
String stringifiedParams = httpParams.size(... |
cd1181c5-4215-40d1-8542-266d94d5b512 | 0 | public void rainHard() throws RainedOut {
} |
0392990d-9270-43d8-b3dc-c650909268a7 | 7 | public static void encode(Object object, ByteBuffer enc) {
if (object == null) {
enc.put((byte) 0x00);
return;
}
if (object.getClass().isArray()) {
enc.put((byte) 0x03);
enc.putInt(Array.getLength(object));
for (int i = 0; i < Array.getLength(object); i++) {
encode(Array.get(object, i), enc);
... |
f35ffd36-7d34-4ab8-851e-356a04535a4c | 6 | public void mouseClicked(MouseEvent e)
{
x = e.getX();
y = e.getY();
boolean interactableClicked = false;
for(Interactable i: ScreenManager.getInstance().getCurrentScreen().getInteractables())
{
if(i.contains(x, y))
{
i.onClick();
ScreenManager.getInstance().getCurrentScreen().onClicked(i);
... |
e402d5cd-b8bb-419b-a924-9e8d214ba1e4 | 9 | private static boolean updateJoinCardinality(Join j,
Map<String, Integer> tableAliasToId,
Map<String, TableStats> tableStats) {
DbIterator[] children = j.getChildren();
DbIterator child1 = children[0];
DbIterator child2 = children[1];
int child1Card = 1;
... |
aa5b9424-f923-49d7-a25e-8e7fcca07c8b | 5 | static public void action(final Player p, final Main Main)
{
String act = Main.getConfig().getString("action");
if (act.equals("warn")) {
p.sendMessage("" + ChatColor.LIGHT_PURPLE + Lang.PREFIX + ChatColor.YELLOW + " " + Main.getConfig().getString("warn-msg"));
Main.... |
9bf9390a-f661-4d7f-ac3e-042ee303e484 | 8 | public void render(Graphics g) {
if (World.gameMode == World.GameMode.CLASSIC) {
g.setFont(font);
g.setColor(Color.BLACK);
g.drawString("SCORE: " + World.SCORE, 15, 45);
g.drawString("HIGHSCORE: " + World.HIGHSCORE, 15, 65);
} else if (World.gameMode != World.GameMode.CLASSIC) {
for (int i = 0; i < W... |
a461bf2f-2f7a-4498-8d75-2f2ac7beb6ca | 4 | private void paivitaMinX(){
double minX = Double.POSITIVE_INFINITY;
for (KentallaOlija osa : osat){
if (osa.getMinX() < minX){
minX = osa.getMinX();
}
}
if (getSuojakilpi()){
if (getX()-getSuojakilvenHalkaisija()/2 < m... |
d6ab2389-2e76-4359-b81b-0eca6fcf0869 | 6 | private void analyzeTextButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_analyzeTextButtonActionPerformed
// TODO add your handling code here:
JFileChooser fileChooser = new JFileChooser();
javax.swing.filechooser.FileFilter textFilter = new javax.swing.filechooser.FileFi... |
3f4bd976-3e50-49ac-a2a2-b9b4d7deab14 | 3 | @Override
public void setKey(String key) throws Exception {
byte[] keyB = key.getBytes();
if (keyB == null) {
throw new RuntimeException("Invalid key: Key was null");
}
if (keyB.length < 16) {
throw new RuntimeException("Invalid key: Length was less than 16 ... |
33026e91-bbc7-4cf4-854b-e550fef8b6bb | 9 | @Override
public void actionPerformed(ActionEvent e) {
if (e.getActionCommand().equals(FILE_EXIT)) {
System.exit(0);
} else if(e.getActionCommand().equals(VIEW_PLAYERS)){
AllPlayersGui playerGui = new AllPlayersGui("Players", "Players", desktop);
playerGui.setVisible(true);
desktop.add(playerGui);
}... |
372e2f58-c5e5-41f4-a9a3-458bb678002a | 8 | public CaseVue(int idCase) {
super();
switch (idCase) {
case 0:
setBackground(Color.white);
break;
case 1:
setBackground(Color.cyan);
break;
case 2:
setBackground(Color.yellow);
... |
29231f4a-0ed8-411e-be91-dabf5889f09a | 4 | public void onAnalog(String name, float value, float tpf) {
if(InputBitArray.AXIS_X_POS.equalsIgnoreCase(name)) {
player.yaw(value*player.getMouseSensitivity()*tpf);
return;
}
if(InputBitArray.AXIS_X_NEG.equalsIgnoreCase(name)) {
player.yaw(-value*player.getMo... |
c0d15cf5-7e1d-41a4-b490-a490b03a5dee | 4 | public ClassNode getClass(String name) {
if (name == null) {
return null;
}
ClassNode c = getClasses().get(name);
if (c == null) {
c = cachedExternalClasses.get(new ID(name));
if (c == null) {
c = new ClassNode();
ClassReader cr;
try {
cr = new ClassReader(name);
} catch (IOExcep... |
7103e57c-5062-4a75-b0d9-8665dea32c45 | 8 | public static void main(String[] args) {
if (args.length != 9) {
System.out.println("{͂Ă");
System.exit(1);
} else {
File datFile = new File(ConstansBook.DAT_URL);
File oldFile = new File(ConstansBook.OLD_DAT_URL);
// oldt@ĈȂĂB
if (oldFile.exists()) {
OldBookDeleter del = new OldBookDele... |
af0ef092-3ca6-41ed-94ac-1d5a84ac4790 | 6 | public void log(int verbosity, String... args)
{
if (frame != null)
frame.log(verbosity, args);
if (( verbosity == 0 ) && !silent )
{
String message = new String();
for (int i = 0; i < args.length; i++)
{
if(i == 0) continue;
... |
f7aba3de-5ac5-4775-bb22-4b2a51e5b099 | 3 | private void deleteRoom(JSONObject obj) {
RoomInfo roomInfo = roomMap.remove(obj.get("id_room"));
if(roomInfo!=null)
{
for(Team team : roomInfo.getTeams().values())
{
for(User user : team.getMembers())
{
clientMap.remove(user.getId());
}
}
}
} |
222aca26-63f2-4ef9-8465-7d56b32bfc2a | 3 | private static Map<Character, String> toCharacterKey(Map<String, Character> inMap) {
Map<Character, String> outMap = new HashMap<Character, String>();
for (Map.Entry<String, Character> entry: inMap.entrySet()) {
Character character = entry.getValue();
String name = entry.getKey()... |
94329832-5ea5-4635-a4e8-8ff898a6d122 | 5 | public void paintComponent(Graphics g) {
super.paintComponent(g);
if(rectangles != null && process_repaint) {
ModelInstance model = ModelInstance.getInstance();
Iterator<Map.Entry<Integer, Point>> it = rectangles.entrySet().iterator();
while(it.hasNext()) {
Map.Entry<Integer, Point> entry = it.next();
... |
184c8fe3-3cc6-4d12-ae90-b97f6794850f | 6 | private void fixedPointSimplestCaseNonCyclicFillRaster(int[] pixels,
int off,
int adjust,
int x, int y,
... |
d4a4d37a-8ee9-4c55-aad9-915ef0ef0536 | 6 | public static int partition(Comparable[] a, int lo, int hi) {
Comparable v = a[lo];
int i = lo;
int j = hi + 1;
while (true) {
while (less(a[++i], v)) {
if (i == hi) {
break;
}
}
while (less(v, a[--j])) {
if (j == lo) {
break;
}
}
if (i >= j) {
break;
}
exch(a,... |
2ec6bd9d-55b6-4bbc-aed9-8127b2983290 | 4 | public String getExpressionString()
{
if( ((expression == null) || (expression.size() == 0)) && (getCachedOOXMLExpression() != null) )
{
return "=" + getCachedOOXMLExpression();
}
if( expression != null )
{
return FormulaParser.getExpressionString( expression );
}
return "=";
} |
38a811e3-2c3f-4fc2-ae82-fd39f1fe91c0 | 2 | @Override
public void execute(CommandExecutor player, String[] args)
{
if(args.length == 1){
if(BanHandler.isBanned(args[0]))
{
BanHandler.unban(args[0]);
player.sendMessage("You unbanned " + args[0]);
}else{
player.sendMessage(args[0] + " is not banned.");
}
}else{
help(player);
}
} |
d7fc6b0c-e2a1-4582-99df-40515ecd7c7f | 9 | private void initGrid(){
gridPanel = new JPanel(new GridLayout(4, 4,1,1));
gridPanel.setBackground(Color.WHITE);
gridPanel.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 10));
gridPanel.add(new JLabel("Name:"));
gridPanel.add(new JLabel(character.getName()));
gridPane... |
3f7beb31-5f32-42e2-b99a-965d27ce8ebc | 9 | public static void load() {
scripts.clear();
File file = new File("./scripts/");
try {
URLClassLoader loader = new URLClassLoader(new URL[] { file.toURI().toURL() });
for(String s : file.list()) {
if(s.contains(".class")) {
Class<?> clazz = loader.loadClass(s.replace(".class", ""));
if(clazz.g... |
9e6e312c-0740-4c39-83f2-58f3a2c1efbf | 7 | protected void processVotingResult(String data) {
String[] splits = data.split(" ");
Integer nodeId = Integer.parseInt(splits[0]);
String operation = splits[1];
String resource = splits[2];
if(operation.compareTo("LOCK") == 0){
if(resources.containsKey(resource)){
ResourceState resState = resources.... |
30fe760f-3675-412b-b893-019f48eb0367 | 2 | public void run(){
BufferedImage img = new BufferedImage(f.getContentPane().getWidth(),f.getContentPane().getHeight(),BufferedImage.TYPE_INT_RGB);
Graphics g = img.getGraphics();
f.getContentPane().printAll(g);
try {
FTPConfig config = FTPConfig.getConfig();
ImageIO.write(img,"png"... |
8f50085f-b9e8-45e8-8252-0d670c8a3ee7 | 2 | public int getSize() {
/*
* maxStack: 2 maxLocals: 2 code: 4 + codeLength exc count: 2
* exceptions: n * 8 attributes: lvt_name: 2 lvt_length: 4 lvt_count: 2
* lvt_entries: n * 10 attributes: lnt_name: 2 lnt_length: 4 lnt_count:
* 2 lnt_entries: n * 4
*/
int size = 0;
if (lvt != null)
size += 8 ... |
dbfd9551-942f-4117-b7f2-2a7b65df5389 | 9 | public void layout() {
if (table == null || table.isDisposed())
return;
if (item == null || item.isDisposed())
return;
int columnCount = table.getColumnCount();
if (columnCount == 0 && column != 0)
return;
if (columnCount > 0 && (column < 0 || column >= columnCount))
return;
super.layout();
} |
26241f3c-f4ae-4692-8f42-5cfcf08cd08b | 5 | public void draw(Game game, Graphics2D g2d) {
// Gets Actual screen dimensions.
Dimension res = game.getSize();
// Fill it black.
g2d.setBackground(COLORS[0]);
g2d.setColor(COLORS[0]);
g2d.fillRect(0,0,res.width,res.height);
// Virtual Screen dimensions. (This will always be 16:9 ratio... |
7fc5c956-eb12-47c0-b1ed-de7a5c7f081b | 8 | public Stmt Statement() throws ParseException {
Stmt s;
switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
case LOCAL:
s = LocalDecl();
break;
case IF:
s = IfStatement();
break;
default:
jj_la1... |
019a79ce-136a-40af-9d66-4589193de14d | 0 | public void setLid(Lid lid) {
this.lid = lid;
} |
d0089753-34c0-45cf-a47a-da271b4f48b2 | 2 | @Override
public String toString() {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < getFileServerInfo().size(); i++) {
sb.append(i + 1).append(". ").append(getFileServerInfo().get(i)).append("\n");
}
return sb.length() > 0 ? sb.toString() : "No file servers connected\n";
} |
8c9e7fd8-9cbf-4798-a304-af7123c9c488 | 5 | @Override
public Ticket in(Car car, List<Park> parkList) {
int no = -1;
int num = -1;
for(int i = 0; i < parkList.size(); i ++) {
Park park = parkList.get(i);
if(park.isFull()) {
continue;
}
if(num < 0) {
num = park.getTotal... |
2e0e9a90-4024-41e0-86f5-34dbd819d369 | 8 | public static void main(String[] args) throws FileNotFoundException {
final String USERFILE = "userItineraries.txt";
final String FLIGHTFILE = "allFlights.txt";
boolean done = false;
//Initialize USERFILE for first time user
try {
getPassengers(USERFILE);
}
catch (FileNotFoundException except) {
... |
8c4dc299-837a-44aa-8b55-63125e3a826a | 6 | @Override
public Object parseClass(Class<?> c, Object o, MainView view) {
Method methods[] = c.getMethods();
for(int i = 0; i < methods.length; i++){
try{
if(methods[i].isAnnotationPresent(GetDatabase.class)){
if(o == null){
o = c.newInstance();
Log.getLogger().log(Level.INFO, "Initializing... |
5cb8d2b4-b951-4a06-9e97-1970274a8d61 | 8 | public float [][] calcEnergy(InputStream is, int fStart, int fEnd){
Manager manager = new Manager(is);
int cont = 0;
int bytes = 0;
final int opt = Constants.DEQUANTIZED_DOMAIN;
float [][] E = new float [2][fEnd - fStart];
float [][] energy = {{0f, ... |
eb7a4e3f-4ef5-4cb9-a9c4-39a55be7123d | 5 | private void t5CaretUpdate(javax.swing.event.CaretEvent evt) {//GEN-FIRST:event_t5CaretUpdate
jScrollPane1.setVisible(false);
jScrollPane2.setVisible(true);
DefaultTableModel model1 = (DefaultTableModel) jTable2.getModel();
int bookcode = 0;
int n = 0;
String query;
... |
203aa80c-66a4-43f9-b2cf-58c8fffc6e20 | 8 | @Override
public int run(String[] args) throws Exception {
if (args.length != 4) {
System.err.println("Usage: PageRank <input path> <output path> <iterations> <tolerance>") ;
return -1 ;
}
FileSystem fs = FileSystem.get(getConf()) ;
String input = args[1] + File.separator + "previous-pageranks";
Str... |
20c3110c-15f2-4791-9bce-9ec5dc3b6a86 | 4 | private void jBAddActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBAddActionPerformed
JDNuevaTarea jdnt = new JDNuevaTarea(this, true);
jdnt.setVisible(true);
//Si ha pulsado aceptar se añadirá la tarea creada al estado actual
if (jdnt.haPulsadoAceptar()) {
... |
75b8eac2-8981-478d-a05e-82f3af36fcd1 | 1 | private void jackpot(String msg, String ttl) {
if (JOptionPane.showConfirmDialog(this, msg, ttl,
JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION)
reset();
else {
parent.dispose();
System.exit(0);
}
} |
35b9974a-f653-440a-9392-8be46178c5fb | 9 | public boolean Update() {
//System.out.println("Running Control Update");
//run the sweepers through CParams::iNumTicks amount of cycles. During
//this loop each sweepers NN is constantly updated with the appropriate
//information from its surroundings. The output from the NN is obtained
//and the sweep... |
f9640b11-31be-461b-81da-57f25e2018f4 | 6 | private SharingPeer getOrCreatePeer(byte[] peerId, String ip, int port) {
Peer search = new Peer(ip, port,
(peerId != null ? ByteBuffer.wrap(peerId) : (ByteBuffer)null));
SharingPeer peer = null;
synchronized (this.peers) {
peer = this.peers.get(search.hasPeerId()
? search.getHexPeerId()
: sea... |
93a0db12-e6d0-4217-9d2f-b161ee5d1f08 | 6 | public synchronized void addPoints(MapleClient c, int points, long expiration, String reason) {
// if (c.getPlayer().isJounin()) return;
int acc = c.getPlayer().getAccountID();
List<String> reasonList;
if (this.points.containsKey(acc)) {
if (this.points.get(acc) >= AUTOBAN_POINTS) return;
this.points.put(... |
88e21c2e-4c71-4abf-8cc1-65617b18cf89 | 1 | public int getChildCount() {
return canHaveChildren() ? mChildren.size() : 0;
} |
a7b19d76-05c5-4952-af88-8e88459e318d | 9 | @Override
public boolean equals(Object y) {
if (y == null)
return false;
if (y.getClass() != this.getClass()) {
return false;
}
Board that = (Board) y;
if (this.N != that.N)
return false;
if (this.io != that.io || this.jo != that.jo)
return false;
for (int i = 0; i < N; i++)
for (int ... |
c606f120-ad3b-4102-8175-40cd33f0d092 | 4 | private Object handlePrimitive(JsonPrimitive json) {
if (json.isBoolean()) {
return json.getAsBoolean();
} else if (json.isString()) {
return json.getAsString();
} else {
BigDecimal bigDec = json.getAsBigDecimal();
// Fi... |
e207f7ef-0b6b-4bce-981a-0bcbdddb11be | 9 | static byte[] unpackArchive(byte[] is, int i) {
anInt7046++;
ByteBuffer class348_sub49 = new ByteBuffer(is);
int i_37_ = class348_sub49.getUByte();
if (i > -74)
method3156(true, null);
int i_38_ = class348_sub49.getDword();
if (i_38_ < 0
|| (HandshakePacket.anInt401 != 0
&& (HandshakePacket.anInt401 ^... |
edc01e55-f2b6-4783-aef1-c75d1a3452ce | 5 | public boolean checkParticipant(String Participant) { // TODO: Clean up
if (victim.getPilot().getCharacterName().equalsIgnoreCase(Participant)) {
return true;
}
if (attackers != null) {
for (ShipAndChar attacker : attackers) {
try {
if (attacker.getPilot().getCharacterName()
.equalsIgnoreCas... |
3e98f440-d230-4e11-9c9e-1013d8cdd7d9 | 0 | public Partner findPartnerById(final Long id) {
return new Partner();
} |
a395a424-d3fd-48d3-9e83-4d059bfec373 | 3 | public static Config readFile(String path) {
Config result = new Config();
try {
FileReader fr = new FileReader(path);
BufferedReader br = new BufferedReader(null);
String line = br.readLine();
KeyValue kv = null;
while(line != null) {
kv = KeyValueFactory.fromString(line);
... |
5d35ab08-0bd2-45ac-86ed-348d8be3eab2 | 0 | public ControlPanel(SelectTreeDrawer treeDrawer,
MinimizeController controller) {
super();
this.treeDrawer = treeDrawer;
this.controller = controller;
initView();
} |
d8204afc-565f-4363-95a2-f0879d1bdfd0 | 2 | public Game()
{
addKeyListener(new KeyInput(this));
setFocusable(true);
setDoubleBuffered(true);
requestFocusInWindow();
magnus = new Magnus();
platform = new Platform();
//Game Timer
timer = new Timer(5, this);
timer.start();
... |
6dc1afaa-f37d-46c2-8d05-62b3ef9b0783 | 5 | public Tool(types type, String path) {
this.path = path;
switch(type) {
case CHALCEUS:
duration = 25;
path += "Chalceus.png";
break;
case ARGNTUM:
duration = 40;
path += "Argentum.png";
break;
case AURAIRUS:
duration = 60;
path += "Aurairus.png";
break;
case AETHERIUM:
dura... |
f72adb4d-8ba9-4e5c-b95e-2a0dcc149ee4 | 2 | public void updateID() {
if(ID == 0) {
int x = 1;
while(Spell.validID(x)) {
x++;
}
IDText.setText(x + "");
}
} |
ba398cb0-52f4-442f-99c9-4e3b2410d010 | 4 | public static void setGrid() {
Color color;
for (int y = 0; y < 4; y++) {
for (int x = 0; x < 4; x++) {
color = getColor(x, y);
for (int c = 0; c < 12; c++) {
if (colors[c].equals(color)) {
Calculate.scenarios[0].gri... |
ffe04a04-315c-4585-b1ae-6fba885c05e9 | 8 | protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
// CHANGE: The EJB is instantiated automatically
// CourseModel model = CourseModelImpl.getInstance();
String path = request.getServletPath();
if (path.equ... |
3df37961-77bc-4aa0-8695-1308872ea2ec | 3 | @Override
public double findCustomersBalance(int id) {
double customersBalance = 0;
String sql = "SELECT balance FROM customer WHERE customer_id='" + id + "';";
Connection con = null;
try {
con = getConnection();
PreparedStatement statement = con.prepareStatement(sql);
ResultSet resultSet = stat... |
ea2fa26a-935f-4921-a68e-f52eeef7b919 | 8 | private static String escapeJSON(String text) {
StringBuilder builder = new StringBuilder();
builder.append('"');
for (int index = 0; index < text.length(); index++) {
char chr = text.charAt(index);
switch (chr) {
case '"':
case '\\':
... |
b02583a5-e34d-466c-9ac1-d7ad89b6faf0 | 4 | @Override
public void keyPressed(KeyEvent e)
{
if(selectedIndex != -1)
{
String chr = KeyEvent.getKeyText(e.getKeyCode());
if(frame.buttons[selectedIndex].getText().indexOf(chr+" + ") == -1)
frame.buttons[selectedIndex].setText(frame.buttons[selectedIndex].getText()+chr+" + ");
if(e.getKeyCode() ... |
8223f922-49b9-4fbe-ba44-7a579a8a4801 | 9 | @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(target==null)
return false;
if(target.fetchEffect(ID())!=null)
{
mob.tell(targ... |
1c3ebe4a-8652-4eda-b894-07b641d72598 | 4 | private void func_31010_a(float var1, float var2) {
if(!this.extending) {
--var1;
} else {
var1 = 1.0F - var1;
}
AxisAlignedBB var3 = Block.pistonMoving.func_31035_a(this.worldObj, this.xCoord, this.yCoord, this.zCoord, this.storedBlockID, var1, this.storedOrientation);
... |
8a64113f-a72a-43c1-8fb0-f83ee91cf6b1 | 3 | private void groupBySourceAndAnalyze(Walk[] paths) {
int curSource = -1;
ArrayList<Walk> curSet = new ArrayList<Walk>();
for(int j=0; j < paths.length; j++) {
Walk w = paths[j];
if (w.getSource() != curSource) {
if (curSource != -1) processWalksFromSource(... |
acc54cbe-4183-474f-8494-9291b3a508e8 | 2 | public Collection<LineUp> getLineUps()
{
if (lineUps == null || lineUps.size() == 0)
fillLineUp();
return lineUps;
} |
1f52b192-84b8-40ac-ac9d-ed6b3ccca010 | 4 | public void moveStep() {
switch(dir){
case EAST: this.x++;
break;
case NORTH: this.y--;
break;
case SOUTH: this.y++;
break;
case WEST: this.x--;
break;
default:
break;
}
} |
e5ef4562-9369-4305-bf48-9de112c52f85 | 8 | public Bittorrent(Object bo) {
Logger.getInstance().debug("Creating Bittorrent with Obj: " + bo.toString());
try {
HashMap<String, Object> raw = (HashMap<String, Object>) bo;
if (raw.containsKey("announceList")) {
Object[] announceArray = (Obj... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.