method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
99263812-750f-4670-8ee2-70564789fc56 | 8 | public void actionPerformed(ActionEvent e) {
int val;
if (e.getSource() == helpItem){
timer.stop();// pause timer
JOptionPane.showMessageDialog(this, helpString, "Help",
JOptionPane.INFORMATION_MESSAGE);
timer.start();// pause timer
} else if (e.getSource() == aboutItem){
timer.stop();// pa... |
c00378f9-296e-4233-a515-c45d8bb63008 | 9 | static void drawsprites(osd_bitmap bitmap)
{
/* Draw the sprites. Note that it is important to draw them exactly in this */
/* order, to have the correct priorities (but they are still wrong sometimes.) */
if ((taitosj_video_enable & 0x80) != 0)
{
int offs;
for (offs = spriteram_size[0] - 4;offs >= 0... |
348d77d0-b582-4403-9241-cdbd0f721998 | 2 | private void endGraphics(Graphics graphics)
{
try
{
graphics = buffer.getDrawGraphics();
graphics.drawImage(bi, 0, 0, null);
if (!buffer.contentsLost())
{
buffer.show();
}
} finally
{
if (graphi... |
cb8699be-ea57-49a2-a9fa-01a98b225caa | 6 | public static void main(String[] args) throws ParseException {
// TODO Auto-generated method stub
// entries are assumed to be sorted
// TODO give option if the entry are not sorted?
int VERBOSE = Constants.LOG_NONE;
// Parse available options
Options opts = createOptions();
CommandLineParser parser... |
13ea335c-673e-40b4-86f7-1497a42774eb | 1 | @Override
public int hashCode() {
int hash = 0;
hash += (lenLenguaje != null ? lenLenguaje.hashCode() : 0);
return hash;
} |
e15a6fc7-77f0-4329-ab77-e82721fe86c6 | 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... |
59211379-d678-41e0-b0cc-cb77b758d46a | 2 | public static void main(String[] args) throws StaleProxyException {
Runtime rt = Runtime.instance();
Profile p = new ProfileImpl();
//AMS and DF Agents
ContainerController mainContainer = rt.createMainContainer(p);
// System.out.println("Registered Auctions:");
for (int i = 0; i < totalAuctionee... |
f3417ecc-0bd6-4e3e-bb22-a6a700facd7f | 0 | public EventBranch getEventBranch() {
return eventBranch;
} |
1d70ae00-1027-42c1-8385-5fc53fe1bb6e | 1 | public void analyzeIdentifier(Identifier ident) {
if (ident == null)
throw new NullPointerException();
toAnalyze.add(ident);
} |
124d99a1-69bc-4d2e-8b02-146487b10750 | 0 | public int getId() {
return id;
} |
d4fad3bb-51e1-4806-b428-f74bbcf3d9c6 | 7 | private boolean confirm() {
if (!checkAndSetUid(uidField.getText(), pageNumericBox, dialog))
return false;
pageNumericBox.setBorderType((String) borderComboBox.getSelectedItem());
pageNumericBox.setForeground(fontColorComboBox.getSelectedColor());
String fontType = (String) fontNameComboBox.getSelectedItem()... |
c35a0324-a813-4a53-a78b-957d7cf150b2 | 7 | public void generateUpdatedEntries()
{
_modifiedEntries.clear();
HashSet<String> newEntries = new HashSet<String>();
for (int i = 0; i < 10; i++)
{
OrderEntry orderEntry = null;
int action = _random.nextInt(100);
if (_orderEntries.size() == 0 |... |
075529dd-a9bf-444f-97a3-87b55f5c0bfb | 8 | private static int decode4to3(
byte[] source, int srcOffset,
byte[] destination, int destOffset, int options) {
// Lots of error checking and exception throwing
if (source == null) {
throw new NullPointerException("Source array was null.");
} // end if
if (destination == nul... |
9b7f4975-b0f9-4f70-98fd-0e7fa9ca42f1 | 6 | protected static int getDayNumber(int date) {
int dayNumber = 0;
int year = 0;
int month = 0;
int day = 0;
boolean isLeapYear = false;
int[] monthLengthStandard = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
//break date into pieces
day = date % 100;
month = (int) (date % 10000) / 100;
year ... |
fc4fb0d2-0598-4e08-a190-31e00c32009d | 4 | public int skip(int len) throws IllegalArgumentException, IOException
{
int bytesRead = 0;
int bytesToRead = 0;
int total = 0;
//check len
if(len < 0)
throw new IllegalArgumentException("len must be a positve value");
//skip by reading blocks of the size of the buffer
int blockSize... |
1131bac8-4c71-4390-8410-85d4b2b57c31 | 8 | public int Salvar(Pessoa obj){
PreparedStatement comando = null;
int id = 0;
try{
if(obj.getId() == 0){
comando = banco.getConexao()
.prepareStatement("INSERT INTO pessoas (nome,rg,cpf,"
+ "data_nascimento,ativo) VALUES (?... |
1344f348-1477-499c-aa63-80fe300cc9b5 | 3 | @Override
public boolean isValidForm() {
if (!isValidString(nameField.getText())){
JOptionPane.showMessageDialog(null, "Du måste ange ett namn!");
return false;
}
if (!isValidString(countryField.getText())){
JOptionPane.showMessageDialog(null, "Du måste ange ett land!");
return fal... |
3b75d331-faab-4f19-ae62-8dbdbe8ec060 | 6 | public List<Position> getValidMovements(Unit unit, Position position, Map<Position, List<Unit>> map) {
List<Position> validMovements = new ArrayList<Position>();
for (MoveSequence validMove : getValidMoves(unit)) {
MovementHelper movementHelper = new MovementHelper(unit.getBoardDirection(), positio... |
41589cf1-6025-487a-bee6-1adcf28cc92e | 6 | public void setNext(boolean left, boolean right, int i) {
if(i == -1 && right){
text = "right";
}
else if(i == -2 && left)
text = "left";
else if(i == 1)
text = "left";
else if(i == 2)
text = "right";
} |
c60703d5-d793-402f-8c45-53a7deccfee4 | 7 | @Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
LootItem lootItem = (LootItem) o;
if (id != lootItem.id)
return false;
if (lootInCombat != lootItem.lootInC... |
86898996-b9d9-4efb-9191-96dd107a79d5 | 9 | public JRadioButtonMenuItem getSelectedTimezone(){
if (simplifiedTimezone.isSelected()){
return simplifiedTimezone;
}else if (allTimezone.isSelected()){
return allTimezone;
}else if (africaTimezone.isSelected()){
return africaTimezone;
}else if (amer... |
f9aa8811-18cf-40fa-b2d6-23ad108065e8 | 6 | private static int[][] getNeighbours(ImageData imageData, int mx, int my, int x, int y, int w, int h) {
int[][] pixels = new int[h][w];
int iw = w/2;
int ih = h/2;
for (int i = -ih; i <= ih; i++) {
for (int j = -iw; j <= iw; j++) {
int xx = x + j;
xx = xx < 0 ? 0 : xx > mx ? mx : xx;
int yy = y +... |
42258f9e-d172-4687-96f5-5bf3900d857b | 7 | private MethodDoc getterForField(MethodDoc[] methods,
MethodDoc propertyMethod) {
final String propertyMethodName = propertyMethod.name();
final String fieldName =
propertyMethodName.substring(0,
propertyMet... |
2a59a3c3-668c-49a2-94b9-6c2f1fc2a768 | 5 | @Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
Position other = (Position) obj;
if (col != other... |
dd99f259-84a4-4eb4-aaf3-8e4946155b90 | 2 | public void print() {
System.out.println(genome);
// Show genes
for (Gene gene : genome.getGenes().sorted())
System.out.println(gene);
// Show other inervals
for (Marker marker : markers)
System.out.println(marker);
} |
0d491947-9df9-45c6-bb4c-70bf873f5217 | 2 | public TimeOutListItem(T item, List<T> old) {
if (item == null || old == null)
throw new IllegalArgumentException();
this.timeOut = new Timestamp(new Date().getTime() + item.getTimeOut());
this.item = item;
this.oldLocation = old;
} |
90b908cd-7eb2-407e-93ae-a8d0818f650b | 4 | public MainWindow() {
super();
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setTitle("Książka adresowa");
setSize(500, 400);
setLocationRelativeTo(getRootPane());
addWindowListener(this);
kaModel = new KAModel();
toolBar = new JToolBar();
add(toolBar, BorderLayout.PAGE_START);
addButton = ... |
2ffce829-bec6-40d3-a201-97ee99a534ea | 1 | @Override
public void selectionChanged(TreeSelectionEvent e) {
JoeTree tree = e.getTree();
Document doc = tree.getDocument();
if (doc == Outliner.documents.getMostRecentDocumentTouched()) {
calculateEnabledState(tree);
}
} |
d149a0c9-2f17-4732-8dee-6ea6d26649d1 | 6 | public void actionPerformed(final ActionEvent actionEvent) {
final Object source = actionEvent.getSource();
if (source.equals(addParser)) {
appendParser(availableParsers.getSelectedValue().toString());
} else if ((source.equals(openFileChooser)) || ((source.equals(selectedFileText)))... |
01e6eb2c-9f89-40c3-865c-07af9697f777 | 3 | public void runTest(String fileInputName, String fileOutputName, double minSupportLevel, double minConfidenceLevel,
ClientResource clientResource, GeneratorResource proxy) {
String supMsg = checkLevels(minSupportLevel);
String confMsg = checkLevels(minConfidenceLevel);
ErrorLogs errorLogs = new ErrorLogs();
... |
1b59e6a7-3a9b-4863-94c4-f4f381b5b590 | 0 | public int getHouseScore() {
return theHouse.getScore();
} |
37f9929e-d19f-4057-be26-dbb9dc51d023 | 7 | public static Cons idlGetStaticVariableDefinitions(Stella_Class renamed_Class) {
{ Cons staticattributedefs = Stella.NIL;
{ Slot slot = null;
Iterator iter000 = renamed_Class.classSlots();
while (iter000.nextP()) {
slot = ((Slot)(iter000.value));
if (Stella_Object.storage... |
960ce043-4bd7-4aea-b217-ba89f5130f44 | 5 | public static int makeNormal(int x, boolean isX, Map map){
if (x < 0)
return 0;
else if (isX && x > map.size[0])
return map.size[0];
else if (!isX && x > map.size[1])
return map.size[1];
else
return x;
} |
dfa91e97-9e07-4221-8071-5885b782a402 | 0 | public void setKind(int kind) {
this.kind = kind;
} |
55137455-10b5-4257-8b2a-6a06edec3110 | 0 | public String getColumnName(int col) {
return columnNames[col];
} |
296f1795-7dab-43a4-b8aa-11786019cca3 | 0 | public CommandListener getCommandListener()
{
return listener;
} |
acfd6a0f-db5b-499c-9478-2a0eaef1b7cd | 4 | public boolean save(GameConfiguration conf) {
boolean ostreamCreatedHere = false;
try {
if (ostream == null) {
ostream = new FileOutputStream(f);
ostreamCreatedHere = true;
}
JAXBContext context = JAXBContext
.newInstance(GameConfiguration.class);
Marshaller marsh = context.createMarshaller... |
d26d1932-80f8-4477-8242-b5598459fb2c | 9 | public String nextToken() throws JSONException {
char c;
char q;
StringBuffer sb = new StringBuffer();
do {
c = next();
} while (Character.isWhitespace(c));
if (c == '"' || c == '\'') {
q = c;
for (;;) {
c = next();
... |
32079cbf-7340-490b-9738-c9f3c6125fca | 9 | @Override
public void caisseStateChanged() {
final Article articleSelected = this.controler.getArticleSelected();
for (final ListDataListener l : this.listeners) {
l.contentsChanged(new ListDataEvent(this, ListDataEvent.CONTENTS_CHANGED, 0, this.listeners.size()));
}
this... |
0816888b-d695-474e-9085-54ae31b995e8 | 4 | public boolean switchRenderList(Collection<Renderable> newRenderables)
{
if(this.hasPendingRenderList()) {
return false;
}
else {
ArrayList<ArrayList<Renderable>> newList = new ArrayList<ArrayList<Renderable>>(batch.numberOfTextures());
for(int i = 0; i < batch.numberOfTextures(); i++)
newList.add(n... |
e3863c69-123e-4f02-b84e-9021ceb59311 | 5 | public void beamPlayer(Command command)
{
if(!command.hasSecondWord()) {
// if there is no second word, we don't know what to do
System.out.println("Wat doen?");
return;
}
if(command.getSecondWord().equals("ga"))
{
if(player.ge... |
d054309c-8495-4fff-b2e8-a7f5616aff84 | 1 | public void registerListener(String name, Listener listener) throws ListenerReregisterException {
if (!this.listeners.containsKey(name)) {
this.listeners.put(name, listener);
this.plugin.getServer().getPluginManager().registerEvents(listener, this.plugin);
} else {
th... |
c779bfab-48bc-49be-8b44-79f0a6b31a9e | 4 | public boolean PortExists(String portName) {
if(portName==null || portName.equals("")) return false;
int i;
for(i=0;i<portsDetected.length;++i) {
if(portName.equals(portsDetected[i])) {
return true;
}
}
return false;
} |
1a6b8768-87bf-4ae2-97de-684c575b14d8 | 5 | final void s(int i) {
if (((SoftwareToolkit) aHa_Sub1_5353).anInt7485 > 1) {
synchronized (this) {
if ((mask & 0x10000) == 65536 && (i & 0x10000) == 0)
method634(true);
mask = i;
}
} else {
if ((mask & 0x10000) == 65536 && (i & 0x10000) == 0)
method634(true);
mask = i;
}
} |
fb05abc3-9de6-48cb-bce5-f93a44317868 | 2 | public boolean bernoulli(double p) {
if (!(p >= 0.0 && p <= 1.0))
throw new IllegalArgumentException(
"Probability must be between 0.0 and 1.0");
return uniform() < p;
} |
db5ff4f7-e077-4528-823e-886a34454b27 | 9 | protected boolean save(File file) {
boolean result;
BufferedWriter writer;
int i;
int n;
Object cell;
writer = null;
try {
result = true;
writer = new BufferedWriter(new FileWriter(file));
// header
for (n = 0; n < m_Model.getColumnCount(); n++) {
if (n > ... |
5d377781-3c6b-4604-8194-df4968ca77a7 | 9 | private static Paoding implMake(final Properties p) {
// 将要返回的Paoding对象,它可能是新创建的,也可能使用paodingHolder中已有的Paoding对象
Paoding paoding;
// 作为本次返回的Paoding对象在paodingHolder中的key,使之后同样的key不会重复创建Paoding对象
final Object paodingKey;
// 如果该属性对象是通过PaodingMaker由文件读入的,则必然存在paoding.dic.properties.path属性
// 详细请参考loadProperties... |
98650192-f340-4713-914e-d6f055a48625 | 2 | public String getUIDByCarnumber(Statement statement,String carnumber)//根据车牌号获取用户ID
{
String result = null;
sql = "select UID from CarNumber where carnumber = '" + carnumber +"'";
try
{
ResultSet rs = statement.executeQuery(sql);
while (rs.next()) {
result = rs.getString("UID");
}
}
catch (SQ... |
936475a8-3a80-4c2f-916f-5c02b44f910c | 1 | public String toString ()
{
String str = "";
for (int index = 0; index < quantity; index++)
{
str = str + list[index] + " ";
}
return str;
} |
eaa2dec4-b382-4b4e-a49d-0f94530e6333 | 1 | private void sortLeaderboards() {
Arrays.sort(leaderboard, new Comparator<String[]>() {
@Override
public int compare(final String[] entry1, final String[] entry2) {
if (Integer.parseInt(entry1[1]) == Integer.parseInt(entry2[1])) {
return entry1[0].comp... |
d84dce6e-4c89-49a9-b300-ea435d757d9c | 7 | public void partialTransferOfOwnership(Person seller, Person buyer, int shares) throws BadSellerException {
// TODO Auto-generated method stub
CorpMember corpSeller = null, corpBuyer = null;
for (CorpMember member: members)
{
if (member.person == seller) corpSeller = member;
if (member.person == buyer) ... |
06b99d9c-0b29-4ef6-b57e-ed930a397cef | 9 | private static void recordMoves(final int player, final int pieceMovingType,
final long pieceMask, final long moves,
final long enemyAttacks, final long enemyPieces,
final long promotionMask,
final MoveList mlist, final State4 s, final FeatureSet f) {
if (pieceMask != 0 && moves !... |
c7ea9ad9-e69c-471a-8139-58372d4920cc | 0 | private void initView() {
this.setLayout(new BorderLayout());
tabbed = new JTabbedPane();
super.add(tabbed, BorderLayout.CENTER);
// So that when the user changes the view by clicking in the
// tabbed pane, this knows about it.
tabbed.addChangeListener(new ChangeListener() {
public void stateChanged(Chan... |
08de5871-bc35-4712-b14c-2ba8a9394959 | 6 | private Stack<Vertex<T>> getDfsSorting(Graph graph) {
Set<Vertex<T>> nonVisited = new HashSet<Vertex<T>>();
nonVisited.addAll(graph.getVertices());
Stack<Vertex<T>> stack = new Stack<Vertex<T>>();
//stack with vertices in order that corresponds to DFS run
while (nonVisited.siz... |
3c4186db-21d8-4ec0-83d3-c155dc3a5688 | 6 | public static int daysInMonth(int month, int year) {
switch(month) {
case 9: // September
case 4: // April
case 6: // June
case 11: // November
return 30;
case 2: // February
return isLeapYear(year) ? 29 : 28;
default:
return 31;
}
} |
b84d870e-d184-494c-b1e1-813f0bd79373 | 4 | public static void close(Connection conn, Statement statement, ResultSet result) {
try {
if (conn != null) {
conn.close();
}
if (statement != null) {
statement.close();
}
if (result != null) {
result.close();
}
} catch (Exception e) {
e.printStackTrace();
}
} |
998dede2-8182-44f7-a8ac-e11003366d83 | 0 | @Basic
@Column(name = "first_name")
public String getFirstName() {
return firstName;
} |
24245c6f-7566-407d-a347-fdd246658009 | 9 | @Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
ModuleNode that = (ModuleNode) o;
if (declaration != null ? !declaration.equals(that.declaration)
: that.declar... |
ac3a24e7-0e3e-4d06-bf3c-8d4b0e275a27 | 5 | private boolean isSyncMark(int headerString, int syncMode, int word) {
boolean sync = false;
if (syncMode == INITIAL_SYNC) {
sync = ((headerString & 0xFFE00000) == 0xFFE00000); // SZD: MPEG 2.5
} else {
sync = ((headerString & 0xFFF80C00) == word) && (((headerString & 0x0... |
04e4b40a-02c0-4073-a219-beb60f9718da | 6 | @Override
public void onServerUpdate(Server apples) {
if (swag++>80)
{
swag = 0;
for (PlayerOnline P:apples.playerList)
{
if (P.x>X-48&&P.x<X+48&&P.y>Y-48&&P.y<Y+48)
{
P.score+=10;
apples.send... |
43637ce8-b75b-4722-8edd-eed654f440f8 | 2 | public static List<Laureate> filterByPrize(List<Laureate> inputList, List<String> ListOfTerms) {
List<Laureate> outputList = new ArrayList<Laureate>();
// parse input, keep what matchs the terms.
for (Laureate Awinner : inputList) {
if (ListOfTerms.contains(Awinner.getPrize())) {
... |
01a943fe-d71c-4e61-8e3b-b5b10773237a | 5 | private void applyChoice(GameContainer container, int mouseX, int mouseY)
throws SlickException {
if (choice1.contains(mouseX, mouseY)) {
menuValidate.play(1, RLGame.SOUND_VOLUME);
game.enterState(RLGame.MAP_STATE,
new FadeOutTransition(Color.black), new FadeInTransition(
Color.black));
} else ... |
b11a7ccd-d4a8-4069-8006-7c6295d0a44f | 9 | public StringBuilder add(StringBuilder num1, StringBuilder num2) {
if (num1.length() == 0 && num2.length() > 0) {
return num2;
}
if (num2.length() == 0 && num1.length() > 0) {
return num1;
}
int sum = 0;
int carry = 0;
StringBuilder sb = new StringBuilder();
int i = 0;
for (i = 0; i < num1.lengt... |
f571c254-ce1a-4c71-8900-d430c8f23136 | 3 | public static void printMatrix(double[][] A){
if(A == null){
System.out.println("ERROR MATRIX IS EMPTY");
}
else{
for(int i = 0; i<A.length; i++){
for(int j = 0; j<A[0].length; j++){
System.out.print(A[i][j]+" ");
}
System.out.println();
}
}
} |
6b583f23-853b-4729-b4e5-33e8099fd350 | 1 | private double exptLessThan(double b) {
double sum=0,interval=(b-12)/1000,val=12;
for (int i = 0; i <1000; i++) {
sum+=phi(val, mu, sigma)*val*interval;
val+=interval;
}
return sum/probLessThan(b);
} |
16c1853c-7446-407d-a20b-2f27408eaca7 | 6 | @Override
protected void execute(CommandSender sender, String Command, List<String> list) {
this.init(sender);
MarketSign ms = this.getClicked().get(sender.getName());
if (ms == null) {
this.error("Du musst erst ein MarketSign auswählen!");
return;
}
if (!ms.getOwner().equals(player.getName()) && !pla... |
4c2c0ca6-9043-4650-bfc8-a872621393de | 5 | public static boolean parsable(String frac){
//fractions can't be shorter than 7 chars
if(frac.length() < 7)return false;
//find the index of the first slash that is not nested in parentheses
int divisionIndex = indexOfSlash(frac);
if(divisionIndex < 1)return false;
String top = frac.substring(0, divi... |
10cb083f-de16-4c66-bf9c-62244e06c0e1 | 3 | public static byte[] writeListToByteArray(List<? extends Writable> writableList) {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
DataOutput output = new DataOutputStream(outputStream);
try {
output.writeInt(writableList.size());
for (Writable writable : writableList) {
writable.write... |
2e3102e8-9503-4252-a2c5-4f219daf6f7f | 5 | public void prepend(int i, String str)
{
int len = str.length();
int newsize = this.size + len;
// If there's insufficient capacity, make a new array,
// leaving space for the string to be prepended.
if (newsize >= this.contents.length)
{
char[] oldcontents = this.contents;
... |
45ceeaa0-f5f9-45a6-9ed8-b2575450d7f3 | 4 | public void moveEast() throws InterruptedException{
if (isDoor[1] && !isLocked[1]){
currentX++;
currentRoom = rooms[currentY][currentX];
currentRoom.playerVisits();
setAdjacentRooms();
Game.printMessage("You walk through the eastern door\n");
} else if (!isDoor[1])
Game.printMessage("There is no d... |
e0b0a2ce-f314-4379-8e68-fda5938fa648 | 0 | public boolean connected(int p, int q) {
return getRoot(p) == getRoot(q);
} |
7a0bbff0-dbde-4e97-8d6a-433851d5b249 | 5 | public static List<String> convertTags(String tag) {
List<String> tags= new ArrayList<String>();
try{
if(!(tag.equals(""))){
try {
String string = convertDecimalNumbersToString(tag);
tag = string;
String[] args = string.split(";");
try{
for(int k = 0; k < args.length; k++){
... |
b2cdf127-bd91-4ff9-84f9-deaace7ecbc4 | 4 | public void closeConnection() {
if (stmt != null) {
try {
stmt.close();
} catch (Exception ignore) {
}
}
if (conn != null) {
try {
conn.close();
} catch (Exception ignore) {
}
}
} |
e130ec67-7421-49e5-8971-0fc281238165 | 8 | protected void checkEdge() {
if ((xmin < containerXMin || getXMax() > containerXMax) && run != 0) {
if (xmin < containerXMin) {
setXMin(containerXMin + 1);
} else {
setXMin(containerXMax - (getXSize()));
}
run = 0;
}
... |
79a43bf2-e094-405d-9f6d-16ab49a481ff | 3 | private static boolean uploadLocationData(AirNowData airDat){
String[][] data = airDat.getLocationJSON();
for (int i = 0; i < data[0].length; i++){
System.out.println("Uploading " + (i + 1) + " of " + data[0].length);
int count = 0;
while (!AirNowUploader.uploadDataSource(data[0][i],data[1][i],data[2]... |
15f61fcb-d65c-4331-8651-588a3db6e33c | 3 | private void processGridletStatus(Sim_event ev)
{
int gridletId = 0;
int userId = 0;
int status = -1;
try
{
// if a sender using gridletXXX() methods
int data[] = (int[]) ev.get_data();
gridletId = data[0];
userId = data[1];
... |
c79174e1-c265-438a-a8c4-71c48e1a2565 | 9 | public void draw(Graphics g){
//while we haven't received the room and user from the server do nothing
if(user.getRoom()==null)return;
//black background
g.drawImage(ImageLoader.getImage(smoke),0,0,WIDTH,HEIGHT,null);
//translate to center the room
g.translate((Display.WIDTH/2)-((Room.ROOM_WIDTH*TILE... |
b1b31f8d-acde-4fb6-9feb-91dc85f046e0 | 6 | public void jouer() {
//a modifier au moment de l'écriture de l'interface graphique
int numCarte = 0;
System.out.println(this.nom + " choisissez la carte à poser (nombre de 1 à " + mainJoueur.size() + ") : ");
InputStreamReader lecteur = new InputStreamReader(System.in);
BufferedReader entree = new Buffere... |
de2202de-04df-4bdb-972a-51e8aec26892 | 8 | public TomasuloGUI(){
super("Tomsulo's Simulation");
setLocation(50,75);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setMinimumSize( new Dimension( 700, 500 ) );
//setPreferredSize( new Dimension( 700, 600 ) );
Container cp = getContentPane();
//crea... |
d62a18f7-6cd8-4f17-8ca1-efad6340938c | 4 | private void findTour(SessionRequestContent request) throws ServletLogicException {
Criteria criteria = new Criteria();
criteria.addParam(DAO_ID_TOUR, request.getParameter(JSP_CURR_ID_TOUR));
User user = (User) request.getSessionAttribute(JSP_USER);
if (user != null) {
crite... |
ba2aa683-11d8-427c-b777-35a590253602 | 4 | public static int recursion(int n, int m, int step){
if (n == m){
return m + step - 1;
}
if (n%2 == 0 && (n/2 + step)%m == 0){
return n/2 + step;
}
else {
if (n<m) {
return -1;
} else {
return re... |
d7464c07-1700-49e8-a202-561026c2ede3 | 0 | public String setRealSub()
{
System.out.println("This is From Proxy1impl2 !");
return "Proxy1impl2";
} |
5e92ef93-7fd3-4262-854a-e43afcbac822 | 8 | static final Class258_Sub3_Sub1 method3583(boolean bool, byte[] is, int i,
int i_0_, OpenGlToolkit var_ha_Sub2,
int i_1_, int i_2_, int i_3_) {
try {
anInt4521++;
if (i_1_ > -17)
return null;
if (((OpenGlToolkit) var_ha_Sub2).aBoolean7793
|| Class192.method1436(-58, i_3_) && ... |
b086fe25-c410-4ef8-94e5-9fb76486d527 | 8 | private Record getRecord(String arg, ArgHolder<Object> ndescHolder) {
NameDesc ndesc;
for (int i = 0; i < matchList.size(); i++) {
Record rec = (Record) matchList.get(i);
for (ndesc = rec.nameList; ndesc != null; ndesc = ndesc.next) {
if (rec.convertCode != 'v' && ndesc.oneWord) {
... |
7485ddbb-b77f-491d-9f6b-dc78df383bd5 | 7 | public static String doubleToString(double d) {
if (Double.isInfinite(d) || Double.isNaN(d)) {
return "null";
}
// Shave off trailing zeros and decimal point, if possible.
String string = Double.toString(d);
if (string.indexOf('.') > 0 && string.indexOf('e') < 0
... |
9e534b81-b271-4e89-9af6-ad67b6b89fac | 9 | public Updater(Plugin plugin, int id, File file, UpdateType type, boolean announce) {
this.plugin = plugin;
this.type = type;
this.announce = announce;
this.file = file;
this.id = id;
this.updateFolder = plugin.getServer().getUpdateFolder();
final File pluginFile = plugin.getDataFolder().getParentFile();... |
b6bf38dd-32d2-4764-94c6-ec04d1abcc93 | 0 | @Before("execution(* com.laudandjolynn.springtest.springtechmanual.aop.IHello.hello(*))")
public void before3(JoinPoint joinPoint) throws Throwable {
Object[] args = joinPoint.getArgs();
log.debug("喂喂," + args[0].toString());
} |
51fe9f81-60fb-4093-a622-33ca9802a0f6 | 4 | public int addPoller(PollItem item_, IZLoopHandler handler, Object arg)
{
PollItem item = item_;
if (item.getRawSocket() == null && item.getSocket() == null)
return -1;
SPoller poller = new SPoller(item_, handler, arg);
pollers.add(poller);
dirty = true;
... |
694ec7ff-a625-41fa-8c1a-afb0be875823 | 1 | @AfterSuite
public void finaltest()
{
//Making Zip Folder of screenshots
TestUtil.zip(System.getProperty("user.dir")+"\\screenshots");
//Sending Mail to gmail
try {
Page.mail.sendMail(TestConfig.server,TestConfig.from,TestConfig.to,TestConfig.subject, TestConfig.messageBody,TestConfig.attachmentPath,... |
357ac0e5-a4bd-41d7-85fb-adae38355ae1 | 4 | public static void main(String[] args) {
int nHorses = 7;
int pause = 200;
if (args.length > 0) { // Optional argument
int n = new Integer(args[0]);
nHorses = n > 0 ? n : nHorses;
}
if (args.length > 1) { // Optional argument
int p = new Integer(args[1]);
pause = p > -1 ? p : pause;
}
new Hor... |
85739af2-0e1a-4b3f-af7e-be6a24f24585 | 7 | public static ArrayList<String> computeCtgCnt(List<Entry<Integer, String>> idinfos) {
ArrayList<String> dataCtg = new ArrayList<String>();
int ctgNum = 1;
String c_ctg;
String last_ctg = null;
for (int i = 0; i < idinfos.size(); i++) {
c_ctg = idinfos.get(i).getValue();
if(c_ctg == null) {
c_c... |
3aa5aa30-6869-481e-ab37-b5963dada804 | 0 | @Basic
@Column(name = "city")
public String getCity() {
return city;
} |
ffb23c31-a2cc-4584-bc31-a1108167aa05 | 9 | private void loadCurConf()
{
int iCnt = 0, iLen = 0;
// C U R R E N T S E T T I N G S ---------------------------------
EzimConf ecTmp = EzimConf.getInstance();
// multicast group IP
String strMcGroup = ecTmp.settings.getProperty
(
EzimConf.ezimMcGroup
);
this.jtfdMcGroup.setText(strMcGroup);
... |
0ee967ec-6c58-4362-b2ea-30df8fffb3a2 | 1 | @Override
public boolean equals(Object other) {
if (other instanceof HabrahabrArticle) {
HabrahabrArticle otherArticle = (HabrahabrArticle) other;
return url.equals(otherArticle.url);
} else {
return false;
}
} |
df6d4112-49dd-4596-ad37-dab7bc557d59 | 5 | public void visitTypeInsn(final int opcode, final String type) {
if (opcode == Opcodes.NEW) {
if (labels == null) {
Label l = new Label();
labels = new ArrayList(3);
labels.add(l);
if (mv != null) {
mv.visitLabel(l);
}
}
for (int i = 0; i < labels.size(); ++i) {
uninitializedType... |
2ca590ee-0062-47c3-b8ed-10a097a3fdf9 | 9 | public static void kd(String[] args) {
// default values
int portNumber = 1500;
String serverAddress = "localhost";
String userName = "Anonymous";
// depending of the number of arguments provided we fall through
switch(args.length) {
// > javac Client username portNumber serverAddr
case 3:
server... |
cad7b5d6-fd54-4211-8d52-69026050390e | 8 | static int findCharacterSequence(
final char[] text, final int offset, final int maxi,
final int[] locator, final char[] charSeq) {
if (charSeq == null || charSeq.length == 0) {
return offset;
}
final char c1 = charSeq[0];
char c;
int i = of... |
704c2569-1f45-4684-afdb-eed93447afa5 | 6 | private static Node merge(Node first, Node second){
Node h = null;
Node curr = h;
while(first!=null && second!=null){
Node chosen = null;
if(first.v <= second.v){
chosen=first;
first=first.next;
}else{
chosen=second;
second=second.next;
}
if(h==null){
h = chosen;
curr = h;
... |
d27ad22c-ab86-4729-950c-e33ebd4fa843 | 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... |
b5697115-c316-4aa9-905f-284468b729cb | 2 | public static void sendSpawns(Server s) throws SQLException {
ResultSet res =SQLManager.sqlQuery("SELECT * FROM BungeeSpawns WHERE server='"+s.getInfo().getName()+"' AND NOT (spawnname = 'NewPlayerSpawn' OR spawnname = 'ProxySpawn')");
while(res.next()){
ByteArrayOutputStream b = new ByteArrayOutputStream();
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.