text stringlengths 14 410k | label int32 0 9 |
|---|---|
private boolean readPlane(int[] dst, byte[] tmp, int width, int height) {
try
{
for (int y = 0; y < height; y++)
{
dis.read(tmp);
for (int x = 0; x < width; x++)
{
dst[y * width + x] = unsignedByteToInt(tmp[x]);
}
}
return true;
}
catch (Exception e)
{
e.printStackTrac... | 3 |
public static void main(String args[]) {
Scanner reader = new Scanner(System.in);
char loop = 'y';
while (loop == 'y'){
String first, second;
Scanner scan = new Scanner(System.in);
System.out.println("-----Minimal Edit Distance-----");
System.out.print("Please input the first string: ");
... | 1 |
public Item getItem(String type, int tier){
switch(type){
case "random":
return randomItem(tier);
case "weapon":
return randomWeapon(tier);
case "armor":
return randomArmor(tier);
case "trinket":
return randomTrinket(tier);
case "consumable":
return randomConsumable(tier);
case "loot":
r... | 6 |
public void setMaximumDepth(float m) {
if (m < 0.0f)
throw new IllegalArgumentException("Potential well depth cannot be negative");
v *= max / m;
max = m;
if (format != null) {
if (max >= 1000f)
format.applyPattern("####");
else if (max >= 100f)
format.applyPattern("###");
else if (max >= 10... | 9 |
private void createComboView(Composite parent, Object layoutData) {
combo = new Combo(parent, SWT.NONE);
combo.setLayoutData(layoutData);
combo.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
final File[] roots = (File[]) combo.getData(COMBODATA_ROOTS);
if (... | 6 |
public int getTotalBets() {
List<ParisModel> paris = DataStore.getAllTeamParisBySchedule(this.sched_id);
int total = 0;
for(ParisModel par : paris){
total += par.getBet();
}
return total;
} | 1 |
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
StringTokenizer tokenString;
HashMap<Integer, String> candidates;
ArrayList<Ballot> ballots;
Ballot ballot;
/* This code have to be run for n elections */
int numElections = in.nex... | 4 |
public Smoothie createSmoothie(String s){
if(s.equals("Banana")) {
Smoothie drink = new CannedBanana();
drink = new Icecream(drink);
return drink;
}
if(s.equals("Orange")) {
Smoothie drink = new CannedOrange();
drink = new Icecream(drin... | 4 |
public static int isamax_f77 (int n, double x[], int incx) {
double xmax;
int isamax,i,ix;
if (n < 1) {
isamax = 0;
} else if (n == 1) {
isamax = 1;
} else if (incx == 1) {
isamax = 1;
xmax = Math.abs(x[1]);
for (i = 2; i <= n; ... | 7 |
private int getBlockIntensity(int x, int y) {
int averageIntensity = 0;
for (int i = x; i < scale + x; i++) {
for (int j = y; j < scale + y; j++) {
averageIntensity += getIntensity(i, j);
}
}
return averageIntensity / (s... | 2 |
public String displayInfo() {
super.displayInfo();
return "Tigers are similar to Lions but they have \n"+look+". Tigers live in the "+location;
} | 0 |
public void run() {
// initialization
System.out.println("Client0: initialization " + System.currentTimeMillis());
Messager messager = new Messager(Messager.Id_Server);
messager.initialization();
TowerDefense_TransData towerDefense_TransData;
for (int i = 0; i < 3; i++) { // 3 rounds
... | 9 |
protected void _run(MergeId new_merge_id, final Collection<Address> coordsCopy) throws Exception {
boolean success=setMergeId(null, new_merge_id);
if(!success) {
log.warn("%s: failed to set my own merge_id (%s) to %s", gms.local_addr, merge_id, new_merge_id);
retu... | 7 |
public boolean canHaveAsCreditLimit(BigInteger creditLimit) {
return (creditLimit != null) && (creditLimit.compareTo(BigInteger.ZERO) <= 0);
} | 1 |
@Override
public void run() {
super.run();
this.play = true;
this.allive = true;
while(this.play)
{
if(this.play && this.AnimationSource.getAnimationImageIndex() < this.AnimationSource.getAnimationImages().size())
{
this.AnimationSource... | 5 |
@Override
public Boolean accept(States state, CalculatorReader expressionReader) throws BinaryOperatorException, CalculatorException{
if (States.FINISH == state) {
return true;
} else if (States.RIGHT_BRACKET == state) {
if (evalBracketClose(expressionReader)) {
... | 9 |
private List<Homonym> cleanse(List<Homonym> homonymList, int wType) {
List<Integer> linesToRemove = new ArrayList<>();
//combine split lines
for (Homonym tr: homonymList) {
for (int i = tr.getWords().get(wType).getMeanings().size() - 1; i >= 0; i--) {
Meaning se = t... | 7 |
@SuppressWarnings("unchecked")
public String getTeamRadarChart() {
PreparedStatement st = null;
ResultSet rs = null;
JSONArray json = new JSONArray();
try {
conn = dbconn.getConnection();
st = conn.prepareStatement("SELECT sum(auton_top)*6 + sum(auton_middle)*... | 3 |
protected void addResult(PropertyTree node) {
// todo: don't call getValue again right here!
Object value=node.getValue();
Result match=getMatchingResult(value);
if(match==null) {
results.add(new Result(node));
} else {
match.add(node);
}
this.totalNodes++;
this.sorted=false;
} | 1 |
public void draw(Graphics2D g) {
if (!visible) return;
int w = getWidth();
int h = getHeight();
RoundRectangle2D button = new RoundRectangle2D.Float(
0, 0, w, h, h/2, h/2);
g.setColor(background);
g.fill(button);
GradientPaint paint;
int y1 = down? -h : ... | 5 |
public String getPassword(String account){
return this.passwordHash.get(account);
} | 0 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
CommunicationDeviceType that = (CommunicationDeviceType) o;
if (id != that.id) return false;
if (name != null ? !name.equals(that.name) : that.... | 6 |
private Tuple<Integer, Integer> traceDirection(Set<Tuple<Integer, Integer>> set,
int board[][], int player,
int startX, int startY, int dx, int dy) {
Tuple<Integer, Integer> res = new Tuple<>(0, 0);... | 8 |
public boolean get_connection_state()
{
return this.connected;
} | 0 |
private TreeNode recursiveIterator(TreeNode currentNode, String currentWord) {
if (foundDialogue || currentNode == null || currentNode.isTempVisited()) {
return currentNode;
}
List<TreeNode> children = currentNode.getChildren();
currentNode = checkChildrenForKeyWords(currentNode, currentWord);
for (TreeNo... | 7 |
public int compareTo(Point point){
if (point == null) return 1;
if (this.equals(point)) return 0;
if (getX() > point.getX()) return 1;
if (getY() > point.getY()) return 1;
if (getZ() > point.getZ()) return 1;
if (getX() < point.getX()) return -1;
if (getY() < point.getY()) return -1;
if (getZ() < point.... | 8 |
public List<Palabra> getListado(String c){
Connection con = null;
Statement stat = null;
ResultSet rs = null;
ResultSet rs2 = null;
List<Palabra> lista = new ArrayList<>();
try {
con = DriverManager.getConnection("jdbc:sqlite:DBVocabulario.s3db");
... | 8 |
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Office)) {
return false;
}
Office other = (Office) object;
if ((this.onumber == null && other.onumber != null) ... | 5 |
public static void delayLine() {
int sum = 0;
for (int i = 0; i < 1000000; i++) {
sum += i;
}
} | 1 |
public CtrlPrincipal() {
// Gérer la persistance
em = EntityManagerFactorySingleton.getInstance().createEntityManager();
em.getTransaction().begin();
} | 0 |
public void processQueries(String strInputFilePath, String strOutputFilePath)
throws IOException {
oBufferedReader = new BufferedReader(new FileReader(strInputFilePath));
oBufferedWriter = new BufferedWriter(new FileWriter(strOutputFilePath));
calcuateTFIDF(oBufferedReader);
oBufferedReader.close();
oBuff... | 9 |
void addResult(String valueData, String detailData) {
if (value) {
if (valueData == null) throw new IllegalArgumentException(CLASS + ": valueData may not be null");
values.add(valueData);
if (detail) {
if (detailData == null) throw new IllegalArgumentException(CLASS + ": detailData may not... | 4 |
private static void removeOldRecords(ArrayList<Long> times) {
Iterator<Long> it = times.listIterator();
while ( it.hasNext() )
if ( isOld( it.next() ))
it.remove();
} | 2 |
@Generated("method")
@Override
public boolean equals(Object o) {
if (o == this)
return true;
if (!(o instanceof List))
return false;
Iterator<E> e1 = iterator();
Iterator e2 = ((List) o).iterator();
while(e1.hasNext() && e2.hasNext()) {
... | 7 |
public void run() {
while (true) {
String instruction = null;
try{
instruction = replicas.poll(1, TimeUnit.SECONDS);
if (instruction != null) {
//System.out.println("Processing...." + instruction);
Replica replica = ReplicaFactory.buildReplica(this.getLocation(), instruction); //Auto digested
... | 3 |
public String[] getClaims()
{
if(claims!=null)
return claims;
String s=getParmsNoTicks();
if(s.length()==0)
{
claims = defclaims;
return claims;
}
char c=';';
int x=s.indexOf(c);
if (x < 0)
{
c = '/';
x = s.indexOf(c);
}
if(x<0)
{
claims = defclaims;
return claims;
}
s... | 9 |
public static void main (String[] args){
if (args.length < 3 ){
System.out.println("Please enter instance type, instance file and report path.");
System.exit(0);
}
try {
PowerGrid pg = new PowerGrid(args[1]);
if (args[0].equalsIgnoreCase("sarecycl... | 8 |
@Test
public void assertBudgetItemsMissingExceptionMessageIsValid() throws Exception {
try {
annualBudget.setCoreBudgetItemList(new ArrayList<CoreBudgetItem>());
budgetCalculation.processBudgetItemsCalculation(annualBudget, breakdown);
fail("SocialBudgetItemList is null"... | 1 |
@EventHandler
public void onWorldChange(PlayerChangedWorldEvent event)
{
Player player = event.getPlayer();
if(!player.getWorld().getName().equals(p.getWorld()))
{
ItemStack[] inv = player.getInventory().getContents();
ItemStack[] armor = player.getInventory().ge... | 5 |
protected Location getLocation()
{
return location;
} | 0 |
private static boolean test4_1() throws FileNotFoundException {
String input = "new\n" + "pick up rock\n" + "drop rock\n" + "quit\n"
+ "yes\n";
HashMap<Integer, String> output = new HashMap<Integer, String>();
boolean passed = true;
try {
in = new ByteArrayInputStream(input.getBytes());
System.setI... | 7 |
public void setBlocked(Account account){ account.setBlocked(); } | 0 |
public static int generateClassificationTrainingExamples(Vector instances, Surrogate concept, boolean createSignatureP) {
{ int numInstances = instances.length();
Cons consQuery = Stella.NIL;
int numExamples = 0;
TrainingExample example = null;
Proposition prop = null;
Cons classificat... | 7 |
public void test_07_long_lines() {
initSnpEffPredictor("testCase");
String file = "./tests/long.vcf";
Timer t = new Timer();
t.start();
VcfFileIterator vcf = new VcfFileIterator(file);
vcf.setCreateChromos(true);
// They are so long that they may produce 'Out of memory' errors
for (VcfEntry vcfEntry... | 3 |
@Override
public void execute(double t) {
Matrix y = new ColumnMatrix(output.getDim());
for (InputConnector ic : input) {
if (ic != null && ic.isConnected()) {
y = y.plus(ic.getInput());
}
}
try {
output.setOutput(y);
} catch (OrderException e) {
e.printStackTrace();
}
} | 4 |
public void simplify() {
if (object != null)
object = object.simplify();
super.simplify();
} | 1 |
public int insert(char[] word, int I) {
int child_index, new_index;
int i, j, k;
byte cs;
ST_NODE parent;
ST_NODE tmp_node = new ST_NODE();
tmp_node.child = 0;
tmp_node.CS = 0;
tmp_node.I = 0;
tmp_node.K = 0;
k = 0;
if(word.length == 0)
return -1;
search(word);
k += this.search_end;
... | 8 |
void init() {
setEffort(Effort.getEnumByValue(Util.random(3))); // FULL, NORMAL, EASY
shooting = 12;
stamina = 12;
skill = 12;
passing = 12;
power = 12;
offensive = 12;
defensive = 12;
mental = 12;
int ran = Util.random(8);
switch (ran) {
case 0:
shooting++;
stamina++;
skill++;
passi... | 8 |
private byte[] crypt_raw(byte password[], byte salt[], int log_rounds) {
int rounds, i, j;
int cdata[] = (int[])bf_crypt_ciphertext.clone();
int clen = cdata.length;
byte ret[];
if (log_rounds < 4 || log_rounds > 31)
throw new IllegalArgumentException ("Bad number of rounds");
rounds = 1 << log_rounds;
... | 7 |
@Override
public void actionPerformed(ActionEvent e) {
if (e.getActionCommand() == "CANCELAR") {
this.dispose();
}
if (e.getActionCommand()=="SALVAR") {
if(tfCidade.getText().equals("") && tfBairro.getText().equals("") ){
JOptionPane.showMessageDialog(this, "PREENCHA OS CAMPOS CORRETAM... | 6 |
public void westerosCardChoice(boolean choice) {
switch(westerosPhase){
case 1:
if(choice){
supplyUpdate();
}else{
westerosCardMustering();
}
wildingsGrow();
break;
case 2:
if(choice){
westerosCardClashOfKings();
}else{
westerosCardGameOfThrones();
}
wildingsGrow();
b... | 6 |
public static void main(String[] args) {
// TODO Auto-generated method stub
try {
OutputStreamWriter osr = new OutputStreamWriter(System.out);
PrintWriter pr = new PrintWriter(osr);
pr.println("Hello");
pr.close();
osr.close();
} catch (IOException e) {
// TODO Auto-generated catch block
... | 1 |
public boolean equals(Object obj) {
if (!(obj instanceof PerspectiveTransform)) {
return false;
}
PerspectiveTransform a = (PerspectiveTransform)obj;
return ((m00 == a.m00) && (m10 == a.m10) && (m20 == a.m20) &&
(m01 == a.m01) && (m11 == a.m11) && (m21 == a.m21) &&
(m02 == a.m... | 9 |
private boolean jj_3R_24()
{
if (jj_3R_27()) return true;
Token xsp;
while (true) {
xsp = jj_scanpos;
if (jj_3R_28()) { jj_scanpos = xsp; break; }
}
return false;
} | 3 |
public int getId() {
return id;
} | 0 |
public static Element createRuleElement(Document document, LSystem lsystem,
String left) {
Element re = createElement(document, RULE_NAME, null, null);
re.appendChild(createElement(document, RULE_LEFT_NAME, null, left));
List[] replacements = lsystem.getReplacements(left);
for (int i = 0; i < replacements.le... | 1 |
public Set<String> getKeys(boolean deep) {
Set<String> result = new LinkedHashSet<String>();
Configuration root = getRoot();
if (root != null && root.options().copyDefaults()) {
ConfigurationSection defaults = getDefaultSection();
if (defaults != null) {
... | 3 |
public String getAccountId() {
return accountId;
} | 0 |
public Graph loopTree() {
if (loopEdgeModCount != edgeModCount) {
buildLoopTree();
}
return loopTree;
} | 1 |
void doEnsure(Ref ref){
if(!info.running())
throw retryex;
if(ensures.contains(ref))
return;
ref.lock.readLock().lock();
//someone completed a write after our snapshot
if(ref.tvals != null && ref.tvals.point > readPoint) {
ref.lock.readLock().unlock();
throw retryex;
}
Info refinfo = ref... | 7 |
@EventHandler(priority=EventPriority.LOWEST)
public void onPlayerMove(PlayerMoveEvent event) {
if(unMovable.contains(event.getPlayer().getName())) {
event.getPlayer().teleport(event.getFrom());
}
} | 1 |
public int checkAFK()
{
if(cornerMap.get("A").equals("A")
&& cornerMap.get("F").equals("F")
&& cornerMap.get("K").equals("K"))
{
return SOLVED;
}
if(cornerMap.get("A").equals("F")
&& cornerMap.get("F").equals("K")
&& cornerMap.get("K").equals("A"))
{
return CW;
}
if(cornerMap.get("A... | 9 |
private void appendMetadataElement(StringBuffer buf, String name, String value, String line_ending) {
if (name == null || name.length() == 0) {
return;
}
buf.append("\t");
buf.append("<").append(ELEMENT_METADATA).append(" ").append(ATTRIBUTE_NAME).append("=\"").append(escapeXMLAttribute(name)).append("\">");... | 2 |
public static boolean isLeapYear(int year) {
return year >= 1582 ? ((year % 4 == 0) && ((year % 100 != 0) || (year % 400 == 0))) : // Gregorian
(year % 4 == 0); // Julian
} | 3 |
@Override
public String getColumnName(int column) {
switch (column) {
case 0:
return "Comp";
case 1:
return "Date";
case 2:
return "Count";
case 3:
return "Price";
case 4:
... | 7 |
public static Hand toHand(int input){
switch(input){
case 1:
return new Rock();
case 2:
return new Paper();
case 3:
return new Scissors();
case 4:
return new Lizard();
case 5:
return new Spock();
default:
return null;
}
} | 5 |
public void update()
{
for(int x = 0; x < WORLD_WIDTH; x++)
{
for(int y = 0; y < WORLD_HEIGHT; y++)
{
if(tiles[x][y] != null)
tiles[x][y].update();
if(collectables[x][y] != null)
collectables[x][y].update();
}
}
for(int i = 0; i < particles.size(); i++)
{
if(particles.ge... | 7 |
public void makePersistentSearchResult() {
try {
this.searchResult = (SearchResult) cache.get("searchResult");
extendedLinkedHashMap<String, String> elhm = searchResult
.getRootMap();
Element root = new Element("root");
for (String key : elhm.keySet()) {
if (key == null || elhm.get(key) == null)
... | 5 |
public boolean authenticate(AuthToken token, Message msg) {
if ((token != null) && (token instanceof SimpleToken)) {
// Found a valid Token to authenticate against
SimpleToken serverToken = (SimpleToken) token;
if ((this.auth_value != null) && (serverToken.auth_value != null... | 7 |
public static void main(String[] args) throws Exception {
HamaConfiguration conf = new HamaConfiguration();
BSPJob bsp = new BSPJob(conf);
// Set the job name
bsp.setJobName("Strassen Multiply");
bsp.setBspClass(StrassenBSP.class);
bsp.setJar("strassenNoSyncFinal.jar");
if (args.length < 8 || args.length... | 4 |
private void firstPlayerMove(){
if(gameRegime == TWO_PLAYERS_GAME_REGIME || gameRegime == TWO_PLAYERS_ONLINE_GAME_REGIME){
System.out.println("First Player,");
} else{
System.out.println("Player,");
}
humanMove(FIRST_PLAYER_NUMBER);
} | 2 |
public <C extends StatefulContext> void callOnEventTriggered(EventEnum event, StateEnum stateFrom, StateEnum stateTo, C context) throws Exception {
Handler h = handlers.get(new HandlerType(EventType.EVENT_TRIGGER, event, null));
if (h != null) {
ContextHandler<C> contextHandler = (ContextHan... | 2 |
String getTypeLabel(int type)
{
String newType = "";
switch (type)
{
case passiveUser:
newType = "Passive User";
break;
case userContributor:
newType = "Contributor";
break;
case userBugReporter:
newType = "Bug Reporter";
break;
case userTester:
newType = "Tester";
... | 6 |
private void bntGuardarNuevoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bntGuardarNuevoActionPerformed
Producto pNuevo = new Producto(descPr.getText(),refPr.getText(),Double.parseDouble(precPr.getText()), Integer.parseInt(combFt.getText()));
GestionarProducto gp = new GestionarPro... | 0 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Post post = (Post) o;
if (date != null ? !date.equals(post.date) : post.date != null) return false;
if (text != null ? !text.equals(post.text) ... | 9 |
public void staff(String[] lab, JPanel staffPane, int loggedId) {
this.staffPane = staffPane;
JScrollPane patientsSP = new JScrollPane(tpPatiens);
JScrollPane staffinfoSP = new JScrollPane(staffinfoTP);
StringBuffer loggedUser = new StringBuffer();
JTextPane tpLoggedStaff = new ... | 9 |
@Override
public boolean sil(int siraID) {
int sonuc = JOptionPane.showConfirmDialog(null, "Sırayı silmek istedğinize emin misiniz?",
"Sil", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
if(sonuc != JOptionPane.YES_OPTION)
return false;
t... | 3 |
* responsible for reporting the error to the user through
* ValidationEventHandler.
*/
private String convert(String v) throws Exception {
if (v == null) {
return null;
}
if (minLength != null && v.length() < minLength) {
throw new Exception("string le... | 8 |
public CouldNotEncodePacketException(PacketEncodingException e, Packet packet) {
super("Packet not encodable" + (e == null ? "." : "--" + e.getMessage()), packet);
wrappedException = e;
} | 1 |
private static ArgValue parseArgument(String arg)
{
for(String opt : HELP_OPTIONS)
{
if(opt.equals(arg))
return ArgValue.HELP;
}
for(String opt : VERBOSE_OPTIONS)
{
if(opt.equals(arg))
return ArgValue.VERBOSE;
}
for(String opt : SILENT_OPTIONS)
{
if(opt.equals(arg))
return ArgValue... | 9 |
public int getCount(String sequence) {
reverseComplement = new ReverseComplement(sequence);
String reverseSequence = reverseComplement.getReverseComplement();
int count = 0;
if (containsString(sampleText, reverseSequence)) {
count = 0;
} else {
for (int i ... | 5 |
public void eliminarDuplicados() {
Nodo<T> q = p;
Nodo<T> r;
Nodo<T> s = q;
boolean ban;
while (q != null && s.getLiga() != null) {
ban = false;
r = q;
s = q.getLiga();
while (s.getValor() != q.getValor() && !ban) {
... | 7 |
private void saveDuplicateResults() {
Saver slf_save = new Saver();
int totalSize = MasterList.size();
LabelMaxSize = 2 * totalSize - 1;
int progCounter = 0;
SpecialFile[] list = new SpecialFile[totalSize];
List<SpecialFile> cpyLst = new ArrayList<SpecialFile>();
SentinelProgressLabel.setText("Analy... | 9 |
public void unZipIt(String zipFile, String outputFolder) {
byte[] buffer = new byte[1024];
try {
File folder = new File(OUTPUT_FOLDER);
if (!folder.exists()) {
folder.mkdir();
}
ZipInputStream zis = new ZipInputStream(new FileInputStream(zipFile));
ZipEntry ze = zis.getNextEntry();
System.ou... | 4 |
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
request.setCharacterEncoding("UTF-8");
File cacheFile = new File(UPLOAD_CACHE_PATH);
if (!cacheFile.exists()) {
cacheFile.mkdir();
}
... | 8 |
public boolean start() {
synchronized (optOutLock) {
// Did we opt out?
if (isOptOut()) {
return false;
}
// Is metrics already running?
if (taskId >= 0) {
return true;
}
// Begin hitting the se... | 6 |
public static void main(String[] args) throws InterruptedException
{
Logger.initialize();
Logger.setLoggingLevel(LoggingLevel.DEFAULT);
// kontrola typu operacniho systemu
if (!SystemCheck.isSupported()) {
String message = String.format("Vas operacni system neni aplikaci... | 9 |
private int lastIndexOf(int c) {
int i = len;
boolean ok = false;
while (i > 0)
if (buf.charAt(--i) != c)
ok = true;
else if (ok)
return i;
return -1;
} | 3 |
private int[] randomComputeLastIndex(String key, boolean skipFirst)
{
int count = 0;
int keyIndex = lastHTMLReply.indexOf(key);
// 1. Count the number of times we find key
while (keyIndex != -1)
{
count++;
keyIndex = lastHTMLReply.indexOf(key, keyIndex+key.length());
}
if ((cou... | 9 |
public void update(final Observable obj, final Object arg) {
final String line = (String) arg;
final String thisLine = line.substring(line.indexOf("Text [") + "Text [".length(), line.indexOf("]", line.indexOf("Text [")));
if (thisLine.indexOf(E2E_SEND) < 0) {
return;
}
... | 8 |
public AccBtnPreview(SkinPropertiesVO skinproperties, JPanel parent) {
if (skinproperties == null) {
IllegalArgumentException iae = new IllegalArgumentException("Wrong parameter!");
throw iae;
}
this.skin = skinproperties;
this.parent = parent;
} | 1 |
@Override
public String getToolTipText(MouseEvent event) {
Column column = overColumn(event.getX());
if (column != null) {
Row row = overRow(event.getY());
if (row != null) {
return column.getRowCell(row).getToolTipText(event, getCellBounds(row, column), row, column);
}
}
return super.getToolTipTe... | 2 |
private static Hashtable<String, TestCase> getTests(String solFile) throws IOException {
RandomAccessFile raf = new RandomAccessFile(new File(solFile), "r");
Hashtable<String, TestCase> ret = new Hashtable<>();
String questionClassName;
while ((questionClassName = nextViableLine(raf)) != ... | 2 |
private String replace_all(String s, final String from, final String to)
{
int index = 0;
while ((index = s.indexOf(from)) != -1)
{
s = s.substring(0, index) + to + s.substring(index + from.length());
}
return s;
} | 1 |
public void affichage(){
System.out.println("+------------+");
if (this.valTab[0]>=0) {
System.out.println("| "+this.valTab[0]+" |");
} else {
System.out.println("| "+this.valTab[0]+" |");
}
if (this.valTab[1]>=0 && this.valTab[3]>=0) {
System.out.println("| "+this.valTab[3]+" ["+th... | 6 |
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof HabitatFeature)) {
return false;
}
HabitatFeature other = (HabitatFeature) object;
if ((this.featureID == null ... | 5 |
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://down... | 6 |
public void qsorthelper( int begin, int end ) {
if ( end - begin >= 1 ) {
//To hold the position of the first element;
int pivot = begin;
int ppos = pivot;
//To hold the position during the swap of data[pivot] and left or right.
i... | 7 |
public void callAction(String args) {
if (args.equalsIgnoreCase("NeuNet")) {
/*ActivationCalculation calc = new ActivationCalculation();
calc.setupIdentity();
ui.printToConsole("Loading NeuNet...");
Perceptron perc = new Perceptron(2);
perc.addNeuron(0, 2, ENeuronType.Input, calc);
perc.addNeuron(1,... | 2 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Telefone other = (Telefone) obj;
if (this.id != other.id) {
return false;
}
i... | 5 |
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.