method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
9c901e19-a325-4584-a66b-aeec2ef2a409 | 0 | public String getDiagnostico() {
return diagnostico;
} |
8447d544-0edd-48c6-a069-ead7cb368808 | 3 | void setCellBackground () {
if (!instance.startup) {
table1.getItem (0).setBackground (1, cellBackgroundColor);
}
/* Set the background color item's image to match the background color of the cell. */
Color color = cellBackgroundColor;
if (color == null) color = table1.getItem (0).getBackground (1);
Tabl... |
36fc4679-04b2-4636-96a0-d50acb9d115e | 8 | @Override
public Orientation getStepOrientation(int lineIndex) {
switch(lineIndex) {
case 0:
case 4:
return Orientation.LEFT;
case 1:
case 5:
return Orientation.DOWN;
case 2:
case 6:
return Orientation.UP;
case 3:
case 7:
return Orientation.RIGHT;
default:
return Orientation.NONE;
... |
397bee41-1089-496d-9f7d-625d632d445b | 5 | @Override
protected void execute(CommandSender sender, String Command, List<String> list) {
this.init(sender);
// /rm limit list <sell/rent>
// /rm limit <region> <sell/rent> <int>
// /rm limit <region> <sell/rent>
if (list.get(0).equals("list")) {
Map<String, Integer> limit = null;
if (list.get(1).e... |
b7bb4df5-ca07-4f54-a9f2-cdaf2ed4f3fa | 2 | @Override
public byte[] getSchedule() {
byte[] schedule = new byte[getScheduleSize()];
for (int i = 0; i < numSlots; i++) {
if(desiredSlots[i]) {
setSlot(schedule, i, footprints[i]);
}
}
return schedule;
} |
83759cdf-5067-43d2-8e96-c3fc9200a303 | 9 | private Hashtable<String, String> loadCsv(HttpServletRequest request, String tempFolder) throws IOException
{
Hashtable<String, String> items = new Hashtable<String, String>();
File csv = null;
if (request.getParameter("uploadfile") != null && (request instanceof SabaHttpServletRequest))
{
csv = ((SabaHt... |
cea8f2df-84d3-44f0-85a3-0b87f20bdfa4 | 6 | public OnDemandRequest getNextNode() {
OnDemandRequest onDemandRequest;
synchronized (aClass19_1358) {
onDemandRequest = (OnDemandRequest) aClass19_1358.popFront();
}
if (onDemandRequest == null) {
return null;
}
synchronized (queue) {
... |
65f1f23c-f1d6-4aba-b98a-a17ec2e81ad2 | 0 | public void setDescription(String description) {
this.description = description;
} |
14d9b941-484d-48d0-9a9a-278cc180cee4 | 0 | public void showMessage(String message, String title, int messageType){
JOptionPane.showMessageDialog(frame, message, title, messageType);
} |
ce3e7475-4edb-44df-b378-d52ab9411117 | 4 | @Override
public void killProcess(String programName) throws IOException, InterruptedException,
ProcessKillerException {
logger.trace("Attempt to kill " + programName);
int attempts = 0;
if (!isProgramRunning(programName))
return;
for (attempts = 0; attempts... |
ff55bbef-8762-4ab7-8ed9-f5ade5c8c611 | 5 | public Object getArgument(String arg, String classDescription){
switch(classDescription)
{
case "boolean":
return getBooleanArgument(arg,true);
case "double":
return getDoubleArgument(arg,true);
case "long":
return getLo... |
e6405293-fb24-46ec-a96a-ae4bb703d0fb | 3 | public void unsubscribeEvent(String eventName, Object className) {
HashMap<Object, String> eventCallbacks = this.eventMap.get(eventName);
if(eventCallbacks != null) {
if(eventCallbacks.containsKey(className)) {
eventCallbacks.remove(className);
if(eventCallbacks.size() == 0) {
this.eventMap.remove... |
316f701c-dfa3-4edd-b2ef-2d5f643c72cf | 4 | private int findLekarzId(int nr_lekarza)
{
int id = 0;
Session session = factory.openSession();
Transaction tx = null;
try
{
tx = session.beginTransaction();
Query query = session.createQuery("from lekarze where nr_lekarza = :id ");
query.setParame... |
377705d7-1044-4012-bf8b-42ad76b27216 | 0 | @Override
public void execute(VirtualMachine vm) {
} |
a836c790-b80c-491a-a7ca-5bd518fe7b0a | 2 | private void push(JSONObject jo) throws JSONException {
if (this.top >= maxdepth) {
throw new JSONException("Nesting too deep.");
}
this.stack[this.top] = jo;
this.mode = jo == null ? 'a' : 'k';
this.top += 1;
} |
02a667da-e947-414a-b167-dd6e5d690785 | 9 | public static void init(){
Toolbox.debugPrint(TAG, numLines + "");
tb = new TextBox();
lines = new Label[numLines];
tb.setX(3);
tb.setY(CMConfig.WINDOW_HEIGHT - 17);
tb.setHintText("Enter Command");
tb.getLabel().setFont("data/roboto_small.fnt", "data/roboto_sma... |
28569fea-d672-48fb-8952-8877cdf0a836 | 6 | private static int[] matchNodes(SquareMatrix S) {
// Number of rows <= Number of columns
int numRows = S.getNumberOfRows();
int numCols = S.getNumberOfColumns();
int[] matches = new int[numRows];
ArrayList<Integer> tabuRows = new ArrayList<Integer>();
ArrayList<Integer> tabuCols = new ArrayList<Integer>();... |
38a255b9-19f6-467b-be85-08a812c0f1e0 | 2 | public void removeLastStmt() {
final ListIterator iter = stmts.listIterator(stmts.size());
while (iter.hasPrevious()) {
final Stmt s = (Stmt) iter.previous();
if (s instanceof LabelStmt) {
continue;
}
iter.remove();
return;
}
} |
0bde8b5c-4b6c-4dd7-af4f-c91131e64045 | 9 | @Override
public boolean execute(String code)
{
int indexValue = 0;
int pointerToAdd = 0;
String effectiveAddress = "";
String val = "";
seperateCode(code);
// Get the addressing mode.
int addressMode = getAddressingMethod(code);
try {
... |
8db6777c-37da-4818-9999-fb40570496c5 | 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... |
1b92f19b-8bdc-4202-b9f3-a18410b950dd | 7 | public static void main(String[] args) throws Throwable {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
for( String linea; (linea = in.readLine() ) != null ; ) {
v = new boolean[12];
int guess = Integer.parseInt(linea);
if(guess == 0) break;
String resp = in.readLine();
wh... |
ae101ea9-5175-495f-8cc1-c5e1a7a16aaa | 2 | private void sendQuickLaunchFiles(){
if(client_connected){
// Notify connected client of new files (TCP)
for(int x = 0; x < quick_launch_files.length; x++){
sendQuickLaunchFile(x);
}
}
} |
c1ff7b83-a6e3-4cb0-8f2c-cf0a75b0ef9f | 6 | private void calculateEnabledState(JoeTree tree) {
Document doc = tree.getDocument();
if (doc == Outliner.documents.getMostRecentDocumentTouched()) {
Node node = tree.getEditingNode();
if (tree.getComponentFocus() == OutlineLayoutManager.TEXT) {
if (node.isLeaf()) {
setEnabled(false);
} el... |
d95ea06f-296e-4358-a4d7-f40bc34b37e4 | 9 | protected boolean verificaVencedor() {
boolean daVez = jogador1.obterDaVez();
boolean ocupada;
boolean haAdversarios;
Troglodita troglodita;
Posicao posicaoTemporaria;
//Verifica se não há trogloditas adversários, e depois se há próprio troglodita na última linha.
if(daVez){
haAdversarios = jogado... |
91e4331b-3ce4-484d-a14e-7663d4be04b2 | 9 | private void initMenu() {
connectItem = new JMenuItem("Connect");
connectItem.setEnabled(false);
connectItem.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
for (JCheckBoxMenuItem portItem : portItems) {
... |
24d379d9-7566-4eec-9a61-884900ebe37c | 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 ConsultantInfo)) {
return false;
}
ConsultantInfo other = (ConsultantInfo) object;
if ((this.userId == null && ... |
abd083cc-7f4f-4703-9617-19564f86630c | 2 | private final AStarNode obtainOpenWithLowestCost() {
Iterator<Entry<Float, Vector<AStarNode>>> entries = open.entrySet().iterator();
if (!entries.hasNext())
return null;
Vector<AStarNode> costEntry = entries.next().getValue();
int lastCostEntry = costEntry.size() - 1;
AStarNode lowestCostNode = costEntry.g... |
1a55ed1e-ff88-42e4-8006-914c26496f98 | 6 | public void decodeToFile(BufferedReader br, BufferedWriter bw, int total) throws IOException{
int input;
boolean[] new_bits;
while ((input = br.read()) != -1 && total > 0) {
if(total <= 0){
System.out.println("stopped due to max words!");
}
new_bits = byteToBooleans(input);
addToQueue(new_bits);
... |
b288921c-dcb7-445d-b6b5-fab584259558 | 2 | public ArrayList<AreaFormacao> listar(String condicao) throws Exception
{
ArrayList<AreaFormacao> listaAreaFormacao = new ArrayList<AreaFormacao>();
String sql = "SELECT * FROM areaformacao " + condicao;
try
{
PreparedStatement stmt = ConnectionFactory.getConnection().prepareStatement(sql);
ResultSet ... |
86643b97-33ce-485c-81a3-f903e7b0698e | 0 | public void stop(){ stopping = true; } |
b412def5-62c7-4253-9359-c6b6d6669e85 | 2 | public static Titulo sqlLeer(Titulo titulo){
String sql="SELECT * FROM titulo WHERE idtitulo = '"+titulo.getId()+"'";
if(!BD.getInstance().sqlSelect(sql)){
return null;
}
if(!BD.getInstance().sqlFetch()){
return null;
}
titulo.setId(BD... |
11796b8a-4065-4ed6-b61f-fa749779f896 | 5 | public AuthHeader getAuthHeaderByToken(String token){
AuthHeader ah=null;
Connection con = null;
Statement stmt = null;
try {
DBconnection dbCon = new DBconnection();
Class.forName(dbCon.getJDBC_DRIVER());
con = DriverManager.getConnection(dbCon.getDATABASE... |
de0efd39-291a-4c4d-8ce3-ab27b56fc4e0 | 8 | synchronized private void waitReady(DocumentsWriterThreadState state) {
while (!closed && ((state != null && !state.isIdle) || pauseThreads != 0 || flushPending || aborting)) {
try {
wait();
} catch (InterruptedException ie) {
throw new ThreadInterruptedException(ie);
}
}
... |
acd66dec-3073-40ee-bec8-5c5955d1f255 | 7 | public ListNode removeNthFromEnd(ListNode head, int n) {
ListNode p1,p2;
if (n <=0 ) return head;
int k = n;
p1 = head;
while (k > 0 && p1 != null)
{
k--;
p1 = p1.next;
}
if (k ==0 && p1 ==null)
{
head = head.ne... |
0624f6c8-72ac-4e5b-8c35-758c36132870 | 8 | @Override
public void actionPerformed(ActionEvent arg0)
{
if (colorGain)
colorN += 3;
else
colorN -= 5;
if (colorN >= 200)
colorGain = false;
else if (colorN <= 30)
colorGain = true;
if (!seen)
{
tutorial = true;
hero.setPaused(true);
if (tutorialX > 0)
{
tutorialX -= 15;
t... |
8ee6f0a5-c964-4f7f-94b7-28352b9cafe8 | 3 | public static Collection getAllTasks(){
Session session = HibernateUtil.getSessionFactory().openSession();
List answer = new ArrayList<Task>();
try {
session = HibernateUtil.getSessionFactory().openSession();
answer = session.createCriteria(Task.class).list();
... |
5b2ce23d-2d62-40bc-afb1-e3a4e54fc003 | 1 | private void compute_pcm_samples15(Obuffer buffer)
{
final float[] vp = actual_v;
//int inc = v_inc;
final float[] tmpOut = _tmpOut;
int dvp =0;
// fat chance of having this loop unroll
for( int i=0; i<32; i++)
{
float pcm_sample;
final float dp[] = d16[i];
pcm_sample = (float)(((vp[15 ... |
b7aae556-56f2-4e91-8447-83d559d7ab93 | 0 | public void play() {
pause = false;
timer = new Timer();
timer.scheduleAtFixedRate(new Timing(this), 0, (int) (50.0f / vitesseBase));
} |
0d233ec2-d086-40d9-9995-2a8c9620fa54 | 4 | protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
try {
Library library = new Library();
ResultPage<Patron> patrons = library.getPatronList(
Integer.parseInt(request.getParameter("offset")));
JSONObject result = new JSONObject();
... |
88380b8e-852a-42a4-afd0-f4a306a306c8 | 4 | public PointGame getLeftNeighbor() {
int x0 = x;
int y0 = y;
while (x0 > MINX) {
// check if x=4 and y=3, we cannot go to the left.
if(x0==4 && y0==3)
break;
x0--;
if (Board.validPoints.contains(new PointGame(x0,y0))) {
return new PointGame(x0,y0);
}
}
return null;
} |
e20e69a9-e09b-45a5-9f2a-a64e067c6002 | 9 | private void checkForPrompt()
{
// Text has been entered, remove the prompt
if (document.getLength() > 0)
{
setVisible( false );
return;
} else if(show == Show.EMPTY) { //Show always parent text is empty
setVisible(true);
return;
}
// Prompt has already been shown once, remove it
if (sho... |
dac487ad-95ec-4938-a7d1-a8d4ebc63dea | 8 | @Override
public boolean show() {
if (!tab.open())
return false;
WidgetChild window = Widgets.get(BOOK_WIDGET, CLICK_WINDOW);
WidgetChild wc = getChild();
WidgetChild scrollbar = Widgets.get(BOOK_WIDGET, SCROLLBAR);
if (wc == null || window == null || scrollbar == null || !wc.visible() || !window.visible(... |
1468ac20-8ab9-4ddc-88b8-520e6dfbf860 | 1 | public void keyPressed(KeyEvent arg0) {
if(arg0.getKeyCode() == KeyEvent.VK_ESCAPE) {
frame.setVisible(false);
}
} |
a229862d-2c84-4b68-8f48-af17137911d9 | 8 | public void chargeProvinceRent(Player player) {
String playerName = player.getName();
String worldName = player.getWorld().getName();
String query = "SELECT * FROM `Monarchy_Provinces` WHERE `player` = ? AND `world` = ? ORDER BY `time` ASC;";
Connection con = getSQLConnection();
try {
PreparedStatement... |
172729ad-1f2b-48d1-b7d6-fa156c73bfb1 | 2 | public int balance ()
{
org.omg.CORBA.portable.InputStream $in = null;
try {
org.omg.CORBA.portable.OutputStream $out = _request ("balance", true);
$in = _invoke ($out);
int $result = $in.read_long ();
return $result;
... |
cd77feb2-b3e7-4748-a167-91e745fff587 | 4 | public void keyReleased(KeyEvent e) {
if (e.getKeyCode() == 10) {
if (textWavelength.isFocusOwner()) {
wavelength = (int) Double.parseDouble(textWavelength
.getText().replaceAll(",", ""));
loadExistingValues();
updateConsole();
}
else if (textPower.isFocusOwner()) {
power[i] = Double.p... |
2d1a0897-6837-4ca6-b794-be1efe96baf6 | 2 | @Override
public void draw() {
StringBuilder s = new StringBuilder();
for (int i = 0; i < side; i++) {
s.append("# ");
}
for (int i = 0; i < side; i++) {
System.out.println(s);
}
} |
2e71a0d9-e2d9-490f-8673-1bcd0780ab73 | 5 | @SuppressWarnings({ "unchecked", "rawtypes" })
public void SaveLevel() {
System.out.println("Attempting level save.");
new Thread(new Runnable() {
public void run() {
for(int i = 1; i<=Layers; i++) {
File layer_file = new File(workingDir, ("Layer" + i + ".dat"));
FileSystem.SaveDatFile(LayerList.g... |
ea9cba92-c57c-4c8d-8ad8-6646f98483b8 | 9 | public synchronized void detectPulse(Record record) {
if (this.lastRecord != null) {
// check whether we have not found a peak after 166% of avg2 if so take the last peak as a signal peak
// if that greater than half threshold.
if ((record.getTime() - this.lastSPKTime) > 1... |
89dedb6f-1dc3-4ad2-ad4f-ece3a63bb9e7 | 3 | @Override
protected void _processWalks(WalkArray walkArray, int[] atVertices) {
long[] walks = ((LongWalkArray)walkArray).getArray();
long t1 = System.currentTimeMillis();
for(int i=0; i < walks.length; i++) {
long w = walks[i];
int atVertex = atVertices[i];
... |
2b3814d3-39e3-44f1-9988-afcd8ddcd14c | 1 | @Override
public void run() {
try {
Thread.sleep(1000);
System.out.println("here");
} catch (InterruptedException e) {
e.printStackTrace();
}
} |
420f0d0f-5baf-4b44-b217-5d07442e35bd | 4 | private void removeClientFromResourceMap(ClientInterface clientInterface){
synchronized(resourcesOfClients){
Set<String> list = resourcesOfClients.keySet();
Iterator<String> iter = list.iterator();
Vector<String> keysToBeDeleted = null;
while(iter.hasNext()) {
String key = iter.next();
resourcesO... |
95b7f51b-de1d-44a0-82ec-49d7089ed85b | 9 | private void divideSamples(Node node, SampleSet nodeSet){
/*
* The first step is to assign the given set to the top node of the subtree.
* If it is a leaf, we're done; else we have to divide the samples into the
* correct subsets for the subtrees.
*/
node.setSampleSet(nodeSet);
if(!node.isLeaf()){
... |
ac27f556-4026-48d4-8bb3-74a27060ad59 | 9 | protected boolean checkCDATA(StringBuffer buf) throws IOException {
char ch = this.readChar();
if (ch != '[') {
this.unreadChar(ch);
this.skipSpecialTag(0);
return false;
} else if (!this.checkLiteral("CDATA[")) {
this.skipSpecialTag(1); // one [ h... |
fcc283c3-0f27-4b0a-aea9-45c0667fc6f2 | 4 | public static String parseSpace(char[] s, int length) {
// 1.check number of space in original array
int count = 0;
for (char c : s) {
if (c == ' ') {
++count;
}
}
int newLength = length + count * 2;
int j = newLength - 1;
for ( int i=length-1; i >=0; --i ){
if ( s[i] == ' ' ){
s[j--]... |
8d40df0f-5988-460d-aa6e-54e634a56417 | 9 | protected void FillBuff() throws java.io.IOException
{
if (maxNextCharInd == available)
{
if (available == bufsize)
{
if (tokenBegin > 2048)
{
bufpos = maxNextCharInd = 0;
available = tokenBegin;
}
else if (tokenBegin < 0)
bufpos = maxN... |
9f73ae0f-87af-40d4-93e2-4f28e19cb61a | 4 | int getCountCorrect()
{
int count = 0;
for(int i=0;i<sudokuSize;i++) {
for(int j=0;j<sudokuSize;j++) {
if(cells[i][j].valueState == 1 || cells[i][j].valueState == 7)
count++;
}
}
return count;
} |
cfe9f31b-dac8-4a65-8cbe-be5f22a9a341 | 8 | private HttpResponse processRequest() {
try {
// Read client Input and parse it.
BufferedReader inFromClient = new BufferedReader(new InputStreamReader(socket.getInputStream()));
RequestParser requestParser = new RequestParser(this);
parsedHttpRequest = requestParser.getParsedRequest(inFromClient);
/... |
2b563a39-2956-4610-b9e2-6a11f17c2c9c | 7 | protected void doProtocolPings()
{
if(getClientTelnetMode(TELNET_MSDP))
{
final byte[] msdpPingBuf=CMLib.protocol().pingMsdp(this, msdpReportables);
if(msdpPingBuf!=null)
{
try
{
rawBytesOut(rawout, msdpPingBuf);
}
catch (final IOException e)
{
}
if(CMSecurity.isDebugging(... |
50444d39-dd35-427d-8171-b3cc961723e7 | 6 | private boolean isSwf(String filetype){
if(filetype.equals("doc")
||filetype.equals("docx")
||filetype.equals("ppt")
||filetype.equals("pptx")
||filetype.equals("xls")
||filetype.equals("xlsx")) {
return true;
}e... |
9482dc19-02b4-4047-8ec8-a70194a3d0ea | 4 | private Dimension layoutSize(Container parent, boolean minimum) {
Dimension dim = new Dimension(0, 0);
Dimension d;
synchronized (parent.getTreeLock()) {
int n = parent.getComponentCount();
for (int i = 0; i < n; i++) {
Component c = parent.getComponent(i)... |
28a0c1cd-9ec2-4f6b-8061-875941ac2f1d | 0 | public Carte( String url, int i, String nomAnimal ) {
this.url = url;
this.nomAnimal = nomAnimal;
ijk = i;
telecharger();
initComponents();
label1.setIcon(new ImageIcon(nomImage));
} |
f65c3e44-c2a2-484e-9860-736938c1b590 | 4 | @Override
public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
if (args.length == 1 && "reload".equalsIgnoreCase(args[0]) && sender.hasPermission("orelog.reload")) {
if (sender instanceof Player) {
this.plugin.reload(sender.getName());... |
3a928126-346a-4fc4-ac4e-1b4c384c4154 | 9 | public static void clientRemove(final Socket socket,DataInputStream datais,String basepath) {
boolean success=false;
DataOutputStream dataOutputStream=null;
OutputStream outputStream=null;
try {
outputStream=socket.getOutputStream();
dataOutputStream = new DataOutputStream(outputStream);
// 读取到请求的url
... |
08d34de7-133e-4017-8974-a1fec39fbaf2 | 8 | public void setupButtons() {
side_hud_panel.removeAll();
if (selected.size() > 0
&& selected.getFirst() instanceof VillagerEntity) {
VillagerEntity tower = ((VillagerEntity) selected.getFirst());
final JCheckBox build = new JCheckBox("Build: "
+ createCostString(VillagerEntity.MAKE_TOWER_COST));
s... |
56a1c524-9640-4ef9-a008-00f3e621abdd | 7 | private void inviteNickHelper() {
if (true) {
return;
} //TODO Fix this method
if (!hasArgs || !(cmdArgs.split("\\s++").length > 0)) { // Min 1 Arg
//@TODO Replace code with getHelp(cmd); //Overloaded method
connection.msgChannel(config.getChannel(), "Usage: " + config.getCmdSymb() + "inv... |
2c104036-78ee-4a63-b81c-86239bf1abb9 | 5 | public static boolean isPowerProviderOrWire(IBlockAccess var0, int var1, int var2, int var3, int var4) {
int var5 = var0.getBlockId(var1, var2, var3);
if(var5 == Block.redstoneWire.blockID) {
return true;
} else if(var5 == 0) {
return false;
} else if(Block.blocksList[var5].can... |
e413b543-927d-4e82-ae86-9921dc1c2226 | 2 | @Override
@Command
public MessageResponse getProxyPublicKey() throws IOException {
if(initRMI()) {
ProxyPublicKeyResponse response = proxyRMI.getProxyPublicKey();
if(!response.hasKey()) return new MessageResponse(response.toString());
else {
String pathToPublicKey = keysDir+"/proxy.pub.pem";
PEMWri... |
ac05639b-c7d1-45b8-95cf-fa2b20a3160c | 6 | public <VT> List<VertexIdValue<VT>> queryWithValues(int vertexId, BytesToValueConverter<VT> conv) throws
IOException {
List<VertexIdValue<VT>> results = new ArrayList<VertexIdValue<VT>>();
ShardIndex.IndexEntry entry = index.lookup(vertexId);
int curvid = entry.vert... |
d4a505f6-f8eb-4c15-9e51-d5bf65dfe6a1 | 4 | public static void setOutputParams(String failedUrlsFileName, String succedUrlsFileName,
String postsFileName, String postsParamsFileName, WriteToCsvDiscussionsFile writeToCsvDiscussionsFile) {
OutputParams.failedUrlsFileName = failedUrlsFileName;
OutputParams.succedUrlsFileName = succedUrlsFileName;
Output... |
eeba513a-4d51-4690-8cab-752ba8eccce9 | 3 | public void handleAnnounceResponse(Map<String, BEValue> answer) {
try {
if (answer != null && answer.containsKey("interval")) {
this.interval = answer.get("interval").getInt();
this.initial = false;
}
} catch (InvalidBEncodingException ibee) {
this.stop(true);
}
} |
3c562ab4-d67a-4263-85fe-28d9fe4e681e | 3 | public Rectangle2D.Float getBounds() {
if (bounds == null) {
// increase bounds as glyphs are detected.
for (GlyphText glyph : glyphs) {
if (bounds == null) {
bounds = new Rectangle2D.Float();
bounds.setRect(glyph.getBounds());
... |
f05970f0-0fe3-4d11-a291-b684edd9ae07 | 5 | private void createUser()
{
if(userType.equalsIgnoreCase("guest"))
user = new GuestUser();
else if(userType.equalsIgnoreCase("handicap"))
user = new HandicappedUser();
else
{
searchFiu(userID);
if(userType.equalsIgnoreCase("stud... |
d0534d53-6f83-4a73-b357-7659ce456121 | 8 | public void analyze(int minWalkId, int maxWalkId, int maxHops) throws IOException {
int numberOfWalks = maxWalkId - minWalkId + 1;
Walk[] paths = new Walk[numberOfWalks];
for(int i=0; i < paths.length; i++) {
paths[i] = new Walk(maxHops);
}
String[] walkFiles = direc... |
8f0f367c-3394-4932-acf2-54530179f06d | 2 | @Override
public boolean equals(Object o) {
LightRabin tmpLIFRTA = (LightRabin) o;
return tmpLIFRTA.states.equals(states) && tmpLIFRTA.initialState.equals(initialState) && tmpLIFRTA.liveStates.equals(liveStates);
} |
6906abbf-9896-4939-b2f4-e5d92b96e0da | 8 | public void render() {
System.out.println("RenderLoopBegin");
try {
g = bi.createGraphics();
g.setColor(background);
g.fillRect(0, 0, frameW, frameH);
/************/
for (int i = 0; i < tasks.size(); ) {
tmpTask = t... |
f7009a2f-e396-4e9a-ab8f-f03d313d37b0 | 9 | public void acquireLog() {
synchronized (fLogLengthTable) {
String ip = null;
String logKey = null;
int logLength = 0;
Integer lengthValue = null;
fLogAcquired = false;
MeetingProtocol.getInstance().logLen... |
140ab87d-cf57-4e0d-a2b8-73c5b9967177 | 6 | public static String getCoastlineCoding(Game game, Position center) {
char[] coding = {'0','0','0','0' };
int row = center.getRow(), col = center.getColumn();
Position p;
int offsetRow[] = { -1,0,+1,0 };
int offsetCol[] = { 0,+1,0,-1 };
// iterate over the four compas directions
// for... |
d2ca1c32-a7cb-4583-ac84-a60735caccf0 | 5 | private Image unmarshalImage(Node t, String baseDir) throws IOException
{
Image img = null;
String source = getAttributeValue(t, "source");
if (source != null) {
if (checkRoot(source)) {
source = makeUrl(source);
} else {
source = mak... |
8d75bb99-9915-4fb6-97a0-1a5faecade66 | 9 | static boolean parseArguments(String args[]) {
if (args.length < 2) {
System.out
.println("Syntax: java Snoop <server_name> <port_number> [optional args]");
System.out.println("\nPossible values for [optional args]:");
System.out
.println(" -snoopPort <local port number>");
System... |
0e36cc95-13d0-4cbf-858e-7be93bcf0747 | 3 | @Override
public int getVendidosSecao(Secao secao, Evento evento) {
try {
conn = ConnectionFactory.getConnection();
String sql = "SELECT COUNT(ingresso.id) AS vendidos " +
"FROM ingresso " +
"JOIN secao on ingresso.idsecao = s... |
4af55117-d5dd-4e1f-8834-6d6501d4ab04 | 4 | public static EventDetailInfo getEventDetail(int eventId)
throws HibernateException {
EventDetailInfo eventDetail = null;
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
try {
// Begin unit of work
session.beginTransaction();
// get the event
EventInfo eventInfo = getEvent... |
986ec84a-5684-4754-8f79-9fbe3ce0afda | 3 | @Override
public boolean onPointerMove(int mX, int mY, int mDX, int mDY) {
Iterator<IGameScreen> it = screens.iterator();
while(it.hasNext()) {
IGameScreen screen = it.next();
if(screen.onPointerMove(mX, mY, mDX, mDY)) {
return true;
... |
4fe05454-01d4-4db1-9067-17dd2eca68f7 | 3 | private boolean isEqual(char[] c, String s)
{
if (c.length != s.length()) return false;
for (int i = 0; i < c.length; i++)
if (Character.toLowerCase(s.charAt(i)) != Character.toLowerCase(c[i])) return false;
return true;
} |
5bde80bd-3aa5-478a-b114-42f255ade36c | 8 | public static void update(float delta) {
if (Gdx.input.isButtonPressed(Input.Buttons.LEFT)) {
if (abilityRequesting != null) {
abilityRequesting.fireAction(Camera.getRealWorldX(), Camera.getRealWorldY());
}
Gdx.input.setCursorCatched(true);
} else if (... |
5737a735-23b9-47ac-b8ff-c5905ee44f13 | 8 | private boolean r_un_accent() {
int v_3;
// (, line 215
// atleast, line 216
{
int v_1 = 1;
// atleast, line 216
replab0: while(true)
{
lab1: do {
if (!(out_groupin... |
49d7e6d3-9689-4220-a1dd-03126eeea625 | 1 | public boolean addSheet(String sheetname){
FileOutputStream fileOut;
try {
workbook.createSheet(sheetname);
fileOut = new FileOutputStream(path);
workbook.write(fileOut);
fileOut.close();
} catch (Exception e) {
e.printStackTrace();
return false;
}
return true;
} |
c8ecb908-1935-49f6-8957-23eed2c2147b | 9 | public void actionPerformed(ActionEvent e) {
Object o = e.getSource();
Debug.print("Action performed on: " + o);
if(o == okButton) {
// create a new Ferm object
Fermentable i = new Fermentable();
i.setName(txtName.getText());
try {
NumberFormat format = NumberFormat.getInstance(Local... |
3a1ceac2-339d-46a9-987d-621af752d8e1 | 8 | private static String initialise(Token currentToken,
int[][] expectedTokenSequences,
String[] tokenImage) {
String eol = System.getProperty("line.separator", "\n");
StringBuffer expected = new StringBuffer();
int maxSize = 0;
for (int i = 0; i < expe... |
2feebe8c-31fa-4117-9992-aca34405f478 | 5 | public ArrayList getSolutionsRunningOnSpecificPlatform(int tmpClassID, String tmpPlatformName)
{
ArrayList result = new ArrayList<Solution>();
int tmpCounter = 0;
ArrayList<Solution> allSolutionInstances = getInstances(tmpClassID);
if(allSolutionInstances != null)
{
... |
7309b984-ff80-4128-8b35-ce0e6673e1ab | 6 | public static boolean isVowel(String str, int index, int depth) throws java.io.IOException {
if (index < str.length() && index >= 0) {
char letter = str.charAt(index);
if (inList(VOWELS, letter) > -1) {
return true;
} else if (letter == 'y') {
... |
0a565c90-caad-493c-b483-544ce5a49dd6 | 7 | protected void sortIntoMap() {
outputMap = new TreeMap<Object, ArrayList<CalendarEvent>>();
int conflictNum = 1;
for (int i = 0; i < outputList.size(); i++) {
for (int j = 0; j < outputList.size(); j++) {
if (j > i) {
CalendarEvent event1 = outputList.get(i);
long start1 = event1.getmyStartTim... |
b45bc6a8-c08f-4595-9986-1ae311fdc295 | 9 | public static NoOpenStartTagException makeNoOpenStartTagException(
int nodeKind, String name, int hostLanguage, boolean parentIsDocument, boolean isSerializing) {
String message;
String errorCode;
if (parentIsDocument) {
if (isSerializing) {
String kind = ... |
cce6ae03-3531-48d8-a6ae-f62aa979e030 | 3 | public static void removeIfCaptured(Board board, int player, int x, int y) {
if (board.intersections[x][y] == player) {
List<Intersection> group = getGroup(board, x, y);
if (countLiberties(board, group) == 0) {
board.captures.addAll(group);
for (Intersection intersection : group) {
board.intersecti... |
cb14e19f-e51e-4ed8-9fed-06b6ecd5902f | 1 | static public Matricula instancia() {
if (UnicaInstancia == null) {
UnicaInstancia = new Matricula();
}
return UnicaInstancia;
} |
d05cad2f-21ea-4939-89a1-2f53fdfb7f29 | 7 | public void traverse(ASTVisitor visitor, ClassScope classScope) {
if (visitor.visit(this, classScope)) {
if (this.javadoc != null) {
this.javadoc.traverse(visitor, this.scope);
}
if (this.arguments != null) {
int argumentLength = this.arguments.length;
for (int i = 0; i < argumentLength; i++)
this.a... |
207ac50f-32aa-4e72-a3c1-7af8903cd21d | 0 | public MultipleCYKParseAction(GrammarEnvironment environment) {
super("Multiple CYK Parse", environment);
this.environment = environment;
this.frame = Universe.frameForEnvironment(environment);
} |
344e2563-4028-4cef-b263-5abb7cd5e9ea | 2 | @Override
public Connection crearConexion() {
try {
InitialContext initialContext = new InitialContext();
DataSource dataSource = (DataSource) initialContext.lookup("java:comp/env/jdbc/ausiasyield");
Connection connection = dataSource.getConnection();
return c... |
73c21a9b-b1c4-4804-95f6-9a04e55d82e0 | 9 | public void mouseClicked(int clickX, int clickY) {
clickY = (int)APPLET_HEIGHT - clickY;
Point pnt = new Point(clickX, clickY);
Point selection = new Point();
Card clickCard;
if (pnt.x>offsetX && pnt.x<maxX && pnt.y>offsetY && pnt.y<maxY)
{
selection.x = (pnt.x-offsetX)/cardSize;
selection.y = (pn... |
a1fa697e-9bf4-444d-b0bd-c1cb1a349773 | 4 | TreeNode next() {
TreeNode head = queue.poll();
if (head == null) {
if (!queue.isEmpty())
queue.offer(null);
return null;
}
if (head.left != null)
queue.offer(head.left);
if (head.right != nu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.