text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void storeFinalGrades(int term){
try {
// Connect
HttpGet finalGet = new HttpGet("https://jweb.kettering.edu/cku1/wbwskogrd.P_ViewGrde?term_in=" + term + "&inam=on&snam=on&sgid=on");
HttpResponse response = this.clientBanner.execute(finalGet);
String html = HTMLParser.parse(response);
... | 8 |
private Map<Pattern,String> loadPatterns(InputStream is) {
Properties p = new Properties();
try {
p.load(is);
} catch (IOException e) {
throw new RuntimeException("Error loading patterns", e);
}
Map<Pattern,String> pattMap = new HashMap<Pattern,String>();
for (Object k : p.keySet()) {
String key... | 3 |
public void initialize() {
setTitle("Manage Teams");
setBounds(100, 100, 464, 362);
getContentPane().setLayout(new BorderLayout());
{
JPanel buttonPane = new JPanel();
buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
getContentPane().ad... | 7 |
private void afficherModifierFormation() {
System.out.println("Code de la formation à modifier ?");
this.modeleApplication.afficherLesFormations();
String code = scan.nextLine();
while(code.isEmpty()) {
System.out.println("Veuillez entrer un code de formation correct.");
... | 5 |
private void jButtonVoteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonVoteActionPerformed
SondageReponseDao srd = SondageReponseDao.getInstance();
List<SondageReponse> listReponses = srd.findAll();
SondageReponse sr_vote = new SondageReponse(lastSondage.getId(), las... | 3 |
private final void method3067(byte i) {
int i_5_ = 25 / ((i - -28) / 57);
if ((((Class348_Sub40_Sub8) this).anInt9149 ^ 0xffffffff) < -1) {
aShortArray9162
= new short[((Class348_Sub40_Sub8) this).anInt9150];
aShortArray9159
= new short[((Class348_Sub40_Sub8) this).anInt9150];
for (int i_6_ = 0; ((... | 5 |
public void creationCarte(final int[][] carte)
{
this.carte = new int[carte.length][carte[0].length];
for (int i = 0; i < carte.length; i++) {
for (int j = 0; j < carte[i].length; j++) {
this.carte[i][j] = carte[i][j];
}
}
for (final IleEcouteur ileEcouteur : this.ileEcouteurs.getListeners(IleEcoute... | 3 |
public int getMsgFormat() {
return MsgFormat;
} | 0 |
public static DayEnum fromValue(String v) {
for (DayEnum c: DayEnum.values()) {
if (c.value.equals(v)) {
return c;
}
}
throw new IllegalArgumentException(v);
} | 2 |
@SuppressWarnings("rawtypes")
public void buildList(JSONObject jo) {
//build from the JSONObejct a arrayList with stops
try{
if(!jo.isEmpty()) {
Set set = jo.entrySet();
Iterator i = set.iterator();
int data = set.size();
int total = 25;
double current = StartUpLoader.getInstance().get... | 8 |
public static void makeCompactGrid(Container parent,
int rows, int cols,
int initialX, int initialY,
int xPad, int yPad) {
SpringLayout layout;
try {
layout = (SpringLayout)pa... | 7 |
private void writeResultGlobal(ValidateResult[] validateResultsSingle, ValidateResult globalResult, String filepath) throws IOException {
BufferedWriter out = new BufferedWriter(new FileWriter(new File(filepath)));
out.write(ValidateResult.getCaption());
out.newLine();
for (ValidateResult validateResult : vali... | 1 |
public static String findTextInList(List<WebElement> webElements, String ans){
Point sLocation;
int xx, yy, d;
String text;
for(WebElement ss : webElements){
text = ss.getText();
if(text!=null && !text.equals("")){
sLocation = ss.getLocation();
... | 5 |
@Override
public double[] computeValue(final char refBase, FastaWindow window, AlignmentColumn col) {
values[ref] = 0.0;
values[alt] = 0.0;
int refCount = 0;
int altCount = 0;
if (col.getDepth() > 0) {
Iterator<MappedRead> it = col.getIterator();
while(it.hasNext()) {
MappedRead read = it... | 7 |
@Override
public void process(WatchedEvent event) {
try {
final String eventPath = event.getPath();
switch (event.getType()) {
case None:
final Event.KeeperState state = event.getState();
logger.info("new ZK connection stat... | 7 |
public void focusGained(FocusEvent e) {
try{
if(e.getSource() == txtAreaTeam1){
if(blnServer){
for(int i = 0; i < player.size(); i++){
tempPlayer = (PlayerConnection)player.get(i);
if(tempPlayer.intID == intID){
tempPlayer.intTeam = 1;
updateTeams();
}
}
}else{
... | 9 |
@SuppressWarnings("unchecked")
public Map<String, Object> getStateForPlayerId(String playerId) {
Map<String, Object> result = Maps.newHashMap();
for (String key : state.keySet()) {
Object visibleToPlayers = visibleTo.get(key);
Object value = null;
if (visibleToPlayers.equals(ALL)... | 3 |
public static List<FunctionTrace> extractRelevantSequence(
List<List<FunctionTrace>> llft) {
List<FunctionTrace> relevantSequence = null;
Iterator it = llft.iterator();
List<FunctionTrace> lft = null;
List<FunctionTrace> finalFunctionTrace = new ArrayList<FunctionTrace>();
boolean foundErrorTrace = false;... | 9 |
public void cleanUp()
{
try
{
synchronized (this.mutex)
{
while (!pool.isEmpty())
{
pool.get(0).setTaken(true);
Connection c = pool.get(0).getConnection();
c.commit();
//this is a workaround for a bug in some databases that
//won't properly close connections if they're ... | 2 |
void drawSelected(int x, int y, double w, double h) {
if (Main.isBlinked) {
final int border = (int) Math.round(w / 50.0 + 0.5);
g.setColor(SELECTED_COLOR);
g.fillOval(x - border, y - border, (int) w + 2 * border, (int) h + 2 * border);
}
} | 1 |
@Override
public boolean equals(Object object) {
if (super.equals(object)) {
NBTTagList nbttaglist = (NBTTagList) object;
if (this.type == nbttaglist.type) {
return this.list.equals(nbttaglist.list);
}
}
return false;
} | 2 |
public void beginRO(String transactionName, long startTime) {
if( transactionMap.containsKey(transactionName) ) {
writeToStreamln("Transaction with same name already"
+ "exists");
return;
}
String output = new StringBuilder("Read only Transaction ")
.append(transactionName... | 6 |
@Override
public String toString() {
String desc;
desc = "id3v2TagRestrictions = "+Integer.toBinaryString(getBitmap(null));
return desc;
} | 0 |
public LayoutStorageAction(String saveString, String restoreString, Automaton a) {
super(saveString, null);
automaton = a;
restoreAction = new AutomatonAction(restoreString, null) {
public void actionPerformed(ActionEvent e) {
graph.moveAutomatonStates();
}
};
restoreAction.setEnabled(false); ... | 0 |
public String getOldValue(){
return oldValue.getText();
} | 0 |
public int PrintAge() {
Calendar today = Calendar.getInstance();
Calendar birthDate = Calendar.getInstance();
int age = 0;
birthDate.setTime(this.DOB);
if (birthDate.after(today)) {
throw new IllegalArgumentException("Can't be born in the future");
}
age = today.get(Calendar.YEAR) - birthDate.get(Cale... | 5 |
public boolean validRay(RayIntersect intersect){
if(intersect == null || Double.isNaN(intersect.getX()) || Double.isNaN(intersect.getZ()) || intersect.getDistance() == 0){
return false;
}
return true;
} | 4 |
private void displayNext() {
try {
refresh(ekd.next(ek));
} catch (NoNextEmailKontaktFoundException e) {
JOptionPane.showMessageDialog(this, e.getMessage());
e.printStackTrace();
}
} | 1 |
public ParameterizedTypeImpl(Type ownerType, Type rawType, Type... typeArguments) {
// require an owner type if the raw type needs it
if (rawType instanceof Class<?>) {
Class<?> rawTypeAsClass = (Class<?>) rawType;
boolean isStaticOrTopLevelClass = Modifier.isStatic(rawTypeAsClass.getModifie... | 8 |
private static void register(Transition transition) {
List<Transition> list = transitions.get();
if (list == null) {
list = new ArrayList<Transition>();
transitions.set(list);
}
list.add(transition);
} | 1 |
@Override
public boolean equals(Object value) {
if(value instanceof Type){
Type t = (Type) value;
boolean r = true;
r = r && getType().equals(t.getType());
if(getKeyType() !=null){
r = r && getKeyType().equals(t.getKeyType());
}
if(getValueType()!=null){
r = r && getValueType().eq... | 7 |
private void dessinerFormesNonTriees(Graphics graphique)
{
Noeud courant = GestionnaireForme.getInstance().getPremierNoeud();
if(courant != null) {
while (courant != null) {
graphique.setColor(courant.getForme().getCouleur());
if (courant.getForme() instanceof Rectangle)
{
Rectangle re... | 5 |
private void dispatch(String[] commands, PrintWriter writer) {
switch (commands[0]) { //first element of string array must be one of the accepted commands
case AppConstants.ADD:
if (commands.length != 3) {
LOG.warning("Insufficient number of parameters in ADD com... | 7 |
public Entity(EntityType t1,Level l1){
t=t1;
l=l1;
sp = new Sprite(t1);
switch(t){
case BAT:
health=15;
break;
case PLAYER:
health=25;
break;
case SNAKE:
health=25;
... | 9 |
@Override
public List<Event> findEventAll() {
List<Event> list = new ArrayList<Event>();
Connection cn = null;
PreparedStatement ps = null;
ResultSet rs = null;
try {
cn = ConnectionHelper.getConnection();
ps = cn.prepareStatement(QTPL_SELECT_ALL);
... | 5 |
private void method289(Object5 class28)
{
for(int j = class28.anInt523; j <= class28.anInt524; j++)
{
for(int k = class28.anInt525; k <= class28.anInt526; k++)
{
Ground class30_sub3 = groundArray[class28.anInt517][j][k];
if(class30_sub3 != null)
{
for(int l = 0; l < class30_sub3.anInt1317; l... | 7 |
public boolean skipPast(String to) throws JSONException {
boolean b;
char c;
int i;
int j;
int offset = 0;
int length = to.length();
char[] circle = new char[length];
/*
* First fill the circle buffer with as many characters as are in the
... | 9 |
private static boolean settNode(int j, int[] noderSett) {
for (int i : noderSett) {
if (i == j) return true;
}
return false;
} | 2 |
public static void main(String[] args) {
int l=0;int r = 5;int u = 1;int d = 5;
int n=0;
int[][] arr = {{1,2,3,4,5},{1,2,3,4,5},{1,2,3,4,5},{1,2,3,4,5},{1,2,3,4,5}};
int i=0,j=0;
int m = 1;
int num = r*d;
while (n< num){
n++;
switch(m){
case 1:
if(j<r-1){
System.out.println(arr[i][... | 9 |
public void selectionInteract(int x, int y)
{
for (Inventory inventory : inventorys) {
if (inventory.getX() >= x && inventory.getY() >= y && inventory.getX() - 20 <= x && inventory.getY() - 20 <= y ) {
if (inventory.getQuantity() > 0) {
holdingItem = !holdingItem;
... | 6 |
@Override
public void open(String name) throws ChannelException {
try {
Socket socket = new Socket(host, port);
out = new PrintWriter(socket.getOutputStream(), true);
in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
receiver = new Recei... | 1 |
public void run() {
// get line and buffer from ThreadLocals
SourceDataLine line = (SourceDataLine)localLine.get();
byte[] buffer = (byte[])localBuffer.get();
if (line == null || buffer == null) {
// the line is unavailable
return;
... | 7 |
protected boolean setEmoteType(String str)
{
str=str.toUpperCase().trim();
if(str.equals("BROADCAST"))
broadcast=true;
else
if(str.equals("NOBROADCAST"))
broadcast=false;
else
if(str.equals("VISUAL")||(str.equals("SIGHT")))
emoteType=EMOTE_TYPE.EMOTE_VISUAL;
else
if(str.equals("AROMA")||(str.e... | 9 |
public void jump() {
Cell[][] grid = this.landlord.getGridPanel().getGrid();
// -2 because of fences on the sides
int width = this.landlord.getGridPanel().getW();
int height = this.landlord.getGridPanel().getH();
// +1 because of the fence on the side
int x = (int) (Math.random() * width);
int y = (int) ... | 2 |
*/
private boolean checkSessionLapRawData() {
// Gestion des flashbacks dans le même tour, bug
// FIXME : Not Working
boolean ret = true;
try {
if (this.curRawDataSet != null
&& this.curRawDataSet.size() > 0
&& this.curRawDataSet.last().getLap().equals(this.curRawData.getLap())
&& this.curRaw... | 5 |
public void sendDebug( String d ) // Temporary Method to send debug
// information to my username.
{
for ( Player p : getServer().getOnlinePlayers() )
{
if ( p.isOp() )
p.sendMessage( ChatColor.DARK_AQUA + "[iNations Debug] " + ChatColor.WHITE + d );
}
} | 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 Servico)) {
return false;
}
Servico other = (Servico) object;
if ((this.id == null && other.id != null) || (thi... | 5 |
private int getMinIndex(char[] arr, int i) {
int minIndex = i;
for (int j = i + 1; j < arr.length; j++) {
if (arr[j] < arr[minIndex])
minIndex = j;
}
return minIndex;
} | 2 |
private Window wdg() {
Widget wdg = UI.instance.getWidget(remote_id);
if (wdg instanceof Window) {
return (Window) wdg;
} else {
return null;
}
} | 1 |
@Test
public void findDuplicateTypeHand_whenTwoPairsExist_returnsTwoPairPlusHighestKicker() {
Hand hand = findDuplicateTypeHand(twoSixesTwoFoursAceKicker());
assertEquals(HandRank.TwoPair, hand.handRank);
assertEquals(Rank.Six, hand.ranks.get(0));
assertEquals(Rank.Four, hand.ranks.get(1));
assertEquals(Rank... | 0 |
private String getStrFromInputStream(InputStream is) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(is));
StringBuilder response = new StringBuilder();
String inputLine;
try {
while ((inputLine = reader.readLine()) != null) {
... | 2 |
public void update()
{
Vector3f playerDistance = transform.getPosition().sub(Transform.getCamera().getPos());
Vector3f orientation = playerDistance.normalized();
float distance = playerDistance.length();
float angle = (float)Math.toDegrees(Math.atan(orientation.getZ()/orientation.getX()));
if(orient... | 3 |
public World isAndGetCopyWorld(World world, Player player){
String playerName = "_" + player.getName();
new_name = world.getName();
folderName = "/" + new_name;
if (!(new_name.endsWith(playerName))){
new_name = new_name + playerName;
if (plugin.mainWorlds.contains(world.getName())){
if (playerWorld... | 6 |
@Override
public String toImplementationSyntax(TableModel tableModel, String definition)
{
String newDefinition = definition;
StringTokenizer tokens = new StringTokenizer(newDefinition,
getSyntax().getDelimiters());
String token;
String cellID = n... | 9 |
public static PathConvexShape findGroundShape(Point3f guyPosition, PathLevel pathLevel) {
List<PathConvexShape> pathConvexShapeList = pathLevel.getPossibleShapes(guyPosition.x, guyPosition.z);
if (pathConvexShapeList == null) {
return null;
}
double highestPossibleY = guyPos... | 5 |
public void progressStart()
{
if (block == 0) {
}
++block;
} | 1 |
@Override
public void documentRemoved(DocumentRepositoryEvent e) {} | 0 |
public void renderWorld(){
for(int y = 0; y < worldHeight; y++){
for(int x = 0; x < worldWidth; x++){
Tile tile = Tile.getTileById(mapData.get((y * worldHeight) + x));
tile.render(x * tileSize, y * tileSize);
}
}
renderLights();
renderSides();
renderEntities();
} | 2 |
public static MultipleChoiceQuestion getMultipleChoiceQuestionByXMLElem(XMLElement root, Quiz quiz, int pos) {
int quizID = quiz.quizID;
int position = pos;
Object question = null;
Object answer = null;
double score = 10;
ArrayList<String> questionList = new ArrayList<String>();
for (int i = 0; i < root... | 5 |
public Game(World world, BrainParser b1, BrainParser b2){
// ArrayList<Instruction> brain1 = new BrainParser("src/cleverbrain3.brain").parseBrain();
// ArrayList<Instruction> brain2 = new BrainParser("src/cleverbrain4.brain").parseBrain();
ArrayList<Instruction> brain1 = b1.parseBrain();
ArrayList<Instruction>... | 4 |
private ArrayList<Action> findPathsFromActionMap(
int goalRowID, int goalColID, int goalDrcID) {
//int startRowID,int startColID,int startDrcID) {
ArrayList<Action> actions = new ArrayList<>();
//Find the action min distance
int rowID = goalRowID;
int colID = goalColID;
int drcID = goalDrcID;
wh... | 6 |
private ResourceManager()
{
m_textTileMap = new HashMap<Integer, TileResource>();
m_objectsMap = new HashMap<Integer, MovableResource>();
try {
InputStream is = getClass().getResourceAsStream(RESOURCES_FILE);
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder d... | 9 |
public List<Vak> getVakkenVanStudent(long studentId) {
List<Vak> vakken = new ArrayList<Vak>();
List<Long> klasIds = new ArrayList<Long>();
List<Long> vakIds = new ArrayList<Long>();
try {
PreparedStatement prepareStatement = manager
.prepareStatement("SELECT klas_id FROM leerling_klas WHERE leerling_id... | 5 |
void updateCacheView() {
TlvCacheInstance cache = cacheModel.getCacheInstance();
TlvCacheState cacheState = (cache == null ? null : cache.getState());
buttonInitCache.setEnabled(cacheState == null || cacheState == TlvCacheState.CREATED || cacheState == TlvCacheState.STOPPED);
buttonStartCache.setEnable... | 7 |
private Token jj_consume_token(int kind) throws ParseException {
Token oldToken;
if ((oldToken = token).next != null) token = token.next;
else token = token.next = token_source.getNextToken();
jj_ntk = -1;
if (token.kind == kind) {
jj_gen++;
if (++jj_gc > 100) {
jj_gc = 0;
... | 6 |
public void setDimension(Dimension dim, int size) {
if (dim.getSize() == size) return;
dim.setSize(size);
Set param_set = getParamsForDim(dim);
for (Iterator i = param_set.iterator(); i.hasNext();) {
Parameter param = (Parameter)(i.next());
param.resize();
... | 2 |
public static void toggleEditableAndClearForSingleNode(Node node, CompoundUndoable undoable) {
toggleEditableForSingleNode(node, undoable);
for (int i = 0, limit = node.numOfChildren(); i < limit; i++) {
clearEditableForSingleNode(node.getChild(i), undoable);
}
} | 1 |
public static void setPageRanges(PrintRequestAttributeSet set, PageRanges ranges) {
if (ranges != null) {
set.add(ranges);
} else {
set.remove(PageRanges.class);
}
} | 1 |
public void mousePressed(MouseEvent e) {
if (image !=null && tileset) {
if (e.getX()>=0 && e.getX() <=image.getWidth() && e.getY() >= 0 && e.getY() <= image.getHeight()) {
x0=e.getX()/(8*zoom);
y0=e.getY()/(8*zoom);
}
}
} | 6 |
public void render(Graphics g) {
if (active) {
if (img != null) {
boolean hover = checkMouse(InputHandler.getInstance().getMouseHoverPoint());
if (hover)
g.drawImage(img, x, y, width, height, Color.darkGray, null);
else
g.drawImage(img, x, y, width, height, null);
}
if (text != null) ... | 4 |
public Path getBestPath()
{
if(Ways.isEmpty())
{
return(new Path());
}
float length = Ways.elementAt(0).getDistance();
int p = 0;
//Besten Pfad ausrechnen
for(int i=0; i<Ways.size(); i++)
{
if(Ways.elementAt(i).getDistance() < length)
{
p = i;
}
}
return(Ways.elementAt(p));
} | 3 |
public static void main(String args[]) throws Exception{
NavigableSet nav = new TreeSet<>();
nav.add("A");
nav.add("B");
nav.add("C");
nav.add("D");
nav.add("E");
// Testing flag inclusive and exclusive
SortedSet tail = (NavigableSet)nav.tailSet("A");
NavigableSet head = nav.headSet("E",tru... | 3 |
@Override
public void handleModelChangeEvent(ModelChangeEvent e){
displayMessage(e.getMessage());
drawList = e.getDrawable();
for(Drawable2D drawable : drawList) {
if(drawable.getClass().equals(Player2D.class)) {
player = (Player2D)drawable;
}
if(drawable.getClass().equals(Room2D.class)) {
mapAr... | 5 |
@Override
public void cycler() {
// Choices
String[] speedModes = { "Easy", "Normal", "Hard" };
// Input System
String speedSelect = (String) JOptionPane.showInputDialog(null,
"Choose Difficulty", "RunBitMan 2", JOptionPane.PLAIN_MESSAGE,
null, speedModes, "Easy");
long speed = 100;
if ((speedSe... | 8 |
@RequestMapping(value = "/", method = RequestMethod.GET)
public String home(Locale locale, Model model) {
logger.info("Welcome home! The client locale is {}.", locale);
Date date = new Date();
DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, locale);
String formattedDa... | 2 |
public void initialisationFinaleProvince(){
for(Province p : this.hashProvince){
switch(p.getNom()){
case "Chugoku" :
case "Kanto" : p.setTroupe(new Troupes("Samouraï", "Vert"));
break;
case "Chubu" :
case "Kansai"... | 9 |
public final void unlinkSub() {
if (previousNode == null) {
} else {
previousNode.nextNode = nextNode;
nextNode.previousNode = previousNode;
nextNode = null;
previousNode = null;
}
} | 1 |
private void expand1(byte[] src, byte[] dst) {
for(int i=1,n=dst.length ; i<n ; i+=8) {
int val = src[1 + (i >> 3)] & 255;
switch(n-i) {
default: dst[i+7] = (byte)((val ) & 1);
case 7: dst[i+6] = (byte)((val >> 1) & 1);
case 6: dst[i+... | 8 |
public boolean adisyonEkle(String masaAdi,String urunAdi,int miktar){
Siparis siparis = new Siparis(new Urun().urunBul(urunAdi), miktar);
Bilgisayar b = masaBul(masaAdi);
if(b!=null){
if(mutlakkafe.MutlakKafe.mainCont.getUrunCont().urunSat(siparis.getUrun().getUrunID(), mikta... | 3 |
@Override
public void initializeNorm()
{
checkingNorms();
for ( Action action : getAllActions().values() )
{
if ( action.getNormType() != null ) // Only action linked with deontic concept will goona be setted
{
if ( action.getNormType() == NormType.OBLIGATION )
{
if ( getPlayer().containAct... | 7 |
public void start() {
if(!fTimer.isRunning()) {
if(fAnimationTarget == null) {
throw new IllegalStateException("Animation target is not set!");
}
fAnimationStartTime = System.nanoTime() / 1000000;
final Runnable r = new Runnable() {
public void run() {
fAnimationTarget.begin(AnimationTimer.th... | 3 |
public void runScript(String configFileName)
{
int lineNum = 0;
try {
BufferedReader in = new BufferedReader(new FileReader(configFileName));
String line;
while ((line = in.readLine())!=null) {
lineNum++;
if (!line.startsWith("#")) {
String command = null;
List args = new ArrayLis... | 7 |
public static byte[] compressRow(byte[] b) {
try {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
byte active = b[0];
byte same = (byte) -127;
for (int i = 1; i < b.length; i++) {
if (b[i] == active && same < 127) same += 1;
else {
baos.write(new byte[] { same, active });
same... | 4 |
public boolean checkWin() {
boolean gameWon = false;
boolean gameWonBackDiagonal = false;
boolean gameWonVertical = false;
boolean gameWonForwardDiagonal = false;
boolean gameWonHorizontal = false;
for (int j=0; j<WIDTH ; j++) {
for (int i=0; i<HEIGHT ; i++) {
if (m_Pieces[j][i].getPieceColour() != E... | 7 |
public Object displayCreateActivityPrompt() throws IOException{
Calendar cal = Calendar.getInstance();
Date date = cal.getTime(); //set to today
Date duration = null;
String title = "";
String note = "";
Activity activity = new Activity(userName);
System.out.println("Record an activity"); //initial pro... | 7 |
public boolean getBoolean(int index) throws JSONException {
Object object = this.get(index);
if (object.equals(Boolean.FALSE)
|| (object instanceof String && ((String) object)
.equalsIgnoreCase("false"))) {
return false;
} else if (object.equal... | 6 |
public static char boardIntToString(boolean[] value) {
// System.out.print("boardToString: " + Integer.toBinaryString(value) +
// " ");
char ret = 'r';
if (Conversions.isWall(value)) {
ret = Constants.S_WALL;
} else if (Conversions.isPlayer(value) && Conversions.isGoal(value)) {
ret = Constants.S_PLAYE... | 9 |
public void setSector(String sector) {
addressCompany.setSector(sector);
} | 0 |
protected synchronized void executeQuieries() {
if (!m_queries.isEmpty())
{
String query = null;
Statement statement = null;
final Connection connection = getConnection();
try {
if (connection == null) {
Utilities.outputError("Could not connect to database.");
return;
}
... | 7 |
private DefaultTreeModel parseTree(String string, Grammar grammar,
LLParseTable table, List nodes) {
int p = 0;
string = string + "$";
Stack stack = new Stack();
MutableTreeNode root = new DefaultMutableTreeNode(grammar
.getStartVariable());
stack.push(root);
nodes.add(root);
DefaultTreeModel tree ... | 7 |
public int correSimulacion(Estrategia estr, Datos dato, String id,
int max_time) {
Nodo nodo = null;
time = 0;
if (true) {
estado = new Estado(estr);
for (Sensor x : estr.getSensores())
x.setEstado(estado);
estr.setEstado(estado);
estado.initEstado();
addAleatOponents(MAX_ENEMIGOS);
}
... | 6 |
private Node<U, T> buildSubtree(List<T> intervalList, int low, int high) {
U point = intervalList.get((low + high) >>> 1).getLow();
Node<U, T> result = new Node<U, T>(point);
int lowPointer = low;
int highPointer = high;
for (int j = low; j < highPointer; j++) {
T next = intervalList.get(j);
... | 5 |
@Override
public void setMaximum(int i) {bar.setMaximum(i);} | 0 |
private static String getText(final List<List<Symbol>> board) {
List<WinnerChecker> winnerCheckers = Arrays.asList(new HorizontalChecker(), new VerticalChecker(new Column()),
new VerticalChecker(new DiagonalIncreasing()),
new VerticalChecker(new DiagonalDecreasing()));
/... | 7 |
public boolean equalsInContent(Deck d) {
if (this.cardArray.length != d.cardArray.length)
return false;
for (int i = 0; i < cardArray.length; i++) {
if (d.binarySearch(cardArray[i]) == -1) {
return false;
}
}
return tr... | 3 |
public James()
{
super("James", 6500, 250, 50, 80, as);
as.setSkill(0, "Work Hard", 100, 20, "James works very hard in class.");
as.setSkill(1, "Wise", 200, 45, "James is exceptionally wise.");
as.setSkill(2, "Program", 500, 100, "James creates a deadly program.");
as.setSkill(3, "High Mark", 4500, 180, "Jam... | 0 |
private int jjMoveStringLiteralDfa7_1(long old0, long active0)
{
if (((active0 &= old0)) == 0L)
return 7;
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
return 7;
}
switch(curChar)
{
case 69:
case 101:
return jjMoveStringLiteralDfa8_1(active0... | 9 |
public GUI() {
setTitle("Calculator");
setSize(WIDTH, HEIGHT);
setLocationRelativeTo(null); // Center the GUI
setResizable(false);
setDefaultCloseOperation(EXIT_ON_CLOSE);
ImageIcon icon = new ImageIcon(this.getClass().getResource("/icon.png"));
this.setIconImage... | 0 |
@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 Funcao)) {
return false;
}
Funcao other = (Funcao) object;
if ((this.id == null && other.id != null) || (this.i... | 5 |
@Override
public boolean hesapBilgiGuncelle(String kullaniciAdi, Kisi kisi) {
int sonuc = JOptionPane.showConfirmDialog(null, kullaniciAdi +
" isimli müşteri bilgilerini değiştirmek istediğinize emin misiniz?", "Müşteri Güncelle",
JOptionPane.YES_NO_OPTION, JOptionPane.QUEST... | 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.