text stringlengths 14 410k | label int32 0 9 |
|---|---|
final void assertAllTestCasesHaveRequiredElements(final Xpp3Dom results) {
new ForAllTestCases(results) {
@Override
void apply(Xpp3Dom each) {
for (final String requiredElement : REQUIRED_ELEMENTS) {
assertHasExactlyOneNamedNonEmptyElement(each, requir... | 1 |
public double getDirectionLength(String dir, double minPathLength) {
int xDiff = coordX - targetX;
int yDiff = coordY - targetY;
int tempDiff = 0;
double pathLength = 0;
if(dir.equals("up")) {
tempDiff = yDiff-1;
pathLength = Math.sqrt(xDiff*xDiff + tempD... | 8 |
public static double estimateGoalFanout(Proposition goal) {
{ Keyword testValue000 = goal.kind;
if (testValue000 == Logic.KWD_ISA) {
return (NamedDescription.estimateCardinalityOfExtension(Logic.getDescription(((Surrogate)(goal.operator)))));
}
else if ((testValue000 == Logic.KWD_FUNCTION... | 9 |
public int countStars(String[] result) {
int n = result.length;
int ans = 0;
for(int i = 0;i < n;i++){
if(result[i].equals("ooo")){
ans += 3;
}else if(result[i].equals("oo-")){
ans += 2;
}else if(result[i].equals("o--")){
ans += 1;
}
}
return ans;
} | 4 |
public Bundle worthAtLeast(double maximumPrice) {
double value = getValue();
if (value < maximumPrice) return null; //I want to cause null pointers if this ever happens.
Bundle divvy = this.times(maximumPrice/value); //good starting guess.
Bundle leftover = this.minus(divvy);//What I have left to allocate.
... | 7 |
public static void calculateTLZScore(ArrayList<Song> songs)
{
for(Song song: songs)
{
song.setTimeLength();
}
double sum=0;
double mean;
double var;
double sd;
double zScore;
int count=0;
for(int i=0; i<songs.size(); i++)
{
if(songs.get(i).getTimeLength()>0)
sum=sum+songs.get(i).getTime... | 6 |
@Override
public void actionPerformed(ActionEvent event) {
if(isAddComputer(event)){
String profile = view.getProfileName();
String computer = view.getNickName();
String homeFolder = view.getHomeFolder();
String serverName = view.getServerName();
String userName = view.getUserName();
String... | 7 |
private static void addCatchPhiOperands(final SSAConstructionInfo info,
final Block block, final LocalExpr def) {
final Iterator handlers = block.graph().handlers().iterator();
// Iterate over all of the exception handlers in the CFG. If
// the block we are dealing with is a protected block (that is,
// is ... | 4 |
private void executeIteration(int[] rgb, Mask mask, int width, int height) {
int[][] offsets = { { -1, -1 }, { 0, -1 }, { 1, -1 }, { -1, 0 }, { 1, 0 }, { -1, 1 }, { 0, 1 }, { 1, 1 } };
MaskIterator iterator = mask.iterator();
while (iterator.hasNext()) {
int pixelIndex = iterator.next();
int x = pixelInde... | 8 |
@Override
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
System.out.println("#####################################################");
System.out.println("start generating code ...");
for(TypeElement typeElement : annotations){
Generat... | 9 |
private static LongSet getIPBlocks()
{
LongSet group = (LongSet)Resources.getResource("SYSTEM_IP_BLOCKS");
if(group == null)
{
group = new LongSet();
final String filename = CMProps.getVar(CMProps.Str.BLACKLISTFILE);
final List<String> ipList = Resources.getFileLineVector(Resources.getFileResource(filen... | 8 |
private boolean claimRegion(Player player){
//Make sure we have a worldguard instance
if (plugin.wg != null){
// Get WorldGuards Region Manager
RegionManager rm = plugin.getRegionManager(player);
// Make sure a RegionManager was found
if (rm != null) {
List<String> regionIds = plugin.ge... | 8 |
public JSONObject getFullFile() throws ReaderException {
if (this.json_obj instanceof JSONObject) {
return (JSONObject) this.json_obj;
} else {
throw new ReaderException("JSON file is not formatted properly.");
}
} | 1 |
private void updateStatistics() {
numPink = numBlue = numGreen = numMale = numFemale = numTotal = 0;
synchronized (world) {
for (int i = 0; i < width; i++) {
for (int j = 0; j < height; j++) {
Organism o = world[i][j].visitor;
if (o == null)
continue;
if (o.getBaseColor().equals(Color.MA... | 9 |
@SuppressWarnings("static-access")
private void ROUND6() {
enemises.clear();
System.out.println("Round6!!!!!!");
for (int i = 0; i < level.getWidth(); i++) {
for (int j = 0; j < level.getHeight(); j++) {
if ((level.getPixel(i, j) & 0x0000FF) == 2) {
... | 3 |
private void chooseFormat(BufferedImage image) {
switch (image.getType()) {
case BufferedImage.TYPE_4BYTE_ABGR :
case BufferedImage.TYPE_INT_ARGB :
imageComponentFormat = ImageComponent.FORMAT_RGBA;
textureFormat = Texture.RGBA;
break;
... | 8 |
public static void main(String[] args) {
// fill distances with max value at the beginning
Arrays.fill(distances, Integer.MAX_VALUE);
// set distances to direct children of the node
for (int i = 0; i < GRAPH_SIZE; i++) {
if (graph[NODE][i] > 0) {
// set the d... | 9 |
public static void main(String[] args) {
Display display = new Display();
final Shell shell = new Shell(display);
shell.setLayout(new FillLayout());
Image originalImage = null;
// FileDialog dialog = new FileDialog(shell, SWT.OPEN);
// dialog.setText("Open an image file or cancel");
// String string = ... | 9 |
public static MavenVersion parse(String version) throws ParseException {
version = version.trim();
if (version.isEmpty()) {
throw new ParseException("Empty string", 0);
}
String[] dotSplit = version.split("\\.");
if (dotSplit.length > 3) {
throw new ParseE... | 9 |
public void zeroLessThan(float cutOff) {
for(int i=0; i < data.length; i++) {
double[] block = data[i];
for(int j=0; j < block.length; j++) {
if (block[j] != 0.0f && block[j] < cutOff) block[j] = 0.0f;
}
}
} | 4 |
public Distance(double conversionFactor, String name) {
super(conversionFactor, name);
} | 0 |
public double getPesoLlaveEntera(int capa, int neurona, int llave){
double peso = 0;
switch (llave) {
case 0:
peso = this.getPeso(capa, neurona, THRESHOLD);
break;
case 1:
peso = this.getPeso(capa, neurona, EMBARAZOS);
break;
case 2:
peso = this.getPeso(capa, neurona, CONCENTRACION_G... | 9 |
private int checkForMultiple(List<Card> hand)
//TODO bugs bugs bugs
{
List<Card> newHand = new ArrayList<Card>();
for(int i = 0 ; i < 5 ; i++)
{
newHand.add(null);
}
int multipleReturn = 1;
int multipleCheck = 1;
int startValue = 0;
for (int i = 0 ; i < hand.size()-1 ; i++)
{
multipleCheck ... | 8 |
public void setSource(File file) throws IOException {
File original = file;
m_structure = null;
setRetrieval(NONE);
if (file == null)
throw new IOException("Source file object is null!");
// try {
String fName = file.getPath();
try {
if (m_env == null) {
m_e... | 7 |
private static char lookupEntity(String val){
Character v=(Character)htmlEntities.get(val);
if(v==null) return (char)0;
return v.charValue();
} | 1 |
public final void setRange(double minValue, double maxValue)
{
// Check for unusual values
if (minValue == Double.NaN)
minValue = 0;
if (maxValue == Double.NaN)
maxValue = 0;
// conserve slider value
double[] sliderValues = new double[sliders.size()];
for (int i = 0; i < sliderValue... | 5 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final CidadeOrigem other = (CidadeOrigem) obj;
if (this.IdCidadeOrigem != other.IdCidadeOrigem && (this.IdCidad... | 5 |
public void parsercommand(String componentType,String componentName, String command)
{
Component component= engine.getPowerPlantComponent(componentName);
if(component.getName() =="valve")
{
InfoPacket i = new InfoPacket();
i.namedValues.add(new Pair<String>(Pair.Label.cNme, component.getName()));
... | 6 |
private void linearize_recursive_single(ArrayList<LUSTree> seq, boolean use_combos){
//This is the end of a sequence
if (branches.isEmpty())
seqs.add(seq);
//Otherwise, branch
else{
int len = branches.size(), i = 0;
for (LUSTree node: branches){
//We need to copy the sequence, so it isn't o... | 3 |
private Token scaenOpCodeOrLiteral(final CharStream line) throws AssemblerSyntaxException {
if (!CharUtils.isAlpha(line.getCurrentChar())) {
throw new AssemblerSyntaxException(
String.format("Opcodes or literals must start with alpha character at column %d!", line.getIndex()),
... | 6 |
public int findKiller() {
int killer = c.playerId;
int damage = 0;
for (int j = 0; j < Config.MAX_PLAYERS; j++) {
if (PlayerHandler.players[j] == null)
continue;
if (j == c.playerId)
continue;
if (c.goodDistance(c.absX, c.absY, PlayerHandler.players[j].absX, PlayerHandler.players[j].absY, 40)
... | 7 |
public String getSignatureAndPermissions(){
String s = getSignature();
for (String perm : permissions)
s += " " + perm;
return s;
} | 1 |
public <T extends Sprite<?>> Set<T> getSpritesOfType(Class<T> type) {
Set<T> result = new HashSet<T>();
for (Sprite<?> sprite : sprites) {
if (type.isInstance(sprite)) {
result.add(type.cast(sprite));
}
}
return result;
} | 4 |
private boolean QueryCompareFormatTwo(LinkedHashMap<String, List<String>> queryvalue, LinkedHashMap<String,List<String>> borrowlistvalue){
if( (borrowlistvalue.containsKey("name") && borrowlistvalue.get("name").equals((queryvalue.get("name")))) &&
(borrowlistvalue.containsKey("birthday") && borrowlistvalue.get... | 5 |
final public String string(boolean requireEOF) throws ParseException {
Token t = null;
t = jj_consume_token(STRING);
eof(requireEOF);
{if (true) return t.image.substring(1, t.image.length()-1);}
throw new Error("Missing return statement in function");
} | 1 |
@Override
public AnnotationVisitor visitParameterAnnotation(final int parameter,
final String desc, final boolean visible) {
AnnotationNode an = new AnnotationNode(desc);
if (visible) {
if (visibleParameterAnnotations == null) {
int params = Type.getArgumentTy... | 7 |
private void loadFromFile()
{
JFileChooser jfc = new JFileChooser();
if( jfc.showOpenDialog(this) != JFileChooser.APPROVE_OPTION)
return;
if( jfc.getSelectedFile() == null)
return;
File chosenFile = jfc.getSelectedFile();
try
{
BufferedReader reader = new BufferedReader(new FileReade... | 7 |
private void processKey(KeyEvent e) {
int keyCode = e.getKeyCode();
System.out.println("Key press:"+keyCode);
// termination keys
// listen for esc, q, end, ctrl-c on the canvas to
// allow a convenient exit from the full screen configuration
if ((keyCode == KeyEvent.VK_ESCAPE) || (keyCode == KeyEvent.VK_Q... | 7 |
public static The5zigMod getInstance() {
return instance;
} | 0 |
private void newPixelRun() {
final Thread current = Thread.currentThread();
//if(animated) DjVuOptions.err.println("bcr newPixelRun "+this);
if (source != null) {
for (int i = 0;;) {
if (threadArray[NEWPIXEL_THREAD] != current) {
break;
... | 8 |
private void initLayout() {
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
this.add(Box.createRigidArea(new Dimension((FRAME_WIDTH / 100) * 2, FRAME_HEIGHT / 5)));
for (JLabel label : labels) {
setLabelParam(label);
this.add(label);
this.add(Box.creat... | 1 |
public static void init(String Db){
if(StringHelper.isNullOrEmpty(Db) || Db.equalsIgnoreCase("Oracle")) {
IdentityCurrVal = "SELECT {0}.currval FROM DUAL";
IdentityNextVal = "{0}.nextval";
SelectVal = "SELECT * FROM {0}";
AppendWhereVal = "new Operation(\"ROWNUM\"... | 7 |
public static LineNumberReader getPositionFileReader(String fileName) throws PositionFileException {
LineNumberReader reader = null;
String name = null;
if(fileName == null) {
JFileChooser fc = new JFileChooser(AppConfig.getAppConfig().getLastSelectedFileDirectory());
fc.setDialogTitle("Select input file... | 6 |
@Override
public Intersection findIntersect(Ray r) {
Vector o = r.getOrigin();
Vector d = r.getDirection();
Vector local_z = p2.sub(p1).norm();
Vector local_x = d.cross(local_z).norm();
Vector local_y = local_z.cross(local_x).norm();
Vector w = o.sub(p1);
Vector o_local = new Vector(w.dot(local_x), w.dot... | 8 |
void loadTemplatesSimple()
{
Templates.addElement(loadTemplate("circle CCW", TemplateData.circlePointsCCW));
Templates.addElement(loadTemplate("circle CW", TemplateData.circlePointsCW));
Templates.addElement(loadTemplate("rectangle CCW", TemplateData.rectanglePointsCCW));
Templates.addElement(loadTemplate("rec... | 0 |
public ClassroomPanel(DataStore ds) {
super();
this.cp = this;
this.dataStore = ds;
this.classrooms = dataStore.getClassrooms();
this.treenodes = new HashMap<ClassType, DefaultMutableTreeNode>();
this.addComponentListener(new ComponentAdapter() {
public void componentShown(ComponentEvent e) {
... | 1 |
public String[] getCMD() {
if (!connected)
return null;
if (stability == NO_CONNECTION) {
return buildCMD(CMD.CONNECTION_LOST);
}
try {
String[] cmd = inFromClient.readLine().trim().split(SPLITTER);
if (stability != STABLE) {
stability++;
log("stability: " + stability);
}
if (cmd[0].... | 5 |
public static boolean isReservedClosedParen(String candidate) {
int START_STATE = 0;
int TERMINAL_STATE = 1;
char next;
if (candidate.length()!=1){
return false;
}
int state = START_STATE;
for (int i = 0; i < candidate.length(); i... | 5 |
private void displayTiles(Terminal term, int left, int top) {
for (int x = 0; x < this.screenWidth; x++) {
for (int y = 0; y < this.screenHeight; y++) {
int wx = x+left;
int wy = y+top;
if (Game.game.world.getDiscovered(wx, wy)) {
if (Game.game.player.canSee(wx, wy))
term.write(Game.game.wor... | 7 |
protected static Ptg calcNormdist( Ptg[] operands )
{
if( operands.length < 4 )
{
return new PtgErr( PtgErr.ERROR_VALUE );
}
try
{
//If mean or standard_dev is nonnumeric, NORMDIST returns the #VALUE! error value.
double x = operands[0].getDoubleVal();
double mean = operands[1].getDoubleVal();
... | 7 |
private void checkActionsInContent() {
if (mInput.up() && currentSectionNumber > 0) {
changeSelectedSection(-1);
} else if (mInput.down() && currentSectionNumber < sections.length - 1) {
changeSelectedSection(1);
} else if (mInput.action()) {
mSection = new Se... | 6 |
@Override
public void mouseWheelMoved(MouseWheelEvent e) {
incrementStroke(e.getPreciseWheelRotation());
int size = getStrokeSize();
if (size < 0) {
stroke = 0;
}
detailsPanel.getStrokeSize().setText("Stroke size: " + stroke);
} | 1 |
private int getSelected(double x, double y)
{
for (int i = selindex+1; i < shapeList.size(); i++)
{
if (shapeList.get(i).contains(x, y))
{
shapeList.get(i).highlight(true);
return i;
}
}
return -1;
} | 2 |
public void countAnswers()
{
countA = 0;
countB = 0;
countC = 0;
countD = 0;
for (int key : database.keySet())
{
if(database.get(key).equals('A'))
{
countA += 1;
}
if(database.get(key).equals('B'))
{
countB += 1;
}
if(database.get(key).equals('C'))
{
countC += ... | 5 |
public static void main(String[] args) {
String usage = "java org.apache.lucene.demo.IndexFiles"
+ " [-index INDEX_PATH] [-docs DOCS_PATH] [-update]\n\n"
+ "This indexes the documents in DOCS_PATH, creating a Lucene index"
+ "in INDEX_PATH that can be searched with SearchFiles";
String indexPath = "inde... | 9 |
@Override
public Value evaluate(Value... arguments) throws Exception {
if (arguments.length != 2) {
throw new EvalException("add support only two argument!");
}
Value arr = new Value(arguments[0]);
Value val = arguments[1];
if (arr.getType() == ValueType.ARRAY) {
... | 4 |
@Override
public boolean isApplicable(Integer current, Integer target)
{
for (Conditional condition : conditions)
{
if (!condition.isApplicable(current, target))
return false;
}
return true;
} | 2 |
public final void terminarPara() throws RecognitionException {
try {
// fontes/g/CanecaSemantico.g:862:2: ( ^( PARA_ . . . . ) )
// fontes/g/CanecaSemantico.g:862:4: ^( PARA_ . . . . )
{
match(input,PARA_,FOLLOW_PARA__in_terminarPara2358); if (state.failed) return... | 9 |
public static void affineMatrixFill(AlignmentGraphBasic d)
{
AlignmentGraphBasic e = new AlignmentGraphBasic(d);
AlignmentGraphBasic f = new AlignmentGraphBasic(d);
int x,y;
d.setMatrix(0,0,0);
for(x=1;x<d.getMatrixXLength();x++)
{
e.setMatrix(0, x,(e.getEffort()[0]+x*e.getEffort()[1]));
d.setMatrix(... | 4 |
public ArrayList<Product> getProducts(String filter) {
ArrayList<Product> products = new ArrayList<Product>();
try {
Connection conn = openConnection();
Statement stat = conn.createStatement();
Statement stat2 = conn.createStatement();
ResultSet rs = stat.executeQuery("select * from "
+ DB_PRODUCT_... | 4 |
private void calculatePath() {
Shape rectangle = new RoundRectangle2D.Float( x, y, width, height, arc, arc );
Triangle triangle = null;
AffineTransform at = new AffineTransform();
switch( tabLocation ) {
case TAB_AT_RIGHT:
if( anglePosition == NONE ) {
triang... | 7 |
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 boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Redirects)) {
return false;
}
Redirects other = (Redirects) object;
if ((this.url == null && other.url != null)... | 5 |
void close ()
throws USBException
{
if (fd < 0)
return;
try {
// make sure this isn't usable any more
int status = closeNative (fd);
if (status < 0)
throw new USBException (
"error closing device",
-status);
} finally {
// make sure nobody else sees the device
usb.remov... | 2 |
public static int lengthOfLongestSubstring(String s) {
int max = 0;
int len = s.length();
int[] hash = new int[256];
int[] first = new int[len+1];
int[] next = new int[len];
first[len] = len;
for (int i = len - 1; i >= 0; i--) {
int index = hash[s.charAt(i)];
next[i] = index == 0 ? len : index;
h... | 5 |
private void detached() {
// Transient session self-destructs after peer disconnects.
if (!connect) {
terminate ();
return;
}
// For delayed connect situations, terminate the pipe
// and reestablish later on
if (pipe != null && options.delay_at... | 9 |
private Point getPointFromMyo(double pitch, double yaw) {
Point point = new Point();
double x, y;
if (topGreater) {
y = HEIGHT - (((pitch - info.getPitchBottom()) / (info.getPitchTop() - info.getPitchBottom())) * HEIGHT);
} else {
y = ((pitch - info.getPitchTop()) / (info.getPitchBottom() - info.getPitchT... | 6 |
public static Object ungz(String string) {
//DetectRight.checkPoint("base64");
if (string == null) return null;
if (PHPSerializer.isSerialized(string)) return Functions.unserialize(string);
byte[] byt;
//DetectRight::checkPoint("GZDecode");
try {
byt = Functions.base64_decode(string);
byt = Functions.... | 9 |
private void thisMouseClicked(MouseEvent e) {
x = e.getX();
y = e.getY();
repaint();
} | 0 |
public Identifier getIdentifier(String fieldName, String typeSig) {
for (Iterator i = getChilds(); i.hasNext();) {
Identifier ident = (Identifier) i.next();
if (ident.getName().equals(fieldName)
&& ident.getType().startsWith(typeSig))
return ident;
}
if (superName != null) {
ClassIdentifier sup... | 6 |
public static int[] GetUser(String username, String password){
try
{
String query = String.format("SELECT * FROM APPUSERS WHERE USERNAME = '%s' AND PASSWORD ='%s'", username, password);
int[] udetails = new int[2];
ResultSet rs = getQueryResults(query);
while (... | 2 |
public Network() {
stations = new ArrayList<String>();
} | 0 |
static final String method1273(int[] is, boolean bool) {
anInt2161++;
StringBuffer stringbuffer = new StringBuffer();
int i = Class239_Sub1.anInt5850;
for (int i_24_ = 0; is.length > i_24_; i_24_++) {
Class321 class321
= Class348_Sub23_Sub2.aClass187_9036.method1408(-12637,
is[i_24_]);
if ((((Cl... | 6 |
public void launchNext(final int wexp, final int ah) {
Thread subExpThread;
subExpThread = new Thread() {
public void run() {
m_remoteHostsStatus[ah] = IN_USE;
m_subExpComplete[wexp] = TaskStatusInfo.PROCESSING;
RemoteExperimentSubTask expSubTsk = new RemoteExperimentSubTask();
expSubTs... | 9 |
public GroupCommand(TotalPermissions p) {
plugin = p;
} | 0 |
public List<ClassObj> getClassTable(PreparedStatement pre) {
List<ClassObj> items = new LinkedList<ClassObj>();
try {
ResultSet rs = pre.executeQuery();
if (rs != null) {
while (rs.next()) {
ClassObj item = new ClassObj();
i... | 3 |
public String removeTags(String str)
{
//str.replaceAll("<+[^>]+>", "");
int index = 0;
String finalString = "";
while(index < str.length())
{
if(str.charAt(index) == '<')
{
while(str.charAt(index) != '>')
{
... | 3 |
private static ArrayList<Object> getWFIPathRec(mxAnalysisGraph aGraph, Object[][] paths, Object startVertex, Object targetVertex,
ArrayList<Object> currPath, mxCostFunction cf, mxGraphView view) throws StructuralException
{
Double sourceIndexD = cf.getCost(view.getState(startVertex));
Object[] parents = paths[s... | 3 |
@Override
public <T> ValueParser<? extends T> getParser(Class<T> clazz)
throws ParserFactoryException {
Class<? extends ValueParser<?>> parserCls = parserClasses.get(clazz);
if (parserCls != null) {
try {
@SuppressWarnings("unchecked")
ValuePar... | 9 |
@Override
public MidiChannel[] getChannels() {
MidiChannel[] oldC = super.getChannels();
ArrayList<MidiChannel> rem = new ArrayList<MidiChannel>();
int ordinal = 1;
for (MidiChannel m : oldC) {
if (ordinal == Values.DRUMCHANNEL) {
ordinal++;
... | 4 |
public void dumpExpression(TabbedPrintWriter writer)
throws java.io.IOException {
Type flat = type.getCanonic();
int depth = 0;
while (flat instanceof ArrayType) {
flat = ((ArrayType) flat).getElementType();
depth++;
}
writer.print("new ");
writer.printType(flat.getHint());
for (int i = 0; i < de... | 3 |
private boolean r_verb_suffix() {
int among_var;
int v_1;
int v_2;
int v_3;
int v_4;
// (, line 175
// setlimit, line 176
v_1 = limit - cursor;
// tomark, line 176
... | 8 |
public String convertToString() {
String word = "";
for (Letter letter : letterChain) {
word += letter.getLetter();
}
return word;
} | 1 |
public String[] getCategories() {
return categories;
} | 0 |
public int getMaxFilledBlock(){
int max = 1;
for (int step = 2; step < block.size(); step *= 2){
boolean stepIsReasonable = false;
for (int i = 0; i < block.size(); i += step){
boolean noDifference = true;
for (int k = i; k < i + step - 1; ++k){
... | 6 |
private String bindResourceAndEstablishSession(String resource) throws XMPPException {
// Wait until server sends response containing the <bind> element
synchronized (this) {
if (!resourceBinded) {
try {
wait(30000);
}
catch... | 8 |
public int getRosterAvailabilityCode (Date date) {
// check roster's availability code for the date. Default is non available
for (RosterAvailability ra : rosterAvailability) {
if (ra.getDate().compareTo(date) == 0)
return ra.getAvailabilityCode();
}
return RosterAvailability.ROSTER_ABSENT;
} | 2 |
public static void main(String[] args) throws Exception {
print("Memory allocated: " + memory + " MB");
if (Debug.splashlogo == true) {
JFrame preload = new JFrame("Loading...");
com.sun.awt.AWTUtilities.setWindowOpacity(preload, 0.8f);
preload.setBounds(450, 300, 528, 3... | 6 |
static void unzip(File targetDir, File zipFile) {
int BUFFER = 4096;
try {
FileInputStream fis = new FileInputStream(zipFile);
ZipInputStream zis = new ZipInputStream(new BufferedInputStream(fis));
ZipEntry entry;
int count;
byte data[] = new b... | 3 |
public void runLogic(){
checkAces();
hitMe();
bust =checkBust();
} | 0 |
public synchronized void addEntry(int cashpointNr,double price, int abgKunden, String productNames, String pricelist, int queuesize){
BalanceEntry balanceEntry = null;
if(getBalanceEntry(cashpointNr) != null){
balanceEntry = getBalanceEntry(cashpointNr);
balanceEntry.addPrice(price);
balanceEntry.setAbKund... | 3 |
public NormalMove(Player player, Board board, Piece piece, Field from, Field to) {
super(player, board, piece, from, to);
} | 0 |
final public SimpleNode Start() throws ParseException {
/*@bgen(jjtree) Start */
SimpleNode jjtn000 = new SimpleNode(JJTSTART);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
try {
Expression();
jj_consume_token(LF);
jjtree.closeNodeScope(jjtn0... | 9 |
@XmlTransient
public Collection<Observacion> getObservacionCollection() {
return observacionCollection;
} | 0 |
public static String getJRobinHomeDirectory() {
String className = Util.class.getName().replace('.', '/');
String uri = Util.class.getResource("/" + className + ".class").toString();
if(uri.startsWith("file:/")) {
uri = uri.substring(6);
File file = new File(uri);
// let's go 5 steps backwards
for(int... | 4 |
String readLabel() {
return label;
} | 0 |
private void persist(PersistAction persistAction, String successMessage) {
if (selected != null) {
this.setEmbeddableKeys();
try {
if (persistAction != PersistAction.DELETE) {
this.ejbFacade.edit(selected);
} else {
... | 8 |
public static void act(Unit unit) {
// NOT cloaked.
if (!unit.isCloaked()) {
if (unit.getEnergy() > 10 && TechnologyManager.isWraithCloakingFieldResearched()) {
unit.cloak();
UnitActions.useTech(unit, TechnologyManager.CLOAKING_FIELD);
}
}
// CLOAKED.
else {
double nearestEnemyDist = xvr.ge... | 6 |
public World getLoadedWorld() {
return loadedWorld;
} | 0 |
public int checkPTW()
{
if(cornerMap.get("P").equals("P")
&& cornerMap.get("T").equals("T")
&& cornerMap.get("W").equals("W"))
{
return SOLVED;
}
if(cornerMap.get("P").equals("W")
&& cornerMap.get("T").equals("P")
&& cornerMap.get("W").equals("T"))
{
return CW;
}
if(cornerMap.get("P... | 9 |
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.