text stringlengths 14 410k | label int32 0 9 |
|---|---|
public int compare(Static o1, Static o2) {
if(tiledata != null && o1.getX() == o2.getX() && o1.getY() == o2.getY() && o1.getZ() == o2.getZ()){
ItemData t1 = tiledata.getItem(o1.getId());
ItemData t2 = tiledata.getItem(o2.getId());
if(t1 == null && t2 == null) return 0;
int t1b = (t1.getFlags().conta... | 8 |
public void loadElementTable(String filename) {
Workbook elementBook = null;
try {
elementBook = Workbook.getWorkbook(new File(filename));
} catch (Exception e) {
System.err.println(e);
}
if(elementBook == null) {
System.err.println("load element table file failed!");
System.e... | 8 |
public boolean editFileContent(String filePath, String fileName, String content) {
filePath = realPath + "\\" + filePath;
BufferedReader reader = null;
BufferedWriter writer = null;
File file = new File(filePath, fileName);
// if no exited, then create one
if (!file.exists()) {
try {
// getParentFile... | 5 |
public void deplacer(String direction, int nombreDeDeplacement)
{
// Contrôle si le véhicule va bien dans le bon sens, puis le déplace dans la bonne direction, et du nombre de cases indiqué en paramètre
if(direction.charAt(0) == 'U' && this.direction == "verticale"){
imageVehicule.slowMoveVertical (nombreDeD... | 8 |
void generateRandomNet(BayesNet bayesNet, Instances instances) {
int nNodes = instances.numAttributes();
// clear network
for (int iNode = 0; iNode < nNodes; iNode++) {
ParentSet parentSet = bayesNet.getParentSet(iNode);
while (parentSet.getNrOfParents() > 0) {
parentSet.deleteLastParent(instances);
... | 8 |
@Override
public void startUp(GameTime gameTime) {
for (IHudItem hudItem : hudItemQueue) {
hudItem.startUp(gameTime);
}
} | 1 |
@Override
public void endElement(String uri, String localName, String qName) throws SAXException {
if (qName.equals("usageFlags")) {
response.setUsageFlags(getInt());
} else if (qName.equals("deployFlags")) {
response.setDeployFlags(getInt());
} else if (qName.equals("allowCorporationMembers")) {
respon... | 5 |
@Override
public Class<?> getColumnClass(int columnIndex) {
return data[0][columnIndex].getClass();
} | 1 |
public int getSampleRate () {
switch (h_sample_frequency) {
case THIRTYTWO:
if (h_version == MPEG1)
return 32000;
else if (h_version == MPEG2_LSF)
return 16000;
else
// SZD
return 8000;
case FOURTYFOUR_POINT_ONE:
if (h_version == MPEG1)
return 44100;
else if (h_version == MPEG2_... | 9 |
public boolean remove(E x) {
if (super.isEmpty()) {
return false;
} else if (super.contains(x)) {
if (maxElement.compareTo(x) == 0) {
super.remove(x);
if (super.isEmpty()) {
maxElement = null;
}
else {
Iterator<E> itr = super.iterator();
maxElement = itr.next();
while (itr... | 6 |
public void mergeSort()
{
// check if there is only 1 element return
if (a.length == 1) return;
// otherwise create two new arrays
int[] left = new int[a.length / 2];
for (int i = 0; i < left.length; i++)
left[i] = a[i];
int[] right = new int[a.length - left.length];
for (int i ... | 3 |
protected void createSubbands()
{
int i;
if (mode == Header.SINGLE_CHANNEL)
for (i = 0; i < num_subbands; ++i)
subbands[i] = new SubbandLayer2(i);
else if (mode == Header.JOINT_STEREO)
{
for (i = 0; i < header.intensity_stereo_bound(); ++i)
subbands[i] = new SubbandLayer2S... | 6 |
@Override
public void close() {
try {
if (this.connection != null)
this.connection.close();
} catch (Exception e) {
this.writeError("Failed to close database connection: " + e.getMessage(), true);
}
} | 2 |
public static void checkVote(final Player player, final String auth) {
if (player.getTemporaryAttributtes().get("CheckingVote") != null)
return;
if(Utils.invalidAuthId(auth)) {
player.getDialogueManager().startDialogue("SimpleMessage", "The authentication id you specified couldn't be found in our database,",... | 9 |
private void startMenu()
{
while (menuRunning) {
Graphics2D g = (Graphics2D) strategy.getDrawGraphics();
g.setColor(Color.black);
g.fillRect(0, 0, Global.xRes, Global.yRes);
button = new ButtonEntity(this, "sprites/hud/newbutton.jpg", new Coords(Global.xRes / 2 - 50, G... | 5 |
public void makeConnection()
{
try
{
if ( weh != null )
weh.close();
weh = new WebsocketExtended();
weh.connect();
}
catch ( Throwable e )
{
e.printStackTrace();
}
} | 2 |
public void update(Input input, int delta) {
// Move down
if(input.isKeyPressed(Settings.menu_down)) {
this.selected += 1;
if(this.selected >= this.items.size()) {
this.selected = 0;
}
}
// Move up
if(input.isKeyPressed(Settings.menu_up)) {
this.selected -= 1;
if(this.selected < ... | 7 |
public void tick() {
die();
if (live <= 0) {
snake.removeEntity(this);
}
} | 1 |
public void printCells(){
for(ProcessedCell cell : cells){
System.out.println(cell);
}
} | 1 |
@Override
public void ParseIn(Connection Main, Server Environment)
{
Room Room = Environment.RoomManager.GetRoom(Main.Data.CurrentRoom);
if(Room == null)
{
return;
}
int itemid = Main.DecodeInt();
if(!Main.Data.SongInInventory.containsKey(itemid))
... | 3 |
public EcTextField(String text,int x, int y,int width,int height){
//super(text);
this.setText(text);
setBounds(x,y,width,height);
try {
font = Font.createFont(Font.TRUETYPE_FONT, this.getClass().getResourceAsStream("/font/LucidaSansRegular.ttf"));
} catch (FontFormat... | 6 |
public String getUsername() {
return username;
} | 0 |
public void destroy(Integer id) throws IllegalOrphanException, NonexistentEntityException {
EntityManager em = null;
try {
em = getEntityManager();
em.getTransaction().begin();
Aplicacao aplicacao;
try {
aplicacao = em.getReference(Aplicaca... | 9 |
@Override
public Object execute(HttpServletRequest request, HttpServletResponse response) throws Exception {
Contexto oContexto = (Contexto) request.getAttribute("contexto");
oContexto.setVista("jsp/usuario/list.jsp");
try {
UsuarioDao oUsuarioDao = new UsuarioDao(oContexto.getEn... | 2 |
public static int damerauDist(int color1, int color2) {
String compOne = color1+"";
String compTwo = color2+"";
int res = -1;
int INF = compOne.length() + compTwo.length();
int[][] matrix = new int[compOne.length()+1][compTwo.length()+1];
for (int i = 0; i < compOne... | 7 |
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((id == null) ? 0 : id.hashCode());
result = prime * result
+ ((kineticLaw == null) ? 0 : kineticLaw.hashCode());
result = prime * result + Arrays.hashCode(listOfProducts);
result = prime * result + Arrays... | 3 |
public void setSize(int width, int height) {
if (width < 0 || height < 0 || width > RASTER_MAX_WIDTH || height > RASTER_MAX_HEIGHT) {
// Invalid width or height.
throw new ExceptionInvalidParam();
} else if (width == 0 || height == 0) {
// An empty image was specified... | 8 |
public int solution(int[] elements) {
int length = elements.length;
//check if array contains only one elements
if (length == 1) {
return length;
}
//check if array contains no elements
if (elements == null || length == 0) {
return length;
}
int localSum = 0;
int globalN = 0;
int localN ... | 6 |
@Override
public boolean pass() {
if (numPassages > 0) {
--numPassages;
return true;
} else {
return false;
}
} | 1 |
private Object[][] createRowData(Integer nbrVars) {
int lines = (int) Math.pow(2, nbrVars.intValue());
Object[][] data = new Object[lines][nbrVars.intValue() + 2];
for (int i = 0; i < lines; i++) {
for (int j = 0; j < nbrVars.intValue() + 2; j++) {
if (j == 0)
data[i][j] = i;
else {
if (j == ... | 5 |
public static void calculateErrorArrays(){
//output error
for(int outNode = 0; outNode < numOutputs; outNode++){
double sum = 0;
for(int node = 0; node < hidOut.length; node++){
sum += (hiddenOutput[node] * hidOut[node][outNode]);
}
outputError[outNode] = derivitiveActivationFunction(sum) * (lastOut... | 5 |
private void HandleCommand(String line, BufferedImage image)
{
try
{
StringTokenizer commands = new StringTokenizer(line);
String command = commands.nextToken();
if (command.equals("common"))
{
mLineHeight = Integer.parseInt(commands.nextToken().substring(11));
}
else if (command.equa... | 9 |
public void assignFarmToBatiment(List<Batiment> batiments){
/* this.setBatiments(batiments);
for (Batiment b : batiments){
b.setFarm(this); */
for(Batiment batiment:batiments){
batiment.setFarm(this);
this.setBatiments(batiments);
}
} | 1 |
public int calcFreeSeats(HashMap<Integer, Integer[]> passengerByStation, List<Object[]> allStationsByTrain, Station stationFrom, Station stationTo, Train train) {
log.debug("Start method \"calcFreeSeats\"");
int occupiedSeats = 0;
int maxOccupied = -1;
boolean calcMax = false;
fo... | 6 |
public List findRecords(String sqlString, boolean closeConnection)
throws SQLException, Exception {
Statement stmt = null;
ResultSet rs = null;
ResultSetMetaData metaData = null;
final List list = new ArrayList();
Map record = null;
// do this in an excpetion... | 7 |
public void test_18_DnaCoder_score_rand() {
int numTests = 10;
int minLen = 10;
System.err.println("DnaCoder.score test:");
DnaCoder dnaCoder = DnaCoder.get();
DnaSubsequenceComparator<DnaSequence> comparator = new DnaSubsequenceComparator<DnaSequence>(true);
Random rand = new Random(20100812);
for( int... | 2 |
private static boolean deleteDir(File dir) {
try {
logger.info("IN DELETEDIR");
if (dir.isDirectory()) {
String[] children = dir.list();
for (int i=0; i<children.length; i++) {
boolean success = deleteDir(new File(dir, children[i]));
if (!success) {
return false;
}
}
}
}
... | 4 |
static void fetch (int pc) {
if(pc<2000){
String corrector = "";
String instruction1 = Integer.toBinaryString(mem[pc]);
String instruction2 = Integer.toBinaryString(mem[pc+1]);
if(instruction1.length() < 8) {
for(int i=0; i<8-instruction1.length(); i++) {
corrector= corrector+0;
}
}
... | 5 |
public void insertNode(int index, DoublyLinkedListNode<T> newNode) {
//Check for out of bounds insertion.
if (index > size) {
return;
}
if (size == 0) {
// Deal with special case of the first node.
startNode = newNode;
} else if (index == 0) {
// Deal with special case of in... | 8 |
public void loadAdmin(Node node) {
Administrator ad = new Administrator();
NodeList childNodes = node.getChildNodes();
for (int i = 0; i < childNodes.getLength(); i++) {
Node cNode = childNodes.item(i);
if (cNode instanceof Element) {
String content = cNode.getLastChild().getTextContent().trim();
sw... | 6 |
private List<Node> findChildren(Node node, int depth) {
List<Node> result = null;
List<Node> traversed = new LinkedList<Node>();
traversed.add(node);
int count = 0;
while (!traversed.isEmpty() && (count < depth)) {
Node tmp = traversed.remove(0);
coun... | 8 |
public int findConversation (ArrayList<String> contacts)
{
// index que l'on retourne
int index = -1;
// variable qui sert d'index pendant qu'on parcourt le tableau
int i = -1;
// variable qui test chaque conversation
boolean checked;
for (Panel_Conversation conversation : conversations)
{
... | 5 |
public static void main(String[] args) throws IOException {
ICsvBeanReader beanReader = null;
try {
beanReader = new CsvBeanReader(new FileReader(
"D:\\Download\\all_india_PO_list_without_APS_offices_ver2.csv"), CsvPreference.STANDARD_PREFERENCE);
// the header elements are used to map the values to the... | 9 |
public int getScaledWidth() {
return WIDTH;
} | 0 |
@Override
public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope,
Scriptable thisObj, Object[] args)
{
if (!f.hasTag(REGEXP_TAG)) {
return super.execIdCall(f, cx, scope, thisObj, args);
}
int id = f.methodId();
switch (i... | 8 |
private void updateGameResult(Boolean amIWinner) {
view.setLastGameChoices(useCase.getMyLastChoice(), useCase.getOpponentLastChoice());
if(null == amIWinner)
view.evenGame();
else if(amIWinner)
view.winGame();
else
view.lostGame();
} | 2 |
public String toString() {
StringBuilder sb = new StringBuilder();
for (byte[] b : list)
sb.append(new String(b) + "\n");
return sb.toString();
} | 1 |
public static void setCaption(String c) {
caption.setText(c);
} | 0 |
@Override
public void Execute(CommandSender cs, String[] args){
try {
if(!FCReborn.getPlugin().getChatters().containsKey(cs.getName())){
cs.sendMessage(ChatColor.RED + "[FCReborn] You aren't attached to anyone!");
return;
}
StringBuilder cmd = new StringBuilder();
for(String s: args){
cmd.a... | 3 |
protected boolean hasSomebodyWon() {
return player1.win() || player2.win();
} | 1 |
public Image resizeImage(int intX, int intY) {
if (isFile()) {
if (intX >= 0 && intY >= 0) {
File flTmp = new File(strFile);
if (flTmp.canRead() && flTmp.isFile() && flTmp.exists()) {
Image imgOrig; ... | 9 |
public static void main(String[] args) throws InterruptedException, MalformedURLException {
String urlArg = args[0];
url = new URL(urlArg);
SpringApplication.run(Application.class, args);
Thread.sleep(600000);
} | 0 |
private String read_file(final File file) throws Exception
{
BufferedReader r = null;
final StringBuffer sb = new StringBuffer();
try
{
r = new BufferedReader(new FileReader(file));
String line = null;
while ((line = r.readLine()) != null) sb.append(line).append("\n");
}
finally
{
if (r != null) r.close... | 2 |
@Override
public void run() {
while (true) {
System.out.println("MediaDownloderThreadを起動します");
MediaDownloderComponent mediaDownloderComponent = new MediaDownloderComponent();
if (mediaDownloderComponent.isDownloadList()) {
mediaDownloderComponent.download();
}
try {
sleep(SLEEP_TIME);
... | 3 |
public static Gleitpunktzahl invSqrt(Gleitpunktzahl x) {
/* TODO: hier den "fast inverse square root" Algorithmus implementieren */
if (x.vorzeichen || x.isInfinite() || x.isNaN() || x.isNull())
return Gleitpunktzahl.getNaN();
int y = gleitpunktzahlToIEEE(x).toInt()/2;
y = FastMath.MAGIC_NUMBER - y;
return... | 4 |
boolean isAdherentBorder(TextStyle style) {
if (this == style)
return true;
if (style == null)
return false;
if (borderStyle != style.borderStyle)
return false;
if (borderColor != null) {
if (!borderColor.equals(style.borderColor))
return false;
} else {
if (style.borderColor != null)
r... | 9 |
public void testConcurrentJoining() throws Exception {
for(int i=0; i < NUM; i++) {
threads[i]=new MyThread(channels[i], i+1, barrier);
threads[i].start();
}
barrier.await(); // causes all threads to call Channel.connect()
System.out.println("*** Starting the con... | 9 |
protected PartitionKeyTrace getPartitionKeyTrace(Object target, MethodSignature signature) {
// inspect cached traces first
PartitionKeyTrace trace = traces.get(signature.getMethod().toString());
if (trace == null) {
Method method = getTargetMethod(target, signature);
if (method != null) {
An... | 8 |
public void setW(String s){
w = s;
} | 0 |
@Override
public int hashCode() {
int result = font != null ? font.hashCode() : 0;
result = 31 * result + (verticalAlign != null ? verticalAlign.hashCode() : 0);
result = 31 * result + (align != null ? align.hashCode() : 0);
result = 31 * result + (fgColor != null ? fgColor.hashCode(... | 7 |
static void p1(int pos, int maxUsed) {
if (pos == k) {
System.out.println(Arrays.toString(a));
} else {
for(int i = maxUsed+1; i <= n; i++) {
a[pos] = i;
p1(pos+1,i);
}
}
} | 2 |
public RadioButton add(String lbl, Coord c) {
RadioButton rb = new RadioButton(c, parent, lbl);
btns.add(rb);
map.put(lbl, rb);
rmap.put(rb, lbl);
if(checked == null)
checked = rb;
return(rb);
} | 1 |
public String getName() {
return name;
} | 0 |
public static void main(String[] args) {
EvolvingGlobalProblemSetInitialisation starter = new EvolvingGlobalProblemSetInitialisation();
starter.initLanguage(new char[] { '0', '1' }, 10, "(0|101|11(01)*(1|00)1|(100|11(01)*(1|00)0)(1|0(01)*(1|00)0)*0(01)*(1|00)1)*");
int solutionFoundCounter = 0;
int noSolutionF... | 8 |
public AnimFrame(Image image, long endTime) {
this.image = image;
this.endTime = endTime;
} | 0 |
public String toString() {
String str = "";
if (this.type == TypeC.YELLOW)
str += "Yellow";
else if (this.type == TypeC.GREEN)
str += "Green";
else if (this.type == TypeC.RED)
str += "Red";
else
str += "Blue";
return str;
} | 3 |
public static EQdata loadCSV(File f) {
ArrayList<EQcamper> sc = new ArrayList<>();
ArrayList<String> requirements = new ArrayList<>();
try {
Scanner m = new Scanner(f);
String titleLine = m.nextLine();
titleLine = titleLine.substring(titleLine.indexOf(",")+1); //gets rid of the Scout Name collum
title... | 9 |
public void moveCharacter(int x, int y, int lastKeyPressed) {
try {
this.retractWeapon(lastKeyPressed);
this.retractWeapon(KeyEvent.VK_D);
this.retractWeapon(KeyEvent.VK_A);
Point newLocation = new Point((int) getCharacterLocation().getX() + x, (int) getCharacterLocation().getY()
+ y);
GridSpace g... | 8 |
public void setPassword(String password, boolean hashed){
if(password != null && this.password != null){
if(this.password.equals(password))
return;
}
if(hashed == true){
this.password = password;
}else{
this.password = this.hash(password);
}
... | 4 |
public void fillOrder(String orderNum)
{
//Called when a customer checks out
//Query the Orders table
System.out.println("Filling order: " + orderNum);
String queryOrders = "SELECT o.stock_number, o.quantity FROM Orders o WHERE o.order_number = '" + orderNum + "'";
Statement stm = null;
try {
s... | 5 |
@Test
public void testSetQueueTimeoutError() {
LOGGER.log(Level.INFO, "----- STARTING TEST testSetQueueTimeoutError -----");
String client_hash = "";
String client_hash2 = "";
try {
server2.setUseMessageQueues(true);
} catch (TimeoutException e) {
exce... | 5 |
public void drawTop(Graphics g) {
for (int i=0; i < edges.size(); i++) {
edges.get(i).drawTop(g);
}
} | 1 |
public void readConfig(String file) {
try {
FileReader configRead;
configRead = new FileReader(file);
Scanner scan = new Scanner(configRead);
while (scan.hasNext()) {
bluHeadX = scan.nextInt();
bluHeadY = scan.nextInt();
magHeadX = scan.nextInt();
magHeadY = scan.nextInt();
blaHeadX = ... | 2 |
public void setSuppliercode(int suppliercode) {
this.suppliercode = suppliercode;
} | 0 |
public void run()
{
try
{
// Join the group and listen for messages.
groupInterface.joinGroup(group);
while (polling)
{
// get a responses!
byte[] buf = new byte[1024];
DatagramPacket packet = new DatagramPacket(buf, buf.length);
groupInterface.receive(packet);
String ... | 2 |
private int getNumIterations() {
int numIterations;
if (population.getGenerationNumber() > 20) {
numIterations = population.getGenerationNumber() * AppProperties.coefMultiplEpoch() * 2;
} else {
numIterations = population.getGenerationNumber() * AppProperties.coefMultiplE... | 2 |
public String getAndroidJar() {
return androidJar;
} | 0 |
protected void move()
{
if (target!= null && m.checkEnemy(target) == true)
{
//System.out.println(target);
turnTowards(target.getX(), target.getY());
move(speed) ;
}//IllegalActor here making it turn when its not there (DID JAMES ADDD THIS?)
el... | 2 |
public AttendanceResponseList getAttendanceResponseList(int aiMaxSize, String asLastModified) {
String lsParam = "";
if (aiMaxSize > 0) {
lsParam += "&max_size=" + Integer.toString(aiMaxSize);
}
if (UtilityMethods.isValidString(asLastModified)) {
lsParam += "&last... | 3 |
public JSONObject xml2Json(InputStreamReader xmlSrc) throws IOException, JSONException {
char[] buf = new char[1024 * 64];
int cnt = -1;
StringBuilder optStr = new StringBuilder(1024 * 1024 * 25);
while((cnt = xmlSrc.read(buf)) > 0) {
optStr.append(buf, 0, cnt);
}
String jsonStr = optStr.toString();
... | 1 |
protected int indexToInsert(GameComponent<?> component) {
int lowerIndex = 0;
int higherIndex = this.getComponentCount() - 1;
int searchedZ = component.getZ();
if(this.getComponents().isEmpty() || searchedZ < this.getZFromComponentAt(lowerIndex)) {
return 0;
}
if(searchedZ >= this.getZFromComponentAt(h... | 7 |
private Connection(String ip) throws UnknownHostException
{
try
{
socket = new DatagramSocket(0);
}
catch (java.net.BindException e)
{
// try
// {
// socket = new DatagramSocket(1003);
// }
// catch (java.net.BindException ex)
// {
// ex.printStackTrace();
// }
// catch (SocketExcept... | 4 |
protected boolean prereqs(MOB mob, boolean quiet)
{
if(mob.isInCombat()&&(mob.rangeToTarget()>0))
{
if(!quiet)
mob.tell(L("You are too far away to perform a called strike!"));
return false;
}
final Item w=mob.fetchWieldedItem();
if((w==null)||(!(w instanceof Weapon)))
{
if(!quiet)
mob.tell(... | 8 |
private void handleP1selection(ActionEvent e) {
for (int i = 0; i < fighters.length; i++) {
JButton button = view.getP1Array()[i];
if (view.getSelection()[i] == 1)
view.setSelection(i, 0);
if (button.equals(e.getSource())) {
System.out.println("P1 button " + i);
view.setSelection(i, 1);
}
... | 3 |
public int get(int key){
if(map.containsKey(key)){
Node n = map.get(key);
if(n.pre != null){
if(list.last == n)
list.last = n.pre;
n.pre.next = n.next;
if(n.next != null)
n.next.pre = n.pre;
n.... | 4 |
@PersistenceContext
public void setEntityManager(EntityManager entityManager) {
this.entityManager = entityManager;
} | 0 |
public static boolean isBorderTimerRunning() {
if (borderTask == -1)
return false;
return (plugin.getServer().getScheduler().isQueued(borderTask) || plugin
.getServer().getScheduler().isCurrentlyRunning(borderTask));
} | 2 |
public int countPrimes(int n) {
if (n <= 1) {
return 0;
}
boolean[] isPrime = new boolean[n];
for (int i = 2; i < n; i++) {
isPrime[i] = true;
}
for (int i = 2; i * i < n; i++) {
if (!isPrime[i]) {
continue;
}
for (int j = i * i; j < n; j += i) {
isPrime[j] = false;
}
}
int cou... | 7 |
public List<Value> getValueSpace() {
List<Value> values = new ArrayList<Value>();
if(firstNumber instanceof MyPower) {
double start = ((MyPower)firstNumber).getExponent(),
e = ((MyPower)end).getExponent(),
next = ((MyPower)nextNumber).getExponent(),
iterations = (e - start) / (next - start) ... | 8 |
public static int countIncludedString(CharSequence charseq, String str){
if(charseq == null || str == null){
System.out.println("�L��Ȓl���͂��Ă�������");
}
String testedStr = charseq.toString();
int count = 0;
while(testedStr.contains(str)){
count++;
int index = testedStr.indexOf(str);
tested... | 3 |
private void updateLayout()
{
if (panelTop != null)
mainPanel.remove(panelTop);
if (panelBot != null)
mainPanel.remove(panelBot);
switch (type)
{
case conjugation:
panelTop = new AddConjugPanel(frameDictionary.getLanguage1());
panelBot = new AddConjugPanel(frameDictionary.getLanguage2());
bre... | 7 |
protected UINode selectionAt(Vec2D mousePos) {
if (super.selectionAt(mousePos) == null) return null ;
if (selectMode == MODE_BOUNDS) {
return this ;
}
if (selectMode == MODE_RADIUS) {
final float radius = Math.max(bounds.xdim(), bounds.ydim()) / 2 ;
return (bounds.centre().pointDist(mo... | 6 |
public static String getLastName(String fullName) {
if (fullName.contains(",")) {// assuming lastName first then firstName maybe as initial or with middle name
// initial
return fullName.substring(0, fullName.indexOf(","));
} else if (!fullName.contains(".") && fullName.contains(" ")) {// ... | 7 |
public Production[] getProductions() {
return productions;
} | 0 |
public void setValue(Object self, Object value) {
if (isBoolean && value instanceof Number) {
value = ((Number) value).longValue() > 0 ? Boolean.TRUE : Boolean.FALSE;
}
try {
if (writeMethod != null) {
writeMethod.invoke(self, new Object[]{value});
... | 6 |
public Class(String className){
this.className = className;
} | 0 |
public static void crossover(Deck[] result, int position, Deck[] source, float[] perf, float total){
Deck a = selectOne(source, perf, total);
Deck b = selectOne(source, perf, total);
if(Math.random() < Zegana.crossoverChance){
//We want to interchange the substring posa1:posa2 (inclusive) in a
//with the... | 6 |
public void dumpTable(final String table, final PrintStream inOut, final String newline) {
(new SQLStatementProcessor<Void>("SELECT * FROM " + table) {
Void process( PreparedStatement s ) throws SQLException {
ResultSet rs = s.executeQuery();
ResultSetMetaData md = rs.getMetaData();
for( int i=... | 4 |
static void initOptions() throws FileNotFoundException, IOException{
opt = new Option();
//setSkin(opt.getSkin());
skin = opt.getSkin();
downloadPath = opt.getDownloadPath();
if (!new File(downloadPath).exists())
new File(downloadPath).mkdir();
maxDownloads= opt.getMaxDownloads();
exec = Executors.new... | 1 |
private void setupBackground(int utilitiesWidth, int slideHeight,
int bookLayout) {
background = new JLabel();
try{
if(bookLayout == 2){
backgroundImage = ImageIO.read(new File("resources/buttons2/UtilitiesBackground.png"));
}
else
{
backgroundImage = ImageIO.read(new File("resources/buttons/... | 2 |
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.