method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
fb15a2e4-e009-44bd-984e-d83f0b66ab2e | 3 | @Override
public void ejecutar(Stack<Valor> st, MemoriaDatos md, Cp cp)
throws Exception {
if (st.size() < 2)
throw new Exception("MENOR: faltan operandos");
Valor op1 = st.pop();
Valor op2 = st.pop();
if (op1 instanceof Entero && op2 instanceof Entero) {
st.push(new Booleano(((int) op2.getValor())... |
2e133092-e584-4b50-b0a0-76397fe263e9 | 8 | private static void runCommandLineInterface() {
boolean keepGoing = true;
while (keepGoing) {
try {
specialActionHandler();
} catch (ExitInputedException e) {
keepGoing = false;
sysout("Terminating...");
} catch (RestartInputedException e) {
sysout("Restarting...");
} catch (FinishInpute... |
3f1eb41e-0a9e-4f1d-bfe0-a6b8d3d543f3 | 2 | public void keyTyped(KeyEvent e){
if (e.getKeyChar() == 10){
startPressed = true;
}
if (e.getKeyChar() == 27){
System.exit(0);
}
} |
91f7f154-eda9-4840-b512-6d3614e71bc4 | 1 | @Override
public void terminate() {
super.terminate();
Actor actor = ai.getActor();
if (actor == null) {
return;
}
actor.setActionMode(Actor.ActionMode.NONE);
} |
ecfa44df-8d73-4a1a-a28a-c151b87364d5 | 6 | public static HashMap<String, HashMap<String, Integer>> getMap(String filePath) throws Exception
{
HashMap<String, HashMap<String, Integer>> map =
new HashMap<String, HashMap<String,Integer>>();
BufferedReader reader = filePath.toLowerCase().endsWith("gz") ?
new BufferedReader(new InputStreamReader(
... |
75aa3c69-0d90-4f9a-a557-fab125bd2ae9 | 5 | private void addJournal() {
String newName = name.getText().trim();
String abbreviation = abbr.getText().trim();
if(!newName.isEmpty() && abbreviation.isEmpty() && newName.length() > 2) {
abbreviation = newName.substring(0, 3).toUpperCase();
abbr.setText(abbreviation);
... |
fd26ce58-259c-4c2d-aa58-e677c6f90c5b | 8 | private void toolBoxCompilarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_toolBoxCompilarActionPerformed
TinyLexico tl;
TinySintaxis ts;
List listalex, listalexError;
Token tok;
DefaultMutableTreeNode node;
try {
textErrores.setText("");
... |
6dacfd0c-49e0-4b3f-9931-b586f526cf65 | 2 | @Override
public void keyPressed(KeyEvent e) {
switch (e.getKeyCode()) {
case KeyEvent.VK_LEFT:
korpa.moveLeft();
break;
case KeyEvent.VK_RIGHT:
korpa.moveRight();
break;
}
} |
b69a7a15-f74c-44a8-a91b-c0080f29682a | 0 | public RODashboardData getDashboardData() {
return dashboardData;
} |
74cafb6f-54dd-4d0f-87e6-650370711377 | 5 | public static void IDF()
{
for(int i =0;i<1714;i++)
{
Hashtable<String, Integer> WFQ_temp= new Hashtable<String, Integer>();
for(String word:preprocessed_list[i][1])
{
if(WFQ_temp.get(word)==null)
{
... |
d9ac8143-cc41-41dd-b63d-6f3779b6e367 | 5 | private static void quickSort(int[] list, int start, int end){
if(start < end){
//swap(list, (start+end)/2, end); //Move pivotPosition to last place
int pivotPosition = end; //Set pivotposition to last place in sublist
for(int i=start; i<=end; i++){
if(i >= pivotPosition){
//Break if at pivot or bey... |
c394198b-fc53-4e59-9a13-204a1ae78bf6 | 0 | public void setDumpfile(String directory,String filename){
dumpFile = new File(directory,filename+".mmap");
} |
52486c11-a48c-470e-97d4-eb922a6a11a8 | 1 | private int[] Decode (byte buffer[], int len, int shift) {
int out[];
int i, j;
out = new int[16];
for (i = j = 0; j < len; i++, j += 4) {
out[i] = ((int) (buffer[j + shift] & 0xff)) |
(((int) (buffer[j + 1 + shift] & 0xff)) << 8) |
(((int) (buffer[j + 2 + shift] & 0xff)) << 16) |
(((int)... |
70f3af5f-9cf2-4677-a546-316df8c8a278 | 2 | public static Boolean getBoolean(String key){
String str = props.getProperty(key);
if(MyStringUtil.isBlank(str)){
return false;
}
return Integer.valueOf(str.trim()) > 0 ? true : false;
} |
71becdc4-c32d-41f1-80e0-636c030a2c92 | 7 | protected void event(MouseEvent paramMouseEvent)
{
String str1 = "";
if (this.VerboseEvents) {
if (paramMouseEvent.getID() == 501)
str1 = "P:";
else if (paramMouseEvent.getID() == 502)
str1 = "R:";
else if (paramMouseEvent.getID() == 504)
str1 = "I:";
else if (... |
105eadf3-48ca-409e-997a-2ccc3c9328a1 | 2 | public final void setHourlyRate(double hourlyRate) {
if(hourlyRate < 0 || hourlyRate > 500) {
throw new IllegalArgumentException();
}
this.hourlyRate = hourlyRate;
} |
9929a435-27d7-40fa-a7e5-c5ce7633a4b2 | 8 | public void move(){
super.move();
if(clock%60 == 0){
double ang = game.atan2(y-game.getPlayer().y, game.getPlayer().x-x);
shoot(ang);
}
// only attempt to stay in screen if not near boundaries
if(x >= 8 && x+8 <= game.viewWidth()){
if(y+32 >= game.viewHeight() && game.goingDown(angle) ||
y <= ... |
1bdf0a4f-ef91-4680-aafa-bc904299df5a | 5 | public void update()
{
if (upgraded)
{
initiateCloaking();
upgraded = false;
}
if (active) //If cloaking
{
forceCloakTimer++;
forceCloak = (forceCloakTimer >= 10);
cloakBlocks();
cloakedDuration += (MachineFactoryPlugin.CLOAKER_UPDATE_CYCLE / MachineFactoryPlugin.TICKS_PER_S... |
d5b80745-782b-483e-ab79-da6c7dc022f6 | 0 | public AddTrapStateController(FiniteStateAutomaton automaton,SelectionDrawer drawer, JLabel mainStep, JLabel detailStep,
JFrame frame)
{
this.automaton = automaton;
this.drawer = drawer;
this.mainStep = mainStep;
this.detailStep = detailStep;
this.frame = frame;
currentStep=CREATE_SINGLE_TRAPSTATE;
n... |
6535d7cf-0d24-43bb-b659-7a91377fc0f1 | 1 | private String getNameFromFilePath() throws InvalidRpcDataException {
List<Download.File> files = getFiles();
if (!files.isEmpty()) {
int index = files.get(0).path.lastIndexOf("/");
return files.get(0).path.substring(index + 1);
} else {
return null;
... |
ae8c2d2a-70df-4227-a244-7389baadd8ce | 0 | public int foo1() {
return a;
} |
6b540fc2-cc9a-481f-ab07-61a29b34d19d | 2 | public static int length(String s) {
int i = 0;
try {
for (i = 0; i >= i; i++) {
s.charAt(i);
}
} catch (StringIndexOutOfBoundsException stringIndexOutOfBoundsException) {
}
return i;
} |
ccc40fe4-c4a2-4b01-a6d2-4cb2c5140f01 | 9 | public static String getTokenTextInternalFree(char[] buffer, int start, int end, int size, boolean upcaseP) {
if (start >= size) {
start = start - size;
}
else if (start < 0) {
start = size + start;
}
if (end > size) {
end = end - size;
}
else if (end < 0) {
... |
fafee1a5-b500-4a38-b97c-953cd7c245dc | 2 | public static boolean isEmpty(String str) {
if (str == null || str.trim().length() == 0) {
return true;
}
return false;
} |
3b3779ae-206b-49ce-abdc-d2845f30fbfc | 0 | public void setFesIdFuncionario(Integer fesIdFuncionario) {
this.fesIdFuncionario = fesIdFuncionario;
} |
dec0de12-0b0d-4a4e-9d5e-4f047e2785c3 | 2 | public void importarArquivoSite(String pArquivo) throws Exception
{
EtlLinkDao etlDao = new EtlLinkDao();
List<String> dados = Arrays.asList();
ArquivoTexto pr = new ArquivoTexto();
EtlLink etl = new EtlLink();
String[] array;
try
{
... |
626dbee9-95b8-4b3a-bc54-36050624dc61 | 0 | public void setHeight (int height) {
this.height = height;
setSize(width + 12, height + 102);
canvas.setSize(width,height);
doLayout();
} |
a1688874-9b97-4718-96e3-6f61028299e2 | 4 | public static void main(String[] args){
int n = 1000;
long total = 0L;
int i = 1;
for(i = 0; i < n; i++)
{
if(i % (3 * 5) == 0) total += i;
else if(i % 5 == 0) total += i;
else if(i % 3 == 0) total += i;
}
System.out.println("Answer:" + total);
} |
1da6b943-22b6-4fae-8013-b6b6e93ad80d | 2 | @Test
public void testSaxReader(){
String xml = "/Users/kimgyupyo/study/project/workspace/ResourceManager/src/test/java/file.xml";
String queryValue = null;
try{
//Parser를 생성한다.
SAXParser saxParser = new SAXParser();
//ContentHandler를 생성한다.
DefaultHandler handler = new Default... |
cf6f2159-b08f-4275-84de-5dcc6ef7be57 | 2 | public Set<BankAccount> getAccountsSatisfying(Checker<BankAccount> checker) {
Set<BankAccount> result = new HashSet<>();
for (BankAccount account: accounts)
if (checker.check(account))
result.add(account);
return result;
} |
b74f03ba-d79f-4a92-a219-a82e40745795 | 9 | final int[][] method2778(int i, boolean bool) {
if (bool != true) {
method2778(6, true);
}
anInt10448++;
int[][] is = aClass348_7454.method3981(i, 3168);
if (aClass348_7454.aBoolean4300) {
int[][] is_5_ = this.method2777(-110, 0, i);
int[] is_6_ = is_5_[0];
int[] is_7_ = is_5_[1];
int[] is_8_ =... |
55890ed0-a042-41b3-97f5-0f2895e490ea | 4 | private void removeLeftistTree(LeftistTreeNode startingNode) {
if (this.root != null) {
LeftistTreeNode toBeRemoved = this.root;
LeftistTreeNode newRoot;
if (this.root.right == null) {
if (this.root.left == null) {
this.root = null;
... |
c978fffc-f2b1-4262-89dd-e062a335e181 | 2 | public void visitVarExpr(final VarExpr expr) {
if (expr instanceof LocalExpr) {
visitLocalExpr((LocalExpr) expr);
}
if (expr instanceof StackExpr) {
visitStackExpr((StackExpr) expr);
}
} |
d35728ae-40aa-4341-b3f6-9d336a3419d6 | 1 | public void changePassword(String username, String password) throws UserExistsException {
User user = getUserByUsername(username);
user.setPassword(password);
try {
saveUser(user);
} catch (UserExistsException e) {
throw new UserExistsException("Tne new password e... |
c6225329-b5b6-4cd8-9817-c5064bfb6cce | 7 | @Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Time other = (Time) obj;
if (this.idActivity != other.idActivity) {
return false;
}
if (!Objects.equals(this.startTime, other.startTime)) {
return false... |
2eb4d678-9cc6-44ff-98ac-c4f1bdb79c48 | 1 | public static void main(String[] args) throws Exception {
FileOutputStream fos = new FileOutputStream("CharacterStreamTest.txt");
OutputStreamWriter osw = new OutputStreamWriter(fos);
BufferedWriter bos = new BufferedWriter(osw);
bos.write("www.baidu.com");
bos.write("\n");
bos.write("\n");
bo... |
ad9f1b10-eef4-4d02-ba03-75dbbaea0008 | 5 | public synchronized String sha(String input, String sugar) {
String result = null;
if (input != null) {
try {
if (digest == null) {
digest = MessageDigest.getInstance("SHA-256");
} else {
digest.reset();
}
if (sugar != null) {
digest.update(sugar.getBytes());
}
digest.updat... |
e8a0d421-c9d4-49cd-b5a7-4d0bf473d915 | 9 | static int findDtype(
String nm,
int nhTp)
throws NhException
{
int dtype = 0;
if (nhTp == TP_SBYTE) dtype = HdfGroup.DTYPE_SFIXED08;
else if (nhTp == TP_UBYTE) dtype = HdfGroup.DTYPE_UFIXED08;
else if (nhTp == TP_SHORT) dtype = HdfGroup.DTYPE_FIXED16;
else if (nhTp == TP_INT) dtype = HdfGroup.DTYPE_FIXED... |
9b2a101c-0479-48b5-8577-b79abffc9c51 | 0 | protected boolean isFinished() {
return true;
} |
7a6dc3ea-52eb-4b39-aff5-32d1bc13c865 | 5 | private Doors getDoor(int id, int x, int y, int z) {
for (Doors d : doors) {
if (d.doorId == id) {
if (d.doorX == x && d.doorY == y && d.doorZ == z) {
return d;
}
}
}
return null;
} |
b561afcb-5b84-47fc-b253-d8be0e636914 | 1 | public AnnotationVisitor visitAnnotation(
final String desc,
final boolean visible)
{
return new SAXAnnotationAdapter(getContentHandler(),
"annotation",
visible ? 1 : -1,
null,
desc);
} |
ff91d71e-f73e-4b21-8cf2-f19038f61574 | 8 | @Override
public void buildGrid()
{
clearGrid(null);
try
{
subMap=new Room[xsize][ysize];
final Exit ox=CMClass.getExit("Open");
for(int x=0;x<subMap.length;x++)
{
for(int y=0;y<subMap[x].length;y++)
{
final Room newRoom=getGridRoom(x,y);
if(newRoom!=null)
{
subMap[x][y]... |
9295cadd-e163-467f-84dd-92ecfc496d88 | 3 | public void exit()
{
core.WorldMap wmap = core.WorldMap.getLastInstance();
if (wmap != null) {
if (hero != null) {
wmap.getMapWidget().objectAt(hero.getY(), hero.getX()).setToolTip(castle.getTooltip() +"\n\n"+ hero.getTooltip());
} else {
core.Point pos = wmap.getPositionOfObject(castle);
wmap.ge... |
d9ec6aa1-7acd-449b-bece-3d5506470828 | 0 | public static MainController getController() {
return mainController;
} |
fdec0e25-f488-4c2a-a627-a3f579f9d5a7 | 0 | public String toCSV() {
return super.toCSV();
} |
d76c7709-ff75-44ad-9e79-fbc7fe3466ba | 0 | public void restart() {
start();
} |
d6218c88-d256-4df0-bbe2-ddee1e865c31 | 1 | @Override
public void update(LineEvent e) {
logger.info(managingSounds.size());
logger.info(e.getSource());
if (e.getType().equals(LineEvent.Type.STOP)) {
managingSounds.remove(e.getSource());
logger.info(managingSounds.size());
}
} |
b45a4a8e-2253-4782-b201-7f1240922e7a | 1 | private String calc(String input) {
//Person 3 put your implementation here
char[] letters = input.toCharArray();
char[] reversedChar = new char[letters.length];
for(int i = 0; i < letters.length; i++){
reversedChar[i] = letters[(letters.length - 1) - i];
}
String reversedStr = new String(re... |
45fb30e2-8bc4-4aee-841c-303c8bd15350 | 6 | public void run() {
while (true) {
try {
boolean sendMessage = true;
String input = this.in.readLine();
if (input == null) {
responder.removeUser(this);
responder.addMessageToQueue(name+" died peacefully.");
return;
}
if (input.split(" ")[0].equals("/n")) {
sendMessage = cha... |
1fc93756-db9a-40c0-9ef5-a3fadce90800 | 2 | public static PacketPlayInClientCommand getRespawnPacket() {
PacketPlayInClientCommand packet = new PacketPlayInClientCommand();
Field a = ReflectionUtil.getDeclaredField(packet.getClass(), "a");
a.setAccessible(true);
try {
a.set(packet, (int) 1);
} catch (IllegalAr... |
cadf2c1f-a98b-4874-b7d8-aed1e1e52004 | 7 | public String generateReply(RPCElement request) {
String pathFile = "";
String strResponse = "";
String messageId = "-1";
log.debug("Request: ");
log.debug(request.toXML());
if (request instanceof Hello) {
log.debug("Crafting a Hello response.");
pathFile = helloFile;
} else if (request instanceo... |
e5506a63-4a3f-44f3-8c3b-ac9a5d50a323 | 0 | public MinimizeTreeAction(FiniteStateAutomaton automaton,
Environment environment) {
super("Miniminize DFA", null);
this.automaton = automaton;
this.environment = environment;
/*
* putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke (KeyEvent.VK_R,
* MAIN_MENU_MASK+InputEvent.SHIFT_MASK));
*/
} |
3e9ef387-64d7-4fc8-ab01-9ae627bc4c22 | 3 | public static TreeNode transvert(TreeNode root,TreeNode result,TreeNode preRoot){
if(root == null) return null;
TreeNode resultNode=new TreeNode(0);
transvert(root.leftNode,result,preRoot);
if(null != root){
System.out.println(root.val);
System.out.println("PreRoot"+preRoot.val);
root.leftNode=preRoot;... |
485015d8-c18e-4c08-b074-088e74e9c392 | 0 | @Test
public void testIsReadyForGetTotal() throws Exception {
boolean isReady = this.terminal.isReadyForGetTotal();
assertTrue(!isReady);
} |
3561127e-b049-4263-ae53-3cc058b76b3a | 9 | private void updateTable(){
// FileTable tablemodel = new FileTable();
// myfiletable = new JTable(tablemodel);
files = new ArrayList<File>();
dirs = new ArrayList<File>();
int rowCount=tablemodel.getRowCount();
for (int i = rowCount - 1;i >= 0;i--) {
t... |
81cafa79-3be7-4675-ad8a-9038de7f8376 | 3 | @Override
public void run() {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
System.out.println("Counter One");
countDownLatch.countDown();
try {
Thread.sleep(1000);
} catch (InterruptedE... |
f590f2b7-6b23-43ae-9e93-143d7fc233ff | 6 | @Override
protected StringBuilder formatMessage(Object... messageObjects) {
StringBuilder sb = new StringBuilder();
for(Object message : messageObjects) {
ChatColor color = ChatColor.GRAY;
if(message instanceof Player) {
Team team = teamHandler.getTeam((Player)message);
color = team.getChatcolor();
... |
c35a2e41-afd3-462c-aeb8-411cde4bcc3a | 8 | private void computeTargetPath(String base, String modified, SinglePatch patch) {
base = base.substring("+++ ".length());
modified = modified.substring("--- ".length());
// first seen in mercurial diffs: base and modified paths are different: base starts with "a/" and modified starts with "b/"
... |
d6b36797-24d6-4d5f-b38a-bc1ef6c095ff | 0 | public void addVertex(City city){
cityMap.put(city.getID(), city);
} |
959a8133-9bcf-4d92-8f8e-e8306a0838be | 7 | @Test
public void testOccurs() {
System.out.println("occurs");
for (int year = 1900; year < 2010; year++) {
for (int month = 0; month < 12; month++) {
GregorianMonthly instance = this._first;
boolean expResult = true;
boolean result = insta... |
78192474-cae8-4cef-b06e-744abe622867 | 7 | public void addIndexesNoOptimize(Directory... dirs)
throws CorruptIndexException, IOException {
ensureOpen();
noDupDirs(dirs);
// Do not allow add docs or deletes while we are running:
docWriter.pauseAllThreads();
try {
if (infoStream != null)
message("flush at addIndexesNoOp... |
bb720d9c-f2e8-42e4-88de-303eb5e60f3a | 0 | protected void usePIDOutput(double output) {
_accelerator.set(OUTPUT_SCALE*output);
} |
9e6f8f34-2d71-406c-9986-ae27818a7369 | 1 | private static String getStringFromDocument(Document doc) {
try {
DOMSource domSource = new DOMSource(doc);
StringWriter writer = new StringWriter();
StreamResult result = new StreamResult(writer);
TransformerFactory tf = TransformerFactory.newInstance();
... |
3387b50e-4bd9-49d0-935c-292814bbe033 | 9 | public void pshu()
{
int t=IMMBYTE();
if(( t&0x80 )!=0) { PSHUWORD(m6809.pc); m6809_ICount[0] -= 2; }
if(( t&0x40 )!=0) { PSHUWORD(m6809.s); m6809_ICount[0] -= 2; }
if(( t&0x20 )!=0) { PSHUWORD(m6809.y); m6809_ICount[0] -= 2; }
if(( t&0x10 )!=0) { PSHUWORD(m6809.x); m6809_ICount[0] -= 2;... |
405b27d8-9756-4741-90ba-f76b0ef1eddd | 6 | public boolean checkMenuFuncionality(IMenu menu){
boolean checked = true;
// Check leaf node
if(!(menu.getName().equals(NAME))){
return false;
}
// Check profiles
Collection<String> profiles = menu.getProfiles();
Iterator<String> proIt = profiles.iterator();
String pro1 = p... |
d6965a58-9dd9-4d24-942c-c8a78299c9b9 | 1 | protected static boolean pointInTri( float[] v0, float[] u0, float[] u1, float[] u2, int i0, int i1 )
{
float a = u1[i1] - u0[i1];
float b = -( u1[i0] - u0[i0] );
float c = -a * u0[i0] - b * u0[i1];
float d0 = a * v0[i0] + b * v0[i1] + c;
a = u2[i1] - u1[i1];
b = -( u2[i0] - u1[i0] );
c = -a * u1[i0] - ... |
2828e8a6-3b11-4c21-98aa-c538ad91599c | 4 | public long startTimer() {
stop = false;
startTime = System.currentTimeMillis();
refresher = new Thread(new Runnable() {
public void run() {
long currentTime;
double remainingTime;
DecimalFormat df = new DecimalFormat(DigitalFormatPattern);
while (!stop) {
currentTime = System.currentTime... |
a7befd3b-fb2e-40b1-979e-4af5ff6703b2 | 9 | void deleteInstanceOfDeviceFromHash(TSDevice _soughtObj) {
int keys_not_in_hash = 0;
int keys_pointing_elsewhere = 0;
Hashtable<String, Object> keys_pointing_at = new Hashtable<String, Object>();
StringBuffer alias_names = new StringBuffer();
StringBuffer elsewhere_names = new StringBuffer();
StringBuffe... |
66631806-231c-4d23-a672-61aa33a6f753 | 3 | private void transferVirus(Person ball) {
Virus thisVirus = getVirus(), ballVirus = ball.getVirus();
if (thisVirus.equals(ballVirus)) {
Statistics.updateConnections(this, ball);
}
else {
if (Math.random() < (thisVirus.getContagiousness() / 2)) {
Statistics.transferVirus(ballVirus, thisVirus);
Stat... |
2f13ee12-6151-41c4-9bf1-76ac88b74c5e | 9 | public void buildTable(Renamer renameRule) {
if (!isReachable() && (Main.stripping & Main.STRIP_UNREACH) != 0)
return;
if (isPreserved()) {
if (GlobalOptions.verboseLevel > 4)
GlobalOptions.err.println(toString() + " is preserved");
} else {
Identifier rep = getRepresentative();
if (!rep.wasAlias... |
6b243c67-568d-4438-816c-cdcf502654a1 | 7 | public String [] getResultNames() {
int addm = (m_AdditionalMeasures != null)
? m_AdditionalMeasures.length
: 0;
int overall_length = RESULT_SIZE+addm;
overall_length += NUM_IR_STATISTICS;
overall_length += NUM_WEIGHTED_IR_STATISTICS;
overall_length += NUM_UNWEIGHTED_IR_STATISTICS;
... |
106fa4a1-c3d8-43c7-8ec5-85ed18fb55ac | 1 | public void launch() {
for (int i = 0; i < 7; i++) {
Person person = new Person(i);
this.addPerson(person);
int n = queueOne.getLength();
System.out.println("The queue at ASDA is " + n +
" People long.");
}
this.serve... |
8896dc19-2e0c-4163-a70f-cde2a3aa8e5e | 9 | public boolean init() {
this.manager = VirtualBoxManager.createInstance(null);
try {
this.manager.connect(this.webserviceUrl, username, password);
} catch (VBoxException e) {
LOGGER.error(
"Could not connect to virtual box manager, start webserver fist",
e);
return false;
}
this.virtualBox... |
c92d2207-2dca-40a2-880a-c6cc6d1709d0 | 5 | @MethodInformation(author="Alex", date="09.12.2012", description="Gives back a double that describes the maximum number of swords to plowshares of all BioTraktor")
protected double maxSwordsBio() {
MyIterator it = (MyIterator) traktoren.iterator();
double max = 0;
while(it.hasNext()) {
Traktor obj = (Tra... |
48ab9e14-018a-4368-828a-baff7f78186c | 6 | private ArrayList<State> returnPossibleStateList(State s) {
ArrayList<State> listOfStates = new ArrayList<State>();
for(int i = 0; i <= s.getRowValue(1); i++){
State newState = new State(i, s.getRowValue(2), s.getRowValue(3));
if(!newState.equals(s)){
listOfStates.add(newState);
}
}
for(int j = 0; ... |
3ece521d-c3ea-4b69-8265-4c7af97a9a2a | 3 | public void process(Client sockector){
ConcurrentLinkedQueue<HashMap<String,String>> msgs = sockector.getBizObjects();
if(msgs.isEmpty()){
return;
}
HashMap<String,String> msg = msgs.poll();
while(msg != null){
msg.put(Constants.FILED_IP, sockector.getIp());
Response rm = Service.getInstance().ser... |
5d8726ac-91bf-4410-8e6b-0b9ee11da0bf | 6 | @EventHandler
public void CreeperWeakness(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.getCreeperConfig().getDouble("Creeper.Wea... |
29691ed7-a5a9-47c5-9db6-887d66d5f55f | 4 | public static boolean isSubstring(String pattern, String str) {
int pattLength = pattern.length();
int pattLoc = 0;
char[] pattCharArr = pattern.toCharArray();
char pattCurr = pattCharArr[pattLoc];
int strLength = str.length();
int strLoc = 0;
char[] strCharArr = str.toCharArray();
char strCurr;
... |
8bedc4b3-586b-4d4c-ae15-69deb73cef73 | 3 | public static void sourceFolderDetails(String sourceFolder) {
System.runFinalization();
// if (!(DetailObject.getTOTAL_LINES_OF_CODE() > 20000000)) {
File sourceFile;
File main = new File(sourceFolder);
if (main.isFile()) {
SourceScanner.fileSelector(main);
} else {
String[] childDir = main.list();
... |
936d0ae7-b2f1-4b2d-8431-2d7999a32269 | 3 | private static void gestionarSaldo( Tienda tienda)
{
boolean salir;
Integer idCliente;
float precio;
do
{
System.out.print( "Introduce el Id del cliente: ");
idCliente = Integer.parseInt( scanner.nextLine());
try
{
System.out.println( "El saldo actual de este cliente es: " + tienda.getCuen... |
15df99fa-08b2-4287-9dd7-d757ce1fee8b | 1 | public void visit_if_icmple(final Instruction inst) {
if (longBranch) {
final Label tmp = method.newLabel();
addOpcode(Opcode.opc_if_icmpgt);
addBranch(tmp);
addOpcode(Opcode.opc_goto_w);
addLongBranch((Label) inst.operand());
addLabel(tmp);
} else {
addOpcode(Opcode.opc_if_icmple);
addBranc... |
90b1c74a-979e-4276-8c89-3fde4911c955 | 8 | @Override
public void spring(MOB target)
{
if(target.location()!=null)
{
if((!invoker().mayIFight(target))
||(isLocalExempt(target))
||(invoker().getGroupMembers(new HashSet<MOB>()).contains(target))
||(target==invoker())
||(doesSaveVsTraps(target)))
target.location().show(target,null,null,CMMs... |
8371c576-4c4e-496b-8743-42c709b57fca | 7 | public static String getTableNameBySql(Cg cg){
String tableName = null;
String tableSql = formartSql(cg.getTableSql());
if(tableSql!=null && tableSql.trim().length()>0){
// tableSql=tableSql.replaceAll("--.*\r\n"," ");
// String tempString=tableSql.replaceAll("\r\n"," ");
// Pattern p = Pattern.compile(r... |
31c0252c-cfb4-4551-ab37-8985a409d19f | 5 | protected void reloadChunk(final ChunkPosition pos) {
boolean end = false;
do {
try {
checkHeapStatus();
final File f;
synchronized(reload) {
f = reload.get(pos);
}
if(f == null) return;
final ChunkInFilePosition op;
synchronized(otherPos) ... |
a5616932-4219-471b-96e3-0ee3864b25b0 | 8 | @Override
public synchronized void gridletCancel(int gridletId, int userId) {
double currentTime = GridSim.clock();
SSGridlet sgl = null;
boolean updateProfile = false;
sgl = runningJobs.get(gridletId, userId);
if (sgl != null) {
if(sgl.getStatus() == Gridle... |
64beed8d-2d0c-48f2-8eee-b1116c699146 | 6 | @Override
public void mouseExited(MouseEvent e)
{
if (e.getSource() == sideButtons[0]) {
sideButtons[0].setText("Start local game");
} else if (e.getSource() == sideButtons[1]) {
sideButtons[1].setText("Start online game");
} else if (e.getSource() == sideButtons[2]) {
... |
a4d0249e-a825-4cf4-a7a6-31e4f0b5fb14 | 4 | public void centerToYourTeam() {
if (Teams.getTeamOfPlayer(game.getPlayer()) == Teams.BLUE) {
// top left
viewPort.x = 0;
viewPort.y = 0;
} else if (Teams.getTeamOfPlayer(game.getPlayer()) == Teams.GREEN) {
// top right
viewPort.x = map.getNumberOfCellsAcross()
* map.getCellDimensionsPx() - this... |
8420dcb5-8acb-4106-a0b3-c1373401dc8c | 4 | void removeDevice(Device device) {
DevicePanel dp = devicesMap.remove(device.getName());
if (dp != null) {
ClientConnectionManager.getInstance().removeClientChangedListener(
dp);
if ((panelList.size() > 1)
&& (panelList.indexOf(dp) == (panelList.size() - 1))) {
GridBagConstraints newLastConstrai... |
d826f495-6c94-4eec-8489-9d90329ef8f0 | 4 | public TooltipProperty(final GObject gObj, String name, String getter, String setter, String fxml, String defaultValue, GridPane gp, int row, Node settingsNode, HistoryManager hm) {
this.gObj = gObj;
gp.add(new Label(name + ":"), 0, row);
textField = new TextField();
//Grab value from ... |
cd86e8e8-873b-4af3-af7d-bb407871e36b | 4 | public static int[][] invertBody(int[][] matrix){
//preconditions
if(matrix == null)throw new IllegalArgumentException("matrix must not be null");
for(int i = 0; i < matrix.length; i++){
if(matrix.length != matrix[i].length)throw new IllegalArgumentException("matrix must be square!");
}
int[][] newMa... |
453a2fbf-b7d7-4bd0-b29e-dea8cc67a78d | 0 | public String toString() {
StringBuffer buffer = new StringBuffer();
buffer.append("[ItemVo:");
buffer.append(" id: ");
buffer.append(id);
buffer.append(" itemcode: ");
buffer.append(itemcode);
buffer.append(" name: ");
buffer.append(name);
buffer.... |
d3a538bd-2022-48fc-ab07-5c61078c5567 | 7 | public ArrayList<Customer> AllCustomersInFranchise( int FranID)
throws UnauthorizedUserException, BadConnectionException, DoubleEntryException
{
PreparedStatement statment = null;
ResultSet results = null;
ArrayList<Customer> BPArrayList = new ArrayList<Customer>();
... |
d523e23b-e67a-4bbd-8de3-6b8b9336a0d7 | 1 | private void initialize(Color color, boolean includeOpacity) {
this.cp = new ColorPicker(true, includeOpacity);
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (ClassNotFoundException
| InstantiationException
| Illega... |
a09d1ff8-ecae-402b-bd1e-187780603603 | 3 | private void createTable(ConnectionWrapper cw) throws SQLException
{
String command = "CREATE TABLE " + tableName + " (" + Defaults.ID_COL + " ";
if (adapter.isSupportsIdentity())
{
command += adapter.getIdentity();
}
else
{
command += adapter.getLongTypeKeyword();
}
command += " PRIMARY KEY, NAM... |
471f4195-5013-4685-bec3-13cf8003bfee | 1 | private void compute_pcm_samples8(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++)
{
final float[] dp = d16[i];
float pcm_sample;
pcm_sample = (float)(((vp[8 + ... |
aaa244bb-8449-4b0f-91c0-99c2089f96a7 | 2 | public void checkConsistent() {
super.checkConsistent();
StructuredBlock sb = outer;
while (sb != breaksBlock) {
if (sb == null)
throw new RuntimeException("Inconsistency");
sb = sb.outer;
}
} |
aa560cbd-3f2a-45cd-a6ca-584eaa6d1e90 | 0 | @Override
public Message toMessage(Session session) throws JMSException {
BlobMessage message = ((ActiveMQSession) session)
.createBlobMessage(image);
setMessageProperties(message);
message.setJMSType(TYPE);
return message;
} |
f1e39499-82db-45f3-86e8-2dc44ab8dc54 | 7 | private String convertProduct(Product product)
{
StringBuffer result = new StringBuffer();
//First the uriref for the subject
result.append(" ");
result.append(Product.getPrefixed(product.getNr(), product.getProducer()));
result.append("\n");
//rdf:type
result.append(createTriplePO(
RDF.prefixed(... |
df31babb-22e3-4289-9d3a-c3935d225131 | 7 | public int escribir(String nombre, String rutaArchivo) {
InputStream entrada = null;
PreparedStatement pst = null;
int ingresados = 0;
try {
File archivo;
String insert;
z.con.setAutoCommit(false);
insert = "Insert into docu... |
4a708c90-2840-44ca-a949-2ec17483fdaf | 9 | @Override
@Deprecated
public int writeBlockingBytesToChannel(final DataBuffers buffers) throws IOException
{
int written=0;
DataBuffers bufs=null;
synchronized(writeables)
{
writeables.addLast(buffers);
while(writeables.size()>0)
{
bufs=writeables.getFirst();
while(bufs.hasNext())
{
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.