text stringlengths 14 410k | label int32 0 9 |
|---|---|
public static double ln(double a) {
double aminus1 = a - 1.0;
boolean gt1 = (sqrt(aminus1 * aminus1) <= 1) ? false : true;
final int iteration_count = 300;
double lnsum = 0.0;
if (gt1) {
// use trick for fast convergence:
// ln(123.456) = ln(1.23456*10^2)
// ln(123.456) = ln(1.23456) + 2*ln(10)
... | 9 |
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other == this)
return true;
if (this.row == null)
return false;
Place otherPlace = (Place) other;
return this.number == otherPlace.getNumber() && this.row.equals(otherPlace.getRow());
} | 4 |
private TreeElement handleClass(HashMap classes, ClassInfo clazz) {
if (clazz == null)
return root;
TreeElement elem = (TreeElement) classes.get(clazz);
if (elem != null)
return elem;
elem = new TreeElement(clazz.getName());
classes.put(clazz, elem);
if (!clazz.isInterface()) {
ClassInfo superCla... | 6 |
@Override
public int registerPacketHandler(IPacketHandler iph) {
log.finer("Registering a PacketHandler");
synchronized(PHList) {
if(!PHList.contains(iph)) {
PHList.add(iph);
}
return PHList.indexOf(iph);
}
} | 1 |
JSONArray toJSONArray(final Message.EncodeMode encodeMode) throws JSONException {
JSONArray jsonArray = null;
if (values != null) {
jsonArray = new JSONArray();
for (int i = 0; i < values.size(); i++) {
Parameter param = values.get(i);
if (encodeMo... | 9 |
public String toString() {
StringBuffer sb = new StringBuffer("<class>" + getClass().getName() + "</class>\n");
if (uid != null)
sb.append("<uid>" + uid + "</uid>\n");
if (!layout.equals(BorderLayout.NORTH))
sb.append("<layout>" + layout + "</layout>\n");
sb.append("<single>" + getSingleSelection() + "</s... | 8 |
public static double[][] readOtherData(Kattio io){
String tmp;
double[][] points=null;
int N=0;
//read until reached the EOF line
while(!(tmp=io.readLine()).equals("EOF")){
String sarr[]=tmp.split(" ");
//try to read the dimension
if(points==null && sarr[0].equals("DIMENSION")){
N = Intege... | 5 |
public void resolvePrefixes(LinkedList<Prefix> pre){
//Scan subject, predicate and object (data indices 0 to 2)
for (int i=0; i<3; i++){
String value=getByIndex(i);
//Contains ':'? (a prefix)
if (value.contains(":")){
//Replace prefix
for (Prefix p:pre){
if (value.startsWith(p.getPrefix()... | 6 |
public void paint(Graphics g) {
g.setColor(Color.GRAY);
g.fillRect(0, 0, 1000, 1000);
g.setColor(new Color(clr));
g.drawImage(texture, 0, 0, 128 * scale, 128 * scale, null);
if(curTool == 3) {
this.overlay = new BufferedImage(128, 128, BufferedImage.TYPE_INT_ARGB);
this.overLayGraphics = this.ove... | 4 |
private void runExtCommand(String[] cmd, File dir, String description,
boolean print) {
if (description == null)
setStatusBar("Calling External Program...");
else
setStatusBar(description);
try {
Runtime r = Runtime.getRuntime();
Process p;
if (dir == null)
p = r.exec(cmd);
else
p = ... | 6 |
public boolean canEncode(Serializable structure) {
return false;
} | 0 |
private RenderableObject generateRectangle(Scanner inFile) {
Point s = null, e = null, loc = null;
int thickness = 0;
Color c = null;
String current = inFile.next();
while (inFile.hasNext()
&& !(isCloseTag(current) && parseTag(current) == LegalTag.Object)) {
if (isOpenTag(current)) {
switch (parseT... | 9 |
public void paintComponent(Graphics g) {
super.paintComponent(g);
//Paint grey background
g.setColor(Color.LIGHT_GRAY);
g.fillRect(0, 0, this.getWidth(), this.getHeight());
g.setColor(Color.BLACK);
g.fillRect(myModel.TRASHCAN.y * 40, myModel.TRASHCAN.x*40, squareW, squareH);
//Paint rubble
f... | 5 |
public void act(ArrayList<Plant> plist, ArrayList<Bacteria> baclist){
incrementAge();
if(isDying() || isDead()){
return;
}
//We give a small positive movement bonus to herbivores, and negative to carnivores
double boost = gen.getAggression() * (-0.15);
... | 9 |
public T get(int id) {
if (id < 0) {
return null;
}
T definition = cache.get(id);
if (definition == null) {
synchronized (lock) {
definition = cache.get(id);
if (definition == null) {
try {
definition = loader.load(id);
cache.put(id, definition);
} catch (Exception ignored) ... | 4 |
public static void main(String[] args) {
String[] patterns;
if(args.length < 2) {
patterns = PATTERNS;
} else {
patterns = args;
}
String argString = patterns[0];
System.out.println("Input: " + argString);
for(int i = 1; i < patterns.leng... | 4 |
public List<BoundingBox> getEntityBoundingBoxesInRange(double x, double y, double radius) {
ArrayList<BoundingBox> list = new ArrayList<BoundingBox>();
for(Entity entity : entities) {
if(entity != null && !entity.isDead && entity.getDistance(x, y) <= radius) {
list.add(entity.boundingBox);
}
}
return ... | 4 |
public static void exit(final int iIn)
{
if (! Ezim.running) return;
Ezim.running = false;
EzimNetwork.thAckTaker.interrupt();
EzimAckTaker.getInstance().closeSocket();
EzimNetwork.thDtxTaker.interrupt();
EzimDtxTaker.getInstance().closeSocket();
EzimThreadPool etpTmp = EzimThreadPool.getInstance();
... | 3 |
public void checkFields (LYNXsys system) { // check textfields before adding student to system
boolean existingStudentFlag = false; // temp var to flag if student info is valid
if (!(getFirstName().getTextField().getText().equals("")) && // check that ALL FIELDS are filled (4)
!(getLastName().getTextField().ge... | 7 |
public void addYesterday(FacWarStat stat) {
if (stat instanceof CharacterKills) {
characterKillsYesterday.add((CharacterKills) stat);
} else if (stat instanceof CharacterVictoryPoints) {
characterVictoryPointsYesterday.add((CharacterVictoryPoints) stat);
} else if (stat instanceof CorporationKills) {
cor... | 6 |
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
new Main();
} catch (Exception e) {
e.printStackTrace();
}
}
});
} | 1 |
@Override
public int compareTo(MediaElement o)
{
final int compareTo = this.name.compareTo(o.getName());
if (this != o && compareTo == 0)
return this.name.compareTo(o.getName());
else
return compareTo;
} | 2 |
@Override
public void run() {
List<Action> actions;
long startTime = System.currentTimeMillis(), estimatedTime, timeToWait = 100;
while (true && !sim.isEnded()) {
actions = sim.prepareUpdate();
estimatedTime = System.currentTimeMillis() - startTime;
Sys... | 6 |
private void handleCommitOnly(Sim_event ev)
{
int src = -1; // the sender id
boolean success = false;
int tag = -1;
try
{
// id[0] = resID, [1] = reservID, [2] = trans ID, [3] = sender ID
int[] obj = ( int[] ) ev.get_data();
// get the ... | 5 |
public boolean isHorizontalCollision(Bounds r1, Bounds r2) {
double tamX = r2.getRight() - r1.getLeft();
double tamY = r2.getBottom() - r1.getTop();
if(r1.getLeft() <= r2.getLeft() && r2.getLeft() < r1.getRight()) {
tamX = r1.getRight() - r2.getLeft();
}
if(r1.getTop() <= r2.getTop() && r2.getTop(... | 4 |
protected void move() {
//show/hide nodes
if (visibleNodesCount != mainPanel.symbolsCount.intValue()) {
visibleNodesCount = mainPanel.symbolsCount.intValue();
for (int i = 0; i < symbols.size(); i++)
symbols.get(i).node.setVisible(i < visibleNodesCount);
}
//animate symbols
for (int i = 0; i < mainP... | 8 |
public DecisionQuestView() {
super();
this.add(new JLabel("Decision"));
// quest = QuestFactory.createQuest(QuestType.DECISIONQUEST);
addAnswersTable();
} | 0 |
public int getFileCount() {
try {
return (int) (indexChannel.size() / IDX_BLOCK_LEN);
} catch (IOException ex) {
return 0;
}
} | 1 |
public void setAccessPathLength(int accessPathLength) {
this.accessPathLength = accessPathLength;
} | 0 |
private static String errorToString(int id) {
String errorMessage="";
switch(id) {
case HABITRPG_SERVER_API_CALL_NOT_FOUND:
case INTERNAL_WRONG_URL:
errorMessage="The server wasn't found. Please check your hosts settings.";
break;
case SERV_EXPERIENCING_ISSUES:
errorMessage="HabitRPG's server i... | 6 |
public static void setAlgorithm(Algorithm a) {
AlgorithmInterface.algorithm = a;
} | 0 |
protected boolean parseFile(LineHandler handler, InputStream stream)
throws Exception
{
BufferedReader bis = new BufferedReader(new InputStreamReader(stream));
int lineNum = 0;
for (String line = bis.readLine(); line != null; line = bis.readLine())
{
lineNum++;
if (line.equals("")) { continue;... | 7 |
public Builder socialRepository(Repository respository) {
// If we didn't get a repository, do nothing.
if (respository == null) {
return this;
}
if (message.socialRepositoryList == null) {
message.socialRepositoryList = new ArrayList<Repo... | 2 |
public boolean isSyncCurrentPosition(int syncmode) throws BitstreamException
{
int read = readBytes(syncbuf, 0, 4);
int headerstring = ((syncbuf[0] << 24) & 0xFF000000) | ((syncbuf[1] << 16) & 0x00FF0000) | ((syncbuf[2] << 8) & 0x0000FF00) | ((syncbuf[3] << 0) & 0x000000FF);
try
{
source.unread(syncbuf, 0,... | 3 |
private void addDataToTable(TableDescription tableDescription, DataContainer allData) {
Map<String, Row> map = allData.getRowsByDescription(tableDescription);
String tableName = tableDescription.getName();
for (String key : map.keySet()) {
Row row = map.get(key);
try {
... | 4 |
public synchronized void removeVM(SlaveVM vm) throws UnreachableVMException {
System.out.println("DEBUG: VM " + vm.getId() + " is deleted");
if (vmsInUse.contains(vm))
vmsInUse.remove(vm);
if (vmsAvailable.contains(vm))
vmsAvailable.remove(vm);
vm.hardExit();
} | 2 |
@Override
public String execute(String[] args){
System.exit(0);
return null;
} | 0 |
public Emitter on(String event, Listener fn) {
ConcurrentLinkedQueue<Listener> callbacks = this.callbacks.get(event);
if (callbacks == null) {
callbacks = new ConcurrentLinkedQueue <Listener>();
ConcurrentLinkedQueue<Listener> _callbacks = this.callbacks.putIfAbsent(event, callba... | 2 |
public List<Location> adjacentLocations(Location location)
{
assert location != null : "Null location passed to adjacentLocations";
// The list of locations to be returned.
List<Location> locations = new LinkedList<Location>();
if(location != null) {
int row = location.ge... | 9 |
private String getNextString() {
while ( pos < content.length() && content.charAt(pos) == ' ')
pos++;
if (pos >= content.length())
return new String("");
if (content.charAt(pos) == '<') {
int endPos = content.indexOf('>', pos);
String retStr = content.substring(pos, endPos+1);
pos = endPos + 1;
... | 4 |
public static Stream allocate() { // create
synchronized (Stream.queue) {
Stream stream = null;
if (Stream.pointer > 0) {
Stream.pointer--;
stream = (Stream) Stream.queue.popFront();
}
if (stream != null) {
stream.offset = 0;
return stream;
}
}
Stream stream = new Stream();
stream... | 2 |
public void print(){
for(int i =0 ; i < 9; i++){
for(int j = 0 ; j< 9; j++){
System.out.print ( etat[i][j]+" " );
}
System.out.println();
}
} | 2 |
@Override
public void setBoolean(long i, boolean value)
{
if (ptr != 0) {
Utilities.UNSAFE.putShort(ptr + sizeof * i, value == true ? (short) 1 : (short) 0);
} else {
if (isConstant()) {
throw new IllegalAccessError("Constant arrays cannot be modified.");
... | 4 |
public static void enginePulse(){
if(Game.currentGame == null)
return;
if(ObjectAction.difficulty == null){
Miscellaneous.log("[FATAL] Cycle rate not set, game ending.");
Engine.destructGame();
}
for(Entity entity : Entity.entityList){
enti... | 3 |
public Output() {
instance = this;
// Check for HTML-Output
if (Config.getHtmlPath() != null) {
checkValidHtmlPath();
}
} | 1 |
@Override
public void execute(VGDLSprite sprite1, VGDLSprite sprite2, Game game) {
if(sprite1.is_resource)
{
Resource r = (Resource) sprite1;
applyScore=false;
int numResources = sprite2.getAmountResource(r.resource_type);
if(numResources + r.value <=... | 3 |
public static List<String> tokenize(String source) {
List<String> tokens = new ArrayList<String>();
String token = "";
for (char c : source.toCharArray())
if (isSpace(c)) {
if (!token.isEmpty()) {
tokens.add(token);
token = "";
}
}
else
token += c;
if (!token.isEmpty())
tokens... | 4 |
private static boolean homePageForPassenger(ObjectOutputStream toServer, ObjectInputStream fromServer, Scanner scanner) throws ParseException, IOException, ClassNotFoundException {
log.debug("Start method \"homePageForPassenger\"");
System.out.println("1 - find train, 2 - timetable by station, 3 - buy t... | 8 |
private synchronized Set<Message.RequestMessage> cancelPendingRequests() {
Set<Message.RequestMessage> requests =
new HashSet<Message.RequestMessage>();
if (this.requests != null) {
for (Message.RequestMessage request : this.requests) {
this.send(Message.CancelMessage.craft(request.getPiece(),
req... | 2 |
private boolean writeSign(Sign sign, Set<Matcher> matchers) {
int index = 0;
boolean needComma = false;
String[] lines = {"", "", ""};
for (Matcher matcher : new HashSet<>(matchers)) {
String tmp = needComma ? "," : "";
tmp += matcher.toString();
if ... | 4 |
private int secuenciaDeNodosContiguos(){
int rta=-1;
if(secuencia.size()>1){
for(int i =1; i<secuencia.size();i++){
if(secuencia.get(i).getPosX()!=secuencia.get(i-1).getPosX()
||secuencia.get(i).getPosY()!=secuencia.get(i-1).getPosY() ){
rta=i;
i=secuencia.size();
}
}
}
return ... | 4 |
private List<RegexNode> generateNodes(Map<Integer, List<Symbol>> table)
{
List<RegexNode> singles = new ArrayList<>();
List<RegexNode> parens = new ArrayList<>();
for (Entry<Integer, List<Symbol>> entry : table.entrySet())
{
List<Symbol> symbols = entry.getValue();
... | 8 |
public JSONObject accumulate(String key, Object value)
throws JSONException {
testValidity(value);
Object o = opt(key);
if (o == null) {
put(key, value instanceof JSONArray ?
new JSONArray().put(value) :
value);
} else if (o... | 3 |
public ConsoleEvaluationHandler(PrintStream output, Reader console) {
if (output == null) {
throw new IllegalArgumentException("The given output stream must not be null.");
}
if (console == null) {
throw new IllegalArgumentException("The given console must not be null.");... | 2 |
String anonymizeString(String input,String nameToBeAnonymized)
{
//extract name terms
String nameTerms[] = nameToBeAnonymized.split(" ");
String textTerms[] = input.split(" ");
String output = null;
//go through input, replace name term sequences with substitute
boolean lastTermWasName = false;
for(int ... | 8 |
public int getNumValue(boolean isABig) {
switch (_value) {
case "A":
if (isABig) {
return 14;
} else {
return 1;
}
case "J":
return 11;
case "Q":
return 12;... | 5 |
@Test
public void testGetNeighbourhoodBest1Maximum(){
boolean result = true;
double testFitness = 19;
classUnderTest.setMaximum(true);
classUnderTest.setWheel(19);
for(int i = 0; i < 20; i++){
if(testSolutions.get(classUnderTest.neighbourhoodBest(i)) < testFitness){
result = false;
}
}
assertTr... | 2 |
@Override
public List findRecords(String sqlString, boolean closeConnection) throws SQLException, Exception {
Statement stmt = null;
ResultSet rs = null;
ResultSetMetaData metaData = null;
final List list = new ArrayList();
Map record = null;
// do this in an excpeti... | 7 |
private void swim(int k){
while(k > 1 && less(k/2, k)){
exch(k/2, k);
k = k/2;
}
} | 2 |
public static Record getAchievementRecordByXMLElem(XMLElement root) {
User user = null;
Achievement achievement = null;
for (int i = 0; i < root.childList.size(); i++) {
XMLElement elem = root.childList.get(i);
if (elem.name.equals("user")) {
user = User.getUserByUsername(elem.content);
} else if (el... | 5 |
public static long getElapsed(int tickID) {
if (TickCount - tickID >= Ticks.length) {
}
long time = Ticks[(tickID % Ticks.length)];
return System.currentTimeMillis() - time;
} | 1 |
private void actionMix( )
{
DefaultMutableTreeNode
selNd = getSelectedNode();
if ( selNd != null )
{
int[] selIdxs = getNodeIndexList(selNd);
if ( selIdxs.length == 1 )
{
LinkedList<double[]> audioList = audioVectors.get(selIdxs[0]);
int m = audioList.size();
if ( m > 0 )
{
NumberDialog numbe... | 5 |
public static void createGraphs(LinkedList<Game> games) {
HashMap<String, XYSeriesCollection> datasets = new HashMap<>();
for (Game game : games) {
for (String key : game.getVarData().keySet()) {
if (datasets.containsKey(key)) {
try {
... | 9 |
public void heal() {
List<Player> rangeList = getPlayersInRegion();
for (Player p : rangeList) {
if (p.getHealth() != 20) {
if (!p.isDead()) {
p.setHealth(p.getHealth() + 1);
}
}
}
} | 3 |
public Set propagateUsage() {
used = new SimpleSet();
Set allUse = new SimpleSet();
Set childUse0 = subBlocks[0].propagateUsage();
Set childUse1 = subBlocks[1].propagateUsage();
/*
* All variables used somewhere inside both sub blocks, are used in this
* block, too. Also the variables used in first bloc... | 1 |
public MetropolisTableModel() {
// construct column names
colNames = new ArrayList<String>(
Arrays.asList("Metropolis", "Continent", "Population"));
// connection to database
try {
// make sure JDBC driver is loaded
Class.forName("com.mysql.jdbc.Driver");
// create connection between our ac... | 2 |
public boolean isSyncMark(int headerstring, int syncmode, int word)
{
boolean sync = false;
if (syncmode == INITIAL_SYNC)
{
//sync = ((headerstring & 0xFFF00000) == 0xFFF00000);
sync = ((headerstring & 0xFFE00000) == 0xFFE00000); // SZD: MPEG 2.5
}
else
{
sync = ((headerstring & 0xFFF80C00) ==... | 5 |
public RdpPacket_Localised receive() throws RdesktopException, IOException,
CryptoException, OrderException {
int sec_flags = 0;
RdpPacket_Localised buffer = null;
while (true) {
int[] channel = new int[1];
buffer = McsLayer.receive(channel);
if (buffer == null)
return null;
buffer.setHeader(Rd... | 7 |
public Point2DInt[] getCornersOfOneSide(LineSegmentInt seg, int sgn) {
final Point2DInt[] corners = getCorners();
final double sgn0 = seg.side(corners[0]);
final double sgn1 = seg.side(corners[1]);
final double sgn2 = seg.side(corners[2]);
final double sgn3 = seg.side(corners[3]);
int nb = 0;
if (Math.sig... | 8 |
public boolean getScrollableTracksViewportHeight() {
if (adapt)
return true;
return getPreferredSize().height < getParent().getSize().height;
} | 1 |
public void cellAltDraw(int x, int y){
if(!sedna.getSelected() ||sedna.getSelection(x,y)){
if(cellfillflag){
switch(cft){
case 0: populate(x,y,2); break;
case 1: break;
case 2: break;
default: populate(x,y,2); break;}
}
else{ switch(cdt){
... | 9 |
@Basic
@Column(name = "LOG_CANTIDAD")
public int getCantidad() {
return cantidad;
} | 0 |
public static String traducirMensaje(int id){
if(id == 0)
return "Mensaje de login";
if(id == 1)
return "Mensaje para todos";
if(id == 2)
return "Mensaje privado";
if(id == 4)
return "Mensaje de logout";
return "Error: Mens... | 4 |
public String getDesc() {
return desc;
} | 0 |
@Before
public void setUp() {
TestHelper.signon(this);
MongoHelper.setDB("fote");
MongoHelper.getCollection("users").drop();
for(User user : users) {
if(!MongoHelper.save(user, "users"))
TestHelper.failed("user save failed!");
}
} | 2 |
public static MapFunction getInstance(Node root) throws ParsingException {
URI returnType = null;
NodeList nodes = root.getChildNodes();
for (int i = 0; i < nodes.getLength(); i++) {
Node node = nodes.item(i);
if (node.getNodeName().equals("Function")) {
... | 6 |
private void costomedicamentosFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_costomedicamentosFieldKeyTyped
// TODO add your handling code here:
if (!Character.isDigit(evt.getKeyChar()) && evt.getKeyChar() !='.' && !Character.isISOControl(evt.getKeyChar()))
{
T... | 4 |
public static void main(String[] args) throws InterruptedException, IOException, PropertyException, JAXBException {
String path = "F:\\TargetFolder";// System.getProperty("user.dir");
boolean watchSubtree = false;
//injector = GuiceInjector.getInjector();
FileOperationMask fileOperationMask = injector.getIn... | 1 |
private MainFrame(){
frame = new JFrame();
initialize();
} | 0 |
public Pos findGoalPos() throws Exception
{
ArrayList<String> sTypes = new ArrayList<>();
for(int i = 1; i < 5; i++)
{
for(int j = 1; j < 5; j++)
{
//loops over the board, trying to find a unknown square.
sTypes = m_Logic.locateAllAt(j,... | 8 |
private boolean jj_3R_45() {
if (jj_scan_token(RETURN)) return true;
Token xsp;
xsp = jj_scanpos;
if (jj_3_32()) {
jj_scanpos = xsp;
if (jj_3_33()) return true;
}
if (jj_scan_token(SEMICOLON)) return true;
return false;
} | 4 |
public Map placeNodes(TreeModel tree, NodeDrawer drawer) {
HashMap nodeToPoint = new HashMap();
int[] width = Trees.width(tree), sofar = new int[width.length];
Arrays.fill(sofar, 0);
setPoints((TreeNode) tree.getRoot(), width.length - 1, 0, width, sofar,
nodeToPoint);
return nodeToPoint;
} | 0 |
public void parseFile( OperationList oplist ) throws Exception{
FileReader in_file = new FileReader( data_file );
BufferedReader file_buff = new BufferedReader( in_file );
String[] split_1, split_2, operands;
String op_portion, comment_portion = "";
String li... | 9 |
public RoomState state(int row, int col){
return grid[row][col];
} | 0 |
@Override
public boolean equals(Object obj) {
if (obj instanceof Location) {
Location other = (Location) obj;
return this.x == other.x && this.y == other.y;
}
return false;
} | 2 |
private void getNextPosition() {
// movement
if (left) {
dy -= moveSpeed;
if (dy < -maxSpeed) {
dy = -maxSpeed;
}
} else if (right) {
dy += moveSpeed;
if (dy > maxSpeed) {
dy = maxSpeed;
}
}
// falling
if (falling) {
dy += fallSpeed;
}
} | 5 |
public ArrayList<Edge> getToDo() {
if (this.runDFS) {
return this.dfs.toDo;
}
else {
return this.bfs.toDo;
}
} | 1 |
public LoopingByteInputStream(byte[] buffer) {
super(buffer);
closed = false;
} | 0 |
public VerbConjugator(){
int confirm = 1;
String verb = JOptionPane.showInputDialog(null, "Please input a verb in romaji to conjugate (dictionary form)");
Verb v = null;
try {
v = new Verb(verb);
} catch (Exception e) {
JOptionPane.showMessageDialog(null, "The input value does not conform to Japanese gr... | 6 |
private void createDir(String dir) {
File f = new File(dir);
if(f.exists() && !f.isDirectory()) {
Main.fatalError("Cannot create folder '" + dir + "'. There is a file called the same name.");
} else if(!f.exists()){
try {
if(!f.mkdirs()) {
Main.fatalError("Could not generate all of the directories ... | 5 |
public double standardizedAllResponsesMaximum(){
if(!this.dataPreprocessed)this.preprocessData();
if(!this.variancesCalculated)this.meansAndVariances();
return this.standardizedAllResponsesMaximum;
} | 2 |
@Override
void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild)
{
// Replace child
for(ListIterator<PComando> i = this._comando_.listIterator(); i.hasNext();)
{
if(i.next() == oldChild)
{
if(newChil... | 3 |
public static PaymentResponse fromXml(String xml) throws ArsenalPayApiException {
PaymentResponse paymentResponse = read(xml);
String status = paymentResponse.getMessage();
if (! "OK".equalsIgnoreCase(status)) {
throw translateToException(status);
}
return paymentResp... | 1 |
public void paint(Graphics2D g,boolean draw,boolean fill){
if (calcularVar) {
calcular();
calcularVar = false;
}
if (draw && !fill) {
g.draw(path);
}else if(fill && !draw){
g.fill(path);
}else if(draw && fill){
... | 7 |
public static void main(String args[]) {
try {
UIManager.setLookAndFeel(
UIManager.getSystemLookAndFeelClassName());
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
try {
... | 8 |
private boolean startGame() {
//To do Decide who is starting
// in case of ai openent I'm starting
if (playerIsReady && (oponent.getPlayerState() == ePlayerState.Ready)) {
if (oponent instanceof AI) {
if (gui != null) {
gui.updateState... | 6 |
public static String getMediaPath(String fileName)
{
String path = null;
String directory = getMediaDirectory();
boolean done = true;
// if the directory is null
if (directory == null)
{
// try to find the mediasources directory
try {
// get the URL for where we load... | 5 |
protected void loadFields(com.sforce.ws.parser.XmlInputStream __in,
com.sforce.ws.bind.TypeMapper __typeMapper) throws java.io.IOException, com.sforce.ws.ConnectionException {
super.loadFields(__in, __typeMapper);
__in.peekTag();
if (__typeMapper.isElement(__in, Case__typeInfo)) {
... | 9 |
public static void main(final String[] args) throws Exception {
int i = 0;
int flags = ClassReader.SKIP_DEBUG;
boolean ok = true;
if (args.length < 1 || args.length > 2) {
ok = false;
}
if (ok && "-debug".equals(args[0])) {
i = 1;
flag... | 9 |
@Override
public void generate() throws GeneratorException {
//get the extension of the template
String ext="";
String templateFile = report.getTemplate();
int i = templateFile.lastIndexOf('.');
if (i >= 0) {
ext = templateFile.substring(i+1);
}
try {
report.generate(report.getOutput()+"."+ext)... | 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.