method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
88b4eeb0-8be8-4478-a746-a7fad1c5bb76 | 7 | boolean ehIgual(DadoMaterial dadoMaterial) {
return titulo.equals(dadoMaterial.titulo)
&& descricao.equals(dadoMaterial.descricao)
&& edicao.ehIgual(dadoMaterial.edicao)
&& anoPublicacao.ehIgual(dadoMaterial.anoPublicacao)
&& autor.equals(dadoMater... |
cf62372d-1986-4a9a-9f15-e4b54517b85d | 9 | private void loadPic() throws IOException
{
File jarfile = new File(this.isport, modName + ".jar");
File modpicfile = new File(isportinfo, modName+".png");
if(!modpicfile.exists()&&jarfile.exists())
{
modpicfile.createNewFile();
InputStream in = null;
BufferedImage bi = null;
try
{
String i... |
c4bb531b-847b-477b-abb5-b327c70ffe0c | 8 | public static void main(String[] args) throws Exception {
String inputfile = "";
String testfile = "";
if(args.length != 2) {
System.out.println("Error in the arguments");
System.exit(0);
}
else {
inputfile = args[0];
testfile = args[1];
}
DecisionTree dt = new DecisionTree();
int status = ... |
a1960312-dbe9-4fb8-9a80-e64ff0a83b6a | 2 | private void broadcast(String message) {
for (ChatMessageInbound connection : connections) {
try {
CharBuffer buffer = CharBuffer.wrap(message);
connection.getWsOutbound().writeTextMessage(buffer);
} catch (IOException ignore) {
... |
9b64f41b-86b9-4557-9e47-40039943eafd | 5 | @Override
public void onEnable() {
// Load Configuration
config = new AutoSaveConfig(getConfiguration());
config.load();
// Test the waters, make sure we are running a build that has the
// methods we NEED
try {
// Check Server
org.bukkit.Server.class.getMethod("savePlayers", new Class[] {});
//... |
a8877f7f-0eb1-4e7f-9745-ad1a9c7f0281 | 5 | void addAsIncoming( Node u, BitSet is ) throws MVDException
{
Iterator<Arc> iter = iterator();
boolean wasAttached = false;
while ( iter.hasNext() )
{
Arc a = (Arc) iter.next();
if ( a.versions.intersects(is) )
{
u.addIncoming( a );
wasAttached = true;
}
}
if ( wasAttached )
{
// n... |
7ca850da-36fe-41dc-98bd-48c08476048d | 3 | public int getNumberOfFeatureSets() {
int num= 0;
if (this.extractRH)
++num;
if (this.extractRP)
++num;
if(this.extractSSD)
++num;
return num;
} |
cf7f5013-92b5-4430-a3f4-118075881390 | 1 | public Snail(MonsterManager mm, Registry rg, String im, String st, int x, int y, int minDist, int maxDist) {
super(mm, rg, im, st, x, y, minDist, maxDist, false);
name = "Snail";
displayName = "Snail";
monsterManager = mm;
difficultyFactor = 0.60f;
adjustHPForLevel();... |
8bb8ec71-b868-4e4e-8682-e52361aada3e | 0 | public Long getTimestamp() {
return timestamp;
} |
e75317a8-8fea-4e70-abf3-605d1c89cd6e | 7 | public void go() {
BufferedReader br = null;
BufferedWriter out = null;
try {
int numFloors;
int numElevators;
int numRiders;
int maxCapacity;
List<Rider> myRiders = new ArrayList<Rider>();
String sCurrentLine;
br = new BufferedReader(new FileReader("inputs"));
out = new Buffer... |
39c86f31-a6e6-467a-8ff5-928958c49631 | 8 | public void setPortALabels(int t) {
// t = t & 0b11111111;
int a = t & 0b00000001;
int b = t & 0b00000010;
int c = t & 0b00000100;
int d = t & 0b00001000;
int e = t & 0b00010000;
int f = t & 0b00100000;
int g = t & 0b01000000;
int h = t & 0b10000000;
if (a > 0) {
label_20.setText("1");
} else {... |
6557f3b4-65d9-4265-8f0a-008ec460aa56 | 6 | private void addSplits(ArrayList<S3Item> fileList, SimpleQueue queue, int numSplits) {
StringBuilder sb = new StringBuilder();
int mapNum = 0;
long totalSize = 0;
for (S3Item item : fileList) {
totalSize += item.getSize();
}
long splitSize = totalSize / numSplits + 1;
logger.info("Total input file s... |
f3eacd1a-390a-4d2a-bd5c-6d11cdd02124 | 1 | public Player(int x, int y, double angle, double vx, double vy, double vAngle, int numLives, int playerNo){
model = new PlayerModel(x, y, angle, vx, vy, vAngle, numLives, playerNo);
this.playerNo = playerNo;
if (playerNo == 0)
color = Color.WHITE;
else
color = Color.blue;
shape = new GeneralPath(General... |
3913a15d-b642-44ee-8998-252d0c0f6bad | 8 | public void addNewEnemy() throws SlickException{
// Gets a new random X location.
int randX = xLoc.getX();
// Makes an enemy at (randX, 0), but doesn't display it on the screen.
Enemy enemy = new Enemy(randX);
// Runs at least once, then loops if the new enemy's word is the same as any of the current enemi... |
d796f743-00a8-4af0-b372-f296af7af58e | 1 | public SmartRobot() throws AWTException {
super();
// The anvil client sends over some non standard keycodes
// (Android does not include the awt package)
keyMap = new HashMap<Character, ShiftIndex>();
// Add Uppercase letter keys (sent as negatives of the lowercase)
for(int x = -65; x > -91; x--){
k... |
d91c2a24-7bb8-43c8-bece-8937b5e6e2c8 | 4 | public void msgUserClicked(ArrayList<String> usersId, int result, int x, int y, String turnUserId, String winnerId) {
String tmpl = "clicked %d %d %d %s"; // command x, y, result, {turnUserId|winUserId}, [win]
if (winnerId != null)
tmpl += " win";
String id = winnerId != null ? winne... |
aca2042e-4214-440b-95b4-d381d4d8e1a8 | 7 | private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
if(this.tabPerksFlaws.getSelectedIndex() == TAB_PERKS) {
if(this.listPerks.getSelectedValue() != null) {
if(!this.characterPerks.contains((Perk)this.listPerks.getSelectedV... |
64011bbe-9517-4958-a60e-14c027f7417b | 7 | public static int levenshteinDistance (String s, String t) {
int d[][]; // matrix
int n; // length of s
int m; // length of t
int i; // iterates through s
int j; // iterates through t
char s_i; // ith character of s
char t_j; // jth character of t
int cost; // cost
// Step 1
n = s.le... |
e9cff974-0837-4ea1-9c47-39aeb6c08912 | 3 | @Override
public Confirmation deliver(final Message message) {
int count = 0;
for (final Permissible permissible : Bukkit.getPluginManager().getPermissionSubscriptions(this.permission))
if (permissible instanceof CommandSender && permissible.hasPermission(this.permission)) {
... |
04292d12-2a06-4513-9e7d-595d8b8ea1b0 | 2 | public int checkGameState() {
ArrayList<Integer> player1Moves = getValidMoves(PLAYER1);
ArrayList<Integer> player2Moves = getValidMoves(PLAYER2);
if (player1Moves.isEmpty() && player2Moves.isEmpty()) {
this.gameOn = false;
return 0;
} else return 1;
} |
b9cc47db-34fc-46bf-b02e-baac7b9ec277 | 3 | private static boolean checkAABB(Position p1, Collidable c1, Position p2, Collidable c2) {
return !((p1.x + c1.width - 1 < p2.x) || (p1.x > p2.x + c2.width - 1) || (p1.y + c1.height - 1 < p2.y) || (p1.y > p2.y + c2.height - 1));
} |
86263469-25a8-4a92-b751-8db6b194f22a | 5 | @Override
public void onEntityHit(Player p, MapObject mo) {
jiggle = true;
int wepDmg = 0;
ItemStack wep = world.getPlayer().invArmor.getWeapon();
if(wep != null && effectiveTool == ((ItemTool)wep.getItem()).getEffectiveness())
wepDmg = ((ItemTool)wep.getItem()).getEffectiveDamage();
switch (getType())... |
dc384cc6-5435-49fd-be53-c02a1fab61f1 | 0 | @Override
public void windowIconified(WindowEvent arg0) {
// TODO Auto-generated method stub
} |
6b219102-c18a-4278-a628-795006ca56c8 | 9 | @Override
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof FindWithinGenerator<?>)) {
return false;
}
FindWithinGenerator<?> other = (FindWithinGenerator<?>) obj;
return other.useIfNone == useIfNone && ... |
57287ec9-da86-4ea5-b82f-d7b83b01d3cf | 3 | public static void updateStation(Station station) {
PreparedStatement stat;
try {
stat = ConnexionDB.getConnection().prepareStatement("select * from station where id_station=?",ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
stat.setInt(1, station.getId_station())... |
88acdeac-0bad-4914-b046-612a1c6bcd18 | 4 | @Override
public Tile cross(Tile currentTile, Character crosser) {
if (crosser == null || currentTile == null){
throw new IllegalArgumentException("crosser can not be null");
}
if (!isLocked()){ //just cross, exit's already unlocked
return super.cross(currentTile, crosser);
}
else if (crosser.hasIt... |
92cd830a-d41b-43b1-8eb1-b17d0dcc9c4b | 9 | public void loadConfigFiles(String board, String legend) throws IOException, BadConfigFormatException {
rooms = new HashMap<Character, String>();
// Import Legend
FileReader legendReader = new FileReader(legend);
Scanner legendIn = new Scanner(legendReader);
String line, parts[];
while(legendIn.hasNextLine... |
07eb71c0-9ed5-40e3-8118-f9d079817739 | 0 | public double getWidth() {
return width;
} |
6016f4fe-d645-4cea-a4dd-6ce50166baa8 | 1 | private TextMeasurer tm() {
if(tm == null)
tm = new TextMeasurer(str.getIterator(), rs.frc);
return(tm);
} |
c669a2a6-deaa-4a1c-bb7c-d7e4adf87f8a | 3 | @Override
public int getResponseSize(final ByteBuffer buf) throws Exception
{
// Need at least the encapsulation header
int needed = 24 - buf.position();
if (needed > 0)
return needed;
// Buffer contains header (and maybe more after that)
final short command_code = buf.getShort(0... |
6190f907-50b0-471a-b876-e91cce520440 | 6 | public boolean lineFree(int x1, int y1, int x2, int y2)
{
if(x1 == x2)
{
int start = Math.min(y1, y2);
int end = Math.max(y1, y2);
for(int i = start; i <= end; i++)
{
if(evaluationMap[x1][i] == WALL_VALUE)
return false;
}
return true;
}
else if(y1 == y2)
{
int start = Math.m... |
aad0d58c-98b9-4826-be01-fc16c9eb8b39 | 4 | @Override
public void deserialize(Buffer buf) {
name = buf.readString();
worldX = buf.readShort();
if (worldX < -255 || worldX > 255)
throw new RuntimeException("Forbidden value on worldX = " + worldX + ", it doesn't respect the following condition : worldX < -255 || worldX > 255... |
19f3b2d9-7eae-4188-8515-de427c9bc9a1 | 0 | @Basic
@Column(name = "CSA_FECHA_HORA")
public Date getCsaFechaHora() {
return csaFechaHora;
} |
17b65ece-417a-4fa0-bfc5-dc57472e7184 | 9 | public static void uploadFileAsBlob(String fullPath) {
// TODO Auto-generated method stub
FileInputStream fis = null;
try {
CloudStorageAccount storageAccount = CloudStorageAccount
.parse(Connection.storageConnectionString);
CloudBlobClient blobClient = storageAccount.createCloudBlobClient();
Cloud... |
a5ac9a40-3354-4cb7-b8fe-982403a9c979 | 3 | private void EquipaSelecionada_LabelPropertyChange(java.beans.PropertyChangeEvent evt) {//GEN-FIRST:event_EquipaSelecionada_LabelPropertyChange
if(EquipaSelecionada_Label.getText().equals("nenhuma")) {
for(Component component: DadosJogador_Panel.getComponents())
component.setEnabled(... |
fad8a171-49db-40e5-98d0-66cfe3bd1354 | 3 | public void process() {
while (!eventQueue.isEmpty())
{
Event event = eventQueue.poll();
if (listenerRegistry.containsKey(event.getType()))
for (EventListener listener : listenerRegistry.get(event.getType()))
listener.notify(event);
}
} |
7b9e8aaf-5752-4846-af98-a906e19afb7b | 0 | private void usage() {
System.out.println(
"Usage: java -jar jfht.jar [options]\n"
+ "\n"
+ "\t-n [num]: number of items to insert\n"
+ "\t-m [num]: number of right shifts of optimal bloom filter length\n"
+ "\t-k [num]: number of hash functions to use, none or 0 for optimal\n"
+ "\t-r [num]: number... |
b30cf6d8-4d78-4e45-a2cf-dbd01892cdf4 | 9 | private void check() {
//each route
for (Route r : Solution.getRoutes()) {
int type = r.getType();
if (r.getRequests().get(0).getNodeId() != -1) {
int routeNodeStart = r.getRequests().get(0).getNodeId();
int routeNodeArrival = r.getRequests().get(r.getRequests().size()-1)
.getNodeId();
//ea... |
68b9daf1-73e8-4153-9a5d-c951e1a65b79 | 8 | public BigDecimal getBigDecimal() {
BigDecimal expValue2 = null;
BigDecimal fraction2 = null;
switch (numberType) {
case Nan:
return null;
case Infinite: {
return null;
}
case SubNormalized:
// ����SubNormal����ֵ
expValue2 = new BigDecimal("2").pow(config.MaxExp - 1);
expValue2 = new BigDe... |
8849423d-3596-4af9-a144-6877af9407fe | 7 | private void computeDeleCommand(String message) {
String[] cmd = message.split(" ");
if (cmd.length > 1) {
int n = Integer.parseInt(cmd[1]);
if (mails.containsKey(n)) {
// Mail ist noch nicht geloescht
if (!mailIsDeleted(n)) {
// Mail wird geloescht
deletedMails.add(n);
try {
writ... |
b7adde1d-c8d2-44f5-b721-76090564781e | 2 | private File getURLClassFile(String url) {
File classFile = new File("temp.class");
try {
URL u = new URL(url);
InputStream inputStream = u.openStream();
OutputStream outputStream = new FileOutputStream(classFile);
byte[] buffer = new byte[1024];
int count;
while ((count = inputStream.read(buffer)... |
a03b86d1-869b-4678-8c07-c6da0f01ac51 | 9 | public static boolean addUser(DBC dbc, String username, String password, String email) throws addUserException{
boolean success = true;
String errors ="", hash="", salt;
// validate username
if( !validUsername(username)){
errors += "Invalid Username. ";
s... |
ba1993c4-9c67-407e-a63a-77c071fac8b6 | 0 | public String getUserName() {
return userName;
} |
bce2b5b8-cacc-4be6-9d8a-a835dcd1f7c1 | 4 | @Override
public boolean onCommand(CommandSender sender, Command command,
String label, String[] args) {
if(args.length==1){
BansManager.banPlayer(sender.getName(),args[0], "");
return true;
}
if(args.length>1){
String msg = "";
for(String data: args){
if(!data.equals(args[0])){
msg+=d... |
722bdc85-3fd0-4fa5-913a-561bf3075a04 | 7 | @Override
public void affectCharStats(MOB affected, CharStats affectableStats)
{
super.affectCharStats(affected,affectableStats);
if(increase <= 0)
{
increase = 1;
if (affectableStats.getCurrentClass().baseClass().equals("Thief"))
increase = 2;
if (affectableStats.getCurrentClass().baseClass().equa... |
35df1d89-6ed6-437e-9a1a-5ad275dde60a | 3 | public void askWhereToSave() {
String[] options = {trans.getString("GetPath.home"),trans.getString("GetPath.portable")};
int choose = JOptionPane.showOptionDialog(null,trans.getString("GetPath.WhereSaveQuestion"),
trans.getString("GetPath.WhereSaveTitle"),JOptionPane.DEFAULT_OPTION,JOptionPane.QUESTION_ME... |
aee08aeb-623d-4428-9f6e-34c1fc5989da | 0 | @Override
public String toString() {
return "STORE " + new Integer(offset).toString() + " " + identifier
+ " "
+ identifier + " = " + new Integer(storedValueForPrinting).
toString();
} |
6a4d0441-ed36-4ee6-9314-623e604908cc | 2 | protected String getDocPath (int docSelector) {
// if we're outta bounds ...
if ((docSelector < 0) || (docSelector > docPaths.length)) {
// ... return bupkis
return null ;
} // end if
// we're in bounds. return the path name
return docPaths[docSelector] ;
} // end method getDocPath |
85447c8e-e034-4b10-be73-2e01a731e7da | 6 | public <T> List<T> findMoreRefResult(String sql, List<Object> params,
Class<T> cls) throws Exception {
List<T> list = new ArrayList<T>();
int index = 1;
pstmt = connection.prepareStatement(sql);
if (params != null && !params.isEmpty()) {
for (int i = 0; i < params.size(); i++) {
pstmt.setObject(index+... |
92adee35-f800-4aec-a98b-d6fe9eb5f6d2 | 7 | private void inhibitLateralSameShapeRecognizers(int shape) {
int shapeOffset = 2500 * shape;
double inhibWeight = 1.0;
int toNeuron;
for (int neuron = 0; neuron < 2500; neuron += 5) {
int fromNeuron = neuron + shapeOffset;
int fromRow = neuron / 50;
if ((fromRow % 10) >= 5) {// only ... |
ad7ccee6-93ae-485c-909e-44e07789d562 | 1 | public static ArrayList<Excel> rotateY(int angle, ArrayList<Excel> toScale)
{
ArrayList<Excel> result = new ArrayList<Excel>();
double matrix[][] = { {Math.cos(angle * Math.PI/180), 0, -Math.sin(angle* Math.PI/180),0},
{0, 1 ,0, 0},
{Math.sin(angle* Math.PI/180),0, Math.cos(angle* Mat... |
31b85b17-85e1-4881-ad71-236884f1653a | 1 | public ProtocolThread(Socket socket) {
System.out.println("Accepting connection from " + socket.getInetAddress() + "...");
this.socket = socket;
try {
out_socket = new PrintWriter(socket.getOutputStream(), true);
in_socket = new BufferedReader(new Inpu... |
82add17f-4c85-4be6-a334-b98b2f65ab17 | 1 | public void visit_imul(final Instruction inst) {
stackHeight -= 2;
if (stackHeight < minStackHeight) {
minStackHeight = stackHeight;
}
stackHeight += 1;
} |
58c4012a-3922-46b9-bfbd-9ec97b71c2f5 | 4 | @SuppressWarnings("serial")
private Action getDeleteAction() {
if (this.deleteAction == null) {
String actionCommand = bundle.getString(DELETE_NODE_KEY);
String actionKey = bundle.getString(DELETE_NODE_KEY + ".action");
this.deleteAction = new AbstractAction(actionCommand... |
ba9f17f8-41c2-40db-8854-29f1faaaf60c | 8 | @Override
public void run() {
int whatdo = Random.nextInt(0, 10);
switch (whatdo) {
case 0:
case 1:
Mouse.move(Random.nextInt(0, 750), Random.nextInt(16, 500));
break;
case 2:
case 3:
case 5:
case 4:
case 7:
case 8:
Camera.setAngle(Random.nextInt(0, 360));
break;
default:
Camer... |
578de215-b57f-441a-a6c3-88cbfb43a749 | 0 | public Integer getTaskCount(){
return taskCounter.get().intValue();
} |
60611fdd-8390-40c3-88e3-baabf61edead | 2 | public boolean isPassiv() {
for (Vertrag vertrag : vertragCollection) {
if (vertrag.getAktiv()) {
return false;
}
}
return true;
} |
f350f35e-a3f4-409c-b394-3556775a70d9 | 1 | public static void playGame(GameFactory factory) {
Game s = factory.getGame();
while (s.move()) {
}
} |
bc9b8a6a-e6db-42bf-b4ab-ed290336f594 | 5 | public static void main(String[] args) {
for (int i = 1; i <= 100; i++){
if (i % 5 == 0 || i % 7 == 0){
if (i % 5 == 0){
if (i % 7 == 0) System.out.println("ABBA");
else System.out.println("A");
} else System.out.println("B");
... |
427427cb-ecb2-4aad-9472-3c3fd04f695e | 2 | @Override
public synchronized void down()
{
super.down();
if (bulbPower > 0)
{
bulbPower--;
}
if (bulbPower == 0)
{
startEntryPoint.insert(new ReachedBottom());
}
sendImageToGUI();
} |
8539f8cc-f833-496a-9452-6456744aafb2 | 8 | private void initExceptionMessage() {
if(descriptor.getException() == null) {
add(createMessageLabel(), BorderLayout.CENTER);
return;
}
JTabbedPane tabs = new JTabbedPane();
tabs.addTab("Description", createMessageLabel());
JTextArea expTA = new JTextArea();
... |
05f6cd7e-1b79-4aeb-8348-ee6a6098c6fd | 0 | public List<EventBranch> findEventBranchesByHallEventId(final Long hallEventId) {
return new ArrayList<EventBranch>();
} |
046e9f26-aa67-4494-a138-e438f39c0c6a | 7 | private boolean checkUserInDB(String s, String s1, String s2)
{
String s3 = null;
s = s.trim().toLowerCase();
s1 = s1.trim().toLowerCase();
DbAccess dbaccess = null;
try
{
dbaccess = dbManager.takeDbaRef();
}
catch(Exception exception)
... |
39536af7-a9cb-4b98-a037-f5775e366d6b | 3 | public void run() {
init();
long start, elapsed, wait;
while(running) {
start = System.nanoTime();
update();
draw();
drawToScreen();
elapsed = System.nanoTime() - start;
wait = TARGET_TIME - elapsed / 1000000;
if(wait < 0) wait = TARGET_TIME;
try {
Thread.sleep... |
563d0f90-2799-4960-87be-e53826a8bae2 | 2 | private Socket getClientSocket() {
Socket clientSocket = null;
try {
clientSocket = new Socket(this.destinationIpAddress,
this.destinationPort);
this.log.fine("Create new clientSocket: " + clientSocket.toString());
} catch (UnknownHostException e) {
e.printStackTrace();
clientSocket = null;
} c... |
0e4882a5-2198-4386-ace1-6c0690b6ab15 | 9 | protected String getQueryString(RequestBean request)
throws CitysearchException {
log.info("Start OfferProxy getQueryString()");
StringBuilder strBuilder = new StringBuilder();
strBuilder.append(constructQueryParam(APIFieldNameConstants.RPP,
RPP_OFFERS));
strBuilder.append(CommonConstants.SYMBOL_AMPERSA... |
299f6d64-d1ba-4763-a160-44eed5c1b91c | 4 | public void listen() {
System.out.println("Node listening for requests...");
while (!m_exitFlag) {
int incomingPolls = m_poller.poll();
if (incomingPolls > 0) {
for (int i = 0; i < m_incomingSockets.size(); i++) {
if (m_poller.pollin(i)) {
receiveMessage(ZstIo.recv(m_poller.getSocket(i)));
... |
37f24a88-e07b-4973-bddd-96041d608fb1 | 1 | @Override
public void cleanUp() {
// Synchronise the waitingEventLists which stores the list of all events
// which were collected during the previous logic update and clear each
// individual key
synchronized (waitingEventLists) {
for (Collection<EventHolder> eventHolderList : waitingEventLists.values()) {... |
0b3afed5-5078-4556-a4dc-f95f2f9777f4 | 7 | static Class<?> getClass(Type type) {
if (type instanceof Class) {
return (Class<?>) type;
} else if (type instanceof ParameterizedType) {
return getClass(((ParameterizedType) type).getRawType());
} else if (type instanceof GenericArrayType) {
Type componentTy... |
a9591e54-e29e-4955-a4e3-acc0dc9b125c | 2 | public Function getFunction (String literal) {
int functionCount = this.functionList.size();
for(int i = 0;i<functionCount;i++) {
Function currentFunction = this.functionList.get(i);
String currentText = currentFunction.getLiteral();
boolean isMatchingExpression = literal.equals(currentText);
if (isMa... |
d673f0f1-4880-42d8-897b-c1301de53384 | 2 | private boolean allSitesHasVarRecover(int index) {
for(int i: sitesHasVar(index).keySet()) {
Site site = sitesHasVar(index).get(i);
if(site.isUp()) {
return false;
}
}
return true;
} |
af0d7b65-a235-4057-ae52-a6f260115644 | 0 | public void validity(){
} |
c78364db-66e7-4437-a777-e70d01f9e44a | 9 | private boolean isConcealedSquare(long n) {
int[] digits = Numbers.getDigits(n * n);
if(digits.length < 17) { return false; }
return digits[0] == 9
&& digits[2] == 8
&& digits[4] == 7
&& digits[6] == 6
&& digits[8] == 5
... |
5d0f2a54-03fa-493a-bec5-792ed76d1be3 | 8 | @Override
public IRailwayMap processRailwayGraph(final String graphInput)
throws DuplicateRouteException, OrphanStationException {
IRailwayMap trainMap = new RailwayMap();
HashMap<Character, Integer> checkLinkageMap = new HashMap<Character, Integer>();
String[] routes = preproc... |
6ad6c193-85dd-4022-9b38-c1445db3919e | 2 | private Quote takeQuote(int maxLinesLimit) {
for ( Quote q : quotes ) {
if ( q.lines() <= maxLinesLimit )
return q;
}
return quotes.get(0);
} |
39b16e9e-0646-4b27-ad1a-2cf99971a958 | 7 | public static Vertex convertNode(org.yaoqiang.bpmn.model.elements.core.common.FlowNode inputNode){
Vertex outputNode = null;
String type = inputNode.getClass().getCanonicalName();
if(outputNode == null){
if(type.toLowerCase().contains("gateway")){
//a.e.println(type + " " + inputNode.getName());
output... |
103aa57e-b629-45d5-939a-cd1456744ccb | 3 | public List<Telefone> listarTodos(int idPessoa){
try{
PreparedStatement comando = banco.getConexao()
.prepareStatement("SELECT * FROM telefones WHERE id_pessoa = ? AND"
+ " ativo = 1");
comando.setInt(1, idPessoa);
ResultSet consulta = ... |
682126f0-a00d-4684-8c0f-dc900db07f72 | 8 | public static boolean createCheddarXml(List<Partition> lop, CartsModel cm,
String filename) {
// -> file
File dir = new File(Airsched.DEFAULT_OUTPUT_DIR);
// File file = new File(OUTPUT_FILE);
File output_file = new File(Airsched.DEFAULT_OUTPUT_DIR + "/"
+ filename + "_period-" + cm.getModel_period() + ... |
b6c4cbb3-1b67-4c56-a358-ba22e9961145 | 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... |
31b97c12-3a3a-40d6-8a85-bbceb5a3c212 | 6 | public static double[][][] createGridAround(double[] point, int m){
double xAxis[][] = new double[m*2+1][2];
double yAxis[][] = new double[m*2+1][2];
for(int i=1;i<=m; i++){
double nextPoint[]= GeoUtil.nextPoint(point, 100*i, 0);
xAxis[m+i] = nextPoint;
}
for(int i=1;i<=m; i++){
double nextPoi... |
65cf20b8-4923-46a7-bd8d-0fc1fb16d999 | 5 | */
@Override
public int compare(SchemaError arg0, SchemaError arg1) {
if(arg0==null && arg1==null){
return 0;
}
if(arg0==null){
return 1;
}
if(arg1==null){
return -1;
}
if(arg0.getError().getErrorType()==arg1.getError().getErrorType()){
return 0;
}
return getRank(arg1.getError().getError... |
38680ab2-0544-4356-9a0f-217f58fa42fb | 0 | public void setName(String name) {
this.name = name;
} |
dc2835e4-75b4-4d86-aed5-1f5293d490ff | 1 | public int Decode(Decoder rangeDecoder) throws IOException
{
int m = 1;
for (int bitIndex = NumBitLevels; bitIndex != 0; bitIndex--)
m = (m << 1) + rangeDecoder.DecodeBit(Models, m);
return m - (1 << NumBitLevels);
} |
7cec4124-2755-40b6-8513-23d44e2da7b3 | 7 | private BufferedImage VerticalFiltering(BufferedImage pbImage, int iOutH) {
int iW = pbImage.getWidth();
int iH = pbImage.getHeight();
int value = 0;
BufferedImage pbOut = new BufferedImage(iW, iOutH,
BufferedImage.TYPE_INT_RGB);
for (int y = 0; y < iOutH; y++) {
... |
4d832390-4676-4a85-b561-a11a2fa3c1e2 | 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... |
f0e7afcc-fab6-43a8-b275-511efcf23860 | 5 | public static void showPopularBooksReportsTable(ResultSet rs,
String reportsQuery, Date[] years, int noBooks) {
int numCols;
ResultSetMetaData rsmd;
JTextArea tableTitle = null;
JTable table = null;
try {
rsmd = rs.getMetaData();
numCols = rsmd.getColumnCount();
String columnNames[] = new String... |
d81d1891-bb99-4aa8-a55d-5572a773b98d | 7 | public List<CertListing> getAll() {
List<CertListing> courseListing = new ArrayList<CertListing>();
try {
//Connect to database
conn = DriverManager.getConnection(url, userName, password);
stmt = conn.createStatement();
ResultSet rset = null;
... |
abded649-c5a1-4144-b88c-a7bc8722a7ac | 0 | public Object readResolve() {
return INSTANCE;
} |
628c4ba0-64d0-4672-ab81-635969965fc4 | 1 | public SignatureVisitor visitReturnType() {
endFormals();
if (seenParameter) {
seenParameter = false;
} else {
declaration.append('(');
}
declaration.append(')');
returnType = new StringBuffer();
return new TraceSignatureVisitor(returnType);
} |
aad5188a-9ffc-48eb-a499-18385e87ceb4 | 6 | @Override
public void run() {
if (options.mode == Mode.BURIAL_ARMOUR) {
final GameObject tunnel = ctx.objects.select().id(4618).nearest().poll();
if (tunnel.valid()) {
if (ctx.camera.prepare(tunnel) && tunnel.interact("Climb")) {
Condition.wait(new Callable<Boolean>() {
@Override
public Bo... |
3c76541e-f552-4de9-8c88-4871a6963e50 | 6 | public void service(){
while(true){
Socket socket=null;
try {
socket = serverSocket.accept();
BufferedReader br = new BufferedReader(new InputStreamReader(socket.getInputStream()));
PrintWriter pw = new PrintWriter(socket.getOutputStream(),true);
String msg = null;
while((msg=br.readLin... |
5d6bdf2c-0930-4ce2-8fc6-38d53fa790f7 | 4 | private void testEntityCollision(double dt) {
double xx = x + dx * dt;
double yy = y + dy * dt;
for (Entity e : level.getEntityNear(xx, yy, getWidth(), getHeight())) {
if (e == this)
continue;
boolean collide = Collide.aabb(xx, yy + hIgnored, getWidth(),
(int) (getHeight() - hIgnored), e.getBox().... |
9e030048-429c-48dd-ae14-1c485931e549 | 5 | public void serialize(ByteWriter bw) throws IOException {
int size = 16;
byte[] label_b = label.getBytes();
size += label_b.length + 1;
boolean u = false;
if (!Charset.defaultCharset().newEncoder().canEncode(label)) {
size += 4 + 1 + label.length() * 2 + 2;
u = true;
}
bw.write4bytes(size);
bw... |
32aad5fd-ad95-4fac-8fb6-24ecf9d24bec | 5 | private String getInvokerFor(File file) {
String name = file.getName();
String ext = name.indexOf(".") != -1 ? name.substring(name.indexOf(".")) : "";
if (ext.equals(".exe"))
return "";
else if (ext.equals(".jar"))
return "java -jar ";
else if (ext.equals(... |
5379fd7e-2cea-4e27-9371-af0209b18287 | 6 | private Config() {
final InputStream in = getClass().getClassLoader().getResourceAsStream(
CONFIG_FILE);
if (in == null) {
return;
}
byte[] bytes;
try {
bytes = new byte[in.available()];
in.read(bytes);
final String[] lines = new String(bytes).split("\n");
Map<String, String> map = this.map... |
9aad77d1-b7d7-4329-89cf-721ad137984b | 4 | public static List<String> twoArrayDiffData(String[] arr1,String[] arr2){
Integer arr1Length = arr1.length;
Integer arr2Length = arr2.length;
List<String> returnArr = new ArrayList<String>();
boolean flag = false;
for(int i = 0; i< arr1Length; i++){
flag = false;
for(int j = 0; j < arr2Length; j++){
... |
47ccc0d0-5475-4192-9c28-10276db8635e | 9 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
AssRule other = (AssRule) obj;
if (a == null) {
if (other.a != null)
return false;
} else if (!a.equals(other.a))
return false;
if ... |
6e089045-bdfc-423a-973e-1c50192ca8c5 | 1 | public void writeToStream(OutputStream os) throws IOException {
DataOutputStream dos = new DataOutputStream(os);
for(int i = 0; i < ObjectList.size(); i++) {
dos.writeBoolean(true);
writeObjectToStream(ObjectList.get(i), ObjectType.get(i), ObjectNames.get(i), dos);
}
dos.writeBoolean(false);
dos.flu... |
faa956d2-8d29-496e-9882-a9aa8f71fc70 | 7 | public static String doubleToString(double d) {
if (Double.isInfinite(d) || Double.isNaN(d)) {
return "null";
}
// Shave off trailing zeros and decimal point, if possible.
String string = Double.toString(d);
if (string.indexOf('.') > 0 && string.indexOf('e') < 0 &&
... |
2e193cee-5d47-4789-aed9-58bcfbdb48af | 1 | public void redirectError(Writer w) {
if (w == null) {
throw new NullPointerException("w");
}
stderr = w;
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.