text stringlengths 14 410k | label int32 0 9 |
|---|---|
@Override
public void run() {
super.run();
try {
pushCookie();
} catch (IOException ex) {
Logger.getLogger(SinaWeiboAutoLogin.class.getName()).log(Level.SEVERE, null, ex);
} catch (JSONException ex) {
Logger.getLogger(SinaWeiboAutoLogin.class.getNa... | 9 |
private final void updateVideoExistence() {
boolean exists = (this.videncode.getVideoFileSource() != null);
this.videoSourceCheckbox.setEnabled(exists);
this.videoSourceCheckbox.setSelected(exists);
this.updateVideoEncodeButtonAndBitrate();
this.videoEncodingDurationRangeslider.setEnabled(exists);
for (i... | 7 |
public void setState(State state) {
this.state = state;
} | 0 |
public Node getNode() {
return this.node;
} | 0 |
public void start(String hashPrefix) throws IOException, NoSuchAlgorithmException, InterruptedException {
ArrayBlockingQueue<List<String>> in = new ArrayBlockingQueue<List<String>>(100);
ArrayBlockingQueue<List<String>> out = new ArrayBlockingQueue<List<String>>(100);
int threadNum = Runtime.g... | 6 |
private static List<String> validateSetter(Method m) {
List<String> errors = new ArrayList<String>();
if (m.isAnnotationPresent(BusinessLogic.class)) errors.add("@BusinessLogic is not valid here");
if (m.isAnnotationPresent(Xml.class)) errors.add("@Xml is not valid here, use it on getter");
if (m.isAnnotatio... | 6 |
public static String kick(DataOutputStream out, PassthroughConnection ptc, KillableThread thread, String message) {
if(Main.craftGUI != null) {
Main.craftGUI.safeSetStatus(message);
}
if(ptc != null && (!ptc.sendingKickMessage())) {
return null;
}
PacketFFKick kick = new PacketFFKick((byte)(0xF... | 5 |
public GroupInfo getGroupInfo(String groupId) throws IOException {
ZookeeperUtils zkUtils = createZookeeperUtils();
ZkClient zkClient = null;
GroupInfo info = new GroupInfo(groupId);
try {
zkClient = zkUtils.getZkClient(zkServers);
List<Broker> brokers = zkUtils.... | 8 |
public int[] getUtility( int [] utility,boolean isMax)//might be problem here
{
int [] result=new int [2];
int curr=utility[0];
if(isMax)//find the max value in utility
{
for(int i=1;i<utility.length;i++)
{
if(utility[i]>curr){
curr=utility[i];
result[1]=i;
}
}
}
else
{
for... | 5 |
private void hbCreateDecodeTables(int[] limit, int[] base,
int[] perm, char[] length,
int minLen, int maxLen, int alphaSize) {
int pp, i, j, vec;
pp = 0;
for (i = minLen; i <= maxLen; i++) {
for (j = 0; j < ... | 9 |
@EventHandler
public void MagmaCubeSlow(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.getMagmaCubeConfig().getDouble("MagmaCube.S... | 6 |
private String domNodeDescription (Node node, int tablevel) {
String domNodeDescription = null;
String nodeName = node.getNodeName ();
String nodeValue = node.getNodeValue ();
if (!(nodeName.equals ("#text") && nodeValue.replaceAll ("\n", "").trim ().equals (""))) {
domNodeDescription = tabs (tablevel) + no... | 7 |
private void look(Command command) {
if (!command.hasSecondWord()) {
printLocationInfo();
return;
}
String secondWord = command.getSecondWord();
if (secondWord.equals("inventory")) {
player.printInventory();
return;
}
... | 4 |
public void setSetTEmodeGratingOrder(int[] order){
this.gratingOrderTE = order;
int m = order.length;
if(this.setMeasurementsTEgrating)if(m!=this.numberOfTEmeasurementsGrating)throw new IllegalArgumentException("Number of grating orders entered, " + m + ", is not equal to the number of measureme... | 5 |
@Override
public void startEffect(ThePeanutButterJellyGame game, Player player) {
if (sound != null)
sound.play();
for (Player p : game.getPlayers()) {
if (p != player) {
p.removeBricks();
}
}
} | 3 |
public static List<String> decodificarQuery(String queryString) {
List<String> resultado = new ArrayList<String>();
JSONParser parser = new JSONParser();
try {
Object objQuery = parser.parse(queryString);
JSONObject queryJSON = (JSONObject) objQuery;
JSONObject query = (JSONObject) queryJSON.get(QUERY);
... | 1 |
public void removeTurma(int numero){
for (Turma t: this.turmas){
if (t.getNumero() == numero){
this.turmas.remove(t);
break;
}
}
} | 2 |
@Override
public void downloadAllFiles() {
Map<String, WikiResourceMeta> newFileMetaList = new HashMap<String, WikiResourceMeta>(alreadyDownloadMeta);
try {
Map<String, WikiResourceMeta> fileMetaList = getPageUrls();
for (Map.Entry<String, WikiResourceMeta> fileMeta : fileM... | 9 |
public void update(InputHandler inhandler){
if(timer.isReady()){
if(timeVar<5){
timeVar++;
timer= new Timer(40);
}else{
Level.entities.remove(this);
}
}
} | 2 |
private static long trace(long n) {
long length = 1;
long temp = n;
while (temp != 1) {
length++;
temp = (temp % 2 == 0) ? (temp / 2) : (3 * temp + 1);
if (temp < n) {
try {
length += l.get(temp);
} catch (Exception e) {
System.out.println("tracing " + n + " can't find " + temp);
}
... | 4 |
private void showStudent(int index) {
final Student student = this.students[index];
// remove all previous entries in the fields list
this.fields.clear();
// Remove all previous Components from the panel
this.studentInfoPanel.removeAll();
this.studentInfoPanel.setLayout(new BorderLayout());
/* na... | 5 |
public static void readRegularGrammarFromFile(Set<String> nonTerminals,Set<String> terminals,List productions,StringBuilder startSymbol) {
try {
FileInputStream fstream = new FileInputStream("C:\\Users\\fgheorghe\\Dropbox\\Compilatoare\\src\\Files\\2.regularGrammar.txt");
DataInputStrea... | 7 |
@Override
public float eval(IRList l) {
if (l == null || l.getQuery() == null || l.getPertinence() == null)
return -1;
ArrayList<Integer> relevants = l.getQuery().relevants;
ArrayList<Integer> pertinence = l.getPertinence();
int currentLevel = nbLevels, nRelevants = rele... | 9 |
private boolean canCalculate(String expression){
//todo: not implemented
return true;
} | 0 |
private void install() {
final ProgressMonitor monitor = new ProgressMonitor(this, "Installing", null, 0, 1);
monitor.setMillisToPopup(0);
monitor.setMillisToDecideToPopup(0);
final Installer installer = new Installer(new DialogInstallAdapter(this, "Installing") {
@Override... | 8 |
@Override
protected void read(InputBuffer b) throws IOException, ParsingException {
time = Util.getInt(b.get(0, 4));
stream = Util.getInt(b.get(4, 4));
b = b.getSubBuffer(8);
services = getMessageFactory().parseNodeServicesMessage(b);
b = b.getSubBuffer(services.length());
byte[] ipBytes = b.get(0, 16);
... | 7 |
public void disconnect() {
try {
if (stmt != null) {
stmt.close();
}
if (conn != null) {
conn.close();
}
gui.setdisconnected();
} catch (SQLException e) {
gui.handleSQLException(e);
}
} | 3 |
@Override
public boolean equals(Object o){
if (!(o instanceof Sense)){
return false;
}
Sense s = (Sense)o;
return this.name.equals(s.name) && this.value.equals(s.value);
} | 2 |
public JavaMethod getMethodFromSignature(String signature) {
if (signature == null || signature.equals("") || !signature.startsWith("(")) {
return null;
}
final int closingIndex = signature.lastIndexOf(')');
if (closingIndex <= 0 || closingIndex >= signature.length() - 1) {... | 9 |
private static void getChannelEncoding(byte[] pixel1, byte[] pixel2, int[] channels) {
for (int c=0; c<3; ++c) {
channels[c] = 0;
for (int b=0; b<8; ++b) {
byte p1 = (byte) ((pixel1[c] >> b)&0x01);
byte p2 = (byte) ((pixel2[c] >> b)&0x01);
if (p1 != p2) channels[c]++;
}
}
} | 3 |
@PostConstruct
public void initRecommender() {
try {
// get the file which is part of the WAR as
URL url = getClass().getClassLoader().getResource(DATA_FILE_NAME);
// create a file out of the resource
File data = new File(url.toURI());
// create a map for saving the preferences (likes) for... | 6 |
private static ItemStack deserializeBasicSection(String s) {
String[] d = s.split(",");
ItemStack is = new ItemStack(0);
for(int i=0;i<d.length;i++) {
switch(i) {
case 0: is.setTypeId(Integer.parseInt(d[i]));
break;
case 1: is.setDurability(Short.parseShort(d[i]));
break;
case 2: is.set... | 4 |
private void takeCommand(String input, Player hero) {
String amount = parseLastInput(input); //The last word in the string input
Integer amtToTake = 1;
//If the player enters "take hp pot all" it will take all of the hp pots in the room
if (amount.equalsIgnoreCase("all")) {
... | 7 |
public void shrink()
{
int[] nmin = new int[min.length];
int[] nmax = new int[min.length];
for (int i = 0; i < min.length; i++)
nmin[i] = nmax[i] = -1;
for (MultiColor c : freqTable.keySet())
if (inside(c))
for ... | 8 |
public static void DFS(int node, int used, int parent, String path) {
if (path.length() == size)
ans.add(path);
else {
Stack<Integer> change = new Stack<Integer>();
for (int i = 0; i < ady[node].size(); i++) {
int neigh = ady[node].get(i);
if (check(used, neigh)) {
if (parents[neigh] == 1)
... | 8 |
RollbackToken(final String fullName, final String userName, final String token) {
if ((fullName == null) || (fullName.length() == 0))
throw new IllegalArgumentException("fullName may not be null or empty");
if ((userName == null) || (userName.length() == 0))
throw new IllegalArgumentException("userName ma... | 5 |
private void verificaPK() {
try {
if (this.primaryKey == null || this.primaryKey.length == 0) {
throw new Exception("Nome da coluna de ID não informado na classe " + this.subClasse.getSimpleName());
}
/*
* Verificando se o nome da primary key informada está em algum dos
* atributos da classe
... | 7 |
private Shape getShape()
{
if (cachedShape == null || lastX != this.getPosition().getX()
|| lastY != this.getPosition().getY() || lastRadius != this.getRadius())
{
cachedShape = createNewShape();
lastX = this.getPosition().getX();
lastY = this.getP... | 4 |
public static void main(String[] args) {
w = new Worker();
} | 0 |
@EventHandler (priority = EventPriority.HIGH, ignoreCancelled = true)
public void onItemFrameBreakEvent(EntityDamageByEntityEvent event) {
if (event.getEntityType() != EntityType.ITEM_FRAME) {
return;
}
final Player player;
if (event.getDamager() instanceof Arrow) {
... | 7 |
public static Vector<String> parseSemicolons(String s, boolean ignoreNulls)
{
final Vector<String> V = new Vector<String>();
if ((s == null) || (s.length() == 0))
return V;
int x = s.indexOf(';');
while (x >= 0)
{
final String s2 = s.substring(0, x).trim();
s = s.substring(x + 1).trim();
if ((!ig... | 7 |
@Test
public void testGenerateRandomContestWorld() {
System.out.println("generateRandomContestWorld");
World instance = new World();
instance.generateRandomContestWorld();
} | 0 |
public static Results averageResults(ArrayList<Results> res) {
Results outResults = res.get(0);
for (int i = 1; i < res.size(); i++) {
Results tempRes = res.get(i);
for (int j = 0; j < tempRes.getResults().size(); j++) {
for (int k = 0; k < outResults.getResults(... | 5 |
public synchronized void gridletMove(int gridletId, int userId, int destId, boolean ack)
{
// cancel the Gridlet first
ResGridlet rgl = cancel(gridletId, userId);
// If no found then print an error msg
if (rgl == null)
{
System.out.println(super.resName_ +
... | 4 |
private boolean connectToVault()
{
boolean blnRet = false;
PluginManager pm = getServer().getPluginManager();
Plugin plugin = pm.getPlugin(TGPConstants.VAULT);
//Check if the plugin is initialized and enabled
if (plugin != null && plugin.isEnabled())
{
/... | 4 |
public static Line getMasterOutputLine() {
for (Mixer mixer : getMixers()) {
for (Line line : getAvailableOutputLines(mixer)) {
if (line.getLineInfo().toString().contains("Master")) return line;
}
}
return null;
} | 3 |
public Maasto Maasto(int i, int j){
if((i>maxKoko || i<0) || (j> maxKoko || j<0)){
return null;
}
return kartta[i][j].maasto();
} | 4 |
private void bubbleDown() {
int index = 1;
if (comp==null){
while (hasLeftChild(index)) {
int smallerChild = index*2;
if (hasRightChild(index)
&& ((Comparable) data[index*2]).compareTo(data[(index*2+1)]) > 0) {
smallerChild = (ind... | 9 |
private void read(DataInputStream in) throws IOException {
int i, n;
int magic = in.readInt();
if (magic != 0xCAFEBABE)
throw new IOException("bad magic number: " + Integer.toHexString(magic));
minor = in.readUnsignedShort();
major = in.readUnsignedShort();
c... | 6 |
public static byte[] encrypt(byte[] in,byte[] key){
Nb = 4;
Nk = key.length/4;
Nr = Nk + 6;
int lenght=0;
byte[] padding = new byte[1];
int i;
lenght = 16 - in.length % 16;
padding = new byte[lenght];
padding[0] = (byte) 0x80;
for (i = 1; i < lenght; i++)
padding[i] = 0;
... | 6 |
private void parseDefs(String fileName, int numProvs) throws FileNotFoundException, IOException {
final BufferedReader reader = new BufferedReader(new FileReader(fileName));
try {
reader.readLine(); // eat first line
for (int i = 1; i < numProvs; i++) {
... | 3 |
public Point getDownConnection(String conn) {
int pos = 0;
for (int i = 0; i <= outLables.length; i++) {
if(i == outLables.length){
return null;
}
if(outLables[i].equals(conn)){
pos = i;
break;
}
}
... | 3 |
public String encrypt(String message) {
try {
MessageDigest md = MessageDigest.getInstance("MD5");
return hex (md.digest(message.getBytes("CP1252")));
} catch (NoSuchAlgorithmException e) { } catch (UnsupportedEncodingException e) { }
return null;
} | 2 |
public static void log(Level level, String message) {
if (level.ordinal() >= CURRENT_LEVEL.ordinal()) {
System.out.println(message);
}
} | 1 |
@SuppressWarnings("unchecked")
ArrayList new58() /* reduce ANonTerminal$Methoddecl */
{
@SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();
@SuppressWarnings("unused") ArrayList nodeArrayList2 = pop();
@SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
L... | 2 |
@Override
public IRemoteCallObject getResponseRemoteCallObject() {
return response;
} | 0 |
@Override
public byte[] generate(World world, Random rand, int chunkx, int chunkz) {
// max-boxel-size set to 0 will result in non-limited worlds
if (maxBoxelSize != 0) {
if (chunkx > maxBoxelSize / 2)
return Arrays.copyOf(borderChunk, borderChunk.length);
if (chunkz > maxBoxelSize / 2)
return Arra... | 5 |
public static void clearPanel() {
if (jTable_Inbox != null && jTable_Outbox != null && jTable8 != null) {
((OTInboxTableModel) jTable_Inbox.getModel()).clearValue();
((OTOutboxTableModel) jTable_Outbox.getModel()).clearValue();
((OTReceiptTableModel) jTable8.getModel()).clear... | 3 |
@Override
public void paint(Graphics g, Point position) {
} | 0 |
public static AlbumLogger getInstance()
throws LogException {
if(AlbumLogger.log == null) {
synchronized (AlbumLogger.class) {
if(AlbumLogger.log == null) {
AlbumLogger.instance= new AlbumLogger();
}
}
}
return AlbumLogger.instance;
} | 2 |
public void stopPoint(String name) {
if (this.goalMap.containsKey(name)) {
Calculator cal = (Calculator) this.goalMap.get(name);
cal.setStopTime(Calendar.getInstance().getTimeInMillis());
} else {
log.error("沒有==" + name + "==的進入點");
}
} | 1 |
public void tickServer() {
update++;
if (!isLoaded())
ticksExisted++;
else if (update % PAIR_CHECK_INTERVAL == 0)
validatePairings();
} | 2 |
public boolean setBothParameter(String value,String value2)
{
if(type[0]!=null)
{
try
{
if(type[0].equals("int"))
{
number[0]=Integer.parseInt(value);
}else if(type[0].e... | 8 |
public void update(){
if(isDead() && Game.SECONDS >= respawnTimer){
if(canRespawn()){
respawn();
}else{
respawnTimer += 3;
}
}
if(isDead() && loot.size() == 0 && visible){
visible = false;
solid = false;
}
} | 6 |
public synchronized static BaseReader create(SourceSwitcher switcher) throws ReaderConfigException {
BaseReader reader = null;
Class<?> cluss = null;
String name = switcher.toString();
try {
createByConfig(name);
if(name.equals("NotificationSystem")){
cluss = XOIReader.class;
reader = (BaseReader... | 5 |
public void scan(int posX, int posY, int Range){
radarCheck.clear();
for (int i = 0; i < ocean.submarines.size() ; i++){
CoordinatesServer point = new CoordinatesServer(posX, posY, ocean.submarines.get(i).depth);
if ((ocean.submarines.get(i).posX <= (posX+Range) && ocean.submarin... | 7 |
public static String ParseDisplayName(Player p)
{
PermissionManager manager = null;
String displayNameFormat = "%prefix%player%suffix";
if(Bukkit.getServer().getPluginManager().isPluginEnabled("PermissionsEx")) manager = PermissionsEx.getPermissionManager();
if(Bukkit.getServer().get... | 3 |
private void cache(final long chunk, final Region region) {
final long existing = this.references.put(region, this.references.get(region) + 1);
if (existing == 0) this.catalog.registerOptions(region);
Set<Region> loaded = this.cache.get(chunk);
if (loaded == null) loaded = new HashSet<R... | 4 |
public static void main(String[]args) {
if(args != null){
if(args.length>0){
username = args[0];
}
if(args.length>1){
sessionId = args[1];
}
}
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() ... | 3 |
public static List<Planet> interestingPlanets(PlanetWars pw){
List<Planet> asw = new ArrayList<Planet>();
for (Planet p : pw.NotMyPlanets()){
if (p.NumShips()<p.GrowthRate()*2) // We've got 2 turns before an eventual attack; that's why rentability is calculated that way
asw.a... | 3 |
public static void createFile() throws FileNotFoundException {
Scanner in = new Scanner(System.in);
System.out.println(">Enter your new file name:");
String fileName = in.nextLine() + ".txt";
boolean exist = false;
String[] files = FileLister.getFilesArrayString();
for (int i = 0; i < files.length; i++) ... | 3 |
public String patch_addPadding(LinkedList<Patch> patches) {
short paddingLength = this.Patch_Margin;
String nullPadding = "";
for (short x = 1; x <= paddingLength; x++) {
nullPadding += String.valueOf((char) x);
}
// Bump all the patches forward.
for (Patch aPatch : patches) {
aPatc... | 8 |
public static void main(String[] args) {
System.out.println("Введіть к-сть значень --> ");
Scanner in = new Scanner (System.in);
int kst = in.nextInt();
int fn1=1, fn2=1, fn=0;
System.out.print(fn1+" "+fn2+" ");
for (int i=0; i<kst; i++) {
fn = fn2 + fn1;
fn2 = fn1;
fn1 = fn;
System.out.print(fn... | 1 |
@Override
public void update(GameContainer gc, StateBasedGame sbg, int delta) throws SlickException {
Input input = gc.getInput();
if(input.isKeyPressed(Input.KEY_ENTER)) {
sbg.enterState(Main.States.Play.ordinal());
}
} | 1 |
public void actionPerformed(ActionEvent e) {
// Construct the regular grammar.
RightLinearGrammar grammar = (RightLinearGrammar) environment
.getGrammar(RightLinearGrammar.class);
if (grammar == null)
return;
if (grammar.getProductions().length == 0) {
JOptionPane.showMessageDialog(Universe
.fram... | 3 |
public void deletePage(int i) {
if (this.numPages == 0) {
return;
}
this.pages.get(i).destroyPage();
this.pages.remove(i);
for (int x=0; x < this.pages.size(); x++) {
this.pages.get(x).setIndex(x);
}
this.numPages--;
this.curPage--... | 7 |
public String prettyPrint() {
String result = "";
for (int i = 0; i < 2; i++) {
for (int j = 0; j < 2; j++) {
boolean b1 = i == 0 ? false : true;
boolean b2 = j == 0 ? false : true;
List<Boolean> symbols = new ArrayList<Boolean>();
symbols.add(b1);
symbols.add(b2);
result += "P(" + b2 +... | 9 |
private String[] getScannedLine(Scanner scanner){
String line = scanner.nextLine();
line = line.replace("/", "");
line = line.replace("\\", "");
line = line.replace("_", "");
line = line.replace(" ", "");
line = line.replace("\t", "");
if(line.equals("")){
ignoredLines++;
return new String[0];
}
Stri... | 1 |
public void mouseReleased(MouseEvent e) {
} | 0 |
public void gameLoop()
{
while(1==1)
{
System.out.println(theTime.getParsedTimeDay()); //Show current time and day before...
System.out.println("You are in " +thePlayer.currentLocation.name +" - " +thePlayer.currentLocation.room); //...Showing the current location.
... | 1 |
private void btnBookMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnBookMouseClicked
// TODO add your handling code here:
SimpleDateFormat format = new SimpleDateFormat("dd-MM-yyyy");
try{
Calendar start = GregorianCalendar.getInstance();
start.setTime(f... | 3 |
public static void initDisplay() {
// Get the original display mode (the display mode before the program is
// run)
origDisplayMode = Display.getDisplayMode();
System.out.println("RacingApp.initDisplay(): Current display mode is: "
+ origDisplayMode);
try {
// If the program settings indicate it to u... | 9 |
public void updateThisField (JTextField textField, boolean updateRemaining)
{
try {
tempLong = usFormat.parse(textField.getText()).longValue();
textField.setText(usFormat.format(tempLong));
switch (textField.getName())
{
case "Screen Cups":
todaysBean.setAvailableScreenCups(tempLong);
break... | 8 |
@Override
public double score(NewsEvent event, long forecast) {
String content = event.getContent();
Matrix pdv = index.getPseudoDocumentVector(tokenizer.tokenize(content));
Matrix similarity = matrix.mtimes(pdv);
Matrix delta = MatrixFactory.dense(1, news.size());
for(int i = 0; i < news.size(); i++) ... | 9 |
@Override
public void draw(Graphics g)
{
Tile tile = super.getTile();
int x = tile.getWidth() * tile.getXPos();
int y = tile.getHeight() * tile.getYPos();
//g.setColor(Color.RED);
//g.fillOval(x, y, tile.getWidth(), tile.getHeight());
try
{
BufferedImage img =... | 7 |
private void ElseIfStatement(boolean ran) {
nextToken();
ArrayList<Token> exp = LogicalExpression();
ArrayList<Token> stmts = getStatements();
if(exp == null || stmts == null) {
return;
}
BooleanParser bp = new BooleanParser(exp);
boolean run = bp.getAnswer();
if(run && !ran) {
StatementsPa... | 9 |
public ArrayList<Polynomial> multiplyExpressions(ArrayList<Polynomial> expression1, ArrayList<Polynomial> expression2) {
int sizeOfExpressions = expression1.size() + expression2.size();// Size of the result array, needs to be dynamically sized
int k = 0;//Index of the result
ArrayList<Polynomial> temp = new Ar... | 7 |
public static void main(String[] args) throws Exception {
int sendport = 6001;
DatagramSocket socket = new DatagramSocket(6001);
long server_isn = 9000L;
long mws = 0L;
long mss = 0L;
String filename = null;
long sendbase = 0L;
TreeSet<MyPacket> windows = new TreeSet<MyPacket>();
long originalbase = 0... | 8 |
public void saveStatusBlocks(){
if (customConfigurationFile == null) {
customConfigurationFile = new File(plugin.getDataFolder(), "status.yml");
}
customConfig = new YamlConfiguration();
List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
for (Location blockLoc : plugin.statusBlock... | 5 |
private int c2i(char c) {
switch (c) {
case '1':
return 1;
case '2':
return 2;
case '3':
return 3;
case '4':
return 4;
case '5':
return 5;
case '6':
return 6;
case '7':
return 7;
case '8':
return 8;
case '9':
return 9;
}
return 0;
} | 9 |
public static Boolean getBoolParam(SessionRequestContent request, String name) {
String param = (String) request.getParameter(name);
if (param != null && !param.isEmpty()) {
Boolean currParam = Boolean.parseBoolean(param);
return currParam;
}
return null;
} | 2 |
ClosedArea append(LineSegmentInt other) {
if (isClosed()) {
throw new IllegalStateException();
}
if (getSegments().contains(other)) {
throw new IllegalArgumentException();
}
final ClosedArea result = new ClosedArea();
for (LineSegmentInt seg : segmentsList) {
result.addSegment(seg);
}
if (resul... | 9 |
@Test
public void gameIsResetted()
{
rp.resetGame();
assertTrue(rp.getEntities().getList(Rat.class).size() == 1 &&
rp.getEntities().getList(Ball.class).size() == Const.ballAmountInFirstLevel &&
rp.getEntities().getList(Cheese.class).size() == Const.cheeseamount &&... | 4 |
public ChatMessage[] loadMessages(ChatChannel channel, Date joinDate){
ChatMessage[] chatMessages = null;
try {
Socket socket = new Socket(SERVER_ADDRESS_CHAT, CHAT_PORT);
socket.setSoTimeout(TIMEOUT);
OutputStream outputStream = socket.getOutputStream();
ObjectOutputStream objectOutputStream = ... | 3 |
public static void generateInvertedIndex(boolean includeApproximateMatches, String tokenizationType, File directory) { //NB Change nGramSize to tokenizationType
dictionaryMap.clear();
inverseDocFreqMap.clear();
//read all files in a directory
//http://stackoverflow.com/questions/491732... | 7 |
public void setPortBLabels(int t) {
int a = t & 0b00000001;
int b = t & 0b00000010;
int c = t & 0b00000100;
int d = t & 0b00001000;
int e = t & 0b00010000;
int f = t & 0b00100000;
int g = t & 0b01000000;
int h = t & 0b10000000;
if (a > 0) {
label_45.setText("1");
} else {
label_45.setText("0")... | 8 |
@Override
protected boolean isValueAcceptable(String key, String bdbValue, String hadoopValue) {
if (bdbValue.equals(hadoopValue)) {
return true;
}
String[] bdbValueSplitContents = bdbValue.split(AnalyseConstants.FINAL_VALUE_SPLITTER);
String[] hadoopValueSplitContents = ... | 9 |
private void writeObject(JSONObject jsonobject) throws JSONException {
// JSONzip has two encodings for objects: Empty Objects (zipEmptyObject) and
// non-empty objects (zipObject).
boolean first = true;
Iterator keys = jsonobject.keys();
while (keys.hasNext()) {
if (probe) {
... | 6 |
private void checkRight(int x, int y) {
boolean test = false;
if (test || m_test)
System.out.println("ConnectFour::checkRight() - BEGIN");
Grid grid = getGrid();
Game.PlayerTurn Player = grid.getCoordinate(x, y).getValue();
if (Player != Game.PlayerTurn.NONE) {
if (x < GAME_WIDTH - COUNT3) {
if ((g... | 9 |
public void abrir() throws Exception {
if(id.length() > 0 && !id.equals("0")){
long cod = Long.parseLong(id);
if(venda == null || (venda != null && venda.getId() != cod ) )
setVenda(ejb.Open(cod));
}
} | 5 |
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.