text stringlengths 14 410k | label int32 0 9 |
|---|---|
public int command(int cmd) {
if (cmd_pending) // If this is the second word of a command
{
int A14_15 = (cmd & 0x0003) << 14;
rw_addr = (rw_addr & 0xffff3fff) | A14_15;
// Copy rw_addr to mirror register
rw_addr = (rw_addr & 0x0000ffff) | (rw_addr << 16)... | 9 |
final String _readComment_() throws IOException {
final Reader source = this._reader_;
final StringBuilder result = this._builder_;
result.setLength(0);
while (true) {
int symbol = source.read();
switch (symbol) {
case -1:
case '\r':
case '\n':
return result.toString();
case '\\':
... | 5 |
public void setMaxSpyDepth(int maxSpyDepth) {
this.miningDepth = maxSpyDepth;
} | 0 |
@Override
public boolean onCommand(CommandSender sender, Command command, String label,
String[] args) {
String lbl = label.toLowerCase();
// label must be help
if(lbl.equalsIgnoreCase("help")) {
String nested;
// get first argument (could be one of the commands)
try {
nested = args[0];
... | 6 |
public static void call(final String mapping, final String data) throws Exception {
Iterator errors = null;
DataError dataError = null;
final Parser pzparser = DefaultParserFactory.getInstance().newFixedLengthParser(new File(mapping), new File(data));
final DataSet ds = pzparser.parse();... | 6 |
public static void main(String args[]) throws InvocationTargetException, InterruptedException {
new Thread() {
public void run() {
CardFrame frame = new CardFrame();
try {
Thread.sleep(200);
} catch (InterruptedException e) {
... | 1 |
public JSONArray getJSONArray(int index) throws JSONException {
Object object = this.get(index);
if (object instanceof JSONArray) {
return (JSONArray) object;
}
throw new JSONException("JSONArray[" + index + "] is not a JSONArray.");
} | 1 |
public void aboutCourse() {
System.out.println("Course name: "+ name);
System.out.println("Hours: " + hours);
} | 0 |
public static Stella_Object justificationArgumentBoundTo(Stella_Object argument, Justification justification) {
if (Surrogate.subtypeOfP(Stella_Object.safePrimaryType(argument), Logic.SGT_LOGIC_PATTERN_VARIABLE)) {
{ PatternVariable argument000 = ((PatternVariable)(argument));
if (justification == nu... | 9 |
@Override
public void keyPressed(KeyEvent e)
{
switch (e.getKeyCode())
{
case KeyEvent.VK_DOWN:
{
downPressed=true;
}
break;
case KeyEvent.VK_UP:
{
upPressed=true;
}
break;
case KeyEvent.VK_RIGHT:
{
rightPressed=true;
}
break;
case KeyEvent.VK_... | 6 |
public ArrayList<String> getProperties(){
ArrayList<String> commands = new ArrayList<String>();
try {
r = new BufferedReader(new FileReader(config));
} catch (IOException e) {
}
String temp;
try {
while((temp = r.readLine()) != null){
commands.add(temp.substring(temp.indexOf(": ")));
}
... | 3 |
@Override
public boolean contains(final String column) {
final Iterator<ColumnMetaData> cmds = ParserUtils.getColumnMetaData(row.getMdkey(), metaData).iterator();
while (cmds.hasNext()) {
final ColumnMetaData cmd = cmds.next();
if (cmd.getColName().equalsIgnoreCase(column)) {... | 2 |
Object callChunk(ScriptContext context) throws ScriptException {
try {
// Apply context
Object[] argv;
if (context != null) {
// Global bindings
Bindings bindings;
bindings = context.getBindings(ScriptContext.GLOBAL_SCOPE);
if (bindings != null) {
applyBindings(bindings);
}
// E... | 8 |
@Override
public boolean onCommand(CommandSender sender, Command command, String label,
String[] args) {
plugin.debugMsg("PvPTime command:" + label.toString());
if(args.length > 0) {
plugin.debugMsg("Args length: " + args.length);
if(args[0].equalsIgnoreCase("relo... | 3 |
public static void postData(String url, JSONObject obj) throws IOException {
URL posturl = new URL(url);
HttpURLConnection con;
if (ApiProperties.get().getUrl().contains("https")) {
setupConnection();
con = (HttpsURLConnection) posturl.openConnection();
} else {
con = (HttpURLConnection) posturl.openCo... | 4 |
@Override
public void update(Observable o, Object arg) {
if (arg instanceof SearchModel) {
this.model = (SearchModel) arg;
}
/**-50 to count for the offset of the textbox*/
show(this.textField, -50, this.textField.getHeight());
List<PictureObject> pictures = this.model.getPictures();
this.setListItem... | 5 |
public void setValue(int i) {
if (this.slider != null) {
this.slider.setValue(i);
}
if (this.spinner != null) {
this.spinner.setValue(new Integer(i));
}
} | 2 |
void readSessions()
{
Sheet sessions_sheet = workbook.getSheet("Sessions");
for (int si = 1; si < sessions_sheet.getRows(); si++)
{
String name = sessions_sheet.getCell(0, si).getContents();
String title = sessions_sheet.getCell(1, si).getContents();
Strin... | 8 |
private boolean inRange(Unit unit)
{
int dist = Math.abs(unit.getX() - x) + Math.abs(unit.getY() - y);
return dist >= getMinRANGE() && dist <= getMaxRANGE();
} | 1 |
public void render(Graphics g){
// if(!walkable){
// g.drawImage(wall, x, y);
// return;
// }
//g.drawImage(floor, x, y);
// if(minion != null){
// g.setColor(Color.white);
// g.fillRect(x, y, width, height);
// minion.render(g,x,y);
// //return;
// }
g.setColor(Color.transparent);
if(start){
// ... | 9 |
public static Cause findCauseById(ArrayList<Cause> causes, int id) {
for(Cause cause:causes) {
if(cause.getId()==id) {
return cause;
}
}
return new Cause();
} | 2 |
public ErrorPanel() {
setBackground(Color.BLACK);
addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
if(ar && !running) {
HavenApplet.this.remove(ErrorPanel.this);
startgame();
}
}
});
} | 2 |
public static void main(String[] args) throws NumberFormatException,
IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(br.readLine());
for (int i = 0; i < n; i++) {
String[] in = br.readLine().split(" ");
String a = in[0];
String b = in[1]... | 6 |
@Override
public String transform(String s) {
StringBuilder sb = new StringBuilder();
if (s != null){
if (this.removeMultipleWhitespaces) {
s = SqueezeWhitespaceTransformer.MULTIPLE_WHITESPACE.matcher(s).replaceAll(" ");
}
if (this.trimIt) {
s = s.trim();
}
Matcher m = regex.matcher(s);
... | 5 |
@Override
public void actionPerformed(ActionEvent e) {
try {
conn = DriverManager.getConnection(Utils.DB_URL);
PreparedStatement checkStat;
checkStat = conn.prepareStatement("select name from user where name = ?");
checkStat.setString(1, textField.getText());
... | 5 |
@Override
public void visitLdcInsn(final Object cst) {
Item i = cw.newConstItem(cst);
// Label currentBlock = this.currentBlock;
if (currentBlock != null) {
if (compute == FRAMES) {
currentBlock.frame.execute(Opcodes.LDC, 0, cw, i);
} else {
... | 8 |
private void reactToPartChange(IWorkbenchPartReference part) {
if (!autoSync)
return;
if (!(part.getPart(false) instanceof IEditorPart))
return;
IEditorPart editorPart = (IEditorPart) part.getPart(false);
if (!getViewSite().getPage().isPartVisible(editorPart))
... | 7 |
protected String getBestDistance(long d)
{
String min=null;
final long sign=(long)Math.signum(d);
d=Math.abs(d);
for(SpaceObject.Distance distance : SpaceObject.DISTANCES)
{
if((distance.dm * 2) < d)
{
double val=(double)d/(double)distance.dm;
if((val<0)||(val<100))
val=Math.round(val*100.... | 7 |
public Object localise()
{
Object o = null;
try
{
Class<?> c = Class.forName(Obj_Name+"_stub");
Constructor<?> constructor = c.getConstructor(String.class, int.class);
o = constructor.newInstance(IP_adr, Port);
} catch (InstantiationException e) {
// TODO A... | 9 |
protected void btnSairActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSairActionPerformed
if(JOptionPane.showConfirmDialog(rootPane, "Você tem certeza que deseja sair ?","",JOptionPane.OK_CANCEL_OPTION) == 0){
this.dispose();
}
}//GEN-LAST:event_btnSairActionPerformed | 1 |
public static void elevTilFil(ArrayList<Elev> minListe)
{
Formatter output = null;
try
{
//For å skrive til fil må jeg bruke klassen FileWriter
FileWriter fileWriter = new FileWriter("elever.txt", true);
output = new Formatter (fileWriter);//åpner fila elever.txt for skriving, hvis den ikke finnes, ... | 5 |
private void fireCellSelectionChangeNotification() {
if ( _locked) {
return;
}
Set<CellKey> changedKeys = new HashSet<CellKey>();
for(CellKey oldKey : _oldCellKeys) {
if(!isCellKeySelected(oldKey)) {
changedKeys.add(oldKey);
}
}
for(CellKey selectedKey : _selectedCellKeys) {
if ( !_oldCellKe... | 7 |
@Override
public <T> T sudo(final SudoAction<T> c) throws LoginException, SudoExecutionException {
final Subject s = createSubject(c);
// save the current security context...
final SecurityContext secCtx = SecurityContext.getCurrent();
final LoginContext lc;
if(c.g... | 6 |
public static double meandev(double[] vals) {
double mean = mean(vals);
int size = vals.length;
double sum = 0;
for (int i = size; --i >= 0;) {
sum += Math.abs(vals[i] - mean);
}
return sum / size;
} | 1 |
private RenderableObject generateElipse(Scanner inFile) {
Point s = null, e = null, loc = null;
int thickness = 0;
Color c = null;
String current = inFile.next();
while (inFile.hasNext()
&& !(isCloseTag(current) && parseTag(current) == LegalTag.Object)) {
if (isOpenTag(current)) {
switch (parseTag(... | 9 |
public void set(String in, int field,Scanner s) {
switch(field){
case 1:
number = in;
break;
case 2:
name = in;
break;
case 3:
address = in;
break;
case 4:
city = in;
break;
case 5:
while (in.length() != 2){
System.out.println("Please enter a valid state: ");
i... | 9 |
private void miNewActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_miNewActionPerformed
if (story.isSomethingChanged()) {
// Show save confirm window
int n = JOptionPane.showConfirmDialog(null,
"You made one or several changes to the current story.\... | 6 |
public Contenu getContenu(Agent joueur){
if (wumpus==true && !joueur.getWumpusTue()){return Contenu.WUMPUS;}
else if (pit==true){return Contenu.TROU;}
else if (gold==true){return Contenu.OR;}
else if (joueur.getPosition().getXReel()==this.coord.getX()&&joueur.getPosition().getYReel()==this.coord.getY())/*agent=... | 6 |
private static byte[] appendByteArrays( byte[] arrayOne, byte[] arrayTwo,
int length )
{
byte[] newArray;
if( arrayOne == null && arrayTwo == null )
{
// no data, just return
return null;
}
else if( arrayOne ... | 4 |
public void setWidth(int width)
{
marker[markers-1].setWidth(width);
} | 0 |
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 |
private void setTextUnderIcons() {
//if showTextunderButtons is true, the text will
//not be shown
if(!showText)
{
startRecordButton.setText(null);
stopRecordButton.setText(null);
hearMusicButton.setText(null);
scheduleButton.setText(null);
infoButton.setText(null);
deleteButton.setText(null... | 3 |
public boolean equals(Object obj){
if(obj==null){
return false;
}
if(getClass()!=obj.getClass()){
return false;
}
BloomFilter<E> o2 = (BloomFilter<E>) obj;
final BloomFilter<E> other=o2;
if(this.expectedNumOfElements!=other.expectedNumOfElements){
return false;
}
if(this.k!=other.k){
re... | 8 |
private static String getFilenameWithoutPathOrExtension( String filename )
{
String newFilename;
// Remove the ".java" extension from the filename, if it exists
int extensionIndex = filename.lastIndexOf( ".java" );
if ( extensionIndex == -1 )
{
newFilename = filen... | 2 |
@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 DatasetType)) {
return false;
}
DatasetType other = (DatasetType) object;
if ((this.key == null && other.key !=... | 5 |
public static void main(String[] args) {
int BITS_PER_LINE = 16;
if (args.length == 1) {
BITS_PER_LINE = Integer.parseInt(args[0]);
}
int count;
for (count = 0; !BinaryStdIn.isEmpty(); count++) {
if (BITS_PER_LINE == 0) { BinaryStdIn.readBoolean(); contin... | 7 |
public static void releaseAll() {
if (isDiagnosticsEnabled()) {
logDiagnostic("Releasing factory for all classloaders.");
}
synchronized (factories) {
Enumeration elements = factories.elements();
while (elements.hasMoreElements()) {
LogFactory... | 3 |
private static void initGussian(Composite inComposite, int heightHint) {
final Composite toolbar = new Composite(inComposite, SWT.BORDER);
final Composite gaussion = new Composite(inComposite, SWT.BORDER);
GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
gridData.grabExcessHorizontalSpace = true;
... | 2 |
public void defocus(Configuration configuration) {
setNormal(configuration);
Configuration parent = configuration;
parent.setFocused(false);
while (parent.getParent() != null) {
parent = parent.getParent();
parent.setFocused(false);
}
} | 1 |
@Override
public String process(String content) throws ProcessorException {
// TODO Auto-generated method stub
pipeline = new SimpleAuthenticationPipeline();
context = new AuthorizeContext();
pipeline.setBasic(new AuthEntryValve());
pipeline.addValve(new FlushValve());
pipeline.addValve(new EncodeValve())... | 3 |
private void btnSalvarMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnSalvarMouseClicked
dao = new ProdutoDAO();
produto = new Produto();
produto.setNome(txtNome.getText());
produto.setValorcompra(Double.parseDouble(txtValorCompra.getText()));
produto.setValorve... | 8 |
public int[] search (ASEvaluation ASEval, Instances data)
throws Exception {
m_best = null;
m_generationReports = new StringBuffer();
if (!(ASEval instanceof SubsetEvaluator)) {
throw new Exception(ASEval.getClass().getName()
+ " is not a "
... | 8 |
private void disconnect(Channel channel, String message) {
if (channel.isActive() && this.currentProtocol == Protocol.PLAY || this.currentProtocol == Protocol.LOGIN) {
ByteBuf header = Unpooled.buffer();
ByteBuf data = Unpooled.buffer();
ByteBufUtils.writeVarInt(data, 0x0);... | 3 |
double evaluateInstanceLeaveOneOut(Instance instance, double [] instA)
throws Exception {
DecisionTableHashKey thekey;
double [] tempDist;
double [] normDist;
thekey = new DecisionTableHashKey(instA);
if (m_classIsNominal) {
// if this one is not in the table
if ((tempDist = (double... | 8 |
public static ProjectileType parseType(String type) {
if(type.matches("PROJECTILE")) {
return PROJECTILE;
} else if(type.matches("HOMING")) {
return HOMING;
} else if(type.matches("AREA")) {
return AREA;
} else if(type.matches("ENCHANT")) {
return ENCHANT;
}
return null;
} | 4 |
public void addChar(char ch) {
ch = normalize(ch);
char lastchar = grams_.charAt(grams_.length() - 1);
if (lastchar == ' ') {
grams_ = new StringBuffer(" ");
capitalword_ = false;
if (ch==' ') return;
} else if (grams_.length() >= N_GRAM) {
... | 5 |
public static void main(String[] args) {
Random randomGenerator = new Random();
int dice;
int[] result = new int[6];
for(int i = 0; i < 1000; i++) {
dice = randomGenerator.nextInt(6) + 1;
switch(dice) {
case 1:
result[dice - 1]++;
break;
case 2:
result[dice - 1]++;
break;
c... | 7 |
protected void createContents()
{
shell = new Shell();
shell.setSize(640, 480);
shell.setText(title);
Label lblTaskTitle = new Label(shell, SWT.NONE);
lblTaskTitle.setBounds(10, 13, 64, 15);
lblTaskTitle.setText("Task Title *");
txtTitle = new Text(shell, SWT.BORDER);
txtTitle.setTextLimit(Task.M... | 5 |
@Basic
@Column(name = "pass")
public String getPass() {
return pass;
} | 0 |
public static boolean canConnect(Connector<?> c1, Connector<?> c2) {
if( c1 == null || c2 == null ) return true;
return c1.getPayloadClass() == c2.getPayloadClass() &&
c1.getConnectorType().canConnectTo(c2.getConnectorType());
} | 5 |
@RequestMapping(value = "/image_src/{imageId}", method = RequestMethod.GET)
public void imageSrc(@PathVariable String imageId, HttpServletRequest request, HttpServletResponse response)
throws Exception {
Image image = imageService.getImageBytesAndContentTypeById(imageId);
response.setContentType(image.getConten... | 0 |
public static String mkString(Collection<String> c, final String sep) {
if (c.isEmpty()) {
return "";
}
String head = c.iterator().next();
Collection<String> tail = new ArrayList<String>(c);
tail.remove(head);
return reduce(tail, new Function2<String, String>() {
@Override
public String apply... | 1 |
public FireBall(TileMap tileMap, boolean right) {
super(tileMap);
facingRight = right;
moveSpeed = 3.8;
if(right) dx = moveSpeed;
else dx = -moveSpeed;
sWidth = sHeight = 30;
width = height = 14;
BufferedImage spritesheet = new Texture("/textures/fireball.... | 3 |
private int getCollidingBouncyBlockBounciness() {
if(!collidable)
return -1;
if(!crouch || !crouchable){
if(game.getCurrentLevel().getBlockAtPixel(x,y-(height/4)) instanceof BlockBouncy){
BlockBouncy bb = (BlockBouncy) game.getCurrentLevel().getBlockAtPixel(x,y-(height/4));
return bb.getBounciness();
... | 6 |
public int[][] DFA(String pattern) {
int patternLength = pattern.length();
int[][] dfa = new int[alphabet][patternLength];
dfa[pattern.charAt(0)][0] = 1;
for (int X = 0, j = 1; j < patternLength; j++) {
for (int character = 0; character < alphabet; character++)
dfa[character][j] = dfa... | 2 |
@Override
public void update(float delta) {
handleInput();
Vector2D[] vertices = this.bounds.getVertices();
Rectangle r = (Rectangle)this.bounds;
if(vertices[0].x<limits.getPosition().x){
this.setPosition(new Vector2D(limits.getPosition().x + r.getWidth()/2,this.getPositi... | 5 |
public static boolean vectorCompare(double[] v, double[] w) {
if (v.length != w.length)
return false;
for (int i = 0; i < v.length; i++)
if (Math.abs(v[i] - w[i]) > eps)
return false;
return true;
} | 3 |
public void showField() {
for (int i = 0; i < fieldSize; i++) {
showLine(i);
System.out.println();
}
} | 1 |
public static boolean checkSumUsingSort(int[] A, int x) { // Time complexity - O(nlog(n))
if(A == null || A.length < 2)
return false;
int i, j, flag = 0;
int left = 0, right = A.length - 1;
java.util.Arrays.sort(A);
while(left < right) {
i = A[left];
j = A[right];
if(i + j == x) {
System.out.p... | 6 |
@Override
public int addRecipe(Recipe r) {
int recipeId = getNextIdAndIncrement();
try(Connection connection = DriverManager.getConnection(connectionString)){
PreparedStatement statement = connection.prepareStatement("insert into recipe (id, name, numPersons, cookingTime, restingTime, prepTime, steps) values (?... | 3 |
public static OggAudioStreamHeaders create(OggPacket firstPacket) {
if (firstPacket.isBeginningOfStream() &&
firstPacket.getData() != null &&
firstPacket.getData().length > 10) {
int sid = firstPacket.getSid();
if (VorbisPacketFactory.isVorbisStream(firstP... | 7 |
private boolean r_mark_suffix_with_optional_y_consonant() {
int v_1;
int v_2;
int v_3;
int v_4;
int v_5;
int v_6;
int v_7;
// (, line 153
// or, line 155
lab0: do {
... | 9 |
public boolean leapYear(int year){
boolean test = false;
if(year%4 != 0){
test = false;
}
else{
if(year%400 == 0){
test=true;
}
else{
if(year%100 == 0){
... | 3 |
private static GridResource createGridResource(String name, double baud_rate,
double delay, int MTU, int totalPE, int totalMachine,
int rating, String sched_alg)
{
// Here are the steps needed to create a Grid resource:
// 1. We need to create an objec... | 4 |
public void doCopy(InputStream is, OutputStream os) throws IOException {
byte[] bytes = new byte[64];
int numBytes;
while ((numBytes = is.read(bytes)) != -1) {
os.write(bytes, 0, numBytes);
}
os.flush();
os.close();
is.close();
} | 1 |
public void setEvent(Event event) {
this.event = event;
event.getParticipants().add(this);
} | 0 |
public void mouseUp(MouseEvent e, int x, int y) {
if ( isCheckerFigure(draggedFigure) ) {
Location from = Convert.xy2Location(originalPt.x, originalPt.y);
Location to = Convert.xy2Location(e.getX(), e.getY());
draggedFigure.moveBy(originalPt.x - e.getX(), originalPt.y - e.getY());
if( ... | 4 |
public void setIndex(int i) {
if (i < 0) {
idx = 0;
} else if (i > len) {
idx = len;
} else {
idx = i;
}
} | 2 |
@EventHandler
public void onTeleport(PlayerTeleportEvent e) {
Player p = e.getPlayer();
World world = e.getFrom().getWorld();
if (utils.isValidWorld(p)) {
ConfigurationSection section = plugin.getConfig().getConfigurationSection(world.getName());
if (section == null)
return;
int newHunger = p.ge... | 3 |
@Override
public HandshakeState acceptHandshakeAsClient( ClientHandshake request, ServerHandshake response ) {
return request.getFieldValue( "WebSocket-Origin" ).equals( response.getFieldValue( "Origin" ) ) && basicAccept( response ) ? HandshakeState.MATCHED : HandshakeState.NOT_MATCHED;
} | 2 |
@Test public void ImageTest() {
// Test to make sure that it can't load a none existent image
boolean exceptionThrown = false;
Image img;
try {
img = new Image("not_an_image");
} catch (Exception e) {
exceptionThrown = true;
}
Assert.assertTrue(exceptionThrown);
// Test to make sure that fire.j... | 5 |
public void setActiveActivies(ActiveActivities activeActivies) {
this.activeActivity = activeActivies;
} | 0 |
public boolean peutPrendreEnCharge(Navire n) {
//vérifie le type
if(prendEnCharge(n.getTypeMachandise())) {
//Vérifie qu'il y a assez de place pour le prendre
if(_naviresAQuai.isEmpty()) {
if(_longueurMetre>=n.getLongueurMetre()) {
return true;... | 4 |
@Override
public void mouseClicked(MouseEvent e) {
if(SwingUtilities.isRightMouseButton(e))
{
if (sfap.hand == 1)
{
NewMapDialog dialog = new NewMapDialog();
int result = JOptionPane.showConfirmDialog(null, dialog, "Select", JOptionPane.OK_CANCEL_OPTION);
if (result == JOptionPane.OK_OPTION) {
... | 3 |
private Tree parameterListPro(){
Symbol identifier = null;
Tree identifiers = null;
if((identifier = accept(Symbol.Id.IDENTIFIER_NAME))!=null){
if(accept(Symbol.Id.PUNCTUATORS,",")!=null){
if((identifiers = parameterListPro())!=null){
return new ParameterList(identifier, identifiers);
}
... | 3 |
private Boolean checkData(String name,String surname,String pass,String pass2){
/*
* elegxei an einai swsta ta dedomena pou dothikan kai epistrefei to katalilo mnm an den einai
*/
if(name.length()<3){
JOptionPane.showMessageDialog(null, "Dwste egkiro onoma!");
return false;
}else if(surname.length()<3... | 4 |
@Override
public void changedMostRecentDocumentTouched(DocumentRepositoryEvent e) {
calculateEnabledState((OutlinerDocument) e.getDocument());
} | 0 |
public RebalanceInfo(JsonObject obj) throws RestApiException {
JsonElement e = obj.get("status");
if (e == null || e.isJsonPrimitive() == false) {
throw new RestApiException("Expected status string", obj);
}
String sStatus = e.getAsString();
if (sStatus.equals("none")) {
completed = true... | 9 |
@Override
public String execute() throws Exception {
try {
Map session = ActionContext.getContext().getSession();
User user = (User) session.get("User");
Campaign camp;
// camp=(Campaign) session.get("campa");
// Long camp1id=camp.getCampaig... | 3 |
@Override
public void valueUpdated(Setting s, Value v) {
try {
if (s.getName().equals(_RefVisibible)) {
if (switch_ != null)
switch_.setReferenceVisible(v.getBoolean());
} else if (s.getName().equals(_Reference)) {
if (switch_ != null)
switch_.setReference(v.getBoolean());
} else if (s.get... | 9 |
public com.novativa.www.ws.streamsterapi.Bar[] getBars(java.lang.String instrument, java.lang.String period, java.lang.String options) throws java.rmi.RemoteException {
if (super.cachedEndpoint == null) {
throw new org.apache.axis.NoEndPointException();
}
org.apache.axis.client.Call ... | 4 |
private int nthPrime(int n) {
while (primes.size() <= n) {
int candidate;
if (primes.size() == 0) {
candidate = 1;
} else {
candidate = primes.get(primes.size() - 1);
}
boolean isPrime;
do {
... | 7 |
public static int[] getPixels(BufferedImage img,
int x, int y, int w, int h, int[] pixels) {
if (w == 0 || h == 0) {
return new int[0];
}
if (pixels == null) {
pixels = new int[w * h];
} else if (pixels.length < w * h) {
... | 6 |
void animationMode() throws ScriptException {
float startDelay = 1, endDelay = 1;
if (statementLength < 3 || statementLength > 5)
badArgumentCount();
int animationMode = 0;
switch (statement[2].tok) {
case Token.loop:
++animationMode;
break;
case Token.identifier:
String cmd = (String) statement... | 8 |
public static boolean considerOffense(Card card, Duelist duelist) {
int c;
if (MonsterCard.class.isInstance(card)) {
MonsterCard mc = MonsterCard.class.cast(card);
MonsterCard mc2 = null;
for (c = 0; c < duelist.opponent.field.monsterzones.length; c++) {
if (duelist.opponent.field.monsterzones[c].isOpe... | 6 |
@Override
protected Boolean doInBackground() {
if (debugVerbose) { Logger.logInfo(debugTag + "Loading MC assets..."); }
setStatus("Downloading jars...");
if (!loadJarURLs()) {
return false;
}
if (!binDir.exists()) {
if (debugVerbose) { Logger.logWarn(debugTag + "binDir not found, creating: " + binDir.g... | 6 |
private void swapElementsByIndex(int firstIndex, int secondIndex) {
E firstKey = heap.get(firstIndex);
E secondKey = heap.get(secondIndex);
heap.set(firstIndex, secondKey);
heap.set(secondIndex, firstKey);
} | 0 |
@Override
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof CategoryDataset)) {
return false;
}
CategoryDataset that = (CategoryDataset) obj;
if (!getRowKeys().equals(that.getRowKeys())) {
re... | 9 |
public void setAnt(Ant ant) {
// Update Ant on this cell
this.ant = ant;
} | 0 |
public static void puzzleReady() {
boolean isWin = true;
for (SlidingPuzzlePiece thisPiece
: SlidingPuzzlePiece.getPuzzlePiece()) {
if (thisPiece.getField().getFieldCoordX() != thisPiece.getRootX()) {
isWin = false;
}
if (thisPiece.getF... | 5 |
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.