text stringlengths 14 410k | label int32 0 9 |
|---|---|
private boolean isToken(HttpServletRequest request) {
HttpSession session = request.getSession();
String token_cline = request.getParameter("token");
if(token_cline == null){
return false;
}
String token_server = (String) session.getAttribute("token");
if(token_server==null){
return false;
}
... | 3 |
public ParamsParse (String filePath) throws Exception {
// Инициализация объекта
db = new DBParams();
try {
// Откроем файл
File fXmlFile = new File(filePath);
// Подготовим парсер
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newIn... | 5 |
public static List<UserTrend> constructTrendList(Response res) throws WeiboException {
try {
JSONArray list = res.asJSONArray();
int size = list.length();
List<UserTrend> trends = new ArrayList<UserTrend>(size);
for (int i = 0; i < size; i++) {
tre... | 3 |
public void setKey(String key) {
this.key = key;
} | 0 |
public void actionPerformed(ActionEvent e) {
if(e.getSource()==btnDmarrerSimulation){
new Thread(new Runnable() {
public void run() {
controleur.configurerSimulation(genererDonnees(),spinner.getValue().toString());
}
}).start();
}
else if(e.getSource()==btnEditerPosteur){
... | 7 |
public void seCacher()
{
int nombreAtrouver, nombreDuJoueur = 100, nombreEssais = 0;
String nombreString;
nombreAtrouver = (int) (Math.random() * 50);
System.out.println("Pour vous cacher à temps, il faut que vous trouviez le nombre recherche en moins de 5 essais"
... | 6 |
public Context(List tokens, int center, List[] results) {
this.tokens = tokens;
this.center = center;
this.results = results;
} | 0 |
public void edit(int index, String subject, String text, int priority) {
if(index<0 || index==this.size()) { // Reveals if the number exists
return;
}
boolean a;
for(int i = 0; i<this.size(); ++i) {
a = true;
for(int j = 0; j<this.size(); ++j) { // Makes the subject unique
if(subject.equals(get(j).... | 6 |
private void removeBrokenMTWCs(MTWData data) {
Set<Set<Tuple<Integer, Integer>>> set;
if (data.player == playerID) {
set = data.mTWCFP2;
} else {
set = data.mTWCFP1;
}
Iterator<Set<Tuple<Integer, Integer>>> combinations = set.it... | 5 |
public void tableChanged(TableModelEvent e) {
try {
// get the index of the inserted row
// tableModel.getRowSet().moveToCurrentRow();
int firstIndex = e.getFirstRow();
// create a new table model with the new data
tableModel = new ProjectTableModel(tableModel.getList(),
tableModel.getEntityManag... | 1 |
@Override
public Iterator<Integer> iterator()
{
ArrayList<Integer> nonNullProperties = new ArrayList<Integer>();
for (int x = 0; x < this.values.size(); x++)
{
if (values.get(x) != null)
{
nonNullProperties.add(x);
}
}
return nonNullProperties.iterator();
} | 2 |
public static void main(String[] args) {
Collection<Integer> c = new ArrayList<Integer>();
for (int i = 0; i < 10; i++)
c.add(i); // Autoboxing
for (Integer i : c)
System.out.print(i + ", ");
} | 2 |
public boolean addItem(String description, String pwd){
String newItem;
String [] existDesc;
if(description.isEmpty() || description == null || description.length() < 1) return false;
// Create the XML tags and enclose the description and password separated
// by a comma.
... | 9 |
public static boolean accept(AbstractSyntaxNode node, TokenReader reader)
{
boolean result = false;
final Term term = new Term();
if (Factor.accept(term, reader))
{
while (reader.accept(Token.TIMES) || reader.accept(Token.DIVIDE)
|| r... | 4 |
@Override
public void keyPressed(KeyEvent e) {
switch (e.getKeyCode()) {
case KeyEvent.VK_LEFT:
doAction(Action.MOVE_LEFT);
break;
case KeyEvent.VK_RIGHT:
doAction(Action.MOVE_RIGHT);
break;
case KeyEvent.VK_... | 6 |
* @return The double[] that the buffer has been converted into.
*/
private double[] bytesToDoubleArray(byte[] bufferData){
final int bytesRecorded = bufferData.length;
final int bytesPerSample = getAudioFormat().getSampleSizeInBits()/8;
final double amplification = 100.0; // choose a number as you like
... | 4 |
public void transfer(int from, int to, double amount)
{
if (accounts[from] < amount) return;
System.out.print(Thread.currentThread());
accounts[from] -= amount;
System.out.printf(" %10.2f from %d to %d", amount, from, to);
accounts[to] += amount;
System.out.printf(" Total Balance:... | 1 |
@Override
public synchronized void execute(final Runnable r)
{
queue.offer(new Runnable() {
public void run()
{
runs = true;
try
{
r.run();
// to fire up the exception if there was one.
if( r instanceof SwingWorker )
((SwingWorker<?,?>)r).get();
} catch... | 6 |
private void create(String[] args) {
boolean clientOnlyMode = false;
boolean useAWT = false;
System.setErr(System.out);
SplashScreen splashScreen = new SplashScreen("/images/welcome.gif");
splashScreen.setVisible(true);
for (String arg : args) {
if (arg.equ... | 7 |
public void paintComponent( Graphics g )
{
super.paintComponent( g );
Graphics2D g2d = (Graphics2D) g;
for(int i =0; i < NUM; i++)
{
g2d.setColor( pelotas[i].col );
pelotas[i].draw(g2d);
}
g2d.setColor(Color.GRAY);
raqueta.dibuja(g2d);
g2d.setColor(Color.ORANGE... | 3 |
private static boolean isaffected( int[] cellrc, int[] arearc )
{
if( cellrc[0] < arearc[0] )
{
return false; // row above the first ref row?
}
if( cellrc[0] > arearc[2] )
{
return false; // row after the last ref row?
}
if( cellrc[1] < arearc[1] )
{
return false; // col before the first ref ... | 4 |
public BufferedImage loadImage(String fnm) {
try {
BufferedImage im = ImageIO.read(ImageLoader.class.getResource(fnm));
//ImageIO.read(Art.class.getResource(fileName));
int transparency = im.getColorModel().getTransparency();
BufferedImage copy = gc.createCompati... | 1 |
public boolean AfegirRestriccioGrupSessio(String nomA, int grup, String dia, int hora) {
int d;
if ( dia.equals("dilluns") ) d = 0;
else if ( dia.equals("dimarts") ) d = 1;
else if ( dia.equals("dimecres") ) d = 2;
else if ( dia.equals("dijous") ) d = 3;
else if ( dia.equa... | 6 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Group other = (Group) obj;
if (idGroup != other.idGroup)
return false;
if (name == null) {
if (other.name != null)
return false;
} ... | 7 |
public String getCalle() {
return addressCompany.getCalle();
} | 0 |
final public Link get() {
Link retVal = null;
String url = null;
try {
Memcached cache = Memcached.getInstance();
@SuppressWarnings("unchecked")
ArrayList<String> cacheValue = (ArrayList<String>) cache
.get("jPapayaUrlList");
while (cacheValue == null || cacheValue.size() < 3) {
cache... | 3 |
public String match(String query, String fullLine){
int qTextLen = query.length();
int fLineLen = fullLine.length();
int[][] opt = new int [qTextLen + 1][fLineLen+1];
if(qTextLen == 0 || fLineLen == 0){
return null;
}
// Build the table
for (int i = qTextLen - 1; ... | 9 |
public void onReceive(Object msg) {
if (msg.equals("start")) {
// start by depositing enough money in the account to cover the
// txfrs
accountA.tell(new BankAccount.Deposit(taskCount * 100),
getSelf());
probe.tell("started", getSelf());
} else if (msg.equals(BankAccount.TransactionStatus.... | 8 |
final public java.util.Map.Entry < FtanString, FtanValue > KeyValuePair() throws ParseException {
FtanString key;
FtanValue value;
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case SQ_STRING_START:
case DQ_STRING_START:
key = String();
break;
case NAME:
key = Name();
break;
de... | 5 |
public void insertIntoPosition(HTreeNode node, int position){
/* Checks if node is null. */
if (node == null)
return;
/* Creates a new node from node; designates a null next() link. */
HTreeNode newNode = new HTreeNode(node);
/* The iterator node for the insertion. */
HTreeN... | 8 |
private Vector getResultant() {
Vector resultant = new Vector(myUniverse.getDimension()); //TODO Bit of a hack here, consider cleaning
for(Vector element: forceList) {
try {
resultant = Vector.add(resultant,element);
} catch (DimensionMismatchException e) {
e.printStackTrace();
}
}
return resul... | 2 |
@Override
protected void updateAnimation() {
if (left || right) {
if (currentAction != 0) {
currentAction = 0;
getAnimation().setFrames(entityTexture);
getAnimation().setDelay(75);
}
}
getAnimation().update();
} | 3 |
public NamePrinter(SharedObject counter) {
this.counter=counter;
} | 0 |
public void mousePressed(MouseEvent e)
{
Point click = e.getPoint();
int xIndex = click.x/TILE;
int yIndex = click.y/TILE;
Tile clicked = campus.getTile(xIndex+screenX, yIndex+screenY);
System.out.println("Clicked: " + xIndex + "," + yIndex + ", Tile: " + clicked);
if (e.getButton() == Mous... | 7 |
public void selectNone() {
expandMenu();
for(int i = 0; i < methodTree.getRowCount(); i++) {
TreePath path = methodTree.getPathForRow(i);
if(path == null) return;
DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) path.getLastPathComponent();
if(tr... | 5 |
public int getOil(int size){
if (resource1==2){
if (size==1){
return sgenrate1;
}
else if (size==2){
return mgenrate1;
}
else {
return lgenrate1;
}
}
else{
return 0;
}
} | 3 |
public int getLevel() {
// Level not calculated yet?
if( level < 0 ) {
level = 0;
// Level = max(parent's level) + 1;
for( GoTerm parent : parents )
level = Math.max(level, parent.getLevel() + 1);
}
return level;
} | 2 |
public static void sortMaps() {
mapPanels.clear();
maps.removeAll();
currentMaps.clear();
int counter = 0;
selectedMap = 0;
maps.repaint();
LaunchFrame.updateMapInstallLocs(new String[]{""});
mapInfo.setText("");
HashMap<Integer, List<Map>> sorted = new HashMap<Integer, List<Map>>();
sorted.put(0... | 7 |
public String getSampleOutput() {
return this.sampleOutput;
} | 0 |
private double normalisoi(double kulma){
if (kulma < 0){
return kulma + Math.PI*2;
} else if (kulma > Math.PI*2) {
return kulma - Math.PI*2;
} else {
return kulma;
}
} | 2 |
public static void main(String[] args) throws Throwable{
StringBuilder sb = new StringBuilder();
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
int caso = 1;
for(String str1; (str1=in.readLine())!=null; caso++){
sb.append((caso<10?" ":"") + caso + ". ");
String str2 = in.readLin... | 9 |
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 |
public void setConfigSize(Integer w, Integer h) {
if (w == null && h == null)
return;
if (w == null)
w = getSize().width;
if (h == null)
w = getSize().height;
setSize(w, h);
} | 4 |
public Target(String ip, int dv) {
this.ip = ip;
this.dv = dv;
} | 0 |
public Iterator<Compound> col_wise() {
return new Iterator<Compound>() {
int y = 0;
int x = 0;
int idx = 0;
public boolean hasNext() {
if ((x == cols-1) && (y < rows-1)) {
x = 0;
}
... | 2 |
private static void putInput(Comparable[] a, String type)
{
try
{
SortHelper.class.getMethod("put" + type + "Input",
Comparable[].class).invoke(null, (Object) a);
}
catch (Exception e)
{
System.out.println(e + "\n" + e.getCause());
System.exit(1);
}
} | 1 |
private void applyMovement() {
if (isGoLeft() && isCanLeft()) {
getGame().setxOffset(getGame().getxOffset() + getMovementSpeed());
}
if (isGoRight() && isCanRight()) {
getGame().setxOffset(getGame().getxOffset() - getMovementSpeed());
}
if (isGoUp() && isCanUp()) {
getGame().setyOffset(getGame().gety... | 8 |
public String getType() {
return "pda";
} | 0 |
@Override
public Boolean needScrolling(ViewEventArgs args){
Boolean needScrolling = false;
int totalHeight = 0;
for (Row row : this.document.getRows()){
totalHeight += row.getHeight();
}
if (totalHeight > args.getFrameHeight()){
needScrolling = true;
}
return needScrolling;
} | 2 |
public void generate_signals(Instruction current_instruction){
clear_signals();
switch(current_instruction.get_format()){
case 0:
set_reg_write(true);
break;
case 1:
set_reg_write(true);
set_mem_read(true);
set_mem_to_reg(true);
break;
case 2:
set_mem_write(true);
break;
case 3:
s... | 7 |
private void peopleProjectComboBoxActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
int index = peopleProjectComboBox.getSelectedIndex();
if (index != -1) {
String projID = projectTableController.getTableM... | 1 |
private void processGridlet(Sim_event ev, int type)
{
int gridletId = 0;
int userId = 0;
try
{
// if a sender using gridletXXX() methods
int data[] = (int[]) ev.get_data();
gridletId = data[0];
userId = data[1];
}
// i... | 8 |
@Override
public void alreadyExists(User user) throws EntityAlreadyExistsException, UnablePerformDBOperation, CantGetDBConnection {
log.info("Searching user " + user.toString() + " in DB");
checkConnection();
String queryLogin = "select * from users where login = ? ";
String query... | 7 |
private void mode() {
Stopwatch.start();
Boolean moreThen0 = false;
Map<Integer, Integer> freqs = new HashMap<Integer, Integer>();
for (Integer val : _myBigArray) {
Integer freq = freqs.get(val);
if (freq == null) {
freq = 1;
} else {... | 7 |
public List<Map<Double,Double>> getNormalDataSet(int saptak) {
List<Map<Double,Double>> dataList = new ArrayList<Map<Double,Double>>();
//DataSet Map
double maxTimeValue = 0;
Map<Double,Double> map = new LinkedHashMap<Double,Double>();
if (pointFramesMap != null) {
for(String _po... | 6 |
public final void statement() throws RecognitionException {
ParserRuleReturnScope labelfield1 =null;
try {
// C:\\Users\\Shreeprabha\\Documents\\GitHub\\CecilRPi\\src\\org\\raspberrypi\\cecil\\model\\grammar\\Cecil.g:140:3: ( ( '.' labelfield )? mnemonicdata )
// C:\\Users\\Shreeprabha\\Documents\\GitHub\\Ce... | 6 |
public Complex getElem(int ri, int ci) {
try {
return matrix[ri][ci];
} catch (Exception e) {
System.out.println("Invalid indices in getElem(int ri, int ci)");
e.printStackTrace();
}
return null;
} | 1 |
public static Graph<Vertex, Edge<Vertex>> FileToGraph(String dat, boolean directed) {
int[][] GArray = FileToGraphArray(dat);
int n = GArray[0][0];
int m = GArray[0][1];
Graph<Vertex, Edge<Vertex>> G = new Graph(n);
// Knoten hinzufuegen
for (int i = 0; i < n; i++) {
G.addVertex(new Verte... | 3 |
public static void main(String args[])
{
In in = new In(args[0]);
int N = in.readInt();
UnionFindWQU qf = new UnionFindWQU(N);
while (!in.isEmpty())
{
int p = in.readInt();
int q = in.readInt();
if (qf.connected(p, q))
continue;
qf.union(p, q);
System.out.println(p + " " + q);
}
Syst... | 2 |
private void butterflyStage(double[] from, double[] to, int numFftPoints, int currentDistance) {
int ndx1From;
int ndx2From;
int ndx1To;
int ndx2To;
int ndxWeightFft;
if (currentDistance > 0) {
int twiceCurrentDistance = 2 * currentDistance;
for ... | 3 |
public void readCarvia(String tipo) throws IOException{
InputStream inputStream = null;
if (tipo.equals("UR"))
inputStream = new FileInputStream(Config.get("UrbanoSHPPath") + "/CARVIA/Carvia.DBF");
else if (tipo.equals("RU"))
inputStream = new FileInputStream(Config.get("RusticoSHPPath") + "/CARVIA/Carvia.... | 9 |
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
Random rand = new Random();
// The default ranges
int[][] ranges = {{0,10}, {0,100}, {0,500}, {0,1000}};
try {
do {
int[] range = getRange(scan, ranges);
in... | 6 |
public List<Park> getParkList() {
List<Park> list = new ArrayList<Park>();
list.addAll(this.parkList);
return list;
} | 0 |
public void process() {
for (int i = 0; i < 1000; i++) {
stageOne();
stageTwo();
}
} | 1 |
public static Double calcLogSumOfLogs(Double logX, Double logY) {
if (logX == null && logY == null) {
return null;
} else if (logX == null) {
return logY;
} else if (logY == null) {
return logX;
}
if (logX >= 0 || logY >= 0) {
double x = Math.pow(2, logX);
double y = Math.pow(2, logY);
d... | 8 |
public void setFocused(Configuration configuration) {
ConfigurationButton button = (ConfigurationButton) configurationToButtonMap
.get(configuration);
if (button == null)
return;
if (button.state == ConfigurationButton.NORMAL) {
//System.out.println("Setting color");
button.setState(ConfigurationButt... | 2 |
private void drainOutput() {
try {
LOGGER.debug("Draining Output");
if ((readyOps & SelectionKey.OP_WRITE) != 0) {
Message msg;
while ((msg = outQueue.poll()) != null) {
LOGGER.debug("Sending message " + msg.toString());
ByteBuffer buffer = msg.toByteBuffer();
channel.write(buffer);
}... | 5 |
public FriendsList() {
loaded = false; //it's currently not loaded
lastMessage = new Date(Calendar.getInstance().getTimeInMillis());
//create friends list
friendsList = new JFrame();
//menubar for exit and information
menubar = new JMenuBar();
icon = new Image... | 2 |
public RoundLcdClock() {
hColor = new SimpleObjectProperty<>(this, "hourColor", Color.BLACK);
mColor = new SimpleObjectProperty<>(this, "minuteColor", Color.rgb(0, 0, 0, 0.5));
m5Color = new SimpleObjectProperty<>(this, "5MinuteColor", Color.BLACK);
sColor = ne... | 6 |
public static List fromArray(Object[] array) {
if ((array == null) || (array.length == 0)) {
return new ArrayList();
}
List list = new ArrayList(array.length);
for (int i = 0; i < array.length; i++) {
list.add(array[i]);
}
return list;
} | 3 |
final public void WhileExp() throws ParseException {/*@bgen(jjtree) WhileExp */
SimpleNode jjtn000 = (SimpleNode)SimpleNode.jjtCreate(this, JJTWHILEEXP);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
try {
jj_consume_token(WHILE);
Expression();
jj_consume_token(DO);
Expression... | 8 |
public void ThreateningScore(Board b) {
char c;
if (color == 'W')
c = 'B';
else
c = 'W';
int score = 0;
int best = -10;
System.out.println(c);
checkThreats(b, c);
printThreats();
for (int i = 0; i < numThreatened; i++) {
score = toInt(threatened[i]);
if (isThreatened(locThreatening[i])) {... | 5 |
@Override
public void compileClicked(ArrayList<ArrayList<String>> code) {
if(checkCorrectInput(code)) {
model.compile(new Program(code));
this.setViewOutput();
if(model.isCompileSuccess()){
view.setButtonsEnabled(model.isCompileSuccess());
if(sendToIO)
for(int i = 0; i < 10; i++)
opin.... | 4 |
public int getMaxPacketSize ()
{
int field = getU16 (4);
int size = field & 0x3ff;
String type = getType ();
boolean highspeed = iface.getDevice ().getSpeed () == "high";
// "high bandwidth" mode may use multiple packets per microframe
if (highspeed && (type == "iso" || type == "interrupt"))
size *= 1 + (f... | 3 |
public void visitNewArrayExpr(final NewArrayExpr expr) {
print("new " + expr.elementType() + "[");
if (expr.size() != null) {
expr.size().visit(this);
}
print("]");
} | 1 |
public SearchedTrainListFrame(Title myTitle, TrainSchedule TS, String searchTerm) throws IOException {
setBackground(new Color(173, 216, 230));
setLayout(null);
//===================================== THIS SHOULD TAKE THE OUTPUT FROM THE SEARCH METHOD INSTEAD OF AN IMAGE ==========================
JTable ... | 3 |
public static void moveSubArray(int[] arr, int from, int to, int offset){
int iters=0;
if(from>to){
iters=((arr.length-from)+to)+1;
} else {
iters=(to-from)+1;
}
if(offset==1){
int previous=circleIncrement(to, arr.length);
for(int i=0;i<iters;i++){
swap(arr,to,previous);
previous=to;
t... | 5 |
protected void paintBackground(Graphics g, JComponent c, int x, int y, int w, int h) {
// if (!AbstractLookAndFeel.getTheme().isDarkTexture()) {
// super.paintBackground(g, c, x, y, w, h);
// return;
// }
JMenuItem b = (JMenuItem) c;
ButtonModel model = b.getModel();
... | 8 |
final public void Insert() throws ParseException {
/*@bgen(jjtree) Insert */
ASTInsert jjtn000 = new ASTInsert(JJTINSERT);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtn000.jjtSetFirstToken(getToken(1));
try {
jj_consume_token(INSERT);
jj_consume_token(INTO);
... | 8 |
public Boolean find(int[] arrA, int x, int y) {
int range = y - x;
for (int i = 0; i < arrA.length; i++) {
if (arrA[i] >= x && arrA[i] <= y) {
int z = arrA[i] - x;
if (arrA[z] > 0) {
arrA[z] = arrA[z] * -1;
}
}
}
// for(int i=0;i<arrA.length;i++){
// System.out.print(" " + arrA[i]);
... | 6 |
public void saveSongs(List<String> songLinkList, SongParserForOneGenre songParser) {
if (songParser != null) {
for (String songLink : songLinkList) {
if (!DataUtils.isEmpty(songLink)) {
try {
songParser.pasrePage(songLink);
... | 4 |
public static void initWindowGL(int width, int height, String title)
{
try
{
Display.setTitle(title);
Display.setDisplayMode(new DisplayMode(width, height));
Display.create();
}
catch (LWJGLException e)
{
e.printStackTrace();
... | 3 |
public JSONObject optJSONObject(String key) {
Object object = this.opt(key);
return object instanceof JSONObject ? (JSONObject)object : null;
} | 1 |
private void updateGame()
{
// If no current block, generate new one
if (gameBoard.getCurrentBlock() == null)
{
gameBoard.completeRows();
gameBoard.newBlock();
gameBoard.setRow(0);
gameBoard.setCol(4);
if(gameBoard.isValidMove(Direction.DOWN) == false)
{
isRunning = false;
}
... | 2 |
private void handleCheck( CommandSender sender, String label, String[] args)
{
Collection<GroupSettings> allGroups = mPlugin.getGroups(true);
LinkedList<GroupSettings> matching = new LinkedList<GroupSettings>();
for(int i = 0; i < args.length; ++i)
{
boolean found = false;
for(GroupSettings group : al... | 6 |
private void formatClassFeatures(StringBuilder formatted, List<String> features) {
if (!features.isEmpty()) {
formatted.append("\\n|");
boolean first = true;
for (String feature : features) {
if (first) {
first = false;
}
... | 3 |
direction NNIEdgeTest(edge e, double[][] A, double[] weight, int wIndex )
{
int a,b,c,d;
edge f;
double[] lambda;
double D_LR, D_LU, D_LD, D_RD, D_RU, D_DU;
double w1,w2,w0;
if ( e.tail.leaf() || e.head.leaf() )
return direction.NONE;
lambda = new double[3];;
a = e.tail.parentEdge.topsize;
f =... | 5 |
public static void main(String []args) throws ParseException, IOException, WrongArgumentException
{
CommandLineParser parser = new PosixParser();
Options options = new Options();
HelpFormatter f = new HelpFormatter();
options.addOption("h",false,"Print The help infomation");
options.addOption("s", true, "Chunk S... | 7 |
public BlockFace faceFromYaw(int yaw){
int cYaw = cardinalYaw(yaw);
switch (cYaw){
case 0: return BlockFace.SOUTH;
case 90: return BlockFace.WEST;
case 180: return BlockFace.NORTH;
case 270: return BlockFace.EAST;
default : return BlockFace.SOUTH;
}
} | 4 |
public void selectMode()
{
String[] modes = {"Play New Game", "Load Saved Game/Level", "Open Level Creator"};
String mode = (String)JOptionPane.showInputDialog(
null,
"Select mode:\n",
"Kraft Dinner Table Game",
JOptionPane.QUEST... | 2 |
protected void populateButtons()
{
int month = lMonths.getSelectedIndex();
int year = lYears.getSelectedIndex() + mStartYear;
GregorianCalendar gc = new GregorianCalendar(year, month, 1);
// Get which day of week is the first day of the month
int firstDay = gc.get(Calendar.DAY_OF_WEEK) - 1;
// System.ou... | 3 |
@Override
public void handleSimpleTag(HTML.Tag tag, MutableAttributeSet attrs, int pos) {
logger.info("SimpleTag: " + tag);
HTMLComponent comp = null;
for (HTML.Tag t : wantedSimpleTags) {
if (t == tag) {
comp = HTMLComponentFactory.create(tag, attrs);
break;
}
}
if (comp == null && !totall... | 4 |
public void load() {
if (!new File(plugin.getDataFolder(), "config.yml").exists()) {
plugin.saveDefaultConfig();
}
configLoader = (YamlConfiguration) plugin.getConfig();
} | 1 |
public boolean validate () {
// check primes.
BigInteger mm = p.multiply(q);
if (!mm.equals (m))
return false;
BigInteger pm1 = p.subtract (BigInteger.ONE);
BigInteger qm1 = q.subtract (BigInteger.ONE);
BigInteger r = pm1.multiply(qm1).divide(pm1.gcd(qm1));
// check public expo... | 7 |
@Override
public void render(RenderContext renderContext) {
// System.out.println(getCurrentMatrix().toString());
glMatrixMode(GL_PROJECTION);
glLoadMatrix(toFloatBuffer(renderContext.getCamera().getProjection(getViewport().getSize()).m));
glMatrixMode(GL_MODELVIEW);
glLoadMatrix(toFloatBuffer(renderContex... | 6 |
private void saveAs_buildPropButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveAs_buildPropButtonActionPerformed
JFileChooser buildChooser = new JFileChooser();
buildChooser.setDialogTitle(parser.parse("buildProp:saveAs_title"));
buildChooser.setApproveButtonText(parse... | 2 |
@Override
protected TreeNode<K,V> delete(TreeNode<K,V> deleteNode) {
TreeNode<K,V> spliceNode = null; // either replacement or deleted !
//case 1, 2
if (deleteNode.left == null || deleteNode.right == null){
spliceNode = deleteNode;
} else //case 3
spliceNode ... | 7 |
public int insertarTipoMovimiento(String codigo, String descripcion, String accion, String estado) {
if(codigo.trim().length()==3 && descripcion.trim().length()>0 && descripcion.trim().length()<=40
&& accion.trim().length()>0 && accion.trim().length()<=10 &&
estado.trim().length(... | 9 |
@SuppressWarnings({ "rawtypes", "unchecked" })
public PersonRegister() {
setBounds(7, 55, 1290, 600);
setResizable(false);
setModal(true);
setLocationRelativeTo(null);
// dim = super.,getToolkit().getScreenSize();
// super.setSize(dim);
// setLocationRelativeTo(null);
getContentPane().setLayout(new Bor... | 4 |
private static String makeUrl(String filename) throws MalformedURLException {
final String url;
if (filename.indexOf("://") > 0 || filename.startsWith("file:")) {
url = filename;
} else {
url = new File(filename).toURI().toString();
}
return url;
} | 2 |
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.