text stringlengths 14 410k | label int32 0 9 |
|---|---|
public Object execute(Node node) {
Keyword key = (Keyword) node.getLeftChild().getTokenValue();
Node result = (Node) super.execute(node.getRightChild());
char[] ops = key.toString().substring(1, key.toString().length() - 1).toLowerCase().toCharArray();
for (int i = ops.length - 1; i >= 0; i--) {
if (ops[i... | 9 |
protected static Ptg calcRound( Ptg[] operands ) throws CalculationException
{
if( operands.length < 1 )
{
return PtgCalculator.getNAError();
}
double[] dd = PtgCalculator.getDoubleValueArray( operands );
if( dd == null )
{
return new PtgErr( PtgErr.ERROR_NA );//20090130 KSC: propagate error
}
//... | 4 |
public static Hand OnePair(Rank pairRank, Rank firstKicker, Rank secondKicker, Rank thirdKicker) {
return new Hand(HandRank.OnePair, null, pairRank, firstKicker, secondKicker, thirdKicker, Rank.Null);
} | 0 |
private void connectButtonActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_connectButtonActionPerformed
{//GEN-HEADEREND:event_connectButtonActionPerformed
try
{
echoClient.connect(hostTextField.getText(), Integer.parseInt(portTextField.getText()));
messageArr... | 1 |
@Override
public Task getTask(String jid, String tid) throws RemoteException {
Task[] taskArray = null;
synchronized (this.syncTaskList) {
taskArray = this.syncTaskList.toArray(new Task[0]);
}
if (taskArray == null) {
return null;
}
for (int i = this.syncTaskList.size() - 1; i >= 0; i--) {
Task... | 4 |
public SchemaGraphComponent(mxGraph graph)
{
super(graph);
mxGraphView graphView = new mxGraphView(graph)
{
/**
*
*/
public void updateFloatingTerminalPoint(mxCellState edge,
mxCellState start, mxCellState end, boolean isSource)
{
int col = getColumn(edge, isSource);
if (col >= ... | 7 |
public String getColumnName(int column) {
int count = getColumnCount();
if (column == count - 1)
return "Result";
int offset = 0;
if(isMultiple){
offset = 1;
if(column == 0) return "File";
}
String word = "";
if(column <= (getInputCount()-1+offset) && col... | 7 |
public void muteMedia() {
if (Debug.audio) System.out.println("AudioPlayer -> muteMedia called");
if ((null != player) && realizeComplete) {
gainControl.setMute(true);
if (Debug.audio) System.out.println("AudioPlayer -> muteMedia set");
}
} | 4 |
public int getLength(){
return arraysBase.size();
} | 0 |
public static boolean isChargedCreeper (Entity entity) {
if (entity instanceof Creeper) {
Creeper chargedcreeper = (Creeper) entity;
if (chargedcreeper.isPowered()) {
return true;
}
}
return false;
} | 2 |
public static Population evolvePopulation(Population pop, int mutationPerEvo) {
int cloneCounter = 0;
Population newPopulation = new Population(pop.populationSize(), false);
tournamentSize = (int) (pop.populationSize()*0.2);
// Keep our best individual if elitism is enabled
int elit... | 9 |
@Override
public void undo() {
// Remove the Node
node.getTree().removeNode(node);
parent.removeChild(node, index);
} | 0 |
public void actionPerformed(ActionEvent e) {
if (e.getSource() == btnExcluir) {
try {
do_btnExcluir_actionPerformed(e);
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
if (e.getSource() == btnCancelar) {
do_btnCancelar_actionPerformed(e);
}
} | 3 |
private static Result doSendViaGcm(String message, Sender sender,
DeviceInfo deviceInfo) throws IOException {
// Trim message if needed.
if (message.length() > 1000) {
message = message.substring(0, 1000) + "[...]";
}
// This message object is a Google Cloud Messaging object, it is NOT
... | 4 |
public void removeService(Object service) throws Exception {
int index = this._list.indexOf(service);
if (index >= 0) {
this._list.remove(index);
if (service instanceof IService) {
((IService) service).uninitializeService();
}
}
} | 2 |
private boolean analyzeLine(SourceLine sourceLine, List<SourceLine> lines) {
for (String expression : properties.expressions) {
Matcher m = Pattern.compile(expression).matcher(sourceLine.getContent());
if (m.matches()) {
sourceLine.matchesAt(m.start(), m.end());
... | 8 |
public void positionVessel(EnumBoard player, EnumLine line,
EnumColumn column, boolean vertical, EnumElement vessel)
throws InvalidPositionException, GameInitializedException {
if (this.init) {
throw new GameInitializedException();
} else {
Map<String, EnumElement> board = (player.equals(EnumBoard.PLAYE... | 4 |
public void configure(Configuration conf) throws ConfigurationException {
conf.addConfigurable(this);
ruleFile = conf.getProperty("broadcastTCPOutputConnector.rule");
if(ruleFile == null)
throw new ConfigurationException("broadcastTCPOutputConnector.rule not specified");
String portString = conf.get... | 6 |
protected void scriptConvert(int pass, String relpath, File file) {
if (pass == 1 && file.getName().endsWith("fcf")) {
if (!relpath.contains("/")) {
//If any subfolders exist, it's because the files were extracted on top of
//an aborted earlier extraction.
routeParser.parse(file, appendMap);
}
... | 7 |
public boolean ModificarTrata(Trata p){
if (p!=null) {
cx.Modificar(p);
return true;
}else {
return false;
}
} | 1 |
void createChildren(Widget widget, boolean materialize) {
if (contentProviderIsLazy) {
Object element = widget.getData();
if (element == null && widget instanceof TreeItem) {
// parent has not been materialized
virtualMaterializeItem((TreeItem) widget);
// try getting the element now that updateElem... | 9 |
private String getCellToolTip(MouseEvent event) {
String toolTip = null;
int col = columnAtPoint(event.getPoint());
int row = rowAtPoint(event.getPoint());
if (row >= 0 && col >= 0) {
TableCellRenderer renderer = getCellRenderer(row, col);
Component component = ... | 4 |
public void execute(MinersWife wife){
switch(rand.nextInt(3)) {
case 0:
System.out.println(wife.getName() + " Moppin' the floor");
break;
case 1:
System.out.println(wife.getName() + " Washin' the dishes");
break;
case 2:
System.out.println(wife.getName() + " Mak... | 3 |
public void setGame(Game game){
boolean test = false;
if (test || m_test) {
System.out.println("EndDisplay :: setGame() BEGIN");
}
m_game = game;
if (test || m_test) {
System.out.println("EndDisplay :: setGame() END");
}
} | 4 |
public static void clearAllNodes() {
eventQueue.pruneAllNodeEvents();
packetsInTheAir = new PacketsInTheAirBuffer();
for(Node n : nodes) {
n.outgoingConnections.removeAndFreeAllEdges();
}
nodes = createNewNodeCollection();
Node.resetIDCounter(); // new nodes restart their ID with 1
if(Global.isGuiMode... | 2 |
public Shape getShape() {
return shape;
} | 0 |
@SuppressWarnings("unchecked")
public static SignalWriter createSignalWriter(SignalEntry signalEntry){
Properties unisensProperties = UnisensProperties.getInstance().getProperties();
String readerClassName = unisensProperties.getProperty(Constants.SIGNAL_WRITER.replaceAll("format", signalEntry.getFileFormat().getF... | 9 |
private void New()
{
try
{
for(int i = 0; i < list.getProjectList().size(); i++)
{
StringTokenizer st = new StringTokenizer(list.getProjectList().get(i), " : ");
String str = st.nextToken();
if(str.equals(NameTextField.getText()))
{
JOptionPane.showMessageDialog(buttonNew, "Project with... | 4 |
private final boolean isInvalidURICharacter( char c )
{
for ( int i = 0; i < VALID_URI_CHARS.length; ++i )
{
if ( VALID_URI_CHARS[i] == c )
{
return false;
}
}
return true;
} | 2 |
public String[] getOptions() {
Vector result;
String[] options;
int i;
result = new Vector();
if (getDebug())
result.add("-D");
if (getSilent())
result.add("-S");
result.add("-N");
result.add("" + getNumInstances());
if (getE... | 7 |
public static ProtocolSignUp getProtocolSignup(String inString)
throws JDOMException, IOException, TagFormatException {
SAXBuilder mSAXBuilder = new SAXBuilder();
Document mDocument = mSAXBuilder.build(new StringReader(inString));
Element rootNode = mDocument.getRootElement();
String protType = rootNode.getN... | 1 |
private void spawnObstacle() {
if (rand.nextInt(100) <= 8) {
for (int i = 0; i < 10; i++) {
int xPos = rand.nextInt(Game.WIDTH - 30) + 15;
Entity o = new EntityObstacle(xPos, 0);
if (rand.nextInt(100) <= 2) {
o = new EntityObstacleSpecial(xPos, 0);
}
Object[] e = getCollisionListFor(o).toA... | 6 |
public static void nth_number(Integer[] v, Integer n) {
int min1 = 0, min2 = 0, min3 = 0;
for (Integer value : v) {
}
} | 1 |
public static int safeLongToInt(long l) {
if (l < Integer.MIN_VALUE || l > Integer.MAX_VALUE) {
throw new IllegalArgumentException
(l + " cannot be cast to int without changing its value.");
}
return (int) l;
} | 2 |
@Override
public final void mouseMoved(MouseEvent mouseevent) {
int i = mouseevent.getX();
int j = mouseevent.getY();
if (frame != null) {
i -= 4;
j -= 22;
}
idleTime = 0;
mouseX = i;
mouseY = j;
} | 1 |
List<CompilationUnit> getMissingCompilationUnits() {
List<CompilationUnit> missingCompilationUnits = new ArrayList<>();
compilationUnits.forEach((compilationUnit) -> {
try {
loadClass(compilationUnit.getName());
} catch (ClassNotFoundException e) {
... | 1 |
public TestFrame()
{
super(new GLTexture("bg0.png",GL13.GL_TEXTURE0));
this.test = new Button(420, 262, Colors.BLUE+"G"+Colors.RED+"o"+Colors.YELLOW+"o"+Colors.BLUE+"g"+Colors.DARKGREEN+"l"+Colors.RED+"e");
this.test.setBackgroundHighlightColor(Colors.VIOLET.getGlColor());
this.test.setBorderColor(Colors.LIGHT... | 9 |
public LinkedList<String[]> getServers() {
LinkedList<String[]> servers = new LinkedList<String[]>();
conn.query("SELECT * from "+SCHEMA+".servers");
ResultSet rs = conn.getQueryResult();
try {
while( rs.next() ) {
servers.add(new String[] {
rs.getString("url"),
String.valueOf(rs.getInt("... | 2 |
public void setLocal(String local) {
if(local.length() < 65) {
try {
isValidLocal(local);
this.local = local;
} catch(Exception e) {
System.out.println(e.getMessage());
System.out.println("Local not set.");
}
}
else
System.out.println("Local part length must be less than 65 characters"... | 2 |
public Vector collide(PhysicsObject a){
Vector aPosition = a.getPosition();
Vector aOldPosition = a.getOldPosition();
Vector aSize = a.getSize();
//System.out.println(aPosition);
//if( this.y >= doA.oy + doA.height && (doA.y + doA.height >= this.y) && (doA.x < this.x + this.width && doA.x + doA.width > this.x... | 5 |
@Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
MOB target=mob;
if((auto)&&(givenTarget!=null)&&(givenTarget instanceof MOB))
target=(MOB)givenTarget;
if(target.fetchEffect(ID())!=null)
{
mob.tell(target,null,null,L("<S-NAME> already <S-... | 8 |
private static boolean isVowel(char chr){
return (chr == 'A' || chr == 'E' || chr == 'I' || chr == 'O' || chr == 'U' || chr == 'a' || chr == 'e' || chr == 'i' || chr == 'o' || chr == 'u');
} | 9 |
@Override
@SuppressWarnings({ "nls", "boxing" })
protected void initialize(Class<?> type, Object oldInstance,
Object newInstance, Encoder enc) {
super.initialize(type, oldInstance, newInstance, enc);
if (type != oldInstance.getClass()) {
return;
}
Menu menu = (Menu) oldInstance;
i... | 8 |
@Override
public void EntityKilled(Entity entity, Entity killer) {
if(entity instanceof Mob){
Mob mob = (Mob)entity;
if((killer != null) && (killer instanceof Tower)){
mobGotKilled(mob);
((Tower)killer).kills++;
}
level.markMobForDeletion(mob);
return;
}
if(entity instanceof Tower){
lev... | 9 |
public Locale dequeue() throws Exception {
Locale retVal = null;
// Check for underflow.
if (!this.isEmpty()) {
retVal = arr[frontPtr];
// Shift every element towards the front.
for (int i = 0; i < backPtr; i++) {
arr[i] = arr[i + 1];
}
// Reinitialize the last element
arr[backPtr] = null;
... | 2 |
public <T> void registerMethods(final Class<T> cls, String toStringMethodName, String fromStringMethodName) {
if (cls == null) {
throw new IllegalArgumentException("Class must not be null");
}
if (toStringMethodName == null || fromStringMethodName == null) {
throw new Ill... | 4 |
public Value( String strVal ) {
value = strVal;
// test to see which type of value it is
if ( value.compareTo("#t") == 0 || value.compareTo("#f") == 0) {
type = "boolean";
}
else if ( value.matches("-?\\d+") ) {
type = "integer";
}
else if ( val... | 6 |
private static void initChoiceCombinationAndChoices() {
if (choiceCombination == null || choiceCombination.length == 0) {
return;
}
indexsArray = new Integer[choiceCombination.length];
for (int i = 0; i < choiceCombination.length; i++) {
indexsArray[i] = i;
String itemString = choiceCombination[i];
... | 6 |
public static void printResult(Map<String, Double> result, ArgumentValidator validator, int limit) {
try {
FileWriter fstream = null;
BufferedWriter out = null;
boolean writeToFile = validator.getSearchOut() == null ? false : true;
// Create file
if (writeToFile) {
fstream = new FileW... | 7 |
private static String rationalPartFrom(String expression, int part) {
notNull(expression, "Expression cannot be null");
int p = expression.indexOf("/");
switch (part) {
case NUMERATOR:
return p > 0 ? expression.substring(0, p) : expression;
case DENOMINATO... | 4 |
public Object [][] getDatos(){
Object[][] data = new String[getCantidad_Cuentas ()][colum_names.length];
//realizamos la consulta sql y llenamos los datos en "Object"
try{
if (colum_names.length>=0){
r_con.Connection();
String c... | 5 |
public static synchronized DatabaseConnection getInstance(){
if (DatabaseConnection.instance == null){
DatabaseConnection.instance = new DatabaseConnection();
}
return DatabaseConnection.instance;
} | 1 |
public boolean fGuiCheckChildObjectNonExistence(WebElement objParent, String strDesc){
//Delimiters
String[] delimiters = new String[] {":="};
String[] arrFindByValues = strDesc.split(delimiters[0]);
//Get Findby and Value
String FindBy = arrFindByValues[0];
String v... | 9 |
public double getSternCapPerSquareMetre(){
if(!this.sternOption){
System.out.println("Class: GouyChapmanStern\nMethod: getSternCapacitance\nThe Stern modification has not been included");
System.out.println("A value of infinity has been returned");
return Double.POSITIVE_INFI... | 5 |
public void setTable() {
// Centering the first two column's cell content
DefaultTableCellRenderer centerRenderer = new DefaultTableCellRenderer();
centerRenderer.setHorizontalAlignment(JLabel.CENTER);
questionTable.getColumnModel().getColumn(0).setCellRenderer(centerRenderer);
... | 3 |
private void readStudents(Element node, Group group) throws ServerException {
if (log.isDebugEnabled())
log.debug("Method call. Arguments: " + group);
Element studentsNode = (Element) node.getElementsByTagName("students")
.item(0);
if (studentsNode == null) {
ServerException ex = new ServerException(
... | 6 |
public static void main(String[] args) throws SummerMissingException {
Programmetajs programmetajs = new Programmetajs();
Vasara vasara = new Vasara();
programmetajs.Vards = "Janis";
vasara.VidejaTemperatura = 20;
if (vasara.VidejaTemperatura < 20) throw new Su... | 3 |
public static long getLastUpdate(){
Connection con = DBase.dbConnection();
PreparedStatement pst;
long t=0;
Calendar c = Calendar.getInstance();
try{
String query = "Select Distinct RetreiveDate FROM \"ME\".USD";
pst = con.prepareStatement(query);
... | 2 |
void getPreviousWavelength (){
previousStateValues = FileManager.loadBackup();
if(Integer.parseInt(previousStateValues.get(0)) == -1){
previousStateValues.set(0, "0");
}
if(Integer.parseInt(previousStateValues.get(1)) == -1){
previousStateValues.set(1, "0");
}
int conversion1 = Integer.parseI... | 5 |
public String exportCustReport() {
File outFile = new File(STAFF_REPORT_PATH);
if(outFile.exists()){
outFile.delete();
}
IDataVector<ISubDataVector> data = Application.RECORD_VIEW.getTableModel().getData();
FileInputStream in = null;
OutputStream out = null;
try {
in = new FileInputStream(new ... | 9 |
public void setNametextFontcolor(int[] fontcolor) {
if ((fontcolor == null) || (fontcolor.length != 4)) {
this.nametextFontColor = UIFontInits.NAME.getColor();
} else {
this.nametextFontColor = fontcolor;
}
somethingChanged();
} | 2 |
public void bOpen(){
if (isOpen)
return;
if (bombsBeingRevealed && getValue() != 9){
return;
}
if (markIndex > 0){
return;
}
if (!hasStarted)
MainFrame.startTimer();
getModel().setPressed(true);
getModel().setEnabled(false);
isOpen = true;
chooseIcon(true);
//theGame.openSpot(xPos, yPo... | 5 |
private void initFenetre() {
this.setLocationRelativeTo(null);
this.setUndecorated(true);
this.setResizable(false);
this.setSize(350, 200);
JLabel finJeuLabel = new JLabel();
finJeuLabel.setIcon(new ImageIcon(getClass().getClassLoader().getResource("popupLabel.jpg")));
finJeuLabel.setLayout(new FlowLa... | 7 |
public Inventory solveGreedily() {
int availableCapacity = capacity;
ArrayList<Double> amounts = new ArrayList<Double>();
if (availableCapacity <= 0) {
return new Inventory(this, amounts);
}
for (Item i : items) {
if (availableCapacity < i.getWeight()) {
... | 3 |
public void play(File file) {
if (stopRequested) {
stopRequested = false;
try {
AudioInputStream stream = AudioSystem.getAudioInputStream(file);
AudioFormat format = stream.getFormat();
DataLine.Info info = new DataLine.Info(Clip.class, stream.getFormat(),
((int) stream.getFrameLength() * form... | 7 |
protected void execute() {
// TODO Auto-generated method stub
double speed = scale(oi.getXSpeed(RobotMap.HookController));
if(speed > 0 && !hookMotors.Limit1.get()){
hookMotors.motor1.set(speed);
}
else if(speed < 0 && !hookMotors.Limit2.get()){
hookMotors.motor2.set(-speed);
}
} | 4 |
private final void method3167(int i, ByteBuffer class348_sub49,
byte i_2_) {
if (i_2_ == -86) {
anInt9489++;
if ((i ^ 0xffffffff) == -250) {
int i_3_ = class348_sub49.getUByte();
if (aClass356_9494 == null) {
int i_4_ = Class33.method340(i_3_, (byte) 108);
aClass356_9494 = new HashTable... | 5 |
public static void doLevel() throws ClassNotFoundException, FileNotFoundException, IOException, InterruptedException {
addToPattern();
SimoneUI.blinker.run();
Thread.sleep(5000);
for(Integer i: currentPattern) {
// Don't need the integer, but it will ask for the same number of inputs as are in the current pa... | 3 |
public void executarMetodos() throws MyClassException {
SingleValueVetor obj = new SingleValueVetor();
for (Method metodo : obj.getClass().getDeclaredMethods()) {
for (Annotation anotacao : metodo.getAnnotations()) {
if ((anotacao instanceof SingleValueLogAnnotation) && (((SingleValueLogAnnotation) anotacao)... | 9 |
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
} | 1 |
public void startTreasureHunt()
{
found = false;
if(currentTreasureLocation != null && currentTreasureLocation.getBlock().getType().equals(Material.CHEST))
{
Chest chest = (Chest)currentTreasureLocation.getBlock().getState();
Inventory inv = chest.getBlockInventory();
inv.clear();
currentTreasureL... | 5 |
final void method1092(int i, int i_0_) {
anInt1819++;
for (int i_1_ = 0; ((Model) this).vertices > i_1_; i_1_++) {
((Model) this).vertexX[i_1_] <<= i;
((Model) this).vertexY[i_1_] <<= i;
((Model) this).vertexZ[i_1_] <<= i;
}
if (i_0_ <= 39)
method1107(40, -7, -80, -24);
if ((((Model) this).anIn... | 6 |
private void setUsersState(int state){
//Номер колонки айди пользователя
final int columnId = 0;
//Если выбран пользователь в таблице
if (tableUsers.getSelectedRow() != -1) {
//Получаем идентификатор выбранного пользователя
int userId = (Integer)tableUsers.getValu... | 4 |
public static long parseTimeInterval(String str) {
try {
int len = str.length();
char suffix = str.charAt(len - 1);
String numstr;
long mult = 1;
if (Character.isDigit(suffix)) {
numstr = str;
} else {
numstr... | 7 |
public static Model getModel(int id) {
if (Model.modelHeaderCache == null) {
return null;
}
ModelHeader modelHeader = Model.modelHeaderCache[id];
if (modelHeader == null) {
Model.fileRequester.get(id);
return null;
} else {
return new Model(id);
}
} | 2 |
private void dehighlight() {
pane.tablePanel.dehighlight();
pane.grammarTable.dehighlight();
pane.tablePanel.repaint();
pane.grammarTable.repaint();
} | 0 |
private static String applyUnification(String sen1, String sen2, String[][] substitution){
String newSentence = "";
for(int i = 1; i < substitution.length; i++){
if(substitution[i][0] != null){
sen1 = sen1.replaceAll(substitution[i][0], substitution[i][1]);
sen2 = sen2.replaceAll(substitution[i][0], subs... | 7 |
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 wanderSpawner(){
if(time % 10 + random.nextInt(25) == 0) pickWanderLocation();
if(targetX != 0 && targetY != 0) pathTo(new Vector2i(x / 32, y / 32), new Vector2i(targetX, targetY), 0);
} | 3 |
private Position findPlayer(ArrayList<String> board) throws Exception
{
for (int y = 0; y < board.size(); ++y)
{
for (int x = 0; x < board.get(y).length(); ++x)
{
char c = board.get(y).charAt(x);
if (c == '@' || c == '+')
re... | 4 |
private void copyNsAndAttributes(XMLStreamReader parser, XMLStreamWriter writer) throws XMLStreamException {
int nbNamespace = parser.getNamespaceCount();
for (int i = 0; i < nbNamespace; i++) {
String nsPrefix = parser.getNamespacePrefix(i);
String nsURI = parser.getNamespaceURI... | 6 |
@Override
public void setup(
BSPPeer<NullWritable, NullWritable, NullWritable, NullWritable, JobMessage> peer)
throws IOException, SyncException, InterruptedException {
HamaConfiguration conf = peer.getConfiguration();
blockSize = conf.getInt(blockSizeString, 2);
/* Values for rows and columns padde... | 7 |
public void make_pivot(ArrayList<finger_print> outliers){
////System.out.println("Total outliers :" +outliers.size());
if(outliers.size()< OUTLIERS_SIZE || outliers.size() < PIVOT_SIZE_TOTAL){
for(int i=0;i<outliers.size();i++){
final_pivot_list.add(new node(outliers.get(i)));
}
return;
}... | 9 |
private MinesNode[] getSurroundingNodes(int inX, int inY) {
Vector v = new Vector();
for (int i = (inX-1); i <= (inX+1); i++) {
for (int j = (inY-1); j <= (inY+1); j++) {
if (i >= 0 && j >= 0 && i < width && j < height && !(i == inX && j == inY))
v.addElement(minesNodes[i][j]);
}
}
MinesNode[]... | 9 |
public static boolean isValidSuggestion(Suggestion s) {
if (s.getSubject().isEmpty()) {
return false;
}
if (s.getDescription().isEmpty()) {
return false;
}
if (!UserModel.isValidUser(s.getAuthor())) {
return false;
}
System.out.... | 3 |
public int[][] directHoaar(int f[][]) {
int c[] = zigZag.getHideZigZagArray(f, N);
int result[] = new int[N * N];
for (int i = 0; i < N * N / 2; i++) {
result[2 * i] = ((c[2 * i] + c[2 * i + 1]));
result[2 * i + 1] = ((c[2 * i] - c[2 * i + 1]));
}
int arra... | 1 |
public void reloadAll() {
Class<Textures> localTextures = Textures.class;
BufferedImage localBufferedImage1;
for (Iterator localIterator = this.loadedImages.keySet().iterator(); localIterator.hasNext(); ) { int i = ((Integer)localIterator.next()).intValue();
localBufferedImage1 = (BufferedImage)this.l... | 5 |
private double leastSquares(Instances instances) {
double numerator=0, denominator=0, w, t;
double[] classMeans = new double[m_numOfClasses];
double[] classTotals = new double[m_numOfClasses];
for (int i=0; i<instances.numInstances(); i++) {
LADInstance inst = (LADInstance) instances.instance(i)... | 7 |
public void setPieces(){
TicTacToePiece[][] piecesToBeSaved = TicTacToeBoard.getBoard();
for(int j = 0; j < piecesToBeSaved[0].length; j++){
for(int i = 0; i < piecesToBeSaved.length; i++){
if(piecesToBeSaved[i][j].getPieceColour() == Piece.TicTacToePieceColour.NOUGHT){
Element newNoughtPiece;
... | 8 |
private boolean enteredViaVertex0( int anEdgeIndex)
{
if (anEdgeIndex < 1 || anEdgeIndex > 5)
throw new IllegalArgumentException( "Edge index must be in range [1..5], was " + anEdgeIndex);
else
{
boolean retval;
Edge cur = myEdge[anEdgeIndex];
Edge prev = myEdge[... | 5 |
public GayBerneConfigure() {
super(new BorderLayout());
if (rotateCursor1 == null) {
rotateCursor1 = UserAction.createCursor("images/cursors/rotate1.gif", new Point(16, 17), "rotate");
rotateCursor2 = UserAction.createCursor("images/cursors/rotate2.gif", new Point(14, 11), "rotate");
rotateCursor3 = User... | 9 |
protected PingResult pingLeft(){
for (int i = this.posX; i >= 0; i--){
if (i == enemyPosX && this.posY == enemyPosY) {
return new PingResult(this.posX - i - 1, true);
}
else if (BattleBotsGUI.instance.obstacles[i][this.posY]) {
return new PingR... | 5 |
public CmdCreateExecutor(SimpleQueues plugin) {
this.plugin = plugin;
} | 0 |
@Test
public void testSetFood() {
System.out.println("setFood");
int food = 0;
Cell instance = new Cell(0,0);
instance.setFood(food);
int expResult = 0;
int result = instance.getFood();
assertEquals(expResult, result);
} | 0 |
public void add(GUITreeComponent comp) {
reg.put(comp.getGUITreeComponentID(), comp);
} | 0 |
private String parseRes(String res) {
Pattern pattern = Pattern.compile(Constant.MESSAGE_PATTER);
Matcher matcher = pattern.matcher(res);
if (matcher.find()) {
return matcher.group().split(":")[1];
}
if (res.matches(Constant.ORDER_SUCCESS_REGEX)) {
String ... | 5 |
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
// TODO Auto-generated method stub
JSONObject jb = new JSONObject();
String userId = request.getParameter("userId");
try{
connection = new Mongo();
scheduleDB = connection.getDB("sched... | 2 |
@Override
public double getXRotation()
{
double lowest = 9001;
double highest = 0;
int y = 0;
if (getRotationAngle() == 180)
y = -20;
if (getRotationAngle() == 360)
y = 20;
for (Block block : blockArray)
{
if (block.getXValue() > highest)
highest = block.getXValue();
if (block.getXValue(... | 5 |
@Override
public void add(double score) {
if ((score < 0) || (score > 1)) throw new RuntimeException("p-value out of range: " + score);
scores.add(score);
} | 2 |
@Override
public void keyReleased(KeyEvent e) {
switch (e.getKeyCode()) {
case KeyEvent.VK_W:
keys[0] = false;
break;
case KeyEvent.VK_S:
keys[1] = false;
break;
case KeyEvent.VK_I:
keys[2] = false;
break;
case KeyEvent.VK_K:
keys[3] = false;
break;
default:
break;
... | 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.