text stringlengths 14 410k | label int32 0 9 |
|---|---|
public boolean removeOpenFormat(String formatName) {
int index = indexOfName(formatName, openerNames);
if (index >= 0) {
openerNames.remove(index);
openers.remove(index);
// Also remove it from the list of formats stored in the preferences
Preferences.FILE_FORMATS_OPEN.remove(index);
return t... | 1 |
private List<PseudoSequence> buildProjectedDatabase(Integer item, List<PseudoSequence> database, Set<Integer> sidset, boolean inPostFix) {
// We create a new projected database
List<PseudoSequence> sequenceDatabase = new ArrayList<PseudoSequence>();
// for each sequence in the database received as parameter
fo... | 7 |
public static int getTreeHeight(ParserNode node, int symbolSize) {
if (node.isVar())
return 0;
int height = 0;
List<ParserNode> children = node.getChildren();
int childrenSize = children.size();
if (childrenSize == 1) {
// Ako čvor ima samo jedno dijete, stablo je visoko koliko je
// visoko i podst... | 9 |
private List<Integer> findSharedUsers(int movie1, int movie2) {
List<Integer> sharedUsers = new ArrayList<Integer>();
HashSet<Integer> movie1Raters = usersByMovie.get(movie1);
HashSet<Integer> movie2Raters = usersByMovie.get(movie2);
// Return empty list if one user didn't rate any movies
if (movie1Raters ==... | 4 |
public static void removeAllBorders()
{
if (!borderEnabled()) return;
for(CircleMarker marker : roundBorders.values())
{
marker.deleteMarker();
}
roundBorders.clear();
for(AreaMarker marker : squareBorders.values())
{
marker.deleteMarker();
}
squareBorders.clear();
} | 3 |
public void addCourse(String name, String course) {
/* search entire tree, if found, add course */
StudentNode currentStudent = root;
StudentNode preNode = null;
/* empty tree */
if (root == null) {
StudentNode newNode = new StudentNode(name);
newNode.courses.add(course);
root = newNode;
numStude... | 5 |
public User login(String userName, String password) {
ArrayList<User> lista = (ArrayList<User>) userList.getUserList();
for (User us : lista) {
if (userName.equals(us.getName())
&& password.equals(us.getPassword())) {
return us;
}
}
return null;
} | 3 |
final Class258_Sub3 method3467(int i, int i_4_) {
anInt4357++;
Object object = aClass60_4361.method583((long) i, -127);
if (object != null)
return (Class258_Sub3) object;
if (!aD4359.method4(-7953, i))
return null;
TextureDefinition class12 = aD4359.getTexture(i, -6662);
int i_5_ = (!((TextureDefinition... | 8 |
public static Phasor parsePhasor(String ss){
Phasor ph = new Phasor();
ss = ss.trim();
int anglePos = ss.indexOf('<');
if(anglePos==-1){
anglePos = ss.indexOf('L');
if(anglePos==-1)throw new IllegalArgumentException(... | 8 |
public void moveOwl() {
if (move != null){
if (move.getWhere() == 0){
x += 10;
} else if(move.getWhere() == 1){ //vasen
x -= 10;
}else if (move.getWhere() == 2){ //alas
y += 10;
} else if (move.getWhere() == 3) { //y... | 5 |
private AbstractResource findResource
(String resName,
String resID,
String packageName) {
// Find the correct package
for (ARSCFileParser.ResPackage pkg : this.resourcePackages) {
// If we don't have any package specification, we pick the app's default package
boolean matches = (packageName == null ... | 6 |
public String getDescription()
{
if ( fullDescription == null )
{
if ( description == null || isExtensionListInDescription() )
{
fullDescription = description == null ? "(" : description + " (" ;
// build the description from the extension list
Enumeration extensions = filt... | 6 |
public double newPurchase(){
Random r = new Random();
if (marketStrength == 0)
marketStrength += .01;
double marketEffect = marketStrength * beta + stockStrength; // strength less than one causes decrease in price, beta exaggerates/ mitigate's market's effect
double d = r.nextDouble() * volatility * marketEffe... | 2 |
private void message(String user_name, CommandArgsIterator args_it)
throws IOException
{
if (args_it.hasNext()) {
String dest = args_it.next();
String message = args_it.remainder();
if (dest.length() >= 1 && !message.isEmpty()) {
... | 8 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Circuit circuit = (Circuit) o;
if (eRank != null ? !eRank.equals(circuit.eRank) : circuit.eRank != null) return false;
if (hRank != null ? !hRa... | 9 |
protected void setOutput(String output)
{
((MooreMachine) to.getAutomaton()).setOutput(to, output);
} | 0 |
public static double informationGainRatio(String attribute,
ArrayList<HashMap<String, String>> examples,
HashMap<String, String[]> attributeValues, String goalAttribute) {
double iv = intrinsicValue(attribute, examples, attributeValues);
if (iv == 0) {
return 1;
}
return informationGain(attribute, exam... | 1 |
public DonneeArgos ( String numBalise, String precision,
String date, String heure,
String latitude, String longitude ) {
this.numBalise = numBalise;
this.precision = precision;
int annee = 0;
int mois = 0;
int jour... | 2 |
private void sendMessage(String text)
{
// Due to chunk generation eating up memory and Java being too slow about GC, we need to track memory availability
int availMem = Config.AvailableMemory();
Config.Log("[Fill] " + text + " (free mem: " + availMem + " MB)");
if (notifyPlayer != null)
notifyPlayer.sendM... | 3 |
@Override
public boolean equals(Object obj) {
if (super.equals(obj)) {
StringTag o = (StringTag) obj;
return ((data == null && o.data == null) || (data != null && data.equals(o.data)));
}
return false;
} | 4 |
private void TfCodProdutoKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_TfCodProdutoKeyReleased
if (!TfCodProduto.getText().equals("")) {
prodcompravenda.getForneproduto().getProduto().setCodigo(Integer.parseInt(TfCodProduto.getText()));
if (!TfCodFornecedor.getText().equals... | 8 |
public static int firstPrimeAfter(int n) {
for(int i = n + 1; i > n; ++i) {
int factors = 0;
for(int j = 1; j < (i + 2) / 2; ++j) {
if((i % j) == 0)
factors++;
}
if(factors < 2) {
return i;
}
... | 4 |
public String getOneChapterContent(String ver, String bookChapter) throws ParseException, IOException {
Path file = Paths.get("/home/mark/bible/content/" + ver + "/" + bookChapter + ".htm");
StringBuilder sb = new StringBuilder();
Charset charset = Charset.forName("US-ASCII");
if (ver.e... | 3 |
public static boolean isTrue(String s) {
if (s == null || s.length() == 0) {
return false;
}
char c = s.charAt(0);
return c == 't' || c == 'T' || c == 'y' || c == 'Y' || c == '1';
} | 6 |
public void paintGameObjects(Graphics2D g) {
if(instructions) {
g.setColor(Color.WHITE);
g.setFont( displayFont );
g.drawString("Player One Uses Arrow Keys.", 20, SCREEN_HEIGHT/4);
g.drawString("Player Two Uses WASD.", 20, SCREEN_HEIGHT/2);
g.drawStrin... | 7 |
public void setQuery(String q)
{
tmp = new Vector<String[]>();
try
{
ResultSet rs = statement.executeQuery(q);
ResultSetMetaData meta = rs.getMetaData();
columns = meta.getColumnCount();
headers = new String[columns];
for (int i = 1; i <= columns; i++)
headers[i - 1] = meta.getColumnName(i);
... | 4 |
public static List<Weapon> parseWeapons(File f){
List<Weapon> weapons = new ArrayList<>();
try {
Scanner sc = new Scanner(f);
while(sc.hasNextLine()){
String line = sc.nextLine();
String[] content = line.split(",");
String name = content[0];
String dmgDice = content[1];
String profBon... | 4 |
private int getIntBigEndian(byte[] a, int offs) {
return
(a[offs] & 0xff) << 24 |
(a[offs + 1] & 0xff) << 16 |
(a[offs + 2] & 0xff) << 8 |
a[offs + 3] & 0xff;
} | 0 |
@POST
@Path("/createEvent")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response createEvent(String jsonObject) {
Gson gson = new GsonBuilder().setDateFormat(WS_DATE_PATTERN).create();
Event event = null;
try {
event = gson.fromJson(jsonObject, Event.class);
} catc... | 5 |
@Override
public Vector substract(Vector vector) throws IllegalArgumentException {
if (this.getFieldsNumber() != vector.getFieldsNumber()) {
throw new IllegalArgumentException();
}
for (int i = 0; i < getFieldsNumber(); i++) {
try {
setElementAt(i + 1, this.getElementAt(i + 1) - vector.getElementAt(i +... | 3 |
private static DetailObject getDetailObject(String language) {
boolean objectFound = false;
DetailObject detailObject = null;
for (DetailObject detailObject1 : SourceScanner.detailObjects) {
if (detailObject1.getLanguage().equalsIgnoreCase(language)) {
objectFound = true;
detailObject = detailObject1;
... | 3 |
public void drawColored(Bitmap bitmap, int color, int xo, int yo) {
for (int y = 0; y < bitmap.height; y++) {
int yy = y + yo;
if (yy < 0 || yy >= this.height)
continue;
for (int x = 0; x < bitmap.width; x++) {
int xx = x + xo;
if (xx < 0 || xx >= this.width)
continue;
if (bitmap.pixels[... | 7 |
public Causa eliminacionTestigoPorTeclado(){
@SuppressWarnings("resource")
Scanner scanner = new Scanner (System.in);
String texto;
int expediente;
Long dni;
Causa causa = new Causa();
try {
System.out.println("Eliminar Testigo de la Causa");
System.out.println("----------------------------");
w... | 9 |
public boolean listenSocket() {
try {
server = new ServerSocket(4444);
System.out.println("server running on port 4444");
} catch (IOException e) {
System.out.println("Could not listen on port 4444");
System.exit(-1);
}
//listen for new co... | 6 |
private void cpuLoadNextProcess() {
System.out.println("cpuLoadNextProcess()");
Process p = cpu.startNextProcess();
if (p != null) {
p.updateProcess(CPU_ACTIVE);
long processRemainingTime = p.getRemainingCPUTime();
long maxCpuTime = this.maxCpuTime;
long processNextIO = p.getTimeToNextIoOperation(... | 5 |
int open_seekable() throws SoundException {
Info initial_i = new Info();
Comment initial_c = new Comment();
int serialno;
long end;
int ret;
int dataoffset;
Page og = new Page();
// is this even vorbis...?
int[] foo = new int[1];
ret = fetc... | 5 |
public HashMap<String, Character> getState() {
HashMap<String, Character> points = new HashMap<String, Character>();
for (int i = 0; i < plateau.length; i++) {
for (int j = 0; j < plateau[0].length; j++) {
if (updates[i][j]) {
System.out.println("Updated");
char sym;
if(plateau[i][j]==nu... | 5 |
public void commandLine() {
while (true) {
System.out.print(">");
command = userInput.nextLine().split(" ");
//String junk = userInput.next();
if (command[0].equals("addplayer")) {
comAddplayer();
} else if (command[0].equals("removeplayer")) {
comRemoveplayer();
} else if (command[0].equals... | 9 |
private void whereDoIGo(String urlParameter, HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException{
// URL string for the file the user should be taken to next.
String whereToGo;
// Check if parameter is null, ie, was not supplied
if(urlParameter == null){
urlPar... | 8 |
public static MyList board() {
// generate positions for a square board, and let the
// onBoard() function filter out the wrong positions
MyList boardlist = new MyList();
for (int r = 1; r <= 17; r++) { // for every row
int c = ((r % 2 == 0) ? 2 : 1); // what col to start?
for (; c <= 9; c += 2) {
Hex... | 4 |
public void recuperar() {
FileInputStream fis = null;
ObjectInputStream stream = null;
try {
File arquivo = new File("arquivo.bin");
if (arquivo.exists()) {
fis = new FileInputStream(arquivo);
stream = new ObjectInputStream(fis);
persistencia = (Persistencia) stream.readObject();
}
} catch ... | 6 |
public void writeHistory(DataOutput output) {
try {
output.writeInt(VERSION);
sourcePanel.writeHistory(output);
destinationPanel.writeHistory(output);
int comboCount = commandCombo.getItemCount();
Vector commands = new Vector();
for (int i ... | 4 |
private static void invokeServiceListenerCallback(Bundle bundle,
final EventListener l, Filter filter, Object acc,
final EventObject event, final Dictionary<String, Object> oldProps)
{
// Service events should be delivered to STARTING,
// STOPPING, and ACTIVE bundles.
if ((bu... | 9 |
@Override
public void createFrom(int elementIndex, int numberOfPoints) {
int size = 0;
for(int i = 0; i<numberOfPoints; i++){
size = size + inData.getLength()/numberOfPoints;
Float[] array = new Float[size];
for(int j = 0; j < size; j++ ){
array[j]... | 2 |
public final void visitTryCatchBlock(
final Label start,
final Label end,
final Label handler,
final String type)
{
AttributesImpl attrs = new AttributesImpl();
attrs.addAttribute("", "start", "start", "", getLabel(start));
attrs.addAttribute("", "end", "end",... | 1 |
public void tick() {
anim.tick(x, y);
if (Main.getKey("W"))
y -= speed;
if (Main.getKey("S"))
y += speed;
if (Main.getKey("A"))
x -= speed;
if (Main.getKey("D"))
x += speed;
} | 4 |
public RegistrationPage getRegistrationPage() {
if (registrationPage == null) {
registrationPage = new RegistrationPage(this);
}
return registrationPage;
} | 1 |
public static void setMaxLitterSize(int max_litter_size)
{
if (max_litter_size >= 1)
Grass.max_litter_size = max_litter_size;
} | 1 |
public void changeOrAdd(MindmapLastStateStorage pStore) {
boolean found = false;
for (Iterator it = mLastStatesMap.getListMindmapLastStateStorageList()
.iterator(); it.hasNext(); ) {
MindmapLastStateStorage store = (MindmapLastStateStorage) it.next();
if (Tools.sa... | 8 |
boolean shootAt(int row, int column){
if(this.isSunk()){
return false;
}
if(this.isHorizontal()){
for(int j = 0; j < this.getLength(); j++){
// System.out.println(this.bowRow + "," + this.bowColumn + j);
// System.out.println(row + "," + column);
... | 8 |
static public DalcPlaylist getInstance() {
if (m_instance == null) {
m_instance = new DalcPlaylist();
}
return m_instance;
} | 1 |
public void train(int maxIter, int windowSize, double initStep, double shrinkage){
int iteration = m_iteration;
// Step 0: output the settings
System.out.println("[Info]LambdaRank configuration:");
System.out.format("\tOptimization Type %s, Lambda %.3f, Shrinkage %.3f, WindowSize %d\n", m_oType, m_lambda, sh... | 5 |
public int compare(final Delta<?> a, final Delta<?> b) {
final int posA = a.getOriginal().getPosition();
final int posB = b.getOriginal().getPosition();
if (posA > posB) {
return 1;
} else if (posA < posB) {
return -1;
}
return 0;
} | 4 |
public void saveDefaults() {
if (file == null) {
file = new File(InstaScatter.ins.getDataFolder(), name);
}
if (!file.exists()) {
InstaScatter.ins.saveResource(name, false);
}
} | 2 |
@Override
public void map(IntWritable key, IntArrayWritable value,
OutputCollector<IntWritable, IntArrayWritable> output, Reporter reporter)
throws IOException {
IntWritable[] xMovie = (IntWritable[]) value.toArray();
Set<Integer> imdbMovie = new HashSet<Integer>();
for(int i =0 ;i<xMovie.length; i++... | 6 |
public static void commandHandler(String cmd) throws IOException {
// switch(String) doesn't exist on JDK 6 (only 7)... Resorting to a series of ifelse statments
if(cmd.contains("/query-for-peers")) {
System.out.println("Querying directory server...");
sendToDirectory("QUERY", null, null);
} else if(cmd.con... | 9 |
static final public void MessageSend() throws ParseException {
PrimaryExpression();
jj_consume_token(DOT);
Identifier();
jj_consume_token(LPAREN);
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case LPAREN:
case NOT:
case FALSE:
case NEW:
case THIS:
case TRUE:
case INTEGER_LITER... | 9 |
public Cookie getUsuarioLogado() {
Cookie[] cookies = this.cookies;
if(cookies == null) return null;
for (Cookie cookie : cookies) {
if(cookie.getName().equals("usuarioLogado")){
return cookie;
}
}
return null;
} | 3 |
public double calculoCoeficiente(double unPrecio){
if(unPrecio>500){
return(1.35);}
else{ return(1.1);}
} | 1 |
double[] randomSample() {
double[] sample = new double[n];
for (int i = 0; i < n; i++) {
sample[i] = (lowBound[i] + generator.nextDouble() * (upBound[i] - lowBound[i]));
}
return sample;
} | 1 |
public synchronized byte[] encode(String str, int size) {
byte abyte0[] = null;
if (size > 0) {
abyte0 = f;
f = new byte[size];
}
g = 0;
h = 0;
int l = str.length();
e += l;
for (int j1 = 0; j1 < l;) {
Integer integer = null;
int i1 = j1 + 1;
Hashtable hashtable = c;
do {
if (j... | 8 |
public String toString() {
String equipmentString = "";
int i = 1;
for (Field f : EquipmentSet.class.getFields()) {
if (!f.getType().isPrimitive()) {
try {
equipmentString += i + ") " + f.getName() + ": " + f.get(this) + "\n";
} catch (IllegalArgumentException e) {
} catch (IllegalAccessExcept... | 4 |
@Override public Iterator<String> iterator() {
return cookies.keySet().iterator();
} | 0 |
public String toString() {
String output = "";
for (int i = 0; i < lists.length; i++) {
if (i <= lists.length && lists[i] != null) {
if (lists[i].toString() != null) {
output += lists[i].toString();
output += "; ";
}
... | 4 |
public int getMinJaar()
{
int jaar = 99999;
// Itereer de datasets
for (DataSet set: this.datasets)
{
for (Category cat: set.categories)
{
for (SubCategory scat: cat.subcategories)
{
SubCategory subcat = new SubCategory(scat.id, scat.naam, scat.datatype, scat.wei... | 5 |
public static void main(String[] args) {
try(AsynchronousSocketChannel socketChannel = AsynchronousSocketChannel.open()) {
if (socketChannel.isOpen()) {
Set<SocketOption<?>> socketOptions = socketChannel.supportedOptions();
System.out.println(socketOptions);
... | 9 |
public boolean contains(Attributes attributeList) {
return indexOf(attributeList) >= 0;
} | 0 |
@Override
public boolean deleteICNum(String id, double num) {
// TODO Auto-generated method stub
double icnum = getICNum(id);
double totalNum = 0;
int status = memberDaoImpl.getICStatus(id);
if (icnum < num) {
if (status >= 6) {
memberDaoImpl.setICStatus(id, 6);
memberDaoImpl.alterStatus(id, Memb... | 3 |
public static Integer getBoyToGirlRashiDistance(Rashi boyRashi, Rashi girlRashi) {
int boyNumber = boyRashi.ordinal() + 1;
int girlNumber = girlRashi.ordinal() + 1;
int distance = 0;
if (boyNumber < girlNumber) {
distance = girlNumber - (boyNumber - 1);
}
if (boyNumber > girlNumber) {
distance = (gir... | 3 |
@SuppressWarnings("unchecked")
public <T> T getVariable(String name, T type) throws InvalidParameterException, TesseractException {
requireState(State.INITIALIZED);
int rv = 0;
if (type instanceof Integer) {
IntBuffer value = IntBuffer.allocate(1);
rv = api.T... | 5 |
public void takeTurn(AtomicReference<Player> whoseTurn) throws InterruptedException {
this.gameStillRunning = true;
while (this.gameStillRunning) {
for (int i = 0; i < this.playerList.size(); i++) {
Player player = this.playerList.get(i);
whoseTurn.set(player)... | 6 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Location other = (Location) obj;
if (Double.doubleToLongBits(this.row) != Double.doubleToLongBits(other.r... | 6 |
public static File[] saveAs(Saveable saveable) {
if (saveable == null) {
return new File[0];
}
String path = saveable.getPreferredSavePath();
File result = StdFileDialog.choose(UIUtilities.getComponentForDialog(saveable), false, SAVE_AS, PathUtils.getParent(path), PathUtils.getLeafName(path), saveable.getAll... | 3 |
public Ruutu seuraavaRuutu(Ruutu ruutu, int suunta) {
int vipu=(suunta)%4;
switch (vipu) {
case 0: if (ruutu.getY()==koko) {
return null;
}
ruutu=pelilauta[ruutu.getX()][ruutu.getY()+1];
break;
case 1: i... | 8 |
public String toString(){
String clause = "";
for (int i = 0; i < literals.size() - 1; i++) {
clause += getLiteral(i) + " OR ";
}
if(literals.size() > 0){
clause += getLiteral(literals.size() -1);
}
return clause;
} | 2 |
public void mouseClicked(MouseEvent e) {
if (image !=null && tileset) {
if (e.getX()>=0 && e.getX() <image.getWidth() && e.getY() >= 0 && e.getY() < image.getHeight()) {
tileSelected = new Vector<Integer>();
x0 = (e.getX()/(8*zoom));
y0 = (e.getY()/(8*zoom));
tileSelected.add(x0 + (y0*(image.getWid... | 6 |
@Test
public void calcMeanValues_test() {
try{
double [][]mat1= {{1.0,2.0}, {3.0,1.0}};
PCA pca = new PCA(mat1);
PCA.calcMeanValues(mat1);
pca.getEigenValues();
pca.getEigenVectors();
pca.getVectorsZeroMean();
pca.getResultingVectors();
pca.getMeanValues();
double[] result=PCA.calcMeanValues(mat... | 1 |
private UnitPlayer randomPositionAvatar() {
int id = -1;
//Get the current Highest ID to set the new Avatars ID to one higher than that ID
for (int x = 0; x < gameBoard.length; x++) {
for (int y = 0; y < gameBoard[0].length; y++) {
if (gameBoard[x][y] instanceof UnitPlayer) {
id = Math.max(id, ((UnitP... | 5 |
@Override
public ArrayList<Task> findAllActive(Boolean active) {
ArrayList taskList = new ArrayList();
try {
connection = getConnection();
ptmt = connection.prepareStatement(QUERY_SELECT + "WHERE active=?;");
ptmt.setBoolean(1, active);
resultSet = ptm... | 6 |
private void getData(){
try {
cbSubject.removeAllItems();
cbObject.removeAllItems();
cbVerb.removeAllItems();
cbLocation.removeAllItems();
cbLocationObject.removeAllItems();
ConnectDatabase cdb = new ConnectDatabase();
ResultSet result = cdb.st.executeQ... | 9 |
public void start() {
CountdownTimer.setDELTA_TARGET(Constants.DELTA_TARGET);
game = Game.getInstance();
final int DELTA_TARGET_NANOS = Constants.DELTA_TARGET * 1000 * 1000 * TICK_RENDER_RATIO;
while (true) {
long timeStart = System.nanoTime();
BufferStrategy bs = getBufferStrategy();
if (bs == null... | 4 |
int NNI( double[][] avgDistArray, int count )
{
edge e, centerEdge;
edge[] edgeArray;
direction[] location;
heap p,q;
int i;
int possibleSwaps;
double[] weights;
p = new heap(size+1);
q = new heap(size+1);
edgeArray = new edge[size+1];
weights = new double[size+1];
location = new di... | 3 |
@Override
public Ingredient addIngredient(String s) {
Ingredient c = getIngredient(s);
if(c != null){
return c;
}
c = new Ingredient(getNextId(), s.toUpperCase(Locale.ENGLISH));
ingredientRepository.add(c);
return c;
} | 1 |
private void drawSouth(Terrain[][] currentBoard,
Entities[][] currentObjects, Graphics g) {
//Same logic as above but reversed x, y in respect to board array to draw "upside down"
Location playerDir = boardState.getPlayerCoords();
for (int i = 0; i < currentBoard.length; i++) {
for (int j = 0; j < currentBo... | 6 |
public void kulkusuunnanKustannus(int i, int j) {
if ((i == 0 && j == 0) || (i == 0 && j == 2) || (i == 2 && j == 0) || (i == 2 && j == 2)) {
naapuri.setPaino(kulmittain); // Kulmittain
} else {
naapuri.setPaino(sivuttain); // Suoraan sivussa
}
} | 8 |
public static Controller getController(ControllerType type) {
switch (type) {
case TREE_CONTROLLER:
break;
case DOOR_CONTROLLER:
return new DoorController();
case ENTRANCE_CONTROLLER:
return new EntranceController();
}
... | 3 |
@Override
public void keyPressed(KeyEvent key) {
switch (key.getKeyCode()) {
case KeyEvent.VK_UP:
System.out.println("pressed: Key Up");
break;
case KeyEvent.VK_DOWN:
System.out.println("pressed: Key Down");
break;
case KeyEvent.VK_LEFT:
if(!moveLeft){
moveLeft = true;
ball.move(moveRigh... | 7 |
protected static void importFile(DocumentInfo docInfo, FileProtocol protocol) {
openFile(docInfo, protocol, MODE_IMPORT) ;
} | 0 |
* @param settlement The <code>Settlement</code> that is trading.
*/
private void attemptBuyFromSettlement(Unit unit, Settlement settlement) {
Player player = freeColClient.getMyPlayer();
Goods goods = null;
// Get list of goods for sale
List<Goods> forSale
= askServ... | 9 |
public int driveTheCar(int distanceTravelled) {
if (isCarRented() == true || fuelInCar > 0){
int consumptionRate;
if (distanceTravelled <= 50){
consumptionRate = distanceTravelled/10;
return consumptionRate;
} else {
consumptionRate = ((distanceTravelled - 50)/15) + 5... | 3 |
void updateContentInfo() {
Map<String, Integer> groups=new HashMap();
int dayLenght=0;
for(String name:Day.getAllDays().keySet())
{
Day d=Day.getAllDays().get(name);
for(DayEvent e:d.getEventList()){
if(!e.isUnused()){
... | 5 |
private Observer createObserver() {
return new Observer() {
@Override
public void update(final String event) {
switch (event) {
case "Opened":
int count = cell.countNeighborsWithMines();
refresh((count ==... | 7 |
public static void printStepCounts(DualGbState state) {
System.out.println("size: "+state.stateBufferL.size() + " + " + state.stateBufferR.size());
int minStepCountL = Integer.MAX_VALUE;
int maxStepCountL = Integer.MIN_VALUE;
int minDelayStepCountL = Integer.MAX_VALUE;
int maxDelayStepCountL = Integer... | 8 |
public LinkedList<Node> findPath()
{
DijkstraNode current, start = map_[start_.x][start_.y] ,
goal = map_[goal_.x][goal_.y];
start.setGScore(0); // setting the g score of the start to zero
while(!open_list_.isEmpty())
{
current = lookingForBestNode(); // get node with ... | 7 |
public void print() {
for(int i = 0; i < nodes.size(); i++) {
((Node)nodes.get(i)).print();
}
} | 1 |
public static void loadConfig() {
try {
BufferedReader reader = new BufferedReader(new FileReader(System.getProperty("user.dir") + "/config"));
String line;
while((line = reader.readLine()) != null) {
if(line.matches("<AUDIO>")) {
String[] temp = reader.readLine().split("=");
En... | 7 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Funcao other = (Funcao) obj;
if (this.IdFuncao != other.IdFuncao && (this.IdFuncao == null || !this.IdFun... | 5 |
public void setReorderLevel(int reorderLevel) {
this.reorderLevel = reorderLevel;
} | 0 |
public int getCapacity() {
return CAPACITY;
} | 0 |
private void updateNeighbors(long[] l) {
if((this.sectionID == 1) || (this.sectionID == 2)) {
for(int i=0; i<height; i++) submesh[0][i].setTemp(l[i]);
for(int i=0; i<height; i++) submesh[width-1][i].setTemp(l[i+height]);
} else if(this.sectionID == 3) {
for(int i=0; i... | 7 |
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.