text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void SelecteerSBox(int keuze, int rij, int kolom) {
switch(keuze){
case 0:
resultaatSBox[eersteIndex] = Matrices.sBox1[rij][kolom];
eersteIndex++;
break;
case 1:
resultaatSBox[eersteIndex] = Matrices.sBox2[rij][k... | 8 |
public static void main(String[] args) {
boolean isLocal = "windows".equals(OS);
System.out.println(isLocal);
} | 0 |
public final WaiprParser.statdefs_return statdefs() throws RecognitionException {
WaiprParser.statdefs_return retval = new WaiprParser.statdefs_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token char_literal36=null;
Token char_literal38=null;
ParserRuleReturnScope statdef35 =null;
Par... | 8 |
@Test
public void putGetSize() {
HugeMapBuilder<HandTypesKey, HandTypes> dummy = new HugeMapBuilder<HandTypesKey, HandTypes>() {{
allocationSize = 64 * 1024;
setRemoveReturnsNull = true;
}};
HandTypesMap map = new HandTypesMap(dummy);
HandTypesKeyImpl key = new HandTypesKeyImpl();
Han... | 3 |
@Override
public boolean removeAll( Collection<?> collection )
{
boolean changed = false;
for (Object element : collection)
{
changed |= remove( element );
}
return changed;
} | 2 |
public static char findFirstNonRepeatingChar(String stream)
{
LinkedListNode head = null;
LinkedListNode tail = null;
boolean[] repeating = new boolean[256];
LinkedListNode[] nodes = new LinkedListNode[256];
for (int i=0; i<stream.length(); i++)
{
... | 9 |
@Override
public void setVolume(int soundID, int volume) {
//Clamp the volume between 0-100
if(volume > 100) volume = 100;
if(volume < 0) volume = 0;
//Convert it to a float between 0.0f and 1.0f
float convertedVolume = ((float)(volume/100));
//Set the volume
if(this.soundMap.containsKey(soundID)) {
... | 3 |
public int score(Collection<String> names) {
int sum = 0;
for( String name : names ) {
if( rankByName.get(name) == null ) throw new RuntimeException("Error: Entry '" + name + "' not found!");
sum += rankByName.get(name);
}
return sum;
} | 2 |
public boolean set_hhmm(String hhmm) {
if(hhmm.matches("\\d\\d\\d\\d")) {
int h= (byte)Integer.parseInt(hhmm.substring(0, 2));
int m= (byte)Integer.parseInt(hhmm.substring(2, 4));
if(h>=0 && h<24 && m>=0 && m<60) {
this.hour=(byte) h;
this.minute=(byte) m;
return true;
}
}
r... | 5 |
private Statement statement() throws RequiredTokenException
{
enterRule(NonTerminal.STATEMENT);
Statement statement = null;
if(firstSetSatisfied(NonTerminal.VARIABLE_DECLARATION))
try
{
statement = variable_declaration();
}
catch (SymbolRedefinitionException e)
{
statement = new Error(... | 8 |
protected void updateWeather()
{
if (!this.worldProvider.hasNoSky)
{
if (this.lastLightningBolt > 0)
{
--this.lastLightningBolt;
}
this.prevRainingStrength = this.rainingStrength;
if (this.worldInfo.isRaining())
... | 8 |
public ArrayList<LazyDocument> documentFor(Filer filer, TypeElement classDeclaration)
throws SAXParseException {
String viewName = classDeclaration.getSimpleName() + ".ui.xml";
Collection<? extends AnnotationMirror> mirrors = classDeclaration.getAnnotationMirrors();
for (AnnotationMirror mirror : mirr... | 9 |
public PaintMessage getMessage(String string)
{
Scanner s = new Scanner(string);
PaintMessage message = null;
switch (PaintMessageType.valueOf(s.next()))
{
case LINE:
message = new LineMessage(s.nextInt(), s.nextInt(), s.nextInt(), s.nextInt(), s.nextInt(), s.nextInt());
break;
case SHAPE:
message... | 4 |
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((datum == null) ? 0 : datum.hashCode());
result = prime * result + nummer;
result = prime * result + plaatsen;
result = prime * result + ((prijs == null) ? 0 : prijs.hashCode());
result = prime * result + (... | 4 |
public synchronized void lock(){
while(locked){
try{
if(this.thread != Thread.currentThread())
wait();
else
break;
}catch(Exception e){}
}
this.thread = Thread.currentThread();
locked... | 3 |
public Component getTableCellRendererComponent(JTable table, Object value,
boolean isSelected, boolean hasFocus, int row, int column) {
super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
if(isSelected) {
setForeground(table.getSelectionForeground());
setBackg... | 6 |
public static void deleteDir(File dir) {
for(File file : dir.listFiles()) {
if(file.isDirectory()) {
deleteDir(file);
continue;
}
file.delete();
}
dir.delete();
} | 2 |
private String formatTD(String content) {
String buf = "";
int idx = 0;
int aStart = 0;
int aEnd = -5;
int i=0;
while (content.indexOf("<td", idx) != -1) {
i++;
aStart = content.indexOf("<td", idx);
aStart = content.indexOf(">", aStart)+1;
//buf += content.substring(aEnd+5, aStart);
aEnd ... | 1 |
public void put(K key, V value) {
int internalKey = generateKey(key);
if (array[internalKey] == null) {
Bag<K, V> bag = new Bag<>(key, value, internalKey);
array[internalKey] = bag;
} else {
int count = 0;
while (array[internalKey] != null && count < size) {
internalKey++;
count++;
if (i... | 5 |
public Object[] conectarOlib(String url, String titleno) throws ClassNotFoundException, SQLException {
// retorna un arreglo con 2 arreglos en su interior [ [arreglo 1] , [arreglo 2] ]
// arreglo 1: arreglo de cadenas [nombres de archivo]
// arreglo 2: arreglo de cadenas [cadenas con dublin co... | 3 |
public void render(Graphics g) {
Graphics2D g2d = (Graphics2D) g;
AffineTransform transformation = new AffineTransform();
//rotiere den Vogel
transformation.translate(x, y);
try {
double xOrient = (double)direction.getY();
double yOrient = (double)direction.getX();
double pos = Math.atan2(xOrient, yO... | 1 |
@Override
public void setValueAt(Object o, int row, int col)
{
Order or = info.get(row);
switch (col)
{
case 0 : or.getOrderName(); break;
case 1 : or.getDueDate(); break;
case 2 : or.getSleeve().getMaterial().getName(); break;
case 3 : or.... | 9 |
private JPanel setupControlPanel() {
JPanel controlPanel = new JPanel();
controlPanel.setBorder(new TitledBorder("Controls"));
GridBagLayout gbl = new GridBagLayout();
GridBagConstraints gbc = new GridBagConstraints();
controlPanel.setLayout(gbl);
gbc.anchor = GridBagCon... | 8 |
public void Play() {
while (game.getGameState() != GameState.Ending) {
switch (game.getGameState()) {
case MainMenu:
visualiser.sayHello();
String[] names = visualiser.getNames();
game.getPlayers()[0].setName(names[0]);
... | 8 |
public String properties()
{
String gasString = "";
if(isGas())
gasString = " gas";
return protons+" "+getSymbol()+" "+getName()+gasString+" Mass: "+getMass()+" Density: "+getDensity();
} | 1 |
private void ExitbuttonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ExitbuttonMouseClicked
// TODO add your handling code here:
dispatchEvent(new WindowEvent(this, WindowEvent.WINDOW_CLOSING));
System.exit(0);
}//GEN-LAST:event_ExitbuttonMouseClicked | 0 |
public Matrix getD () {
Matrix X = new Matrix(n,n);
double[][] D = X.getArray();
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
D[i][j] = 0.0;
}
D[i][i] = d[i];
if (e[i] > 0) {
D[i][i+1] = e[i];
} else if (e[i] < 0) {
... | 4 |
private void trigger(){
Set<String> fileSignatureSet = filePathModifiedTimeMap.keySet();
for ( String fileSignature : fileSignatureSet ){
File file = new File(fileSignature);
long currentLastModifiedTime = file.lastModified();
Long lastestLastModifiedTime = filePathModifiedTimeMap.get(fileSignature);... | 3 |
public static void closeConnection(){
try {
conn.close();
} catch (SQLException e) {
System.out.println("error closing connection within process class");
e.printStackTrace();
}
} | 1 |
public int alphaBetaSearchResult(int depth, int alpha, int beta)
{
if (isTerminalState())
return heuristicFunctionValueOfGivenBlock(lastMoveMadeInBlockNumber);
else if (depth == 0)
return heuristicFunctionValueOfGame();
List <Integer> listOfEmptyCells = getBlock(nextMoveInBlockNumber).getListOfBestMoves... | 9 |
static void openURL (String url) throws IOException, URISyntaxException{
Desktop desktop = Desktop.getDesktop();
if (desktop.isSupported(Desktop.Action.BROWSE)){
desktop.browse(new URI(url) );
}else
showMessage(("Error"));
} | 1 |
private void readtRNS() throws IOException {
switch (colorType) {
case COLOR_GREYSCALE:
checkChunkLength(2);
transPixel = new byte[2];
readChunk(transPixel, 0, 2);
break;
case COLOR_TRUECOLOR:
checkChunkLength(6);
transPixel... | 4 |
public void deleteCommand()
{
try{
int choice = JOptionPane.showConfirmDialog(rootPane, "Are you sure you want to delete " + currentRunway.getId() + "?"
+ "\n This will also delete all glider and winch positions associated with this runway.",
"Delete Runwa... | 3 |
@Override
public ImmutableValue<Boolean> evaluate(Context context) {
// destacando variaveis
Value[] values = new Value[variables.length];
for (int i = 0; i < variables.length; i++) {
Expression variable = variables[i];
values[i] = variable.evaluate(context);
}
// destacando ... | 8 |
@Test
public void testTimeStep_MEAN_MONTHLY_1year() throws Exception {
printDebug("----------------------------");
printDebug("MEAN_MONTHLY 1 year: " + this.toString());
printDebug("----------------------------");
CSTable t = DataIO.table(r, "obs");
Assert.assertNotNull(t);
... | 1 |
public void releaseAllKeys() {
for(int i = 0; i < buttons.length; i++) {
buttons[i] = false;
}
for(int j = 0; j < upButtons.length; j++) {
upButtons[j] = false;
}
} | 2 |
public static String to_booleanString(String str) {
if (str == null) return null;
String[] trueValues = new String[] {"true","True","Yes","yes","1","-1","yep","supported"};
String[] falseValues = new String[] {"false","no","False","No","0","nope","not supported","not_supported"};
//ArrayList<String> trueValues ... | 5 |
private ImageProcessor hMinima(ImageProcessor ip, int m){
ip.invert();
ImageProcessor ip1 = ip.duplicate();
ip1.subtract(m);
GreyscaleReconstruct_ gr = new GreyscaleReconstruct_();
Object[] result = gr.exec(new ImagePlus("temp", ip), new ImagePlus("temp1", ip1), "null", true, false);
ip.invert();
return (... | 0 |
public void render(Graphics g, Camera camera) {
int x0 = camera.x >> 4;
int x1 = (camera.x + camera.width + 16) >> 4;
int y0 = camera.y >> 4;
int y1 = (camera.y + camera.height + 16) >> 4;
for (int y = y0; y < y1; y++) {
for (int x = x0; x < x1; x++) {
if (x >= 0 && y >= 0 && x < width && y < height) ... | 8 |
static final void method1005(byte byte0, boolean flag) {
if (TraversalMap.aByteArrayArrayArray976 == null) {
TraversalMap.aByteArrayArrayArray976 = new byte[4][104][104];
}
if (!flag) {
return;
}
for (int i = 0; i < 4; i++) {
for (int j = 0; j ... | 5 |
private static DecimalImpl divByInt(final long d1Base, final int d1Factor, final long d2Base)
{
if (d1Factor < 0)
{
final long scaledBase = d1Base * DPU.getScale(-d1Factor);
final long base = scaledBase / d2Base;
final long remainder = scaledBase % d2Base;
if (0 != remainder)
{
final int factorLimi... | 6 |
@Override
public void paintComponent(Graphics g) {
super.paintComponent(g);
// Offset used by the image, as well as their "highlighted" buttons.
Point offsetHead = new Point(10, 25);
Point offsetMiddle = new Point(235, 30);
// Sinleton to load the images only once. Placin... | 8 |
@Override
public double calculate(Map<? extends Number, ? extends Number> weightedSet, double extremalLevel) {
assert extremalLevel >= -1 && extremalLevel <= 1;
// используя гравитационное расширение нечетких сравнений найдем центр тяжести всей совокупности.
double sumOfRectifications = 0;... | 6 |
public static int parse(String methods) {
int httpMethods = 0;
String[] items = methods.split("\\|");
for (String item : items) {
item = item.trim();
httpMethods = httpMethods | HttpMethods.getMethod(item);
}
return httpMethods;
} | 1 |
public void initialize(ConstPool cp, CodeAttribute attr) {
if (constPool != cp)
newIndex = 0;
} | 1 |
@Override
public void windowActivated(WindowEvent e)
{
} | 0 |
private static Attack createAttack(Element type){
Element attackElement = (Element)type.getElementsByTagName("attack").item(0);
if(attackElement == null){
return null;
}
SoundWrapper attackSound = ResourceLoader.createSound(attackElement.getAttribute("sound"),
Float.parseFloat(attackElement.getAttribute(... | 6 |
public boolean isMobAllowed(final EntityType type) {
return type == EntityType.SPIDER || type == EntityType.CAVE_SPIDER || type == EntityType.SKELETON || type == EntityType.CREEPER || type == EntityType.PIG_ZOMBIE || type == EntityType.ZOMBIE;
} | 5 |
private int getIssueCycle2(int[][] schedule, int instructionNumber) {
FunctionType function = executed.get(instructionNumber).getFunction();
int cycle = schedule[instructionNumber - 1][0] + 1;
if (function.ordinal() >= configuration.length - 1)
return cycle;
int minCycle = schedule[instructionNumber - ... | 7 |
public static void connectToDB () {
try {
Driver driver = (Driver) Class.forName("org.sqlite.JDBC").newInstance();
DriverManager.registerDriver(driver);
} catch (Exception ex) {
ex.printStackTrace();
}
} | 1 |
private void habilitarMenuPerfil(Vector<Vector<Integer>>moduloTarea){
habilitarMenu(false);
for(Component cMenu:jMenuBar1.getComponents()){
for(Vector<Integer>modulo:moduloTarea){
if(cMenu.getName().equals("M"+modulo.get(0))){
... | 8 |
public JoinIterator(Iterable<T> outer, Iterable<TInner> inner, Selector<T, TKey> outerKeySelector, Selector<TInner, TKey> innerKeySelector, Joint<T, TInner, TResult> joint, Comparator<TKey> comparator)
{
this._outer = outer.iterator();
this._inner = inner;
this._innerKeySelector = innerKeySelector;
this._... | 0 |
@Override
public void checkedDoPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
if (isLoggedIn(req.getSession()))
forceLogOut(req, resp);
String userName = req.getParameter("username");
String name = req.getParameter("nam... | 9 |
public void loadAllObjects() {
ResultSet data = query(QueryGen.selectAllObjects());
while (iterateData(data)) {
ChunkyObject obj = (ChunkyObject) createObject(getString(data, "type"));
if (obj == null) {
Logging.warning("Created " + getString(data, "type") + " is ... | 3 |
public boolean isPalindrome(String s)
{
int b = 0, e = s.length()-1;
while(b <= e)
{
char x = s.charAt(b);
char y = s.charAt(e);
if (isCharacter(x) && isCharacter(y) && !isSame(x,y))
return false;
else if (isCharacter(x) && isCh... | 9 |
public void die() {
alive = false;
} | 0 |
@Override
public Object solve() {
int count = 0;
int weekday = 2; // 1 - 7 mapping to Mon - Sun, 1st Jan 1901 is a Tuesday
for (int year = 1901; year <= 2000; year++) {
for (int month = 0; month < 12; month++) {
if (weekday == 7) {
count++;
... | 4 |
public final Set<Token.Kind> firstSet()
{
return firstSet;
} | 0 |
private String dayOfWeek(int dayOfWeek)
{
String day;
switch (dayOfWeek)
{
case 1: day = "Sun"; break;
case 2: day = "Mon"; break;
case 3: day = "Tues"; break;
case 4: day = "Wed"; break;
case 5: day = "Thurs"; break;
case 6: day ... | 7 |
public void search (BayesNet bayesNet, Instances instances) throws Exception {
m_random = new Random(m_nSeed);
// determine base scores
double [] fBaseScores = new double [instances.numAttributes()];
double fCurrentScore = 0;
for (int iAttribute = 0; iAttribute < instances.numAttributes()... | 9 |
public static int getLevenshteinDistance(String first, String second) {
if (first.equals(second)) return 0;
if (first.length() == 0) return second.length();
if (second.length() == 0) return first.length();
int[] previousRow = new int[second.length() + 1];
int[] currentRow = new int[second.length() + 1];
f... | 8 |
public void addNode(int pos, long nodeId) {
if (poligons.size() > pos)
nodes.get(pos).add(nodeId);
} | 1 |
public static void showRevealedBoard(BoardModel boardModel) {
System.out.print(" ");
for (int i = 0; i < boardModel.getBoardWidth(); i++) {
System.out.print(" " + i);
}
System.out.println("");
System.out.println(" -----------------------");
for (int i = 0; ... | 4 |
@Override
public URI getResourceIdentity() {
try {
return new URI(context() + name());
} catch (URISyntaxException e) {
e.printStackTrace();
return null;
}
} | 1 |
public static void main(String[] args) {
char again;
do{ // The main loop, everything is called from here.
double[] u = new double[3], v = new double[3],w;
print("Enter a vector in R" + "\u00b3"+": ");
for(int i = 0; i < 3; i++)
u[i] = scan.nextDouble();
print("Enter a second vector in R" + "\u00... | 4 |
public void sort(){
java.util.Stack<Integer> spare_stack=new java.util.Stack<Integer>();
while(!this.stack.empty()){
int current=this.stack.pop();
while(!spare_stack.empty() && spare_stack.peek()>current){
this.stack.push(spare_stack.pop());
}
spare_stack.push(current);
}
while(!spare_stack.empt... | 4 |
public boolean isValidBST(TreeNode root) {
if(null != root) {
List<Integer> list = new ArrayList<Integer>();
travelTree(root, list);
for(int i=0; i<list.size()-1; i++) {
if(list.get(i) >= list.get(i+1)){
return false;
}
}
}
return true;
... | 3 |
public void update(int delta) {
for (Building b : buildings) {
if (b.getStatus()) {
b.setBuildingtimeLeft(b.getBuildingtimeLeft() - delta);
}
if (b.getBuildingtimeLeft() <= 0) {
b.upgrade();
}
}
for (Building b : buildings) {
if (b instanceof ProductionBuilding) {
b.setTimeLeft(b.... | 6 |
protected void processInput(String userInput) {
if (userInput.equals("!end")) {
exit = true;
try {
stdIn.close();
} catch (IOException e) {
logger.error("coulden't get inputstream");
}
// propper shutdown of the ExecutorService
Main_Client.clientExecutionService.shutdown(); // Disable new t... | 6 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
User other = (User) obj;
if (ip == null) {
if (other.ip != null)
return false;
} else if (!ip.equals(other.ip))
return false;
if (n... | 9 |
public String getContacter() {
return contacter;
} | 0 |
public void characters(char[] ch, int s, int len)
{
String content = new String(ch, s, len);
if(content.length() != 0)
{
if(Debug.debugLevel() >= 5)
{
Debug.println("Characters received:", 5);
Debug.println(" Characters: " + content, 5);
Debug.println("End of characters.", 5);
Debug.pri... | 2 |
public static void main(String[] args) {
//Test: CreateBlackBox
Circuit c1 = new Circuit();
int number1 = 0;
int number2 = 0;
Scanner scan = new Scanner(System.in);
System.out.println("Length of binary numbers:");
int amount = Integer.parseInt(scan.nextLine());... | 4 |
@EventHandler
public void WitchStrength(EntityDamageByEntityEvent event) {
Entity e = event.getEntity();
Entity damager = event.getDamager();
String world = e.getWorld().getName();
boolean dodged = false;
Random random = new Random();
double randomChance = plugin.getWitchConfig().getDouble("Witch.Strength.... | 6 |
private void verbindeNachbarn(int x, int y)
{
//Nord
if(istGueltigePosition(x, y - 1) && existiertRaumAnPosition(x, y - 1))
{
_raumArray[x][y].verbindeZweiRaeume(TextVerwalter.RICHTUNG_NORDEN,
_raumArray[x][y - 1], TextVerwalter.RICHTUNG_SUEDEN);
}
//Ost
if(istGueltigePosition(x + 1, y) && existie... | 8 |
public void closeBraceContinue() {
if ((Options.outputStyle & Options.BRACE_AT_EOL) != 0)
print("} ");
else {
println("}");
if ((Options.outputStyle & Options.BRACE_FLUSH_LEFT) == 0
&& currentIndent > 0)
untab();
}
} | 3 |
private Entity readFromFile(int pos) {
ObjectInputStream ois = null;
Entity rslt = null;
try {
ois = new ObjectInputStream(new FileInputStream(file));
for (int i = 0; i < pos; i++) {
ois.readObject();
}
rslt = (Entity) ois.readObjec... | 4 |
public void compileSource(String source){
//1.创建需要动态编译的代码字符串
//2.将预动态编译的代码写入文件中1:创建临时目录2:写入临时文件
File dir=new File("../webapps/JudgeOnLine/temp");//tomcat里工程下的临时目录
String className = source.substring(source.indexOf("public class") + 13,source.indexOf("{")).toString();//获取类名字符串
//如果/temp目录不存在创建temp目录
if(!d... | 5 |
private String unitConver(int len)
{
String reVal;
switch(len)
{
case 2:
reVal = "十";break;
case 3:
reVal = "百";break;
case 4:
reVal = "千";break;
case 5:
reVal = "万";break;
case 6:
reVal = "十";break;
case 7:
reVal = "百";break;
case 8:
... | 7 |
public void setCurrent(long current) {
this.current = current;
if (current > this.total) this.total = current;
if (this.job != null) this.job.updateProgress();
} | 2 |
public Prime(int n) {
max = n;
bitSet = new BitSet(max + 1);
bitSet.set(0, 2, false);
bitSet.set(2, max, true);
for (long i = 2; i * i <= max; ++i) {
if (isPrime((int) i)) {
for (long j = i * i; j <= max; j += i) {
bitSet.set((int) j, false);
}
... | 3 |
public void write(List<String> csvStrings, String fileNameDestination) throws IOException {
File file = new File(fileNameDestination);
logger.info("outfilename=" + fileNameDestination);
if ( !file.exists()) {
file.createNewFile();
}
FileWriter fileWriter = new FileWriter(file, false);
fi... | 3 |
public static void connectToChatRoom(String cHost, int cPort) throws IOException {
Socket joinedClient =null;
BufferedReader in;
PrintWriter out = null;
try {
joinedClient = new Socket(cHost, cPort);
} catch (IOException e) {
System.out.println("Could not connect to peer ");
return;
}
try {... | 9 |
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case boardPackage.BOARD__COUNTRIES:
return getCountries();
case boardPackage.BOARD__BORDERS:
return getBorders();
case boardPackage.BOARD__CONTINENTS:
return getContinents();
case boardPackag... | 6 |
public void connect() throws RemoteException {
try {
registry = LocateRegistry.getRegistry(ipAddress, portNumber);
} catch (RemoteException ex) {
System.out.println("Client: Cannot locate registry");
System.out.println("Client: RemoteException: " + ex.getMessage());
... | 5 |
public int candy(int[] ratings) {
if(ratings == null) return 0;
int people = ratings.length;
int[] candys = new int[ratings.length];
candys[0] =1;
for(int i=1;i<people;i++){
candys[i]=1;
if(ratings[i]>ratings[i-1]){
candys[i]=candys[i-1]+1;
} else {
candys[i] = 1;
}
... | 7 |
private void jTextField7FocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTextField7FocusLost
// TODO add your handling code here:
if ((evt.getOppositeComponent()!=jTextField3) &&
(evt.getOppositeComponent()!=campoFecha1) &&
(evt.getOppositeComponent()!=campoFecha... | 6 |
private static void renderMethods(Class cls) {
Method[] methods = cls.getMethods();
Method m;
StringAppender appender = new StringAppender();
int mf;
for (int i = 0; i < methods.length; i++) {
appender.append(TextUtil.paint(' ', PADDING + 2));
if (((mf = (m = methods[i]).getModifiers())... | 9 |
private Vector<DashboardIcon> getCostensValues(Player player) {
// object variable costs
DashboardIcon variableCosts = new DashboardIcon();
variableCosts.setTitle("variable costs");
variableCosts.setIcon("align-left");
variableCosts.setColor("turquoise");
try {
variableCosts.setValue(Double.toString(play... | 4 |
public GameState update(KeyboardInput keyboard) {
GameState nextState = GameState.PLAYING;
if (keyboard.keyPressed(KeyEvent.VK_TAB)) {
nextState = GameState.MENU;
}
else {
Direction dir = keyboard.getArrowKeyDirection();
if (keyboard.keyIsDown(KeyEvent.VK_A) && timeUntilNextBullet <= 0) {
shootBull... | 9 |
@SuppressWarnings("unchecked")
public String loadMatches() {
PreparedStatement st = null;
ResultSet rs = null;
JSONArray json = new JSONArray();
try {
conn = dbconn.getConnection();
st = conn.prepareStatement("SELECT match_number FROM match_record_2013 where e... | 3 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof Product)) return false;
Product product = (Product) o;
if (id != product.id) return false;
if (catalog != null ? !catalog.equals(product.catalog) : product.catalog != null) return fal... | 7 |
public Markers createGenomicRegions() {
Markers markers = new Markers();
// Add up-down stream intervals
for (Marker upDownStream : genome.getGenes().createUpDownStream(upDownStreamLength))
markers.add(upDownStream);
// Add splice site intervals
for (Marker spliceSite : genome.getGenes().createSpliceSite... | 3 |
public void loadCards() throws BadConfigFormatException {
try {
// open the cards file, which has 6 person, 6 weapon, then 9 room cards in that order
FileReader reader = new FileReader("cards.txt");
Scanner in = new Scanner(reader);
// stored to know card type
int lineNumber = 0;
Card card;
// lo... | 4 |
public Template waitForMatch(Template tpl, int timeout) {
String queryString = "";
int i = 0;
for (i = 0; i < 9; i++) {
Integer min;
Integer max;
try {
min = (Integer) PropertyUtils.getSimpleProperty(tpl, "property" + i + "_min");
max = (Integer) PropertyUtils.getSimpleProperty(tpl, "property"... | 7 |
@Basic
@Column(name = "CSA_ID_SOLICITUD")
public int getIdSolicitud() {
return idSolicitud;
} | 0 |
@Test
public void testListHdfs() throws IOException {
System.setProperty("HADOOP_USER_NAME", "hduser");
Injector injector = Guice.createInjector(new Context());
HDFS hdfs = injector.getInstance(HDFS.class);
hdfs.init();
hdfs.listRoot();
} | 0 |
public boolean matchesOperator(String text) {
int operatorCount = this.operatorList.size();
for(int i = 0;i<operatorCount;i++) {
String currentOperator = this.operatorList.get(i).getLiteral();
boolean isMatchingExpression = text.equals(currentOperator);
if (isMatchingExpression) {
return true;
}
... | 2 |
public void dump() {
updateKnown();
File imgdir = new File(Constants.getCacheDirectory() + "rsimg" + System.getProperty("file.separator"));
if (!imgdir.exists()) {
imgdir.mkdir();
}
int count = imageArchive.countImages();
int total = count;
try {
for (int index = 0; index < count; index++) {
Fil... | 5 |
public void actionPerformed(ActionEvent e) {
if(e.getActionCommand().equals(Constantes.CLOSE)) {
this.setVisible(false);
}
} | 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.