text stringlengths 14 410k | label int32 0 9 |
|---|---|
protected void generateCode() {
List<Invalid> errors = validateData();
if (!errors.isEmpty()) {
displayValidationErrorDialog(true, errors);
return;
}
JFileChooser save = new JFileChooser();
save.setAcceptAllFileFilterUsed(false);
save.setFileFilter(new FileNameExtensionFilter("JAR files", "jar"));
... | 7 |
private void setupNewStyle(final String installPath, final ModPack pack)
{
List<DownloadInfo> assets = gatherAssets(new File(installPath), pack.getMcVersion());
if (assets.size() > 0)
{
final ProgressMonitor prog = new ProgressMonitor(this, "Downloading Files...", "", 0, 10... | 7 |
public static String checkForLauncherUpdates(boolean verbose, String currentVersion, JSONObject versionsConfig) {
if (Util.versionIsEquivalentOrNewer(currentVersion, versionsConfig.get("latestmoddle").toString())) {
//Jump out if the launcher is up to date
Logger.in... | 7 |
public Course(String[] parameters){
this.shortName.add(parameters[0]);
setName(parameters[1]);
if (!parameters[2].isEmpty()) {
String[] crosslisted=parameters[2].split(",");
for(String s:crosslisted) {
this.shortName.add(s);
}
}
if (parameters[4].equals("LAB")){
setType("lab");
} else {
s... | 8 |
public boolean isSet(int i, int j){
boolean c = false;
if (board[i][j].equals("X") || board[i][j].equals("O")) c=true;
else c=false;
return c;
} | 2 |
public static void addListenerToAllComponents( String listenerName, EventListener listener, Component c ) {
if( c == null )
return;
try {
Class[] classes = listener.getClass().getInterfaces();
if( classes.length > 0 ) {
Method addListenerMethod = c.get... | 5 |
public int getNumberDisjoint(Organism organism2) {
int D = 0;
int maxNumberShortGenome, counterInnovNumber, i = 0, j = 0;
if (organism2.getLastGeneInovNumber() > this.getLastGeneInovNumber()) { //this - short genome
maxNumberShortGenome = this.getGenome().lastGeneInovNumber();
... | 5 |
private void clickMouse(final Gamepad gamepad) {
if (gamepad.isPressed(5) && !mouseLeftDown) {// R1 = left click
robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
mouseLeftDown = true;
System.out.println("Left Mouse Clicked");
}
if (!gamepad.isPressed(5) && mouseLeftDown) {
robot.mouseRelease(InputEvent... | 8 |
private Body() {
super(10);
initComponents();
} | 0 |
public String[][] getAllValues() throws IOException {
if (labels == null) setLabels();
String[][] allValues = parse.getAllValues();
if (allValues == null){
lastLine = null;
} else {
lastLine = allValues[allValues.length-1];
}
return allValues;
... | 2 |
private Image getFarbigenDrLittle(String name)
{
BufferedImage drlittle = ladeBild(getClass().getResource(
"bilder/drlittle.png"));
Color farbe = _spielerfarben.get(name);
if(farbe != null)
{
for(int i = 17; i < 54; i++)
{
for(int j = 0; j < 54; j++)
{
if(drlittle.getRGB(j, i) == Color.... | 7 |
public E min() {
final E returnValue = (E) heap.get(0);
return returnValue;
} | 0 |
@Override
public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Exception {
if(e.getMessage() instanceof HandshakeRequestEvent) {
Actions.addAction(new Action(ActionType.INFO, "Received handshake from Connection, validating..."));
/* Create a new NetworkEvent */
NetworkEvent ... | 3 |
private void blitNumber(int number, int x, int y) {
if (numbers!=null) {
String sNum=Integer.toString(number);
for (int i=0; i<sNum.length(); i++) {
char cNum=sNum.charAt(i);
int iNum=cNum-48;
buffer.blit(numbers, iNum*5, 0, x, y, 5, 9, FrameBuffer.TRANSPARENT... | 2 |
public Core(String[] args) throws Exception { // XXX main : Working
System.out.println("FabFileConverter V" + version + " Beta started.");
System.out.println("Programm path : " + pluginHandler.getApplicationPath());
for (int i = 0; i < args.length; i++) {
System.out.println(" args[" + i + "] - " + args[i]);
... | 6 |
private JComboBox<EnumValue> createCombo(EnumList p_enumList)
{
JComboBox<EnumValue> l_combo = new JComboBox<EnumValue>();
l_combo.addPopupMenuListener(new PopupMenuListener() {
public void popupMenuWillBecomeVisible(PopupMenuEvent p_e)
{
}
public void popupMenuWillB... | 6 |
public TableModel Update() {
String columnNames[] = { "ID","Nom","Prenom","Situation","Adresse","Classe"};
DefaultTableModel defModel = new DefaultTableModel();
defModel.setColumnIdentifiers(columnNames);
try {
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDr... | 4 |
public static String readTextFromReader(final Reader reader) {
StringBuffer sb = new StringBuffer();
char[] buf = new char[1024 * 4];
int readLen;
try {
while (-1 != (readLen = reader.read(buf))) {
sb.append(buf, 0, readLen);
}
} catch (IOException e) {
e.printStackTrace();
} finally {
if (... | 4 |
protected void updateCapabilitiesFilter(Capabilities filter) {
Instances tempInst;
Capabilities filterClass;
if (filter == null) {
m_ClassifierEditor.setCapabilitiesFilter(new Capabilities(null));
return;
}
if (!ExplorerDefaults.getInitGenericObjectEditorFilter())
tempInst... | 8 |
public void process(WikiArticle page, Siteinfo siteinfo)
throws SAXException {
if (page != null && page.getText() != null
&& !page.getText().startsWith("#REDIRECT ")) {
// Zap headings ==some text== or ===some text===
// <ref>{{Cite
// web|url=http://tmh.floonet.net/articles/falseprinciple.ht... | 6 |
public static void main( String[] argv ) {
//String msg = "Hallo, das ist ein Test.";
//byte[] data = msg.getBytes();
byte[] data = new byte[256];
for( int i = 0; i < data.length; i++ )
data[i] = (byte)i;
int size = data.length;
System.out.println( "Creating buffer (size="+ size + ") ..." );
Circular... | 6 |
public static <E extends Enum<E>>E lookup (Class<E> e, String id ){
try {
E result = Enum.valueOf(e, id.toUpperCase());
return result;
} catch (IllegalArgumentException e2) {
return null;
}
} | 1 |
public void makeKey() {
BufferedReader standardInput = launcher.openStandardInput();
boolean accepted = false;
// Frage jeweils solange die Eingabe ab, bis diese akzeptiert werden kann.
do {
Logger("Geben Sie den Modulus ein: ");
try {
modulus = Integer.parseInt(standardInput.readLi... | 9 |
public static String[] splitIKRSMD5( String str )
throws NumberFormatException {
// Format (example):
// keel:${ikrs.http.MD5}$12345678$xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
String[] split = str.split( "(\\$)" );
if( split.length != 4 )
throw new NumberFormatException( "The string is not an ikrs-MD5 sum (cod... | 5 |
public void add(Force f) {
double myX = this.getX();
double hisX = f.getX();
double myY = this.getY();
double hisY = f.getY();
double newX = myX + hisX;
double newY = myY + hisY;
this.magnitude = Math.pow(Math.pow(newX, 2) + Math.pow(newY, 2), 0.5);
if (newX == 0) {
if (newY > 0) {
direction = ... | 8 |
public void fadeOutIn(FilenameURL filenameURL, long milisOut, long milisIn) {
if (filenameURL == null) {
errorMessage("Filename/URL not specified in method 'fadeOutIn'.");
return;
}
if (milisOut < 0 || milisIn < 0) {
errorMessage("Miliseconds may not be negative in method "
+ "'fadeOutIn'.");
ret... | 5 |
private void portamento_down() {
if( ( portamento_param & 0xF0 ) == 0xE0 ) {
/* Extra-fine porta.*/
if( effect_tick == 0 ) {
set_period( period + ( portamento_param & 0x0F ) );
}
} else if( ( portamento_param & 0xF0 ) == 0xF0 ) {
/* Fine porta.*/
if( effect_tick == 0 ) {
set_period( period +... | 5 |
public void renderRaisedMob(int xp, int yp, Sprite s) {
int w = s.W;
int h = s.H;
xp -= xOffs;
yp -= yOffs;
int[] iso = twoDToIso(xp, yp);
xp = iso[0];
yp = iso[1] - 20;
for (int y = 0; y < h; y++) {
int ya = y + yp - h; // absolute position
... | 8 |
public void visitShiftExpr(final ShiftExpr expr) {
if (previous == expr.expr()) { // the expression to be shifted is like
previous = expr; // the left child
expr.parent().visit(this);
} else if (previous == expr.bits()) {
check(expr.expr()); // the right child
}
} | 2 |
public void processFile() throws IOException {
if (displayInfo) {
System.out.println(" *** tape info:");
System.out.println(" " + getTapeRecord().toString());
for (FileRecord fileRecord : getFileRecords()) {
System.out.println(" *** file record:");
... | 8 |
public void enable() {
disabled = false;
} | 0 |
public String getRepeatedCharsAsString(String one, String two) {
Map<Character, Integer> charFrequency;
StringBuilder builder = new StringBuilder();
String longer;
if (one.length() > two.length()) {
charFrequency = makeCharFrequencyMap(two);
longer = one;
... | 9 |
public InvitePk insert(Invite dto) throws InviteDaoException {
long t1 = System.currentTimeMillis();
// declare variables
final boolean isConnSupplied = (userConn != null);
Connection conn = null;
PreparedStatement stmt = null;
ResultSet rs = null;
try {
// get the user-specified connection or get a connec... | 9 |
public void paint(Graphics g)
{
if (previewState != null)
{
mxGraphics2DCanvas canvas = graphComponent.getCanvas();
if (graphComponent.isAntiAlias())
{
mxUtils.setAntiAlias((Graphics2D) g, true, false);
}
float alpha = graphComponent.getPreviewAlpha();
if (alpha < 1)
{
((Graphics2D)... | 3 |
void probabilities() {
// Already done, nothing to do
if (prob != null) return;
// Get total length and count for chromosomes (chromosome size is total genome length)
String chrType = Chromosome.class.getSimpleName();
long chrSize = countBases.get(chrType);
long chrCount = countMarkers.get(chrType);
if (... | 4 |
private void setOriginServer(ConfigurationCommands command,
String[] parameters) {
POPXY popxy = POPXY.getInstance();
User user = null;
String[] serverAndPort = parameters[0].split(":");
Integer port = null;
if (serverAndPort.length == 2) {
port = Integer.parseInt(serverAndPort[1]);
}
// Se le se... | 9 |
public void PhysicsSolve ()
{
// capture Image
BufferedImage screenshot = ActionRobot.doScreenShot();
// process image
VisionRealShape vision = new VisionRealShape(screenshot);
// get all object
List<ABObject> objects = vision.findObjects();
List<ABObject> pigs = vision.findPigs();
List<ABObject> bir... | 7 |
public void fixTile() {
if (stop) {
return;
}
if (!board.isGameOver() && !playPanel.isAnimating()) {
playPanel.fixCurrentTile();
scorePanel.repaint();
if (board.isGameOver()) {
if (board.getWinner() > -1) {
cheers.play();
}
playPanel.displayResult();
} else if (board.getPlayers()[b... | 8 |
private synchronized void receiveAd(Sim_event ev)
{
if (super.reportWriter_ != null) {
super.write("receive router ad from, " +
GridSim.getEntityName(ev.get_src()));
}
// what to do when an ad is received
RIPAdPack ad = (RIPAdPack)ev.get_data();
... | 7 |
public static String getAlias(Class<? extends ConfigurationSerializable> clazz) {
DelegateDeserialization delegate = clazz.getAnnotation(DelegateDeserialization.class);
if (delegate != null) {
if ((delegate.value() == null) || (delegate.value() == clazz)) {
delegate = null;
... | 7 |
void build( CodeWriter src, CodeWriter res ) throws IOException {
// write classes
for (JDefinedClass c : classes.values()) {
if (c.isHidden())
continue; // don't generate this file
JFormatter f = createJavaSourceFileWriter(src, c.name());
f.write(... | 9 |
public void calcTEmodeEffectiveRefractiveIndices(){
this.effectiveRefractiveIndicesTE = new double[this.numberOfTEmeasurementsGrating];
this.effectiveErrorsTE = new double[this.numberOfTEmeasurementsGrating];
if(!this.setSuperstrateRI){
this.superstrateRI = RefractiveIndex.air(super... | 4 |
public boolean addElement(Element elem) {
if (filled + elem.getValue() <= capacity) {
filled += elem.getValue();
elements.add(elem);
return true;
}
return false;
} | 1 |
@Override
public String toString() {
NumberFormat formatter = new DecimalFormat("0.#####E0");
return "\n" + "NaturalSatellite{" +
"id=" + id +
", name='" + name + '\'' +
", mass=" + formatter.format(mass) +
(inhabited ? ", population=" ... | 1 |
void WFext( double[][] A)
{
edge f, g;
if ( head.leaf() && tail.leaf() )
distance = A[head.index][head.index];
else if ( head.leaf() )
{
f = tail.parentEdge;
g = siblingEdge();
distance = 0.5*(A[head.index][g.head.index]
+ A[head.index][f.head.index]
- A[g.head.index][f.head.index]);
... | 3 |
* @throws ArithmeticException if numeric overflow occurs
*/
@Override
public YearMonth plus(PlusAdjuster adjuster) {
return (YearMonth) adjuster.doPlusAdjustment(this);
} | 9 |
private void formComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_formComponentShown
// TODO add your handling code here:
}//GEN-LAST:event_formComponentShown | 0 |
private <T> T createBean(ResultSet rs, Class<T> type,
PropertyDescriptor[] props, int[] columnToProperty)
throws SQLException {
T bean = this.newInstance(type);
for (int i = 1; i < columnToProperty.length; i++) {
if (columnToProperty[i] == PROPERTY_NOT_FOUND) {
... | 6 |
public void update(int delta) {
if(this.elapsedTime >= this.delay) {
if(this.currentAnimation < this.animation.size() -1) this.currentAnimation++;
else this.currentAnimation = 0;
this.elapsedTime = 0;
} else {
this.elapsedTime += delta;
}
//Testing:
this.position.add(new Vector2f(-2,0));
t... | 2 |
private EntityObject AddObjectToDB(EntityObject obj)
throws DataProviderAddingException {
if (!obj.getClass().isAnnotationPresent(Entity.class)) {
throw new DataProviderAddingException(obj.getClass());
}
boolean generated = true;
// is id auto generated
... | 9 |
@Override
public Object getTeleportPacket(Location loc) {
Class<?> PacketPlayOutEntityTeleport = Util.getCraftClass("PacketPlayOutEntityTeleport");
Object packet = null;
try {
packet = PacketPlayOutEntityTeleport.getConstructor(new Class<?>[] { int.class, int.class, int.class, int.class, byte.class, byte.cl... | 8 |
private File getConfigFile(String file) {
if (file.isEmpty() || file == null) {
return null;
}
File configFile;
if (file.contains("/")) {
if (file.startsWith("/")) {
configFile = new File(plugin.getDataFolder()
+ file.re... | 4 |
private void removeMode(final Theory theory, final String str) throws ParserException {
int l = -1;
if ((l = str.indexOf(DflTheoryConst.SYMBOL_MODE_CONVERSION)) > 0) {
try {
String o = str.substring(0, l).trim();
String[] c = str.substring(l + DflTheoryConst.SYMBOL_MODE_CONVERSION.length()).split(
... | 6 |
public Object get(String key) throws JSONException {
Object o = opt(key);
if (o == null) {
throw new JSONException("JSONObject[" + quote(key) +
"] not found.");
}
return o;
} | 1 |
public void getUserInfo(int offset, String postfix, int startIdx, int endIdx) {
CommonLogger.logger.info("--------begin users' information collection--------");
OAuthRequest req = null;
BufferedWriter userInfoWriter = null, errorWriter = null;
String tName = Thread.currentThread().getName();
try {
userI... | 8 |
public void addEvent(Event event) {
events.add(event);
switch (event.getType()) {
case Event.MARRIAGE:
if (marriage == null)
marriage = event;
break;
}
} | 2 |
public void displayTerrainData(Tile tile) {
if (tile == null) {
label.setText("None");
} else if (tile.hasStatus(TileStatus.Type.BLOCKED)) {
label.setText(TileStatus.Type.BLOCKED.toString() + "(" + tile.getStatusDuration(TileStatus.Type.BLOCKED) + ")");
} else {
label.setText("Normal terrain");
}
} | 2 |
@Override
protected boolean canRun(ClassNode node) {
if (classNodes.containsKey("LinkedList"))
return false;
int fieldCount = 0;
int nodeCount = 0;
ListIterator<FieldNode> fnIt = node.fields.listIterator();
while (fnIt.hasNext()) {
fieldCount++;
... | 5 |
private Seasons(String name, int id) {
this.name = name;
this.id = id;
} | 0 |
private void fillComponents() {
for (int i = 0; i < componentList.size(); i++) {
// Fill text components
if (componentList.get(i) instanceof Text) {
((Text) componentList.get(i)).setText(row.getElementAt(i));
// Fill table viewer components
} else if (componentList.get(i) instanceof DetailedAttr... | 6 |
private int getColorValue(String inputComponent, BufferedImage image, int x, int y) {
int value;
switch (inputComponent) {
case "a":
value = getA(image, x, y);
break;
case "r":
value = getR(image, x, y);
break;
... | 4 |
public void mouseMoved(MouseEvent e) {
boolean test = false;
if (test || m_test) {
System.out.println("GameBoardGraphics :: mouseMoved() BEGIN");
}
m_colX = (e.getX() / getSquareWidth()) * getSquareWidth();
m_colY = (e.getY() / getSquareHeight()) * getSquareHeight();
m_nextColX = (e.getX() / getSquareWid... | 4 |
@Override
public PermissionType getType() {
return PermissionType.GROUP;
} | 0 |
@SuppressWarnings("unchecked")
public void run() {
log.info("Attempting to connect to chat server...");
try {
socket = new Socket(plugin.getConfig().getString("chat-server"), 51325);
out = new DataOutputStream(socket.getOutputStream());
in = new DataInputStream(socket.getInputStream());
} catch (Unknown... | 9 |
public double calculateEnergyConsumptionEP(SoftwareSystem system, FunctionalRequirement functionalRequirement, SequenceAlternative sequenceAlternative) {
double consumption = 0;
system.getActuallyUsedHardwareSets().clear();
for (Message message : sequenceAlternative.getMessages()) {
double componentConsumption... | 4 |
public void onEnable(){
loadConfig();
this.getCommand("RageQuit").setExecutor(new RageQuitCommand(this));
this.getCommand("rq").setExecutor(new RageQuitCommand(this));
this.getCommand("hug").setExecutor(new HugCommand(this));
this.getCommand("kiss").setExecutor(new KissCommand(this));
th... | 2 |
ServerFrame(String professorName,String departmentName,String subjectName,String topicName) throws IOException
{
super("Class Room Interaction");
/*
File image2=new File("Images/mic_icon.png");
System.out.println("hello lavish kothari");
try {
Image image = ImageIO.read(image2);
this.setIconImages((... | 5 |
protected Casella obertura()
{
if ( partida.getTornsJugats() == 0 )
{
return new Casella( 4, 2 );
}
Casella fitxa_posada = null;
// Busquem quina és la fitxa que ha posat l'altre jugador
int fila = 0;
while ( fitxa_posada == null && fila < partida.getTauler().getMida() )
{
int columna = 0;
w... | 8 |
private boolean versionCheck(String title)
{
if(type != UpdateType.NO_VERSION_CHECK)
{
String version = plugin.getDescription().getVersion();
if(title.split(" v").length == 2)
{
String remoteVersion = title.split(" v")[1].split(" ")[0]; // Get the ... | 6 |
private List<Node> closestNodesNotFailed(Byte status)
{
List<Node> closestNodes = new ArrayList<>(this.config.k());
int remainingSpaces = this.config.k();
for (Map.Entry e : this.nodes.entrySet())
{
if (!FAILED.equals(e.getValue()))
{
if (stat... | 4 |
public int[] search(int[] a, int k){
if(a==null || k>a.length) return new int[0];
int[]result=new int[k];
int cur=-1;
for(int i=0;i<k;++i){
cur=max(a,cur,a.length-k+1+i);
result[i]=a[cur];
}
return result;
} | 3 |
public static void saveRentTransaction(RentTransaction rentTransaction){
try {
if(conn == null || conn.isClosed()){
conn = DatabaseConnection.getConnection();
}
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
try {
conn.setAut... | 9 |
public AudioDevice createAudioDevice() throws JavaLayerException
{
AudioDevice device = null;
AudioDeviceFactory[] factories = getFactoriesPriority();
if (factories==null)
throw new JavaLayerException(this+": no factories registered");
JavaLayerException lastEx = null;
for (int i=0; (device==null) &... | 6 |
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, AccessLevel__typeInfo)) {... | 9 |
public void mapObjectToPSTM(PreparedStatement pstm, T bean, String... labels) throws SQLException, NoSuchColumnLabel {
for( int i = labels.length; i>0; i-- ){ //fields are identified from 1 for preparedStatement.setXX()
String s = labels[i-1];
try {
mapObject(pstm, i, getters.get(s).invoke(bean));
} c... | 3 |
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
Transferable clipboardContent = getToolkit().getSystemClipboard().getContents(this);
if ((clipboardContent != null)
&& (clipboardContent.isDataFlavorSupported(DataFla... | 3 |
@Override
public void init(GameContainer container, StateBasedGame sbg)
throws SlickException {
//Init Resources
if(!Globals.RESOURCES_INITIATED){
Checkers.initRessources();
}
//GameType Box
gameTypeBox = new GameTypePrompt();
gameTypeBox.pvaiButton = new MouseOverArea(container, ResourceManager.... | 8 |
public boolean importData(JComponent jcIn, Transferable tIn)
{
if (! this.canImport(jcIn, tIn.getTransferDataFlavors()))
{
return false;
}
try
{
EzimMsgOut emoTarget = null;
Object objTmp = null;
emoTarget = (EzimMsgOut) jcIn.getParent().getParent()
.getParent().getParent().getParent();
... | 7 |
public MovieSubtitles parseSubtitlies(String fileName)
throws SubtitlesParserException {
MovieSubtitles result = new MovieSubtitles();
InputStream inputStream = getClass().getClassLoader()
.getResourceAsStream(fileName);
if (inputStream == null) {
try {
inputStream = new FileInputStream(fileName);
... | 7 |
private boolean EsTelefonoCorrecto(String entrada_Telefono){
char Numero;
boolean TelefonoCorrecto = true;
boolean TelefonoIncorrecto = false;
if(entrada_Telefono.equals("")){
return TelefonoIncorrecto;
}else{
for(int Indice=0; Indice < entrada_Telefono... | 4 |
private void updateStatus() {
pane.stackDisplay.setText(stackString());
pane.inputDisplay.setText(STRING.substring(P));
} | 0 |
public String buildUrl(User user, VerifyImage img){
StringBuffer url = new StringBuffer();
// TODO 这里有待修改
// String urlV4 = this.fetionContext.getLocalSetting().getNodeText("/config/servers/ssi-app-sign-in-v2");
LocalSetting localSetting = new LocalSetting();
try {
localSetting.load(user);
} catch (IOE... | 5 |
private static String array2Str(Object[] source) {
StringBuffer buffer = new StringBuffer();
for (Object object : source) {
buffer.append(" ").append(object + "");
}
return buffer.toString();
} | 1 |
private void validaEntrada(int row, int col) {
switch (col) {
case 0:
Boolean inicia = (Boolean) tabelaAF.getValueAt(row, col);
if (inicia) {
for (int i = 0; i < modeloTabelaAF.getItens().size(); i++) {
if (((Boolean) modeloTabelaAF.getItens().get(i).get(0)) && row != i) {
JOptionPane.showMessa... | 8 |
public void gumbelMaxProbabilityPlot(){
this.lastMethod = 6;
// Check for suffient data points
this.gumbelMaxNumberOfParameters = 2;
if(this.numberOfDataPoints<3)throw new IllegalArgumentException("There must be at least three data points - preferably considerably more")... | 3 |
@Override
public void executeMsg(final Environmental myHost, final CMMsg msg)
{
super.executeMsg(myHost,msg);
if(!(affected instanceof MOB))
return;
final MOB mob=(MOB)affected;
if((msg.amITarget(mob))
&&(msg.targetMinor()==CMMsg.TYP_WEAPONATTACK)
&&(amountOfShieldArmor>0)
&&(mob.isInCombat())
&... | 9 |
@Test
public void testGetInstruction() throws IOException {
System.out.println("getInstruction");
AntBrain ab = new AntBrain("cleverbrain1.brain");
Ant instance = new Ant(ab,true,0);
Sense expResult = new Sense(Sense.dirFromString("here"),32, 1,Sense.condFromString("home"));
... | 0 |
private String expFormat(double d) {
String f = "";
int e = 0;
double dd = d;
double factor = 1;
while (dd > 10) {
e++;
factor /= 10;
dd = dd / 10;
}
while (dd < 1) {
e--;
factor *= 10;
dd = ... | 9 |
@Override
public String toString() {
StringBuffer sb = new StringBuffer(qname + "\t" + flag //
+ "\t" + rname //
+ "\t" + pos //
+ "\t" + mapq //
+ "\t" + cigar //
+ "\t" + rnext //
+ "\t" + pnext //
+ "\t" + tlen //
+ "\t" + seq //
+ "\t" + qual);
// Apend tags
for (int i = ... | 2 |
public void addMonster(){
int x;
int y;
String s = (String)JOptionPane.showInputDialog(
mainWindow,
"Give x and y coordinates\n"
+ "Seperated by /",
"Add monster",
JOptionPane.PLAIN_MESSAGE,
null,null,"");
if ((s ... | 9 |
public static Proposition updateProperty(LogicObject self, Surrogate surrogate, Keyword updatemode) {
{ Proposition value000 = null;
{ Proposition p = null;
Iterator iter000 = Logic.unfilteredDependentPropositions(self, surrogate).allocateIterator();
loop000 : while (iter000.nextP()) {
... | 6 |
private void RunTasks()
{
// TODO Auto-generated method stub
try
{
//System.out.println("In Run Tasks " + new Date().toString());
if(this._states!=null && this._states.size()>0)
{
//System.out.println("Total no of states " + this._states.size());
if(_currentState==null)
{
_currentState... | 5 |
private void loadNatives()
{
log("Loading Natives...");
String os = System.getProperty("os.name").toLowerCase();
String folder = "";
if (os.indexOf("win") >= 0)
{
log("OS: Windows");
folder = "windows";
}
else if (os.indexOf("mac") >= 0)
{
log("OS: Mac");
folder = ... | 6 |
private void endStep() {
ArrayList<Player> losingPlayers = new ArrayList<Player>();
for (Player p : this.players) {
if (p.checkHasLost()) {
// System.out.println("Player " + p.getPlayerNumber()
// + " has lost the game.");
losingPlayers.add(p);
}
}
for (Player p : losingPlayers) {
this.play... | 3 |
private static double[] getSupportPoints(int curvePoints,int lineNumber, double[] lowPrices) {
double[] sPoints = new double[lineNumber];
for(int i =0;i<lineNumber-1;i++){
double price = 999999999;
for(int j=-(curvePoints);j<=0;j++){
if((i+j>=0) && (i+j<lineNum... | 5 |
public String[] nextStrings(int n) throws IOException {
String[] res = new String[n];
for (int i = 0; i < n; ++i) {
res[i] = next();
}
return res;
} | 1 |
public final JSONArray toJSONArray(JSONArray names) throws JSONException {
if (names == null || names.length() == 0) {
return null;
}
JSONArray ja = new JSONArray();
for (int i = 0; i < names.length(); i += 1) {
ja.put(this.opt(names.getString(i)));
}
... | 3 |
public static byte menuAbrirCuentaClienteNuevo(){
byte op=0;
do{
try{
System.out.println("Cliente nuevo");
System.out.println("1. Abrir Cuenta Corriente");
System.out.println("2. Abrir Cuenta de Ahorro");
System.out.print("OP => ");
BufferedReader stdin=new BufferedReader(new InputStreamReader(Syst... | 3 |
public void init() {
if (wizzard == null && wizzardId != 0) {
wizzard = towerService.findWizzard(wizzardId);
} else if (wizzard == null && wizzardId == 0) {
wizzard = new Sorcerer();
}
if (wizzard == null) {
try {
FacesContext.getCurren... | 6 |
@Override
public void Consultar() throws SQLException
{
try
{
Conexion.GetInstancia().Conectar();
ResultSet rs = Conexion.GetInstancia().EjecutarConsulta("SELECT Nom_Sucursal ,Ciu_Sucursal ,Dir_Sucursal,Tel_Sucursal FROM Sucursal WHERE Cod_Sucursal ='"+ObSucursal.getCod_... | 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.