text stringlengths 14 410k | label int32 0 9 |
|---|---|
@Override
protected int getAvgIndex(ChannelType c) {
switch (c) {
case RED:
return 0;
case GREEN:
return 1;
case BLUE:
return 2;
default:
throw new IllegalArgumentException();
}
} | 3 |
public boolean isClosed() {
return isClosed;
} | 0 |
private final void step6() {
j = k;
if (b[k] == 'e') {
int a = m();
if (a > 1 || a == 1 && !cvc(k - 1))
k--;
}
if (b[k] == 'l' && doublec(k) && m() > 1)
k--;
} | 7 |
public boolean createAccount() {
Scanner sc = new Scanner(System.in);
boolean success = false;
String posUsername, posPassword, firstName, lastName; //Possible username/password.
int attempts = 0;
while (attempts < 3) { //At three attempts, the user is booted back to the main screen.
System.out.print("E... | 8 |
private void addResources(int dices)
{
// Liste des tuiles correspondante au nombre des des.
LinkedList<ResourceTile> tiles = new LinkedList<ResourceTile>();
// Pour chaque tuile ressource.
for(int i: resourceIndexes)
{
ResourceTile t = (ResourceTile)grid[i];
if (t.isNumber(dices) && !t.hasThief()) ... | 8 |
public String getAnswer() throws Exception {
String [] input = getResource("problem59.txt").readLine().split(",");
int[] letters = new int[input.length];
int[] key = new int[3];
List<Map<Integer,Integer>> freqAnalysis = new ArrayList<Map<Integer,Integer>>(key.length);
int retVal... | 9 |
@Override
public void panelResize() {
for (Node current : reachable) {
for (Node to : current.expand()) {
//from is not in cover
if (reachable.contains(to)) {
publish(new HighlightEdge(layer, current, to, Color.RED));
}
... | 9 |
protected int getSquareIndex(int x, int y)
{
int squareIndex = 0;
int offy = resx*y;
int offy1 = resx*(y+1);
if (posDiscrimination == false)
{
if (gridValue[x+offy] < isovalue) squareIndex |= 1;
if (gridValue[x+1+offy] < isovalue) squareIndex |= 2;
if (gridValue[x+... | 9 |
private void proveedormedicamentoFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_proveedormedicamentoFieldKeyTyped
// TODO add your handling code here:
if (!Character.isLetter(evt.getKeyChar()) && !Character.isISOControl(evt.getKeyChar()) && !Character.isWhitespace(evt.getKeyChar())) ... | 4 |
public static double getSleepFactor() {
double min = getSleepFactorMin();
double diff = getSleepFactorMax() - min;
if (diff == 0) {
return min;
}
return min + (new Random()).nextDouble() * diff;
} | 1 |
private void listForGuessing(){
ArrayList<WordStructure> list = new ArrayList<WordStructure>(GuiBuilder.wordListAll);
try {
FileInputStream fileInputStream = new FileInputStream("settings.txt");
ObjectInputStream objectInputStream = new ObjectInputStream(fileInputStream);
... | 7 |
@Override
public String getPref(String key) {
for (String _key : preferences.keySet())
if (_key.equals(key))
return String.format("{0}; {1}", key, preferences.get(key));
return null;
} | 2 |
@Test
public void testCreatingPhoneNumberWithNullLabelShouldFail() {
try {
new PhoneNumber(null, "12345678");
fail("Was expecting an Exception when no label is provided.");
} catch (IllegalArgumentException iae) {
Assert.assertEquals("Please provide a value for Label as it is a non-nullable field.", iae.g... | 1 |
public static synchronized void updateCoreVersion(String coreVersion) {
if (Main.coreVersion != null) {
if (!Main.coreVersion.equals(coreVersion)) {
logger.error("You use different Versions of Dynmaps");
System.exit(-1);
}
} else {
Main... | 2 |
@Override
public void paint(Graphics g) {
super.paint(g);
if (running) {
if (state == 0) {
paintGame(g);
} else if (state == 1) {
paintGame(g);
paintPauseMenu(g);
} else if (state == 2) {
paintGame(g);
paintReconnect(g);
}
}
} | 4 |
public void renderProjectile(int xp, int yp, Projectile p) {
xp -= xOffset;
yp -= yOffset;
for (int y = 0; y < p.getSpriteSize(); y++) {
int ya = y + yp;
for (int x = 0; x < p.getSpriteSize(); x++) {
int xa = x + xp;
if (xa < -p.getSpriteSize() || xa >= width || ya < 0 || ya >= height) break;
if... | 8 |
@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 Software)) {
return false;
}
Software other = (Software) object;
if ((this.idSoftware == null && other.idSoftwa... | 5 |
public static ParticleEffect fromId(int id) {
for (Entry<Integer, ParticleEffect> entry : ID_MAP.entrySet()) {
if (entry.getKey() != id) {
continue;
}
return entry.getValue();
}
return null;
} | 2 |
static final void method3198(boolean bool, byte i) {
anInt9547++;
if (i != -45)
aShort9555 = (short) -74;
if (bool) {
if ((r.anInt9721 ^ 0xffffffff) != 0)
Class14.method235(r.anInt9721, (byte) -113);
for (Class348_Sub41 class348_sub41
= (Class348_Sub41) Class125.aClass356_4915.method3484(0);
... | 7 |
public static String stripNonLongChars(final String value) {
final StringBuilder newString = new StringBuilder();
for (int i = 0; i < value.length(); i++) {
final char c = value.charAt(i);
if (c == '.') {
// stop if we hit a decimal point
break;
... | 8 |
public boolean canJump(int[] A) {
// Note: The Solution object is instantiated only once and is reused by
// each test case.
// boolean[] reach = new boolean[A.length];
// for (int i = 0; i < A.length; ++i){
// reach[i] = false;
// }
// reach[0] = true;
// int r = 0;
// if(A.length == 1){
// return true;
... | 5 |
@Override
public boolean equals(Object obj)
{
if (this == obj)
{
return true;
}
if (obj == null)
{
return false;
}
if (getClass() != obj.getClass())
{
return false;
}
final Diff other = (Diff) obj;
if (operation != other.operation)
{
return false;
}
if (text... | 7 |
private String getHeaderName(String columnName) {
String headerName = columnName;
if (columnName.equalsIgnoreCase(Buyer.getBuyerColumn())) {
// Buyer name
headerName = Buyer.BUYER_HEADER;
} else if (columnName.equalsIgnoreCase(Buyer.getLocationColumn())) {
// Location
headerName = Buyer.LOCATION_HEAD... | 9 |
public static HashMap<String, ClassNode> parseJar(JarFile jar) {
HashMap<String, ClassNode> classes = new HashMap<>();
try {
Enumeration<?> enumeration = jar.entries();
while (enumeration.hasMoreElements()) {
JarEntry entry = (JarEntry) enumeration.nextElement();
if (entry.getName().endsWith(".class")... | 4 |
public void actionPerformed(ActionEvent event) {
if (event.getActionCommand() == null) {
fadeEffect.start();
this.setTimerDelay();
} else {
switch (event.getActionCommand()) {
case "Effect Complete":
changePin(pinLoader.getRandomPin... | 2 |
@Override
public Item findDepositInventory(String depositorName, String itemName)
{
final List<PlayerData> V=getRawPDDepositInventory(depositorName);
if(CMath.s_int(itemName)>0)
{
for(int v=0;v<V.size();v++)
{
final DatabaseEngine.PlayerData PD=V.get(v);
if(PD.xml().startsWith("COINS;"))
retu... | 7 |
void solve() {
for (int i = 0; i < numberOfPoints; i++) { // zeros wavefunction
phi[i] = 0;
}
for (int i = 0; i < numberOfPoints; i++) {
phi[i] = state[0]; // stores wavefunction
x[i] = state[2];
solver.step(); // steps Schroedinger equation
if (Math.abs(state[0]) > stepThresh... | 8 |
private boolean testFilterProperty_Thorough(SpecialFile other) {
List<Byte> one = new ArrayList<Byte>(this.BYTES);
List<Byte> two = new ArrayList<Byte>(other.BYTES);
double matchCount = 0.0d;
double totalCount = 0.0d;
if (one.size() > two.size()) {
double first = two.size();
double second = one.size();
... | 6 |
protected boolean sting()
{
if (CMLib.flags().isAliveAwakeMobileUnbound(this,true)&&
(CMLib.flags().canHear(this)||CMLib.flags().canSee(this)||CMLib.flags().canSmell(this)))
{
final MOB target = getVictim();
// ===== if it is less than three so roll for it
final int roll = (int)Math.round(Math.random()... | 8 |
@Test
public void compareHands_HighCardHandsHaveSameCardsExceptLastCard_HandsWithHigherFifthCardWins() {
Hand p1 = Hand.HighCard(Rank.King, Rank.Jack, Rank.Nine, Rank.Six, Rank.Five);
Hand p2 = Hand.HighCard(Rank.King, Rank.Jack, Rank.Nine, Rank.Six, Rank.Six);
assertTrue(p1.compareTo(p2) < 0);
} | 0 |
void attributeValueLiteral(String value) {
buf.append('\'');
for (int i = 0, len = value.length(); i < len; i++) {
char c = value.charAt(i);
switch (c) {
case '<':
buf.append("<");
break;
case '&':
buf.append("&");
break;
case '\'':
bu... | 8 |
public void configure() {
if (this.mandatory) {
value = true;
} else {
if (Config.getInstance().allno_config()) {
value = false;
} else if (Config.getInstance().allyes_config()) {
if (this.ignore_autoconf) {
value = false;
} else {
value = true;
}
} else if (Config.getInstance(... | 8 |
private static void appendTypeAnnotations(TextBuffer buffer, int indent, StructMember mb, int targetType, int index, Set<String> filter) {
for (String name : TYPE_ANNOTATION_ATTRIBUTES) {
StructTypeAnnotationAttribute attribute = (StructTypeAnnotationAttribute)mb.getAttributes().getWithKey(name);
if (at... | 9 |
static final AbstractToolkit method958(boolean bool, int i, d var_d, int i_61_,
Canvas canvas, IndexLoader class45) {
try {
if (bool != true)
aClass221_1620 = null;
anInt1610++;
int i_62_ = 0;
int i_63_ = 0;
if (canvas != null) {
Dimension dimension = canvas.getSize();
i_63_ = d... | 6 |
private static String initialise(Token currentToken,
int[][] expectedTokenSequences,
String[] tokenImage) {
String eol = System.getProperty("line.separator", "\n");
StringBuffer expected = new StringBuffer();
int maxSize = 0;
for (int i = 0; i < expe... | 8 |
public static synchronized BusinessObjectDAO getInstance() throws DataException {
if (instance == null) {
instance = new BusinessObjectDAO();
}
return instance;
}//getInstance | 1 |
BigInt multiply(BigInt n) {
BigInt result = new BigInt(digits_.length + n.digits_.length);
result.sign_ = sign_ * n.sign_;
int i = 0, j = 0;
for (i = 0; i < n.digits_.length; ++i) {
if (n.digits_[i] != 0) {
int carry = 0;
for (j = 0; j < digits_.length || carry > 0; ++j) {
int n_digit = result.d... | 9 |
@Override
public void actionPerformed(ActionEvent e) {
exportOutlinerDocument((OutlinerDocument) Outliner.documents.getMostRecentDocumentTouched(), getProtocol());
} | 0 |
public List<String> getPasswordUser(){
List<String> res = new ArrayList<String>();
NodeList methodNodes = getDocument().getElementsByTagName("user");
if (methodNodes.getLength() == 0){
System.err.println("Couldn't read XML");
return null;
}else {
for (... | 2 |
public void checkForDuplicates(String outputFolder,boolean contentDuplicate, boolean nameDuplicate) throws SQLException, FileNotFoundException, IOException, ProcessingException {
if (!contentDuplicate && !nameDuplicate) {
return;
}
// Set this to true then the method starts.
// The GUI can set this to f... | 6 |
private OperatingSystem checkUserAgent(String agentString) {
if (this.isInUserAgentString(agentString)) {
if (this.children.size() > 0) {
for (OperatingSystem childOperatingSystem : this.children) {
OperatingSystem match = childOperatingSystem.checkUserAgent(agentString);
if (match != null) {
r... | 5 |
public ConcreteFlyweight(String data) {
this.data = data;
} | 0 |
public void paint(Graphics g)
{
updateLocation();
Graphics2D g2d = (Graphics2D) g;
Line2D l = new Line2D.Double(x1, y1, x2, y2);
g2d.setColor(Color.black);
g2d.draw(l);
if (Math.abs(x1 - x2) > Math.abs(y1 - y2))
g2d.drawString(cardMin + ", " + cardMax, (... | 1 |
public Fraction evaluate(Fraction fraction, String inputString) {
// create variables
String operator = "";
Fraction current = fraction;
String item;
// create Scanner
Scanner s1 = new Scanner(inputString);
s1.useDelimiter(" ");
... | 4 |
public static double getOctave(Octave octave) {
switch ( octave ) {
case O0:
return 1;
case O1:
return 2;
case O2:
return Math.pow(2, 2);
case O3:
return Math.pow(2, 3);
case O4:
... | 8 |
private static int decode4to3(
byte[] source, int srcOffset,
byte[] destination, int destOffset, int options ) {
// Lots of error checking and exception throwing
if( source == null ){
throw new NullPointerException( "Source array was null." );
} // end if
... | 8 |
public int compare(String o1, String o2)
{
String s1 = (String)o1;
String s2 = (String)o2;
int thisMarker = 0;
int thatMarker = 0;
int s1Length = s1.length();
int s2Length = s2.length();
while (thisMarker < s1Length && thatMarker < s2Length)
{
... | 8 |
public Pointer put(byte[] key, byte[] value, long ttl) throws IOException {
// First try to store in the current active block
Pointer pointer = activeBlock.store(key, value, ttl);
if (pointer != null) {
return pointer;
} else {
// Current active block overflow
... | 3 |
public FailureDetector createFd(String fdName, String className,
Map<String, String> properties) throws Exception {
if (fdName == null) {
throw new IllegalArgumentException(
"No failure detector name was defined.");
}
Class<?> fdClass... | 9 |
public List<Node> calc(int ns, int nt) {
System.out.println(String.format("A*: Started @%s, goal: %s", start, goal));
List<Node> path = null;
int steps = 0;
while (!open.isEmpty() && steps++ < ns) {
// System.out.println(String.format("open list size: %d", open.size()));
Node n = open.remove();
// Sys... | 8 |
public static String getIPAddress() {
if(LCARS.ipAddress == null) {
LCARS.ipAddress = "127.0.0.1";
try {
InetAddress ipAddress = null;
Enumeration<NetworkInterface> netInterfaces = NetworkInterface.getNetworkInterfaces();
while(netInterfaces.hasMoreElements()) {
Enumeration<InetAddress> inetAd... | 9 |
public static PDFPattern getPattern(PDFObject patternObj, Map resources)
throws IOException
{
// see if the pattern is already cached
PDFPattern pattern = (PDFPattern) patternObj.getCache();
if (pattern != null) {
return pattern;
}
// get the patt... | 4 |
private void updateCurrentState() {
if (hitWumpus) {
endGame();
this.currentState = "You aim and fire you weapon of choice. Your trusty bow.\n"
+ "The arrow whistles through the air. Your aim is true.\n"
+ "The beast is dead.\n" + "You return home a hero.";
} else if (hitSelf) {
endGame();
thi... | 8 |
private void persisteInformacoes(List<AvaliacaoDocente> listaAvaliacaoDocente, BeanPopulate beanPopulate) {
System.out.println("Salvando Avaliação..");
avaliacaoDao.salvar(beanPopulate.getAvaliacao());
System.out.println("Avaliação salva.. id: " + beanPopulate.getAvaliacao().getId());
f... | 9 |
private void configureAbstractButton(AbstractButton button, String resource) {
String title = resources.getString(resource);
int i = title.indexOf('&');
int mnemonic = 0;
if (i >= 0) {
mnemonic = title.charAt(i + 1);
title = title.substring(0, i) + title.substring(i + 1);
button.... | 1 |
private static boolean checkIfVampire (int a, int b, int x) {
//cast to strings
char[] charsAB = (a + "" + b).toCharArray();
char[] charsX = ("" + x).toCharArray();
Arrays.sort(charsAB);
Arrays.sort(charsX);
if (Arrays.equals(charsAB,charsX)) return true;
else r... | 1 |
protected void loadParser() throws ClassNotFoundException, NoSuchMethodException,
InstantiationException, IllegalAccessException, InvocationTargetException {
ClassLoader cl = Thread.currentThread().getContextClassLoader();
if ( !startRuleName.equals(LEXER_START_RULE_NAME) ) {
String parserName = gramma... | 8 |
public boolean isOppositeOf(Direction direction)
{
switch (this)
{
case UP:
if (direction == Direction.DOWN)
{
return true;
}
break;
case DOWN:
if (direction == Direction.UP)
{
return true;
}
break;
case LEFT:
if (direction == Direction.RIGHT)
{
return ... | 8 |
private boolean jj_3R_50()
{
if (jj_scan_token(LET)) return true;
if (jj_3R_17()) return true;
if (jj_scan_token(EQUAL)) return true;
if (jj_3R_9()) return true;
if (jj_scan_token(IN)) return true;
if (jj_3R_9()) return true;
if (jj_scan_token(END)) return true;
return false;
} | 7 |
public static void sort(Comparable[] a) {
for (int i = 0; i < a.length; i++)
for (int j = 1; j < a.length - i; j++)
if (less(a[j], a[j - 1]))
exch(a, j - 1, j);
} | 3 |
@Override
public void onResultsAvailable(
BiDiInterproceduralCFG<Unit, SootMethod> cfg,
InfoflowResults results) {
// Dump the results
if (results == null) {
print("No results found.");
}
else {
for (SinkInfo sink : results.getResults().keySet()) {
print("Found a flow to sink " + sink... | 5 |
private void cleanEffects()
{
for(int c = 0; c<effectList.length;c++)
{
if(!effectList[c].isActive())
{
System.out.println(effectList[c].NAME +" wore off.");
effectList[c] = Effect.CLEAR;
effectList[c].duration = -1;... | 2 |
public boolean isKingInCheck() {
Point kingsLocation = null;
for (Entry<Point, Piece> p : b.entrySet()) {
if (p.getValue() instanceof King
&& isWhitesTurn == p.getValue().getColor()) {
kingsLocation = p.getKey();
}
}
for (Entry<Point, Piece> p : b.entrySet()) {
if ((isWhitesTurn != p.g... | 6 |
public static MoodleCourse[] getAllCourses() throws MoodleRestException, UnsupportedEncodingException {
Vector v=new Vector();
MoodleCourse course=null;
StringBuilder data=new StringBuilder();
String functionCall=MoodleCallRestWebService.isLegacy()?MoodleServices.MOODLE_COURSE_GET_COURSE... | 7 |
public static int executeAndCountSqlFile(String path) throws ClassNotFoundException, SQLException, IOException {
Class.forName("org.postgresql.Driver");
Connection connection = null;
connection = DriverManager.getConnection(
Configuration.getJdbcString(), Configuration.user, Conf... | 1 |
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
double n1, n2, result = 0;
String operator;
System.out.print("Please enter first number: ");
n1 = sc.nextDouble();
System.out.print... | 5 |
public List<String> findSolutions(final LetterGen letGen, final List<String> words) {
final List<String> solutions = new ArrayList<String>();
for (final String word : words) {
if( wordContainsLettersInOrder(letGen, word) ) {
solutions.add(word);
}
}
return solutions;
} | 2 |
public double getDouble(int index) throws JSONException {
Object object = this.get(index);
try {
return object instanceof Number ? ((Number) object).doubleValue()
: Double.parseDouble((String) object);
} catch (Exception e) {
throw new JSONException("J... | 2 |
public boolean checkDangerFor(Castle castle, Hero dummy)
{
int strength = 0;
if (castle.getGarission() != null) {
strength += castle.getGarission().getStrenght();
}
if (castle.getHero() != null) {
strength += castle.getHero().getStrenght();
}
for (Hero h: p2h.objects()) {
if (h.getStrenght() > ... | 5 |
private void compileAndRun(ICompilationUnit unit) {
Map settings = new HashMap();
settings.put(CompilerOptions.OPTION_LineNumberAttribute,CompilerOptions.GENERATE);
settings.put(CompilerOptions.OPTION_SourceFileAttribute,CompilerOptions.GENERATE);
CompileRequestorImpl requestor = new CompileRequestorImpl(... | 5 |
public void generateTask(Message.TaskInitMessage message){
if(message.getType() == Message.TaskInitMessage.TaskType.BUILDER_TASK){
if(message.getId() != null && message.getDataSourceCount() > 0){
String commId = "LS " + message.getId();
CommClient localSchedulerClient... | 9 |
public static int utfSizeOf(String str)
{
int strlen = str.length();
int utflen = 0;
int c = 0;
/* use charAt instead of copying String to char array */
for (int i = 0; i < strlen; i++) {
c = str.charAt(i);
if ((c >= 0x0001) && (c <= 0x007F)) {
utflen++;
} else if (c > 0x07FF) {
utfle... | 4 |
protected void attackEntity(Entity par1Entity, float par2)
{
float var3 = this.getBrightness(1.0F);
if (var3 > 0.5F && this.rand.nextInt(100) == 0)
{
this.entityToAttack = null;
}
else
{
if (par2 > 2.0F && par2 < 6.0F && this.rand.nextInt(10) ... | 6 |
public void CambiarRealmlistPor(int Seleccion){
try {
String Realmlist = Config.Configuracion(4);
FileReader ArchivoConfiguracion = new FileReader("Configuracion.txt");
BufferedReader _ArchivoConfiguracion = new BufferedReader(ArchivoConfiguracion);
String LineaInform... | 7 |
void out_close(){
try{
if(out!=null && !out_dontclose) out.close();
out=null;
}
catch(Exception ee){}
} | 3 |
public int[][] readMap() throws IOException {
int[][] mapTab = new int[nbLine][nbCol];
String lign;
seekFile(1);
for(int i1 = 0; i1 < nbLine; i1++) {
lign = readString(nbCol);
for(int i2 = 0; i2 < nbCol; i2++) {
... | 5 |
public void collsionDetection(){
new Thread(new Runnable() {
@Override
public void run() {
while(true) {
for (GameObject gobj : gameObjects) {
if (getBounds().intersects(gobj.getBounds())) {
switch(go... | 9 |
private Object _getItem(JSONObject obj, String name) {
return obj.get(name);
} | 0 |
private Color translateColor(se.liu.ida.danan391.TDDC69.tetris.Color color) {
switch (color) {
case BLACK:
return Color.BLACK;
case BLUE:
return Color.BLUE;
case GREEN:
return Color.GREEN;
case RED:
r... | 6 |
public static void readCompressed(File f, byte[] buf, int nbytes) throws FileNotFoundException, IOException {
if (COMPRESSION_ENABLED) {
BufferedInputStream bis = new BufferedInputStream(new FileInputStream(f));
InflaterInputStream iis = new InflaterInputStream(bis);
int read... | 3 |
public boolean peutCreerCategorie(Utilisateur utilisateur) {
return (
utilisateur != null
&& (
utilisateur.getRole().getValeur() >= Role.Administrateur.getValeur()
|| (
utilisateur.getRole().getValeur() >= Role.Moderateur.getValeur()
... | 6 |
void update(){
x+=dx;
y+=dy;
if(dx > 0){
dx--;
}else if(dx < 0){
dx++;
}
if(dy < 0){
dy++;
}else if(dy > 0){
dy--;
}
} | 4 |
public void setGuid(Guid newGuid) {
if (newGuid == null) {
throw new RuntimeException("Guid must not be null.");
}
if (guid != null) {
throw new RuntimeException("Can only set GUID on a constant with an existing NULL guid.");
}
guid = newGuid;
} | 2 |
public boolean addTypeWorkFrame(){
boolean ret = false;
String name;
JTextField text = new JTextField();
JComponent[] components = new JComponent[]{
new JLabel("Введите название типа работы"),
text
};
do {
boolean result = SMS.dialog(th... | 7 |
public void drawSprite2(int i, int j) {
int k = 225;//was parameter
i += anInt1442;
j += anInt1443;
int i1 = i + j * DrawingArea.width;
int j1 = 0;
int k1 = myHeight;
int l1 = myWidth;
int i2 = DrawingArea.width - l1;
int j2 = 0;
if(j < DrawingArea.topY) {
int k2 = DrawingArea.topY - j;
k1 -= ... | 6 |
private void initializeSound (){
new Sound ("music/soundTrack.wav").start();
} | 0 |
public Competition(){
super("Competition");
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}
catch(Exception e) {
}
setSize(400, 250);
final JLabel namelabel[] = new JLabel[7];
final JLabel timelabel[] = new JLabel... | 4 |
public double getInfoFloat(String key) {
if (info == null) parseInfo();
String f = info.get(key);
if (f == null) return Double.NaN;
return Gpr.parseDoubleSafe(f);
} | 2 |
public int minMaxLookback( int optInTimePeriod )
{
if( (int)optInTimePeriod == ( Integer.MIN_VALUE ) )
optInTimePeriod = 30;
else if( ((int)optInTimePeriod < 2) || ((int)optInTimePeriod > 100000) )
return -1;
return (optInTimePeriod-1);
} | 3 |
@EventHandler(priority = EventPriority.HIGHEST)
public void onBowHit(EntityDamageByEntityEvent e) {
if (e.getDamager() instanceof Arrow) {
Arrow arrow = (Arrow) e.getDamager();
if (arrow.getShooter() instanceof Player) {
if(parent.isInNation((Player)arrow.getShooter())) {
... | 4 |
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://down... | 6 |
private VarInfo getVar(final String aVarName, final Visibility aVisibility) throws ParsingException {
final VarInfo var = mVariables.get(aVarName);
if (var == null) {
if (mParentScope == null) {
return DUMMY_VAR;
}
final VarInfo closed = mParentScope.getVar(aVarName, aVisibility);
if (closed == DU... | 8 |
public int reserve(int x){
int newNum = 0, left =0;
while(x!=0){
left = x%10;
newNum = newNum*10+left;
x = x/10;
}
return newNum;
} | 1 |
private ArrayList<Cellule> watchBois(){ // Methode qui renvoie ce que regarde le villageois (les cellules adjaçantes à la sienne + la sienne) sans les diagonalles)
ArrayList<Cellule> autour = curent.env.getenv(curent);
for (int i =0 ; i<autour.size() ; i++){
if (autour.get(i) ==null){
autour.remove(i);
... | 3 |
public boolean isPair() {
boolean retBoo = false;
for (int i = 0; i < _cards.size()-1; i++) {
for (int x = (i+1); x < _cards.size(); x++) {
if (_cards.get(i).compareTo(_cards.get(x)) == 0) {
retBoo = true;
break;
}
}
}
return retBoo;
} | 3 |
@Test
@Ignore
public void test_RoomListGet()
{
RoomList laRoomList = laClient
.getRoomList("2012-01-01-08.00.00.000000");
System.out.println(laRoomList.getRoomList().size());
if (laRoomList.getRoomList().size() > 0) {
for (Room laRoom : laRoomList.getRoomList()) {
System.out.println(laRoom.toString(... | 2 |
@Override
public float getCusto() {
// TODO Auto-generated method stub
float cus;
switch (marca) {
case ATI:if(gab.getDescricao().contains("AMD")) cus = 104;else cus = 130; break;
case NVIDIA: cus = 120; break;
default: cus = 0; break;
}
return cus + gab.getCusto();
} | 3 |
private void addEmptyThings(){
SortedSet<String> keys = new TreeSet<String>(data.keySet());
for (String path : keys) {
while(true){
path = deleteLastLevel(path);
if(path == null || path.equals(""))
break;
if(data.get(path) == null){
data.put(path, " ");
}
}
}
} | 5 |
public static void pprintOntosaurusObject(Stella_Object self, OutputStream stream) {
{ Object old$LogicDialect$000 = Logic.$LOGIC_DIALECT$.get();
Object old$PprintAtomicObjectRenderer$000 = OntosaurusUtil.$PPRINT_ATOMIC_OBJECT_RENDERER$.get();
try {
Native.setSpecial(Logic.$LOGIC_DIALECT$, Onto... | 7 |
public static StorageSlot LOOKUP_ELEMENT_SLOT(XMLObject renamed_Object, Cons elementExpr) {
{ XmlElement tag = ((XmlElement)(elementExpr.value));
Cons general_slots = Stella.NIL;
{ Slot slot = null;
Cons ITER_000 = XMLObject.GET_MAPPED_SLOTS(renamed_Object).theConsList;
for (;!(ITER_00... | 6 |
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.