method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
ee4d1a49-eb7c-42a2-a590-f1f7ed95e9d1 | 4 | public static void renew(final LogGildedAltar script) {
script.options.status = "Renewing familiar";
if (script.ctx.summoning.summoned()) {
script.ctx.summoning.renew();
} else {
script.ctx.summoning.summon(script.options.beastOfBurden);
Condition.wait(new Callable<Boolean>() {
@Override
public ... |
cbb36cca-9ee1-41b0-a9d8-ec597aa8e9ad | 6 | @EventHandler
public void MagmaCubeNightVision(EntityDamageByEntityEvent event) {
Entity e = event.getEntity();
Entity damager = event.getDamager();
String world = e.getWorld().getName();
boolean dodged = false;
Random random = new Random();
double randomChance = plugin.getMagmaCubeConfig().getDouble("Magm... |
6b004765-ea45-4925-bbc1-bf960fcefcff | 0 | @Override
public Set<String> getUsers() throws DataLoadFailedException {
return getList("users", "name");
} |
b19d783b-f50e-4913-ba39-f6c3eeb0c273 | 3 | public void play() {
stop();
try {
bitStream.reset();
} catch (IOException e) {
// ignore if no mark
}
player = new Thread() {
public void run() {
try {
playStream(Thread.currentThread());
} catch (InternalException e) {
e.printStackTrace();
}
try {
bitStream... |
615056a4-e3e6-4b07-b9d8-ecad2774694c | 5 | public void convertGedcom(File file) {
try {
Gedcom gedcom = parser.parseGedcom(file);
OutputStream out = (gedcomOut != null ? new FileOutputStream(new File(gedcomOut, file.getName())) :
new ByteArrayOutputStream());
writer.write(gedcom, ... |
1e906931-7490-4980-a1dc-e8785b720852 | 4 | public boolean generate(World var1, Random var2, int var3, int var4, int var5) {
for(int var6 = 0; var6 < 10; ++var6) {
int var7 = var3 + var2.nextInt(8) - var2.nextInt(8);
int var8 = var4 + var2.nextInt(4) - var2.nextInt(4);
int var9 = var5 + var2.nextInt(8) - var2.nextInt(8);
... |
d1b1882b-66a3-4d55-a403-fedc10248428 | 8 | public void paintComponent(Graphics g){
if(histData == null || histData.length == 0)
{
return;
}
Graphics2D g2 = (Graphics2D)g;
RenderingHints rh = new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2.setRenderingHints(rh)... |
d985cad6-d6c1-438c-bced-92050df22ebe | 9 | static final void method3309(Animable animable, Node_Sub29[] node_sub29s) {
if (Class239.aBoolean2932) {
int i = animable.method819(node_sub29s, 1);
CacheNode_Sub18.aGraphicsToolkit9607.a(i, node_sub29s);
}
if (Class368.aPlaneArray4548 == Class320_Sub10.aPlaneArray8300) {
int i;
int i_1_;
if (anima... |
bcc321de-4ff1-4398-a3cb-a013faa6e8ac | 5 | public void load() throws TemplateException {
// set label
try {
label = "t" + Integer.toString(Integer.valueOf(id));
}
catch (Exception e) {
label = "t" + id;
}
String baseURL = "http://www.radreport.org/xml/xml.php?id=" + id;
URL url;
try ... |
06b9badf-d5ee-4962-b3c1-82f649c75ada | 9 | public static void writeXmlBean(XMLBean xmlBean) throws IOException {
if (null != xmlBean) {
File file = new File(xmlBean.getPath());
if (!file.exists()) {
// file.mkdirs();
file.getParentFile().mkdirs();
file.createNewFile();
}
if (file.canWrite()) {
Strin... |
68295e93-0abd-47d8-a44e-57262dcd309b | 0 | public int getProcessMode() {return processMode;} |
494b9d59-1917-4cb2-961f-c37145ef2656 | 2 | private void insertServers() throws SQLException {
for (String data : proxy.getServers().keySet()) {
if (!utils.serverExists(data)) {
utils.createServer(data);
cl.cLog("&2 Server " + data + " added to database!");
}
}
cl.cLog("&6 -" + proxy.getServers().values().size() + " Servers loaded");
... |
9dcc0c76-ab71-4c44-9cad-c057996e8062 | 1 | public String getMainClassName() throws IOException {
URL u = new URL("jar", "", url + "!/");
JarURLConnection uc = (JarURLConnection)u.openConnection();
Attributes attr = uc.getMainAttributes();
return attr != null ? attr.getValue(Attributes.Name.MAIN_CLASS) : null;
} |
1e337e44-e0a3-4d52-ac8d-acb985cc79e6 | 8 | public static JulianDate jauUt1utc(double ut11, double ut12, double dut1) throws JSOFAIllegalParameter, JSOFAInternalError
{
double utc1, utc2;
boolean big1;
int i;
double duts, u1, u2, d1, dats1, d2, fd, dats2, ddats, us1, us2, du;
/* UT1-UTC in seconds. */
... |
3c5d046e-8149-447b-861d-360627411841 | 3 | public static String camelCaseToUnderscore(String camelCase) {
StringBuilder builder = new StringBuilder();
char[] chars = camelCase.toCharArray();
for (int j = 0; j < chars.length; j++) {
if (Character.isUpperCase(chars[j])) {
if (j != 0) {
builder.append('_');
}
builder.append(Character.toLo... |
55922462-afd6-4c7b-8d79-229a0a3764b3 | 8 | private static void liftBreakLabels(Statement stat) {
for (Statement st : stat.getStats()) {
liftBreakLabels(st);
}
while (true) {
boolean found = false;
for (StatEdge edge : stat.getLabelEdges()) {
if (edge.explicit && edge.labeled && edge.getType() == StatEdge.TYPE_BREAK) {
... |
4101eded-c02a-4532-af9f-0f8bf252bafe | 8 | void onReceiveFromRemote(final MuxClientRemote remote, final MuxPacket msg) { // Remote is MUX
if (msg.syn()) { // New SubChannel
Log.info(this.getClass().getSimpleName() + "::onReceiveFromRemote " + msg);
openLocal(msg.getIdChannel(), msg.getIdEndPoint(), msg.getSourceAddress());
} else if (msg.fin()) { ... |
8c11e41f-d8e3-4bdf-93f5-e93188ce6d29 | 2 | public static void createRandomPlanets(ResourceManager rm, TileMap t, int numPlanets){
int mapWidth = t.getWidth();
int mapHeight = t.getWidth();
Random r = new Random();
int tileFromEdge = 5;
for(int n = 0; n < numPlanets; n++){
int newX = r.nextInt((mapWidth-tileFromEdge)-tileFromEdg... |
9a0279f7-7e97-4a60-8488-bfdc6b7e9c6a | 1 | private void initialize() {
for (int i = 0; i < id.length; i++) {
id[i] = i;
siz[i] = 1;
}
} |
313fdfb5-08ae-44f9-a977-70bbcb6c5488 | 2 | public static void main(String[] args)
{
int i = 1, j = 1;
switch(i)
{
// case 0,1 : j = 1;
case 1 :j = -1; break;
case 2 : j = 2;
default : j = 0;
}
System.out.println("j=" + j);
System.out.println("------------------------");
System.out.println("value = " + switchlt(2));... |
addddc1e-475d-4e7f-b4eb-454bad9dcfd9 | 4 | public Shell()
{
env = new EnvironmentImpl();
defaultId = "User";
inReader = new InputStreamReader(System.in);
bufReader = new BufferedReader(inReader);
fileManager = new FileManager();
contentArchiveDir = new File(contentDirectoryPath);
if (!(contentArchiveD... |
7403eb85-5c4d-4efd-b466-92654ad574bb | 4 | public static String getPrettyString(String cmdLineArg) {
String result = null;
if (cmdLineArg == null || cmdLineArg.isEmpty()) {
return result;
}
String rawCmdLine = cmdLineArg.trim();
if (rawCmdLine.startsWith("\"") && rawCmdLine.endsWith("\"")) {
resu... |
20487846-300e-4e33-af6c-d20417c4c56b | 8 | public void actionPerformed( ActionEvent e )
{
String username = textFieldId.getText();
String password = String.valueOf(textFieldPassword.getPassword()); //transfer char[] type to String
if(e.getSource() == btnShowReservationCard)
{
cardManager = (CardLayout) pnlCardDeck.getLayout();
card... |
266595c0-7e59-49ee-921f-27c6d00800ee | 3 | public synchronized void update(long elapsedTime) {
if (frames.size() > 1) {
animTime += elapsedTime;
if (animTime >= totalDuration) {
animTime = animTime % totalDuration;
currentFrame = 0;
}
while (animTime > getFrame(currentFrame).endTime) {
currentFrame++;
}
}
} |
c25803e8-8621-4892-92e3-ea04b6b147f5 | 1 | public JPanel getShutdownFrameMenu() {
if (!isInitialized()) {
IllegalStateException e = new IllegalStateException("Call init first!");
throw e;
}
return this.shutdFrame;
} |
72f1ab62-87b7-4d25-a2ed-5fe68dabc478 | 0 | protected void writePIDOut(double output) {
Robot.driveTrain.tankDrive(output, -output);
} |
d6ca01d4-74e8-47ba-91f0-870b558f2e38 | 2 | public Teaches(ClassGroup c, Teacher t) {
if (c == null || t == null)
throw new IllegalArgumentException();
this.teacher = t;
this.classTaught = c;
} |
bf106696-f3f6-4878-a42e-8798c3601985 | 3 | public Word get(Word word){
Node current = root;
while (current != null){
int d = current.data.compareTo(word);
if (d == 0)
return (Word) current.data;
else if (d > 0)
current = current.left;
else
current = current.right;
}
... |
be45b8e1-b8fa-4a2b-b2d1-9d9ef7d2d20d | 5 | private static void appendJSONPair(StringBuilder json, String key, String value) throws UnsupportedEncodingException {
boolean isValueNumeric = false;
try {
if (value.equals("0") || !value.endsWith("0")) {
Double.parseDouble(value);
isValueNumeric = true;
... |
5639e2cb-f8bb-48ce-b0e2-3b173fd481e8 | 8 | private static byte reverse(byte v) {
byte r = 0;
if ((v & 0x01) != 0)
r |= 0x80;
if ((v & 0x02) != 0)
r |= 0x40;
if ((v & 0x04) != 0)
r |= 0x20;
if ((v & 0x08) != 0)
r |= 0x10;
if ((v... |
a675134a-16f9-4cdf-9aa6-391004f70253 | 2 | private void btnBuscarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBuscarActionPerformed
String text = txtBuscar.getText().toString();
PrestamosCRUD pdao = new PrestamosCRUD(MyConnection.getConnection());
ArrayList<Prestamos> rows = new ArrayList<>();
Prestamos ... |
8cddb40f-72d3-4471-8a93-d8ea909bd79d | 1 | final public CycVariable metaVariable(boolean requireEOF) throws ParseException {
CycVariable val = null;
Token t = null;
t = jj_consume_token(META_VARIABLE);
val = new CycVariable(t.image);
eof(requireEOF);
{if (true) return val;}
throw new Error("Missing return statemen... |
9dd49a8c-1b96-4ee6-bada-441206868fef | 5 | public static void WeekEight() throws IOException
{
System.out.println("So what did Damon learn this week?");
boolean next = false;
BufferedReader r = new BufferedReader (new InputStreamReader(System.in));
while (!next)
{
System.out.println("Knowledge: " + DamonStats.Knowledge);
System.out.print... |
9352ba40-130a-469c-9610-1f21ab4bb8f8 | 6 | public KeyNodeStringPair dealWithPromote(String newKey, Node rightChild,
InternalNodeString node) {
// if new key is greater than the key in the last element of list
// insert child into the node
if (newKey.compareTo(node.getKeys().get(node.size() - 1)) > 0) {
node.getKeys().add(newKey);
node.getChildre... |
1153c207-9d9e-4ae4-9c2b-389f3b403896 | 1 | public GameScreen(JFrame parent) {
this.parent = parent;
this.width = parent.getContentPane().getWidth();
this.height = parent.getContentPane().getHeight();
super.setSize(width, height);
this.width -= 10;
super.setBackground(Color.BLACK);
keys = new boolean[256];
... |
aafa2195-c8cb-4e7b-8009-a6de6439aefa | 8 | public static void main(String args[]) {
try {
t = PdfUtilities.chooseFolder();
// TODO: create a method which tests if the file is an
// ok-to-the-end-PDF to work with
if (t != null) {
ArrayList<File> files = PdfUtilities.getPaths(new File(t),
new ArrayList<File>());
if (files != null) {
... |
d80b1464-72dd-4475-af58-b482f905caeb | 3 | public void setAlive(boolean alive) {
aliveDirty = true;
lifeDirty = true;
if (this.alive == false && alive) {
this.setLife(1);
for (WeaponInfo wi : getWeaponsData()) {
wi.resetAmoAmount();
}
}
this.alive = alive;
} |
b6dd7b69-74cf-4639-93a4-f2acd8d9c338 | 3 | private boolean clickedOnHand(MouseEvent e) {
return e.getX() >= handXStart() && e.getX() <= handXEnd() && e.getY() >= handYStart() && e.getY() <= handYEnd();
} |
c462431c-4866-4535-ab58-5d46f25e670f | 1 | public static void main(String[] args) throws Exception
{
InputStreamReader is = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(is);
String str;
while(null !=(str = br.readLine()))
{
System.out.println(str);
}
} |
75899bd5-6a84-4b88-bd9b-90e57a2f3e96 | 3 | protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
try {
Library library = new Library();
if (request.getParameter("cardNumber") != null) {
request.getSession().setAttribute("patron",
library.getPatron(Integer.parseInt(
requ... |
1194c5a7-5960-441a-b358-bc62523262c6 | 2 | public ArrayList regresaCatalogo(String catalogo) {
String res = "";
ArrayList lista = new ArrayList();
try {
Class.forName(driver);
Connection con = DriverManager.getConnection(connectString, user, password);
PreparedStatement query = con.prepareStatement("se... |
deeec336-4324-44ec-a8a9-3d1d3b65731a | 6 | protected void createSubbands()
{
int i;
if (mode == Frame.SINGLE_CHANNEL)
for (i = 0; i < num_subbands; ++i)
subbands[i] = new SubbandLayer1(i);
else if (mode == Frame.JOINT_STEREO)
{
for (i = 0; i < header.intensity_stereo_bound(); ++i)
subbands[i] = new SubbandLayer1Stereo(... |
e4dd0716-a80c-4f5a-9ce3-5c908cc60245 | 7 | public static boolean setConsulta(Consulta consulta) {
Connection connect = connect();
if(connect != null){
try {
connect.setAutoCommit(false);
PreparedStatement statement = connect.prepareStatement("insert into consultas (paciente, detalhes, data_inicio, data_fim) values (?, ?, ?, ?)", Statement.RETURN_... |
152d5c6b-f7eb-450a-9a3a-b99b285f7c50 | 1 | public void insertBack(Node node) {
if (node.previous != null) {
node.unlink();
}
node.previous = head.previous;
node.next = head;
node.previous.next = node;
node.next.previous = node;
} |
d18641bd-e6bb-42ac-8355-09fa6b825268 | 2 | private void collectClosedParents(TreeRow row, Set<TreeContainerRow> parents) {
TreeContainerRow parent = row.getParent();
if (parent != null) {
if (!isOpen(parent)) {
parents.add(parent);
}
collectClosedParents(parent, parents);
}
} |
61358929-0702-43b7-811a-efc955f4dec4 | 4 | public void run() {
while (NATBox.RUNNING) {
/* Wait time */
try {
Thread.sleep(NATBox.REFRESH_TIME);
} catch (InterruptedException e) {
e.printStackTrace();
}
/* Reset counter for removed entries */
int removed_entries = 0;
/* Find and remove old entries */
for (String key : NAT... |
43216992-65b7-498f-9a33-1278490de78d | 2 | public GroupRequestBuilder setCount(Integer count) {
// TODO make via logger
if (count != null && count > 1000) {
System.out.println("WARN: Cannot be greater then 1000");
}
request.count = count;
return this;
} |
e9024ea3-22c9-4c8e-a909-ec63880b7eff | 3 | public int maxStreak(){
int max_streak = 1, cur_streak = 1;
for (int i=1; i<cards.length; i++){
if (cards[i] == cards[i-1]+1)
cur_streak++;
else{
if (cur_streak > max_streak)
max_streak = cur_streak;
cur_streak = 1;
}
}
return max_streak;
} |
be7936e3-7fad-4072-ad1d-349025f501a2 | 6 | public static int changePassword(String userid, String oldpassword, String newPassword){
PreparedStatement pst = null;
Connection conn=null;
boolean result = false;
try {
conn=ConnectionPool.getConnectionFromPool();
PreparedStatement pst2 =conn.prepareStatement("SELECT COUNT(*) FROM PERSON WHERE USER... |
f9166a7d-b957-4ce6-958a-512cd22c6879 | 3 | public double dameGananciaMedia(Nodo n) {
int ganancia = 0;
int num = 0;
for (Nodo ady : memoria.getAdjacents(n)) {
if (!ady.isEstimacion()) {
ganancia += ady.ganancia;
num++;
}
}
if (num != 0) {
return ganancia / num;
}
return 0;
} |
0aca4a87-fe0e-4903-ab4a-f2b3cca7f6b1 | 1 | protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
/**
* Servlet ottaa vastaan asiakkaan henkilö- sekä toimitustiedot.
* Tietoja voi muokata seuraavan sivun Muokkaa-linkin kautta,
* mikäli niihin lipsahti jokin virhe.
*/
// Onko se... |
efbaa59e-b261-4b69-87a0-add9d3edceaf | 9 | public Node simplify(Node n)
{
leafNodes.clear();
matches.clear();
n.clearMarks();
if(!q_simplify(n)) //if it can not be simplified with this DynamicFormula, return as it is
return n;
Node target = match_node; //get Node where the match is found
if( target.equals(n) ) //if matc... |
7c6ab351-4d66-42a8-bd46-31eaee1092c2 | 7 | public static Runnable launchAppropriateHandler(String[] args)
{
if (args == null || args.length == '0') {
System.err.println("Invalid Input");
return null;
}
try
{
if(args[0].toString().equalsIgnoreCase("PM") && args.length == 3) //Commands to start a Process Manag... |
3a96b891-c34e-470e-8587-1de9c75ceb19 | 4 | public static List<Peer> findRutgersPeers(List<Peer> peers)
{
List<Peer> rutgersPeers = Collections.synchronizedList(new ArrayList<Peer>());
for(Peer p : peers)
{
String pIP = p.getIP();
if(pIP.equals("128.6.171.131") && p.getPeerId().contains("-AZ5400-"))
{
rutgersPeers.add(p);
}
else if ... |
a5272a24-669f-4f8f-9209-daf63137d031 | 7 | @Override
public void attackFinished() {
if (this.currentFlashFrame == this.numOfFlashTextures - 1) {
this.frameNum = 0;
this.currentFlashFrame = -1;
this.isAttacking = false;
if (this.isCrouching) {
if (xProectionSign) {
ch... |
dd4010b4-724a-46ed-bf02-9530521047eb | 0 | public int[] getSubstitutions() {
return subs;
} |
2fc4fa96-00fa-47bc-85f4-489b2c977e3d | 2 | @Override
public void execute(CommandSender sender, String[] arg1) {
if (!CommandUtil.hasPermission(sender, PERMISSION_NODES)) {
sender.sendMessage(plugin.NO_PERMISSION);
return;
}
HashSet<String> list = plugin.getChatPlayer(sender.getName()).getIgnores();
String message = ChatColor.DARK_AQUA + "Ignor... |
27a13235-f24b-4762-b0bc-a43dd0eb8a7d | 2 | public static void main(String[] args) {
//Instantiate Scanner
Scanner scanner = new Scanner (System.in);
//Ask user how many students they want to enter. Use that response to instantiate an object array.
System.out.println("How many students would you like to enter?");
int num = scanner.nextInt();
//Instanti... |
984069d7-a261-44b7-ac4d-3f81f55fab57 | 7 | private static void setupVirtualServerAndToolkit() {
final int MAX = 30;
int i;
File target;
final String DISPLAY;
final Runtime runtime;
try {
/*
* This seems quite the kludge, but apparently this is the
* algorithm used by X itself... |
f5c0eeb3-ca4f-477c-914d-2f1922031bf4 | 6 | private FileBlock[] getFileAllocation(String DFSFileName, int no_of_blocks){
Logger.log("no of blocks:" + no_of_blocks);
Collections.sort(dataNodeList);
Logger.log("Nodes after sorting: ");
for(DataNodeInfo s: dataNodeList)
Logger.log(s.getId()+ " | Stores: " + s.getsizeOfStoredFiles() +" | FREE: "+ s.getFr... |
5221b41d-db5b-4770-be59-97a3104e9f79 | 8 | @Override
public void set(long i, Object o)
{
if (o == null) {
if (ptr != 0) {
objectLengths.setShort(i, (short) -1);
} else {
if (isConstant()) {
throw new IllegalAccessError("Constant arrays cannot be modified.");
... |
18035ef8-ac25-4ea3-b59d-180e9774cc55 | 9 | private void initDimensions() throws InvalidInput {
String[][] rows = CSVHelper.getTrimmedTable(dimensionsToTestCSV);
if (CSVHelper.isInputsEmpty(rows))
return;
if (!CSVHelper.isTableConsistent(rows) || rows[0].length != 3)
throw new WrongFileStructure("Rows are not consistent", INPUT_AREA);
for (int i=0;... |
ef2682cf-ce8a-4da8-94e9-e01f7911f8ae | 4 | @Override
public boolean update(Hotelier x)
{
Statement stm = null;
try
{
String req = "UPDATE hotelier SET \n" +
"email=\""+x.getEmail()+"\",\n" +
"motdepasse=\""+x.getMotDePasse()+"\",\n" +
"siteweb=\... |
0c579fae-9c5c-4687-a03b-1cc18d74fc4e | 3 | @Override
public void run() {
cpu.start();
dispositivo.start();
if (cpu != null){
while(simulacion){
numTicks++; /* Paso del tiempo */
/* Notificacion del paso del tiempo */
cpu.notifica();
dispositivo.notifica();
... |
d1782c43-3158-4dad-b1ea-a6cd9831d450 | 2 | @Override
public String toString() {
String entryString = "";//Arrays.toString(entries.toArray());
for (byte entry: entries){
entryString += ","+(char)entry;
}
return "" + (char) id + "(" + (entries.length==0?"":entryString.substring(1, entryString.length())) + ")";
} |
17d0ef54-8145-4797-be3f-d58ae806584d | 9 | public void transform(JavaClass javaClass) {
if (javaClass.className.equals("Heaper")) {
return;
}
boolean foundEmptyConstructor = false;
boolean foundRcvrConstructor = false;
for (Iterator iter = javaClass.methods.iterator(); iter.hasNext();) {
JavaMethod method = (JavaMethod) iter.next();
if (metho... |
40468ca6-6b6b-4ee4-9e09-1cf579a8187e | 4 | public void add(String sana) {
Node uusi = getChild(sana.charAt(0));
String loput = sana.substring(1);
if (uusi == null) {
uusi = new Node();
uusi.setName(sana.charAt(0));
if (juuri.isEmpty()) {
juuri.add(uusi);
} else {
... |
4435ddf5-915f-4075-9cbc-115431c8adba | 5 | public static void scheduleRecurringEvent( String method, Object target, long delay, Object... parameters )
{
Event event = new Event();
try
{
if ( parameters != null )
{
Class< ? >[] paramClasses = new Class< ? >[ parameters.length ];
... |
9627adcd-a104-4d5a-b4f3-018fe3260a59 | 9 | private boolean jj_scan_token(int kind) {
if (jj_scanpos == jj_lastpos) {
jj_la--;
if (jj_scanpos.next == null) {
jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken();
} else {
jj_lastpos = jj_scanpos = jj_scanpos.next;
}
} else {
jj_scanpos = jj_... |
34f9765f-2450-4de5-9f6d-e224ed1eed15 | 9 | private boolean runTestCase(File dir) throws IOException {
File xmlDir = new File(dir, toDir);
File compactDir = new File(dir, COMPACT_DIR);
File outputDir = new File(dir, OUT_DIR);
File correct = new File(compactDir, CORRECT_SCHEMA_NAME + COMPACT_EXTENSION);
File incorrect = new File(compactDir, IN... |
2dfc1fa4-2daa-4fdb-b6b7-e6083c0409fe | 0 | @Override
public void mouseClicked(MouseEvent e) {} |
1d6baa70-55b0-40f6-800f-f882787f67fd | 8 | public static void main(String[] args) throws IOException {
BufferedReader keyboard = new BufferedReader(new InputStreamReader(System.in));
System.out.print("Enter a regexp: ");
String regexp = keyboard.readLine();
ConvertRegexpToNFA nfaBuilder = new ConvertRegexpToNFA(regexp);
FiniteAutomaton a = nfaBuilder... |
6e7e6fc0-ff8b-44e1-81f4-c40f04c3a004 | 5 | public Object nextEntity(char ampersand) throws JSONException {
StringBuffer sb = new StringBuffer();
for (;;) {
char c = next();
if (Character.isLetterOrDigit(c) || c == '#') {
sb.append(Character.toLowerCase(c));
} else if (c == ';') {
... |
8a5a270f-7645-4748-be45-fa64be044545 | 0 | public int getActionType() {
return actionType;
} |
056ee2a5-468b-4afa-8f7c-7f844fad335a | 1 | public static Configuration loadConfiguration() {
if (instance == null)
instance = new Configuration();
return instance;
} |
11c86fd4-0c9e-486b-81a5-5b5493567dbe | 2 | private void placeLightGrenades() {
while(grid.getLightGrenadeCoverage() < 5){
int randomX = (int) Math.round(Math.random() * grid.getHorLength());
int randomY = (int) Math.round(Math.random() * grid.getVerLength());
LightGrenade lg = new LightGrenade(new Position(randomX, randomY));
if (grid.canHaveA... |
591c8804-240c-4fca-a1e7-3b61593feb3b | 2 | public void testWithers() {
TimeOfDay test = new TimeOfDay(10, 20, 30, 40);
check(test.withHourOfDay(6), 6, 20, 30, 40);
check(test.withMinuteOfHour(6), 10, 6, 30, 40);
check(test.withSecondOfMinute(6), 10, 20, 6, 40);
check(test.withMillisOfSecond(6), 10, 20, 30, 6);
try... |
862dc41f-e9ec-470c-a031-d3182f6ea9aa | 4 | public void setRotation(Rotation rotation) {
switch(rotation) {
case BOTTOM:
this.rotation = 0;
break;
case LEFT:
this.rotation = 90;
break;
case TOP:
this.rotation = 180;
break;
case RIGHT:
this.rotation = 270;
break;
}
} |
1ccaa48f-13d9-4dc0-833a-5ff3e85ffc2a | 5 | private long removeRefOfferDataNym(long lIndex) {
//
// loop through the elements in the actual container, in order to find the one
// at lIndex. Once it is found, then loop through the reference list and remove
// the corresponding reference for that element.
//
OfferDataNym refActualElement = GetOfferDataNym(l... |
7f4654d1-1df7-41a6-b53b-eda1edaf74f0 | 3 | public static void main(String[] args) {
// TODO Auto-generated method stub
//�����v�f��*�����āA�t�B�{�i�b�`����̍ŏ��̕�̗v�f��\������
System.out.println("��ǃt�B�{�i�b�`����");
String[] stringImprovedFibonacci = new String[MAX_INDEX];
int lo = 1;
int hi = 1;
String mark;
stringImprovedFibonacc... |
b77e80e2-083a-4689-8d02-becf36560ecd | 3 | private boolean rightEdge(int particle, int cubeRoot) {
for(int i = 0; i < cubeRoot; i++){
for(int k = 1; k < cubeRoot; k++){
if(particle == i * cubeRoot * cubeRoot + cubeRoot - 1 + k * cubeRoot){
return true;
}
}
}
return false;
} |
ca12af39-9bf6-4ff4-bc47-f07e5095720c | 8 | public static void main(String[] args) throws Exception
{
HashSet<String> set = getMatchingSequences();
System.out.println(set);
System.out.println(set.size());
BufferedReader reader = new BufferedReader(new InputStreamReader(
new GZIPInputStream( new FileInputStream( ConfigReader.getVanderbiltDir() + ... |
284113c1-c329-4fb9-a82d-3cb228272e27 | 9 | public void searchAvailableCells(){
int numB1 = 1 ;
int numB2 = 1 ;
int numB3 = 1 ;
int numB4 = 1 ;
for (int i = 0; i < 28; i++) {
if (i < 7) {
if (this.testAvailabe(numB1 , 0, i)){
numB1++;
}else{
this.FilterAvailable(i, 7);
i = 7 ;
continue;
}
} else if (i < 14... |
7ea76414-6cd6-49ff-acfe-f580fac47b7f | 2 | public void run()
{
try
{
while (alreadyRunning)
{
Socket socket = incoming.accept();
log.debug(name + ": Accepting connection...");
new EventHandler(this, socket);
Thread.sleep(1500);
}
}
catch (Exception e)
{
log.error("Error in communication protocol! ", e);
}
} |
905f390b-3293-4139-a510-31a78625215e | 9 | private void handleNumericAttribute(Instances trainInstances)
throws Exception {
m_c45S = new C45Split(m_attIndex, 2, m_sumOfWeights, true);
m_c45S.buildClassifier(trainInstances);
if (m_c45S.numSubsets() == 0) {
return;
}
m_errors = 0;
Instances [] trainingSets = new Instances [m... |
23208353-63e4-4218-9b5b-64f38ef8220f | 8 | @Override
public ExecuteResult start() {
String currentActionName = startActionName;
Map<String, Action> actions = getActionMap();
while (true) {
// 如果没有提前预置标志结束的ActionName,则使用end。如果当前actionName等于标志结束的ActionName,则退出并认为引擎成功结束
if (StringUtils.equals(currentActionName, endActionName)) {
log.info("Meet act... |
be5dbd24-3a3f-4e6e-a2ef-9acbc56a3e75 | 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... |
3bb46b77-d304-47b8-a24f-7729b9c7a3d4 | 6 | private void setupBlock() throws IOException {
if (this.data == null) {
return;
}
final int[] cftab = this.data.cftab;
final int[] tt = this.data.initTT(this.last + 1);
final byte[] ll8 = this.data.ll8;
cftab[0] = 0;
System.arraycopy(this.data.unzftab... |
27773102-7aed-49ab-8119-b8bb0a8513c9 | 7 | public FeatureMap(File file,int idxOfName,int idxOfIndex,String sep,int offset){
BufferedReader br = null;
int idxError = 0;
int intFormatError =0;
try {
// 构造BufferedReader对象
br = new BufferedReader(new FileReader(file));
String line = null;
while ((line = br.readLine()) != null) {
String[] co... |
a1838ac9-205e-4111-8b5b-90243c859f90 | 3 | public String login(String userId, String password, int department) {
User user = validateUser(userId);
if (user == null) {
m_logger.debug("userId " + userId + " is not valid");
return ResponseMessages.USER_DOES_NOT_EXIST;
}
if (!password.equals(user.getPassword())) {
m_logger.debug("password for " + u... |
8fa95fdf-5b18-441e-b4c2-15c796a00699 | 9 | void CardTypes_Show (javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.http.HttpSession session, javax.servlet.jsp.JspWriter out, String sCardTypesErr, String sForm, String sAction, java.sql.Connection conn, java.sql.Statement stat) throws java.io.IOException ... |
7b8f53a6-7883-4088-8f13-b11ca832df1c | 4 | public void createNewKey(String username, boolean client,ObjectInputStream in, ObjectOutputStream out) {
try {
System.out.println("Initiating the key agreement protocol ...");
System.out.println("Generating a Diffie-Hellman KeyPair...");
KeyPairGenerator kpg = KeyPairGenerator.getInstance("DH");
kpg.initi... |
3f8c0904-2ba3-4852-b4e4-a00da46f2c14 | 2 | public static void style(Component comp) {
comp.setForeground(theme.getForeground());
comp.setBackground(theme.getBackground());
if (!(comp instanceof Container)) {
return;
}
Component[] comps = ((Container) comp).getComponents();
for (int i = 0; i < comps.length; i++) {
style(comps[i]);
}
} |
7ee427f5-4c7e-455c-be49-510def7e2f4b | 6 | * @param terminal Cell state that represents the terminal.
* @param source Boolean indicating if the terminal is the source or target.
*/
public mxConnectionConstraint getConnectionConstraint(mxCellState edge,
mxCellState terminal, boolean source)
{
mxPoint point = null;
Object x = edge.getStyle()
.get... |
732d93be-0d03-4a90-8674-41556f9e9ad4 | 4 | @Override
public boolean testPermission(CommandSender target) {
if (testPermissionSilent(target)) {
return true;
}
if (getPermissionMessage() == null) {
target.sendMessage(ChatColor.RED + "I'm sorry, but you do not have permission to perform this command. Ple... |
46b5b2ab-cd85-41b7-9afc-53f5e82595c6 | 3 | private int[][] initCellValues(int rows, int columns)
{
int[][] values = new int[rows][columns];
int totalPoints = 0;
for (int r = 0; r < rows; r++) {
for (int c = 0; c < columns; c++) {
int value = map.getCellValue(r, c);
values[r][c] = v... |
2a709906-e3dc-4232-99a5-58b28801493d | 9 | private void buildMenu() {
boolean exit = false;
int type = findType(id);
if (type == TYPE_PATIENT) {
System.out.println("Welcome patient " + id
+ " here is the list of your record(s):");
patientMenu(id, id);
} else if (type == TYPE_DOCTOR) {
System.out.println("Welcome doctor, what would you like... |
61f3954c-45ea-4fd5-a7d2-422562dd2ed6 | 4 | public static int getSailplaneVelocityUnit() throws ClassNotFoundException {
int velocityUnit = 0;
try{
//Class derbyClass = RMIClassLoader.loadClass("lib/", "derby.jar");
Class.forName(driverName);
Class.forName(clientDriverName);
}catch(java.lang.ClassNotFoun... |
4638469c-66f0-4606-8074-3e38b7dc71c4 | 3 | private void disconnect(int id, boolean status) {
ServerClient c = null;
for (int i = 0; i < clients.size(); i++)
if (clients.get(i).getID() == id) {
c = clients.get(i);
clients.remove(i);
break;
}
String message = "";
if (status) {
message = "Client " + c.name.trim() + " (" + c.getID() + "... |
2c828111-4732-440f-aa91-8b408b839b2c | 3 | public void financeManager(){
if (turretBuilder.size() != 0){
if (turretBuilder.get(turretsPlaced).buy()+turretsPlaced*5 > player.getGold()){
turretBuilder.remove(turretsPlaced);
}
else{
player.moneyLoss(turretBuilder.get(turretsPlaced).buy()+turretsPlaced*5);
int loop;
for(loop = 0; loop < 5... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.