text stringlengths 14 410k | label int32 0 9 |
|---|---|
public String showListInKind(){
if(page == 0) page = 1;
size = 5;
List<Problem> list = problemDAO.findKindPage(page, size, kind);
problemList = new ProblemList();
problemList.setList(list);
return SUCCESS;
} | 1 |
@RequestMapping("/{producto}/cantidad/{cantidad}")
public ModelAndView agregarStockAProducto( @PathVariable String producto, @PathVariable Integer cantidad) {
Stock stock = Stock.getInstance();
stock.agregarStock(producto, cantidad);
Integer availableStock = stock.obtenerStockDisponible(producto);
Mod... | 0 |
public String getNAME() {
return name;
} | 0 |
@Override
public boolean update(Object item) {
conn = new SQLconnect().getConnection();
String sqlcommand = "UPDATE `Timeline_Database`.`Eventnodes` SET `description`='%s' WHERE `id`='%s';";
if(item instanceof Eventnode)
{
Eventnode newitem = new Eventnode();
newitem = (Eventnode)item;
try {
... | 2 |
public static String unescape(String string) {
int length = string.length();
StringBuffer sb = new StringBuffer();
for (int i = 0; i < length; ++i) {
char c = string.charAt(i);
if (c == '+') {
c = ' ';
} else if (c == '%' && i + 2 < length) {
... | 6 |
public static Integer valueOf(Object o) {
if (o == null) {
return null;
} else if (o instanceof Byte) {
return (int)(Byte)o;
} else if (o instanceof Integer) {
return (Integer)o;
} else if (o instanceof Double) {
return (int)(double)(Double... | 6 |
public Container load(InputStream is) throws FormatException, IOException {
byte[] magic = new byte[4];
int bytesRead = is.read(magic);
if (bytesRead < 4
|| magic[0] != 0xF0
|| magic[1] != 0x9F
|| magic[2] != 0x99
|| magic[3] != ... | 7 |
public Gem removeGem()
{
tempGem = (Gem) Bag.get(0);
this.Bag.remove(0);
return tempGem;
} | 0 |
public static boolean attempt(BufferedReader input, BufferedWriter output, Scanner sc) throws IOException
{
output.write("HELLO\n");
output.flush();
String s, t;
s=input.readLine();
if(!s.equals("HELLO. WHO ARE YOU?")){
System.out.println("PROTOCOL FAILED");
input.close();
output.close();
return ... | 8 |
public Contact getLeastRecentlySeenBucketContact()
{
final Contact[] leastRecentlySeen = new Contact[]{ null };
contacts.traverse(
new Cursor<NodeId, Contact>()
{
public SelectStatus select(Map.Entry<? extends NodeId, ? extends Contact> entry)
{
... | 4 |
@FXML
private void handleBtnNextAction(ActionEvent event) {
move(1);
} | 0 |
public void setTab(GraphicsTab tab) {
Control[] children = tabControlPanel.getChildren();
for (int i = 0; i < children.length; i++) {
Control control = children[i];
control.dispose();
}
if (this.tab != null) this.tab.dispose();
this.tab = tab;
if (tab != null) {
setDoubleBuffered(tab.getDoubleBuffered());
... | 8 |
@Override
public Converter put(String key, Converter value) {
Converter v = super.put(key, value);
if (v != null) {
throw new IllegalArgumentException("Duplicate Converter for "
+ key);
}
return v;
} | 2 |
public static void main(String[] args) {
if (args.length < 1) {
System.out.println("Usage: java -cp .:sam.jar TabixReader <in.gz> [region]");
System.exit(1);
}
try {
TabixReader tr = new TabixReader(args[0]);
String s;
if (args.length == 1) { // no region is specified; print the whole file
whil... | 6 |
private static void
checkFeature (String id, XMLReader producer)
{
int state = 0;
try {
boolean value;
// align to longest id...
final int align = 35;
for (int i = align - id.length (); i > 0; i--)
System.out.print (' ');
System.out.print (id);
System.out.print (": ");
... | 7 |
private void evalNewObjectArray(int pos, CodeIterator iter, Frame frame) throws BadBytecode {
// Convert to x[] format
Type type = resolveClassInfo(constPool.getClassInfo(iter.u16bitAt(pos + 1)));
String name = type.getCtClass().getName();
int opcode = iter.byteAt(pos);
int dimen... | 2 |
public State getCorrespondingStoppedState() {
if(state == State.MOVE_DOWN) {
return state.STOPPED_DOWN;
} else if(state == State.MOVE_LEFT) {
return state.STOPPED_LEFT;
} else if(state == State.MOVE_RIGHT) {
return state.STOPPED_RIGHT;
} else {
return state.STOPPED_UP;
}
} | 3 |
@Override
public String toString() {
return "ModelFiledDesc [filedName=" + filedName + ", filedType="
+ filedType + ", tableFiledName=" + tableFiledName + "]";
} | 0 |
private int pathFind(Pos start, int danger) throws Exception {
// ArrayList<String> sTypes;
// for(int i = 1; i < 5; i++)
// {
// for(int j = 1; j < 5; j++)
// {
// //just debugging to see the map and how it is represented from prolog
// sTypes = ... | 4 |
@Test
public void testAddBook() {
Set<StockBook> booksToAdd = new HashSet<StockBook>();
Integer testISBN = 100;
booksToAdd.add(new ImmutableStockBook(testISBN,
"*@#&)%rdrrdjtIHH%^#)$&N 37874\n \t",
"eurgqo 89274267^&#@&$%@&%$( \t", (float) 100, 5, 0, 0, 0,
false));
List<StockBook> listBooks = null... | 9 |
public int getId(){
return id;
} | 0 |
public SignatureVisitor visitParameterType() {
endFormals();
if (!hasParameters) {
hasParameters = true;
buf.append('(');
}
return this;
} | 1 |
public static String cleanURL(String url) {
if (isEmpty(url)) return "";
ArrayList<String> tmp=Functions.explode(", ",url);
url=tmp.get(0);
if (tmp.size() == 2 && Functions.strlen(tmp.get(1)) < 4) url = url + "," + tmp.get(1);
ArrayList<String> replace = new ArrayList<String>();
replace.add("\n");
replace... | 8 |
public static void cppOutputAtomicExpression(Stella_Object atom) {
{ GeneralizedSymbol testValue000 = ((GeneralizedSymbol)(atom));
if (testValue000 == Stella.SYM_STELLA_NEWLINE) {
((OutputStream)(Stella.$CURRENT_STREAM$.get())).nativeStream.println();
}
else if (testValue000 == Stella.SYM... | 6 |
public void decode( ByteBuffer socketBuffer )
{
if ( !socketBuffer.hasRemaining() || flushandclosestate )
return;
if ( DEBUG )
System.out.println( "process(" + socketBuffer.remaining() + "): {" + ( socketBuffer.remaining() > 1000 ? "too big to display" : new String( socketBuffer.array(), socketBuffer.posi... | 8 |
@Override
public boolean equals(Object o)
{
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
IntegerAggregate that = (IntegerAggregate) o;
if (value != null ? !value.equals(that.value) : that.value != null) return false;
return true;
} | 5 |
public static ListeDesMatchs getListeDesMatchs()
{
if(lm == null)
{
lm = new ListeDesMatchs(1);
return lm;
}
return lm;
} | 1 |
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
String input = null;
int[] count = new int[VOWELS.length];
int y = 0;
try {
System.out.print("Enter a string to check for vowels: ");
input = scan.nextLine().toLowerCase();
... | 5 |
@Override
public boolean preHandle(HttpServletRequest request,
HttpServletResponse response, Object handler) throws Exception {
HandlerMethod handlerMethod = (HandlerMethod) handler;
Method method = handlerMethod.getMethod();
DoubleSubmitSession annotation = method.getAnnotation(Do... | 4 |
@Override
public Auction bid(String username, int itemId) {
searches.get(searches.get(itemId));
for(Auction auc : searches.values()){
if(searches.get(itemId) != null){
auc.setCurrentBid(auc.getCurrentBid()+1);
auc.setOwner(username);
return auc;
}
}
return null;
} | 2 |
@Override
public void run() {
while(true) {
try {
System.out.println("Fps: " + fps);
fps = 0;
Thread.sleep(1000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
} | 2 |
private void placeIdentityDiscNearPlayer() {
for (Player p : grid.getAllPlayersOnGrid()) {
boolean placed = false;
int minX = (p.getPosition().xCoordinate > 1) ? p.getPosition().xCoordinate - 4 : 0;
int maxX = (grid.width - p.getPosition().xCoordinate > 1) ? p.getPosition().xCoordinate + 4 : grid.width;
... | 8 |
private static void collideFixed( Sprite A , Sprite B , float ddx , float ddy )
{
// j - для "запрыгивания" на уступы
if( ddx>ddy || (A.j>0 && ddy<A.j) ) { if( A.y>B.y ){ A.y+=ddy; } if( A.y<B.y ){ A.y-=ddy; } }
else { if( A.x>B.x ){ A.x+=ddx; } if( A.x<B.x ){ A.x-=ddx; } }
/*
if( ddx<ddy ) { if( A.x... | 7 |
public void transformMouseEvent(MouseEvent event) {
if (transformNeedsReform)
reformTransform(new Rectangle(getSize()));
Point point = new Point(), ePoint = event.getPoint();
try {
// transform.transform(ePoint, point);
transform.inverseTransform(ePoint, point);
event.translatePoint(point.x - ePoint.x... | 2 |
@SuppressWarnings("deprecation")
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label,
String[] args) {
if(Match.getMatch().getState().equals(MatchState.PREMATCH)){
for(Player player : Bukkit.getOnlinePlayers()){
Match.getMatch().getSurvivors().add(player);
}
if(Match.g... | 3 |
public Vector2 calculate(Vector2 target) {
Vector2 steeringForce = new Vector2(0f, 0f);
for(MovingEntity neighbor : minigame.birds) {
if(neighbor != entity) {
Vector2 toAgent = entity.position.minusOperator(neighbor.position);
toAgent.normalize();
toAgent = toAgent.divideBy(toAgent.length());
ste... | 2 |
private List<String[]> getCustomOutputsPropertyValue(final Properties properties) {
List<String[]> customOutputs = new ArrayList<>();
String values = this.getPropertyValue(properties, CUSTOM_OUTPUTS_TAG, null);
if (values == null) {
return null;
}
String [] outputs = values.split(OUTPUT_SEPARATOR);
for (... | 2 |
public void run() {
HttpURLConnection var1 = null;
try {
URL var2 = new URL(this.location);
var1 = (HttpURLConnection)var2.openConnection();
var1.setDoInput(true);
var1.setDoOutput(false);
var1.connect();
if(var1.getResponseCode() / 100 == 4) {
... | 3 |
private static int[][] calculateDistances2(double[][] points,int N) {
int[][] distanceMatrix= new int[N][N];
for(int i=0; i<N;i++){
for(int j=0;j<N;j++){
if(j==i){
distanceMatrix[i][j]=0;
} else if(i<j){
distanceMatrix[i][j]=distance(points[0][i],points[0][j],points[1][i],points[1][j]);
} e... | 4 |
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
int[] numbers = new int[3];
for (int i = 0; i < numbers.length; i++) {
numbers[i] = (int) (Math.random() * 10);
for (int j = 0; j < i; j++) {
if (numbers[i] == numbers[j]) {
i--;
... | 3 |
public ArrayList<BedFeature> getBedData(RPChromosomeRegion selectionRegion,
boolean contained) {
int itemNumber = 0;
int chromID, chromStart, chromEnd;
String restOfFields;
int itemHitValue;
// chromID + chromStart + chromEnd + res... | 8 |
@Override
public Provider matchClientProviders(Task task, List<Provider> providers) {
Client ci = task.getClient();
Cluster cu = ci.getBelongingCluster();
Provider matched = null;
double matchedScore = Double.NEGATIVE_INFINITY;
// test providers randomly
Lis... | 9 |
public void drawPredator(Node to, Node from, Graphics g) {
if (from != null) {
Coordinates predatorCoords = from.getCoordinates();
int predPicX = predatorCoords.col * wallSize + padding
+ finalFormatX - (wallSize / 2) + 2;
int predPicY = predatorCoords.row * wallSize + padding
+ finalFormatY - (wal... | 2 |
public final Object get(String key) throws JSONException {
Object o = opt(key);
if (o == null) {
throw new JSONException("JSONObject[" + quote(key) +
"] not found.");
}
return o;
} | 1 |
@Override
public int compareTo(Hand o) {
currentType = Validator.getHandType(this);
Hand h = new Hand(this);
Collections.sort(h.getCards());
return currentType.getValue() > o.getCurrentType().getValue() ? -1
: currentType.getValue() < o.getCurrentType().getValue() ? 1
: 0;
} | 2 |
public void act(int timestamp) {
//Do actions, then check fuel levels at end of tick
if (currentLocation instanceof Hangar) {
Simulation.getStatistics().incrementNumberOfTakeOffs(this);
takeOff(timestamp);
}
else if (currentLocation instanceof Airspace) {
Simulation.getStatistics().incrementNumbe... | 9 |
public static void processDownlaod(ModInstance modInstance) throws IOException
{
File currentMod = new File(FileManager.dir + "/" + modInstance.type.output + "/", modInstance.modName);
File storedMod = new File(FileManager.updaterDir + "/" + modInstance.type.storage + "/", modInstance.modName);
... | 8 |
public void dfs(Vertex<T> start) {
//DFS uses Stack data structure
Stack<Vertex<T>> stack =new Stack<Vertex<T>>();
start.visited=true;
stack.push(start);
printNode(start);
while(!stack.isEmpty()) {
Vertex<T> n= stack.peek();
Vertex<T> child=getUnvisitedChildren(n);
if(child!=null) {
c... | 2 |
public void removeChangeListener(ChangeListener listener) {
changeListeners.remove(listener);
} | 0 |
public ListNode partition(ListNode head, int x) {
ListNode p1 = null, p2 = head, p2Prev = null;
while( p2 != null ) {
if( p2.val < x ) {
if( p1 == p2Prev ) {
p1 = p2;
p2 = p2.next;
p2Prev = p1;
} el... | 4 |
private boolean onCommandRefresh(CommandSender sender, Command command, String label, String cmd, String[] args)
{
String queryPlayerName = getQueryPlayerName(sender, args, 1);
if (!queryPlayerName.equals("CONSOLE"))
{
Hashtable<String, ReplicatedPermissionsContainer> playerMods = null;
for (Entry<Stri... | 8 |
public void step() {
double x0 = x, y0 = y, t0 = t;
x += v * Math.cos(t) * dt;
y += - v * Math.sin(t) * dt;
t += vt * dt;
while (t < - Math.PI)
t += 2 * Math.PI;
while (t >= Math.PI)
t -= 2 * Math.PI;
if (playfield.collision(this, true)) {
... | 4 |
public String getBlogContent() {
return this.blogContent;
} | 0 |
private static int getBits(int i, Bzip2Block bzip2Block) {
int dest;
do {
if (bzip2Block.bsLive >= i) {
int tmp = bzip2Block.bsBuff >> bzip2Block.bsLive - i & (1 << i) - 1;
bzip2Block.bsLive -= i;
dest = tmp;
break;
}
bzip2Block.bsBuff = bzip2Block.bsBuff << 8 | bzip2Block.input[bzip2Block.... | 3 |
public boolean move()
{
// Don't let him move out of bounds.
/*if ( (position.x + WIDTH + direction.x > Map.WIDTH) ||
(position.x + direction.x < 0) ||
(position.y + HEIGHT + direction.y > Map.HEIGHT) ||
(position.y + direction.y < 0))
return;*/
if (position.x + WIDTH + direction.x > Map.WIDTH)
... | 6 |
@Override
public boolean offer(T t) {
boolean result = false;
if (firstItem == null) {
firstItem = new LinkedItem(t);
result = true;
} else {
boolean searching = true;
LinkedItem currentItem = firstItem;
LinkedItem lastItem = null;
while (searching) {
if (currentItem.getNextItem() == null)... | 3 |
@Override
public Set<List<A>> times(Set<List<A>> x, Set<List<A>> y) {
Set<List<A>> product = new HashSet<>();
for (List<A> a : x) {
for (List<A> b : y) {
product.add(concat(a, b));
}
}
return product;
} | 2 |
public void run() {
Date date = new Date();
Calendar cal = Calendar.getInstance();
cal.setTime(date);
String time = cal.get(Calendar.HOUR_OF_DAY) + ":" + roundUpToNearestFive(cal.get(Calendar.MINUTE));
System.out.println("COLLECTING RENT.");
DBConnector dbc = _plugin.db;
List<World> worlds = Bukkit.getWor... | 7 |
public SimpleRunCPE(String args[]) throws Exception {
mStartTime = System.currentTimeMillis();
// check command line args
if (args.length < 1) {
printUsageMessage();
System.exit(1);
}
// parse CPE descriptor
System.out.println("Parsing CPE Descriptor");
CpeDescription cpeDesc =... | 4 |
private void serveGet(List<String> request) throws IOException, ClassNotFoundException, WrongVersionNumber{
if (request.size() < 3){
return;
}
boolean zip = (request.get(0) != null) && (request.get(0).equals("get_zip"));
String source = request.get(1);
List<Str... | 9 |
protected final CodSigningInfo signers(final InputStream inputStream,
final String fileName) {
// Pre-condition: - inputStream is not null - inputStream is at the
// beginning of the file
// Post-condition: - inputStream is at the end of the file, but still
/... | 8 |
@Override
public Resource objectToJena(Model toAddTo, Investigation investigation)
throws IllegalArgumentException {
if (investigation.getResourceURL() == null) {
throw new IllegalArgumentException(String.format(msg_ResourceWithoutURI, "investigations"));
}
Resource res = toAddTo.createResourc... | 9 |
public void writeToStream(PrintStream p) {
// create definition string with first character 1 if the
// mapping is character-defined, 0 otherwise
String definition = "" + (characterDef ? 1 : 0);
// add character or keycode
definition += "\t";
if (characterDef)
definition += (int) keyChar;
else
def... | 7 |
@Override
public boolean equals(Object o)
{
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
NodePair nodePair = (NodePair) o;
if (finish != null ? !finish.equals(nodePair.finish) : nodePair.finish != null) return false;
if (start != null ? !start.equals(n... | 7 |
public boolean containsValidLoginDetails() {
return isValidPassword() && isValidEmail();
} | 1 |
@Override
public void run()
{
long previousTime = System.currentTimeMillis();
long currentTime = previousTime;
if( soundSystem == null )
{
errorMessage( "SoundSystem was null in method run().", 0 );
cleanup();
return;
}
... | 5 |
@Override
public String toString()
{
String str = "";
if (isFlag(DRIVE_READY))
str += "DRIVE_READY ";
if (isFlag(MOTOR_OFF))
str += "MOTOR_OFF ";
if (isFlag(MOVING))
str += "MOVING ";
if (isFlag(VOLTAGE_FAULT))
str += "VOLTA... | 8 |
@Override
public void windowClosing(WindowEvent e) {
kaModel.saveToFile(dataFile);
} | 0 |
public void startPolling() {
pollingActive = true;
Runnable pollingTask = () -> {
while(pollingActive) {
//wait for a bit
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
e.printStackTrace();... | 5 |
public void extractEmails(String input){
String emailRegex = "[A-z0-9_.]+@[A-z0-9_.]+([.com]|[.net]|[.edu])";
// String emails = "someone@this.com, that one guy, realEmail@k.edu";
//extracts email addresses from email message
// [A-z0-9_.]+@[A-z0-9_.]+([.com]|[.net]|[.edu])
p = Pattern.compile(emailRegex);
... | 1 |
public boolean conditionMatches(CombineableOperator combinable) {
return (type == POSSFOR || cond.containsMatchingLoad(combinable));
} | 1 |
public static void dswap_j (int n, double dx[], int incx, double
dy[], int incy) {
double dtemp;
int i,ix,iy,m;
if (n <= 0) return;
if ((incx == 1) && (incy == 1)) {
// both increments equal to 1
m = n%3;
for (i = 0; i < m; i++) {
dtem... | 8 |
public VDGTransitionCreator(AutomatonPane parent) {
super(parent);
} | 0 |
public int lengthOfLastWord(String s) {
if (s == null || s.length() == 0) {
return 0;
}
int lastWordEnd = -1;
for (int i = s.length() - 1; i >= 0; i --) {
char c = s.charAt(i);
if (c == ' ') {
if (lastWordEnd != -1) {
... | 7 |
@Override
public void setResource(String resource) {
this.resource = resource;
} | 0 |
private XMLTools() {} | 0 |
String multiplyHelper(String str1,int digit,int zeros){
if(digit==1){
for(int i=0;i<zeros;i++){
str1+="0";
}
return str1;
}
if(digit==0||str1.equals("0")){
return "0";
}
String str="";
int advance=0;
for(int i=str1.length()-1;i>=0;i--){
int temp=(str1.charAt(i)-'0')*digit+advance;
ad... | 7 |
public void generatePath(ArrayList<ArrayList<Integer>> result, ArrayList<Integer> path, TreeNode root, int sum) {
path.add(root.val);
if(root.left==null&&root.right==null){
if(root.val==sum){
result.add(new ArrayList<Integer>(path));
return;
}
... | 5 |
@SuppressWarnings({"ToArrayCallWithZeroLengthArrayArgument"})
public void testKeySet() {
int element_count = 20;
int[] keys = new int[element_count];
String[] vals = new String[element_count];
TIntObjectMap<String> raw_map = new TIntObjectHashMap<String>();
for (int i = 0; i... | 6 |
public ArrayList<Rectangle2D> getAllBlockedBoxes() {
if(noChildren()) {
ArrayList<Rectangle2D> tempBoxes = new ArrayList<Rectangle2D>();
if(this.blocked)
tempBoxes.add(this.box);
return tempBoxes;
} else {
ArrayList<Rectangle2D> tempBoxes = new ArrayList<Rectangle2D>();
for(int x = 0; x < thi... | 3 |
private final void method549(byte[] bs, int[] is, int i, int i_62_, int i_63_, int i_64_, int i_65_, int i_66_, int i_67_, int i_68_, int i_69_, int i_70_, aa var_aa, int i_71_, int i_72_) {
aa_Sub1 var_aa_Sub1 = (aa_Sub1) var_aa;
int[] is_73_ = var_aa_Sub1.anIntArray5487;
int[] is_74_ = var_aa_Sub1.anIntArray548... | 9 |
@Override
public List func_22176_b() {
ArrayList var1 = new ArrayList();
File[] var2 = this.field_22180_a.listFiles();
for(File var3 : var2) {
if(var3.isDirectory()) {
String var7 = var3.getName();
WorldInfo var8 = this.getWorldInfo(var7);
if(var8 != nul... | 5 |
public SignatureVisitor visitReturnType() {
if (type != METHOD_SIGNATURE
|| (state & (EMPTY | FORMAL | BOUND | PARAM)) == 0)
{
throw new IllegalArgumentException();
}
state = RETURN;
SignatureVisitor v = sv == null ? null : sv.visitReturnType();
... | 3 |
private JButton createConfirmButton() {
JButton b = new JButton("Confirm");
b.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try {
submitPurchaseButtonClicked();
} catch (ParseException e1) {
e1.printStackTrace();
}
}
});
b.setEnabled(false);
... | 1 |
private static String js_substr(String target, Object[] args) {
if (args.length < 1)
return target;
double begin = ScriptRuntime.toInteger(args[0]);
double end;
int length = target.length();
if (begin < 0) {
begin += length;
if (begin < 0)
... | 7 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof TestBox)) return false;
TestBox testBox = (TestBox) o;
if (depth != testBox.depth) return false;
if (height != testBox.height) return false;
if (width != testBox.width) return... | 7 |
private void emitTableCRUD( Table table ) throws Exception
{
// Default array params for all rows
ArrayList<String> params = new ArrayList<String>();
for ( Field row : table.fields )
{
params.add( SqlUtil.getJavaTypeFor( row.type ) );
params.add( row.name );
}
ArrayList<String> paramsWithUnique = n... | 6 |
public void stop_tunnel_in(final long milllis) {
new Thread(new Runnable() {
public void run() {
try {
Thread.sleep(2000);
stop_tunnel(); }
catch (Exception e) {
}
}
}).start();
} | 1 |
@Override
public void update() {
switch(this){
case START_LEVEL:
if(Game.level == null){
//game over...
System.out.println("game over");
}
Animation.START_LEVEL_ANIMATION.update();
break;
case PLAY_LEVEL:
Game.gameField.update();
break;
case END_LEVEL:
//keep the level playing in b... | 5 |
public ArrayList<String> allowedActions(String asker,String type) {
// access property looks like access_read = 'u(admin,daniel),a(euscreenpreview)'
// where u=user,a=application etc etc. Any normal writes on 'access_ are forbidden.
ArrayList<String> list = new ArrayList<String>();
// we do them one by one to b... | 6 |
public static boolean Checkkey (String s)
{
if ("fk".equals(s)||"Fk".equals(s)||"FK".equals(s)||"fK".equals(s))
{
return true;
}
else
{
return false;
}
} | 4 |
public SpellList() {
setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
setTitle("Spell List");
setBounds(100, 100, 325, 500);
getContentPane().setLayout(new BorderLayout());
contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
getContentPane().add(contentPanel, BorderLayout.CENTER);
contentPanel.setLayo... | 2 |
protected boolean couldSwitch(Behaviour last, Behaviour next) {
if (next == null) return false ;
if (last == null) return true ;
//
// TODO: CONSIDER GETTING RID OF THIS CLAUSE? It's handy in certain
// situations, (e.g, where completing the current plan would come at 'no
// cost' to the ne... | 7 |
private void botonMoverAdministrarCatalogoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonMoverAdministrarCatalogoActionPerformed
if (this.campoOrigenAdministrarCatalogo.getText().equals("Origen") || this.campoDestinoAdministrarCatalogo.getText().equals("Destino")) {
JOptionP... | 8 |
public static void main(String[] args) {
if (args.length<2) {
System.out.println("Usage: Echo <host> <port#>");
System.exit(1);
}
ss = new EchoObjectStub2();
//EJERCICIO: crear una instancia del stub
ss.setHostAndPort(args[0],Integer.parseInt(args[1]));
BufferedReader stdIn = ... | 4 |
public void back(int velocity) {
controls.back(velocity);
} | 0 |
public static void main(String[] args) {
ArrayList<Integer> results = new ArrayList<Integer>();
int number = 1;
do {
int result = number;
do {
String parse = Integer.toString(result);
char[] cheat = parse.toCharArray();
int suma = 0;
for (int i = 0; i < cheat.length; i++)
suma += Math.... | 9 |
@Override
public void onCombatTick(int x, int y, Game game) {
SinglePlayerGame spg = (SinglePlayerGame) game;
List<Entity> neighbors = spg
.getSquareNeighbors(x, y, 1);
for (Entity entity : neighbors) {
if (entity.id == zombie.id) {
if (((MortalEnt... | 4 |
private void update(DocumentEvent event)
{
String newValue = "";
try
{
Document doc = event.getDocument();
newValue = doc.getText(0, doc.getLength());
}
catch (BadLocationException e)
{
e.printStackTrace();
}
if (newValue.length() > 0)
{
int index = targetList.getNextMatch(... | 5 |
public PlanBeschreibung(JSONObject setup, Object obj) throws FatalError {
super("Beschreibung");
if (obj == null || ! (obj instanceof String)) {
throw new ConfigError("Beschreibung");
} else {
content = (String) obj;
}
} | 2 |
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.