text stringlengths 14 410k | label int32 0 9 |
|---|---|
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Estoque other = (Estoque) obj;
if (this.id != other.id) {
return false;
}
ret... | 3 |
public static void main(String[] args) {
// TODO code application logic here
//6. Дан двумерный массив целых чисел.
//б) Последний нулевой элемент каждою столбца заменить на число 100
//(предполагается, что в каждом столбце есть нулевой элемент).
System.out.println("*** Задани... | 3 |
public int solution(int[] array) {
if (array.length == 1) {
return -2;
}
sort(array);
long minimumDistance = Long.MAX_VALUE;
for (int i = 1; i < array.length; i++) {
long distance = (long) array[i] - array[i-1];
if (distance < minimumDistance) {
minimumDistance = distance;
}
}
return m... | 4 |
@Override
public void setSheetName( String newname )
{
cch = (byte) newname.length();
byte[] namebytes;
if( !ByteTools.isUnicode( newname ) )
{
grbitChr = 0x0;
}
else
{
grbitChr = 0x1;
}
try
{
if( grbitChr == 0x1 )
{
namebytes = newname.getBytes( UNICODEENCODING );
}
else
... | 4 |
protected LSystemEnvironment getEnvironment() {
return environment;
} | 0 |
public static void main(String[] args) {
try {
setupLog4j();
CommandLine commandLine = parser.parse(ConsoleOptions.OPTIONS, args);
if (commandLine.hasOption("d")) {
Logger.getLogger("net.kahowell.xsd.fuzzer").setLevel(Level.DEBUG);
}
for (Option option : commandLine.getOptions()) {
if (option.g... | 9 |
public String[] getEditableDimensionArray() {
TreeSet dim_set = new TreeSet();
for (Iterator i = parameters.values().iterator(); i.hasNext();) {
Parameter p = (Parameter)(i.next());
if (p.getSize() > 0) {
String foo = "";
for (int j = 0; j < p.get... | 5 |
@Override
public boolean equals(Object obj) {
if (obj == this) return true;
if (obj == null || !(obj instanceof java.util.Map.Entry)) return false;
java.util.Map.Entry<?,?> me2 = (java.util.Map.Entry<?,?>)obj;
return (HashedMap.compareObjects(key, me2.getKey()) && HashedMap.compareObjects(getValue(), me2.... | 8 |
public RandomInt() {
s.add(new BigInteger("12345")); // initial seed
// calculate first 4 elements of series
for (int i = 0; i < 3; i++) {
// calculate si+1 from si
s.add(s.get(i).multiply(new BigInteger("22695477")).add(new BigInteger("1")));
}
} | 1 |
@Override
public byte[] write(DataOutputStream out, PassthroughConnection ptc, KillableThread thread, boolean serverToClient) {
if(length == null) {
return null;
}
Short lengthTemp = lengthUnit.write(out, ptc, thread, serverToClient);
if(lengthTemp == null) {
return null;
}
if((short)(lengthTemp... | 7 |
@Test
public void testServerSetQueueTimeoutDisconnectIndividualInvalidEx() {
LOGGER.log(Level.INFO, "----- STARTING TEST testServerSetQueueTimeoutDisconnectIndividualInvalidEx -----");
boolean exception_other = false;
String client_hash = "";
try {
server2.setUseMessageQu... | 5 |
@Override
public boolean execute(CommandSender sender, String identifier,
String[] args) {
if (sender instanceof Player) {
try {
ArrayList<String> list = new ArrayList<String>();
String ownedIds = "";
list = DBManager.getOwnedTitles(sender.getName());
if (list.size() >= 1) {
for (String ... | 4 |
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 fe... | 6 |
@Override
public GrammarTree createGrammarTree(SyntaxAnalyser analyser)
throws GrammarCreateException {
GrammarTree grammarTree = new GrammarTree(new Token(TokenType.KEYWARD,
"all"));
AnalyticResult tokens = analyser.getAnalyticResult();
Token tempToken = tokens.front();
if (tempToken == null) {
Gram... | 6 |
public boolean checkInitalBridge() {
if (client_bridge.isCreateGameRequest()) {
client_bridge.setGameCreated(true);
client_bridge.setCreateGameRequest(false);
setClientId(Messager.Id_Server);
start();
return true;
}
if (client_bridge.isJoinGameRequest()) {
try {
sleep(1000);
} catch (I... | 3 |
@EventHandler
public void banCheck(LoginEvent e) throws SQLException {
if(BansManager.isPlayerBanned(e.getConnection().getName())){
Ban b =BansManager.getBanInfo(e.getConnection().getName());
if(b.getType().equals("tempban")){
if(BansManager.checkTempBan(b)){
e.setCancelled(true);
SimpleDateForma... | 3 |
@Override
public boolean equals(Object o){
if (o == null) { return false; }
if (o == this) { return true; }
if (o.getClass() != getClass()) {
return false;
}
RomanNumeral rn = (RomanNumeral) o;
return new EqualsBuilder()
.append(this.value, rn.value)
.isEquals();
} | 3 |
@Override
public int getRank() {
return rank;
} | 0 |
@Override
public void mousePressed(MouseEvent e) {
System.out.println("Clicked pressed at pixel (" + e.getX() + ", " + e.getY() + ")");
int x = e.getX() * _width / getWidth();
int y = e.getY() * _height / getHeight();
System.out.println("Which is cell (" + x + ", " + y + ")");
if (_dra... | 1 |
public static int kmpStrStr(String text, String pattern) {
if(text == null || pattern == null) {
return -1;
}
Set<Character> dedup = new HashSet<>();
// find all unique characters in pattern
for(char c : pattern.toCharArray()) {
dedup.add(c);
}
... | 7 |
protected void onDccSendRequest(String sourceNick, String sourceLogin, String sourceHostname, String filename, long address, int port, int size) {} | 0 |
@Override
public void actionPerformed(ActionEvent arg0)
{
if (colorGain)
colorN += 5;
else
colorN -= 5;
if (colorN >= 200)
colorGain = false;
else if (colorN <= 30)
colorGain = true;
if (!seen)
{
tutorial = true;
if (tutorialX > 0)
{
tutorialX -= 15;
tutorialEnd = true;
}
... | 8 |
private void requestUpdateRange() {
int i = 0;
for (DBUpdate u : updates) {
console.printf("[%d]: %s\n", ++i, u.getFileName());
}
first = 0;
while (first < 1) {
String sfirst = requestInputWithFallback("First Update", "1");
try {
first = Integer.parseInt(sfirst);
} catch (NumberFormatExcepti... | 9 |
public Discretize(Element discretize, FieldMetaInfo.Optype opType, ArrayList<Attribute> fieldDefs)
throws Exception {
super(opType, fieldDefs);
/* if (m_opType == FieldMetaInfo.Optype.CONTINUOUS) {
throw new Exception("[Discretize] must have a categorical or ordinal optype");
} */
m_fi... | 7 |
public long getTotalTicketsSold() {
return totalTicketsSold;
} | 0 |
private void jButtonApplyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonApplyActionPerformed
String type = typeAskPanel1.getTypeAsk();
jPanel1.setLayout(new BorderLayout());
jPanel1.removeAll();
switch (type) {
case "SelectedTest":
... | 8 |
public Icon getIcon(File file) {
return file.isFile() ? file_icon : folder_icon;
} | 1 |
public void generateFakeCorpus(String filePrefix){
HashMap<Integer, Double> t_wordSstat = new HashMap<Integer, Double>();
double t_allWordFrequency = 0;
for(_Doc d:m_corpus.getCollection()){
if(d instanceof _ChildDoc){
_SparseFeature[] fv = d.getSparse();
for(int i=0; i<fv.length; i++){
in... | 9 |
public static boolean helpFinalizeClass(Stella_Class renamed_Class, Surrogate finalizedparent) {
if (renamed_Class.classFinalizedP) {
return (true);
}
KeyValueList.setDynamicSlotValue(renamed_Class.dynamicSlots, Stella.SYM_STELLA_BADp, Stella.TRUE_WRAPPER, null);
{ Surrogate renamed_Super = null;
... | 8 |
public void sendRequest(Player player) {
if (sent) return;
player.sendPluginMessage(The5zigMod.getInstance(), "5ZIG", ("/ts/seconds=" + seconds + ";up=" + up + ";id=" + id + ";name=" + name).getBytes());
sent = true;
} | 1 |
public void listenForControls(int dt) {
float movementSpeed = 0.015f * dt;
if (Keyboard.isKeyDown(Keyboard.KEY_A)) {
main.player.strafeLeft(movementSpeed);
}
if (Keyboard.isKeyDown(Keyboard.KEY_D)) {
main.player.strafeRight(movementSpeed);
}
if (Keyboard.isKeyDown(Keyboard.KEY_SPACE)) {... | 5 |
public void setShowRowDivider(boolean visible) {
if (visible != mShowRowDivider) {
mShowRowDivider = visible;
notify(TreeNotificationKeys.ROW_DIVIDER, Boolean.valueOf(mShowRowDivider));
}
} | 1 |
public static ExtensionRegistry getInstance()
{
if(registrySingleton == null) {
try {
// locate file in bundle
URL url = ExtensionRegistry.class.getClassLoader().getResource(CONFIG_PROPERTIES_FILENAME);
if(url != null) {
// open file and parse it
Properties config = new Properties();
... | 6 |
public Menu(Descent descent) {
this.descent = descent;
addMouseListener(new MouseInputAdapter() {
@Override
public void mouseClicked(MouseEvent event) {
Font font = Menu.this.descent.getTitleFont().deriveFont(16.0F);
if (SwingUtilities.isLeftMouseB... | 7 |
public GuiFrame() {
total.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
CardLayout cardLayout = (CardLayout) panelcontainer.getLayout();
cardLayout.show(panelcontainer,"totalpanel");
/... | 0 |
@Override
public void tick(int arg0, int arg1, int arg2) {
ArrayList<ComponentPlayer> comps = player.getComponentsOfType(ComponentPlayer.class);
ColliderBox coll;
if(comps.size() > 0)
coll = player.pos.add(comps.get(0).colliderPos).getColliderWithDim(comps.get(0).colliderDim);
else
coll = player.pos.getC... | 3 |
private void getPossibleEventsForDate(Date selectedDate){
Hall selectedHall = (Hall) hallCombo.getSelectedItem();
String selectedHallName = selectedHall.getName();
ArrayList<Event> allAssignedEvents = new ArrayList<Event>();
allAssignedEvents = getAllAssignedEvents();
eventCombo.removeAllItems();
for (in... | 8 |
public static String htmlEscape(String input) {
if (input == null) {
throw new IllegalArgumentException("Null 'input' argument.");
}
StringBuilder result = new StringBuilder();
int length = input.length();
for (int i = 0; i < length; i++) {
char c = input.... | 8 |
public static void aNewWalk() {
try {
String firstDirectoryName = "/home/xander/test/test1";
String secondDirectoryName = "/home/xander/test/test1/test2";
String fileOne = "/home/xander/test/test1/firstFile.txt";
String nameOfTheLinkToFileOne = "/home/xander/test/... | 2 |
public void readCharacterDefinition(String filename, UnknownDictionary dictionary) throws IOException {
FileInputStream inputStream = new FileInputStream(filename);
InputStreamReader streamReader = new InputStreamReader(inputStream, encoding);
LineNumberReader lineReader = new LineNumberReader(streamReader);
S... | 5 |
long fixedFromGJ(int year, int monthOfYear, int dayOfMonth) {
if (year == 0) {
throw new IllegalArgumentException("Illegal year: " + year);
}
int y = (year < 0) ? year + 1 : year;
long y_m1 = y - 1;
long f = JULIAN_EPOCH - 1 + 365 * y_m1 + div(y_m1, 4)
+ d... | 4 |
public void addTray(Tray tray) {
if (!this.trays.contains(tray)) {
this.setSlotNumber(tray);
this.trays.add(tray);
tray.setStorageUnit(this);
}
} | 1 |
public double[] getColumnCopy(int ii){
if(ii>=this.numberOfColumns)throw new IllegalArgumentException("Column index, " + ii + ", must be less than the number of columns, " + this.numberOfColumns);
if(ii<0)throw new IllegalArgumentException("column index, " + ii + ", must be zero or positive");
... | 3 |
public void fillPreRequisites(Ability A, DVector rawPreReqs)
{
for(int v=0;v<rawPreReqs.size();v++)
{
final String abilityID=(String)rawPreReqs.elementAt(v,1);
if(abilityID.startsWith("*")||abilityID.endsWith("*")||(abilityID.indexOf(',')>0))
{
final List<String> orset=getOrSet(A.ID(),abilityID);
... | 7 |
public Object getFromCache(String key) throws Exception {
Object result = null;
// We get the SoftReference represented by that key
SoftReference softRef = (SoftReference) map.get(key);
if (softRef != null) {
// From the SoftReference we get the value, which can be
// null if it was not in the map, or it ... | 6 |
public void bodyDetected(double x, double y, double width, double height, double dist) {
// calculate body-center pos (image) x,y 0..1
double cX = x + width / 2;
double cY = y + height / 2;
Point2D absPos = this.camPosToAbsPos(new Point2D(cX, cY));
Point3D cartPos = this.... | 6 |
Message parse(final DataInputStream input)
throws IOException {
if (input == null) {
throw new IllegalArgumentException("Input stream for ISO8583 message cannot be null");
}
final MessageReader reader = getMessageReader();
// if the header field is required, check that it is present
fin... | 9 |
public static void main( String[] args )
{
System.out.println( "NanoHTTPD 1.0 (c) 2001 Jarno Elonen\n" +
"(Command line options: [port] [--licence])\n" );
// Show licence if requested
int lopt = -1;
for ( int i=0; i<args.length; ++i )
if ( args[i].toLowerCase().endsWith( "licence" ))
{
lopt = i;... | 8 |
public void handleConf(CSTAEvent event) {
if ((event == null)
|| (!(event.getEvent() instanceof CSTAPickupCallConfEvent))) {
return;
}
this.device.replyTermPriv = event.getPrivData();
Vector<TSEvent> eventList = new Vector<TSEvent>();
if (this.terminalAddress == this.pickConnection.getTSDevice()) {
... | 9 |
public void run() {
while(connected){
try {
int i = inputStream.readInt();
IPacket packet = PacketList.instance.getPacketFromID(i);
if (packet != null){
if (!packet.isClientPacket() || packet.isServerPacket()){
... | 5 |
public void update(int delta) {
while(performAction(delta) != -1);
} | 1 |
public boolean testForward() throws PersistitException {
setPhase("a");
_ex.clear().append(Key.BEFORE);
int index1 = 0;
int index2;
while (_ex.next() && !isStopped()) {
index2 = (int) (_ex.getKey().decodeLong());
for (int i = index1; i < index2; i++) {
... | 9 |
public Person1 (int id,String Name,Double height)
{
this.id = id;
this.Name = Name;
this.height = height;
} | 0 |
public PrintAutonomousMove(double speed,double waitTime){
_speed = speed;
_waitTime = waitTime;
} | 0 |
public int getArmor() {return armor;} | 0 |
public static void main(String args[]) throws IOException {
/* 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 deta... | 6 |
@Override
public void processPacket(Client c, int packetType, int packetSize) {
int tradeId = c.getInStream().readSignedWordBigEndian();
c.getPA().resetFollow();
if(c.arenas()) {
c.sendMessage("You can't trade inside the arena!");
return;
}
if(c.playerRights == 2 && !Config.ADMIN_CAN_TRADE) {
... | 4 |
public static GsonBuilder registerAdapters(GsonBuilder builder)
{
builder.registerTypeAdapter(GeoJsonObject.class, new GeoJsonObjectAdapter());
builder.registerTypeAdapter(LngLatAlt.class, new LngLatAltAdapter());
return builder;
} | 0 |
public static void main(String[] args) throws Throwable{
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
StringBuffer sb = new StringBuffer();
ArrayList<Figura> figuras = new ArrayList<Figura>();
for (String ln; !(ln = in.readLine().trim()).equals("*"); ) {
String[] arr = ln.split(... | 9 |
public ChatRoom getChatRoomAt(int index) {
if(list == null) {
return null;
}
if(index < 0 || index >= list.size()) {
return null;
}
return list.get(index);
} | 3 |
public static boolean compare(int a, int b) {
long resa = a;
long resb = b;
int ta = a;
int tb = b;
do {resa = resa * 10; tb = tb / 10;} while (tb != 0);
resa = resa + b;
do {resb = resb * 10; ta = ta / 10;} while (ta != 0);
resb = resb + a;
if (resa >= resb) return true;
return ... | 3 |
public void move() {
x += dx;
y += dy;
Dimension d = panel.getSize();
if (x < 0) {
x = 0;
dx = -dx;
} else if (x + BALL_DIAM >= d.width) {
x = d.width - BALL_DIAM;
dx = -dx;
}
if (y < 0) {
y = 0;
dy = -dy;
} else if (y + BALL_DIAM >= d.height) {
y = d.height - BALL_DIAM;
dy = -d... | 4 |
public boolean getUpdate(){
if (prop.getProperty("autoUpdate").equals("true"))
return true;
else
return false;
} | 1 |
private static void printGerber(ArrayList<Gaussian> primes) throws Exception {
System.out.println(GerberPlottables.GERBER_HEADER);
System.out.println("G75*");
int scale = 1000;
// double radius = scale/2*2/Math.sqrt(3);
double radius = scale/2;
for(Gaussian e: primes)
System.out.println(GerberPlottables.circ... | 1 |
@Test
public void findStudentBookingsByMonthAndYearTest() {
try {
SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT);
DiningHall d1 = new DiningHall(24, BigDecimal.valueOf(4.00),
DiningHall.Type.MADRUGADORES);
DiningHall d2 = new DiningHall(20, BigDecimal.valueOf(5.00),
DiningHall.Type.COME... | 1 |
public void setCondicao(PExpLogica node)
{
if(this._condicao_ != null)
{
this._condicao_.parent(null);
}
if(node != null)
{
if(node.parent() != null)
{
node.parent().removeChild(node);
}
node.parent... | 3 |
private void shiftLeft(int position) {
// int countOfLeftShift = 0;
// countOfLeftShift = (items.length - 1) - position;
for (int count=position; count > 0; count--) {
items[count]=items[count+1];
}
} | 1 |
public void setPause(int seconds) {
try {
Thread.sleep(seconds * 1000);
} catch (InterruptedException e) {
System.out.printf("\n%s", "Some thing went wrong!!!");
}
} | 1 |
private static void traverseFields(Class<?> c, List<Field> out)
{
List<Field> fieldList = new ArrayList<Field>();
for (Field f : c.getFields())
{
if ((f.getModifiers() & (Modifier.STATIC | Modifier.TRANSIENT)) == 0)
{
f.setAccessible( true );
... | 5 |
private boolean camposCompletos (){
if((!field_codigo.getText().equals(""))&&
(!field_nombre.getText().equals(""))&&
(!field_apellido.getText().equals(""))&&
(!field_localidad.getText().equals(""))&&
(!field_direccion.getText().equals(""))&&
(!field_sit_fre... | 6 |
public static Praticien selectNum(EntityManager em, String nom, String prenom) throws PersistenceException {
Praticien praticien = null;
Query query = em.createQuery("select pra.numero from Praticien pra where pra.nom = :nom and pra.prenom = :prenom");
query.setParameter("nom", nom);
que... | 0 |
@SuppressWarnings("deprecation")
@Override
public boolean girisYap(String kullaniciAdi, String sifre) throws Throwable {
if (!kullaniciAdi.isEmpty() && !sifre.isEmpty()) {
kullanici = new Calisan();
if (kullanici.girisYap(kullaniciAdi, sifre)) {
kullanici.bilg... | 3 |
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof ComparableObjectSeries)) {
return false;
}
if (!super.equals(obj)) {
return false;
}
ComparableObjectSeries that = (ComparableObjectSerie... | 7 |
@Override
public boolean existsLockRead(Long connectionId, String objectType) {
return readLocks.contains(objectType + lockSeparate + connectionId);
} | 0 |
public static BEProvince fromCode(String code){
if (!StringUtils.isBlank(code)){
String codeUpper = code.toUpperCase().trim();
for (BEProvince p : BEProvince.values()){
if (codeUpper.equals(p.provinceCode)){
return p;
}
}
}
return null;
} | 3 |
private final String getChunk(String s, int slength, int marker)
{
StringBuilder chunk = new StringBuilder();
char c = s.charAt(marker);
chunk.append(c);
marker++;
if (isDigit(c))
{
while (marker < slength)
{
c = s.charAt(marker... | 5 |
private Set<Local> getAllDeadKeys(List<Local> live_var){
Set<Local> dead_keys = new HashSet<Local>();
for(Map.Entry<Local, Set<Local>> e: map.entrySet()){
if(!live_var.contains(e.getKey())){
Set<Local> myset = e.getValue();
boolean flag = true;
for(Local l: myset){
if(live_var.contains(l)){
... | 5 |
public void mostrarDatos(beansVentas registros){
if(registros.getAccion().equals("Descuento")){
System.out.println("Descripcion "+registros.getDescripcion());
System.out.println("Descuento "+registros.getDescuento()+"%");
System.out.println("TotalSinDescuento "+registros.getTotalSinDescue... | 2 |
public static void get_bill_configure()
{
try{
FileInputStream in = new FileInputStream(billConfigFile);
try (BufferedReader bufffile = new BufferedReader(new InputStreamReader(in, "UTF8")))
{
String strLine;
strLine = bufffile.readLine();... | 5 |
public static Double toDouble(Object obj) {
if(obj==null)
return null;
String string=StringUtils.trimNonNumeric(obj.toString());
Double o=null;
try {
o=new Double(Double.parseDouble(string));
} catch (NumberFormatException ex) {
}
return o;
} | 2 |
@Override
public void collideWith(Element e) {
if (e instanceof Moveable)
getGrid().teleportElement(e, destination);
} | 1 |
public static String toString(JSONObject jo) throws JSONException {
StringBuffer sb = new StringBuffer();
sb.append(escape(jo.getString("name")));
sb.append("=");
sb.append(escape(jo.getString("value")));
if (jo.has("expires")) {
sb.append(";expires=");
s... | 4 |
public void mousePressed(MouseEvent event) {
int x = event.getX();
int y = event.getY();
int mouseButton = event.getButton();
Marking initialMarking = PNEditor.getRoot().getCurrentMarking();
if (PNEditor.getRoot().getClickedElement() != null
&& PNEditor.getRoot()... | 9 |
public void init( ArrayList<Monster> mon ) {
int enmyCt = 1 + (int)(Math.random()*4); //How many enemies in play?
while ( enmyCt > 0 ) { //Add rand enmys to battle depending on MONSTERS
try {
Class mans = MONSTERS.get((int)(Math.random()
*MONSTERS.size())).getClass();
_eInPlay.add( (Monster)(m... | 4 |
public String getRealName() {
return realName;
} | 0 |
private void put(JsonElement value) {
if (pendingName != null) {
if (!value.isJsonNull() || getSerializeNulls()) {
JsonObject object = (JsonObject) peek();
object.add(pendingName, value);
}
pendingName = null;
} else if (stack.isEmpty()) {
product = value;
} else {
... | 5 |
public void keyPressed( KeyEvent e ) {
int iday = getSelectedDay();
switch ( e.getKeyCode() ) {
case KeyEvent.VK_LEFT:
if ( iday > 1 )
setSelected( iday-1 );
break;
case KeyEvent.VK_RIGHT:
if ( iday < lastDay )
setSelected( iday+1 );
break;
case KeyEvent.VK_UP:
if ( iday > 7 )
setSel... | 8 |
private static boolean bestPermutationMutated (Tour tour, int a, int b, int c, int d, int e, int f) {
City A = tour.getCity(a);
City B = tour.getCity(b);
City C = tour.getCity(c);
City D = tour.getCity(d);
City E = tour.getCity(e);
City F = tour.getCity(f);
double[] dist = new double... | 9 |
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
jColorChooser1 = new javax.swing.JColorChooser();
jColorChooser2 = new javax.swing.JColorChooser();
buttonGroup1 = new javax.swing.But... | 3 |
@Override
public String getLabel()
{
if (Java8Util.PARAMETER_NAME == null)
{
throw new IllegalStateException("Missing Label");
}
try
{
return Java8Util.PARAMETER_NAME.invoke(javaParameter).toString();
}
catch (IllegalAccessException... | 2 |
private static String addScriptDirectives(Element scriptElement) throws IOException, DocumentTemplateException {
String scriptReplacement = "";
List scriptParts = parseScriptParts(scriptElement.getValue());
for (int index = 0; index < scriptParts.size(); index++) {
ScriptPart scriptPart = (ScriptPart) scrip... | 8 |
public void initFromXML( Element node, String projectDir )
{
NodeList nList = node.getElementsByTagName("settings") ;
Element elem = null ;
// a settings entry was found
if (nList != null)
{
if (nList.getLength() > 0)
{
elem = (Element) nList.item(0) ;
setProjectName( ... | 6 |
public static void displayJob(String selected) {
Position position = Position.fromString(selected);
Map<Evaluation, Set<Dwarf>> eval = new EnumMap<Evaluation, Set<Dwarf>>(Evaluation.class);
for (Dwarf dwarf : dwarvesList) {
Evaluation evaluation = position.evaluate(dwarf);
... | 8 |
public boolean validateAndStartScriptExecutable(ScriptExecutable pScriptExecutable, int pStatementSequence) {
try {
if(pScriptExecutable instanceof ScriptSQL){
ScriptSQL lScriptSQL = (ScriptSQL) pScriptExecutable;
//Check if we can run this exectuable
boolean lRunAllow... | 3 |
public State getState() {
return this.state;
} | 0 |
public void setOptions(String[] options) throws Exception {
String classifierString = Utils.getOption('W', options);
if (classifierString.length() == 0)
classifierString = weka.classifiers.rules.ZeroR.class.getName();
String[] classifierSpec = Utils.splitOptions(classifierString);
if (classifierS... | 7 |
public void copy(int[] src, int[] dst) {
for (int i = 0; i < dst.length; i++) {
if (src.length > i) {
dst[i] = src[i];
} else {
dst[i] = 0;
}
}
} | 2 |
public static boolean checkInBounds(Object array, int... coords) {
for (int i = 0; i < coords.length; ++i) {
if (i > 0)
array = Array.get(array, coords[i - 1]);
if (!array.getClass().isArray())
return false;
if (coords[i] < 0 || coords[i] >= Array.getLength(array))
return false;
}
return true... | 5 |
private Tree argumentListPro(){
Tree argumentList = null;
ArgumentListExpression argumentLists = null;
if((argumentList = expressionPro()) != null){
if(accept(Symbol.Id.PUNCTUATORS,",")!=null){
if((argumentLists = (ArgumentListExpression) argumentListPro()) != null){
return new ArgumentListExpressi... | 3 |
@SuppressWarnings("unchecked")
private void gatherAndLoad(ExecutionPlan plan, Collection<Class<?>> entities) {
List<Class<?>> sortedEntities = new ArrayList<Class<?>>(entities);
Collections.sort(List.class.cast(sortedEntities), Schema.CLASS_COMPARATOR);
for (Class<?> c : sortedEntities) {
plan.addOperation(ne... | 9 |
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.