text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void actionPerformed(ActionEvent e) {
if (automaton.getInitialState() == null) {
JOptionPane.showMessageDialog((Component) e.getSource(),
"Simulation requires an automaton\n"
+ "with an initial state!", "No Initial State",
JOptionPane.ERROR_MESSAGE);
return;
}
Object input = initialI... | 3 |
public void paint(GC gc, int width, int height) {
if (!example.checkAdvancedGraphics()) return;
Device device = gc.getDevice();
// set line attributes
gc.setLineWidth(20);
gc.setLineCap(SWT.CAP_ROUND); // round line ends
gc.setAntialias(SWT.ON); // smooth jagged edges
Pattern pattern = null;
if (foreground.... | 5 |
public OperationProgressDialog(String title, String message, TestStatus event) {
super();
this.title = title;
this.message = message;
this.event = event;
JProgressBar jProgressBar = new JProgressBar();
jProgressBar.setIndeterminate(true);
final JOptionPane progres... | 2 |
private synchronized void start(){
if(running){
return;
}
running = true;
thread = new Thread(this);
thread.start();
} | 1 |
public GridProcessingManager(int threadsCount) {
this.threadsCount = threadsCount;
threads = new GridWorker[threadsCount];
threadStates = new boolean[threadsCount];
} | 0 |
public void onClick(int x, int y, int button){
for (int i=0;i<bHandler.length;i++){
Button b = bHandler[i];
if (b != null && x > b.getEntity().getHitBox()[0] && y > b.getEntity().getHitBox()[1] && x < b.getEntity().getHitBox()[2] && y < b.getEntity().getHitBox()[3] && button == 1){
... | 7 |
private void makeAliasList() {
if (entries.isEmpty())
return;
StringBuffer buf = new StringBuffer();
for (Iterator it = entries.iterator(); it.hasNext(); ) {
Entry entry = (Entry) it.next();
if (entry instanceof EnvelopeEntry) {
buf.append(((EnvelopeEntry) entry)... | 6 |
public void addStudent(Student student) throws IllegalArgumentException {
// Student names must be unique. This is because of a bug in JComboBox where
// getSelectedIndex() returns the first index that contains the name of
// the selected item: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4133743
... | 4 |
public void updateJComboBoxCouleur(){
this.jComboBoxCouleurs.removeAllItems();
List<Couleur> couleurs = new ArrayList<Couleur>();
try
{
couleurs = RequetesCouleur.selectCouleur(jTextFieldCouleurLibelle.getText());
}
catch (SQLException ex)
{
... | 3 |
public void seek1StepToOtherAdjacentLocation(Point centerLocation) {
if (!Physics.arePointsAdjacent(centerLocation, getLocation())) {
new IllegalArgumentException(
"currently not adjacent to centerLocation!").printStackTrace();
return; //TODO
//BUG Why does this happen sometimes?
}
Point[] adjace... | 4 |
public static <T> Object newPrimitiveArray(Class<T> type) {
if (type.equals(byte.class)) {
return newRandomByteArray();
} else if (type.equals(int.class)) {
return newRandomIntArray();
} else if (type.equals(double.class)) {
return newRandomDoubleArray();
} else if (type.equals(char.c... | 8 |
public WanFilter(final ConnectionProcessor proc, final Properties props) {
super(proc, props);
requireConfigKey(medianLatencyKey);
medianLatency = Long.parseLong(props.getProperty(medianLatencyKey));
} | 0 |
@Override
int transition(int absState, int position, int vector) {
// null absState should never be passed in
assert absState != -1;
// decode absState -> state, offset
int state = absState/(w+1);
int offset = absState%(w+1);
assert offset >= 0;
if (position == w) {
if (sta... | 8 |
private characters.Character findClosestFood(Object[] objects) {
DistList.clear();
for (int i = 0; i < World.getCharArray().length; i++) {
// System.out.println(i);
// System.out.println(World.getCharArray(i));
for (int xer = 0; xer <= MAX_DISTANCE; xer++) {
if (Utils.getDistance(World.getCharArray(i)... | 3 |
static void skipComment(IXMLReader reader)
throws IOException,
XMLParseException
{
if (reader.read() != '-') {
XMLUtil.errorExpectedInput(reader.getSystemID(),
reader.getLineNr(),
"<!--");
}
i... | 5 |
String classToType(Class cls) {
if (cls==Point.class) {
return "int2";
} else if (cls==Integer.TYPE
|| cls==Integer.class ) {
return "int";
} else if (cls==Double.TYPE
|| cls==Double.class ) {
return "double";
} else if (cls==String.class) {
return "String";
} else if (cls==Boo... | 8 |
private void processCatalogueDeleteMasterResult(Sim_event ev)
{
if (ev == null) {
return;
}
Object[] pack = (Object[]) ev.get_data();
if (pack == null) {
return;
}
String filename = (String) pack[0]; // get file name
int msg =... | 5 |
public void play() {
Scanner scanner = new Scanner(System.in);
System.out.println("************ Welcome to < B O W L I N G _ G A M E > ************");
System.out.print("Input Player Number : ");
int playerCount = scanner.nextInt();
createPlayer(playerCount);
for ( int frameNum = 0; frameNum < 10; f... | 2 |
public void removeFirst()
{
int position = 1;
if ( this.isEmpty() || position > numItems || position < 1 )
{
System.out.print("This delete can not be performed "+ "an element at position " + position + " does not exist " );
}
for (int i=position-1; i< numItems-1; i++)
this.bookArray[i] = this.bookArra... | 4 |
public static ArrayList<String> FetchjobsFromJobPortal(String urlForJob)
{
WebDriver driver1 = new FirefoxDriver();
// Code for pagination
driver1.get(urlForJob);
ArrayList<String> listOfJobs = new ArrayList<String>();
//WebElement ulOfPagination = divForJobs.findElement(By... | 8 |
@Test
public void testMarker() {
source.markColor("this", ColorConstants.WHITE);
source.markColor("is", ColorConstants.BLACK);
source.markColor("simple", ColorConstants.YELLOW);
source.markColor("text", ColorConstants.YELLOW);
List<Word> words = source.getKnownWords(ColorConstants.YELLOW);
assertEquals(2... | 8 |
public int getTreatmentSize(){
return treatment.size();
} | 0 |
public int firstIndexOf(Attributes attributeList) {
for (int i = 0; i < size; i++) {
if (attributeLists[i] == attributeList) {
return i;
}
}
return -1;
} | 2 |
public void updateTimer()
{
long l = Minecraft.func_71386_F();
long l1 = l - lastSyncSysClock;
long l2 = System.nanoTime() / 0xf4240L;
double d = (double)l2 / 1000D;
if (l1 > 1000L || l1 < 0L)
{
lastHRTime = d;
}
else
{
... | 7 |
public String validateConnection(Object source, Object target)
{
if (target == null && createTarget)
{
return null;
}
if (!isValidTarget(target))
{
return "";
}
return graphComponent.getGraph().getEdgeValidationError(
connectPreview.getPreviewState().getCell(), source, target);
} | 3 |
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{\n");
for(Variable i : vals) {
sb.append(i.getName());
sb.append(" : ");
if(i.getType().isPrimitive()) {
sb.append(i.getType());
} else if(i.getType().isArray()) {
sb.append(i.getType());
} else if(i.getType(... | 6 |
private void printDebug() {
System.out.println("============");
System.out.println("flame-cycle:" + flameCycle);
if (onDemandFetcher != null) {
System.out.println("Od-cycle:" + onDemandFetcher.onDemandCycle);
}
System.out.println("loop-cycle:" + Client.loopCycle);
... | 2 |
@Transactional
public Step createStep(Integer taskId, String stepName) {
Task task = tasksDao.getById(taskId);
if (task == null) {
throw new RuntimeException("No such task");
}
Step step = new Step();
step.setTask(task);
step.setName(stepName);
st... | 1 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
TracksInPlaylists that = (TracksInPlaylists) o;
if (playlistId != that.playlistId) return false;
if (trackId != that.trackId) return false;
... | 5 |
private void printAcross( ArrayList<Pair> pairs, Node u, BitSet incoming )
throws MVDException
{
int hint = -1;
Arc selected = u.pickOutgoingArc( incoming );
if ( selected != null )
{
if ( selected.to.isPrintedIncoming( selected.versions) )
System.out.println("incoming arc alre... | 5 |
@SuppressWarnings("rawtypes")
public SecurityCommand(Map o) {
this.area = ((Long) o.get("area") != null) ? ((Long) o.get("area")).intValue() : MessageConstants.DEFAULT_AREA;
this.mode = (SecurityModeEnum) o.get("mode");
this.code = ((Long) o.get("code") != null) ? ((Long) o.get("code")).intValue() : Mes... | 2 |
private static int binarySearch(int[] sorted, int key, int imin, int imax, int buffer) {
int imid = 0;
while (imax >= imin) {
imid = (imin + imax) / 2;
if (sorted[imid] < key) {
imin = imid + 1;
} else if (sorted[imid] > key) {
imax = imid - 1;
} else {
return sorted[imid];
}
}
return... | 3 |
private static void generateJavaFile(File genFolder, String packageName, String destClassName, String content) {
File folder = new File(genFolder, packageName.replaceAll("\\.", "/"));
if (!folder.exists()) {
folder.mkdirs();
}
File javaFile = new File(folder, destClassName + ".java");
if (javaFile.ex... | 9 |
public boolean confirm(Runnable runnable) {
boolean ret = false;
// if the model has changed since the last save
if(theModel.isDifferentFromFile()) {
// loop while the user's decision hasn't been made.
// this is here in case the user selects an erroneous
// choice. in that case, it will loop bac... | 7 |
public Object[] getValues()
{
for (int i = 0; i < editors.length; i++)
if (editors[i] != null)
values[i] = editors[i].getValue();
return values;
} | 2 |
private void sink(int i)
{
int t = pq[i]; // save for later restoring at correct position
while (2 * i + 1 <= N) // The node has both the children
{
int j = 2 * i + 1; // right child
if (greater(items[pq[j]], items[pq[j - 1]])) // determine the
// lesser child
j--;
if (greater(item... | 5 |
private Expr factor() {
if (theTokenizer.ttype == '(') {
theTokenizer.next();
Expr exp = expr();
theTokenizer.accept(')');
return exp;
} else if (theTokenizer.ttype == Tokenizer.TT_NUMBER) {
int x = (int) theTokenizer.nval;
theTokenizer.next();
return new Num(x);
} else if (theTokenizer... | 3 |
static String exec( List<String> cmd,
File binDir,
File workDir,
boolean parseOutput,
boolean tossErrorOutput )
throws IOException, InterruptedException
{
String[] cmdp = cmd.toArray( ... | 8 |
private void moviesInvolvedTableMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_moviesInvolvedTableMousePressed
if(moviesInvolvedTable.rowAtPoint(evt.getPoint()) == -1){
moviesInvolvedModel.fireTableDataChanged();
//purkkaviritys, koska moviesInvolvedTable.clearSelection(... | 3 |
public ModelCanvas get(Object key) {
if (!lazyInit)
return map.get(key);
ModelCanvas value = map.get(key);
if (value == null) {
if (key.equals(MOLECULAR_MODEL_1)) {
initAtomContainer(0);
value = new ModelCanvas(atomContainer[0]);
map.put(MOLECULAR_MODEL_1, value);
}
else if (key.equals(MOL... | 9 |
@Override
public boolean equals(Object obj){
if (obj == null) return false;
if (this == obj) return true;
if (getClass() != obj.getClass()) return false;
Person q = (Person)obj;
return name.equals(q.name);
} | 3 |
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
jLabelTitre = new javax.swing.JLabel();
jSeparator1 = new javax.swing.JSeparator();
jLabel... | 0 |
public static boolean supportsBatchUpdates(Connection con) {
try {
DatabaseMetaData metaData = con.getMetaData();
if (metaData != null) {
if (metaData.supportsBatchUpdates()) {
LOGGER.debug("JDBC驱动支持批量更新");
return true;
} else {
LOGGER.debug("JDBC驱动不支持批量更新");
}
}
} catch (SQLExce... | 4 |
@Override
@Deprecated
public String removeProtection(String EntityI, Vector<String> properties)
{
Vector<Vector<String>> triples= new Vector<Vector<String>>();
String xml="";
boolean ack=false;
//String Protection_Entity = "http://" + Double.toString(Math.random());
String Protection_Entity = "http://" ... | 4 |
public boolean peutSupprimer(Utilisateur utilisateur) {
return
utilisateur != null
&& (
utilisateur.equals(getCreateur()) ||
utilisateur.getRole().getValeur() >= Role.Moderateur.getValeur()
)
&& (
getCategorie().getJ... | 4 |
@Override
public void rotate(int angle)
{
super.rotate(angle,center);
setColoredExes();
} | 0 |
private void mapEmbeddedInInstance(ResultSet resultSet,ClassInspect parentInspector, E instance) throws ResultMapException {
List<Field> annotatedFields = parentInspector.findAllAnnotatedFields(Embedded.class);
ClassInspect embeddedClassInspector = null;
for(Field field : annotatedFields) {
logger.debug("Mappi... | 2 |
public Handshake(String s) throws MalformedHeaderException {
//System.out.println(s);
String[] headers_received = s.split("\n");
for (String header : headers_received) {
Header h = null;
try {
h = new Header(header);
} catch (SpecialHeaderException ex) {
Class search = ex.getCorrectType();
... | 5 |
private static void quit() {
// the stats of the game
System.out.println("Your statistics are:- ");
System.out.println("moves: " + moves);
System.out.println("money: " + playerBank);
System.out.println("score: " + points);
System.out.println("strength " + damage);
System.out.println("health: " + playerH... | 6 |
public void inject() throws ClassNotFoundException, NoSuchFieldException, IllegalAccessException, NoSuchMethodException, CannotCompileException, InstantiationException, NotFoundException, InvocationTargetException {
Field configManagerField = Class.forName("net.minecraft.server.MinecraftServer").getDeclaredFiel... | 4 |
private boolean readZipFile(String fileName)
{
boolean success = false;
ZipFile zipFile = null;
try
{
BufferedReader reader = null;
// ZipFile offers an Enumeration of all the files in the Zip file
zipFile = new ZipFile(fileName);
Enum... | 6 |
public AngriffOptions(JSONObject options) {
if (options.has("Zwerg")) {
try {
if (options.getBoolean("Zwerg")) {
buyCrystal = 0;
}
} catch (JSONException r) {
try {
buyCrystal = options.getInt("Zwerg");
} catch (JSONException p) {
}
}
}
if (options.has("Medizin")) {
try... | 6 |
private void updateWeights(double[] labels) {
NeuralNode[] outputNodes = _layers[_layers.length - 1].getNodes();
NeuralNode[] prevNodes = _layers[_layers.length - 2].getNodes();
for(int i = 0 ; i < prevNodes.length; i++){
for(int j = 0 ; j < outputNodes.length ; j++){
double deltaWeight;
if ((int) l... | 8 |
private String valorMonetario(Double valor) throws ValidacaoException {
String dinheiro = Validadores.isValorMonetario(valor);
if (dinheiro.isEmpty() || dinheiro.equals("0")) {
throw new ValidacaoException("O Campo " + validacao.Descricao() + " não é valor Monetário válido!");
} els... | 2 |
@Override
public void loadRcon() throws DataLoadFailedException {
ConfigurationSection sec = getData("server", "rcon");
YamlPermissionRcon permBase = new YamlPermissionRcon(sec);
load(PermissionType.RCON, permBase);
} | 0 |
public void tallennaTiedostoon(){
String palautettava = "";
for (String avain: opiskelut.keySet()) {
palautettava += avain + " " + opiskelut.get(avain) + " ";
}
kasittelija.tallennaTiedostoon(palautettava);
} | 1 |
public void setData(byte[] data) {
this.data = data;
} | 0 |
public GenericBuilderSupport() {
if (log.isLoggable(Level.CONFIG)) {
log.config("oms.version : " + System.getProperty("oms.version"));
log.config("oms.home : " + System.getProperty("oms.home"));
log.config("oms.prj : " + System.getProperty("oms.prj"));
}
} | 1 |
public int Problem87() {
int[] primos = Utility.listarPrimalidade((int) Math.sqrt(LIMITE87));
Set<Integer> sums = new HashSet<Integer>();
sums.add(0);
for (int i=2;i<=4;i++) {
Set<Integer> newSums = new HashSet<Integer>();
for (int p : primos) {
long q = 1;
for (int j=0;j<i;j++) {
q *= p;
... | 6 |
private static void accessServer() {
Socket link = null;
try {
link = new Socket(host, PORT);
Scanner input = new Scanner(link.getInputStream());
PrintWriter output = new PrintWriter(link.getOutputStream(), true);
// set up stream for keyboard entry..
Scanner userEntry = new Scanner(System.in);
S... | 3 |
public static void main(String path) throws IOException
{
File f=new File(path);
BufferedImage cat = ImageIO.read(f);
f.delete();
path=path.replace(".jpg_binary.png","");
path=path.replace(".JPG_binary.png","");
// Loop through all the pixels in th... | 9 |
private int getHitRegion(RPChromosomeRegion hitRegion, boolean contained) {
int hitCount = 0;
// check if new hit list is needed
// Note: getHitList will reset mLeafItemIndex to 0, the beginning of new hit list
if (leafHitList == null) { //|| mLeafItemIndex >= mLeafHitList.size()){
... | 4 |
private static void validateLocalePart(String localePart) {
for (int i = 0; i < localePart.length(); i++) {
char ch = localePart.charAt(i);
if (ch != '_' && ch != ' ' && !Character.isLetterOrDigit(ch)) {
throw new IllegalArgumentException(
"Locale part \"" + localeP... | 4 |
public static String convertFilenameToJSPName( String name )
{
StringBuffer buf = new StringBuffer();
char[] chars = name.toCharArray();
for( int i = 0; i < chars.length; i++ )
{
if( chars[i] == '_' )
{
chars[i + 1] = Character.toUpperCase( chars[i + 1] );
}
else if( chars[i] == '-' )
{
... | 4 |
public Individual[] selectIndividuals(Individual[] population) {
//make a new array to store the fit individuals
Individual[] fitIndividuals = new Individual[population.length];
//first, calculate the sum of e^(the fitness)
double fitnessSum = 0.0;
for(Individual i : population) {
fitnessSum += i.getExpFi... | 7 |
public static Dictionary createNew(Connection con, String name, String desc, String lang1, String lang2)
{
Dictionary dict = null;
try
{
PreparedStatement ps = con.prepareStatement(
"INSERT INTO " + tableInfo.tableName
+ " (Name, Descr, Lang1, Lang2) VALUES (?, ?, ?, ?)",
Statement.RETURN_GENER... | 2 |
public void tick() {
if (x != targetX || y != targetY) {
double pathX = (targetX - x);
double pathY = (targetY - y);
double distance = Math.sqrt(pathX * pathX + pathY * pathY);
xVel = (float) (pathX / distance) * 2;
yVel = (float) (pathY / distance) * 2;
x += xVel;
y += yVel;
}
if(t.Ring(... | 3 |
protected void formOrderList(SessionRequestContent request) throws ServletLogicException {
Criteria criteria = new Criteria();
User user = (User) request.getSessionAttribute(JSP_USER);
if (user != null) {
criteria.addParam(DAO_USER_LOGIN, user.getLogin());
ClientType type... | 4 |
final void method3805(int i, Interface11 interface11) {
try {
anInt7697++;
if (anInt7738 < 0
|| interface11 != anInterface11Array7741[anInt7738])
throw new RuntimeException();
anInterface11Array7741[anInt7738--] = null;
interface11.method45((byte) -47);
if (i == 8387) {
if (anInt7738 < 0... | 6 |
private void initLightPoint()
{
String str[] = DataCount.firstAccept(user_name);
String label0 = "你的排名为【" + str[0] + "】" + ",已完成【" + str[1] + "】道题";
String label1 = "你有【" + str[2] + "】道题第一次提交就获得Accept";
int num = 0;
String label2 = "你在 ";
Iterator<String> itertime = timemap.keySet().iterator();
while(ite... | 3 |
public Network(int inputNeurons, int hiddenLayers, int hiddenNeurons, int outputNeurons, boolean biased) {
if (inputNeurons < 1 || outputNeurons < 1 || hiddenLayers < 0) {
throw new IllegalArgumentException();
}
if (hiddenLayers > 0 && hiddenNeurons < 1) {
throw new IllegalArgumentException();
}
i... | 9 |
@Override
public void actionPerformed(ActionEvent e) {
//System.out.println("DefaultAction");
OutlinerCellRendererImpl textArea = null;
boolean isIconFocused = true;
Component c = (Component) e.getSource();
if (c instanceof OutlineButton) {
textArea = ((OutlineButton) c).renderer;
} else if (c in... | 7 |
public IClusterCalculable[][] getResult() {
//根据Tmatrix来输出结果
HashMap<Integer, ArrayList<IClusterCalculable>> clusterMap = new HashMap<Integer, ArrayList<IClusterCalculable>>();
for (int i = 0; i < dNum; i++) {
IClusterCalculable data = oriDatas[i];
data.setTypeID(Tmatrix[... | 4 |
public PolyBlockType getBlockType() {
int type = iterator.getBlockType();
for (PolyBlockType pbt: PolyBlockType.values()) {
if (type == pbt.value) {
return pbt;
}
}
LOGGER.warn("Unrecognized PolyBlockType: " + type);
return PolyBlo... | 2 |
private Enum<?> getOperator(Token token) {
for (Enum<?> oper : opers) {
if (token.equals(oper.toString()))
return oper;
}
return null;
} | 4 |
public synchronized boolean cacheClean()
{
long l = System.currentTimeMillis();
Enumeration localEnumeration = this.images.elements();
while (localEnumeration.hasMoreElements())
{
ImageTrack localImageTrack = (ImageTrack)localEnumeration.nextElement();
int i = checkImage(localImageTrack.... | 9 |
public void makeMagic() {
prevKey = keyStates;
keyStates = getKeyStates();
moveSuccess = false;
if (prevKey == keyStates) return;
if ((keyStates & LEFT_PRESSED) != 0) {
move(MV_LEFT);
} else if ((keyStates & RIGHT_PRESSED) != 0) {
move(MV_RIGHT);
... | 9 |
public void setHasVisited(boolean hasVisited) {
this.hasVisited = hasVisited;
} | 0 |
@EventHandler
public void EnderDragonHeal(EntityDamageByEntityEvent event) {
Entity e = event.getEntity();
Entity damager = event.getDamager();
String world = e.getWorld().getName();
boolean dodged = false;
Random random = new Random();
double randomChance = plugin.getEnderDragonConfig().getDouble("EnderDr... | 6 |
private void addPage(Element parent) {
Element pageNode = doc.createElementNS(getNamespace(), DefaultXmlNames.ELEMENT_Page);
parent.appendChild(pageNode);
//Image filename
addAttribute(pageNode, DefaultXmlNames.ATTR_imageFilename, page.getImageFilename());
//Width/height
addAttribute(pageNode, Default... | 6 |
public static Map<String,Integer> readTickers() throws IOException {
final BufferedReader reader = new BufferedReader(new FileReader("stocks.txt"));
final Map<String,Integer> stocks = new HashMap<String, Integer>();
String stockInfo = null;
while ((stockInfo = reader.readLine()) != null){
final S... | 1 |
private Queries()
{
} | 0 |
@Override
public void union(int p, int q)
{
int pRoot = find(p); // component of p
int qRoot = find(q); // component of q
// Do nothing if p and q belong to the same component
if (pRoot == qRoot)
return;
// Label the component-id of pRoot as qRoot, thus effectively making the
// component-id of all v... | 1 |
@Override
protected String crearTextoRespuesta() {
StringBuilder sb = new StringBuilder("***Resultados del algoritmo de deducción***\n\n");
sb = sb.append("Explicación:\n");
for (Regla r : reglasDisparadas) {
sb = sb.append("Se disparó la regla ").append(r.getIndiceDeRegla()).ap... | 3 |
public Packet packet() throws IOException {
if (eos)
return (null);
if (strm == null) {
strm = new StreamState();
page = in.page();
strm.init(page.serialno());
}
Packet pkt = new Packet();
while (true) {
int ret = strm.p... | 8 |
@Override
public boolean equals(Object other) {
if (!(other instanceof NBTBase)) {
return false;
} else {
NBTBase tempOther = (NBTBase) other;
return this.getId() == tempOther.getId() && ((this.name != null || tempOther.name == null)
&& (this.n... | 7 |
public boolean addSong(MusicObject music) throws SQLException {
if (connection == null) {
connection = getConnection();
}
if (addSongStmt == null) {
addSongStmt = connection.prepareStatement("INSERT INTO org.MUSIC" +
"(song_name," +
"file_name," +
"folder_path," +
"folde... | 3 |
private static void appendJSONPair(StringBuilder json, String key, String value) throws UnsupportedEncodingException {
boolean isValueNumeric = false;
try {
if (value.equals("0") || !value.endsWith("0")) {
Double.parseDouble(value);
isValueNumeric = true;
... | 5 |
private Set<String> parseOutcome(PreferenceMetaData pmd, BufferedReader reader, String line) throws IOException {
Set<String> outcome = new HashSet<String>();// First state/outcome in the trace
do {
for (String var : pmd.getVariables()) {
if (line.indexOf("\\" + var + " = ") != -1) {
line = line.tri... | 8 |
public ClassInfo getClazz() {
return clazz != null ? clazz : ClassInfo.javaLangObject;
} | 1 |
public final String getPackageName() {
String qname = qualifiedName;
int index = qname.lastIndexOf('.');
if (index < 0)
return null;
else
return qname.substring(0, index);
} | 1 |
protected boolean isPlaceHolder( String to_check ){
return ( to_check.equals("Add1") || to_check.equals("Add2") ||
to_check.equals("Mul1") || to_check.equals("Mul1") ||
to_check.equals("Div1") || to_check.equals("Div2") ||
to_check.equals("Load1")|| to... | 8 |
Animal(String name, float weight, String speech, FlyingAbility flyingAbility) {
this.name = name;
this.weight = weight;
this.speech = speech;
this.flyingAbility = flyingAbility;
} | 0 |
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 |
private void _outOtherStatements() {
pw.println("\n" +
" ////////////////////\n" +
" // other statements");
_outEdgeOtherRelationStyle();
for ( Statement stmt : _info.getStatements() ) {
// TODO for now, ignoring statements about ontology resource
if ( _info.containsOntology(stmt.getSubje... | 9 |
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 VTKPanel(SimulatorWindow rootFrame) {
fcInput = new JFileChooser();
fcInput.setFileFilter(new FileNameExtensionFilter("XML-Dateien", "xml"));
fcOutput = new JFileChooser();
final VTKPanel contentPane = this;
final SimulatorWindow window = rootFrame;
setLayout(new GridBagLayout());
GridBagCons... | 7 |
void transParseInterp(String langlocale, String format, String interrupts, ArrayList<SS_log> log, ArrayList<SS_playlist> pl, ArrayList<SS_arglist> argsx, String transcount)
{
read.lock();
try
{
SS_translation trans = find_translation(langlocale, format);
if (trans != null)
{
... | 8 |
public void init(int mode, byte[] key, byte[] iv) throws Exception{
String pad="NoPadding";
byte[] tmp;
if(iv.length>ivsize){
tmp=new byte[ivsize];
System.arraycopy(iv, 0, tmp, 0, tmp.length);
iv=tmp;
}
if(key.length>bsize){
tmp=new byte[bsize];
System.arraycopy(k... | 4 |
private void updateBestScores()
{
if((bestScores != null) && (bestScores.size() > 0))
{
bestScores.add(this);
Collections.sort(bestScores);
Collections.reverse(bestScores);
for(int i=0; i<bestScores.size(); i++)
{
if (i >= 5)
{
bestScores.remove(i);
}
}
}
else
{
best... | 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.