text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void start() {
if (driving)
return;
(new Thread() {
public void run() {
driving = true;
while (driving) {
move();
yield(); // prevent consuming all CPU resources
}
}
}).start();
} | 2 |
public String getEncoded() {
if (padding == PaddingType.Number && StringUtils.isBlank(original)) {
return StringUtils.leftPad(StringUtils.EMPTY, size).substring(0, size);
}
if (padding == PaddingType.Number) {
return StringUtils.leftPad(original, size, "0").substring(0, size);
}
if (padding == Padding... | 8 |
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
System.out.println("================================");
for(int i=0;i<3;i++)
{
String s1=sc.next();
int x=sc.nextInt();
int length = String.valueOf(x).length();
... | 4 |
private void idNotificationCompletnessTest(){
List<String> notificationIdListFromNotificationSys = new ArrayList<String>();
List<String> notificationIdListFromNetezza = new ArrayList<String>();
this.IdType = this.reader.getIdType();
this.MessageType = this.reader.getMessageType();
String nodeName = "Id";
St... | 9 |
public Wave36(){
super();
MobBuilder m = super.mobBuilder;
for(int i = 0; i < 1200; i++){
if(i % 17 == 0)
add(m.buildMob(MobID.TENTACRUEL));
else if(i % 6 == 0)
add(m.buildMob(MobID.HORSEA));
else if(i % 5 == 0)
add(m.buildMob(MobID.TENTACOOL));
else if(i % 4 == 0)
add(m.buildMob(MobID... | 7 |
private void agendaItemMenu(int itemid, int meetingId) throws IOException, ClassNotFoundException {
String opt = "";
while (!("0".equals(opt))) {
System.out.println("You are now in the item " + itemid + " room\n");
System.out.println("You may now receive messages from other memb... | 7 |
public void testMixed() throws IOException {
System.out.println("testMixed");
RecordManager recman = newRecordManager();
HashDirectory dir = new HashDirectory((byte)0);
long recid = recman.insert(dir,HashNode.SERIALIZER);
dir.setPersistenceContext(recman, recid);
Hashta... | 8 |
TreeNode next() {
TreeNode head = queue.poll();
if (head.left != null)
queue.offer(head.left);
if (head.right != null)
queue.offer(head.right);
return head;
} | 2 |
public void turnSymbol() {
Random generator = new Random();
int x = generator.nextInt(100);
if (x < 10) // 10% chance will get 7
{
this.setID(1);
this.setIcon(new ImageIcon(getClass().getResource(
"resources/Seven2.png")));
value = 10;
} else if (x < 25) // 15% chance will get Bar
{
this... | 4 |
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line = "";
diffWays(30002);
d: do {
line = br.readLine();
if (line == null || line.length() == 0)
break d;
double amount = Double.parseDouble(line);
int ra... | 5 |
public LambdaProductionRemover() {
} | 0 |
@Override
public String toString() {
return "fleming.entity.Paciente[ inhusa=" + inhusa + " ]";
} | 0 |
@SuppressWarnings("unchecked")
public void setSortingStatus(int column, int status)
{
Directive directive = getDirective(column);
if (directive != EMPTY_DIRECTIVE)
{
sortingColumns.remove(directive);
}
if (status != NOT_SORTED)
{
sortingColumns.add(new Directive(column, status));
}
sortingStatus... | 2 |
public String toString() {
return Thread.currentThread() + ": " + countDown;
} | 0 |
public void run() {
try {
while(!stop) {
if(control.shouldUpdate()) {
int selRow = sM.getSelectedRowNumber();
sM.updateTable();
//if a Row was selected select it again
if(selRow > -1) {
sM.setSelectedRow(selRow);
}
control.setUpdateView(false);
}
Thread.sleep(250);
... | 4 |
public static void main(String[] args) {
System.out.println(s.replaceFirst("f\\w+", "located"));
System.out.println(s.replaceAll("shrubbery|tree|herring", "banana"));
} | 0 |
public List<Claim> getClaimList() {
List<Claim> claimList = new ArrayList<Claim>();
Element claimE;
Claim claim;
for (Iterator i = root.elementIterator("claim"); i.hasNext();) {
claimE = (Element)i.next();
if (claimE.element("isDelete").getText().equals("false")) {
String id = claimE.element("id").get... | 3 |
public AbstractOutlineIndicator(OutlinerCellRendererImpl renderer, String toolTipText) {
this.renderer = renderer;
setVerticalAlignment(SwingConstants.TOP);
setOpaque(true);
setVisible(false);
setToolTipText(toolTipText);
updateIcon();
} | 0 |
public String publicMethod()
{
return "public";
} | 0 |
public static char randBase(Random random) {
switch (random.nextInt(4)) {
case 0:
return 'A';
case 1:
return 'C';
case 2:
return 'G';
case 3:
return 'T';
default:
throw new RuntimeException("This should never happen!");
}
} | 4 |
public static void main(String[] args) {
ExecutorService exec = Executors.newCachedThreadPool();
ArrayList<Future<String>> results = new ArrayList<Future<String>>();
for (int i = 0; i < 10; i++)
results.add(exec.submit(new TaskWithResult(i)));
for (Future<String> fs : results)
try {
// get() blocks un... | 4 |
public void run() {
long nextFrameTicks = System.currentTimeMillis();
int framesSkipped;
float interpol;
while (running) {
framesSkipped = 0;
// Profiler.start();
while ((System.currentTimeMillis() > nextFrameTicks) && (framesSkipped < MAX_FRAMESKIP)) {
updateTime = System.nanoTime();
update(... | 3 |
public static int countInstances(String s, char c){
int count=0;
for (int i=0; i<s.length(); i++)
if (s.charAt(i) == c)
count++;
return count;
} | 2 |
public void addOrigin(ISO3Country origin) {
if (this.origin == null) {
this.origin = new ArrayList<ISO3Country>();
this.origin.add(origin);
} else {
this.origin.add(origin);
}
} | 1 |
public void destroy(String id) throws IllegalOrphanException, NonexistentEntityException, RollbackFailureException, Exception {
EntityManager em = null;
try {
em = getEntityManager();
em.getTransaction().begin();
Servidor servidor;
try {
se... | 7 |
@Override
public void takeInfo(InfoPacket info) throws Exception {
super.takeSuperInfo(info);
Iterator<Pair<?>> i = info.namedValues.iterator();
Pair<?> pair = null;
Label label = null;
while(i.hasNext()){
pair = i.next();
label = pair.getLabel();
switch (label){
case elec:
electrisityGenerat... | 4 |
public final static void main(String[] args) {
for (int i = 0; i < 20; i++) {
try {
Control.current = new Instance(args);
current.run();
} catch (FatalError e) {
Output.println(e.getMessage() + "\n", 0);
System.exit(1);
} catch (RestartLater e) {
if (e.getMessage() == null || e.getMessage... | 8 |
@SuppressWarnings({"unchecked","deprecation"})
public static void main(String[] args)
{
Map map = new TreeMap();
Date date = new Date();
map.put("1", date);
System.out.println(date.toLocaleString());
} | 0 |
private String action(String[] messageList, String address, String message) throws SQLException {
String msg0 = messageList[0].toLowerCase();
String msg1 = messageList[1].toLowerCase();
String reply = "";
if (msg0.equals("reg")) {
DBServices.findUser("SELECT * from automart w... | 9 |
public static void main(String[] args) {
HashMap<String, Integer> comptadors = new HashMap<String, Integer>();
String[] arrayParaules = { "Algu", "Pop", "Pilotilla", "Pilota",
"Romba", "Toyota", "Swag", "Meme", "Java", "Rom", "Majordom",
"Xavier", "Oli", "Algu", "Pop", "Java", "Java" };
for (String au... | 3 |
public void LogOut(String userName) {
try {
print("User Log-out from the system.");
driver.findElement(By.partialLinkText(userName)).click();
waitTillElementLoad(By.linkText("Logout"));
driver.findElement(By.linkText("Logout")).click();
print("Successf... | 1 |
public static void PlayerPerksInventory(Player player) {
// get a list of all perks
List<?> PerkList = GChub.getPlugin().getMainConfig().getList("PerkList");
// get player name
String PlayerName = player.getName().toString();
// get player rank
String AllPlayerRanks = "";
String PlayerRank = null... | 5 |
public static List<Game> getGamesList() {
List<Game> gamesList = new ArrayList<Game>();
boolean isLetPointEnabled = false;
for (int i = 1; i <= HOW_MANY_GAMES_YOU_WANT_TO_SET_UP; i++) {
String gameIdString = "game" + i;
// 设置这场比赛的赔率
List<Rate> ratesList = new ArrayList<Rate>();
for (int j = 1; j <= ... | 5 |
public List<Challenge> getPublicChallengeList(String parentId) {
List<Challenge> challengeList = new ArrayList<Challenge>();
Element challengeE;
Challenge challenge;
for (Iterator i = root.elementIterator("challenge"); i.hasNext();) {
challengeE = (Element)i.next();
if (challengeE.element("isDelete").getT... | 4 |
@FXML
private void deleteUplan() {
this.mainApp.confirmMeldung("Soll wirklich gelöscht werden?");
if (this.detailsUmlaufTable.getSelectionModel().getSelectedItem() != null) {
Umlaufplan umlaufplan = this.detailsUmlaufTable.getSelectionModel()
.getSelectedItem();
this.dbm.deleteUmlaufplan(umlaufplan);
... | 5 |
public int handSize() {
return size;
} | 0 |
public int getPort() {
return port;
} | 0 |
private LinkedList processStorm(NOAAHurricaneData noaa, String stormName)
throws Exception
{
if(log.isDebugEnabled())
log.debug("Storm:" + stormName);
LinkedList centers = null;
try {
centers = noaa.getStormCenters(stormName);
} catch (MalformedURLException e) {
e.printStackTrace();
throw new Ex... | 6 |
private String findServiceForDictionary(String dictionaryName)
{
for (Iterator<ServiceInfo> iter = _services.values().iterator(); iter.hasNext();)
{
ServiceInfo service = iter.next();
// stop, if serviceState is DOWN (0) or not available
Object oServiceState = se... | 8 |
public boolean set(int i, T pData) {
if (i >= this.length)
return false;
Node<T> ele = _head;
for (int x = 0; x < i; x++)
ele = ele.getNext();
ele.setData(pData);
return true;
} | 2 |
public void check(Sorter sorter) {
int[] a = {4,7,1,8,5}, a0 = {1,4,5,7,8};
int[] b = {1,2,3,4}, b0 = {1,2,3,4};
int[] c = {6,6,0,9,1,7}, c0 = {0,1,6,6,7,9};
int[] d = {1}, d0 = {1};
a = sorter.sort(a);
b = sorter.sort(b);
c = sorter.sort(c);
d = sorter.s... | 4 |
@Override
public void mousePressed(MouseEvent me) {
if (me.getPoint().x < 800 && me.getPoint().y < 800) {
if (this.echiquier.getPieceCase(((ChessFrame) this.fenetre).getCoord(me.getPoint())) != null) {
if (this.echiquier.getPieceCase(((ChessFrame) this.fenetre).getCoord(me.getPo... | 4 |
public static boolean chkCol(char[][] arr,int col){
boolean res = true;
Set<Character> set = new HashSet<>();
for(int i=0;i<arr.length;i++){
if(arr[i][col]!='.') {
if (set.contains(arr[i][col])) {
if(log){
prints(set);
System.out.println("i "+i+",col "+col+","+arr[i][col]);
}
res... | 4 |
@Override
public void execute() {
String msg = Widgets.get(13, 28).getText();
if (msg.contains("FIRST")) {
Widgets.get(13, Character.getNumericValue(Settings.pin[0]) + 6).click(true);
Task.sleep(750, 1200);
}
if (msg.contains("SECOND")) {
Widgets.get(13, Character.getNumericValue... | 4 |
@Override
public void insertString(FilterBypass fb, int offset, String string,
AttributeSet attr) throws BadLocationException {
StringBuilder builder = new StringBuilder(string);
for (int i = builder.length() - 1; i >= 0; i--) {
int cp = builder.codePointAt(i);
if (!Character.isDigit(cp) && cp != '.' && c... | 5 |
public SequenceIterator getTypedValue() throws XPathException {
switch (getNodeKind()) {
case Type.COMMENT:
case Type.PROCESSING_INSTRUCTION:
return SingletonIterator.makeIterator(new StringValue(stringValue));
case Type.TEXT:
case Type.DOCUMENT:
... | 9 |
public static <T> Iterable<T> filter(Iterable<? extends T> c, Predicate<? super T> p) {
List<T> result = new ArrayList<T>();
for (T e : c) {
if (p.apply(e)) {
result.add(e);
}
}
return result;
} | 4 |
private String inverseLetters(String str){
String returnValue = new String(), c = new String();
if(str.length()>0){
for(int i=0;i<str.length();i++){
c = str.substring(i,i+1);
if(c.equalsIgnoreCase("A")){
returnValue+="T";
}//END IF
if(c.equalsIgnoreCase("T")){
returnValue+="A";
}//E... | 6 |
public int setPage(int page) {
if (select == null) {
return -1;
}
int nbpage = getPageCount();
if (nbpage > 0) {
if (page > 0 && page < getPageCount()) {
currentPage = page - 1;
currentRows = getNbRow();
try {
this.curRows = this.database.getRows(select, currentPage * rowperpage, currentR... | 9 |
public Unit(int x, int y, Sprite sprite, int MOV, int TEAM)
{
this.x = this.pX = x;
this.y = this.pY = y;
this.dX = x * Game.TILESIZE;
this.dY = y * Game.TILESIZE;
this.sprite = sprite;
this.mov = MOV != -1 ? MOV : 5; //Defaults to 5
this.team = TEAM;
... | 2 |
private int getType(Object a) {
while (a.getClass().isArray()) {
a = Array.get(a, 0);
}
if (a instanceof Byte) {
return 1;
}
if (a instanceof Boolean) {
return 2;
}
if (a instanceof Short) {
return 3;
}
... | 9 |
@Override
public List<Livro> listAll() {
Connection conn = null;
PreparedStatement pstm = null;
ResultSet rs = null;
List<Livro> livros = new ArrayList<>();
try{
conn = ConnectionFactory.getConnection();
pstm = conn.prepareStatement(LIST);
... | 3 |
@Override
public void unInvoke()
{
// undo the affects of this spell
if(!(affected instanceof MOB))
return;
final MOB mob=(MOB)affected;
if((mob.isMonster())&&(mob.amDead())&&(!canBeUninvoked()))
super.canBeUninvoked=true;
super.unInvoke();
if(canBeUninvoked())
if((mob.location()!=null)&&(!mob... | 7 |
public void nestPartInScene(String viewName)
{
Resource resView = this.applicationContext.getResource(MessageFormat.format("views/modules/{0}.fxml", viewName));
Resource resLang = this.applicationContext.getResource(MessageFormat.format("views/modules/{0}.properties", viewName));
try
... | 4 |
public void checkName(Draggable d) { //Checks the name of the Draggable and creates a new one of that type of Draggable
if (d.name == "Lake") {
createLake();
} if (d.name == "Crater") {
createCrater();
} if (d.name == "Archer") {
createArcher();
} if (d.name == "Warrior") {
createWarrior();
} if ... | 5 |
public void paint(Graphics g) {
// This test is necessary because the swing thread may call this
// method before the simulation calls SwingAnimator.update()
if (_painter != null ) {
// The clearRect is necessary, since JPanel is lightweight
g.clearRect(0, 0, _width, _height);
... | 1 |
public void tick(World world, int delta) {
if (this.alive) {
// Update the equipped weapon (if there is a weapon equipped)
if (this.weapon != null) this.weapon.tick(this, world, delta);
// Shoot if the player is detected
if (this.detect()) this.weapon.shot(world, this.weapon.getDelay().getDuration() +... | 5 |
private void notifyListeners()
{
for (QuestionListener listener : listeners)
listener.onQuestionChange(question);
} | 1 |
public static int search3(int[] a, int p, int r) {
int x = a[p];
int i = p + 1;
int j = r;
while (true) {
while (j >= p && a[j] > x) {
j--;
}
while (i <= r && a[i] < x) {
i++;
}
if (i < j) {
swap(a, i, j);
} else {
swap(a, p, j);
return j;
}
}
} | 6 |
public static ProtocolChatMessage getProtocolChatMessage(String inString)
throws TagFormatException, JDOMException, IOException {
SAXBuilder mSAXBuilder = new SAXBuilder();
Document mDocument = mSAXBuilder.build(new StringReader(inString));
Element rootNode = mDocument.getRootElement();
String protType = ro... | 4 |
@BeforeClass
public static void setUpBeforeClass() throws Exception {
testImage = new BufferedImage(9, 9, BufferedImage.TYPE_INT_RGB);
for(int x = 3; x < 6; ++x) {
for(int y = 3; y < 6; ++y) {
testImage.setRGB(x, y, 0xFFFFFF);
}
}
} | 2 |
private void db(final String s) {
if (FlowGraph.DEBUG || FlowGraph.DB_GRAPHS) {
System.out.println(s);
}
} | 2 |
public Tree(HuntField field) {
boolean searchPosition = true;
Position position;
while (searchPosition){
position = new Position(new Random().nextInt(field.getXLength()), new Random().nextInt(field.getYLength()));
if(field.setItem(this,position)){
searchPo... | 2 |
public static boolean purgeDB()
{
boolean a, b;
a = db.Query("DROP TABLE `database`");
b = db.Query("CREATE TABLE IF NOT EXISTS `database` (signurl varchar(20), url varchar(164))");
CustomFunction.addLink("Author Site", "http://www.willhastings.net", true);
if(a == b) return true;
else return false;
} | 1 |
protected void moveLeft() {
if (this.posX > 0 && !(this.posY == this.enemyPosY && (this.posX-1) == this.enemyPosX) && !(BattleBotsGUI.instance.obstacles[this.posX-1][this.posY])) {
this.posX--;
}
} | 4 |
public void move(Input input, Rectangle[] walls, int delta){
Rectangle attempt = container;
if (input.isKeyDown(Input.KEY_UP))
{
sprite = up;
attempt.setLocation(absolutex,absolutey - delta * 0.1f);
if (!collision(attempt,walls)){
absolutey -... | 8 |
@Test
public void layerIteratorTest() {
int traversed = 0;
int backtracked = 0;
LayerIterator iter = new LayerIterator(networkLinear);
while (iter.hasNext()) {
List<? extends Neuron> layer = iter.next();
assertNotNull(layer);
if (iter.hasPrevious()) {
iter.previous();
assertEquals(layer, iter.... | 6 |
public List<Meeting> xmlToList() throws Exception {
List<Meeting> meetingList = new ArrayList<Meeting>();
try{
XMLInputFactory inputFactory = XMLInputFactory.newInstance();
InputStream in = new FileInputStream("meetings.xml");
XMLEventReader eventReader = inputFactory.createXMLEventReader(in);
//... | 9 |
private PrintWriter getPrintWriter()
{
if(this.currentLogFile == null && this.filePath != null)
{
try {
return new PrintWriter(this.filePath);
} catch (Exception e) {
e.printStackTrace();
}
}
return this.currentLogFile;
} | 3 |
public void initMenu()
{
comps.add(new UILabel("Connecting to server: "+serverIP, w/2, h/2, LabelAlignment.CENTERED).setColor(0xFFFFFF));
backButton = new UIButton(this, w/2-75, h/2-30, 150, 30,"Cancel");
comps.add(backButton);
if(!connecting)
new Thread(new Runnable()
... | 5 |
protected void interrupted() {
end();
} | 0 |
public boolean doesThreaten(Point p) {
char c = aiarr[(int) p.getX()][(int) p.getY()].toString().charAt(0);
if (c == 'B')
c = 'W';
else
c = 'B';
checkThreats(gameBoard, c);
for (int i = 0; i < numThreatening; i++) {
if (locThreatening[i].getX() == p.getX() && locThreatening[i].getY() == p.getY()) {
... | 4 |
private ConfigValues(String key, Object def) {
this.key = key;
this.def = def;
} | 0 |
@Override
public Line getNextFromTextIntro() {
if (this.getIndex() < ((TextIntroImp) this.getParent()).getLineNb() - 1) {
return ((TextIntroImp) this.getParent())
.getLine(this.getIndex() + 1);
} else {
if (((TextIntroImp) this.getParent()).getParent() instanceof DocumentImp) {
Document doc = ((Docu... | 4 |
public Object invoke(Object proxy, Method method, Object[] args)
throws Throwable {
try {
if (method.getName().equalsIgnoreCase("setService")) {
this.setService(args[0]);
return null;
} else if (method.getName().equalsIgnoreCase("unsetService")) {
this.unsetService(args[0]);
return null;
}... | 7 |
public void stop() {
try {
mServerSocket.close();
} catch (IOException e) {
}
for (Messenger messenger : mConnectedClients) {
messenger.stop();
}
mConnectedClients.clear();
try {
mServerThread.join();
} catch (InterruptedException e) {
}
} | 3 |
public ParseTree addChild(ParseTree parseTree) {
ParseTree[] newChildren = new ParseTree[children.length + 1];
for(int i = 0; i < children.length; i++)
newChildren[i] = children[i];
newChildren[newChildren.length - 1] = parseTree;
children = new ParseTree[newChildren.length];
for(int i = ... | 2 |
public void setModeleJComboBoxVisiteur(DefaultComboBoxModel modeleJComboBoxVisiteur) {
this.modeleJComboBoxVisiteur = modeleJComboBoxVisiteur;
} | 0 |
@Override
public void ParseIn(Connection Main, Server Environment)
{
Environment.InitPacket(620, Main.ClientMessage);
Environment.Append(true, Main.ClientMessage); // gift wrapping Enabled?
Environment.Append(1, Main.ClientMessage); // gift wrapping Cost
Environment.Append(10,... | 3 |
public void release(HGPersistentHandle handle)
{
if (slots.isEmpty() || graph.getHandleFactory().nullHandle().equals(handle))
return;
HGPersistentHandle [] layout = graph.getStore().getLink(handle);
if (layout == null)
// this is fishy, a sys print out like this,... | 8 |
@Override
public boolean execute(MOB mob, List<String> commands, int metaFlags)
throws java.io.IOException
{
if(mob.findTattoo("SYSTEM_MPRUNDOWN")!=null)
return CMLib.commands().handleUnknownCommand(mob, commands);
MOB checkMOB=mob;
if(commands.size()>1)
{
final String firstParm=commands.get(1);
fi... | 7 |
public static void main(String[] args) {
// TODO code application logic here
boolean validar = true;
double valor1 = 0;
double valor2 = 0;
double resultado;
char continuar;
int opcion = 0;
Scanner teclado = new Scanner(System.in);
Operaciones_ aOpe... | 9 |
private boolean updateTime(Time oldTime, Time newTime) {
boolean saved = false;
try {
Connection conn = Dao.getConnection();
// Check that the fields are not null and that the duration is greater than 1 minute.
if (newTime.isFullFilled() && newTime.getDuration() >= MINIMUM_TIME_DURATION) {
int updat... | 5 |
public final static double roundIt(double number, double tick)
{
final String rounded = roundItAsString(number, tick);
try
{
if (rounded != null)
{
return Double.parseDouble(rounded);
}
else
{
// LOGGER.warn("roundItAsString returned null for {} and {}", number, tick);
}
}
catch (NumberFor... | 2 |
Node findCycle() {
Node tortoise = this.next;
Node hare = this.next.next;
while(tortoise != hare) {
tortoise = tortoise.next;
hare = hare.next.next;
}
tortoise = this;
while(tortoise != hare) {
tortoise = tortoise.next;
... | 2 |
@Test
public void testMain() throws Exception {
} | 0 |
@Override
public boolean onCommand(CommandSender sender, Command cmd, String lable, String[] arg) {
if (cmd.getName().equalsIgnoreCase("hotstreak") || cmd.getName().equalsIgnoreCase("hs")) {
//If command sent from console
if (!(sender instanceof Player)) {
//Notify how to use console command
... | 4 |
public void panic() {
for (int x = 0; x < width; x++) {
if (random.nextBoolean()) {
for (int y = 1; y < height; y++) {
if (get(x, y)) {
set(x, y - 1, true);
}
}
}
}
} | 4 |
private Element getStockByIdentifier(String identifier) {
NodeList nl = doc.getDocumentElement().getElementsByTagName("stock");
for (int i = 0; i < nl.getLength(); i++) {
Element e = (Element) nl.item(i);
if (e.getAttribute("identifier").equals(identifier)) {
retu... | 2 |
public static void addSingleItemCentered(JComponent component, Container container) {
LayoutManager layout = container.getLayout();
component.setMaximumSize(component.getPreferredSize());
if (layout instanceof GridBagLayout) {
GridBagLayout gridbag = (GridBagLayout) layout;
c.weighty = 0;
c.wei... | 1 |
public List<String> completeBrokenLimbNameSet(Environmental E)
{
final Vector<String> V=new Vector<String>();
if(!(E instanceof MOB))
return V;
final MOB M=(MOB)E;
final int[] limbs=M.charStats().getMyRace().bodyMask();
for(int i=0;i<limbs.length;i++)
{
if((limbs[i]>0)&&(validBrokens[i]))
{
if... | 7 |
@Override
public boolean createDataConnectionToInputPort(final String portName, LockPolicy lockPolicy, Object client) throws WrongPortTypeException{
OrocosDataPort port = getPort(portName);
if(port.getPortType() == PortType.OUTPUT_PORT){
throw new WrongPortTypeException(port.getPortType());
}
if(inputPortCo... | 6 |
protected void send(RoomEvent event) {
if(event instanceof JoinEvent) {
if(((JoinEvent)event).getType()==JoinEvent.EVENT_JOIN) {
// we need to send a "Joined..." messahge to IRC and to the channel.
processEvent(new JoinEvent(this,JoinEvent.EVENT_JOIN,23,((JoinEvent)event).getName()));
processEvent(new ... | 9 |
protected void write(String str)
{
if (!record_) {
return;
}
if (num_ == null || history_ == null)
{
// Creates the history or transactions of this Gridlet
newline_ = System.getProperty("line.separator");
num_ = new DecimalFormat("#0.0... | 3 |
private void createThreeSliders() {
if (triSliderPanel != null)
return;
triSliderPanel = new JPanel(new SpringLayout());
String s = MolecularContainer.getInternationalText("XComponent");
xSlider = createSlider(originalVector == null ? 0 : originalVector.x, s != null ? s : "x-component");
triSliderPanel.add... | 7 |
public static Configuration fromFile(String filename) {
Configuration c = null;
InputStream i = null;
try {
Properties prop = new Properties();
i = new FileInputStream(filename);
prop.load(i);
String picname = prop.getProperty("picname");
... | 3 |
@POST
@Path("/v2.0/networks")
@Produces(MediaType.APPLICATION_JSON)
public Response createNetwork(final String request) throws MalformedURLException, IOException{
//Convert input object NetworkData into a String like a Json text
Object net;
net = JsonUtility.fromResponseStringToObject(request,ExtendedNetwork.c... | 2 |
public boolean isAce() {
return value == 1;
} | 0 |
public static void main(String args[]){
BufferedReader br = null;
try{
String cLine[];
br = new BufferedReader(new FileReader("graph.txt"));
int nodeNum = Integer.parseInt(br.readLine());
int edgeNum = Integer.parseInt(br.readLine());
//Initialize the vertices
for(int i = 0;i < nodeNum;i++){
e... | 7 |
public static void makeCompactGrid(Container parent,
int rows, int cols,
int initialX, int initialY,
int xPad, int yPad) {
SpringLayout layout;
try {
layout = (SpringLayout)pa... | 7 |
Subsets and Splits
SQL Console for giganticode/java-cmpx-v1
The query retrieves a limited number of text entries within a specific length range, providing basic filtering but minimal analytical insight.