text stringlengths 14 410k | label int32 0 9 |
|---|---|
@Override
public void run() {
int selected = 0;
ArrayList<MonitoredAS> monitoredASs = new ArrayList<MonitoredAS>(
allUpdates.keySet());
for (int i = start; i <= end; i++) {
MonitoredAS monitoredAS = monitoredASs.get(i - 1);
SingleASspikes spikes = allUpdates.get(monitoredAS);
if (spikes.getCurr... | 7 |
private void getGroups() {
String[] temp = manager.getGroupNames();
//build a new array to hold all our names plus the new value
if (temp != null) {
groupNames = new String[temp.length + 1];
groupNames[0] = "<New>";
for (int i = 0; i < temp.length; ++i) {
... | 5 |
@Override
public void redo() {
if (oldKey == null) {
if (newKey == null) {
// Do Nothing, since this should never happen.
} else {
node.setAttribute(newKey, newValue, newReadOnly);
}
} else {
if (newKey == null) {
node.removeAttribute(oldKey);
} else {
if (!oldKey.equals(newKey)) {
... | 4 |
@Override
public void execute(CommandSender sender, String[] args) {
if (args.length == 0) {
sender.sendMessage(new TextComponent(ChatColor.RED + "Usage: /irckick <user> [message ...]"));
return;
}
if (!IRC.sock.isConnected()) {
sender.sendMessage(new Text... | 7 |
public HDR64Buffer scale( HDR64Buffer in, int w, int h ) {
// TODO: Flip instead of ignoring negatives
int sx0, sx1, sy0, sy1;
if( w < 0 ) {
sx0 = in.width;
sx1 = -1;
w = -w;
} else {
sx0 = 0;
sx1 = in.width;
}
if( h < 0 ) {
sy0 = in.height;
sy1 = -1;
h = -h;
} else {
sy0 = 0... | 8 |
@Override
public void run() {
if (!EventQueue.isDispatchThread()) {
EventQueue.invokeLater(this);
} else {
super.run();
}
} | 1 |
public Quaternion SLerp(Quaternion dest, float lerpFactor, boolean shortest)
{
final float EPSILON = 1e3f;
float cos = this.Dot(dest);
Quaternion correctedDest = dest;
if(shortest && cos < 0)
{
cos = -cos;
correctedDest = new Quaternion(-dest.GetX(), -dest.GetY(), -dest.GetZ(), -dest.GetW());
}
... | 3 |
private static int scoreMatchingTokens(List<String> array1, List<String> array2)
{
HashMap<String, Integer> array1Counts = new HashMap<String, Integer>();
HashMap<String, Integer> array2Counts = new HashMap<String, Integer>();
for (String t : array1)
{
if (array1Counts.containsKey(t))
{
array1Counts... | 9 |
@SuppressWarnings("unchecked")
public void load() {
File configFile = plugin.getConfigFile("gates.yml");
int counter = 0;
try {
Yaml yaml = new Yaml();
Map<String, Object> gatesYaml = (Map<String, Object>) yaml.load(new FileInputStream(configFile));
if (gatesYaml == null) {
plugin.log.info(p... | 6 |
public void startLoad() {
new Thread(this).start();
} | 0 |
public static Task[] getTasksByUserMail(String userMail) {
XStream xstream = new XStream(new DomDriver());
Task[] allTasks = new Task[0];
try {
File file = new File((String) Server.prop.get("taskFilePath"));
allTasks = (Task[]) xstream.fromXML(file);
} catch (Exception e) {
}
List<Task> retList = ... | 3 |
public static void main(String[] args){
String address = args[0];
int port = Integer.parseInt(args[1]);
try{
new AudioClient(new Socket(address, port)); } catch (Exception e) {}
} | 1 |
public Model createNarfModelFromAB(String anMid, NucleicAcid aNucleicAcid, List<Cycle<Nucleotide, InteractionEdge>> acycleList){
boolean basepaironly = true;
Random r_i = new Random();
int rand_i = r_i.nextInt()+1;
Model rm = ModelFactory.createDefaultModel();
//add mcb computation resource
Resource mcb_com... | 9 |
@Override
public void start(Stage primaryStage) throws Exception {
Group root = new Group();
primaryStage.setTitle("Circle Fit");
primaryStage.setScene(new Scene(root));
//Draw the random generate circles
Canvas canvas = new Canvas(PANEL_WIDTH, PANEL_HEIGHT);
root.getChildren().add(canvas);
... | 1 |
public static void main(String[] args) {
Game game = new Game();
game.play();
} | 0 |
private NoteLengthEnum shiftNoteLength(NoteLengthEnum lastBeat, double remaining, int change) {
NoteLengthEnum beat = lastBeat;
NoteLengthEnum [] allNoteLengths = NoteLengthEnum.values();
while(change > 0) {
//if there is a noteLength you could increment to...
if(beat.or... | 6 |
private Object getObjectAs(ResultSet rset, ResultSetMetaData rsmd, int colIndex) throws SQLException {
int colType = rsmd.getColumnType(colIndex);
if(colType == Types.INTEGER)
return rset.getInt(colIndex);
else if(colType == Types.FLOAT || colType == Types.DECIMAL || colType == Types.DOUBLE || colType == Ty... | 5 |
public void updateCornerRects() {
int width = 7;
int height = 7;
Point fi = new Point(((Rectangle) getShape()).x - 5, ((Rectangle) getShape()).y - 5);
Point sec = new Point(((Rectangle) getShape()).x + ((Rectangle) getShape()).width, ((Rectangle) getShape()).y - 5);
Point thi = n... | 0 |
@Basic
@Column(name = "quantity_purchased")
public int getQuantityPurchased() {
return quantityPurchased;
} | 0 |
public final void addDragListeners(final Node n) {
n.setOnMousePressed(new EventHandler<MouseEvent>() {
@Override
public void handle(MouseEvent me) {
startDragX = me.getSceneX();
startDragY = me.getSceneY();
root.setStyle("-fx-opacity:.7;");
}
});
n.setOnMouseReleased(new EventHandler<Mous... | 0 |
public static void main(String[] args) {
System.out.println ("Please enter a value for a");
Scanner sc = new Scanner(System.in);
double a = sc.nextDouble();
System.out.println(a);
System.out.println ("Please enter a value for b");
double b = sc.nextDouble();
System.out.println(b);
System.out.println ("Please ente... | 2 |
public String getCitedList(int id) {
String query = "select paperid from dblpcitation where citationid="
+ id + " order by paperid asc";
ResultSet rs = sqLconnection.Query(query);
String list = "";
try {
while (rs.next()) {
int citedid = rs.getInt("paperid");
list += citedid + ",";
}
} catch... | 2 |
public int evalRPN(String[] tokens) {
Stack<Integer> stack = new Stack<Integer>();
for (String token : tokens) {
if (token.charAt(0) >= '0' && token.charAt(0) <= '9' || token.length() != 1) {
stack.push(Integer.parseInt(token));
} else {
Integer opB = stack.pop();
Integer opA... | 8 |
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... | 6 |
public int getAllowedGuiRows(Player player) {
if (player.hasPermission("trade.gui.rows.6"))
return 6;
if (player.hasPermission("trade.gui.rows.5"))
return 5;
if (player.hasPermission("trade.gui.rows.4"))
return 4;
if (player.hasPermission("trade.gui.rows.3"))
return 3;
if (pl... | 5 |
public void run(){
try {
while(true){
message = in.readLine();
switch(message){
case "jeu" : JoueurDIXIT.pretJouer = true; System.out.println("JEU");break;
}
}
} catch (IOException e) {
e.printStackTrace();
}
} | 3 |
private boolean interfaceIsSelected(RSInterface class9)
{
if(class9.valueCompareType == null)
return false;
for(int i = 0; i < class9.valueCompareType.length; i++)
{
int j = extractInterfaceValues(class9, i);
int k = class9.requiredValues[i];
if(class9.valueCompareType[i] == 2)
{
if(j >= k)
... | 9 |
public static boolean eqParamTypes(String desc1, String desc2) {
if (desc1.charAt(0) != '(')
return false;
for (int i = 0; true; ++i) {
char c = desc1.charAt(i);
if (c != desc2.charAt(i))
return false;
if (c == ')')
return... | 4 |
@Override
public MapObject doNextAction(MapEngine engine, double s_elapsed) {
if (is_cloaked && is_visible && visible_time_left < 0.0) {
is_visible = false;
}
if (shields < 0) {
return (has_death_spin ? doNextDeathSpinAction(engine, s_elapsed) : handleDeath(engine, s_elapsed));
}
previ... | 8 |
public void setParticleEvent(int newEvent) {
if (newEvent < 0 || newEvent > 4) {
throw new IllegalArgumentException("Can only change to a particle event between 0 and 3, inclusive!");
}
selectedParticleEvent = newEvent;
} | 2 |
public int getId() {
return id;
} | 0 |
ArrayList<movePair> possibleMoves(Point[] grid, Pair pr) {
ArrayList<movePair> possible = new ArrayList<movePair>();
for (int i = 0; i < size; i++) {
for (int j = 0; j < size; j++) {
Point currentPoint = pointAtGridIndex(grid, i, j);
if (currentPoint.value == 0) {
continue;
}
for (Pair d : d... | 6 |
public boolean isEnabled(){
return triggeredSite == null || triggeredSite == this || handlersAllowed.contains( name );
} | 2 |
public Object getValueAt(int row, int column) {
try {
Class c = rows.get(row).getClass();
BeanInfo beanInfo = Introspector.getBeanInfo(c, Object.class);
PropertyDescriptor pd = beanInfo.getPropertyDescriptors()[column];
Method m = pd.getReadMethod();
i... | 6 |
private long getCPtrAddRefBitcoinServer(BitcoinServer element) {
// Whenever adding a reference to the list, I remove it first (if already there.)
// That way we never store more than one reference per actual contained object.
//
for(int intIndex = 0; intIndex < elementList.size(); intIndex++)
{
Object theObject... | 4 |
private boolean matchArgs(String[] subcommand, String[] args) {
if(args.length < subcommand.length)
return false;
else for(int i = 0; i < subcommand.length; i++)
if(!subcommand[i].equalsIgnoreCase(args[i]))
return false;
return true;
} | 3 |
public double getWrapWidth() {
return wrapWidth.get();
} | 0 |
public List<Player> findAll() {
List<Player> allUsers = new ArrayList<Player>();
try {
Statement statement = base.createStatement();
ResultSet resultSet = statement
.executeQuery("SELECT * FROM player");
resultSet.beforeFirst();
while (resultSet.next()) {
allUsers.add(new Player(resultSet... | 2 |
@Override
public void endSetup(Attributes atts) {
String def = atts.getValue(AbstractPreference.A_DEFAULT);
String cur = Outliner.prefs.getTempValue(getCommand());
setDef(def);
if (cur != null) {
setCur(cur);
setTmp(cur);
} else {
setCur(def);
setTmp(def);
}
} | 1 |
public static void toggleCommentInheritanceForSingleNode(Node node, CompoundUndoable undoable) {
int oldValue = node.getCommentState();
int newValue = Node.COMMENT_INHERITED;
boolean isComment = node.isComment();
if (oldValue == Node.COMMENT_INHERITED) {
if (isComment) {
node.setCommentState(Node.COMM... | 2 |
public static void main(String[] args) throws InterruptedException{
//zainiacjalizuj bufor
for(int i=0; i<rozmiarBufora; i++)
bufor[i]=i;
producenci = new Thread[iloscProducentow];
konsumenci = new Thread[iloscKonsumetow];
for(int i=0; i<iloscProducentow; ++i){
producenci[i] = new Producent(i... | 7 |
private static void zeroMatrix(int[][] matrix, int m, int n) {
boolean[] rows = new boolean[m];
boolean[] columns = new boolean[n];
for (int i = 0; i < m; i++) {
for (int j = 0; j < n; j++) {
if (!columns[j]) {
if (matrix[i][j] == 0) {
... | 8 |
public boolean animate(ActionListener callback) {
if (timer != null && timer.isRunning()) {
return false;
}
this.callbackListener = callback;
this.direction = isTargetAtBaseLocation() ? SimpleShutterAnimation.DIRECTION_UP : SimpleShutterAnimation.DIRECTION_DOWN;
step = 0;
timer = new Timer(10, new Actio... | 8 |
protected static Ptg calcN( Ptg[] operands )
{
Object o = operands[0].getValue();
if( (o instanceof Double) || (o instanceof Integer) || (o instanceof Float) || (o instanceof Long) )
{
Double d = new Double( o.toString() );
return new PtgNumber( d );
}
if( o instanceof Boolean )
{
Boolean b = (Boo... | 6 |
boolean setMatch(int is, int js, int l) {
int[] a = new int[26];
for (int i = 0; i < l; i++) {
a[s1.charAt(is + i) - 'a']++;
a[s2.charAt(js + i) - 'a']--;
}
for (int i = 0; i < 26; i++) {
if (a[i] != 0) {
return false;
}
... | 3 |
private String match(String targetNumber){
if (targetNumber.isEmpty())
return "";
if (hmPartialResults.containsKey(targetNumber))
return hmPartialResults.get(targetNumber);
int minWordCount = Integer.MAX_VALUE;
String localResult = null;
for (int i = targetNumber.length(); i>0; i--){
String localsub ... | 6 |
public static ErrorLogs parameterLogs(String supMsg, String confMsg){
ErrorLogs logs = new ErrorLogs();
String parameterError = "Parameter Input Error: ";
String parameterRange = " Must be between 0.0 and 1.0, inclusively";
if (!supMsg.equals("")) {
logs.getErrorMsgs().add(
parameterError + " Min Suppor... | 2 |
public void updateMidiOutSelectedItems(String[] midiOutDevices) {
for (int i = 0; i < midiOutMenu.getItemCount(); i++) {
String name = midiOutMenu.getItem(i).getText();
if (name == null || name.equals("No MIDI Output Devices Enabled")) {
continue;
}
String[] pieces = name.split("MIDI Output: ");
bo... | 7 |
public void onStart(ISuite suite)
{
List<Long> testSetIds = populateTestSetIds(suite);
if (testSetIds != null && !testSetIds.isEmpty()) {
this.testInstances = populateTestInstances(testSetIds);
}
} | 2 |
public boolean sendContent( long msg_id, int type, String suffix, byte[] content ){
int flag = -1;
switch( type ){
case MessageUtil.TYPE_LONG:
flag = rsc_handler.addLongResource( msg_id, content );
break;
case MessageUtil.TYPE_IMAGE:
flag = rsc_handler.addImageResource( msg_id, suffix, content );
... | 4 |
private Vector3D getAcceleration(Body body1) {
// Uses system mass instead of accounting for moons
Vector3D aTotal = new Vector3D();
for (int i = 0; i < bodies.size(); i++) {
Body body2 = bodies.get(i);
if (body1 == body2) {
break;
}
double mass = getSimpleMass(body1, body2);
if (mass == 0) {
... | 3 |
public void setFooter(JPanel footer) {
this.footer = footer;
} | 0 |
public String getStatus() {
return status;
} | 0 |
public void printMeetings(List<Meeting> contactMeetings) {
for (int i = 0; i < contactMeetings.size(); i++) {
System.out.println("Meeting ID: " + contactMeetings.get(i).getID());
System.out.println("Date: "
+ df.format(contactMeetings.get(i).getDate().getTime()));
System.out.print("Attendees: ");
pri... | 1 |
public static Object quoteIfString(Object obj) {
return (obj instanceof String ? quote((String) obj) : obj);
} | 1 |
@Override
public int filterRGB(int x, int y, int rgb) {
return (rgb & 0xff000000) | amount;
} | 0 |
public JSONObject toJSONObject(JSONArray names) throws JSONException {
if (names == null || names.length() == 0 || length() == 0) {
return null;
}
JSONObject jo = new JSONObject();
for (int i = 0; i < names.length(); i += 1) {
jo.put(names.getString(i), this.opt(i... | 4 |
public static void main(String[] args) {
final String home = "/Users/Dean/Documents/workspace/Intel/GCJ/googlecodejam/";
final String input = home + "AlienLanguage/io/A-large-practice.in";
final String output = home + "AlienLanguage/io/A-large-practice.out";
try {
Scanner sc... | 8 |
private int getRealisticByteModification(int fileSize, ModificationPart part) {
int byteStart;
switch(part) {
case B:
byteStart = 0;
break;
case E:
byteStart = -1;
break;
case M:
default:
int offset = (int)(fileSize*0.1F);
int start = offset;
int end = fileSize-offset;
byteStar... | 3 |
public static void main(String[] args) {
String input = JOptionPane.showInputDialog("Input the chickens' quantity");
double n = Double.parseDouble(input);
// checking of the right chicken quantity's input
while (n <= 0 || n%(int)n>0){
input = JOptionPane.showInputDialog("Uncorrect input! \nTry again please!... | 6 |
public void setLength(int length) {
if( (length < 1) || (length > MAX_NMER_SIZE) ) throw new RuntimeException("Nmer max length must be between 1 and " + coder.basesPerWord());
this.length = length;
} | 2 |
public static boolean iterate() {
boolean didFind = false;
for(int i=0; i<n; i++) {
// update what Company i owns
int[] cOwn = new int[n];
for(int j=0; j<n; j++) {
int test = ownership[i][j];
if(test >= 50 && test != 100) {
test = 100;
didFind = true;
}
cOwn[j] = test;
if(t... | 9 |
public String longestPrefixOf(String s) {
if (s == null || s.length() == 0)
return null;
int length = 0;
Node x = root;
int i = 0;
while (x != null && i < s.length()) {
char c = s.charAt(i);
if (c < x.c)
x = x.left;
else if (c > x.c)
x = x.right;
else {
i++;
if (x.val != null)
... | 7 |
private void putText (Graphics2D g2d, String t, int i) {
Integer fWidth = MainWindow.setupData.getPrintElementSetupList().getPrintElementSetup (i).getFieldWidth();
Font font = MainWindow.setupData.getPrintElementSetupList().getPrintElementSetup (i).getPrintFont();
Integer fontSize = font.getSize();
Integer min... | 2 |
@Override
public void doPost(HttpServletRequest req, HttpServletResponse res){
session = req.getSession(true);
sc=getServletContext();
if(!req.getParameter("naziv").equals("")){
naziv=req.getParameter("naziv");
}
else{
prazno = true;
gresk... | 7 |
private void printTable() throws SQLException {
rs = st.executeQuery("SELECT * FROM products");
ResultSetMetaData rsMetaData = rs.getMetaData();
System.out.print("Row\t|\t");
for (int i = 0; i < rsMetaData.getColumnCount(); i++) {
System.out.print(rsMetaData.getColumnName(i ... | 3 |
public static byte[] readBytes(final InputStream ins) throws IOException {
if (null == ins) throw new IllegalArgumentException("input stream is null");
byte[] buffer = new byte[BUFFER_SIZE];
int len = 0;
BufferedInputStream in = null;
ByteArrayOutputStream baos = null;
in = new BufferedInputStream(ins, BUF... | 6 |
private Object handleStruct(Object tag, int fields) throws IOException {
ReadHandler h = lookup(handlerLookup, tag);
if (h == null)
h = (ReadHandler) standardExtensionHandlers.get(tag);
if (h == null)
return new TaggedObject(tag, readObjects(fields));
else
... | 2 |
public void insertChild(IXMLElement child,
int index) {
if (child == null) {
throw new IllegalArgumentException("child must not be null");
}
if ((child.getName() == null) && (! this.children.isEmpty())) {
IXMLElement lastChild = (IXMLEl... | 4 |
public final void parseDoc(Document doc) {
if (doc == null) {
throw new IllegalArgumentException("Xml document cannot be null");
}
Element elem = (Element) doc.getElementsByTagName("KeyedFile").item(0);
fileName = elem.getAttribute("path");
if (fileName == null || ""... | 7 |
public String CallCropModel(String filename,String pathname,String DistrictID, String Crop)
{ String CropOutput = "0";
try{
Properties properties = new Properties();
// Read the properties file
File file = new File("Data/2011-07-21/188");
//File file = new File("Data/"+pathname+"/"+DistrictID);
/... | 5 |
private void instanceMain(String[] args) {
if (args.length < 1) {
usage("Must specify at least one directory.");
}
int directoryCount = 0;
for (int i = 0; i < args.length; i++) {
if (args[i].startsWith("-")) {
if (args[i].equalsIgnoreCase("-comp... | 7 |
@Override
public void display(UserInterface ui) {
if (!variablesWithNewValues.isEmpty()) {
UserInterface.print("New values were set for variables: ");
for (String v : variablesWithNewValues.keySet()) {
UserInterface.print(v + " ");
}
UserInterf... | 4 |
public void addContacts(List<EzimContact> lIn)
{
if (this.contacts != null)
{
synchronized(this.contacts)
{
for(EzimContact ecTmp: lIn)
{
if (! this.contacts.contains(ecTmp))
{
this.contacts.add(ecTmp);
}
}
}
this.updateContactNames();
}
} | 3 |
public int getSequence() {
return this._sequence;
} | 0 |
boolean handleMouseMoved(int x, int y) {
if (selectedComponent instanceof LineComponent) {
if (((LineComponent) selectedComponent).nearEndPoint(x, y) > 0) {
setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
return true;
}
} else if (selectedComponent instanceof RectangleComponent) {
if (Dr... | 8 |
@Test
public void test_empty_num_when_in_thirty_three_car() {
for(int i = 0; i < 33; i ++) {
manager.in(new Car(String.valueOf(i)));
Assert.assertEquals(manager.getEmptyNum(), 33 - i - 1);
}
} | 1 |
private boolean checkAndLogin() throws Exception{
if(qq == -1 || pwd == null)
throw new IllegalArgumentException("qq和密码不能为空");
String checkIdUrl = "http://ptlogin2.qq.com/check?appid=1003903&uin="+qq;
String res = getUrl(checkIdUrl);
//ptui_checkVC('0','!ZLE');返回这个就不需要获取验证码了。验证码就是!ZLE
//ptui_checkVC('1','... | 9 |
@Override
public int loop() {
try {
if (Game.getClientState() != Game.INDEX_MAP_LOADED) {
return 1000;
}
if (client != Bot.client()) {
WidgetCache.purge();
Bot.context().getEventManager().addListener(this);
... | 7 |
private static NodeWith2Ptr deepCopy(NodeWith2Ptr n){
HashMap<NodeWith2Ptr, NodeWith2Ptr> m = new HashMap<NodeWith2Ptr, NodeWith2Ptr>();
NodeWith2Ptr h = null;
NodeWith2Ptr curr = h;
while(n!=null){
if(h==null){
h = new NodeWith2Ptr(n.v);
h.arbitrary = n.arbitrary;
curr = h;
} else {
curr.... | 3 |
public static weighted readMyFile(String FileName){
System.out.println("BEGIN READ FILE");
weighted w = null;
String record = null;
String recordArray [] = null;
String linesplit = " ";
try {
FileReader dataSize = new FileReader(FileName);
BufferedReader LineCounterBuffer = new BufferedRea... | 6 |
public int validateAndConvert() throws ValidointiPoikkeus {
ValidointiVirheet virheet = new ValidointiVirheet();
Validator validoija = new Validator();
validoija.validateInt(vuosistr, "vuosi", "Vuosi", true, false);
if (validoija.getVirheet().size() > 0) {
virheet = validoija.getVirheet();... | 1 |
private void lisaaButtonActionPerformed(ActionEvent evt) {
if (!ryhmaField.getText().isEmpty()) {
if (ryhmaField.getText().length() > 30) {
JOptionPane.showMessageDialog(this, "Ryhmän nimi voi olla enintään 30 merkkiä pitkä.", "Virhe", JOptionPane.ERROR_MESSAGE);
} else {
... | 4 |
public void writePointRdfModel(String specs) throws UnsupportedEncodingException, FileNotFoundException
{
FeatureIterator iterator = featureCollection.features();
int position = 0;
long t_start = System.currentTimeMillis();
long dt = 0;
try
{
System.out.println(UtilsLib.getGMTime(... | 9 |
@RequestMapping(value = "/init", method = RequestMethod.GET)
public String init(ModelMap model) {
if (studentSystem == null) {
model.addAttribute("message",
"Error filling in data. studentSystem == null");
} else {
int john = studentSystem.addStudent("John McClane");
int jane = studentSystem.addStud... | 1 |
protected static short[][] unpackFromStrings(String[] sa)
{
// Concatanate initialization strings.
StringBuffer sb = new StringBuffer(sa[0]);
for (int i=1; i<sa.length; i++)
sb.append(sa[i]);
int n=0; // location in initialization string
int size1 = (((int)sb.charAt(n))<<16) | ((int)s... | 3 |
private void textNameKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_textNameKeyPressed
int key = evt.getKeyCode();
if (key == KeyEvent.VK_ENTER) {
saveFormtoState();
}
}//GEN-LAST:event_textNameKeyPressed | 1 |
@Override
public void actionPerformed(ActionEvent e) {
if(e.getSource().equals(view.getInputText())){
view.getResults().clear();
try{
search(view.getInputText().getText());
}
catch(NullPointerException n){
JOptionPane.showMessageDialog(view, "No Concerts found");
}
}
else if(e.getActionCo... | 7 |
public void run()
{
while (true)
{
try
{
repaint();
Thread.sleep(30);
}
catch (InterruptedException ie)
{
stop();
}
}
} | 2 |
public void setRefreshing(boolean refreshing) {
if(refreshJob == null) {
refreshJob = new RefreshJob();
}
boolean prev = isRefreshing;
isRefreshing = refreshing;
if(refreshing && !prev) {
Thread t = new Thread(refreshJob);
t.start();
}
} | 3 |
@Override
public void play(long currentTime) {
super.play(currentTime);
if (drawRequest) {
this.drawCard();
drawRequest = false;
}
if (playRequest != null) {
if (eightSuiteRequest >= 0 && playRequest.value == Card.EIGHT) {
this.pl... | 5 |
@Override
public ArrayList<String> getCategories() {
System.out.println("Hello from SessionBean getCategories");
ArrayList<String> categories = new ArrayList<String>();
List<Category> obtainedCategories = (List<Category>) emgr.createNamedQuery("Category.findAll", Category.class).getResultList();
for (int i = ... | 1 |
public void compFinalResult() {
do {
iStage++;
compAllocation();
if (compDistribution()) {
/* deadline can not be satisfied */
if (!bDeadline) {
System.out.println("THE DEADLINE CAN NOT BE SATISFIED!");
return;
} else {
System.out.println("\nNEW ROUND WITHOUT CHECKING:");
dEv... | 7 |
public void startStrategy() throws Exception {
//get the instance of the IClient interface
final ITesterClient client = TesterFactory.getDefaultInstance();
//set the listener that will receive system events
client.setSystemListener(new ISystemListener() {
@Override
... | 6 |
public void ajouterBut(String compteur, String equipe, int periode, long tempsPeriodeMs){
listeBut.add(new But(compteur, equipe, periode, tempsPeriodeMs));
if(equipe.equals(equipeD))
++butD;
else
++butV;
} | 1 |
private List<Integer> getSortedNodes(LinkedList[] graph){
List<Pair<Integer,Integer>> list= new ArrayList<Pair<Integer, Integer>>();
for(int i=0;i<graph.length;++i){
list.add(new Pair<Integer, Integer>(i,graph[i].size()));
}
Collections.sort(list, new Comparator<Pair<Integer,... | 2 |
private JSONWriter append(String string) throws JSONException {
if (string == null) {
throw new JSONException("Null pointer");
}
if (this.mode == 'o' || this.mode == 'a') {
try {
if (this.comma && this.mode == 'a') {
this.writer.write('... | 7 |
@Override
public int compare(OutputModel o1, OutputModel o2) {
long outputSumValue1 = o1.getSumValue();
long outputSumValue2 = o2.getSumValue();
long outputIndex1 = o1.getTargetIndex();
long outputIndex2 = o2.getTargetIndex();
if (outputSumValue1 > outputSumValue2)
{
return -1;
} else if ((outputSumV... | 7 |
private void jPAltConfirmaSenhaKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jPAltConfirmaSenhaKeyTyped
// TODO add your handling code here:
if (evt.getKeyChar() == KeyEvent.VK_ENTER){
if(evt.getSource() == jPAltConfirmaSenha){
... | 9 |
public void recursivePrint(LeftistTree tree, LeftistTreeNode node, int parentPosition, Node innerNode, Node p, int i) {
Node innerParent;
int position;
if (node != null) {
int height = tree.heightRootToNode(node);
int nextTop = getRectNextTop(height);
if (i... | 4 |
Subsets and Splits
SQL Console for giganticode/java-cmpx-v1
The query retrieves a limited number of text entries within a specific length range, providing basic filtering but minimal analytical insight.