text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void cluster() {
_ls.log("clustering");
/* If it is the first time, create the k-means clustering points. */
if (_firstTime)
generateInitialMeans();
/* Reset the associations between means and points. */
Map<NamedPoint, Set<NamedPoint>> assignments =
new HashMap<NamedPoint, Set<NamedPoint>>(... | 8 |
@Command(command = "unfreeze",
arguments = {"target player[s]"},
description = "unfreezes the target players in their place",
permissions = {"unfreeze"})
public static boolean unfreeze(CommandSender sender, String targetPlayer) throws EssentialsCommandException {
// get a list of all target players
ArrayL... | 5 |
public void setUnit(Unit unit, Player unitOwner, ActionListener actionListener, boolean unitActive)
{
if (unit == null) {
setUnitUIVisible(false);
nameLabel.setText(""); //If the panel labelled "unit" is empty, it should be clear that no unit is selected.
} else {
setUnitUIVisible(true);
nameLabel... | 7 |
@Override
public synchronized void movePlayer(SHServiceClient shServiceClientImpl,
char movement) throws RemoteException {
//First, we send the request to the servers linked to this one for the update
if(this.getIsPrimary()){
for(SHService shServiceImpl: listServices){
if(!(shServiceImpl.getHos... | 8 |
public static void main(String[] args) throws Exception
{
checkState(args.length == 2, "Expecting host and port as args");
SocketAddress addr = new InetSocketAddress(args[0], Integer.parseInt(args[1]));
try (RedisConnection conn = RedisConnection.connect(addr))
{
System.o... | 9 |
public static int countNumberOfRepairersForBuilding(Unit building) {
if (building == null) {
return 0;
}
int total = 0;
for (Unit worker : repairers) {
if (worker == null) {
return 0;
}
if (repairersToBuildings.get(worker) == null) {
continue;
}
if (repairersToBuildings.get(worker).... | 6 |
@Override
public int castingQuality(MOB mob, Physical target)
{
if(mob!=null)
{
if(!(target instanceof MOB))
return Ability.QUALITY_INDIFFERENT;
if(((MOB)target).amDead()||(!CMLib.flags().canBeSeenBy(target,mob)))
return Ability.QUALITY_INDIFFERENT;
if((mob.isInCombat())&&(CMLib.flags().isAliveAw... | 8 |
public void tryToFire(boolean isEpic) {
// check that we have waiting long enough to fire
if (System.currentTimeMillis() - lastFire < firingInterval) {
return;
}
// if we waited long enough, create the shot entity, and record the time.
lastFire = System.curre... | 5 |
private static void createFactories() {
if(Utilities.dbFactory == null) {
Utilities.dbFactory = DocumentBuilderFactory.newInstance();
Utilities.dbFactory.setNamespaceAware(true);
}
if(Utilities.xpFactory == null) {
Utilities.xpFactory = XPathFactory.newInstance();
}
if(Utilities.trFactory == nul... | 4 |
@Override
public void actionPerformed(ActionEvent evt) {
String cmd = evt.getActionCommand();
switch (cmd) {
case IC_ADD:
addAlarm();
break;
case IC_EDIT:
editAlarm();
break;
case IC_DELETE:
deleteAlarm();
... | 8 |
public static void startupXmlObjects() {
{ Object old$Module$000 = Stella.$MODULE$.get();
Object old$Context$000 = Stella.$CONTEXT$.get();
try {
Native.setSpecial(Stella.$MODULE$, Stella.getStellaModule("/POWERLOOM-SERVER/GUI-SERVER", Stella.$STARTUP_TIME_PHASE$ > 1));
Native.setSpecial... | 6 |
public static void main(String[] args) throws Exception {
String tmpStr;
String filename;
DataSource source;
Instances data;
int classIndex;
Capabilities cap;
Iterator iter;
if (args.length == 0) {
System.out.println(
"\nUsage: " + Capabilities.class.getName()
+ ... | 9 |
public ArrayList<Nacionalidad> resultQueryNac(String sql){
ArrayList<Nacionalidad> nacList = new ArrayList<Nacionalidad>();
try {
rs = stm.executeQuery(sql);
try {
while(rs.next()){
Nacionalidad item = new Nacionalidad(rs.getInt("idNacionalidad"),
rs.getString("nacion"));
nacList... | 3 |
public static String convertToString(Car car) throws Exception
{
Class<?> currentCarClass = car.getClass();
Method getModel = null;
Method getPower = null;
Method getDateOfCreation = null;
try{
getModel = currentCarClass.getDeclaredMethod("getModel");
}catch (NoSuchMethodException e){
System.out.prin... | 7 |
private void login() {
if(!loginPanel.isFillField()) {
loginPanel.setErrorInfo("Fill all fields");
return;
}
try {
session = chatRoomEntry.login(loginPanel.getLogin(), loginPanel.getPassword());
} catch(RemoteException e) {
... | 3 |
public void deleteTreatmentMeta(int index){
treatmentMeta.remove(index);
} | 0 |
public void refresh() {
combo.removeAllItems();
for(Project project : projects.getBusinessObjects()) {
((DefaultComboBoxModel<Project>) combo.getModel()).addElement(project);
}
if (!projects.getBusinessObjects().isEmpty()) {
if(project==null) project = projects.ge... | 4 |
public AbstractMatter select(Tile tile) {
//check if selected is in the tile, if it is, take the index before
//else take the last index
List<AbstractMatter> ab = tile.getAbstractMatterList();
int index = ab.size() - 1;
for(int i = ab.size() - 1; i >= 0; i--)
{... | 3 |
public static double product(double[] vals) {
double prod = 1;
for (double v : vals) {
prod = prod * v;
}
return prod;
} | 1 |
public static boolean isText(PolyBlockType type) {
return type == FLOWING_TEXT ||
type == HEADING_TEXT ||
type == PULLOUT_TEXT ||
type == VERTICAL_TEXT ||
type == CAPTION_TEXT;
} | 4 |
static final int get(Monster type, Token token) {
switch(token)
{
case Toughness:
switch(type)
{
case DarkYoung: return 3;
default: return 1;
}
case Combat:
switch(type)
{
case Cultist: return 1;
default: return 0;
}
case Stamina:
switch(type)
{
case DarkYoung: return... | 9 |
protected void FillBuff() throws java.io.IOException
{
if (maxNextCharInd == available)
{
if (available == bufsize)
{
if (tokenBegin > 2048)
{
bufpos = maxNextCharInd = 0;
available = tokenBegin;
}
else if (tokenBegin < 0)
bufpos = maxN... | 9 |
public boolean deletePatient(Patient newPatient) {
if (newPatient == head) {
head = null;
return true;
}
Patient aux = head.getNext();
while (!aux.getName().equals(newPatient.getName()) && aux.getNext() != head) {
aux = aux.getNext();
}
if (aux.getNext() == head) {
//patient to remove ... | 4 |
private void renderOptions(GameContainer c, Graphics g){
FontUtils.drawCenter(TowerGame.ricasso30, "Options", 165, 60, 470, Color.white);
FontUtils.drawCenter(TowerGame.ricasso20, "Back", 165, 185, 470, Color.gray);
switch (options){
case 1:
FontUtils.drawCenter(TowerGame.ricasso20, "- Music Volume -", 16... | 3 |
private void checkShipToPlanetsCollision(ShipV2 player, ArrayList<Planet>p){
for(int i = 0; i < p.size();i++){
Planet planet = p.get(i);
if(player.getPosition().x >= planet.getPosition().x &&
player.getPosition().x <= (planet.getPosition().x + planet.getWidth()) &&
player.getPosition... | 5 |
@Test
public void test() {
TernaryST st = new TernaryST();
st.put("three", (Object)3);
st.put("four", (Object)4);
System.out.println(st.contains("four"));
System.out.println(st.contains("five"));
} | 0 |
@Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
if(!super.invoke(mob,commands,givenTarget,auto,asLevel))
return false;
final boolean success=proficiencyCheck(mob,0,auto);
if(success)
{
invoker=mob;
final CMMsg msg=CMClass.getMsg(mob... | 7 |
public void InsertaFinal(String nombreProceso)
{
if ( VaciaLista())
PrimerNodo = UltimoNodo = new NodosListaProceso (nombreProceso);
else
UltimoNodo=UltimoNodo.siguiente =new NodosListaProceso (nombreProceso);
} | 1 |
private String getSuffix(String src, String... delimiter)
{
int i = Utils.findIndex(src, delimiter);
if (i == -1)
return src;
else
return src.substring(i + 1);
} | 1 |
@Override
public void mouseExited(MouseEvent e) {
} | 0 |
@Override
public void start(Stage primaryStage) throws Exception {
final int PANEL_HEIGHT = maze.height*SQUARE_SIZE;
final int PANEL_WIDTH = maze.width*SQUARE_SIZE;
Group root = new Group();
primaryStage.setTitle("Bob's Maze");
primaryStage.setScene(new Scene(root));
//Draw the maze
... | 9 |
public void draw(Graphics2D g) {
for (int row = rowOffset; row < rowOffset + numRowsToDraw; row++) {
if (row >= numRows) {
break;
}
for (int col = colOffset; col < colOffset + numColsToDraw; col++) {
if (col >= numCols) {
break;
}
if (map[row][col] == 0) {
continue;
}
int rc... | 5 |
private int getTextBlockHeight (Graphics2D g2d, String t) {
if ((t == null) || (t.equals(""))) {
return 0;
}
TextLayout tl = new TextLayout(t,
MainWindow.setupData.getPrintElementSetupList().getPrintElementSetup (PrintElementSetupList.FONT_SUMMARY_SHEET).getPrintFont(),
g2d.getFont... | 3 |
public static Collection<Temporal> consolidateTemporalSegments(Collection<Temporal> temporals) {
if (null == temporals || temporals.size() < 2) return temporals;
Set<Temporal> origTemporals = new TreeSet<Temporal>(temporals);
temporals.clear();
if (origTemporals.contains(PERSISTENT_TEMPORAL)) {
temporals.a... | 6 |
@Override
public String execute() {
try {
if ((databaseContext.table != null) && databaseContext.table.getName().equals(arguments.get(1))) {
databaseContext.table = null;
}
databaseContext.provider.removeTable(arguments.get(1));
return "dropped"... | 4 |
public boolean isManaged() {
return managed;
} | 0 |
public static BookCopy getBookCopyByBookCopyID(int copyID){
try {
if(conn == null || conn.isClosed()){
conn = DatabaseConnection.getConnection();
}
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
BookCopy bc = null;
try {
... | 5 |
public boolean monsterAttack(int userPosition, int player) {
boolean dead = false;
for (int i = 0; i < numberofEnemys; i++) {
if (dead == false) {
if (enemyLocation.get(i) != null) {
int enemyLoc = enemyLocation.get(i);
int enemyLocXY[]... | 9 |
public Administrateur ChercherAdministrateur(String login) {
try {
String sql = "SELECT * FROM User WHERE login='" + login + "'";
ResultSet rs = crud.exeRead(sql);
Administrateur a = new Administrateur();
while (rs.next()) {
a.setL... | 2 |
private static void resplit(final double a[]) {
final double c = a[0] + a[1];
final double d = -(c - a[0] - a[1]);
if (c < 8e298 && c > -8e298) {
double z = c * HEX_40000000;
a[0] = (c + z) - z;
a[1] = c - a[0] + d;
} else {
double z = c *... | 2 |
public void mouseReleased(MouseEvent e) {
//moveCamera(e);
} | 0 |
private void addHour(List<QlockWord> timeList, final int HOUR) {
if (HOUR == 12) {
timeList.add(QlockLanguage.EEN);
} else if (HOUR == 10 || HOUR + 1 == 10) {
timeList.add(QlockLanguage.TIEN1);
} else if (HOUR + 1 == 5) {
timeList.add(QlockLanguage.VIJF);
... | 4 |
static char getAlarmSignal(int alarms){
switch(alarms){
case NoAlarm:
return ' ';
case ServerExceptionAlarm:
return 'x';
case NoServerResponseAlarm:
return '@';
case HeadersChangedAlarm:
retur... | 8 |
private void joinGame(String sender) {
if (status == GameStatus.IDLE) {
return;
}
if (status != GameStatus.PRE) {
// if the game is already running, dont add anyone else to either list
sendNotice(sender, "The game is currently underway. Please wait for "
+ "the current game to finish before trying a... | 9 |
private Value[] fillParameters(BytecodeInfo code, Object cls,
Object[] params) {
Value[] locals = new Value[code.getMaxLocals()];
for (int i = 0; i < locals.length; i++)
locals[i] = new Value();
String myType = code.getMethodInfo().getType();
String[] myParamTypes = TypeSignature.getParameterTypes(myType... | 3 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Path other = (Path) obj;
if(end == other.start && start == other.end)
return true;
if (end != other.end)
return false;
if (start != oth... | 7 |
private void removeBrokenMTWCs(MTWData data) {
Set<Set<Tuple<Integer, Integer>>> set;
if (data.player == playerID) {
set = data.mTWCFP2;
} else {
set = data.mTWCFP1;
}
Iterator<Set<Tuple<Integer, Integer>>> combinations = set.it... | 5 |
public void renderBlank(int xp, int yp, int w, int h, int color) {
for (int y = 0; y < h; y++) {
for (int x = 0; x < w; x++) {
paintPixel((x+xp) + (y+yp) * width, color);
}
}
} | 2 |
public static String longestCommonPrefix(String[] strs) {
if(strs.length == 0) {
return "";
}
boolean wrong = false;
String result = new String();
for(int m = 0; m <= strs[0].length(); m++) {
result = strs[0].substring(0, m);
for(int i = 0; i < strs.length; i++) {
if(strs[i].length() < m) {
... | 6 |
public void testMinus_Days() {
Days test2 = Days.days(2);
Days test3 = Days.days(3);
Days result = test2.minus(test3);
assertEquals(2, test2.getDays());
assertEquals(3, test3.getDays());
assertEquals(-1, result.getDays());
assertEquals(1, Days.ONE.minus(D... | 1 |
protected void onConnect() {} | 0 |
public static correctionx line_corrections(double sigma, double w_est, double r_est)
{
correctionx result_corr = new correctionx();
int i_we,i_re;
//boolean is_valid;
double a,b;
int field;
w_est = w_est/sigma;
if (w_est < 2 || w_est > 6 || r_est < 0 || r_est > 1)
{
result_corr.w = 0;
result_co... | 9 |
public static void showGUI(){
//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.
... | 6 |
public void drawBackground(int i, int k)
{
i += anInt1454;
k += anInt1455;
int l = i + k * DrawingArea.width;
int i1 = 0;
int j1 = anInt1453;
int k1 = anInt1452;
int l1 = DrawingArea.width - k1;
int i2 = 0;
if(k < DrawingArea.topY)
{
int j2 = DrawingArea.topY - k;
j1 -= j2;
k = DrawingArea... | 6 |
public Nodo<E> getNodoXpos(int x){
Nodo<E> resp = cabeza;
for(int i=0 ; i < x ;i++){
if(resp != cola)
resp = resp.getSiguiente();
else{
System.out.println("indice fuera de rango");
return null;
}
}
return... | 2 |
@Override
public String toString() {
return "[lines=" + lines + "]";
} | 0 |
public Constant newClass(final String value) {
key2.set('C', value, null, null);
Constant result = get(key2);
if (result == null) {
newUTF8(value);
result = new Constant(key2);
put(result);
}
return result;
} | 1 |
public void showLockedChildren() {
if (Main.getInterface() == null || Main.getInterface().children == null) {
return;
}
for (int index = 0; index < Main.getInterface().children.size(); index++) {
RSInterface child = RSInterface.getInterface(Main.getInterface().children.get(index));
if (child.locked) {
... | 4 |
public static <GItem> Set<GItem> unionSet(final Set<? extends GItem> items1, final Set<? extends GItem> items2) throws NullPointerException {
if (items1 == null) throw new NullPointerException("items1 = null");
if (items2 == null) throw new NullPointerException("items2 = null");
return new AbstractSet<GItem>() {
... | 6 |
public static void main(String args[]) {
File f = new File("config");
FileReader fr = null;
try {
fr = new FileReader(f);
} catch (FileNotFoundException e2) {
e2.printStackTrace();
}
BufferedReader br = new BufferedReader(fr);
String host = "";
String port = "";
try {
host = br.readLine()... | 6 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Zeit other = (Zeit) obj;
if (hour != other.hour)
return false;
if (minute != other.minute)
return false;
return true;
} | 5 |
@Override
public void actionPerformed(ActionEvent e) {
if (e.getActionCommand().equals(OK)) {
ok();
} else if (e.getActionCommand().equals(CANCEL)) {
cancel();
}
} | 2 |
public void draw(Graphics g, boolean fill) {
g.setColor(myColor);
if(fill) {
g.fillRect(getUpperLeftX(), getUpperLeftY(), getWidth(), getHeight());
} else {
g.drawRect(getUpperLeftX(), getUpperLeftY(), getWidth(), getHeight());
}
} | 1 |
private void getContextNodeBinarySearch() {
int low = MIN_CONTEXT_LENGTH;
int high = _contextLength;
_contextLength = MIN_CONTEXT_LENGTH-1; // not sure we need this
_contextNode = null;
boolean isDeterministic = false;
while (high >= low) {
int contextLength = (high + low)/2;
PPMNode contextNode = looku... | 9 |
private static void WriteAttrisGrp(Document doc, Element attrigrpnode, GeneratorAttriGrp attrisgrp)
{
GeneratorAttriGrp grp;
GeneratorAttri attri;
List<GeneratorAttri> attrislist = attrisgrp.getAttrisList();
List<GeneratorAttriGrp> childattrislist = attrisgrp.getChildAttriGrpList();
int i;
for (i = 0... | 8 |
public List<Client> searchClient(String usernameOrName) {
Connection conn=null;
try{
conn = dbConnector.getConnection();
if (conn==null) //cannot connect to DB
return null;
Statement st;
ResultSet rs;
String sql;
boolean searchAll = false;
if (usernameOrName==null )
searchAll=tr... | 9 |
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof AbstractXYItemLabelGenerator)) {
return false;
}
AbstractXYItemLabelGenerator that = (AbstractXYItemLabelGenerator) obj;
if (!this.formatString.equals(that.f... | 7 |
public void addAtEndBeforeBranch(Instruction i) throws Exception {
if(!instructions.isEmpty() &&
instructions.getLast() instanceof BranchInstruction) {
ListIterator<Instruction> iter =
instructions.listIterator(instructions.size() - 1);
iter.next(); // r... | 4 |
public void solve(char[][] board) {
m = board.length;
if (m == 0)
return;
n = board[0].length;
visited = new boolean[m + 2][n + 2];
for (int i = 0; i < m; i++)
for (int j = 0; j < n; j++)
if (board[i][j] == 'X')
visited[... | 7 |
public static void main(String[] args) {
int[] num = {9,5,4,3,2,7,6,1};
for(int i = 0; i < num.length; i ++) {
for(int j = i + 1; j < num.length; j ++) {
for(int n : num) {
System.out.print(n + ",");
}
System.out.println();
... | 5 |
public static <GInput, GValue, GOutput> Converter<GInput, GOutput> chainedConverter(final Converter<? super GInput, ? extends GValue> converter1,
final Converter<? super GValue, ? extends GOutput> converter2) throws NullPointerException {
if (converter1 == null) throw new NullPointerException("converter1 = null");
... | 6 |
public ContainerComponent(WorkplacePanel parent, Container container) {
this.container=container;
this.workplacePanel=parent;
preferences=workplacePanel.documentFrame.loadOrganizer.preferences;
setBorder(BorderFactory.createLineBorder(Color.BLACK,1));
Dimension boxSize=container.getSize();
Dimensio... | 9 |
private void btnModificarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnModificarActionPerformed
try{
int numero = Integer.parseInt(txt1.getText());
if(numero>0){
Modificar modificar = new Modificar();
Statement consulta = c... | 4 |
public void reduce(Text key, Iterator<Text> values, OutputCollector<Text, Text> output, Reporter reporter) throws IOException {
// allocate and initialize 2D array of category by district
int[][] crimes = new int[categories.size()][districts.size()];
for (int i = 0; i < categories.size(); i++) {
for (int j... | 9 |
@Override
public Cible getCible(String cId) throws InvalidJSONException, BadResponseException {
Cible c = null;
JsonRepresentation representation = null;
Representation repr = serv.getResource("intervention/" + interId
+ "/cible", cId);
try {
representation = new JsonRepresentation(repr);
} catch (I... | 2 |
public void cityCheck() {
for(MyNode n : mg.getNodeArray()) {
for(MyEdge e : n.getFromEdges()) {
if(e.getRoadName().equals(address[0]) && e.getCity().equals(address[5])) {
putEdge(e);
}
}
for(MyEdge e : n.getToEdges()) {
if(e.getRoadName().equals(address[0]) && e.getCity().equals(address[5])... | 7 |
private boolean checkALError()
{
switch( AL10.alGetError() )
{
case AL10.AL_NO_ERROR:
return false;
case AL10.AL_INVALID_NAME:
errorMessage( "Invalid name parameter." );
return true;
case AL10.AL_INVALID_ENUM:
... | 6 |
@Override
public Set<Class<?>> getClasses() {
return getRestResourceClasses();
} | 1 |
public synchronized boolean equals(Object obj) {
if (!(obj instanceof FilterRequest)) return false;
FilterRequest other = (FilterRequest) obj;
if (obj == null) return false;
if (this == obj) return true;
if (__equalsCalc != null) {
return (__equalsCalc == obj);
... | 9 |
private int[] mergeSort(int[] a ) {
if(a.length == 1) return a;
int middle = a.length / 2;
int[] left = new int[middle];
int[] right = new int[a.length - middle];
System.arraycopy(a, 0, left, 0, middle);
System.arraycopy(a, middle, right, 0, a.length - middle);
r... | 1 |
public static void moveItem(InventoryItem[] targetInventory, int targetIndex, InventoryItem[] destinationInventory)
{
/*Example of moving an object from your inventory to a storage chest:
* moveItem(player.Inventory,3,chest.Inventory);
* Where player is the instantiated player object,... | 2 |
public static Password getPassword(String realm,String dft, String promptDft)
{
String passwd=System.getProperty(realm,dft);
if (passwd==null || passwd.length()==0)
{
try
{
System.out.print(realm+
((promptDft!=null && p... | 8 |
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 ht... | 6 |
public String get_user_courses_in_circle_by_year(int user_id, int year, int circle_id)
{
User user = get_user_by_id(user_id);
if(user==null)
return "";
ArrayList<Circle> circles=user.user_circles;
ArrayList... | 6 |
private HashMap<String, HashSet<String>> BFS() {
HashMap<String, HashSet<String>> reverseLinks = new HashMap<String, HashSet<String>>();
if (startWord.equals(endWord))
return reverseLinks;
HashSet<String> visited = new HashSet<String>();
HashSet<String> outGoing = new HashSe... | 7 |
private Node<K, V> ceilingAll( V value ) {
if( value == null ) { return null; }
Node<K, V> node = mAllRoot;
Node<K, V> ret = null;
if( mValueComparator != null ) {
Comparator<? super V> comp = mValueComparator;
while( node != null ) {
int c = c... | 9 |
Item newMethodItem(final String owner, final String name,
final String desc, final boolean itf) {
int type = itf ? IMETH : METH;
key3.set(type, owner, name, desc);
Item result = get(key3);
if (result == null) {
put122(type, newClass(owner), newNameType(name, desc));
result = new Item(index++, key3);
... | 2 |
public void clickPlayGame(ArrayList<MainMenuHeroSlot> heroies) {
state.clickPlayGame(heroies);
} | 0 |
public void WGDefaultChannel(String channel, String sender, String login, String hostname) {
User user;
boolean changed = false;
for(Game game : games.values()) {
user = getUser(game, sender, login, hostname);
if(user != null) {
user.defaultchannel = chann... | 3 |
public BaseReport(File file) {
this.file = file;
fileName = file.getName();
fileNameSections = fileName.split("\\.")[0].split("_");
try {
if (checkVersion(file).equals("2003")) {
InputStream in = new FileInputStream(file);
hWorkbook = new HSSFWorkbook(in);
} else {
InputStream in = new FileIn... | 2 |
protected static void parseSites(final Map<String,SiteConfig> map, Node root) throws Exception {
NodeList children=root.getChildNodes();
if(children == null || children.getLength() == 0)
return;
for(int i=0; i < children.getLength(); i++) {
Node node=children.item(i);
... | 7 |
public static void checkAccuracyRealFFT_1D() {
System.out.println("Checking accuracy of 1D real FFT...");
for (int i = 0; i < sizes1D.length; i++) {
FloatFFT_1D fft = new FloatFFT_1D(sizes1D[i]);
double err = 0.0;
float[] a = new float[sizes1D[i]];
IOUtils... | 8 |
public void sprzedawanie(){
System.out.println("Sprzedaje sprzet...");
} | 0 |
protected void markEnclosingMemberWithLocalType() {
if (this.currentElement != null) return; // this is already done in the recovery code
for (int i = this.astPtr; i >= 0; i--) {
ASTNode node = this.astStack[i];
if (node instanceof AbstractMethodDeclaration
|| node instanceof FieldDeclaration
|| (no... | 8 |
public DisplayMode findFirstCompatibleMode(
DisplayMode modes[])
{
DisplayMode goodModes[] = device.getDisplayModes();
for (int i = 0; i < modes.length; i++) {
for (int j = 0; j < goodModes.length; j++) {
if (displayModesMatch(modes[i], goodModes[j])) {
... | 3 |
@Override
public boolean exec() {
//解析
this.doComm(this.line);
//this.line = this.line.replaceAll(",", ""); //String 可能包含空格
int p1 = this.line.indexOf(" ");
int p2 = this.line.indexOf(",");
if (p1 == -1 || p2 == -1 || p2>=this.line.length()) {
this.out.append("exec var error. line:").append(this.line);
... | 9 |
@Override
public int getSlotSpacingY() {
return isNotPlayerInventory() ? 32 : 18;
} | 1 |
private void calcspectralDifference() {
float[] spectrum = this.nextSpectrum();
float[] lastSpectrum = new float[spectrum.length];
// System.out.println("Spectrum length = " + spectrum.length);
// while there are samples to read, we calculate the flux for each
// window
do {
float flux = 0;
for (in... | 5 |
public void die()
{
alive = false;
} | 0 |
@Override
public boolean equals(Object obj) {
if (obj != null && obj instanceof Node) {
Node n = (Node)obj;
if (n.getId() != null && this.getId() != null
&& n.getId().equals(this.getId())) {
return true;
}
}
return false;
} | 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.