text stringlengths 14 410k | label int32 0 9 |
|---|---|
public static void createRatingSiteData(Long[] seeds)
{
System.out.println("Generating RatingSite Data: Reviewers and Reviews... ");
DateGenerator publishDateGen = new DateGenerator(new GregorianCalendar(2008,5,20),new GregorianCalendar(2008,8,23),seeds[0]);
ValueGenerator valueGen = new ValueGenerator(seeds[1])... | 6 |
public SignatureVisitor visitInterfaceBound() {
separator = seenInterfaceBound ? ", " : " extends ";
seenInterfaceBound = true;
startType();
return this;
} | 1 |
public void zoneEventOccurred(String eventZone, int eventType){
// If within the bounds of the text, go to the link
if(eventType==ZoneEvents.ENTER && eventZone.equals("polygon")){
Gui.changeCursor(Cursor.HAND_CURSOR);
}
else if (eventType==ZoneEvents.CLICK && eventZone.equals("polygon")){
if(0 ==... | 8 |
public void visitMultiANewArrayInsn(final String desc, final int dims) {
minSize += 4;
maxSize += 4;
if (mv != null) {
mv.visitMultiANewArrayInsn(desc, dims);
}
} | 1 |
public CheckResultMessage checkG11(int day) {
return checkReport.checkG11(day);
} | 0 |
private static void initDCT(Composite inComposite, int heightHint) {
final Composite toolbar = new Composite(inComposite, SWT.BORDER);
final Composite imageContainer = new Composite(inComposite, SWT.BORDER);
GridData toolbarGridData = new GridData(GridData.FILL_HORIZONTAL);
toolbarGridData.grabExcessHorizontal... | 1 |
public void getStats(){
Iterator sentenceIterator = sentenceMap.entrySet().iterator();
Iterator wordsIterator;
while(sentenceIterator.hasNext()) {
Map.Entry sentencePair = (Map.Entry) sentenceIterator.next();
Sentence sentence = (Sentence) sentencePair.getValue();
... | 5 |
@Override
public void layoutContainer(Container target) {
if (mRootCell != null) {
Rectangle bounds = target.getBounds();
Insets insets = target.getInsets();
bounds.x = insets.left;
bounds.y = insets.top;
bounds.width -= insets.left + insets.right;
bounds.height -= insets.top + insets.bottom;
mR... | 1 |
private void AddProgram(String text, int type)
{
int shader = glCreateShader(type);
if(shader == 0)
{
System.err.println("Shader creation failed: Could not find valid memory location when adding shader");
System.exit(1);
}
glShaderSource(shader, text);
glCompileShader(shader);
if(glGetShad... | 2 |
public void setAnnotations(Annotation[][] params) {
ByteArrayOutputStream output = new ByteArrayOutputStream();
AnnotationsWriter writer = new AnnotationsWriter(output, constPool);
try {
int n = params.length;
writer.numParameters(n);
for (int i = 0; i < n; ++... | 3 |
public int getRowCount() {
// TODO Auto-generated method stub
return 0;
} | 0 |
@Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
MOB target=mob;
if((auto)&&(givenTarget!=null)&&(givenTarget instanceof MOB))
target=(MOB)givenTarget;
if(target.fetchEffect(ID())!=null)
{
mob.tell(target,null,null,L("<S-NAME> <S-IS-ARE> ... | 9 |
@BeforeClass
public static void setUpBeforeClass() {
try { new MySQLConnection(); }
catch (InstantiationException e) { e.printStackTrace(); }
catch (IllegalAccessException e) { e.printStackTrace(); }
catch (ClassNotFoundException e) { e.printStackTrace(); }
catch (SQLException e) { e... | 5 |
private final static void submitSongTasks()
throws MasterException {
try {
//submit tasks to do.
//Waiting until all tasks are done
MasterMetadata.songES.invokeAll(MasterMetadata.songTasks);
//Clean the queue
MasterMetadata.songTasks.clear();
} catch (Exception e) {
throw new ... | 1 |
public OpenURL(String URL) throws Exception {
//if we're not on a supported OS just quit
if (!Desktop.isDesktopSupported()) {
throw new Exception("Unsupported Desktop. Can't open authentication site.");
}
//if thre is no url to open just quit
if (URL.length() == 0) ... | 3 |
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 |
public static final boolean fullVeracsEquipped(Player player) {
int helmId = player.getEquipment().getHatId();
int chestId = player.getEquipment().getChestId();
int legsId = player.getEquipment().getLegsId();
int weaponId = player.getEquipment().getWeaponId();
if (helmId == -1 || chestId == -1 || legsId == -1... | 7 |
public void draw() {
pixels = screen.getPixels();
int xxx = xEnd - xOrigin;
int yyy = yEnd - yOrigin;
double d = (Math.sqrt((xxx*xxx)+(yyy*yyy)));
double xSeg = xxx/d;
double ySeg = yyy/d;
for(int i = 0; i < getLength(); i++){
if(xOrigin <= 0 || xEnd >= screen.getWidth() || yOrigin <= 0 || yEnd >= scr... | 5 |
private GoodsType goodsToMake() {
GoodsType wantGoods = null;
int diff, wantAmount = -1;
for (GoodsType g : getSpecification().getGoodsTypeList()) {
GoodsType produced;
if (g.isRawMaterial()
&& (produced = g.getProducedMaterial()) != null
&... | 6 |
public void timeTableAndBlockOutput(){
try {
jxl.write.WritableWorkbook writeWorkBook = Workbook.createWorkbook(new File("outputFile.xls")); //要寫入的路徑以及檔名
jxl.write.WritableSheet writeSheet = writeWorkBook.createSheet("inbound_train", 0); //建立一個工作表名字,然後0表示為第一頁
Label label = new Label(0, 0, "Inbound Train... | 6 |
public void draw(Graphics g) {
game.screen.clear();
double xScroll = game.player.getX() - game.screen.width / 2;
double yScroll = game.player.getY() - game.screen.height / 2;
game.level.render((int) xScroll, (int) yScroll, game.screen);
for (int i = 0; i < game.pixels.length; i++) {
game.pixels[i] = game.... | 4 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
JList list = (JList) o;
if (getId() != null ? !getId().equals(list.getId()) : list.getId() != null) return false;
return true;
} | 5 |
public void removeDegreeFromStudent(int studentId, int degreeId) {
if(!isValidId(studentId) || !isValidId(degreeId)) {
return;
}
Student student = studentDao.getStudent(studentId);
Set<Degree> degrees = student.getDegrees();
if (student != null && degrees != null) {
for (Degree degree : degrees) {... | 6 |
public int size()
{
return accounts.length;
} | 0 |
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label,
String[] args) {
if (args.length == 0) {
sender.sendMessage(ChatColor.BLUE
+ "-----------------------------------------------------");
sender.sendMessage(ChatColor.GOLD + "Developed by: "
+ ChatColor.GRAY + "... | 8 |
public void setHour(int h){
//checks to see if h is less than or equal to one
//and it checks to see if its less than 24 and if
//both requirements are meant than the integer can remain the same
//value but if it doesn't than we set it to zero.
hour = ((h >= 0 && h<24) ? h : 0);
} | 2 |
public void killHappenedAt(PointI p, int mobSize, boolean wasSplashDamage){
if((p.x < 0) || (p.y < 0) || (p.x >= w) || (p.y >= h)) return;
double amount = 1f / mobSize / mobSize;
for(int y=0; y<mobSize; y++){
for(int x=0; x<mobSize; x++){
if(wasSplashDamage){
splashKillCounts[p.y + y][p.x + x] += amou... | 7 |
@EventHandler
public void onPlayerJoin(PlayerJoinEvent event)
{
Player player = event.getPlayer();
if(player.hasPermission("EasyPvpKits.Admin") && Main.update)
{
if(plugin.getConfig().getBoolean("options.auto-update-onlogin-notice"))
{
player.sendMessage(ChatColor.GREEN + "An update is availab... | 3 |
public void load()
{
bans = new HashMap<String, Long>();
ipBans = new LinkedList<String>();
mutes = new HashMap<String, Long>();
persistMutes = false;
broadcastKick = false;
broadcastMute = false;
broadcastBan = false;
muteLimit = 0;
banLimit =... | 9 |
public void shapeImageToPixels(int x, int y, int height, int originalPixels[], int ai[], int j, int k, int i1, int l1, int i2) {
try {
int j2 = -l1 / 2;
int k2 = -height / 2;
int l2 = (int) (Math.sin((double) j / 326.11000000000001D) * 65536D);
int i3 = (int) (Math.cos((double) j / 326.11000000000001D) * ... | 3 |
private float grad(int hashCode, float x, float y, float z) {
// Convert lower 4 bits of hash code into 12 gradient directions
int h = hashCode & 15;
float u = h < 8 ? x : y;
float v = h < 4 ? y : h == 12 || h == 14 ? x : z;
return (((h & 1) == 0 ? u : -u) + ((h & 2) == 0 ? v : -... | 6 |
private int locateLineByKey( String key ) {
if( key == null )
return -1;
// Search current line.
for( int i = 0; i < this.list.size(); i++ ) {
HTTPHeaderLine line = this.list.get(i);
if( line.getKey() != null && line.getKey().equalsIgnoreCase(key) ) {
return i;
}
}
return -1;
... | 4 |
protected void drawData(Graphics g) {
if (graphValues == null) return;
g.setColor(color);
int X, Y;
int xval, yval;
for (int i = 0; i < graphBuffer.getRows(); i++) {
xval = graphValues[0][i];
yval = graphValues[1][i];
if... | 8 |
public static MultiChoiceMultiAnswerQuestion getQuestionByQuestionID(int questionID) {
try {
String statement = new String("SELECT * FROM " + DBTable + " WHERE questionid = ?");
PreparedStatement stmt = DBConnection.con.prepareStatement(statement);
stmt.setInt(1, questionID);
ResultSet rs = stmt.executeQu... | 1 |
public String getTripleObjectByPredicate( Vector<Vector<String>> triple_list, String predicate)
{
for(int i=0; i<triple_list.size() ;i++)
{ Vector<String> t = triple_list.get(i);
if( t != null )
if( t.get(1)!=null && ((String)t.get(1)).equals(predicate))
{return t.get(2);}
}
return null;
}//public ... | 4 |
public boolean isAllowed(final Player player, final Location target) {
if (player.hasPermission("simpleregions.override.protection")) return true;
boolean found = false;
// check loaded regions, return true if any region allows access
for (final Region region : this.cached(target.getWo... | 9 |
public static ParticipantListJsonConverter getInstance() {
return instance;
} | 0 |
public static void ordTilFil(ArrayList<Innlegg> minListe)
{
Formatter output = null;
try
{
//For å skrive til fil må jeg bruke klassen FileWriter
FileWriter fileWriter = new FileWriter("laerersord.txt", true);
output = new Formatter (fileWriter);//åpner fila laerersord.txt for skriving, hvis den ikk... | 5 |
public boolean canJump() {
boolean jump = true;
int jx = (int) x / 16;
int jy = (int) y / 16;
for (int i = 0; i < 4; i++) {
if (level.getTile(jx, jy - i).solid()) jump = false;
}
if (!doJump) jump = false;
return jump;
} | 3 |
@Subscribe
public void childrenInput(EventInput eventInput) {
if (active)
if (eventInput instanceof EventMouse)
childBus.post(eventInput);
} | 2 |
public Food(int initX, int initY, int initOption) {
super(initX, initY, initOption);
foodType = type.values()[initOption];
switch (foodType) {
case YUKKURIFOOD:
amount = 100*24*24;
imageType = FOOD_NOT_EMPTY_NORMAL;
break;
case BITTER:
amount = 100*24*24;
imageType = FOOD_NOT_EMPTY_BITTE... | 9 |
public static void main(String [] args) {
//NeuralNet n = new NeuralNet();
/* First demonstrate how the layout looks with just one neuron. */
/* Output neuron uses a linear function, f=x^(1). */
//n.setOutputNeuron(new Neuron(new PolynomialTerm(1)));
/* Add inputs. */
/*for(int i = 0; i < 3; i... | 0 |
public boolean pickAndExecuteAnAction() {
try{
for(int j = 0; j < Waiters.size(); j++){
//print("" +Waiters.get(j).ws);
if(Waiters.get(j).ws == WaiterState.wantToGoOnBreak){
answerWaiter(Waiters.get(j));
return true;
}
}
for (Table table : tables) {
if (!table.isOccupied()) {
... | 7 |
public static boolean inMap(int x, int y)
{
return x >= 0 && y >= 0 && x < map.width && y < map.height;
} | 3 |
public ArrayList<String> playerCardString(){
ArrayList<String> displayedCards = new ArrayList<String>();
/*if(playerInputArrayInts==null){
return "player inputs are null";
}
if(shuffle==null){
return "shuffle is null";
}
if(deck==null){
return "deck is null";
}*/
//make the size of the arra... | 9 |
public Point locationOf(Tile t) {
for (int y = bounds.y; y < bounds.height + bounds.y; y++) {
for (int x = bounds.x; x < bounds.width + bounds.x; x++) {
if (getTileAt(x, y) == t) {
return new Point(x, y);
}
}
}
return nu... | 3 |
public void print() {
for (int i = 0; i < M; i++) {
for (int j = 0; j < N; j++) {
System.out.printf("%9.4f ", data[i][j]);
}
System.out.println();
}
} | 2 |
private static boolean trailingZeroesCheck(int a, int b) {
//cast both to string and convert to char array
char[] charsA = ("" + a).toCharArray();
char[] charsB = ("" + b).toCharArray();
if (charsA[1] == 0 && charsB[1] == 0) return false;
else return true;
} | 2 |
public Response handle(Request r) {
// first of all, file requests or plugins should always be okay
// plugins allowed basically so I can reset mediatomb if it died
if (r.getPage().equals(STServer.FILES) ||
r.getPage().equals(STServer.PLUGINS))
return super.handle(r);
Response resp = new Response()... | 8 |
private boolean hunt(Position preyPosition) {
FieldItem prey = field.get(preyPosition);
char preyType = field.getItemType(preyPosition);
if (field.shot(preyPosition)) {
field.removeItem(prey, preyPosition);
if (preyType == 'D') {
return true;
}... | 2 |
public Attribute set(Map<String, String> map, ValueVisitor visitor) {
Set<String> keys = map.keySet();
Class<?> clazz = getClass();
for (String key : keys) {
String value = map.get(key);
try {
Field field = SpringReflectionUtils.findField(clazz, key);
field.setAccessible(true);
field.set(this, v... | 4 |
public String[] sendNameSearch(String s) throws IOException{
String str = new String("namesearch"+ "," + s );
System.out.println(str);
InetAddress serverAddr= null;
try {
serverAddr= InetAddress.getByName(GlobalV.serverIP);
} catch (UnknownHostException e1) {
e1.printStackTrace();
}
... | 6 |
public static Quiz[] getQuizzes()
{
try {
String query = String.format("SELECT * FROM QUIZ");
ResultSet rs = getQueryResults(query);
List<Quiz> quizzes = new ArrayList<Quiz>();
while (rs.next())
{
Quiz q = new Quiz(rs.getString("QUIZTITLE"), r... | 2 |
public int hashCode() {
int firstHashCode = (first == null ? 0 : first.hashCode());
int secondHashCode = (second == null ? 0 : second.hashCode());
if (firstHashCode != secondHashCode) {
return (((firstHashCode & secondHashCode) << 16) ^ ((firstHashCode | secondHashCode)));
} else {
return fi... | 3 |
public int opponent(int player) {
return player == PLAYER1 ? PLAYER2 : PLAYER1;
} | 1 |
public void setIdentificador(TIdentificador node)
{
if(this._identificador_ != null)
{
this._identificador_.parent(null);
}
if(node != null)
{
if(node.parent() != null)
{
node.parent().removeChild(node);
}
... | 3 |
public void setDay(int day) {
if (day <= 31 & day >= 0)
this._day = day;
else
this._day = 0;
this._set = true;
} | 1 |
public void setSkills(List<SkillRating> skills) {
this.skills = skills;
} | 0 |
public void synchronizeEconomyPlayer(UUID uuid) {
try {
List<Map<String, Object>> results = db.getResults("SELECT * FROM " + Economy.ecoPlayerTable + " WHERE uuid = '" + uuid.toString() + "';");
for (int i = 0; i < results.size(); i++) {
EconomyPlayer eco = new EconomyPlayer();
for (Ma... | 9 |
@Override
public void gibFehlerAus(ServerKontext kontext, Spieler spieler,
Befehlszeile befehlszeile)
{
Raum raum = kontext.getAktuellenRaumZu(spieler);
if(!spieler.getInventar().hasAnyKuchen())
{
kontext.schreibeAnSpieler(spieler, TextVerwalter.MAUS_KEIN_KRUEMEL);
}
else if(!raum.hasKatze() && !raum... | 5 |
public static double asech(double a){
if(a>1.0D || a<0.0D) throw new IllegalArgumentException("asech real number argument (" + a + ") must be >= 0 and <= 1");
return 0.5D*(Math.log(1.0D/a + Math.sqrt(1.0D/(a*a) - 1.0D)));
} | 2 |
public void runMainActivityWithTestInput(LinkedList<String> userInput) {
int inputCounter = 0;
boolean run = true;
Main.giveMain().setDmPhase(new DMPhase());
do {
if(Main.giveMain().getPhase() instanceof ASRPhase) {
System.out.print("Your next Input:");
Main.giveMain().setAsrResult(userInput.... | 6 |
public final void setVideoFileTempDimensions(Dimension size) {
if (size.width <= 0 && size.height <= 0) return;
Dimension fullSize = this.getVideoFileSourceDimensions();
if (fullSize.width <= 0 && fullSize.height <= 0) return;
Dimension newSize = new Dimension(size);
if (newSize.width <= 0) {
newSize.wid... | 9 |
ThumbNailCanvas(DrawableItemController dicon) {
items = new ArrayList<>();
//panels =new ArrayList<>();
dic = dicon;
} | 0 |
public DataBase(final String dbDirectory, final TableProvider newProvider, final List<Class<?>> newTypes)
throws IOException {
name = new File(dbDirectory).getName();
dataBaseDirectory = dbDirectory;
provider = newProvider;
if (newTypes != null) {
types = new... | 2 |
private void movement() {
if (y <= 0)
vy = speed;
if (y >= cs.getHeight() - height)
vy = -speed;
if (x <= 0) { // If hits left side (Player)
vx = speed;
cs.clientScore++;
}
if (x >= cs.getWidth() - width) { // If hits right side (AI)
vx = -speed;
cs.serverScore++;
}
x += vx;
y += vy;
... | 6 |
@Id
@GenericGenerator(name = "generator", strategy = "increment")
@GeneratedValue(generator = "generator")
@Column(name = "CTR_ID")
public int getIdPosControlTransacciones() {
return idPosControlTransacciones;
} | 0 |
private void field_cuit3FocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_field_cuit3FocusLost
if(field_cuit3.isEditable()){
String cuit1=field_cuit1.getText();
String cuit2=field_cuit2.getText();
String cuit3=field_cuit3.getText();
if(!field_cuit2.getT... | 5 |
@Override
public void deserialize(Buffer buf) {
objectUID = buf.readInt();
if (objectUID < 0)
throw new RuntimeException("Forbidden value on objectUID = " + objectUID + ", it doesn't respect the following condition : objectUID < 0");
powerRate = buf.readShort();
overMax =... | 3 |
@Override
public void update(){
// if(guiDisplaying instanceof GuiHud)
// System.out.println(GameTime);
if(backGrounds != null && !backGrounds.isEmpty())
for(Background bg : backGrounds)
bg.update();
handleInput();
tileMap.setPosition((GamePanel.WIDTH / 2) - player.getScreenXpos(),(GamePanel.HE... | 7 |
void invoerNieuwePersoon() {
Geslacht geslacht = null;
while (geslacht == null) {
String g = readString("wat is het geslacht (m/v)");
if (g.toLowerCase().charAt(0) == 'm') {
geslacht = Geslacht.MAN;
}
if (g.toLowerCase().charAt(0) == 'v') {... | 5 |
private void calculatePercentages() {
metalPercentages = new double[3];
double point1, point2, larger, smaller;
point1 = Math.random();
point2 = Math.random();
if (point1 < point2) {
larger = point2;
smaller = point1;
} else {
larger = ... | 1 |
public static TreeNode initSyTree(int i,boolean isSy){
/**
* 1
/ \
2 2
/ \ / \
3 4 4 3
*/
TreeNode root = new TreeNode(1);
if(isSy){
//symmertric
if(i==1){
/*
1
2 2
*/
TreeNode l = new TreeNode(2);
TreeNode r = new TreeNode(2);
root.left=l;
root.... | 6 |
public static SearchResponse intersect(SearchResponse s1, SearchResponse s2) {
Map<Integer, RendezVous> m1 = s1.getWordIndex().getMeetings();
Map<Integer, RendezVous> m2 = s2.getWordIndex().getMeetings();
Map<Integer, RendezVous> mResult = new HashMap<>();
for (Integer file : m1.keySet()... | 3 |
@SuppressWarnings("unchecked")
public boolean equals(Object o){
if(o == null) return false;
if(o.getClass() == getClass()){
ShareableHashMap<K, V> other = (ShareableHashMap<K, V>) o;
if(other.currentHashCode != currentHashCode) return false;
if(other.size() != size()) return false;
if(isEmpty... | 9 |
private void registerListeners() {
getSkinnable().widthProperty().addListener(observable -> handleControlPropertyChanged("RESIZE") );
getSkinnable().heightProperty().addListener(observable -> handleControlPropertyChanged("RESIZE") );
getSkinnable().prefWidthProperty().addListener(observable -> h... | 7 |
public Color getColor() {
return color;
} | 0 |
public static void close(ResultSet res, Statement sta, Connection con) {
if (res != null) {
try {
res.close();
} catch (Exception ex){}
}
if (sta != null) {
try {
sta.close();
} catch (Exception ex) {}
}
... | 6 |
private void enterScope()
{
SymbolTable table = new SymbolTable();
table.setDepth(symbolTable.getDepth() + 1);
table.setParent(symbolTable);
symbolTable = table;
} | 0 |
public static Connection getConection() {
try {
System.out.print("Conecting with the database... ");
Class.forName("com.mysql.jdbc.Driver");
if (properties == null) {
properties = ResourceBundle.getBundle("MySQL");
host = properties.getString... | 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 feel.
* For details see http://down... | 6 |
public boolean fullRow( int row )
{
for( int i = 0; i < numRowsToClear; i++ ) {
if( rowsToClear[i] == row )
return true;
}
return false;
} | 2 |
@Test
public void originTest2() {
userInput.add("hello");
userInput.add("daniel");
userInput.add("can you help me with cooking");
userInput.add("what is the origin");
userInput.add("hamburger");
userInput.add("origin");
runMainActivityWithTestInput(userInput);
assertTrue(nlgResults.get(2).contains("wha... | 6 |
public void paint(Board board) {
// Iterate over all Hexpos's
Set set = owner.keySet();
Iterator it = set.iterator();
int[][] binds = new int[17][9];
for (int[] row : binds)
Arrays.fill(row, -1);
while (it.hasNext()) {
Hexpos hp = (Hexpos) it.next();
if (owner.get(hp) != null) {
System.out.p... | 6 |
public boolean testByName(String testName, int testNo, boolean verbose) {
switch (testName.toLowerCase()) {
case "initial":
return testInitialFirst(testNo, verbose);
case "goal":
return testGoalLast(testNo, verbose);
case "steps":
return testValidSteps(testNo, verbose);
case "booms":
return testBo... | 9 |
public void render() {
BufferStrategy bs = getBufferStrategy();
if (bs == null) {
createBufferStrategy(3);
return;
}
int xOffset = player.x - (screen.width / 2);
int yOffset = player.y - (screen.height / 2);
level.renderTiles(screen, xOffset, yOffset);
for (int x = 0; x < level.Width; x++) {
in... | 7 |
public static void testValidity(Object o) throws JSONException {
if (o != null) {
if (o instanceof Double) {
if (((Double) o).isInfinite() || ((Double) o).isNaN()) {
throw new JSONException(
"JSON does not allow non-finite numbers.");
... | 7 |
public void saveAs()
{
// get instance of a file chooser
TFileChooser saveDialog = GUIGlobals.PROJECT_LOAD_SAVE_DIALOG ;
saveDialog.setProjectFiler();
// prepare a filename advice
File file = TGlobal.tools.createProjectFilename(
TGlobal.projects.getCurrentProject()) ;
... | 4 |
public static void findPotentials(String data_file) {
ChainMRFPotentials p = new ChainMRFPotentials(data_file);
SumProduct sp = new SumProduct(p);
for(int i=1; i<=p.chainLength(); i++) {
double[] marginal = sp.marginalProbability(i);
if(marginal.length-1 != p.numXValues()) // take off 1 for 0 index which i... | 9 |
public static void removeFromList(CallFrame frame)
{
if(callFrameList.contains(frame))callFrameList.remove(frame);
} | 1 |
protected void execute(String gameBehavior, AlertObject in) {
//System.out.println(gameBehavior);
for (WeakReference x : myWeakReferences) {
try {
Class[] paramClasses = gameBehaviors.get(gameBehavior).getParameterTypes();
if (paramClasses.length == 0) {
... | 7 |
@Override
public int compareTo(Person t) {
if (t.equals(this)) {
return 0;
}
if (t.age != this.age) {
return this.age.compareTo(t.age);
}
if (t.name.compareToIgnoreCase(this.name) != 0) {
return t.name.compareToIgnoreCase(this.name);
... | 4 |
final boolean method2758(int i) {
if (i < 84)
aClass206_8844 = null;
anInt8834++;
if (((OpenGlToolkit) ((Class348_Sub5) this).aHa_Sub2_6618).aBoolean7820
&& ((OpenGlToolkit) ((Class348_Sub5) this).aHa_Sub2_6618).aBoolean7783
&& ((OpenGlToolkit) ((Class348_Sub5) this).aHa_Sub2_6618).aBoolean7818) {
... | 9 |
public static int countOccurrences(final String haystack, final char needle) {
int count = 0;
for (int i = 0; i < haystack.length(); i++) {
if (haystack.charAt(i) == needle) {
count++;
}
}
return count;
} | 2 |
public void onAction(String name, boolean isPressed, float tpf) {
if (isPressed && name.equals(KeyMapper.BRING_ELEVATOR_UP)) {
if (!elevatorMoving) {
if (elevatorUp == true) {
bringElevatorDown();
}
if (elevatorUp == false) {
... | 5 |
public static SendResourceHashes getCRCMap()
{
// Create a hashmap as return value and populate it with
// entries of key - hashID
HashMap<String,Long> rval = new HashMap<String,Long>();
for(String key : resourceByString.keySet())
{
Resource resource = resourceByString.get(key);
rval.put(key, resource.... | 1 |
public void doOpen() {
fileDialog = new JFileChooser(currentDirectory);
fileDialog.setDialogTitle("Select File to be Opened");
fileDialog.setSelectedFile(null); // No file is initially selected.
int option = fileDialog.showOpenDialog(this);
if (option != JFileChooser.APPROVE_OPTION)
... | 6 |
public void run()
{
while (true)
{
try
{
PianoPacket packet = packets.take();
Iterator<ObjectOutputStream> iter = outStreams.iterator();
while (iter.hasNext())
{
ObjectOutputStream out = iter.next();
try
{
out.writeObject(packet);
out.flush();
}
catch (IO... | 4 |
public Object nextContent() throws JSONException {
char c;
StringBuffer sb;
do {
c = next();
} while (Character.isWhitespace(c));
if (c == 0) {
return null;
}
if (c == '<') {
return XML.LT;
}
sb = new Str... | 7 |
@Override
public boolean equals(Object obj) {
if (obj instanceof String)
return name.equals(obj);
if (obj instanceof Profile) {
Profile that = (Profile) obj;
return this.name.equals(that.name) && this.host.equals(that.host) &&
this.port.equals(that.port) && this.userName.equals(that.userName) ... | 6 |
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.