text stringlengths 14 410k | label int32 0 9 |
|---|---|
private void list () {
String options;
String name;
boolean onlyArmed;
Item[] data;
while (true) {
name = "";
onlyArmed = false;
System.out.println("O que você deseja visualizar?\n" +
"a. Informações sobre um item\n" +
... | 9 |
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + id;
result = prime * result + ((marca == null) ? 0 : marca.hashCode());
result = prime * result + ((nome == null) ? 0 : nome.hashCode());
result = prime * result + ((preco == null) ? 0 : preco.hashCode());
r... | 5 |
public static ConnectionType byPersistentName( String name ){
for( ConnectionType type : values() ){
if( type.getPersistentName().equals( name )){
return type;
}
}
throw new IllegalArgumentException( "unknown name: " + name );
} | 2 |
public void analyseForKeywords(String filename)
{
LinkedList<String> foundKeywords = extractKeywords(filename);
Vector<String> keywordsToAdd = new Vector<String>();
for (String word : foundKeywords)
{
word = word.toLowerCase();
//for... | 5 |
@Override
public void load() {
Plugin cp = Bukkit.getServer().getPluginManager().getPlugin("CoreProtect");
// Check that CoreProtect is loaded
if (cp != null && cp instanceof CoreProtect) {
this.coreprotect = ((CoreProtect)cp).getAPI();
if (coreprotect.isEnabled()==true){
if (coreprotect.APIVersion() ... | 4 |
@Override
public void windowDeiconified(WindowEvent arg0)
{
} | 0 |
public static boolean isAlphanumericSpace(String str)
{
if (str == null)
{
return false;
}
int sz = str.length();
for (int i = 0; i < sz; i++)
{
if ((Character.isLetterOrDigit(str.charAt(i)) == false) && (str.charAt(i) != ' '))
{
... | 4 |
public V get(K key) {
for (int i = 0; i < currentSize; ++i) {
if (key == keys[i]) {
currentIndex = i;
return values[i];
}
}
return null;
} | 2 |
@Override
public void copyFrom(Matrix source) {
if (!isSameLength(source))
throw new IndexOutOfBoundsException("mxn do not equal this matrix");
for (int i = 1; i <= this.getM(); i++) {
for (int j = 1; j <= this.getN(); j++) {
this.insert(i, j, source.get(i, j));
}
}
} | 3 |
public NBestIterator(TagLattice<String> lattice,
int[] tokenStarts,
int[] tokenEnds,
int maxResults,
String beginTagPrefix,
String inTagPrefix,
St... | 8 |
public Employee clone() throws CloneNotSupportedException
{
// call Object.clone()
Employee cloned = (Employee) super.clone();
// clone mutable fields
cloned.hireDay = (Date) hireDay.clone();
return cloned;
} | 0 |
private void addAll()
{
// Traverse hierarchy
Class<?> clazz = this.object.getClass();
do
{
// Traverse methods
for(Method m : clazz.getDeclaredMethods())
// Add
this.add(m);
}while((clazz = clazz.getSuperclass()) != IJeTTEventCallback.class &&
clazz != Object.class);
} | 4 |
private RepairCandidate errorRecovery(int error_token, boolean forcedError) {
this.errorToken = error_token;
this.errorTokenStart = lexStream.start(error_token);
int prevtok = lexStream.previous(error_token);
int prevtokKind = lexStream.kind(prevtok);
if(forcedError) {
int name_index = Parser.terminal_in... | 8 |
private boolean pluginFile(String name) {
for (final File file : new File("plugins").listFiles()) {
if (file.getName().equals(name)) {
return true;
}
}
return false;
} | 2 |
public void save() {
String name = JOptionPane.showInputDialog(this, "Enter a name for the table.");
mortgage.setName(name);
mortgage.setStartCapital(startCapital);
try {
mortgages.addBusinessObject(mortgage);
dispose();
} catch (DuplicateNameException e) {
A... | 2 |
public void unMuteMedia() {
if (Debug.video) System.out.println("VideoPlayer -> unMuteMedia called");
if ((null != player) && realizeComplete) {
gainControl.setMute(false);
if (Debug.video) System.out.println("VideoPlayer -> unMuteMedia un-set");
}
} | 4 |
protected org.w3c.dom.Node getAdapter()
{
if (adapter == null)
{
switch (this.type)
{
case RootNode:
adapter = new DOMDocumentImpl(this);
break;
case StartTag:
case StartEndTag:
... | 9 |
private void readSubframe(int channel, int bps) throws IOException, FrameDecodeException {
int x;
x = bitStream.readRawUInt(8); /* MAGIC NUMBER */
boolean haveWastedBits = ((x & 1) != 0);
x &= 0xfe;
int wastedBits = 0;
if (haveWastedBits) {
... | 9 |
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
MainActivity window = new MainActivity();
window.frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
} | 1 |
private void loadDay() throws SQLException, Exception {
dDL = new DayDL(c);
DecimalFormat decFormat = new DecimalFormat("#.##");
SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
java.util.Date date = new java.util.Date();
java.sql.Date sqlDate = StrUtil.datePar... | 6 |
private final void createStateManager() {
// I wonder if we can lazily load this each time somehow?
stateManager = new StateManager("mainMenuStateManager");
// Add the state which will animate the buttons coming into the screen
// from either set. When the buttons have reached the middle it will
// transitio... | 3 |
public void visitNewMultiArrayExpr(final NewMultiArrayExpr expr) {
final Expr[] dims = expr.dimensions;
for (int i = 0; i < dims.length; i++) {
if (dims[i] == previous) {
if (i > 0) {
check(dims[i - 1]);
} else {
previous = expr;
expr.parent().visit(this);
}
}
}
} | 3 |
public int getACC() {
return acc;
} | 0 |
public int squeezOutOf(AABB r, Vec2D a_out)
{
// up, left, down, right
double[] squeeze = {max.y-r.min.y, max.x-r.min.x, r.max.y-min.y, r.max.x-min.x};
int collidingSide = 0;
for(int i = 0; i < squeeze.length; ++i)
{
if(squeeze[i] < squeeze[collidingSide])
collidingSide = i;
}
double dx = 0, dy = ... | 9 |
protected AbilityWorldConfig(FileConfiguration cfg, String folder)
{
/* ################ UseWorldSettings ################ */
if (folder.length() != 0)
{
useWorldSettings = cfg.getBoolean("UseWorldSettings", false);
set(cfg, "UseWorldSettings", useWorldSettings);
}
/* ################ EnabledSpawn... | 7 |
public String GetPreviousLine(int pindex) {
int tindex = pindex;
while ((tindex > 0 )&& (iExpr.toCharArray()[tindex] != '\n')) {
tindex--;
}
if (iExpr.toCharArray()[tindex] == '\n') {
tindex--;
} else {
return "";
}
while ((t... | 8 |
private final void method678(boolean bool, byte i) {
if (6 * anInt5537 > (((ByteBuffer) (((OpenGlToolkit) aHa_Sub2_5598)
.aClass348_Sub49_Sub1_7798))
.payload).length)
((OpenGlToolkit) aHa_Sub2_5598).aClass348_Sub49_Sub1_7798
= new FloatBuffer(6 * (anInt5537 - -100));
else
((ByteBuffer)
... | 9 |
protected void processLoop() {
currentTime = 0f;
if(reverse) {
endingValue.negate(endingValue);
}
} | 1 |
private void binData(boolean lPerformed) {
double max;
int bin;
boolean performLaplace = false;
min = max = data.get(0);
for(double d : data)
if(d>max)max=d;
else if(d<min)min=d;
interval = (max - min)/((double)numBins - 1.);
... | 9 |
public void putAll( Map<? extends Long, ? extends Byte> map ) {
Iterator<? extends Entry<? extends Long,? extends Byte>> it =
map.entrySet().iterator();
for ( int i = map.size(); i-- > 0; ) {
Entry<? extends Long,? extends Byte> e = it.next();
this.put( e.getKey(), e.... | 8 |
private void initPopupMenu(){
mainPopupMenu = new JPopupMenu();
ImageIcon itemCopyIcon = new ImageIcon(Main.ICO_PATH + "page_copy.png");
JMenuItem itemCopy = new JMenuItem(" Copy ", itemCopyIcon);
itemCopy.addMouseListener(new MouseAdapter() {
@Override
public void mouseReleased(Mous... | 0 |
public void cmpg(final Type type) {
mv.visitInsn(type == Type.FLOAT_TYPE ? Opcodes.FCMPG : Opcodes.DCMPG);
} | 1 |
public static void main(String[] args) throws Exception {
if (args.length == 0) {
System.err.println("Usage: java -jar sezpoz.jar [ something.jar | some.serialized.Annotation ]+");
}
for (String arg : args) {
System.out.println("--- " + arg);
byte[] magic = ne... | 9 |
public static synchronized void loadFromPreferences() {
if (!LOADED) {
Preferences prefs = Preferences.getInstance();
for (Command cmd : StdMenuBar.getCommands()) {
String value = prefs.getStringValue(MODULE, cmd.getCommand());
if (value != null) {
if (NONE.equals(value)) {
cmd.setAccelerator... | 4 |
PERange intersection(PERange rangeb) {
if(rangeb == null) {
return null;
}
int s = (this.begin < rangeb.begin) ? rangeb.begin : this.begin;
int e = (this.end < rangeb.getEnd()) ? this.end : rangeb.getEnd();
return (s > e) ? null : new PERange(s, e);
} | 4 |
public static String downloadURL(URL url) {
InputStream in = null;
try {
in = url.openStream();
BufferedReader reader = new BufferedReader(new InputStreamReader(in));
StringBuilder sb = new StringBuilder();
char[] buffer = new char[1024];
int ... | 4 |
public String toString() {
String ns = "";
Talent currentTalent = null;
ns += name + ": " + (current?"Current":"Not Current") + "\n";
ns += "\n Offense:\n";
for (int i=0;i<offense.length;i++) {
for (int j=0;j<offense[0].length;j++) {
for (Talent e : ta... | 9 |
public final void endElement(
final String ns,
final String lName,
final String qName) throws SAXException
{
// the actual element name is either in lName or qName, depending
// on whether the parser is namespace aware
String name = lName == null || lName.length() == ... | 4 |
public String appendToText(String name, String journalID, String text) {
Journal temp = null;
for (Journal j : db) {
if (journalID.equals(j.getID()))
temp = j;
}
if (nurses.contains(name)) {
if (name.equals(temp.getNurse())) {
temp.changeText(text);
log.addEntry(name, temp.getID(), "User added... | 6 |
private boolean inputRFCHandling(String stdInString) {
// split standard Input into tokens, token cut by " "
String tokenToFind = " ";
StringTokenizer token = new StringTokenizer(stdInString, tokenToFind);
int arraySize = token.countTokens();
String foundToken[] = new String[arraySize];
// find all tokens ... | 6 |
public void update(double dt) {
xPos+=xVel*dt;
yPos+=yVel*dt;
xVel+=xAccel*dt;
yVel+=yAccel*dt;
setAccel(dt);
Ball b=null;
for(int i=0;i<MainClass.balls.size();i++) {
b=MainClass.balls.get(i);
if(b!=null && id<b.id && collides(b)) {
bounce(b,i);
}
}
if(xPos-radius<MainClass.wa... | 8 |
public String toString() {
return "FROM:" + indexFrom + (indexTo == -1 ? "" : " TO " + indexTo) + " TYPE FROM: " + moveTypeFrom + " TYPE TO: " + moveTypeTo;
} | 1 |
private void handleOpenMenuItemClick() {
JFileChooser fileChooser = new JFileChooser();
FileNameExtensionFilter filter = new FileNameExtensionFilter("Xml files", "xml");
fileChooser.setFileFilter(filter);
if (fileChooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
this.controller.onLoadMenuItem... | 1 |
private void drawEmptyGrid(Graphics g) {
g.setColor(Color.BLACK);
for (int i = 0; i <= nbRows; i++) {
for (int j = 0; j <= nbColumns; j++) {
g.drawLine(caseHeight * i, 0, caseHeight * i, nbColumns
* caseHeight + 1);
g.drawLine(0, caseWidth * j, nbRows * caseWidth + 1,
caseWidth * j);
}
}... | 2 |
public static boolean check_repeat_symbol(Symbol_table symbol_table, String name) {
for (int i = 0; i < symbol_table.symbol_name.size(); i++) {
if (symbol_table.symbol_name.get(i).toString().equals(name)) {
return false;
}
}
return true;
} | 2 |
private void nextPiece() {
if(current == null){
this.current = Tetromino.generatePiece();
this.next = Tetromino.generatePiece();
} else {
this.current = this.next;
this.next = Tetromino.generatePiece();
}
side.updateNext(next);
orientation = 0;
currentCol = current.getTiles()[0].length == 16 ? ... | 4 |
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String line = "";
StringBuilder out = new StringBuilder();
int nEdges = Integer.parseInt(in.readLine().trim());
start = 1;
target = 2;
HashMap<String, Integer> mapNames = n... | 4 |
private boolean Rule_0()
{
begin("");
if (!Name()) return rejectInner();
if (!EQUAL()) return rejectInner();
if (!RuleRhs()) return rejectInner();
DiagName();
if (!SEMI()) return rejectInner();
return acceptInner();
} | 4 |
public static int[] sort(int[] list) {
if (list.length == 1) {
return list;
} else {
int[] listL = new int[list.length / 2];
int[] listR = new int[list.length - list.length / 2];
int Center = list.length / 2;
for (int i = 0; i < Center; i++) {
... | 3 |
public void writeOrFail(String fileName) throws IOException
{
String extension = this.extension; // the default is current
// create the file object
File file = new File(fileName);
File fileLoc = file.getParentFile(); // directory name
// if there is no parent directory use the current media dir... | 3 |
public List<String> getStringList(String path, List<String> def) {
if(def == null)
def = new ArrayList<String>();
List<?> list = super.getList(path, def);
if(list == null)
return def;
try {
@SuppressWarnings("unchecked")
List<String> sList = (List<String>) list;
return sList;
} catch (Exception... | 4 |
@Override
public List<Object> getAll(String type){
try {
db.start();
DBCollection collection = db.getDB().getCollection("nonmoves");
XStream xStream = new XStream();
DBCursor cursor = collection.find();
if (cursor == null)
return null;
List<Object> commands = new ArrayList<Object>... | 4 |
protected void cut(Fibonaccinode x, Fibonaccinode y) {
x.left.right = x.right;
x.right.left = x.left;
y.degree--;
if (y.child == x) {
y.child = x.right;
}
if (y.degree == 0) {
y.child = null;
}
x.left = min;
x.right = min.ri... | 2 |
@Override
public void onAudioSamples(IAudioSamplesEvent event) {
if (currentSection != null) {
Long timeStamp = event.getTimeStamp(currentSection.getTimeUnit());
if (currentSection.getStart() < timeStamp) {
adjustVolume(event);
if (currentSection.getEnd() < timeStamp) {
... | 4 |
public RPCMessageImpl(AuthNodeId authNodeId, Authenticator authenticator, RPC rpc)
{
if (authNodeId == null)
throw new NullPointerException("The authNodeId is null!");
if (authenticator == null)
throw new NullPointerException("The authenticator is null!");
if (rpc == null)
throw new NullPointerException... | 4 |
public InputSplit[] getSplits(JobConf jobConf, int numSplits) throws IOException {
// Get the splitsize (number of rows), defaults to 100,000 as much larger seems to
// screw up getting accurate rows
int splitSize = Integer.parseInt(jobConf.get(SimpleDBInputFormat.SIMPLEDB_SPLIT_SIZE, ... | 7 |
@Override
public void run() {
if (stopped || this.tokens.length == 0)
return;
System.out.println("executing search");
try {
this.cmd = getCmd(getLongest(tokens));
String line;
String file;
int n = 0;
String[] dbentry;
p = Runtime.getRuntime().exec(cmd);
BufferedReader input = new Buffere... | 8 |
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((adjacentNodes == null) ? 0 : adjacentNodes.hashCode());
result = prime * result + ((edgeState == null) ? 0 : edgeState.hashCode());
... | 2 |
public void onTurn(Board board) {
if (board.getMovablePos().isEmpty()) {
System.out.println("pass your turn");
board.pass();
return;
}
while(true) {
System.out.print("input point ex.\"f5\" or (u:undo/x:exit):");
BufferedReader stdin =
new BufferedReader(new InputStr... | 8 |
public void initKeyListeners() {
KeyListener deleteListener;
deckTable.addKeyListener(deleteListener = new KeyListener() {
public void keyPressed(KeyEvent k) {
if (k.getComponent() instanceof JList) {
switch (k.getKeyCode()) {
case KeyEvent.VK_DELETE: removeCardsInImageListBuffer();
break;
... | 3 |
public APacket getNewPacketOfID(int id) {
try {
return PList.get(id).getConstructor().newInstance();
} catch(InstantiationException e) {
e.printStackTrace();
//Log.getInstance().logError("PacketRegistrie", "Could not Instantiate " + PList.get(id) + " probably missing public default Constructor");
throw ... | 4 |
@Override
public int compareTo(CubeNode b) {
if (this.heuristic < b.heuristic) {
return -1;
} else if (this.heuristic > b.heuristic) {
return 1;
}
return 0;
} | 2 |
public void logShip (String mmsi) {
UserIdentifier uid=new UserIdentifier();
// First check if a ship has already been logged and is in the list
int a;
for (a=0;a<listLoggedShips.size();a++) {
if (listLoggedShips.get(a).getMmsi().equals(mmsi)) {
// Increment the log count and return
listLoggedShips.g... | 3 |
public void zeichneKartenAusschnitt(Graphics g){
//fenster.ofView
int ausschnitt_x = fenster.ofView.x;
int ausschnitt_y = fenster.ofView.y;
int ausschnitt_ende_x = ausschnitt_x+20,ausschnitt_ende_y = ausschnitt_y+20;
for(int x = ausschnitt_x, rx =0;x < ausschnitt_ende_x;x++,rx++){ /*level.karte.getWidt... | 2 |
public ArrayList<FullLocation> list(String locationName) throws URISyntaxException{
log.trace("Retrieving location list");
JsonObject response = null;
JsonElement locationsAsJson = null;
JsonElement cityAsJson = null;
JsonElement metroAreaAsJson = null;
FullLocation fullLocation = null;
ArrayList<FullLoca... | 5 |
public void valueChanged(ListSelectionEvent e) {
resetCardBuffer();
if (!e.getValueIsAdjusting()) {
ListSelectionModel lsm = (ListSelectionModel)e.getSource();
int minIndex = lsm.getMinSelectionIndex();
int maxIndex = lsm.getMaxSelectionIndex();
for (int i = minIndex; i <= maxIndex; i++) {
if (l... | 3 |
public void killOpen(ArrayList<Enemy> e, Rachel r){
if(getXScreen() > 0 && r.getXScreen() > 0){
for(int i = 0; i < e.size(); i++){
Enemy en = e.get(i);
if(en.getXScreen() > 0 && en.getYScreen() > 0){
if(en.isDead()){
killed++;
}//en.isdead
}//en.getxscreen
}//for loop
if(kille... | 7 |
public void senseLeverDown() throws LeverErrorException {
if((l.getLeverPosition()).equals("OFF")) {
System.out.println("ERROR: leverPosition already at OFF.");
throw new LeverErrorException();
}
else if((l.getLeverPosition()).equals("INT")) {
l.setLeverPosition("OFF");
w.setWiperSpeed(0);
}
else if((l.getLev... | 7 |
protected void wireLayers(List<? extends Neuron> inputs, List<? extends Neuron> outputs) {
double weight = 1d / outputs.size();
for (Neuron input : inputs) {
for (Neuron output : outputs) {
output.setInputWeight(input, weight);
}
}
} | 4 |
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 |
private void createAnswerArea(Attributes attrs) {
answerArea = new AnswerArea(answerAreaDef);
// loop through all attributes, setting appropriate values
for (int i = 0; i < attrs.getLength(); i++) {
if (attrs.getQName(i).equals("id"))
answerArea.setId(Integer.valueOf(attrs.getValue(i)));
else if (attrs.... | 8 |
public void printDefinitons() {
for (String key:definitions.keySet()) {
System.out.println(key+":");
for (Vector<PatternComponent> list:definitions.get(key)) {
for (int i = 0; i < list.size(); i++) {
System.out.println("\t"+list.get(i));
}
}
}
} | 3 |
public void turnAndMove(double distance, double radians) {
if (distance == 0) {
turnBody(radians);
return;
}
// Save current max. velocity and max. turn rate so they can be restored
final double savedMaxVelocity = commands.getMaxVelocity();
final double savedMaxTurnRate = commands.getMaxTurnRate();
... | 9 |
public float parseFloat() throws IOException {
int sign = 1;
int c = nextNonWhitespace();
if( c == '+' ) {
// Unclear if whitespace is allowed here or not
c = read();
} else if( c == '-' ) {
sign = -1;
// Unclear if whitespace is all... | 7 |
public void fusion(){
if(!this.isRacine()){
int index = this.pere.getPointeur().indexOf(this);
Noeud<T> brother;
if(index>0){
brother = this.pere.getPointeur().get(index-1);
if(!this.feuille){
Noeud<T> childOfBrother = brother.getPointeur().get(brother.getPointeur().size()-1);
brother.getVa... | 6 |
public static boolean compareHydrated(String ion, int ii){
boolean test = false;
if(ion.equals(IonicRadii.hydratedIons1[ii])||ion.equals(IonicRadii.hydratedIons2[ii])||ion.equals(IonicRadii.hydratedIons3[ii])||ion.equals(IonicRadii.hydratedIons4[ii])||ion.equals(IonicRadii.hydratedIons5[ii])||ion.equals... | 6 |
String toString(Object o) {
String message = "Could not serialize to json, reason = ";
try {
return gson.toJson(o);
} catch (Exception e) {
message += e.getMessage() + ".";
} catch (StackOverflowError e) {
message += e.getMessage() + ".";
}
... | 4 |
public InvestManagerDto getInvestManagerDto(String mgrName){
PreparedStatement stmt = null;
ResultSet rs = null;
InvestManagerDto investManagerDto = null;
try {
stmt = conn
.prepareStatement("select mgrName,mgrInfo from InvestManager where mgrName = ? ");
stmt.setString(1, mgrName);
rs = s... | 4 |
public static void printKifWrapper(LiteralWrapper self) {
{ OutputStream stream = ((OutputStream)(Logic.$PRINTLOGICALFORMSTREAM$.get()));
{ Surrogate testValue000 = Stella_Object.safePrimaryType(self);
if (Surrogate.subtypeOfIntegerP(testValue000)) {
{ IntegerWrapper self000 = ((IntegerWra... | 6 |
public static void main(String[] args) {
Thread t = new Thread(new LiftOff());
// t.start();
System.out.println("Waiting for LiftOff");
for(int i = 0; i < 5; i++)
new Thread(new LiftOff()).start();
} | 1 |
public void addItem(int type){
for(int i = 0; i < invCount; i++){
if(inv[i].type == 0){
inv[i].type = type;
if(invCount < inv.length)invCount++;
break;
}
}
} | 3 |
public double rawPersonVariance(int index){
if(!this.dataPreprocessed)this.preprocessData();
if(index<1 || index>this.nPersons)throw new IllegalArgumentException("The person index, " + index + ", must lie between 1 and the number of persons," + this.nPersons + ", inclusive");
if(!this.variancesC... | 4 |
public static DirectionEnum fromValue(String v) {
for (DirectionEnum c: DirectionEnum.values()) {
if (c.value.equals(v)) {
return c;
}
}
throw new IllegalArgumentException(v);
} | 2 |
private void quicksort(Comparable[] items, int low, int high) {
int i = low, j = high;
// Get the pivot element from the middle of the list
Comparable pivot = items[low + (high - low) / 2];
// Divide into two lists
while (i <= j) {
while (items[i].compareTo(pivot) < ... | 6 |
public TreeSelectionListener[] getTreeSelectionListeners() {
return (TreeSelectionListener[]) treeSelectionListeners.toArray();
} | 0 |
public AssociationList getAssociationList(int aiMaxSize, String asLastModified,
String asDeactivated) {
String lsParam = "";
if (aiMaxSize > 0) {
lsParam += "&max_size=" + Integer.toString(aiMaxSize);
}
if (UtilityMethods.isValidS... | 4 |
public void scanVariable() {
final char first = ch;
if (ch != '@' && ch != ':') {
throw new ELException("illegal variable");
}
int hash = first;
np = bp;
sp = 1;
char ch;
if (buf[bp + 1] == '@') {
hash = 31 * hash + '@';
... | 6 |
@Override
public void method2() {
System.out.println("ClassA method2()");
} | 0 |
@Override
public String toString()
{
switch(this)
{
case DayPref:
return "Day Pref";
case MON:
return "Monday";
case TUES:
return "Tuesday";
case WED:
return "Wednesday";
case THUR:
return "Thursday";
case FRI:
return "Friday";
case SAT:
return "Saturday";
case NOPREF:
retu... | 8 |
public final Clip loadAudioClip(URL clipName) {
Clip loadedClip = null;
try {
// Open an input stream to the specified clip and retrieve clip format information
AudioInputStream inputStream = AudioSystem.getAudioInputStream(clipName);
AudioFormat format = inputStream... | 6 |
private void unpackData() {
File tmp = new File(backup);
if(!tmp.exists()) {
error("It seems you don't have a '" + backup + "' yet. Stopping.");
return;
}
try {
BufferedInputStream input = new BufferedInputStream(new FileInputStream(tmp));
... | 6 |
@Override
public boolean checkTable(String table) throws MalformedURLException, InstantiationException, IllegalAccessException {
try {
//Connection connection = getConnection();
this.connection = this.getConnection();
Statement statement = this.connection.createStatement(... | 5 |
public BaseArtifactType newArtifactInstance() {
try {
BaseArtifactType baseArtifactType = getArtifactType().getTypeClass().newInstance();
baseArtifactType.setArtifactType(getArtifactType().getApiType());
if (DocumentArtifactType.class.isAssignableFrom(baseArtifactType.getClas... | 4 |
public boolean hasElement(T a)
{ if(this.a.equals(a))
{ return true;}
else if(this.next!=null)
{ return this.next.hasElement(a);
}
else
{ return false;
}
} | 2 |
public void handleWeaponStyle() {
if (c.fightMode == 0) {
c.getPA().sendFrame36(43, c.fightMode);
} else if (c.fightMode == 1) {
c.getPA().sendFrame36(43, 3);
} else if (c.fightMode == 2) {
c.getPA().sendFrame36(43, 1);
} else if (c.fightMode == 3) {
c.getPA().sendFrame36(43, 2);
}
} | 4 |
private void parsePacket()
throws MpegDecodeException, IOException
{
Statistics.startLog(PARSE_PACKET_STRING);
System.out.println("Parsing packet");
if(m_ioTool.getBits(24) != 0x1 )
{
Debug.println(Debug.ERROR, "Synchronization error in packet");
throw new Mp... | 9 |
protected void saveEditDebates() {
String topicTitle = titleCDJtxt.getText()
, maxTurns = maxTurnsJcbx.getSelectedItem().toString()
, maxTime = maxTimeJcbx.getSelectedItem().toString()
, description = descriptionCDJtxa.getText()
, materials = "";
int teamASize = teamACDDLM.getSize()
, teamBSize ... | 9 |
public void rechacharamistad(String emisor, String nick){
try {
String queryString = "DELETE FROM peticionAmistad WHERE emisor=? and receptor=?";
connection = getConnection();
ptmt = connection.prepareStatement(queryString);
ptmt.setString(1, emisor);
... | 5 |
int bNNIRetestEdge( heap p, heap q, edge e, double[][] avgDistArray,
double[] weights, direction[] location, int possibleSwaps )
{
direction tloc;
tloc = location[e.head.index+1];
location[e.head.index+1] =
bNNIEdgeTest( e,avgDistArray,weights, e.head.index+1 );
if ( direction.NONE == location[e.head... | 3 |
@Test
public void testCompPerformance() {
int size = 100000;
int[] inVals = Permutation.randomPermutation(size);
int testVal = inVals[size / 2];
TreeMap<Integer, Integer> treeMap = new TreeMap<Integer, Integer>(comp);
long t1 = System.currentTimeMillis();
for (int 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.