method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
0f8af1bb-9f89-40bf-8e9e-79dd1e2ddcaa | 3 | @Override
public double getTip() {
double tip = 0.00; // always initialize local variables
switch(serviceQuality) {
case GOOD:
tip = bill * goodRate;
break;
case FAIR:
tip = bill * fairRate;
break;
c... |
7a32e061-8097-454c-8ed0-58b8c7be12ff | 7 | public void run()
{
try
{
//do we need the local or the stream from the net?
if(stream.getStatus() && stream.connectToRelayCB) {
options.add("http://127.0.0.1:"+stream.relayServerPortTF);
} else {
options.add(stream.address);
}
//collect the options
options.add(0,mplayerPat... |
3d2448fe-8b8e-499d-939c-284e344b163e | 1 | synchronized public static void addOrUpdateRequestAmount(String ip, String timestamp){
Requests req;
EntityManager manager = JPUtil.getInstance().getManager();
manager.getTransaction().begin();
try {
req = manager.createNamedQuery("Requests.findByIp", Requests.class).setPa... |
e15df36d-36de-4b0f-bcee-d3ec699d97e9 | 5 | public void heapify(int indeksi){
int vasen = left(indeksi);
int oikea = right(indeksi);
int pienin;
if(oikea <= heapsize){
if(keko[vasen] < keko[oikea]){
pienin = vasen;
}
else{
pienin = oikea;
}
... |
472033ab-84e0-487e-b983-be7ed03a8f80 | 8 | public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain)
throws IOException, ServletException {
if (response instanceof HttpServletResponse && request instanceof HttpServletRequest) {
HttpServletRequest httpRequest = (HttpServletRequest) request;
HttpServletR... |
e7014301-a717-414c-b822-0e753dee4807 | 5 | public static int countOccurrencesOf(String str, String sub) {
if (str == null || sub == null || str.length() == 0 || sub.length() == 0) {
return 0;
}
int count = 0;
int pos = 0;
int idx;
while ((idx = str.indexOf(sub, pos)) != -1) {
++count;
pos = idx + sub.length();
}
return count;
} |
90ef307b-fc9a-4454-8244-41ff49cd5fc0 | 3 | @RequestMapping(value = "/upload", method = RequestMethod.POST)
public String upload(ModelMap model, HttpServletRequest request, HttpServletResponse response) {
try {
List<FileItem> items = new ServletFileUpload(new DiskFileItemFactory()).parseRequest(request);
String fileName = "teaDataFile.txt";
for (File... |
1c1839d3-9469-44cb-9483-d871d9c563ca | 4 | public void leer() throws FileNotFoundException, IOException, ClassNotFoundException{
ObjectInputStream s=null;
FileInputStream in = null;
try {
in = new FileInputStream(this.file);
s = new ObjectInputStream(in);
try{
while(true){
... |
41a2fdb3-96cf-47c4-a96d-d043f2899a2e | 1 | public synchronized void release(Connection conn) throws DataException {
try {
// be sure that this connection was committed (so it is at a fresh, new transaction)
conn.commit();
// first remove the connection from the used list
usedConnections.remove(conn);
// next add it back to th... |
663a70a1-6a8c-482f-8dc0-0739a345dcf4 | 5 | public static LinearFilter createF(int i, ColorChannel... channels) {
if (i < 1 || i > 4)
throw new IllegalArgumentException("N�o h� filtros para o valor de i=" + i);
if (i == 1)
return new LinearFilter(DoubleMatrix.createAverages(3, 3,
0, 1, 0,
... |
b8ab0468-c5cc-41e1-b2c4-9ff1f675810d | 4 | private void isCompetitive(){
int wrongWay = 0;
for(int i=1; i<this.nAnalyteConcns; i++){
if(this.responses[i-1]<this.responses[i])wrongWay++;
if(wrongWay>=this.nAnalyteConcns/2){
if(this.responses[this.nAnalyteConcns]>=this.responses[0]){
thro... |
1696ad71-3f3d-4956-bb71-aef12f183cd7 | 9 | public Queue<String> peonEliteXMLUnit (){
try {
path = new File(".").getCanonicalPath();
FileInputStream file =
new FileInputStream(new File(path + "/xml/papabicho.xml"));
DocumentBuilderFactory builderFactory =
DocumentBuilderFactory.newInstance();
... |
bcc37050-c8ab-47b3-baf6-49cf263880b2 | 0 | public CheckResultMessage check17(int day) {
return checkReport.check17(day);
} |
251a0ca0-136d-4703-ae8a-50be0217063b | 2 | static boolean isFieldInSuper(CtClass clazz, CtClass fclass, String fname) {
if (!clazz.subclassOf(fclass))
return false;
try {
CtField f = clazz.getField(fname);
return f.getDeclaringClass() == fclass;
}
catch (NotFoundException e) {}
return ... |
caa01d7d-876c-4029-8562-a6f302e1cca9 | 2 | public byte[] recieveMessage() {
byte[] responce = new byte[68];
for(int i=0;i<responce.length;i++)
responce[i] = 0;
try {
this.from_peer.readFully(responce);
} catch (IOException e) {
// http://docs.oracle.com/javase/tutorial/essential/io/datastreams.html
// We will do nothing with this! The EOF is... |
e64a2466-c6a9-404c-ab99-b1f0f11cbc7d | 7 | @Override
public boolean tick(Tickable ticking, int tickID)
{
if((unInvoked)&&(canBeUninvoked()))
return false;
if((canBeUninvoked())
&&(tickID==Tickable.TICKID_MOB)
&&(tickDown!=Integer.MAX_VALUE))
{
if(tickDown<0)
return !unInvoked;
if((--tickDown)<=0)
{
tickDown=-1;
unInvoke();
... |
d0e15c61-fb59-4944-9eb4-5666ac82a470 | 3 | public static void setPath() {
//Get username and OS
String os=System.getProperty("os.name");
String user=System.getProperty("user.name");
//Set path depending on OS
if (os.contains("Mac")) Main.path="/Users/"+user+"/Library/Application Support/Preproste Suplence/";
else... |
2fe7bd37-f620-4011-ace3-bdbb439f8678 | 5 | private void btnLearnCompleteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnLearnCompleteActionPerformed
ScienceTool.clearAll();
while (lstTypes.getSelectedIndex() < lstTypes.getModel().getSize() - 1) {
System.out.println("learning " + txtFile.getText());
... |
ced5297a-1d30-43e7-bbd8-61c8cfca15d5 | 7 | public void invalidateBlockReceiveRegion(int par1, int par2, int par3, int par4, int par5, int par6)
{
for (int var7 = 0; var7 < this.blocksToReceive.size(); ++var7)
{
WorldBlockPositionType var8 = (WorldBlockPositionType)this.blocksToReceive.get(var7);
if (var8.posX >= par1... |
941acb5d-c705-4b97-9a80-29af90587866 | 4 | private LinkedElement<E> findElement(int index) {
if (indexOK(index)) {
LinkedElement<E> elem = first;
int counter = 0;
// Choose a way to find
boolean wayAhead = (total / 2 > index);
if (wayAhead) { // way forward
while (counter < index) {
elem = elem.getNext();
counter++;
}
} ... |
ea6729c9-a0da-4207-97e8-6b0add427f4e | 0 | private void printHelp() {
System.out.println("\nExample of using command line parameters:\n");
System.out.println(" run server instance");
System.out.println(" java -jar Test7bioz.jar -s");
System.out.println(" run client instance");
System.out.println(" java -jar Test7bioz.jar -c");
Sy... |
c69b2349-ec31-43fb-9746-8fba5acb6174 | 5 | private Coordinate calculateLowestFreeCoordinateDOWN(Coordinate c, Player p) {
Coordinate result = null;
Node nodeHoveringOver = Node.getNode(Coordinate.getCoordinate(c.getX(), c.getY()));
if(nodeHoveringOver.isActive() && nodeHoveringOver.getOwner().getOwner()==p){
//return null;
}
else{
result = c;
... |
1fed1bb4-0ccb-4780-85d3-c8f1bd7e2b67 | 6 | public Responder getHandler(Request request) {
if (!isAURIMatch(request) && isADirectoryFileMatch(getDirectoryFileNames(), request)) return new FileResponder(directory, request.getURI());
if (isAURIMatch(request) && isAValidMethod(request)) return getRoutesMap(request).get(request.getURI()).get(request.getHTTPM... |
9090c50b-0162-4757-8fdb-f87f9d09da5b | 0 | public void setVenue(String venue) {
this.venue = venue;
} |
1fe72cf2-031d-40ef-bbda-ca49835293b8 | 0 | public void setDeleted(boolean deleted) {
this.deleted = deleted;
} |
5784efec-f06a-4daf-b765-03572baa146d | 8 | @Override
public void actionPerformed(ActionEvent arg0) {
if(TrendFrame.gui_debug) System.out.println("Fetching data...");
// Split to a working thread, control progress bar
new Thread(){
@Override
public void run(){
JFileChooser jfc = new JFileChooser();
int selection = jfc.showOp... |
57181ad1-b8b1-406d-9af6-e5abf4dcb8e1 | 7 | public Object getValueAt(Object node, int column)
{
File file = getFile(node);
try
{
switch (column)
{
case 0:
return file.getName();
case 1:
return file.isFile() ? new Integer((int) file.length())
: ZERO;
case 2:
return file.isFile() ? "File" : "Directory";
case 3:
... |
f3939d27-8d11-4395-b264-91c82a00a377 | 4 | private void startUp() {
long sina_e_time = 0;
long sina_s_time = System.currentTimeMillis();
// long qq_e_time = 0;
// long qq_s_time = System.currentTimeMillis();
while (true) {
if (sina_s_time>=(sina_e_time+10000)) {
if (Container.getContainer().getProperty("sina.crawl")
.equals("true")) {
... |
ffd60a78-b71f-4ae1-b067-2bbbdce3312a | 1 | public void testIsEqual_TOD() {
TimeOfDay test1 = new TimeOfDay(10, 20, 30, 40);
TimeOfDay test1a = new TimeOfDay(10, 20, 30, 40);
assertEquals(true, test1.isEqual(test1a));
assertEquals(true, test1a.isEqual(test1));
assertEquals(true, test1.isEqual(test1));
assertEquals(... |
9b6c0343-f31d-487c-bac4-d1deb990bde5 | 4 | private void handleClassPlacement(MouseEvent arg0, UMLButton selected_button) {
last_connector_id = "";
last_clicked_class = null;
ArrayList<JComponent> associated_components = new ArrayList<JComponent>();
JLabel lab = new JLabel(selected_button.getText() + ": ");
ClassInstance c = new ClassInstance(... |
6c649748-abe8-4d9a-925e-b4b5820a32c0 | 1 | public synchronized void adicionar()
{
try
{
new LocalView(this);
}
catch (Exception e)
{
}
} |
52124a24-5df1-45a6-90c1-3428398a9256 | 6 | private PDFObject findInArray(PDFObject[] array, String key)
throws IOException {
int start = 0;
int end = array.length / 2;
while (end >= start && start >= 0 && end < array.length) {
// find the key at the midpoint
int pos = start + ((end - start) / 2);
... |
2213611b-bf6c-4441-888d-11444861876a | 2 | public static AbstractInanimateEntity getInEnt(int uniqueID){
if (uniqueID <= inent.size() && inent.get(uniqueID) != null){
return inent.get(uniqueID);
} else {
System.out.println("Tried to access an ID not bound to an InEnt");
System.out.println(String.valueOf(uniqueID));
return inent.get(0);
}
... |
fadf0445-31e0-4e1b-b0c5-85a6bc6e922f | 7 | @Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
if(CMLib.flags().hasAControlledFollower(mob, this))
{
mob.tell(L("You can only control one elemental."));
return false;
}
if(!super.invoke(mob,commands,givenTarget,auto,asLevel))
return ... |
f817c5ad-7a37-4a13-8b56-ea755118db71 | 0 | public PlayerListener(TotalPermissions p) {
plugin = p;
} |
ea3b9878-32bc-4b59-8861-6c4624c788bf | 2 | public boolean removeStore(Chest chest){
if(chest==null)
return false;
if(!isStore(chest))
return false;
stores.remove(chest);
saveStores();
return true;
} |
3b971769-d12a-4a25-8a95-0dc9de3f7d7a | 5 | public void transferBetweenOwnAccounts(double amount, BasicAccount source, BasicAccount destination){
if(source instanceof CustomerTransferSource){
if(source.getAccountOwner() == this){
if(destination.getAccountOwner() == this){
if(!(source == destination)){
if(amount > 0){
Transaction withdr... |
c896b6de-209e-44fe-bfdb-ea92f3273ade | 0 | @Override
public void actionPerformed(ActionEvent e) {
revertOutlinerDocument((OutlinerDocument) Outliner.documents.getMostRecentDocumentTouched());
} |
9e586d35-7365-4830-9539-e82a749c067c | 2 | public boolean hasNext() {
// is there more data to peruse
if (currentNode == null) {
return false;
}
if (currentNode.getData() != null) {
return true;
} else {
return false;
}
} |
ab1875ee-d430-4f4c-a36b-7a3d6be81a2b | 4 | public int nextSymbol() throws IOException {
final BZip2BitInputStream bitInputStream = this.bitInputStream;
// Move to next group selector if required
if (((++this.groupPosition % BZip2Constants.HUFFMAN_GROUP_RUN_LENGTH) == 0)) {
this.groupIndex++;
if (this.groupIndex == this.selectors.length) {
thro... |
e00bfbfc-5939-498a-9902-39cc8368613e | 9 | public void doStuff() {
try {
if (radioCreditSlip.isSelected()) {
if (radioSpecificDate.isSelected()) {
Date startDate = pickerSpecificDate.getDate();
cal.setTime(pickerSpecificDate.getDate());
cal.add(Calendar.DATE, 1);
... |
b75ed7a7-5829-4577-8861-4673bf665058 | 8 | public static boolean checkDungeonBounds(RoomReference reference,
Room[][] map, Room room) {
if (reference.getX() == 0 && room.hasWestDoor())
return false;
if (reference.getX() == map.length - 1 && room.hasEastDoor())
return false;
if (reference.getY() == 0 && room.hasSouthDoor())
return false;
if (... |
101d0536-aba7-41cd-a275-7e332e9c87c0 | 5 | @Override
public int readSampledBytes(int nBytes, byte[] samplesBuff) {
Header header = null;
try {
header = stream.readFrame();
} catch (IOException e) {
e.printStackTrace();
}
if (header == null) {
return 0;
}
... |
1f9fdff4-e5d6-4589-a938-44edf4e59e37 | 6 | private void readMenuFile(String encoding, final boolean reload) {
final FileConfiguration data = new YamlConfiguration();
try (BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(file), Charset.forName(encoding)))) {
String line;
StringBuilder sb = n... |
6bf5013d-3935-48f6-a52e-5eb877b47c67 | 2 | public int getColumnCount(String sheetName){
// check if sheet exists
if(!isSheetExist(sheetName))
return -1;
sheet = workbook.getSheet(sheetName);
row = sheet.getRow(0);
if(row==null)
return -1;
return row.getLastCellNum();
} |
6bf0d7d0-f7a9-4b5c-9096-56bbadfc5a61 | 0 | public SoundPlayer(InputStream source) {
this.source = source;
} |
1a219c5a-c9fc-42d5-bb61-ead99af53aa3 | 0 | @Basic
@Column(name = "PRP_USUARIO")
public String getPrpUsuario() {
return prpUsuario;
} |
d66be0b4-1b7c-4491-b928-34f9914cbd36 | 8 | @Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final BloomFilter<E> other = (BloomFilter<E>) obj;
if (this.expectedNumberOfFilterElements != other.exp... |
71119ddb-2a89-4e49-91b8-05e0d5add32f | 0 | @Override
protected void createForm() {
setSelectObject();
primitives.put(namePrimitives[1], new InformGraphPrimitive(x-430, y + 70, 500, 500, 120, 60, "Looker"));
} |
3846e8d6-67fa-4d26-a908-91f24c057aea | 9 | public String nextToken() throws JSONException {
char c;
char q;
StringBuilder sb = new StringBuilder();
do {
c = next();
} while (Character.isWhitespace(c));
if (c == '"' || c == '\'') {
q = c;
for (;;) {
c = next();
... |
991c3a4b-96d9-4cb1-b29c-c466b02773f8 | 7 | @Override
public Object getValueAt(int rowIndex, int columnIndex) {
Artist artist = artists.get(rowIndex);
switch(columnIndex){
case -1 : return artist.getId(); // imam id iz baze, ali ga ne prikazujem
case 0 : return artist.getFirstName();
case 1 : return art... |
d76c6c93-b96b-4361-bc31-a6ca9ef0e7c1 | 8 | public static void main(String args[])
{
BufferedReader stdin =
new BufferedReader(new InputStreamReader(System.in));
String command;
Class klasses[] = {Album.class, Artist.class,
Track.class, Composer.class};
HibernateC... |
3b27872a-72a8-4491-89ba-acf8d38769bb | 3 | public void mouseClicked(MouseEvent e) {
//System.out.println(ta.getText());
String[] response = Compiler.instance.compileAssembler(ta.getText());
System.out.println("---------- maschin ----------");
String code = "v2.0 raw\r\n";
int counter = 0;
for (String line : response) {
counter++;
code += line+... |
57f64b40-8277-431e-a394-070f0f7440a3 | 3 | public void accept(Visitor visitor) {
if (visitor.visit(this)) {
if (repo != null) {
repo.accept(visitor);
}
if (chan != null) {
chan.accept(visitor);
}
super.visitContainedObjects(visitor);
visitor.endVisit(this);
}
} |
b2db8d45-56b1-4998-8654-0f1ba80a0585 | 8 | public List<Cubie> getCubes(int index, Axis axis) {
if (VERBAL)
System.out.println("Retrieving cubes of axis " + axis.name() + " on face " + index);
if (index < 1 || index > getSize()) {
System.out.println("### ERROR : Cannot rotate RubiksCube face n°" + index + " on " + axis.name() + " axis => allowed ind... |
990efc3b-8d37-43db-9e9b-c885509606c6 | 8 | public ChessMove[] getMoves(int n) {
// get size of array
int size = 0;
if (n == 0 || Math.abs(n) > log.size()) {
size = log.size();
} else {
size = Math.abs(n);
}
ChessMove[] moves = new ChessMove[size];
if (n > 0 && Math.abs(n) < log.size()) {
for (int i = 0; i < n; i++) {
moves[i] = log.g... |
09dc9a6b-df40-40f1-927d-1259399cf7f9 | 2 | public static boolean login(Usuarios usu){
String sql = " SELECT * FROM usuarios WHERE usuario = '"+usu.getUsuario()+"' AND contrasena = '"+usu.getContraseña()+"' ";
if(!BD.getInstance().sqlSelect(sql)){
return false;
}
if(!BD.getInstance().sqlFetch()){
re... |
3efc44e6-cc99-4c2c-ae86-7edb2493c218 | 7 | public String processInput(String s) {
String reply;
// Do some input transformations first.
s = EString.translate(s, "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
"abcdefghijklmnopqrstuvwxyz");
s = EString.translate(s, "@#$%^&*()_-+=~`{[}]|:;<>\\\"",
... |
55499840-cc10-479c-8c4e-ab4bfec019bc | 1 | public static void removeProductionsForVariable(String variable,
Grammar grammar) {
GrammarChecker gc = new GrammarChecker();
Production[] productions = GrammarChecker.getProductionsWithVariable(
variable, grammar);
for (int k = 0; k < productions.length; k++) {
grammar.removeProduction(productions[k]);... |
4688fca7-341f-48f0-b29a-ac822e765b29 | 9 | public static void getInitData()
{
//here be parser!!!
tiles = new TileType[WIDTH][HEIGHT];
for (int i = 0; i < WIDTH; i++)
for (int j = 0; j < HEIGHT; j++)
tiles[i][j] = TileType.EMPTY;
labels = new String[WIDTH][HEIGHT];
for (int i = 0; i < WIDTH; i++)
for (int j = ... |
23ab0676-a17b-47c9-8489-d4e2ee190e9a | 1 | private void followPlayer() {
Player p = getWorld().getPlayer();
// Print.say(xtemp + " " + p.xtemp);
if (getx() < p.getx()) {
setLeft(false);
setRight(true);
} else {
setRight(false);
setLeft(true);
}
} |
1939b1c9-351a-4f48-a469-afefd59b0414 | 6 | public void testRandomExceptionsThreads() throws Throwable {
MockRAMDirectory dir = new MockRAMDirectory();
MockIndexWriter writer = new MockIndexWriter(dir, new WhitespaceAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
((ConcurrentMergeScheduler) writer.getMergeScheduler()).setSuppressExceptions()... |
ccf289a5-0618-4edd-b5d8-5aaa6befa448 | 6 | public int esMejorMano(Mano m) {
/*primero comparamos la jugada*/
int comparacion = this.jugada.compareTo(m.jugada);
/*si son iguales, pasamos a comprobar la carta de la jugada
Ej: en pareja de ases, el As está almacenado en cartasJugada[0]
en dobles parejas de As, Dieces el A... |
0a5981e9-4c34-490d-9adc-569643db6ded | 9 | public void compute(double[] data){
assert(data.length == input_nodes);
//Set initial net values
boolean first = true;
for (Node[] layer: layers){
for (int j=0; j<layer.length; j++){
Node temp = layer[j];
//Input node
if (first && j < data.length)
temp.net = data[j];
//Bias node
e... |
036426b2-5e05-4da4-8814-57187e04dca0 | 8 | public static void main(String[] argv)
{
if(argv.length < 1)
{
System.out.println("Usage: ");
System.out.println("irssi-log-parser "
+ "<irssi log file> [<options> <output>]");
return;
}
logFile = argv[0];
Parser p = new Parser(logFile, false);
long startTime = System.currentTimeMillis();
... |
af5649f2-c001-41b3-b6f1-818824b62792 | 0 | public int getX(){
return x;
} |
b5e1f7dc-f861-4608-8d41-4ccf9126534a | 0 | public void signalNeedToDisplayFunction() {
needToDisplayFunction = true;
} |
3df861b1-ab56-4854-9eaa-37f716efb264 | 6 | public static void checkArrParam(SessionRequestContent request, Criteria criteria, String reqName, String critName){
String[] arr = (String[]) request.getAllParameters(reqName);
Collection<Integer> set = new HashSet();
if (arr != null && arr.length > 0) {
for (String param : arr) {
... |
6c4f1d9f-70d6-49dd-903d-8a0262c6d69c | 9 | void wrapLines(int cx) throws Exception {
int lineLen = 0;
{
int len = 0;
CharSequence sb = pageData.roLines.getInLine(cy, 0, cx);
for (int i = 0; i < sb.length(); i++) {
len += (sb.charAt(i) > 255) ? 2 : 1;
}
lineLen = Math.max(10, len);
}
ui.message("wrapLine at " + lineLen);
i... |
d9f9bcb8-4db5-4082-8ba8-5c13974fcb6d | 1 | public double getTotalBalance()
{
double sum = 0;
for (double a : accounts)
sum += a;
return sum;
} |
b3652734-b5b2-4f5d-b211-f6be6fd3aea8 | 4 | void reHeapElement( heap q, double[] v, int length, int i )
{
int up, here;
here = i;
up = i / 2;
if ((up > 0) && (v[p[here]] < v[p[up]]))
{
/// we push the new value up the heap
while ((up > 0) && (v[p[here]] < v[p[up]]))
{
swap(q,up,here);
here = up;
up = here / 2;
... |
8f94c829-c29e-4fa3-b5ad-d7688c8473b0 | 5 | @Override
public List<AreaConhecimento> Buscar(AreaConhecimento obj) {
String sql = "select a from AreaConhecimento a";
String filtros = "";
if(obj != null){
if(obj.getId() != null){
filtros += "a.id = " + obj.getId();
}
i... |
966f6cc2-3485-4a4b-92bf-81bddf097568 | 9 | private ResultMessage handleResponse() throws IOException
{
DataInputStream input;
byte[] buffer;
MsgHeaderResponse_PI responseHeaderPI;
ProtocolToken pt = null;
RError_PI errMsg = null;
ProtocolToken bodyToken = null;
input = new DataInputStream(connection.g... |
d1c598fc-f69c-40a4-ab3e-5919a21ccc40 | 9 | @Override
public String runMacro(HTTPRequest httpReq, String parm, HTTPResponse httpResp)
{
final java.util.Map<String,String> parms=parseParms(parm);
final String last=httpReq.getUrlParameter("LEVEL");
if(parms.containsKey("RESET"))
{
if(last!=null)
httpReq.removeUrlParameter("LEVEL");
return "";
... |
b668c820-c2a5-4eaa-96f7-679e1a9b2641 | 6 | private boolean validarDatos() {
//unicamente valido el numero de cuenta
boolean valido = false;
Validaciones val = new Validaciones();
if (jTextField1.getText().equals("") || jTextField2.getText().equals("")){
mensajeError("Ingrese un valor para Desde.. Hasta.");
... |
db7536c9-f301-4722-a382-da57adaf6c79 | 1 | private HTMLPanel createGuessPanel(List<String> history) {
StringBuilder htmlBuilder = new StringBuilder();
htmlBuilder.append("<div id = 'guessHistoryPanel'>"
+ "<div class='panelTitle'>"+constants.Guess()+"</div>");
for (String h : history) {
htmlBuilder.append("<div class='GuessEntry'>"+h+"... |
475850bf-d45e-4c6d-8335-123decae94ac | 9 | @Override
public void doTask()
{
if (this.control)
{
if (Keyboard.getInstance().isKeyPressed(Keys.W) && !collisions.contains(Direction.TOP))
{
y -= speed;
}
if (Keyboard.getInstance().isKeyPressed(Keys.S) && !collisions.contains(Direction.BOTTOM))
{
y += speed;
}
if (Keyboard.... |
232e781e-35ec-406d-a7e7-6c1c69d41c33 | 9 | public Model getAnimatedModel(int frame1Id, int frame2Id, boolean active) {
Model model;
if (active)
model = getModel(modelTypeActive, modelIdActive);
else
model = getModel(modelTypeDefault, modelIdDefault);
if (model == null)
return null;
if (frame2Id == -1 && frame1Id == -1 && model.triangleColours... |
771cd25c-9aef-4de2-a6d5-7545ee5786d2 | 1 | public void visitLineNumber(final int line, final Label start) {
if (lineNumber == null) {
lineNumber = new ByteVector();
}
++lineNumberCount;
lineNumber.putShort(start.position);
lineNumber.putShort(line);
} |
a8ca55c6-dd81-4139-bf2f-85a5dbc20316 | 6 | private void method394(int i, int j, byte abyte0[], int k, int l, int i1,
int j1)
{
int k1 = j + l * DrawingArea.width;
int l1 = DrawingArea.width - k;
int i2 = 0;
int j2 = 0;
if(l < DrawingArea.topY)
{
int k2 = DrawingArea.topY - l;
i1 -= k2;
l = DrawingArea.topY;
j2 += k2 * k;
k1 += k2 * Drawin... |
8788da64-3f15-4d88-a472-133e023e4064 | 5 | private List<EntityVote> verifyAction(HashoutUserToDelegate hashoutUserToDelegate, long time) {
Pair<EntityUser> users = EntityUser.load(new Pair<Id>(voterId, delegateId));
if (!users.getFirst().getType().equals(UserType.VOTER)) {
throw new VoteUserException("Voter type " + users.getFirst().getType() + ":... |
77c442e4-083a-4f31-a070-b644af91e350 | 5 | public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setText("AST Explorer");
shell.setLayout(new FillLayout());
ASTExplorer astExplorer = new ASTExplorer(shell,SWT.NONE);
final Point minimum = shell.computeSize(SWT.DEFAULT,SWT.DEFAULT,true)... |
97ceb7aa-569d-4ee7-9c54-c1a9f23f800d | 3 | public void addData(ArrayList<String> cells) {
if (cells.size() != attribute.size())
throw new IllegalArgumentException("Wrong size on row, was "
+ cells.size() + " expected " + attribute.size());
String[] row = cells.toArray(new String[0]);
HashMap<String, String> newRow = new HashMap<String, String>();
... |
42000530-0ea6-4aed-a5b4-daa7703f3466 | 4 | @Override
public void consume(String str)
{
/* New message received from the message board --> pass it to the client*/
System.out.println(this.getClass().getSimpleName() +" Consume");
if (!wasClosed)
{
if (output == null)
{
try
... |
896f2ced-2d79-415c-b4bd-78c8cddcda3e | 5 | @Override
public boolean activate() {
return (Bank.isOpen()
&& (
Constants.FALADOR_BANK_AREA.contains(Players.getLocal())
|| Constants.EDGEVILLE_BANK_AREA.contains(Players.getLocal())
|| Constants.AL_KHARID_BANK_AREA.contains(Players.getLocal())
|| Constants.NEITIZNOT_BANK_AREA.contains(Players.getLoca... |
55bfb829-b3f1-41ab-99c5-4401ea6f6a46 | 2 | @Override
public void run() {
while (!Thread.currentThread().isInterrupted()) {
try {
Thread.sleep(this.interval);
}
catch (InterruptedException e) {
return;
}
notifyObservers();
}
} |
96951cd6-ef4f-4ddb-bcbe-cf340c316025 | 0 | public static void main(String[] args) {
// TODO code application logic here
} |
cd405314-fe76-4505-a93a-213594a1f352 | 2 | public List[] matches(List list, int centerList) {
centerList -= center;
try {
List sub = list.subList(centerList, centerList + tokens.size());
if (sub.equals(tokens))
return results;
} catch (IndexOutOfBoundsException e) {
}
return EMPTY_ARRAY;
} |
1e5390fc-ac4d-4ef7-b30a-4bc95ab44d6e | 5 | @SuppressWarnings("unchecked")
public static void main(String args[]) {
// if provided, first command line argument is class of evaluator
// default is FractalEvaluator
Repl<?, ?> repl;
if (args.length == 0) {
repl = new Repl<>(FractalEvaluator.class);
repl.lo... |
a29fcfff-cd03-4f95-b096-87ea52bb80d5 | 9 | @Override
public ResponseInfo sendToGroup(String groupId, MessageType messageType, String message) {
//验证
if (StringUtils.isEmpty(groupId)) {
throw new IllegalArgumentException("群发消息时,没有指定组的ID!");
}
if (StringUtils.isEmpty(message)) {
throw new IllegalArgument... |
c2eb2942-1fcc-48e3-8d78-50dc870ab5cd | 7 | @Test
public void testMultipleJobsWithMultipleClients() {
System.out.println("multipleJobsWithMultipleClients");
final Random rnd = new Random();
final Counter counter = new Counter();
final Set<AssignmentListener> computingClients = new HashSet<AssignmentListener>();
final... |
4aface9d-41b2-49df-9284-f151da942dbe | 8 | protected int getClosestTab(int x, int y) {
int min = 0;
int tc = Math.min(rects.length, tabPane.getTabCount());
int max = tc;
int tabPlacement = tabPane.getTabPlacement();
boolean useX = (tabPlacement == TOP || tabPlacement == BOTTOM);
int want = (useX) ? x : y;
... |
ca2642c7-74a3-4d08-8596-762bc3847e93 | 0 | @Override
public void attributesVisibilityChanged(OutlinerDocumentEvent e) {
calculateTextState(e.getOutlinerDocument());
} |
0f5d1b9b-c4b1-4d8b-9e29-f42c27a16b89 | 1 | void crawl(String[] args) throws IOException {
Validate.isTrue(args.length == 1, "usage: supply url to fetch");
String url = args[0];
print("Fetching %s...", url);
Document doc = Jsoup.connect(url).get();
// price-wrap post-right full
Elements num_oferta = doc.select("d... |
11fea764-b1a2-454b-90f1-c21815bbf60b | 5 | public Color getColor(int index) {
if (index == lastExchangeA || index == lastExchangeB) {
return Color.RED;
} else if (index == lastCompareA || index == lastCompareB) {
return Color.GREEN;
} else if (index == lastPlace) {
return Color.BLUE;
} else {
... |
2c34b15a-2ba2-4d18-8ab4-c1c634d2a73e | 6 | public void cargarListaComprobantes(){
try{
r_con.Connection();
ResultSet rs=r_con.Consultar("select * from tipo_comprobante");
DefaultListModel modelo = new DefaultListModel();
while(rs.next()){
Strin... |
04790725-ef09-4cee-a2bb-a8aadfa0e7ea | 4 | public static void main(String[] args) {
System.out.println("begin:" + (System.currentTimeMillis() / 1000));
final SynchronousQueue<String> sq = new SynchronousQueue<String>();
final Semaphore semaphore = new Semaphore(1);
for (int i = 0; i < 10; i++) {
new Thread(new Runnabl... |
4f6492c1-de19-4bd7-9318-12db873f0de3 | 6 | public int compareTo(Object obj) {
if ((obj == null) || (!(obj instanceof UUID))) {
throw new RuntimeException("Can't compare UUIDs to non-UUIDs: " + obj);
}
UUID val = (UUID)obj;
// The ordering is intentionally set up so that the UUIDs
// can simply be numerically compared as two numbers
... |
0dede594-9d89-4853-86ed-e2dd45c09183 | 9 | public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random)
{
int var4 = this.getComponentType();
switch (this.corridorDirection)
{
case 0:
StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par... |
69d5e2e4-5ea5-4a43-83bd-53b43dc1bf59 | 0 | public String getAffiliatId() {
return affiliateId;
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.