text stringlengths 14 410k | label int32 0 9 |
|---|---|
@Override
void removeChild(@SuppressWarnings("unused") Node child)
{
// Remove child
if(this._expLogica_ == child)
{
this._expLogica_ = null;
return;
}
if(this._seV_.remove(child))
{
return;
}
if(this._senaoF_.... | 3 |
protected static void setBackground(Path img) throws IOException, InterruptedException {
if (FileUtil.control(img)) {
FileUtil.deleteDirectory(SystemInformation.getBackgroundDirectory());
FileUtil.createDirectory(SystemInformation.getBackgroundDirectory());
FileUtil.scaleIma... | 1 |
private void btnAcceptActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAcceptActionPerformed
String backupPath = txtPath.getText();
File filePath = new File(txtPath.getText().trim());
if (backupPath != null && !"".equals(backupPath.trim()) && filePath.exists()) {
Controller.setProperty(App... | 4 |
public void setReminderAhead(long uid, long reminderAhead)
throws SQLException {
Reminder reminder = Reminder.findByApptAndUser(this.getId(), uid);
if (reminder == null)
{
Reminder.create(this.getId(), uid, reminderAhead);
} else
{
reminder.reminderAhead = reminderAhead;
reminder.save();
}
} | 1 |
public void initializeComponents() {
setTitle("Barbeiro");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 678, 490);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
JScrollPane scrollPane = ne... | 8 |
private Integer[][] getLogicalMap(CustomizedArena arena,
int robotDiameterInCellNum) {
int rowCount = arena.getRowCount();
int columnCount = arena.getColumnCount();
Integer[][] logicalMap = new Integer[rowCount][columnCount];
//For each obstacle cell at Row i, Col j,
//Mark logicalMap[i ~ (i + robotDiam... | 8 |
@Override
public boolean parseArg(String[] values) {
if("server".equalsIgnoreCase(values[0])) {
Properties.Common.SIDE = Side.SERVER;
return true;
}
if("client".equalsIgnoreCase(values[0])) {
Properties.Common.SIDE = Side.CLIENT;
return true;
}
return false;
} | 2 |
public HalfEdge findEdge (Vertex vt, Vertex vh)
{
HalfEdge he = he0;
do
{ if (he.head() == vh && he.tail() == vt)
{ return he;
}
he = he.next;
}
while (he != he0);
return null;
} | 3 |
public void setViewEnabled(String view, boolean enabled) {
String value = enabled ? "true" : "false";
rootElement.xpath("view/" + view).attr("value", value);
} | 1 |
@EventHandler(priority = EventPriority.NORMAL)
public void clickOnSign(PlayerInteractEvent e) {
if (!e.getAction().equals(Action.RIGHT_CLICK_BLOCK)) return;
if (!e.hasBlock()) return;
if (!e.getClickedBlock().hasMetadata("rentals_sign")) return;
e.setCancelled(true);
Player ... | 8 |
public static void main(String[] args) throws InterruptedException, ExecutionException {
Future<Long> f = service.submit(new Callable<Long>() {
@Override
public Long call() throws Exception {
long r = 0;
for (int i = 0; i < 10; i++) {
r ++;
Thread.sleep(500);
}
return r;
}
});
... | 3 |
private void bReplaceActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bReplaceActionPerformed
try {
App.ge.extractShapes(getGmlTextWrapped());
doClose(RET_REPLACE);
} catch (XMLStreamException ex) {
System.err.println(ex.getMessage());
JO... | 1 |
public static void addItem(int itemID, int itemX, int itemY, int itemAmount, int itemController, boolean itemStatic) {
for (int i = 0; i <= 5000; i++) { // Phate: Loop through all item spots
if(globalItemID[i] == 0) { // Phate: Found blank item spot
globalItemController[i] = itemController;
globalItemID... | 4 |
public Field findFieldWithAnnotationAttributeAndValue(Class<? extends Annotation> annotationClass,String attributeName, String attributeValue) {
for(Field field : getFields()) {
if(field.isAnnotationPresent(annotationClass)) {
Annotation annotation = field.getAnnotation(annotationClass);
try {
Method ... | 9 |
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
String se = e.getActionCommand();
if(se.equals("Browse"))
{
JFrame f = new JFrame("Select Location");
JFileChooser fc = new JFileChooser();
f.add(fc);
f.setVisible(true);
fc.setFileSelecti... | 6 |
private Map<Integer, Double> getSimResources(int userID, int resID) {
Map<Integer, Double> resources = new LinkedHashMap<Integer, Double>();
// get all resources that have been tagged by the user
for (UserData data : this.trainList) {
if (data.getWikiID() != resID) {
if (userID == -1) {
resources.put(... | 8 |
public String nextToken() throws JSONException {
char c;
char q;
StringBuffer sb = new StringBuffer();
do {
c = next();
} while (Character.isWhitespace(c));
if (c == '"' || c == '\'') {
q = c;
for (;;) {
c = next();
... | 9 |
@Override
/**
* Takes actions based on messages received
*/
public void receive(Message msg) {
super.receive(msg);
Command hdr = (Command) msg.getHeader(Command.HEADER_ID);
switch (hdr.command) {
case 's': // sync state
System.out.format(
"[%s] Received command to sync gameState from %s: %s%n",
... | 8 |
public ScreenshotGenerator(
final ThreadManager threadManager,
final Component guiComponent,
final File inputFile,
final String outputFilename,
final File outputDirectory,
boolean copyableSource,
final Dimension imageSize,
int quality,
double time
) {
super(threadManager, null, 1.0, 0);
... | 7 |
public boolean stem() {
int v_1;
int v_2;
int v_3;
int v_4;
// (, line 133
// do, line 134
v_1 = cursor;
lab0: do {
// call prelude, line 134
if... | 8 |
private void checkAndAddMethod(SootMethod method, SootClass baseClass) {
AndroidMethod am = new AndroidMethod(method);
// Do not call system methods
if (am.getClassName().startsWith("android.")
|| am.getClassName().startsWith("java."))
return;
// Skip empty methods
if (method.isConcrete() && isEmpt... | 7 |
@Override
public synchronized boolean addUser(String username, UUID uuid) {
removeUser(username, uuid);
BufferedWriter bw = null;
try {
bw = new BufferedWriter(new FileWriter(OnlineUsers.directory+OnlineUsers.flatfileData, true));
bw.newLine();
bw.append(username+":"+System.currentTimeMillis()+":"+Strin... | 3 |
private CarType carSizeParse(String a) {
if (a.equals(CarType.CONVERTIBLE.toString())) {
return CarType.CONVERTIBLE;
}else
if (a.equals(CarType.COUPE.toString())) {
return CarType.COUPE;
}else
if (a.equals(CarType.HATCHBACK.toString())) {
return CarType.HATCHBACK;
}else
if (a.equals(CarType.LI... | 8 |
public void assignCourses()
{
ArrayDeque<Instructor> theQueue = new ArrayDeque<Instructor>(instructors.values());
while(!theQueue.isEmpty())
{
Instructor instructor = theQueue.poll();
boolean assigned = false;
while(!assigned)
{
... | 5 |
public double[] columnMedians(){
double[] medians = new double[this.numberOfRows];
for(int i=0; i<this.numberOfColumns; i++){
double[] hold = new double[this.numberOfRows];
for(int j=0; j<this.numberOfRows; j++){
hold[i] = this.matrix[j][i];
... | 2 |
public void reset(Graphics g) {
check();
g.setColor(Colors.lightgrey);
g.fillRect(scale, scale, length * scale, width * scale);
g.drawImage(field, scale, scale, length * scale, width * scale, board);
for (int x = 0; x < width; x++) {
for (int y = 0; y < length; y++) ... | 9 |
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((created == null) ? 0 : created.hashCode());
result = prime * result
+ ((emagVoucherId == null) ? 0 : emagVoucherId.hashCode());
result = prime * result + ((id == null) ? 0 : id.hashCode());
result = prim... | 8 |
public void deletePlayerFromMarker(String userName){
try {
cs = con.prepareCall("{call DELETE_PLAYER_FROM_MARKER(?)}");
cs.setString(1, userName);
cs.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
}
} | 1 |
public String buildInsertFor (T entity) {
StringBuilder sql = new StringBuilder(insertInstruction);
Object value = null;
for (Field field : columnMappings.keySet()) {
String column = columnMappings.get(field);
int replaceStart = sql.indexOf(":" + column);
int replaceEnd = replaceStart + column.len... | 9 |
private void field_codigoFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_field_codigoFocusLost
// TODO add your handling code here:
//if (field_codigo.isEditable()){
if (field_codigo.isEditable() && (lab_modo.getText().equals("Alta"))){
if ((evt.getOppositeComponent()!=... | 6 |
public int parseAtom() throws IOException {
Element localRoot = IRT.createElement(String.valueOf(Tags.ATOM));
curRootElement.appendChild(localRoot);
curRootElement = localRoot;
int result;
if (curToken.type == Lexer.Type.NUMBER) {
result = Integer.parseInt(curToken.c... | 3 |
public void process(ByteBuffer buffer, Client sockector){
if(sockector.isHandShak()){// 已经握手处理
// 通过复杂的数据帧格式来传递数据
parser(buffer,sockector);
}else{// 进行握手处理
String msg = CoderUtils.decode(buffer);
if(MyStringUtil.isBlank(msg)){
return;
}
log.info("the msg received: \r\n" + msg);
... | 4 |
public void WGSignup(String channel, String sender, String login, String hostname) {
Game game;
game = games.get(getServer() + " " + channel);
if(game == null) {
sendMessageWrapper(channel, sender, MSG_NOGAME);
return;
}
if(game.a... | 3 |
public static void multAddTransA_reorder( RowD1Matrix64F A , D1Matrix64F B , D1Matrix64F C )
{
if( C.numCols != 1 ) {
throw new MatrixDimensionException("C is not a column vector");
} else if( C.numRows != A.numCols ) {
throw new MatrixDimensionException("C is not the expecte... | 8 |
private ArrayList<MyEdge> followTheVine(MyNode current) {
if (current.getDegree() == 0) {
return null;
}
MyNode first;
MyEdge e = this.outEdges(current).get(0);
if (current.equals(e.getSource())) {
first = e.getTarget();
} else {
first = e.getSource();
}
MyNode next = first;
MyNode previous ... | 7 |
private boolean initLayerFunctions(boolean optimizing, StringBuffer msg) {
if (numLayers < 1) {
msg.append(MessageFormat.format("invalid number of layers: ''{0}'' (should be > 0)", numLayers));
return false;
}
if (layers == null) {
msg.append("no layers define... | 9 |
private ArrayList<ArrayList<Integer>> helper(int[] candidates, int from, int target) {
ArrayList<ArrayList<Integer>> result = new ArrayList<ArrayList<Integer>>();
if (target == 0) {
result.add(new ArrayList<Integer>());
return result;
}
for (int i = from; i < cand... | 3 |
private void Update(){
if(timeForNextFrame <= System.currentTimeMillis()){
// Next frame.
currentFrameNumber++;
// If the animation is reached the end, we restart it by seting current frame to zero. If the animation isn't loop then we set that animation isn't active.
... | 3 |
public void removeListener (Listener listener) {
if (listener == null) throw new IllegalArgumentException("listener cannot be null.");
synchronized (listenerLock) {
Listener[] listeners = this.listeners;
int n = listeners.length;
Listener[] newListeners = new Listener[n - 1];
for (int i = 0, ii = 0; i <... | 5 |
public void setBumoncode(int bumoncode) {
this.bumoncode = bumoncode;
} | 0 |
@Override
public void mousePressed(MouseEvent arg0) {
if(arg0.getButton() == 2){
if(!middlemouseDown){
middlemouseDown = true;
System.out.println("MMB Down");
PreviousMousePosition[0] = arg0.getX();
PreviousMousePosition[1] = arg0.getY();
}
}
} | 2 |
public boolean contains(Vector vector) {
double dx = end.x - start.x;
double dy = end.y - start.y;
if(dx == 0) {
return vector.x == start.x && vector.y >= start.y && vector.y < end.y;
} else if(dy == 0) {
return vector.y == start.y && vector.x >= start.x && vector.x < end.x;
} else {
double a = dy / ... | 6 |
public boolean isEmpty(int i, int j){
boolean c =false;
if(!board[i][j].equals("X") || !board[i][j].equals("O")) c= true;
else c = false;
return c;
} | 2 |
public void eventMenuFileOpen() {
int proceed = JOptionPane.YES_OPTION;
JFileChooser chooser;
int result;
File selectedFile;
if ( Data.getInventoryChanged() ) {
proceed = JOptionPane.showConfirmDialog( Data.getView(),
Data.CHANGED_MSG,
... | 3 |
public void onMessage(MessageEvent event) {
String rawcommand = event.getMessage();
String command = rawcommand.toLowerCase();
if (command.startsWith("!presents ") || command.equals("!presents")) {
event.respond("(ノಠ益ಠ)ノ彡┻━┻");
} else if (command.startsWith("!pokemon") || command.equals("!pokemon")) {... | 9 |
public boolean exist(char[][] board, String word) {
if (board == null || word == null || word.length() == 0 || board.length == 0) return false;
if (board[0].length == 0) return false;
boolean[][] visited = new boolean[board.length][board[0].length];
for (int i = 0; i < board.length; i++)... | 8 |
@Override
public void executeTask() {
try {
m_SendingSocket = new ServerSocket(LISTEN_PORT);
} catch (IOException e2) {
// TODO Auto-generated catch block
e2.printStackTrace();
}
ObjectInputStream objIn = null;
System.out.println("Listening for remote messages...");
String message = "NULL";
... | 6 |
@Override
public String getUser() {
return "hduser";
} | 0 |
public boolean equals( Object other ) {
if ( other == null ) {
return ( false );
}
else if ( other == this ) {
return ( true );
}
else if ( other.getClass() != this.getClass() ) {
return ( false );
}
Move otherMove = (Move) other;
return ( this.to == otherMove.to() && ... | 4 |
private boolean resize(int newCapacity) {
if (outCapacity >= newCapacity) return true;
byte[] newBuffer = new byte[newCapacity];
System.arraycopy(buffer, 0, newBuffer, 0, Math.min(outBlurbs + ((outBits != 0) ? 1 : 0), newCapacity));
if (newCapacity < outBlurbs + ((outBits != 0) ? 1 : 0))... | 6 |
private static void generateUsecaseHtml(List<Object[]> values) throws IOException {
File htmlOut = new File(getOutputDir(), "index.html");
OutputStreamWriter writer = new OutputStreamWriter(new FileOutputStream(htmlOut, false), "utf-8");
writer.write("<html>\n");
writer.write("<head>\n")... | 1 |
public ArrayList<BoardPosition> scoreCloisters(ArrayList<Player> players,
boolean hasGameEnded) {
ArrayList<BoardPosition> removedMeeples = new ArrayList<BoardPosition>();
Iterator<Meeple> iter = meeplePlacement.keySet().iterator();
// For each meeple which is placed we check to see if it is placed on
// a... | 9 |
@Override
public void executeMsg(final Environmental myHost, final CMMsg msg)
{
super.executeMsg(myHost,msg);
if((affected!=null)
&&(affected instanceof MOB))
{
final MOB mob=(MOB)affected;
if((msg.amISource(mob)||msg.amISource(mob.amFollowing()))
&&(msg.sourceMinor()==CMMsg.TYP_QUIT))
{
unInv... | 8 |
public String getName()
{
String str = "";
if (num < 11)
str += num + " of ";
else if (num == 11)
str += "jack of ";
else if (num == 12)
str += "queen of ";
else if (num == 13)
str += "king of ";
else if (num == 14)
str += "ace of ";
if (suit == HEARTS)
str += "hearts";
else if (suit ... | 9 |
@Override
public boolean okMessage(final Environmental myHost, final CMMsg msg)
{
if((affected instanceof MOB)
&&(msg.amISource((MOB)affected))
&&(msg.targetMinor()==CMMsg.TYP_DAMAGE)
&&(msg.tool() instanceof Weapon)
&&(msg.value()>0)
&&(((Weapon)msg.tool()).weaponClassification()==Weapon.CLASS_THROWN))
... | 7 |
public static String reverseString(String s){
if(s == null){
return null;
}
char[] reverseArray = s.toCharArray();
int lastIndex = 0;
for(int i =0;i <= s.length();i++){
if(i == s.length() || reverseArray[i] == ' '){
reverseChar(reverseArray,lastIndex,i-1);
lastIndex = i+1;
}
}
reverseCh... | 4 |
public void mouseClicked(MouseEvent e) {
System.out.println("Mouse clicked (# of clicks: " + e.getClickCount() + ")");
} | 9 |
public static boolean isOneEditDistance(String s, String t) {
int m = s.length(), n = t.length();
if (m > n)
return isOneEditDistance(t, s);
if (n - m > 1)
return false;
int i = 0, shift = n - m;
while (i < m && s.charAt(i) == t.charAt(i))
i++;
if (i == m) {
if (shift == 0)
return false; // ... | 9 |
public JLabel getjLabel8() {
return jLabel8;
} | 0 |
public static boolean write(List object, File file) {
ObjectOutputStream output = null;
try {
output = new ObjectOutputStream(new FileOutputStream(file));
} catch (IOException e) {
e.printStackTrace();
return false;
}
int amount = object.size();
try {
output.writeObject(amount);
} catch (IO... | 6 |
private static boolean isAbundant(int n){
int sum = 1;
for (int i=2;i<=Math.sqrt(n);i++){
if (i==Math.sqrt(n) && n%i == 0) sum+=i;
else if (n%i==0) sum+=i+n/i;
}
return (sum>n);
} | 4 |
protected byte[] computeByteArray(OSCJavaToByteArrayConverter stream) {
stream.write("#bundle");
computeTimeTagByteArray(stream);
byte[] packetBytes;
for (OSCPacket pkg : packets) {
packetBytes = pkg.getByteArray();
stream.write(packetBytes.length);
stream.write(packetBytes);
}
return stream.toByte... | 1 |
void setArg(Object[] argList) {
LOGOPP.io.debug("function.setArg");
if (this.args == null && argList == null)
return;
if (this.args != null && argList == null) {
LOGOPP.errorhandler.setRunTime(id, "unmatched number of arguments");
return;
}
if (this.args == null && argList != null) {
LOGOPP.errorh... | 9 |
@XmlElementDecl(namespace = "http://www.w3.org/2001/04/xmlenc#", name = "OAEPparams", scope = EncryptionMethodType.class)
public JAXBElement<byte[]> createEncryptionMethodTypeOAEPparams(byte[] value) {
return new JAXBElement<byte[]>(_EncryptionMethodTypeOAEPparams_QNAME, byte[].class, EncryptionMethodType.c... | 0 |
public static boolean validateCategory(){
boolean isValid=false;
return isValid;
} | 0 |
private void startAllAtStartJobs()
{
for(int i=0; i < schedulVector.capacity() ;i++)
{
//only start the recording if the job is enabled
if(schedulVector.get(i).getJobCount() == 3 && schedulVector.get(i).isJobenabled())
{
// start the stream for recording
//look for the to recording stream
Stre... | 3 |
public void mouseClicked(MouseEvent e)
{
Main.mse.setLocation(e.getX()/Main.pixelScale, e.getY()/Main.pixelScale);
if(Main.isMouseLeft) //left click
{
}
else if(Main.isMouseMiddle) //middle click
{
}
else if(Main.isMouseRight) //right click
{
}
} | 3 |
public void setFactorToReference(double factor) {
if(factor > 0) {
this.factorToReference = factor;
}
} | 1 |
public void run(){
double time = 0.5;
while(!TheGame.isOver){
double accelerationX=0,accelerationY=0;
if(TheGame.isRun){
for(Rectangle f: Rectangle.moveList){
if (f.isIn(this.getX(),this.getY())){
accelerationX +=f.getAccelerationX(this);
... | 6 |
public void setCurrent(String current) {
if (this.getParent() == null) {
return;
}
String previous = (String) getStateHelper().get(current);
getStateHelper().put(PropertyKeys.current, current);
// Fire an {@link AreaSelectedEvent} if appropriate
if ((previou... | 6 |
static final void method2035(int i, int i_4_) {
anInt3445++;
int i_5_ = Class367_Sub11.logicCycle - FloatBuffer.anInt9751;
if ((i_5_ ^ 0xffffffff) <= -101) {
Class348_Sub40_Sub21.anInt9282 = 1;
Class9.anInt167 = Class318_Sub1_Sub5_Sub2.anInt10163 = -1;
} else {
int i_6_ = (int) Class76.aFloat1287;
... | 7 |
private void spawnEnemy(double deltaTime) {
timeSinceLastSpawn += deltaTime;
if (timeSinceLastSpawn > 2){
Random random = new Random();
Vector2f position = new Vector2f(random.nextInt(700) + 50, random.nextInt(300));
spawnEntity(spawner, position);
timeSin... | 1 |
@RequestMapping(method = RequestMethod.PUT, value = "{id}")
public void finishTask(@PathVariable("id") Integer id, @RequestParam String action) {
switch (Action.valueOf(action)) {
case FINISH:
stepsService.finishById(id);
break;
}
} | 1 |
@Override
public boolean equals(Object obj)
{
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
Edge other = (Edge) obj;
if (end == null) {
if (other.end != null) {
return false;
... | 9 |
public void setMiasto(String miasto) {
this.miasto = miasto;
} | 0 |
public void valida(){
String usuario =jTextField1.getText();
String contrasenia=jTextField2.getText();
if(usuario.equalsIgnoreCase("admin") && contrasenia.equalsIgnoreCase("admin")) {
new JOptionPane().showMessageDialog(this,"Bienvenido: "+usuario,"CONFIRMAR",JOptionPane.INFORMATIO... | 2 |
int maxDiffArray(int[] A) {
int buy = 0;
int sell = 1;
int max = A[sell] - A[buy];
while (sell < A.length) {
max = Math.max(A[sell] - A[buy], max);
if (A[sell] < A[buy])
buy = sell;
sell++;
}
return max;
} | 2 |
public void waitForPageToLoad() {
// Logger.getInstance().info("waitForPageToLoad started");
WebDriverWait wait = new WebDriverWait(driver, Long.parseLong(getTimeoutForPageLoad()));
try {
wait.until((ExpectedCondition<Boolean>) new ExpectedCondition<Boolean>() {
public Boolean apply(final WebDriver d) {
... | 5 |
private void heapifyDown(Entry<E> entry) {
Entry<E> currentEntry = entry;
Entry<E> bestEntry = null;
do {
bestEntry = currentEntry;
Entry<E> leftEntry = leftChild(currentEntry);
if (leftEntry != null) {
if (compare(bestEntry, leftEntry) < 0) {
bestEntry = leftEntry;
... | 6 |
public void remove(E e)
{
Node u = find(e);
if (u == null)
return;
if (size <= 1) min = null;
else if (min != null && e == min.key) //nullpointer
min = getNext(min);
size--;
if (u.left == null && u.right == null)
... | 9 |
private void method362(int i, int ai[], byte abyte0[], int j, int k, int l,
int i1, int ai1[], int j1) {
int k1 = -(l >> 2);
l = -(l & 3);
for (int l1 = -i; l1 < 0; l1++) {
for (int i2 = k1; i2 < 0; i2++) {
byte byte1 = abyte0[i1++];
if (byte1 != 0)
ai[k++] = ai1[byte1 & 0xff];
else
k+... | 8 |
@Override
public void actionPerformed(ActionEvent e) {
if (e.getSource() == btn_setColorBlob) {
if(btn_setHazard.isSelected()) {
btn_setHazard.setSelected(false);
}
JToggleButton jToggleButton = (JToggleButton)e.getSource();
if (jToggleButton.... | 9 |
public void nouvellePiece() {
courante = suivantes[0];
int i;
for (i = 0; i < suivantes.length - 1; i++) {
suivantes[i] = suivantes[i + 1];
}
suivantes[i] = Piece.randPiece(nombrePieces);
int[][] minMax = courante.getForme().minMax();
int randY;
... | 1 |
public void Disconnect(int clientID)
{
int idToDelete = 0;
boolean delete = false;
for(IClientObserver observer : this.observers)
{
if(observer.GetObserverID() == clientID)
{
System.out.println("Client : " + Inte... | 3 |
public int generate1(){ //Generate per-turn resources
if (resource1==1){
resource1_level=(sgenrate1*small+mgenrate1*med+lgenrate1*large)*Empous.Gov.getStat("taxes")/5
-((Empous.Gov.getStat("freedom")*Empous.Gov.getStat("military")+1)*10
+Empous.Gov.getStat("education")*10
+Empous.Gov.getStat("infras... | 3 |
public static void insertion( Individual[] individuals )
{
for(int i = 1; i < individuals.length; i++)
{
int j = i;
while( j>0 && individuals[j].getFitness()<individuals[j - 1].getFitness() )
{
swap( individuals, j, j - 1 );
j--;
}
}
} | 3 |
synchronized boolean lock(int transactionId, int resourceId, ServerImpl serverimpl)
{
if (lockOwner == transactionId) {
System.err.println("Error: Transaction " + transactionId + " tried to lock a resource it already has locked!");
return false;
}
long timeout_time = Globals.TIMEOUT_INTERVAL + System.curre... | 7 |
public Long create(String name) {
boolean isCreated = false;
Long author_id = -1L;
if (DataUtils.isEmpty(name)) {
logger.warn("Contains null fields");
} else
try {
prepSt = prepStatements[CREATE_AUTHOR];
prepSt.setString(1, name.toL... | 4 |
public boolean setEditing(boolean editing) {
if (!isChangeable) {
return false;
} else {
for (Component component : getComponents()) {
if (component instanceof JPanel) {
LayoutManager lm = ((JPanel) component).getLayout();
if (lm instanceof CardLayout) {
((CardLayout) lm).show((Container) ... | 5 |
private Instances removeExtraAttributes(Instances dataset, HashMap<String, Boolean> setting) {
if (!setting.get("Time")) {
dataset.deleteAttributeAt(dataset.attribute("time").index());
}
if (!setting.get("Ball")) {
dataset.deleteAttributeAt(dataset.attribute("ballDis").index());
dataset.deleteAttributeAt... | 6 |
public void setRecord(Record record) {
this.record = record;
} | 0 |
public static void resumeSchedule(){
// Set the playPause flag to true
playPause = true;
// Used for loops
int i;
// Timer started again.
slideTimer = new Timer();
// Set the last entities to be display or undisplayed
long delay = lastestTime.getTimeStopped();
// Check to see if the slide has got content.
... | 7 |
@Override
public void execute(IContext context) throws Exception {
if(Boolean.parseBoolean(context.getProperties().getProperty("autoindex"))){
File repo = new File((String) context.getProperties().get("file.repository"));
String path = (String) context.getParameter("path");
File currentDir = new File(re... | 4 |
public static ApplictionResources getInstance() {
if (instance == null) {
instance = new ApplictionResources();
}
return instance;
} | 1 |
public void setName( String name ) {
if( name == null )
throw new IllegalArgumentException( "name must not be null" );
this.name = name;
} | 1 |
public void run() {
int maxTime = 60000;
willpower = model.getStat("willpower").getValue();
strenght = model.getStat("strenght").getValue();
critical = model.getStat("critrate").getValue();
alacrity = model.getStat("alacrity").getValue();
power = model.getStat("power").getValue();
forcepower = model.ge... | 5 |
@Override
public String runMacro(HTTPRequest httpReq, String parm, HTTPResponse httpResp)
{
final java.util.Map<String,String> parms=parseParms(parm);
if(parms.containsKey("DOMAIN"))
return CMProps.getVar(CMProps.Str.MUDDOMAIN);
if(parms.containsKey("EMAILOK"))
return ""+(CMProps.getVar(CMProps.Str.MAILBO... | 8 |
private int getComputerMove() {
//label the winning/losing nodes from the game state
LinkedList<NimVertex> labels = NimAlgorithms.labelNimGraph(gameState);
//determine the desired condition
boolean wantToWin = gameType == GameType.MissionImpossible
? true : gameType == GameType.FairGo ? true : false;
//... | 5 |
public void SetInfo(String info) {
String user, desc, conn, mail, share;
int index = 0;
user = new String();
while (info.charAt(index) != ' ') {
user = user + info.charAt(index);
index++;
}
if (user.equals(_bot.botname()))
return;
index++;
desc = new String();
while (info.charAt(index) != '$... | 8 |
public static void main(String[] args) {
initLWJGL();
try {
AppGameContainer game = new AppGameContainer(new Game("Pokemons"));
game.setDisplayMode(800, 600, false);
game.setMaximumLogicUpdateInterval(5);
game.setTargetFrameRate(200);
game.start();
} catch (SlickException e) {
e.printStackTra... | 1 |
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.