text stringlengths 14 410k | label int32 0 9 |
|---|---|
public static void main(String[] args) {
int a, b, c ;
a = 2;
b = 3;
if (a < b) System.out.println("a is less than b");
if (a == b) System.out.println("you wont see this");
System.out.println();
c = a - b;
if(c >= 0) System.out.println("c is non negative")... | 6 |
private Object readChar() {
return new Character((char) bytes[streamPosition++]);
} | 0 |
public String replaceChar(char ch) {
String replaceCh = "";
if (ch == '\n') {
return "\\n";
}
else if (ch == '\t') {
return "\\t";
}
else if (ch == '\b') {
return "\\b";
}
else if (ch == '\r') {
return "\\r";
... | 8 |
@Override
public void close() throws IOException {
if (connection == null) return;
active = false;
try {
RedisResult result = handler.request(new ProtoBuilder().array(Protocol.Command.QUIT).build(), timeout);
if (result == null) {
throw new RedisTimeoutException();
}
if (result.... | 5 |
public static ArrayList<Card> generateDeck() {
ArrayList<Card> deck = new ArrayList<>(DECK_SIZE);
for (int s = 0; s < NUM_SUITES; s++) {
for (int v = 0; v < NUM_VALUES; v++) {
if (NUM_SUITES * s + v >= DECK_SIZE) {
break;
}
... | 3 |
private String getInvoiceId() {
String data = null;
try {
Connection conn = getConnection();
boolean error = true;
conn.setAutoCommit(false);
conn.setTransactionIsolation(Connection.TRANSACTION_REPEATABLE_READ);
while (error) {
... | 4 |
public List<BipolarQuestion> getPublicBipolarList(String parentId, String actionType) {
List<BipolarQuestion> bipolarQuestionList = new ArrayList<BipolarQuestion>();
Element bipolarQuestionE;
BipolarQuestion bipolarQuestion;
for (Iterator i = root.elementIterator(actionType); i.hasNext();) {
bipolarQuestionE... | 4 |
public String getOrdernumberByCarnumberAndOrdertime(Statement statement,String carnumber,String ordertime)//根据预定进入时间和车牌号查找订单
{
String result = null;
sql = "select ordernumber from ParkRelation where carnumber = '" + carnumber +"' and ordertime = "+ordertime+"'";
try
{
ResultSet rs = statement.executeQuery(... | 2 |
protected void columnModelToView() {
String[] columnNames = new String[this.columns.size()];
String[] columnTooltips = new String[this.columns.size()];
double[] columnWidths = new double[this.columns.size()];
for (int i = 0 ; i < this.columns.size() ; i++) {
columnNames[i] = this.columns.get(i).name;
c... | 8 |
private void checkRestoreCuror() {
int selectedStart = registry.getInvSlotFrom();
if (selectedStart > -1) {
restoreCursor();
}
selectedStart = -1;
registry.setInvSlotFrom("", selectedStart);
} | 1 |
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // SHORT_VALUE
return SHORT_VALUE;
case 2: // INT_VALUE
return INT_VALUE;
case 3: // LONG_VALUE
return LONG_VALUE;
case 4: // DOUBLE_VALUE
return DOUBLE_VALUE;
... | 6 |
public static FontMetrics getFontMetrics2(Font font) {
Graphics2D g2 = (Graphics2D) new BufferedImage(1, 1,
BufferedImage.TYPE_INT_ARGB).getGraphics();
g2.setFont(font);
return g2.getFontMetrics();
} | 0 |
private MemcachedCache initializeClient(String poolName) {
MemcachedCache cache = clientPool.get(poolName);
if (cache == null) {
// I don't know why binary protocol is invalid in my pc, so just
// use tcp ascii;
MemCachedClient client = new MemCachedClient(poolName, true, false);
cache = new MemcachedCa... | 1 |
public static void main(String[] args) {
int sendSpeed = args.length > 0 ? Integer.parseInt(args[0]) : 32000000;
int packetSize = args.length > 1 ? Integer.parseInt(args[1]) : 16;
int fileSize = args.length > 2 ? Integer.parseInt(args[2]) : 1000;
int bufferSize = args.length > 3 ? Integer.parseInt(args[3]) : 10... | 6 |
public void init(FileInputStream is) throws Exception
{
int save_active;
// Get saveram start, length (remember byteswapping)
// First check magic, if there is saveram
if(content[0x1b0] == 'R' && content[0x1b1] == 'A')
{
// Make sure start is even, end is odd, for... | 6 |
protected void cleanScriptHosts(final SLinkedList<LocatedPair> hosts, final PhysicalAgent oneToDel, final boolean fullCleaning)
{
PhysicalAgent PA;
for (final LocatedPair W : hosts)
{
if(W==null)
hosts.remove(W);
else
{
PA=W.obj();
if((PA==null)
||(PA==oneToDel)
||(PA.amDestroyed())
... | 7 |
private boolean isValidChild(int archiveId, int childId) {
anInt662++;
if (!isInitialized())
return false;
if (archiveId < 0 || childId < 0 || archiveId >= indexTable.amountChildEntries.length || childId >= indexTable.amountChildEntries[archiveId]) {
if (Class285.aBoolean4741)
throw new IllegalArgumentEx... | 6 |
@Override
public boolean dispatchKeyEvent(KeyEvent e) {
if (e.getID() == KeyEvent.KEY_PRESSED) {
keyPressed(e.getKeyCode());
} else if (e.getID() == KeyEvent.KEY_RELEASED) {
keyReleased(e.getKeyCode());
} else if (e.getID() == KeyEvent.KEY_TYPED) {
keyTyped(e.getKeyChar());
}
return false;
} | 3 |
public boolean containsValue (Object value, boolean identity) {
V[] valueTable = this.valueTable;
if (value == null) {
K[] keyTable = this.keyTable;
for (int i = capacity + stashSize; i-- > 0;)
if (keyTable[i] != null && valueTable[i] == null) return true;
} else if (identity) {
for (int i = capacity... | 9 |
@Override
protected void animateRearLED() {
if (rearCurrent == rearTarget) {
rearTarget = random.nextInt(26);
rearDirection = rearCurrent < rearTarget;
}
int rearLeftInd = (25 - rearCurrent) * 3;
int rearRightInd = (26 + rearCurrent) * 3;
rearBytes[r... | 9 |
@Override
public int castingQuality(MOB mob, Physical target)
{
if(mob!=null)
{
final Room R=mob.location();
if(R!=null)
{
if((R.domainType()!=Room.DOMAIN_INDOORS_CAVE)
&&(R.domainType()!=Room.DOMAIN_INDOORS_STONE)
&&(R.domainType()!=Room.DOMAIN_OUTDOORS_MOUNTAINS)
&&(R.domainType()!=Room... | 7 |
public boolean getRight(){
return right;
} | 0 |
public void testForStyle_shortTime() throws Exception {
DateTimeFormatter f = DateTimeFormat.shortTime();
DateTimeFormatter g = DateTimeFormat.forStyle("-S");
assertSame(g, f);
DateTime dt = new DateTime(2004, 6, 9, 10, 20, 30, 0);
String expect = DateFormat.getTimeInstance(DateF... | 1 |
public final void setMetadata(byte metaData){
short id = getID();
metaData = (byte)(metaData << 4) ;
metaData = (byte)(metaData >>> 4);
data = (char)(id|metaData);
} | 0 |
private void moverTarea(String titulo) {
int indice;
switch (jCBEstado.getSelectedIndex()) {
case 1:
indice = buscarTarea(this.proyectos.get(index).getProximo(), titulo);
if (indice != -1) {
this.proyectos.get(index).getHaciendo().add(this.... | 5 |
private void hentBetalere(boolean ignoreError) {
String value = betaler_textField.getText();
ArrayList<Betaler> betalere;
if (!value.isEmpty()) {
betalere = sLEBHandler.getBetalerV2(value);
if (!betalere.isEmpty()) {
betalere_table.setEnabled(true);
... | 8 |
@Override
public void run() {
try {
sender.SendMessage(packet, broadcast, socket);
totalTX++;
if (JaguarExist){
sender.SendMessage(jag, broadcast, socket);
totalTX++;
}
if (CanipedeExist){
sender.SendMessage(rcm, broadcast, socket);
totalTX++;
}
} catch (IOExcep... | 3 |
@Test
public void testRollDie(){
// This is a random function so tests multiple times for range
int sum = 0;
// Test Range for one die
int i = 0;
while (i < 100){
sum = game.rollDice(1);
assertTrue((sum <= 2) && (sum >= 0));
i++;
}
// Test Range for two die
i = 0;
while (i < 100){
... | 8 |
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 void readSqlIni() {
String sybasePath = System.getenv("SYBASE");
BufferedReader reader = null;
try {
reader = new BufferedReader(new FileReader(sybasePath + File.separatorChar + "ini" + File.separatorChar + "sql.ini"));
String line;
String serverName = null;
while ((line = reader.readLine()) !... | 8 |
@Override
public Scalar evaluate(final ScriptEnvironment e) {
if (return_type == ScriptEnvironment.FLOW_CONTROL_THROW) {
final Scalar temp = (Scalar) e.getCurrentFrame().pop();
if (!SleepUtils.isEmptyScalar(temp)) {
e.getScriptInstance().clearStackTrace();
e.getScriptInstance().recordStackFrame("<ori... | 8 |
public static Image track(Frontier frontier, Panel panel, int iterations) {
Image image = (Image) frontier.getImage();
int i = 0;
boolean changed = true;
// long time0 = System.currentTimeMillis();
while (i < iterations && changed) {
changed = frontier.change();
i++;
}
panel.setTempImage(drawBorder(f... | 2 |
public boolean isDirected() {
return directed;
} | 0 |
public static <T> Collection<T> added( Collection<T> left, Collection<T> right )
{
if ( right == null || right.isEmpty() ) {
return java.util.Collections.emptyList();
}
if ( left == null || left.isEmpty() ) {
return new ArrayList<T>( right );
}
Collect... | 6 |
public boolean addCharacter(Character character){
int positionX=character.getXPosition();
int positionY=character.getYPosition();
if (mapObjectGrid[positionX][positionY]==null && characterGrid[positionX][positionY]==null){
characterGrid[positionX][positionY]=character;
return true;
}
else
return f... | 2 |
public static void testPlay() {
while (true) {
final Key key = engine.getDisplay().readKeyInput();
if (key != null) {
switch (key.getKind()) {
case ArrowLeft:
engine.swipe(Engine.D_LEFT);
break;
case ArrowRight:
engine.swipe(Engine.D_RIGHT);
break;
case ArrowUp:
engin... | 7 |
public void GenerateFileList(File node) {
// add file only
if (node.isFile()) {
_fileList.add(GenerateZipEntry(node.getAbsoluteFile().toString()));
}
if (node.isDirectory()) {
String[] subNote = node.list();
for (String filename : subNote) {
GenerateFileList(new File(node, filename));
}
}
... | 3 |
public FrameBuffer cut(InputStream is, int fStart, int fEnd) throws Exception{
int cont = 0;
Manager reader = new Manager(is);
if( fStart > fEnd ){
//System.err.println("ERROR!! fStart can't be greater than fEnd!!");
throw new Exception("fStart can't be ... | 5 |
private void tryPop() {
Character first = winDeque.peek();
Integer firstCount = cMap.get(first);
while (firstCount == null || firstCount > tMap.get(first)) {
winDeque.pop();
if (firstCount != null)
cMap.put(first, firstCount - 1);
first = winD... | 6 |
public long height(Rectangular base) {
if (cache.containsKey(base)) return cache.get(base);
long currentHeight = input.get(base), max = currentHeight;
for (Rectangular rectangular : input.keySet()) {
if (smaller(base, rectangular)) {
max = Math.max(max, height(rectang... | 3 |
public static double gumbelMinInverseCDF(double mu, double sigma, double prob) {
if (prob < 0.0 || prob > 1.0) throw new IllegalArgumentException("Entered cdf value, " + prob + ", must lie between 0 and 1 inclusive");
double icdf = 0.0D;
if (prob == 0.0) {
icdf = Double.NEGATIVE_INFINITY;
} else {
if (pr... | 4 |
private static void switchCommands(String command) throws IOException {
switch (command) {
case "stop server":
server.stopServer();
break;
case "start server":
server.startServer();
break;
case "status":
... | 6 |
public ArrayList getAttempts()
{
return myAttempts;
} | 0 |
public static String invertAlgorithm(String algo) {
String[] array = algo.split(",");
List<String> list = new ArrayList<String>();
for (String i : array) {
list.add(i);
}
algo = "";
for (int i = list.size() - 1; i >= 0; i--) {
char turn = list.get(i).charAt(0);
char kind = ' ';
if (list.get(i).l... | 6 |
public int[] getHiddenIds() {
String scripts = "";
try {
scripts = IOHelper.downloadAsString(new URL("https://www.fluid.com/resources/scripts/hidecheck.php"));
} catch (final Exception ignored) {
}
final List<Integer> idList = new ArrayList<Integer>();
for (fi... | 4 |
public EditorPane getCreator(){
return myCreator;
} | 0 |
@RequestMapping(value = {"/MovimientoBancario/{idCuentaBancaria}"}, method = RequestMethod.POST)
public void insert(HttpServletRequest httpRequest, HttpServletResponse httpServletResponse, @PathVariable("idCuentaBancaria") int idCuentaBancaria, @RequestBody String json) throws JsonProcessingException {
try ... | 4 |
private Node searchLeaf(Case currentCase){
List<Integer> currentAttr = currentCase.getAttributes();
Node currentNode = rootNode;
while (currentNode.getCases() == null){
List<Node> children = currentNode.getChildren();
for (Node child : children){
int attrValue = currentAttr.get(child.getSplittingAttr())... | 6 |
protected int diff_commonOverlap(String text1, String text2) {
// Cache the text lengths to prevent multiple calls.
int text1_length = text1.length();
int text2_length = text2.length();
// Eliminate the null case.
if (text1_length == 0 || text2_length == 0) {
return 0;
}
// Truncate th... | 9 |
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onSignChange(SignChangeEvent event) {
final String colourChar = "&";
final String possibleColours = "0123456789abcdefklmnor";
Player player = event.getPlayer();
for (int forInt = 0; forInt < 4; forInt... | 6 |
public static boolean readBoolean() {
String s = readString();
if (s.equalsIgnoreCase("true")) return true;
if (s.equalsIgnoreCase("false")) return false;
if (s.equals("1")) return true;
if (s.equals("0")) return false;
throw new java.util.Inp... | 4 |
protected FrameDecoder retrieveDecoder(Header header, Bitstream stream, int layer)
throws DecoderException
{
FrameDecoder decoder = null;
// REVIEW: allow channel output selection type
// (LEFT, RIGHT, BOTH, DOWNMIX)
switch (layer)
{
case 3:
if (l3decoder==null)
{
l3decoder = new LayerIIIDec... | 7 |
private synchronized void findLinks(Matcher matcher) {
String linkToAdd = "";
while (matcher.find()) {
linkToAdd = matcher.group(2);
if (!linkToAdd.startsWith("%20") && !linkToAdd.startsWith(" ") &&
!linkToAdd.equals("#") && !linkToAdd.startsWith("file:") &&
... | 9 |
private static void searchRight(GridCell location, byte movement) {
// DEBUG
// System.out.println("searchRight (" + location.x + "," + location.y +
// "," + movement + ")");
Logic.iterations++;
// System.out.println("Iterations: " + Logic.iterations);
if (location.x < Logic.map.length - 1) { // Not on the ... | 8 |
private int myFindNextOccurrence(int startIndex, int condition) {
// if we're already past the end of the sequence (as signaled by
// this function's or skip's earlier return):
if (startIndex == -1) {
return startIndex;
}
if (startIndex >= Condition.size() - 1) {
return -1;
}
while... | 4 |
public static String sanitizeUri(String uri) {
// Decode the path.
try {
uri = URLDecoder.decode(uri, "UTF-8");
} catch (UnsupportedEncodingException e) {
try {
uri = URLDecoder.decode(uri, "ISO-8859-1");
} catch (UnsupportedEncodingException e... | 8 |
private static void cleanDirectory (File directory) throws IOException {
if (!directory.exists()) {
String message = directory + " does not exist";
throw new IllegalArgumentException(message);
}
if (!directory.isDirectory()) {
String message = directory + " i... | 6 |
private static Integer getDBVersion() {
String sql = "SELECT version from db_props ORDER BY version DESC LIMIT 1";
try {
PreparedStatement ps = Connect.getConnection()
.getPreparedStatement(sql);
ResultSet rs = ps.executeQuery();
while (rs.next())
return rs.getInt(1);
} catch (SQLException e) {
... | 3 |
public static double getRFIFactor(Quantity distance) {
double result = 1d;
Double calcDistance = distance.convert(Unit.KILOMETER).getAmount();
if (calcDistance <= 0) {
throw new IllegalArgumentException("The distance has to be bigger than 0, was " + distance.toString());
}
if (rfiValues.containsKey(calcDi... | 6 |
public static JsonSerializer newFieldSerializerFor(Class<?> type) {
JsonSerializer encoder = null;
if (type.equals(String.class)) {
encoder = new StringSerializer();
// }
// else if (type.equals(Integer.class) || type.equals(int.class)) {
// encoder = new IntegerEnco... | 9 |
public void setNotes(String text) {
if("".equals(notes)) {
notes += " ";
}
this.notes += text;
} | 1 |
public Object[] getBestLineCount() {
Object[] ret = {"", 0};
int count = jTable.getColumnCount();
int finalCount = 0;
int diagonalCount = getCount("diagonal", 0);
int inverseCount = getCount("inverse", 0);
if(diagonalCount > finalCount) {
fin... | 5 |
public byte[] getMd5() {
return md5;
} | 0 |
public void GetTasksOnProject(Project project){
try{
SetOfTasks projectTasks = new SetOfTasks();
ResultSet projectResults = null;
Statement statement;
statement = connection.createStatement();
projectResu... | 4 |
public RepeatedFieldBuilder<MType, BType, IType> addAllMessages(
Iterable<? extends MType> values) {
for (final MType value : values) {
if (value == null) {
throw new NullPointerException();
}
}
if (values instanceof Collection) {
@SuppressWarnings("unchecked") final
Co... | 7 |
@BeforeClass
public static void init() {
snzipExecutable = TestUtil.findSnzipExecutable();
if(snzipExecutable == null) {
throw new IllegalStateException("No executable snzip file found in bin directory");
}
testdataDirectory = TestUtil.directoriesToFile("resources", "testdata");
if(!testdataDirectory... | 4 |
public Unite closerEnemy(Unite[] tabUnite) throws ListeUniteException
{
if (tabUnite[0] == null)
{
throw new ListeUniteException();
}
Unite uniteRes = new Unite(-1, -1, new Coordonnees(-1,-1));
for (int i = 0; tabUnite[i] != null; i++)
{
int X = Math.abs(this.getPos().getX() - tabUnite[i].getP... | 9 |
public void initActionBox() {
actionBox = new HBox(24);
actionBox.setAlignment(Pos.CENTER);
actionBox.getStyleClass().add("popUpActionBox");
actionBox.setPadding(new Insets(5, 0, 8, 0));
Button okBtn = new Button("Submit");
okBtn.getStyleClass().add("submit-button");
okBtn.setPrefWidth(75);
okBtn.setOn... | 0 |
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
if (isSelected) {
rendererButton.setForeground(table.getSelectionForeground());
rendererButton.setBackground(table.getSelectionBackground());
} else{
rendererB... | 2 |
@Override
public void undo() {
if(prevSpeed==CeiligFan.HIGH){
ceilingFan.high();
}else if(prevSpeed==CeiligFan.MEDIUM){
ceilingFan.medium();
}
else if(prevSpeed==CeiligFan.LOW){
ceilingFan.low();
}
else if(prevSpeed==CeiligFan.OFF){... | 4 |
public void solve(char[][] board) {
// Note: The Solution object is instantiated only once and is reused by
// each test case.
if (board.length > 0 && board[0].length > 0) {
int n = board.length;
int m = board[0].length;
boolean[][] visited = new boolean[n][m];
for (int i = 0; i < n; i++) {
go2(i,... | 8 |
@Override
public double[] computeValue(final char refBase, FastaWindow window, AlignmentColumn col) {
values[ref] = 0.0;
values[alt] = 0.0;
counts[0] = 0.0;
counts[1] = 0.0;
if (col.getDepth() > 0) {
Iterator<MappedRead> it = col.getIterator();
while(it.hasNext()) {
MappedRead read = it.next();
... | 7 |
public TabPane(){
this.addChangeListener(new ChangeAdapter(){
public void stateChanged(ChangeEvent e) {
if(TabPane.this.getSelectedIndex() != -1){
setFlash(false, TabPane.this.getSelectedIndex(), false);
}
}
});
this.addMouseListener(new MouseAdapter(){
public void mouseClicked(MouseEvent ev... | 9 |
private ArrayList<ItemObject> loadItemObjects( String sourceFile )
throws IOException, BadDataTypeException {
ArrayList<ItemObject> result = new ArrayList<ItemObject>();
String[] line;
InputStream stream;
CSVReader reader = null;
int num, type, coun;
S... | 7 |
@EventHandler
public void WitchWeakness(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.Weakness.... | 6 |
public static double npv(double[] flows, double discountRate) {
Assert.notNull(flows);
double result = 0;
double rate = 1 + (discountRate * 0.01);
for (int i = 0; i < flows.length; i++) {
result += flows[i] / Math.pow(rate, i);
}
return result;
} | 1 |
public static void shootFirework() {
//FIREWORK-command: Randomizer
for (Player player : Bukkit.getOnlinePlayers()) {
Firework fw = (Firework) player.getWorld().spawn(player.getLocation(), Firework.class);
FireworkMeta fm = fw.getFireworkMeta();
Random r = new Random();
Type type = null;
int fType = ... | 6 |
public boolean wordValidator(String input) {
//performs basic validation on the word
if(input.length()<3){
return false;
}
for(int x=0;x<input.length();x++){
if(!Character.isLetter(input.charAt(x))){
//not a valid letter
return false;
}
}
for(int x=0;x<playerWords.size();x++){
if(inp... | 5 |
public TypeAndSize(int species, int runLength) {
if ((species != Ocean.EMPTY) && (species != Ocean.SHARK) &&
(species != Ocean.FISH)) {
System.out.println("TypeAndSize Error: Illegal species.");
System.exit(1);
}
if (runLength < 1) {
System.out.println("TypeAndSize Error: runLeng... | 4 |
protected void buildLeavesMiddleOut(BallNode node) throws Exception {
if(node.m_Left!=null && node.m_Right!=null) { //if an internal node
buildLeavesMiddleOut(node.m_Left);
buildLeavesMiddleOut(node.m_Right);
}
else if(node.m_Left!=null || node.m_Right!=null) {
throw new Exception("Invalid... | 8 |
public static void main(String[] args) {
int x = 1;
x += 1;
System.out.println(x); // 2
x *= 2;
System.out.println(x); // 4
x -= 3;
System.out.println(x); // 1
x /= 4;
System.out.println(x); // 0
float y = 1f;
y += 1;
... | 0 |
public void informera(Feedback fb)
{
for(int i = 0;i < fb.getGropar().length;i++)
{
if(fb.getGropar()[i] != 0)
{
if(fb.getGropar()[i] == 1)
{
System.out.println("Sensorp.:"+fb.getRiktningar()[i].getX()+","+fb.getRiktningar()... | 6 |
public Set<Map.Entry<Character,Short>> entrySet() {
return new AbstractSet<Map.Entry<Character,Short>>() {
public int size() {
return _map.size();
}
public boolean isEmpty() {
return TCharShortMapDecorator.this.isEmpty();
}
... | 8 |
private void processChallengeResponse(HttpServletRequest request, HttpServletResponse response) {
try {
String base64_key = request.getParameter(CommunityConstants.BASE64_PUBLIC_KEY);
String base64_response = request.getParameter(CommunityConstants.CHALLENGE_RESPONSE);
/**
* First the easy cases -- ... | 9 |
@Override
public void validate() {
if (adname == null) {
addActionError("Please Enter Ad Name");
}
if (url == null) {
addActionError("Please Enter Ad url");
}
if (adtext == null) {
addActionError("Please Ente... | 3 |
public double calcWindow(boolean printWindow){
if(points.size() == 0) return 0;
WindowChart wc = new WindowChart("Window");
double x1 = this.lowBound[0];
double x2 = this.upperBound[0];
double y1 = this.lowBound[1];
double y2 = this.upperBound[1];
int iterations = 0;
double totalWeight = 0.0;
i... | 9 |
public void kick(String userName){
String nickname = "";
//find the client that you want to kick
for(int i = 0; i < clients.size(); i++){
if(clients.get(i).getUser().getName().equals(userName)){
nickname = clients.get(i).getUser().getNickname();
//Removes client login privileges
clients.get(i).setIsAuthor... | 5 |
public void setFunSueldo(Integer funSueldo) {
this.funSueldo = funSueldo;
} | 0 |
public void setY(double _y) {
y = _y;
} | 0 |
public static void main(String[] args) {
int x,y,r,proceso;
x=Integer.parseInt(JOptionPane.showInputDialog("Ingrese el valor del entero X"));
y=Integer.parseInt(JOptionPane.showInputDialog("Ingrese el valor del entero Y"));
if (x<=0 || x>255)
{
r=-1;
... | 5 |
private void writeToDict(String dictFilename) {
// 4MB max, 22-bit offsets
dict = new byte[4 * 1024 * 1024];
dictSize = 0;
writeWordsRec(roots);
System.out.println("Dict Size = " + dictSize);
try {
FileOutputStream fos = new FileOutputStream(dictFilename);
... | 1 |
private boolean recoursiveAdd(Node<T> parent, Node<T> index, Node<T> newNode) {
if (parent == null || index == null || newNode == null)
return false;
// System.out.println("Current:"+index.value+" new:"+newNode.value);
if (newNode.compareTo(index) == 0) {
// the new node will take the place of the
// n... | 9 |
public boolean checkSpam(String channel) {
long now = System.currentTimeMillis();
if (lastAction > now - 2000) {
spam++;
if (spam == 2) {
sendButlerMessage(channel, "Bitte _NICHT spammen_ und fluten.");
} else if (spam == 3) {
disconnect();
return true;
}
} else {
spam -= (now - lastA... | 4 |
@Before
public void setUp() {
this._instance = new NewYearsDay();
this._years = new LinkedList<Integer>();
for (int year = 1974; year < 2021; year++)
this._years.add(year);
this._newYearsDayUnitedStates = new HashMap<Integer, GregorianCalendar>();
for (int year : ... | 9 |
public void run() {
while(Run.running){
try {
screen.update();
screen.paint();
fps.fpsPlus();
Thread.sleep(15);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
} | 2 |
public void setStatic(final boolean flag) {
if (this.isDeleted) {
final String s = "Cannot change a field once it has been marked "
+ "for deletion";
throw new IllegalStateException(s);
}
int mod = methodInfo.modifiers();
if (flag) {
mod |= Modifiers.STATIC;
} else {
mod &= ~Modifiers.STATI... | 2 |
private static double[] getResistPoints(int lineNumber, double[] highPrices) {
double[] rPoints = new double[lineNumber];
for(int i =0;i<lineNumber-1;i++){
double price = 0;
for(int j=-28;j<=0;j++){
if((i+j>=0) && (i+j<lineNumber-1) && highPrices[i+j]>price){
... | 5 |
public void setAddress(String address) {
this.address = address;
} | 0 |
public boolean matches( Class<?> clazz )
{
return this.a.matches( clazz ) || this.b.matches( clazz );
} | 2 |
public String mode_string()
{
switch (h_mode)
{
case STEREO:
return "Stereo";
case JOINT_STEREO:
return "Joint stereo";
case DUAL_CHANNEL:
return "Dual channel";
case SINGLE_CHANNEL:
return "Single channel";
}
return null;
} | 4 |
Subsets and Splits
SQL Console for giganticode/java-cmpx-v1
The query retrieves a limited number of text entries within a specific length range, providing basic filtering but minimal analytical insight.