method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
289ac9c5-6c87-4160-bf7f-e6154ea0831f | 4 | public DarkIRCBot() {
Properties prop = new Properties();
InputStream input = null;
try {
input = new FileInputStream(DarkIRCmain.getConfigFile());
// load a properties file
prop.load(input);
this.setName(prop.getProperty("nick", "DarkUser"));
} catch (IOException ex) {
ex.printStackTrace();
} finally {
if (input != null) {
try {
input.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
this.setLogin("DarkIRC");
this.setVersion("DarkIRC v0.1");
this.setAutoNickChange(true);
this.setVerbose(false);
try {
this.setEncoding("UTF-8");
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} |
df3f734f-857a-457e-a5f9-1d24bcbfe55d | 1 | @Override
protected void onKick(String channel, String kickerNick, String kickerLogin,
String kickerHostname, String recipientNick, String reason) {
ChannelEventsListener listener = getChannelEventsListener(channel);
if (listener != null)
listener.userKicked(kickerNick, recipientNick, reason);
} |
dfbec57c-996b-46e1-979b-ac7e232f2ff9 | 4 | public boolean Login() throws LoginFailException {
try {
String url_id = URLEncoder.encode(id, "UTF-8");
String url_pw = URLEncoder.encode(pw, "UTF-8");
String url = "https://www.melon.com/muid/login/web/login_informProcs.htm";
String param = "memberId=" + url_id + "&memberPwd=" + url_pw;
URL targetURL;
targetURL = new URL(url);
URLConnection urlConn = targetURL.openConnection();
HttpsURLConnection request = (HttpsURLConnection) urlConn;
request.addRequestProperty("User-Agent",
"Android; AS40; Android 4.4.2; 2.7.4; Nexus 5");
request.addRequestProperty("Cookie", "PCID=;");
request.addRequestProperty("Host", "www.melon.com");
request.setUseCaches(false);
request.setDoOutput(true);
request.setDoInput(true);
HttpURLConnection.setFollowRedirects(true);
request.setInstanceFollowRedirects(true);
request.setRequestMethod("POST");
OutputStream opstrm = request.getOutputStream();
opstrm.write(param.getBytes());
opstrm.flush();
opstrm.close();
List<String> cookies = request.getHeaderFields().get("Set-Cookie");
if (cookies == null) throw new LoginFailException("Login Fail");
String tmp = cookies.toString();
if (tmp != null && !tmp.equals("")) {
this.idcookie = tmp.split(";")[2].substring(18);
this.keycookie = tmp.split(";")[4].substring(8).substring(11);
}
return true;
} catch (IOException e) {
e.printStackTrace();
}
return false;
} |
caa1ff16-a7c7-4fb1-897b-3fac953c4ba3 | 1 | private boolean indexOK(int index) {
return (index >= 0 && index < array.length);
} |
f3f68f76-9a22-45df-9e82-5227fe174b04 | 9 | public SnmpPdu decodePDU(BerDecoder raw_packet)
throws SnmpMessageException, BerException {
SnmpPdu pdu = new SnmpPdu();
int length;
pdu.setPduType(raw_packet.decodeTag(-1));
if (debug) dump(pdu.pduTypeToString());
switch (pdu.getPduType()) {
case SnmpPdu.SNMP_MSG_GET:
case SnmpPdu.SNMP_MSG_GETNEXT:
case SnmpPdu.SNMP_MSG_RESPONSE:
case SnmpPdu.SNMP_MSG_SET:
case SnmpPdu.SNMP_MSG_TRAP:
case SnmpPdu.SNMP_MSG_INFORM:
case SnmpPdu.SNMP_MSG_TRAP2:
case SnmpPdu.SNMP_MSG_REPORT:
length = raw_packet.decodeLength();
raw_packet.decodeLengthEquals(length);
pdu.setRequestId(raw_packet.decodeSnmpInteger());
pdu.setErrorStatus(raw_packet.decodeSnmpInteger());
pdu.setErrorValue(raw_packet.decodeSnmpInteger());
break;
default:
throw new SnmpMessageException("Unknown PDU type");
}
pdu.setVarbindList(raw_packet.decodeVarbindList());
return pdu;
} |
f6a01eaf-3d09-4b0b-8546-14a92894b7c9 | 3 | public List<Account> findDeliquentAccounts() throws Exception {
ArrayList<Account> delinquentAccounts = new ArrayList<>();
List<Account> accounts = jdbcAccountDao.findAllAccounts();
Date thirtyDaysAgo = daysAgo(30);
for (Account account : accounts) {
boolean owesMoney = account.getBalance()
.compareTo(BigDecimal.ZERO) > 0;
boolean thirtyDaysLate = account.getLastPaidOn()
.compareTo(thirtyDaysAgo) <= 0;
if (owesMoney && thirtyDaysLate) {
delinquentAccounts.add(account);
}
}
return delinquentAccounts;
} |
ac171a67-0a88-46b8-be97-fa7d819f0c2b | 1 | public void addToStart(String value) {
ListElement current = new ListElement(value);
if (count == 0) {
head = current;
tail = current;
} else {
current.connectNext(head);
head = current;
}
count++;
} |
560e1059-d76a-4b5d-8fd8-c2eba1332cee | 9 | public static void main(String[] args) {
if (args.length != 5){
System.err.println("Incorrect number of arguments");
System.err.println("Syntax: java AllAssignmentsGrader " +
"<hw1|hw2|...> " +
"<gradesource_students_file> <ACMS_accounts_file> " +
"<test_cases_file> <directory_of_submissions>");
return;
}
String assignment = args[0];
File students_file = new File(args[1]);
File accounts_file = new File(args[2]);
File tests_file = new File(args[3]);
File submissions_dir = new File(args[4]);
if (!students_file.canRead()) {
System.err.println("can't read gradesource_students_file");
return;
}
if (!accounts_file.canRead()) {
System.err.println("can't read ACMS_accounts_file");
return;
}
if (!tests_file.canRead()) {
System.err.println("can't read test_cases_file");
return;
}
if (!submissions_dir.canRead()) {
System.err.println("can't read directory_of_submissions");
return;
}
AssignmentGrader grader = getGrader(assignment);
HashMap<String, String> ar[] = createStudentsToIds(students_file);
HashMap<String, String> studentsToIds = ar[0];
HashMap<String, String> idsToRealNames = ar[1];
HashMap<String, String> accountsToStudents = createAccountsToStudents(accounts_file);;
ArrayList<ProblemGrader> problem_graders = ProblemGrader.createProblemGraders(tests_file);
HashMap<String, String> namesToScoresAndFeedback = gradeAllAssignments(
grader, submissions_dir, studentsToIds, accountsToStudents, problem_graders);
ArrayList<String> rows = new ArrayList<String>();
for (Entry<String, String> entry : studentsToIds.entrySet()) {
String name = entry.getKey();
String emailId = entry.getValue();
String scoresAndFeedback = namesToScoresAndFeedback.remove(name);
if (scoresAndFeedback != null)
rows.add(idsToRealNames.get(emailId) + ";" + emailId + ";" + scoresAndFeedback);
else
rows.add(idsToRealNames.get(emailId) + ";" + emailId + ";");
}
Collections.sort(rows);
for (Entry<String, String> entry : namesToScoresAndFeedback.entrySet()) {
String nameOrAccount = entry.getKey();
rows.add(nameOrAccount + ";?;?;" + entry.getValue());
}
for (String row : rows)
System.out.println(row);
} |
e62f88be-82d1-4f00-8528-588b74b9c1d2 | 6 | public void sendBroadcast (Message message)
{
try
{
switch (message.getType())
{
// Etat 10 : On envoi un message en broadcast
case 10 :
{
// On cree une copie pour nous meme
program.getChat().getBroadcast().addMessage(message);
break;
}
// Etat 11 : On envoi un fichier en broadcast
case 11 :
{
String file_name = "";
try
{
File file = (File) message.getMessage();
file_name = file.getName();
FileInputStream fis = new FileInputStream(file);
byte[] file_byte = new byte[(int) file.length()];
fis.read(file_byte);
Message new_message = new Message(message.getSender(), message.getRecipients(), message.getType(), file_byte);
message = new_message;
// Probleme envoi de paquet par broadcast alors on passe par plusieurs
// unicast
for (String contact : program.getListContact().getListContact())
{
netif.sendUnicast(message, new Address(Message.getAddress(contact)));
}
// On creer un message vide avec un getType 0 pour qu'il ne soit pas
// traite car on envois un message a la sortie du switch
message = new Message(message.getSender(), null, 0, null);
}
catch (FileNotFoundException fnfe)
{
fnfe.printStackTrace();
}
catch (IOException ioe)
{
ioe.printStackTrace();
}
// On creer un message pour nous meme disant qu'on est en attente d'un accuse de reception
Message receipt_message = new Message(message.getSender(), null, -1, "envoi en cours " + file_name);
program.getChat().getBroadcast().addMessage(receipt_message);
break;
}
}
netif.sendBroadcast(message);
}
catch (IOException ioe)
{
ioe.printStackTrace();
}
} |
430bddae-0c80-43f8-bbd2-8def4a77d078 | 6 | public boolean parsePublicMessage(String message, Client client) {
if (status > 2 && !client.isModerator()) {
client.sendButlerMessage(channel.getName(),
"In diesem Channel kannst du nicht öffentlich sprechen.");
return false;
}
String msg = message.toLowerCase();
if (msg.contains(Server.get().getButler().getName().toLowerCase())
&& msg.contains("mafia")) {
channel.broadcastMessage(message, client, true);
if (status == 0) {
status++;
thread.start();
String popup = Popup
.create("Start Mafiarunde",
"Start Mafiarunde",
String.format(
"##Im Channel %s beginnt nun die _nächste Mafiarunde_.##_°B>_cKlicken Sie hier|/p James:ok<r°_ um daran teilzunehmen.",
channel.getName()), 400, 250);
for (Client c : channel.getClients()) {
c.send(popup);
}
channel.broadcastButlerMessage("Eine _neue Runde Mafia_ beginnt. Wer bei diesem tödlichen Spiel mitspielen möchte, möge mir dies °R°privat °°mitteilen.");
} else {
channel.broadcastButlerMessage("Mafia läuft bereits.");
}
return false;
}
return true;
} |
0409e028-6195-40ba-9e64-9041a833102a | 6 | @Test
/**
* This does not test the distribution, but if we belive in the random generators
* it tests the "border values" in that all possible values must be generated
*/
public void testGetRandomQuestion()
{
int testTries = 30;
boolean horseFound = false;
boolean houseFound = false;
boolean boatFound = false;
for (int i = 0; i < testTries; i++) {
String question = control.getRandomQuestion();
if (question.equals("hest")) {
horseFound = true;
}
if (question.equals("hus")) {
houseFound = true;
}
if (question.equals("skib")) {
boatFound = true;
}
}
assertTrue(horseFound && houseFound && boatFound);
} |
e77cbece-d486-4539-b508-d684aaee1e20 | 4 | public void setTotal(int total) {
this.total = total;
int pages = total / size;
boolean hasMore = (0 != total % size);
if (0 == pages) {
totalPage = 1;
} else {
if (hasMore) {
totalPage = pages + 1;
} else {
totalPage = pages;
}
}
if (curpage > totalPage) {
curpage = totalPage;
}
if (curpage < 1) {
curpage = 1;
}
} |
c328caea-c968-4da6-ae63-4dc9dd59855e | 3 | public void setEqualizer(Equalizer eq)
{
if (eq==null)
eq = Equalizer.PASS_THRU_EQ;
equalizer.setFrom(eq);
float[] factors = equalizer.getBandFactors();
if (filter1!=null)
filter1.setEQ(factors);
if (filter2!=null)
filter2.setEQ(factors);
} |
cbf10f8e-c149-424a-b58a-96d47950153d | 0 | private static void getCommand() {
System.out.print("[Moves:" + moves + " Score:" + score + " Ratio:" + ratio + " Possible directions:" + possibleDirs + "] ");
Scanner inputReader = new Scanner(System.in);
command = inputReader.nextLine();
} |
046d1a65-f163-4e7f-bd89-670fa37d7067 | 9 | * @param body
* @return Stella_Object
*/
public static Stella_Object traceIf(Stella_Object keyword, Cons body) {
{ Cons test = Stella.NIL;
Cons elements = Cons.copyConsList(body);
if (Stella_Object.safePrimaryType(keyword) == Stella.SGT_STELLA_CONS) {
{ Cons keyword000 = ((Cons)(keyword));
{ Stella_Object kwd = null;
Cons iter000 = keyword000;
Cons collect000 = null;
for (;!(iter000 == Stella.NIL); iter000 = iter000.rest) {
kwd = iter000.value;
if (collect000 == null) {
{
collect000 = Cons.cons(Cons.list$(Cons.cons(Stella.SYM_STELLA_MEMBp, Cons.cons(Stella.SYM_STELLA_$TRACED_KEYWORDS$, Cons.cons(kwd, Cons.cons(Stella.NIL, Stella.NIL))))), Stella.NIL);
if (test == Stella.NIL) {
test = collect000;
}
else {
Cons.addConsToEndOfConsList(test, collect000);
}
}
}
else {
{
collect000.rest = Cons.cons(Cons.list$(Cons.cons(Stella.SYM_STELLA_MEMBp, Cons.cons(Stella.SYM_STELLA_$TRACED_KEYWORDS$, Cons.cons(kwd, Cons.cons(Stella.NIL, Stella.NIL))))), Stella.NIL);
collect000 = collect000.rest;
}
}
}
}
switch (test.length()) {
case 0:
{ Object old$PrintreadablyP$000 = Stella.$PRINTREADABLYp$.get();
try {
Native.setBooleanSpecial(Stella.$PRINTREADABLYp$, true);
Stella.signalTranslationError();
if (!(Stella.suppressWarningsP())) {
Stella.printErrorContext(">> ERROR: ", Stella.STANDARD_ERROR);
{
Stella.STANDARD_ERROR.nativeStream.println();
Stella.STANDARD_ERROR.nativeStream.println(" Missing `trace-if' keyword.");
}
;
}
} finally {
Stella.$PRINTREADABLYp$.set(old$PrintreadablyP$000);
}
}
return (Stella_Object.walkDontCallMeTree(Stella.NIL, Stella.SGT_STELLA_VOID, new Object[1]));
case 1:
test = ((Cons)(test.value));
break;
default:
test = Cons.cons(Stella.SYM_STELLA_OR, test);
break;
}
}
}
else {
test = Cons.list$(Cons.cons(Stella.SYM_STELLA_MEMBp, Cons.cons(Stella.SYM_STELLA_$TRACED_KEYWORDS$, Cons.cons(keyword, Cons.cons(Stella.NIL, Stella.NIL)))));
}
return (Cons.list$(Cons.cons(Stella.SYM_STELLA_WHEN, Cons.cons(Cons.list$(Cons.cons(Stella.SYM_STELLA_AND, Cons.cons(Cons.list$(Cons.cons(Stella.SYM_STELLA_DEFINEDp, Cons.cons(Stella.SYM_STELLA_$TRACED_KEYWORDS$, Cons.cons(Stella.NIL, Stella.NIL)))), Cons.cons(test, Cons.cons(Stella.NIL, Stella.NIL))))), Cons.cons(Cons.cons(Stella.SYM_STELLA_PRINT, Cons.copyConsList(elements).concatenate(Stella.NIL, Stella.NIL)), Cons.cons(((((elements.last() == Stella.SYM_STELLA_EOL) ||
(((Keyword)(Stella.$TRANSLATOROUTPUTLANGUAGE$.get())) == Stella.KWD_COMMON_LISP)) ? Stella.NIL : Cons.cons(Cons.list$(Cons.cons(Stella.SYM_STELLA_FLUSH_OUTPUT, Cons.cons(Stella.SYM_STELLA_STANDARD_OUTPUT, Cons.cons(Stella.NIL, Stella.NIL)))), Stella.NIL))).concatenate(Stella.NIL, Stella.NIL), Stella.NIL))))));
}
} |
8eb6e172-cf37-49ad-8418-18aacf097b40 | 5 | public void InitMouseListener(){
addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent arg0) {
setSelected(true);
}
@Override
public void mousePressed(MouseEvent arg0) {
ClickOffsetPoint = arg0.getPoint();
}
@Override
public void mouseEntered(MouseEvent e) {
// TODO Auto-generated method stub
super.mouseEntered(e);
if (getSelected() == false) {
setOpaque(true);
setForeground(new Color(105,105,105,255));
}
setCursor(new Cursor(Cursor.HAND_CURSOR));
repaint();
}
@Override
public void mouseExited(MouseEvent e) {
// TODO Auto-generated method stub
super.mouseExited(e);
if(getSelected()==false){
setOpaque(false);
}
repaint();
}
});
addMouseMotionListener(new MouseMotionAdapter() {
@Override
public void mouseDragged(MouseEvent e) {
super.mouseDragged(e);
if(iconframe.contains(e.getPoint())){//falls klick innerhalb resizeicon -> Fenstergrösse verändern
setBounds(getBounds().x,getBounds().y,getBounds().width+(e.getX()- ClickOffsetPoint.x),getBounds().height+(e.getY()-ClickOffsetPoint.y));
ClickOffsetPoint=e.getPoint();
}
else {
setLocation(getX() + e.getX() - ClickOffsetPoint.x, getY() + e.getY() - ClickOffsetPoint.y);//position verändern
}
repaint();
}
@Override
public void mouseMoved(MouseEvent e) {//mousezeiger anhand position verändern
if(Selected){
if(iconframe.contains(e.getPoint()))
setCursor(new Cursor(Cursor.SE_RESIZE_CURSOR));
else
setCursor(new Cursor(Cursor.MOVE_CURSOR));
}
}
});
} |
72ea177b-be5b-4494-80c6-790f9503a1ba | 2 | @SuppressWarnings("serial")
public JTableRenderer(final Object cell,
final mxGraphComponent graphContainer)
{
this.cell = cell;
this.graphContainer = graphContainer;
this.graph = graphContainer.getGraph();
setLayout(new BorderLayout());
setBorder(BorderFactory.createCompoundBorder(ShadowBorder
.getSharedInstance(), BorderFactory
.createBevelBorder(BevelBorder.RAISED)));
JPanel title = new JPanel();
title.setBackground(new Color(149, 173, 239));
title.setOpaque(true);
title.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 1));
title.setLayout(new BorderLayout());
JLabel icon = new JLabel(new ImageIcon(JTableRenderer.class
.getResource(IMAGE_PATH + "preferences.gif")));
icon.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 1));
title.add(icon, BorderLayout.WEST);
JLabel label = new JLabel(String.valueOf(graph.getLabel(cell)));
label.setForeground(Color.WHITE);
label.setFont(title.getFont().deriveFont(Font.BOLD, 11));
label.setBorder(BorderFactory.createEmptyBorder(0, 1, 0, 2));
title.add(label, BorderLayout.CENTER);
JPanel toolBar2 = new JPanel();
toolBar2.setLayout(new FlowLayout(FlowLayout.LEFT, 1, 2));
toolBar2.setOpaque(false);
JButton button = new JButton(new AbstractAction("", new ImageIcon(
JTableRenderer.class.getResource(IMAGE_PATH + "minimize.gif")))
{
public void actionPerformed(ActionEvent e)
{
graph.foldCells(graph.isCellCollapsed(cell), false,
new Object[] { cell });
((JButton) e.getSource())
.setIcon(new ImageIcon(
JTableRenderer.class
.getResource(IMAGE_PATH
+ ((graph.isCellCollapsed(cell)) ? "maximize.gif"
: "minimize.gif"))));
}
});
button.setPreferredSize(new Dimension(16, 16));
button.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
button.setToolTipText("Collapse/Expand");
button.setOpaque(false);
toolBar2.add(button);
title.add(toolBar2, BorderLayout.EAST);
add(title, BorderLayout.NORTH);
// CellStyle style =
// graph.getStylesheet().getCellStyle(graph.getModel(),
// cell);
// if (style.getStyleClass() == null) {
table = new MyTable();
JScrollPane scrollPane = new JScrollPane(table);
scrollPane.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
if (graph.getModel().getChildCount(cell) == 0)
{
scrollPane.getViewport().setBackground(Color.WHITE);
setOpaque(true);
add(scrollPane, BorderLayout.CENTER);
}
scrollPane.getVerticalScrollBar().addAdjustmentListener(
new AdjustmentListener()
{
public void adjustmentValueChanged(AdjustmentEvent e)
{
graphContainer.refresh();
}
});
label = new JLabel(new ImageIcon(JTableRenderer.class
.getResource(IMAGE_PATH + "resize.gif")));
label.setCursor(new Cursor(Cursor.NW_RESIZE_CURSOR));
JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
panel.add(label, BorderLayout.EAST);
add(panel, BorderLayout.SOUTH);
ResizeHandler resizeHandler = new ResizeHandler();
label.addMouseListener(resizeHandler);
label.addMouseMotionListener(resizeHandler);
setMinimumSize(new Dimension(20, 30));
} |
e260eb6f-c0eb-4c8b-b1b1-f5d066ca0390 | 6 | @Override
public void apply(View view, Changes changes)
{
byte[] colors = new byte[(((rad2 * 2) + 1) * ((rad2 * 2) + 1)) - 1];
for(int x = -rad; x <= rad; ++ x)
{
for(int y = -rad; y <= rad; ++ y)
{
int index = 0;
for(int x2 = -rad2; x2 <= rad2; ++ x2)
{
for(int y2 = -rad2; y2 <= rad2; ++ y2)
{
if(x2 == 0 && y2 == 0)
{
continue;
}
colors[index ++] = view.get(x + x2, y + y2);
}
}
changes.addPixel(x, y, getMostCommonColor(colors));
}
}
} |
4c889519-c297-40f4-9fb9-97f0ce88bd6c | 8 | public void avancer() {
switch (position.getDirection()) {
case N:
if (position.getY() < gridMaximumValueY)
position.setY(position.getY() + 1);
break;
case E:
if (position.getX() < gridMaximumValueX)
position.setX(position.getX() + 1);
break;
case W:
if (position.getX() > 0)
position.setX(position.getX() - 1);
break;
case S:
if (position.getY() > 0)
position.setY(position.getY() - 1);
break;
}
} |
645ff774-eab9-474d-a0c0-c44b8c5dcf5a | 6 | public static void main(String argv[]){
File fullfolder = new File("/home/dharmesh/aditya/author_profiling/pan_author_profiling_training_data/enoutput/");
File trainfolder = new File("/home/dharmesh/aditya/author_profiling/pan_author_profiling_training_data/entraining/");
File testfolder = new File("/home/dharmesh/aditya/author_profiling/pan_author_profiling_training_data/entesting/");
trainfolder.mkdirs();
testfolder.mkdirs();
// File fullfolder = new File("/home/dharmesh/aditya/sampleroutput/");
// File trainfolder = new File("/home/dharmesh/aditya/samplertrainoutput/");
// File testfolder = new File("/home/dharmesh/aditya/samplertestoutput/");
// File fullfolder = new File("/home/dharmesh/aditya/author_profiling/pan_author_profiling_training_data/esoutput/");
// File trainfolder = new File("/home/dharmesh/aditya/author_profiling/pan_author_profiling_training_data/estraining/");
// File testfolder = new File("/home/dharmesh/aditya/author_profiling/pan_author_profiling_training_data/estesting/");
File f[]=fullfolder.listFiles();
File afile=fullfolder.listFiles()[0];
for(int i = 0; i<(f.length);i++){
if(i<=(f.length)*.65){
System.out.println(i);
afile= f[i];
// System.out.println(bfile);
try{
String bfile=trainfolder.getAbsolutePath() + "/" + afile.getName();
FileInputStream inStream = new FileInputStream(afile);
FileOutputStream outStream = new FileOutputStream(bfile);
byte[] buffer = new byte[1024];
int length;
//copy the file content in bytes
while ((length = inStream.read(buffer)) > 0){
outStream.write(buffer, 0, length);
}
inStream.close();
outStream.close();
}catch(Exception ex){
ex.printStackTrace();
}
}
else{
System.out.println(i);
afile= f[i];
// System.out.println(bfile);
try{
String bfile=testfolder.getAbsolutePath() + "/" + afile.getName();
FileInputStream inStream = new FileInputStream(afile);
FileOutputStream outStream = new FileOutputStream(bfile);
byte[] buffer = new byte[1024];
int length;
//copy the file content in bytes
while ((length = inStream.read(buffer)) > 0){
outStream.write(buffer, 0, length);
}
inStream.close();
outStream.close();
}catch(Exception ex){
ex.printStackTrace();
}
}
}
} |
230a1fd7-9488-4ce1-9c9d-08ad65733963 | 4 | private void SearchList(String s) {
DefaultListModel<Item> listModel = new DefaultListModel<Item>();
ArrayList<Item> items = (ArrayList<Item>) Main.getItemList();
for (Item item : items) {
if (item.getName().startsWith(s)
|| item.getName().contains(" " + s))
listModel.addElement(item);
}
if (list == null)
list = new JList<Item>(listModel);
else
list.setModel(listModel);
} |
18018805-f72d-4425-bcad-1948258a3b4c | 7 | public static LogicObject dowKeywordToInstance(Keyword dow) {
if (dow == Timepoint.KWD_MONDAY) {
return (((LogicObject)(Timepoint.SGT_TIMEPOINT_KB_MONDAY.surrogateValue)));
}
else if (dow == Timepoint.KWD_TUESDAY) {
return (((LogicObject)(Timepoint.SGT_TIMEPOINT_KB_TUESDAY.surrogateValue)));
}
else if (dow == Timepoint.KWD_WEDNESDAY) {
return (((LogicObject)(Timepoint.SGT_TIMEPOINT_KB_WEDNESDAY.surrogateValue)));
}
else if (dow == Timepoint.KWD_THURSDAY) {
return (((LogicObject)(Timepoint.SGT_TIMEPOINT_KB_THURSDAY.surrogateValue)));
}
else if (dow == Timepoint.KWD_FRIDAY) {
return (((LogicObject)(Timepoint.SGT_TIMEPOINT_KB_FRIDAY.surrogateValue)));
}
else if (dow == Timepoint.KWD_SATURDAY) {
return (((LogicObject)(Timepoint.SGT_TIMEPOINT_KB_SATURDAY.surrogateValue)));
}
else if (dow == Timepoint.KWD_SUNDAY) {
return (((LogicObject)(Timepoint.SGT_TIMEPOINT_KB_SUNDAY.surrogateValue)));
}
else {
{ OutputStringStream stream000 = OutputStringStream.newOutputStringStream();
stream000.nativeStream.print("`" + dow + "' is not a valid case option");
throw ((StellaException)(StellaException.newStellaException(stream000.theStringReader()).fillInStackTrace()));
}
}
} |
2f2d2fc3-aa70-4787-9e3a-e139a25e3f64 | 5 | @Override
public V put(K key, V value) {
V oldValue = null;
int index = Math.abs(key.hashCode()) % SIZE;
if(buckets[index] == null) {
buckets[index] = new LinkedList<MapEntry<K, V>>();
}
LinkedList<MapEntry<K, V>> bucket = buckets[index];
MapEntry<K, V> pair = new MapEntry<K, V>(key, value);
boolean found = false;
ListIterator<MapEntry<K, V>> it = bucket.listIterator();
int probes = 0;
while(it.hasNext()) {
MapEntry<K, V> iPair = it.next();
++probes;
if(iPair.getKey().equals(key)) {
System.out.println("Collision at " + iPair + ": " + probes +
" probe" + ((probes == 1) ? "" : "s") + " needed");
oldValue = iPair.getValue();
it.set(pair); // Replace old with new
found = true;
break;
}
}
if(!found) {
buckets[index].add(pair);
}
return oldValue;
} |
99d5b5c6-d025-4a93-a0ca-7dea68fa701c | 7 | @Override
public void run() {
int answer = 0;
Set<Integer> answers = new HashSet<>();
for(int i = 1; i < 9999; i++) {
if(i % 10 == 0)
continue;
for(int j = 1; j < 999; j++) {
if(j % 10 == 0)
continue;
int sum = i * j;
if(sum > 987654321)
break;
if(verify(i, j, sum)) {
answers.add(Integer.valueOf(sum));
}
}
}
for(Integer product : answers) {
answer += product.intValue();
}
setAnswer(String.valueOf(answer));
} |
713972f2-562f-4a8f-90c8-feae82811249 | 9 | private void makeLanguages(String str){
int end = 0;
while(end >= 0 && str != null){
end = str.indexOf("*, ");
if(end >= 0){
String tmp = str.substring(0, end);
int index = 0;
while(index >= 0){
index = tmp.indexOf(", ");
if(index >= 0){
languages.add(tmp.substring(0, index));
tmp = tmp.substring(index+2);
} else {
languagesFullAudio.add(tmp);
}
}
str = str.substring(end+3);
} else {
if(str.indexOf("*") >= 0){
languagesFullAudio.add(str);
str = null;
}
}
}
if(str != null){
int index = 0;
while(index >= 0){
index = str.indexOf(", ");
if(index >= 0){
languages.add(str.substring(0, index));
str = str.substring(index+2);
} else {
languages.add(str);
}
}
}
} |
caa01007-262d-4957-8f6b-96d5152ed274 | 0 | public void setDoubleOptin(boolean doubleOptin) {
this.doubleOptin = doubleOptin;
} |
1c9de17f-0890-4e1e-8940-ff8f8c550922 | 1 | public synchronized char getItemType(Position position){
if (field[position.getX()][position.getY()] != null) return field[position.getX()][position.getY()].getType();
return 0;
} |
e4f82dc9-90dc-4dc5-8403-da97063e3850 | 7 | public static Iterator allDirectSubcollections(LogicObject self, boolean performfilteringP) {
if (Stella_Object.isaP(self, Logic.SGT_LOGIC_DESCRIPTION)) {
Description.deriveDeferredSatelliteRules(((Description)(self)));
}
{ Iterator directlylinkedobjects = Logic.allDirectlyLinkedObjects(self, Logic.SGT_PL_KERNEL_KB_SUBSET_OF, !((Boolean)(Logic.$REVERSEPOLARITYp$.get())).booleanValue());
if (!performfilteringP) {
return (directlylinkedobjects);
}
{ Cons directsubs = Stella.NIL;
Cons equivalents = LogicObject.allEquivalentCollections(self, true);
if (!(equivalents.rest == Stella.NIL)) {
{ LogicObject e = null;
Cons iter000 = equivalents;
for (;!(iter000 == Stella.NIL); iter000 = iter000.rest) {
e = ((LogicObject)(iter000.value));
{ LogicObject child = null;
Iterator iter001 = LogicObject.allDirectSubcollections(e, false);
while (iter001.nextP()) {
child = ((LogicObject)(iter001.value));
if ((!equivalents.memberP(child)) &&
(!directsubs.memberP(child))) {
directsubs = Cons.cons(child, directsubs);
}
}
}
}
}
}
else {
directsubs = ((Cons)(directlylinkedobjects.consify()));
}
return (Logic.mostGeneralCollections(directsubs).allocateIterator());
}
}
} |
0d4bebe8-865c-40d2-9053-f8fcf6b4b39d | 6 | @Override
public void actionPerformed(ActionEvent event) {
JButton selection = (JButton) (event.getSource());
if (selection.equals(craps)) {
new Craps(money, name);
this.dispose();
}
if (selection.equals(blackjack)) {
new Blackjack(money, name);
this.dispose();
}
if (selection.equals(slots)) {
new Slots(money, name);
this.dispose();
}
if (selection.equals(newGame)) {
newGame();
}
if (selection.equals(loadGame)) {
loadGame();
}
if (selection.equals(saveGame)) {
saveGame();
}
} |
8f81fbb1-32e4-405c-a0d5-d175ec527f18 | 0 | @Override
public Message toMessage(Session session) throws JMSException {
Message message = session.createMessage();
setMessageProperties(message);
message.setJMSType(TYPE);
return message;
} |
edc09426-0fd8-4103-b25a-d586d2a41a12 | 7 | @Override
public Protein getProteinFromFile(File f)
{
Protein protein = new Protein();
try
{
BufferedReader br = new BufferedReader(new FileReader(f));
try
{
String line = br.readLine();
int start = line.indexOf(QUOTE, NAME_QUOTE_INDEX);
int stop = line.indexOf(QUOTE, start+1);
protein.setName(line.substring(start+1, stop));
line = line.substring(stop+1);
start = line.indexOf(QUOTE);
stop = line.indexOf(QUOTE, start+1);
while(line.length() > 0 && start != -1 && stop != -1)
{
if(!line.substring(start+1, stop).equals("acids"))
{
protein.add(AminoAcid.getAminoAcidByName(line.substring(start+1, stop)));
}
line = line.substring(stop+1);
start = line.indexOf(QUOTE);
stop = line.indexOf(QUOTE, start+1);
}
//br.close();
}
catch(IOException ioe)
{
throw new RuntimeException("Could not read protein from file.");
}
try
{
br.close();
}
catch(IOException i)
{
throw new RuntimeException("Error reading protein from file.");
}
}
catch(FileNotFoundException fnfe)
{
throw new RuntimeException("Error reading protein. Could not find file.");
}
return protein;
} |
7f77ffb4-7aa8-4bdb-9142-17ac0ee30635 | 0 | public void setLogFileMessageFormatter(LogFileMessageFormatter msgFormatter) {this.msgFormatter = msgFormatter;} |
1d9f70fd-7620-4b35-9b49-9f131697a9c4 | 8 | public static void loadConfig(String filename) {
try {
Reader read = null;
read = new FileReader(new File(filename));
JSONTokener jsonReader = new JSONTokener(read);
JSONObject params = new JSONObject(jsonReader);
/*
* Reading in configuration information from the file, things like confidence, merging thresholds etc
* */
System.out.println(params.toString(3));
ExperimentConstants.populationThreshold = (float) params.getDouble("confidenceThreshold_forYifang");
ExperimentConstants.crossSiteThreshold = (float) params.getDouble("aggregateThreshold");
ExperimentConstants.websiteThreshold = (float) params.getDouble("individualWebsiteThreshold");
ExperimentConstants.experimentID = "" + params.getInt("experimentId");
if(params.has("useEngine")){
ExperimentConstants.doPopulationEngine = params.getBoolean("useEngine");
}
if(params.has("doCrossSite")){
ExperimentConstants.doCrossSite = params.getBoolean("doCrossSite");
}
//Getting which websites this experiment will seek to use
JSONArray temp = params.getJSONArray("websites");
for (int i = 0; i < temp.length(); i++) {
websitesUsed.add(temp.getString(i));
}
//Gets the attirbutes for the initial core
JSONArray tempInit = params.getJSONArray("initialCoreAttributes");
for (int i = 0; i < tempInit.length(); i++) {
if (tempInit.getString(i).equals("last_name") || tempInit.getString(i).equals("first_name"))
continue;
initialAttributeNames.add(tempInit.getString(i));
}
//debugPrint.print("Finished reading config file");
}//end of try block
catch(IOException ie){
ie.printStackTrace();
}
catch(JSONException je){
je.printStackTrace();
}
} |
2338048a-a7ee-445a-a7f1-2fb67111f59d | 3 | public void setValueAt(Object value, int row, int column) {
switch (column) {
case 0:
variables[row] = (String) value;
break;
case 1:
firstSets[row] = removeDuplicateCharacters((String) value);
break;
case 2:
followSets[row] = removeDuplicateCharacters((String) value);
break;
}
} |
6a8b5a0f-95af-458a-8b25-a1b8aa606097 | 7 | public void processCookies(MimeHeaders headers) {
if (headers == null)
return;// nothing to process
// process each "cookie" header
int pos = 0;
while (pos >= 0) {
// Cookie2: version ? not needed
pos = headers.findHeader("Cookie", pos);
// no more cookie headers headers
if (pos < 0)
break;
MessageBytes cookieValue = headers.getValue(pos);
if (cookieValue == null || cookieValue.isNull()) {
pos++;
continue;
}
// Uncomment to test the new parsing code
if (cookieValue.getType() != MessageBytes.T_BYTES) {
Exception e = new Exception();
log.warn("Cookies: Parsing cookie as String. Expected bytes.", e);
cookieValue.toBytes();
}
if (log.isDebugEnabled())
log.debug("Cookies: Parsing b[]: " + cookieValue.toString());
ByteChunk bc = cookieValue.getByteChunk();
processCookieHeader(bc.getBytes(), bc.getOffset(), bc.getLength());
pos++;// search from the next position
}
} |
99565238-c003-4778-8433-fab6c1dc1903 | 0 | public void addHurdle(Hurdle hurdle) {
hurdleList.add(hurdle);
} |
e53ea91b-ef15-41f4-a6e8-71b2b38eaaf4 | 1 | public int subtraction() {
if (stack.stackLength() > 1) {
int firstNum = stack.top();
stack.pop();
int secondNum = stack.top();
stack.pop();
return firstNum - secondNum;
} else {
return error;
}
} |
1c902ba6-409b-4d32-ab1c-aa572f716237 | 3 | public void actionPerformed(ActionEvent event) {
if(event.getSource().equals(close)) {
this.setVisible(false);
} else if(event.getSource().equals(versionTest)) {
VersionTester.testVersion(false, true);
} else if(event.getSource().equals(testForUpdatesAtStartup)) {
AppConfig.getAppConfig().checkForSinalgoUpdate = testForUpdatesAtStartup.isSelected();
AppConfig.getAppConfig().writeConfig();
}
} |
1303aa2e-2339-4bdf-9cbb-6157d9b4e2bc | 8 | public void open() {
shell = new Shell(SWT.APPLICATION_MODAL | SWT.DIALOG_TRIM );
//shell.setImage(RepDevMain.xxxxx);
FormLayout layout = new FormLayout();
layout.marginTop = 10;
layout.marginBottom = 10;
layout.marginLeft = 10;
layout.marginRight = 10;
layout.spacing = 8;
shell.setLayout(layout);
shell.setText("Goto Section/Procedure");
Group sectionGroup = new Group(shell, SWT.NONE);
sectionGroup.setText(" Select Section or Procedure ");
Label sectionLabel = new Label(sectionGroup, SWT.NONE);
sectionLabel.setText("Goto");
Collections.sort(secInfo);
final Combo sectionList = new Combo(sectionGroup, SWT.READ_ONLY);
int index=0;
for(SectionInfo si : secInfo){
sectionList.add(si.getTitle());
if(caretOffset >= si.getPos() && caretOffset <= si.getLastInsertPos()+3){
sectionList.select(index);
}
index++;
}
Button ok = new Button(shell, SWT.PUSH);
ok.setText("Ok");
Button cancel = new Button(shell, SWT.PUSH);
cancel.setText("Cancel");
// --- Key Events ---
sectionList.addKeyListener(new KeyListener() {
public void keyReleased(KeyEvent e){
if(e.keyCode == 27){
shell.dispose();
}
}
public void keyPressed(KeyEvent e){}
});
cancel.addKeyListener(new KeyListener() {
public void keyReleased(KeyEvent e){
if(e.keyCode == 27){
shell.dispose();
}
}
public void keyPressed(KeyEvent e){}
});
ok.addKeyListener(new KeyListener() {
public void keyReleased(KeyEvent e){
if(e.keyCode == 27){
shell.dispose();
}
}
public void keyPressed(KeyEvent e){}
});
// --- Button events ---
ok.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
ec.gotoSection(sectionList.getText());
shell.dispose();
}
});
cancel.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
shell.dispose();
}
});
// Layout infos
sectionGroup.setLayout(layout);
FormData data = new FormData();
data.top = new FormAttachment(0);
data.left = new FormAttachment(0);
data.right = new FormAttachment(100);
sectionGroup.setLayoutData(data);
data = new FormData();
data.top = new FormAttachment(0);
data.left = new FormAttachment(0);
data.width=15;
sectionLabel.setLayoutData(data);
data = new FormData();
data.top = new FormAttachment(0);
data.left = new FormAttachment(sectionLabel);
data.right = new FormAttachment(100);
sectionList.setLayoutData(data);
data = new FormData();
data.top = new FormAttachment(sectionGroup);
data.bottom = new FormAttachment(100);
data.right = new FormAttachment(100);
cancel.setLayoutData(data);
data = new FormData();
data.top = new FormAttachment(sectionGroup);
data.right = new FormAttachment(cancel);
data.bottom = new FormAttachment(100);
ok.setLayoutData(data);
sectionGroup.pack();
shell.setDefaultButton(ok);
shell.pack();
shell.open();
while (!shell.isDisposed()) {
if (!shell.getDisplay().readAndDispatch())
shell.getDisplay().sleep();
}
} |
d544e811-db2f-4412-a6b3-d9222da2e76e | 4 | private File getConfigFile(String file)
{
if (file.isEmpty() || file == null) {
return null;
}
File configFile;
if (file.contains("/"))
{
if (file.startsWith("/"))
{
configFile = new File(plugin.getDataFolder() + file.replace("/", File.separator));
} else
{
configFile = new File(plugin.getDataFolder() + File.separator + file.replace("/", File.separator));
}
} else
{
configFile = new File(plugin.getDataFolder(), file);
}
return configFile;
} |
150060b3-797a-4e05-912a-77b0f76e3276 | 7 | public double partialContains(Instance instance) throws Exception {
int count = 0;
for (int i = 0; i < instance.numAttributes(); i++) {
if (i == m_ClassIndex) {
continue;
}
if (instance.isMissing(i)) {
continue;
}
double current = instance.value(i);
if (m_NumericBounds[i] != null) { // i.e. a numeric attribute
if ((current >= m_NumericBounds[i][0])
&& (current <= m_NumericBounds[i][1])) {
count++;
}
} else { // i.e. a nominal attribute
if (m_NominalBounds[i][(int) current]) {
count++;
}
}
}
return ((double)count) / (instance.numAttributes() - 1);
} |
8d7d0894-e0be-42fd-9afc-1c6db4293832 | 3 | public boolean isColliding(Rectangle rect, TileType type) {
for (int i = 0; i < tileList.size(); i++) {
if (type == tileList.get(i).getType()) {
if (rect.intersects(tileList.get(i).getRect())) {
return true;
}
}
}
return false;
} |
d31ed093-4417-4db2-ac9b-ca66e20f0055 | 5 | @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 Skills)) {
return false;
}
Skills other = (Skills) object;
if ((this.skillsId == null && other.skillsId != null) || (this.skillsId != null && !this.skillsId.equals(other.skillsId))) {
return false;
}
return true;
} |
8d005d07-37ec-433b-9387-84b1c4afb402 | 0 | private void addChromosome(Chromosome chromosome) {
population.add(chromosome);
} |
a4647153-a1a9-4c05-8aa3-2797f60a83fe | 9 | private void byteLoop(RasterAccessor src, RasterAccessor dst) {
int dwidth = dst.getWidth();
int dheight = dst.getHeight();
int dnumBands = dst.getNumBands();
int dstBandOffsets[] = dst.getBandOffsets();
int dstPixelStride = dst.getPixelStride();
int dstScanlineStride = dst.getScanlineStride();
int srcBandOffsets[] = src.getBandOffsets();
int srcPixelStride = src.getPixelStride();
int srcScanlineStride = src.getScanlineStride();
byte dstDataArrays[][] = dst.getByteDataArrays();
byte srcDataArrays[][] = src.getByteDataArrays();
for (int k = 0; k < dnumBands; k++) {
byte dstData[] = dstDataArrays[k];
byte srcData[] = srcDataArrays[k];
int srcScanlineOffset = srcBandOffsets[k];
int dstScanlineOffset = dstBandOffsets[k];
for (int j = 0; j < dheight; j++) {
int srcPixelOffset = srcScanlineOffset;
int dstPixelOffset = dstScanlineOffset;
for (int i = 0; i < dwidth; i++) {
int kernelVerticalOffset = 0;
int imageVerticalOffset = srcPixelOffset;
float f = Float.POSITIVE_INFINITY;
for (int u = 0; u < kh; u++) {
int imageOffset = imageVerticalOffset;
for (int v = 0; v < kw; v++) {
float tmpIK = ((int)srcData[imageOffset]&0xff) -
kdata[kernelVerticalOffset + v];
if(tmpIK < f){
f = tmpIK;
}
imageOffset += srcPixelStride;
}
kernelVerticalOffset += kw;
imageVerticalOffset += srcScanlineStride;
}
if (Float.isInfinite(f)){
f = 0;
}
int val = (int)f;
if (val < 0) {
val = 0;
} else if (val > 255) {
val = 255;
}
dstData[dstPixelOffset] = (byte)val;
srcPixelOffset += srcPixelStride;
dstPixelOffset += dstPixelStride;
}
srcScanlineOffset += srcScanlineStride;
dstScanlineOffset += dstScanlineStride;
}
}
} |
1c416937-289f-4dc7-a857-1805738a7d07 | 1 | @Test
public void removeActivityTest() throws InstanceNotFoundException {
Activity activity = null;
try {
activity = activityService.find(0);
} catch (InstanceNotFoundException e1) {
fail("Activity not exist");
}
activityService.remove(activity);
assertFalse("Activity not delete", activityService.getActivities()
.contains(activity));
} |
973e9e8e-a2ac-444f-9586-51a28941e54c | 4 | @Override
public List<Integer> sort(List<Integer> list) {
// checking input parameter for null
if (list == null) {
throw new IllegalArgumentException("ArrayList not specified!");
}
// moving forward through array
for (int i = 0; i < list.size() - 1; i++) {
// look at all remaining elements to see if there is something smaller
for (int j = i + 1; j < list.size(); j++) {
if (list.get(i) > list.get(j)) {
// exchange the two values if there is
appUtil.swap(list, i, j);
}
}
}
return list;
} |
4548f3d7-76fd-4656-a188-02c59bdacee4 | 1 | public void updateSubTypes() {
if ((GlobalOptions.debuggingFlags & GlobalOptions.DEBUG_TYPES) != 0)
GlobalOptions.err.println("setType of " + local.getName() + ": "
+ local.getType());
local.setType(type);
} |
321fd5d8-57e4-4ff4-ad79-48d5900d91e6 | 5 | public void searchForPath() {
setDrawGraphInstance();
if(nodeFromKDV == -1 || nodeToKDV == -1) {
if(!pa.getMalformed()) {
JOptionPane.showMessageDialog(null, "One of the addresses could not be found", "Warning Message", JOptionPane.WARNING_MESSAGE);
}
return;
}
edgesOnPath.clear();
Iterable<MyEdge> path = dsp.calculatePath(nodeFromKDV-1, nodeToKDV-1);
if(path != null) {
for (MyEdge e : path) {
edgesOnPath.push(e);
}
dg.setDirFromNode(mg.getNodeArray()[nodeFromKDV-1]);
dg.setDirToNode(mg.getNodeArray()[nodeToKDV-1]);
dg.repaint();
}
else
JOptionPane.showMessageDialog(null, "No path could be found between the addresses", "Warning Message", JOptionPane.WARNING_MESSAGE);
nodeFromKDV = -1;
nodeToKDV = -1;
pa.setMalformed(false);
} |
5f3b1184-bbe5-4268-8482-d81929c54728 | 7 | private double[] getSeedFreq(String hash) {
String hashtag;
boolean inBase = false;
//check whether hashtag is baseline criteria
for(String basehash:Settings.baseKeywords){
if(hash.replace("#", "").equals(basehash.toLowerCase()) || hash.equals(basehash)){
inBase = true;
//System.out.println(hash+" vs "+basehash+"..."+inBase);
break;
}
}
//convert the baseline word into # manner
if(!inBase){
hashtag = hash;
}else{
hashtag = hash.toLowerCase();
if(!hashtag.startsWith("#"))
hashtag = "#"+hash.toLowerCase();
hashtag = hashtag.replace(" ", "");
}
//assign the time frame sampled frequency if exist, else assign all zero
if(TFFreq_sample.containsKey(hashtag)){
return TFFreq_sample.get(hashtag);
}else{
System.out.println("********************* {"+hashtag+"} not in sample array");
double[] temp = new double[(int) (Settings.timer/Settings.sample)];
for(int i =0; i<temp.length; i++) temp[i] =0;
return temp;
}
} |
a9b6a2bd-ed81-480d-985a-006e0c918d90 | 2 | private void winTrick() {
// Examine cardsPlayed pile and determine which player won the trick.
int winnerIndex = determineWinner();
// Change firstToPlay to be the index of the player who won the trick.
this.firstToPlayIndex = winnerIndex;
// Show each player who won the trick and which cards were played in the
// trick (call endTrick on each player).
for(int i = 0; i < PLAYER_COUNT; i++) {
IPlayer playerInstance = this.players[i].getPlayer();
playerInstance.endTrick(this.cardsPlayed, winnerIndex);
}
// Move cards in cardsPlayed pile to the TricksWon pile of the player
// who won.
Pile winnerTricksWonPile = this.players[winnerIndex].getTricksWonPile();
while(this.cardsPlayed.getNumCards() > 0) {
Card removedCard = this.cardsPlayed.removeCard(0);
winnerTricksWonPile.addCard(removedCard);
}
// Log our winner
String tempParts = this.players[(winnerIndex)].getPlayer().getClass().getName().replaceAll("skatgame.", "");
this.roundStats.log("Trick won by Player " + (tempParts), this.indentationLevel);
} |
636d3b81-9aef-41b7-97ce-02604e24fb7c | 5 | public void update()
{
bg.update(heart.currentHappinessLevel);
heart.update();
for(int i=0; i<stars.size(); i++)
{
stars.get(i).update();
if(stars.get(i).xPos < 0)
{
stars.remove(i);
}
}
if (spaceCount > 5)
{
checkpoint1 = false;
checkpoint2 = true;
}
if (gsm.score > 2)
{
checkpoint1 = false;
checkpoint2 = false;
checkpoint3 = true;
}
if (gsm.score > 4)
{
checkpoint1 = false;
checkpoint2 = false;
checkpoint3 = false;
checkpoint4 = true;
}
} |
d58ed34c-9571-4375-83fb-f27ad32cd859 | 5 | private void setEntityRelevant(String clientId, EntityRef entityRef, boolean relevant) {
if (relevant) {
if (relevantEntities.add(entityRef)) {
for (ClientEntityRelevancyRuleListener listener : listeners) {
listener.entityRelevancyChanged(clientId, Collections.singleton(entityRef));
}
}
} else {
if (relevantEntities.remove(entityRef)) {
for (ClientEntityRelevancyRuleListener listener : listeners) {
listener.entityRelevancyChanged(clientId, Collections.singleton(entityRef));
}
}
}
} |
1115b60c-c08c-4b35-8c0a-fcc43623162a | 1 | public void setPrintStream(PrintStream printStream) throws IllegalArgumentException{
if(printStream == null)
throw new IllegalArgumentException( "Print stream can not ben null." );
this.printStream = printStream;
} |
47baadb2-b419-4b42-98f4-9b8530fb3f77 | 4 | public static void testFindAlgorithm(int[] ns, float[] ks, Random source, int repeatFactor, float myFactor){
Callback cb = new Collector();
Callback comp = new Collector();
RandomizedAlgorithm rand = new FindAlgorithm();
rand.setRandomSource(source);
for(int n : ns){
List<Integer> data = numbers(n);
double my = 2 * Math.log(n);
double my2 = myFactor*2*Math.log(n);
System.out.println("my="+ my +" 2*my=" + my2);
int repeats = n*repeatFactor;
for( float kp : ks){
int k = Math.min(n,Math.max((int)(n*kp),1));
float above = 0;
float totalZ= 0f;
for(int repeat = 0; repeat < repeats; repeat++){
rand.algorithm(data,k,cb,comp);
int Z = cb.collect()-1;
totalZ += Z;
if(Z > my2){
above+=1;
}
}
System.out.println("n=" + n + " k=" + k + " above=" + above+ " repeats=" + repeats + " factor=" + above/repeats + " avg=" + totalZ/repeats);
}
}
} |
19192507-4cb6-4c5a-82b4-4469b221ae9b | 7 | void setModelClickability() {
Bond[] bonds = frame.bonds;
for (int i = frame.bondCount; --i >= 0;) {
Bond bond = bonds[i];
if (bond == null || bond.atom1 == null || bond.atom2 == null)
continue;
if ((bond.shapeVisibilityFlags & myVisibilityFlag) == 0 || frame.bsHidden.get(bond.atom1.atomIndex)
|| frame.bsHidden.get(bond.atom2.atomIndex))
continue;
bond.atom1.clickabilityFlags |= myVisibilityFlag;
bond.atom2.clickabilityFlags |= myVisibilityFlag;
}
} |
d3ce8134-49bc-4464-98b0-c3b38c47a456 | 1 | private float[] simulateBowl(float[] currentFruits) {
float[] bowl = new float[NUM_FRUIT_TYPES];
int sz = 0;
while (sz < numFruitsPerBowl) {
// pick a fruit according to current fruit distribution
int fruit = pickFruit(currentFruits);
float c = 1 + random.nextInt(3);
c = Math.min(c, numFruitsPerBowl - sz);
c = Math.min(c, currentFruits[fruit]);
bowl[fruit] += c;
sz += c;
currentFruits[fruit] -= c;
}
return bowl;
} |
3a86404e-497a-4028-a4ea-4e6c5f996b1a | 5 | private static int doEvents( int firedEvents, long startTime )
{
Iterator< Event > it = events.iterator(); // get the iterator for the untimed events
while ( it.hasNext() )
{
if ( TimeHelper.isOver( startTime, MaxTickTime ) )
{
return firedEvents; // we've run out of time for this tick, let's keep the game running
}
Event e = it.next(); // get the next event
// we've reached the max number of events we can fire for now
if ( firedEvents >= MaxEvents )
{
break;
}
try
{
e.action.invoke( e.target, e.parameters ); // invoke the method
firedEvents++;
}
catch ( Exception ex )
{
Lumberjack.error( "Scheduler", "Failed to invoke \"%s.%s()\"", e.target.getClass().getSimpleName(), e.action.getName() );
Lumberjack.throwable( "Scheduler", ex );
}
if ( LogOutput )
{
Lumberjack.debug( "Scheduler", "Executed event \"%s\"", e.action.getName() );
}
it.remove(); // remove the iterated object
}
return firedEvents;
} |
0e343dbb-a8a7-44bf-aeec-49eeade6262e | 6 | public final boolean process(Player player) {
if (delay > 0) {
delay--;
return true;
}
while (true) {
if (constructingRegion)
return true;
if (stage == actions.length) {
stopCutscene(player);
return false;
} else if (stage == 0)
startCutscene(player);
CutsceneAction action = actions[stage++];
action.process(player, cache);
int delay = action.getActionDelay();
if (delay == -1)
continue;
this.delay = delay;
return true;
}
} |
a79ca41a-6bc2-4ad4-9106-8c9663a1788a | 1 | public void sortLinkedList2() {
long start = System.currentTimeMillis();
Object[] arr= ll.toArray();
Arrays.sort(arr);
ll.clear();
LinkedList<Object> newLL = new LinkedList<>();
for (int i = 0; i < arr.length; i++) {
newLL.add(arr[i]);
}
long end = System.currentTimeMillis();
System.out.println("using time: " + (end - start));
} |
577a1dae-cd52-4763-85f7-933504d6befe | 0 | public void setResultCode(int resultCode) {
this.resultCode = resultCode;
} |
58fe5e76-bec6-442a-adfa-492e5f4f897c | 8 | public CalRGBColor(PDFObject obj) throws IOException {
// obj is a dictionary that has the following parts:
// WhitePoint [a b c]
// BlackPoint [a b c]
// Gamma a
super(CS_sRGB, 3);
// find out what what is according to the CIE color space
// note that this is not reflexive (i.e. passing this value
// into toRGB does not get you (1.0, 1.0, 1.0) back)
// cieWhite = cieCS.fromRGB(new float[] { 1.0f, 1.0f, 1.0f } );
PDFObject ary= obj.getDictRef("WhitePoint");
if (ary!=null) {
for(int i=0; i<3; i++) {
white[i]= ary.getAt(i).getFloatValue();
}
}
ary= obj.getDictRef("BlackPoint");
if (ary!=null) {
for(int i=0; i<3; i++) {
black[i]= ary.getAt(i).getFloatValue();
}
}
ary= obj.getDictRef("Gamma");
if (ary!=null) {
for (int i=0; i<3; i++) {
gamma[i]= ary.getAt(i).getFloatValue();
}
}
ary= obj.getDictRef("Matrix");
if (ary!=null) {
for (int i=0; i<9; i++) {
matrix[i]= ary.getAt(i).getFloatValue();
}
}
// create a scale matrix relative to the 50 CIE color space.
// see http://www.brucelindbloom.com/Eqn_RGB_XYZ_Matrix.html
// we use the Von Kries cone response domain
float[] cieWhite = rgbCS.toCIEXYZ(new float[] { 1f, 1f, 1f });
float[] sourceWhite = matrixMult(white, vonKriesM, 3);
float[] destWhite = matrixMult(cieWhite, vonKriesM, 3);
scale = new float[] { destWhite[0] / sourceWhite[0], 0, 0,
0, destWhite[1] / sourceWhite[1], 0,
0, 0, destWhite[2] / sourceWhite[2] };
scale = matrixMult(vonKriesM, scale, 3);
scale = matrixMult(scale, vonKriesMinv, 3);
max = matrixMult(white, scale, 3);
max = ciexyzToSRGB(max);
} |
1997c267-adf0-40c9-9836-c5c5f2244b21 | 4 | public static DaoFactory getInstance() {
if(factory == null) {
String classname = PropertyManager.getProperty("persistence.factory");
if (classname != null) try {
factory = (DaoFactory) Class.forName(classname).newInstance();
} catch( Exception e) {
//TODO log this exception with Log4J
System.err.println( e );
}
// fall back to a default
if (factory == null) factory = new JpaDaoFactory();
}
return factory;
} |
a13dafa7-ad06-4b7f-bf8f-c762783441ab | 3 | public String toString()
{
StringBuffer res = new StringBuffer("");
String piece = "";
String couleur = "";
for(int i = 0; i < 8; i++)
{
for(int j = 0; j < 8; j++)
{
if(this.tableau[i][j] == null)
{
piece = "Case vide";
couleur = "";
}
else
{
piece = this.tableau[i][j].getClass().getName();
couleur = this.tableau[i][j].getCouleur();
}
res.append(" [ ");
res.append(piece);
res.append(" ");
res.append(couleur);
res.append(" ] ");
}
res.append("\n");
}
return res.toString();
} |
1b5a2f38-4a17-46e2-a46e-c39320d9b28a | 0 | public static String getHexString(byte [] src, int srcPos,int destPos,int length){
byte[] tmp=new byte[length];
System.arraycopy(src, srcPos, tmp, destPos, length);
return (Hex.rhex(tmp));
} |
ac4b4670-4349-4a68-8d2b-b3bcca0b8c52 | 8 | * of the <code>Tile</code> for. This object is also used to
* get the <code>ColonyTile</code> for the given <code>Tile</code>.
*/
public void displayColonyTile(Graphics2D g, Tile tile, Colony colony) {
boolean tileCannotBeWorked = false;
Unit occupyingUnit = null;
int price = 0;
if (colony != null) {
ColonyTile colonyTile = colony.getColonyTile(tile);
occupyingUnit = colonyTile.getOccupyingUnit();
price = colony.getOwner().getLandPrice(tile);
switch (colonyTile.getNoWorkReason()) {
case NONE: case COLONY_CENTER: case CLAIM_REQUIRED:
break;
default:
tileCannotBeWorked = true;
}
}
displayBaseTile(g, tile, false);
displayTileOverlays(g, tile, false, false);
if (tileCannotBeWorked) {
g.drawImage(lib.getMiscImage(ImageLibrary.TILE_TAKEN), 0, 0, null);
}
if (price > 0 && tile.getSettlement() == null) {
// tile is owned by an IndianSettlement
Image image = lib.getMiscImage(ImageLibrary.TILE_OWNED_BY_INDIANS);
centerImage(g, image);
}
if (occupyingUnit != null) {
ImageIcon image = lib.getUnitImageIcon(occupyingUnit, 0.5);
g.drawImage(image.getImage(), tileWidth/4 - image.getIconWidth() / 2,
halfHeight - image.getIconHeight() / 2, null);
// Draw an occupation and nation indicator.
g.drawImage(getOccupationIndicatorImage(g, occupyingUnit),
(int) (STATE_OFFSET_X * lib.getScalingFactor()), 0, null);
}
} |
f90920dd-bf88-4620-a82a-0d73dce25723 | 5 | public void pickUpItem (int playerID) {
Player p = this.playerIDs.get(playerID);
if (p != null) {
Location l = Location.locationInFrontOf(p.getLocation(), p.getDirection());
InanimateEntity on = board.tileAt(l).getOn();
if (on != null && on instanceof Item) {
if(p.addItemToInventory((Item)on)) {
p.incrementScore(500);
board.tileAt(l).clear();
server.queuePlayerUpdate(new PickUpItemEvent((Item)on), playerID);
for (int id: playerIDs.keySet()) {
server.queuePlayerUpdate(new RemoveItemEvent(l), id);
}
}
}
}
} |
bce2b09e-f02f-4d09-843e-43fc2334960e | 7 | @Override
protected void onDisconnect() {
int reconnectAttempts = 0;
printLog("Connection to " + getServer() + " dropped, "
+ "trying to reconnect...");
// try to reconnect
while(!isConnected() && reconnectAttempts < 15) {
try {
// reconnect
reconnectAttempts++;
reconnect();
} catch (Exception e) {
// failed to reconnect
printLog("Error: could not reconnect to " + getServer() + "\n" + e.getMessage());
try {
Thread.sleep(4000);
} catch(InterruptedException exception) {
Thread.currentThread().interrupt();
} // catch
} // catch
} // while
// check if it has reconnected
if(isConnected()) {
printLog("Reconnected to server: " + getServer());
if(server.getAddress().equals(getServer())) {
// rejoin channels
for(String channel : server.getChannels())
joinChannel(channel);
} else {
printLog("We somehow connected to a different server?");
} // else
} else {
printLog("Unable to reconnect to server: " + getServer() + " - disabling.");
} // else
} // onDisconnect |
6f67762d-dd19-4570-959a-134c6a579c46 | 6 | protected void resizeArrayToFit(int newCount) {
int steppedSize = buf.length;
if (steppedSize == 0)
steppedSize = 64;
else if (steppedSize <= 1024)
steppedSize *= 4;
else if (steppedSize <= 4024)
steppedSize *= 2;
else if (steppedSize <= 2 * 1024 * 1024) {
steppedSize *= 2;
steppedSize &= (~0x0FFF); // Fit on even 4KB pages
} else if (steppedSize <= 4 * 1024 * 1024) {
steppedSize = (steppedSize * 3) / 2; // x 1.50
steppedSize &= (~0x0FFF); // Fit on even 4KB pages
} else if (steppedSize <= 15 * 1024 * 1024) {
steppedSize = (steppedSize * 5) / 4; // x 1.25
steppedSize &= (~0x0FFF); // Fit on even 4KB pages
} else {
steppedSize = (steppedSize + (3 * 1024 * 1024)); // Go up in 3MB increments
steppedSize &= (~0x0FFF); // Fit on even 4KB pages
}
int newBufSize = Math.max(steppedSize, newCount);
byte newBuf[] = allocateByteArray(newBufSize, false);
System.arraycopy(buf, 0, newBuf, 0, count);
buf = null;
buf = newBuf;
} |
47134763-1875-4e06-9b1e-d36131caee88 | 5 | public static double jauDtdb(double date1, double date2,
double ut, double elong, double u, double v)
{
double t, tsol, w, elsun, emsun, d, elj, els, wt, w0, w1, w2, w3, w4,
wf, wj;
int j;
/*
* =====================
* Fairhead et al. model
* =====================
*
* 787 sets of three coefficients.
*
* Each set is
* amplitude (microseconds)
* frequency (radians per Julian millennium since J2000.0)
* phase (radians)
*
* Sets 1-474 are the T**0 terms
* " 475-679 " " T**1
* " 680-764 " " T**2
* " 765-784 " " T**3
* " 785-787 " " T**4
*/
final double fairhd[][] = {
/* 1, 10 */
{ 1656.674564e-6, 6283.075849991, 6.240054195 },
{ 22.417471e-6, 5753.384884897, 4.296977442 },
{ 13.839792e-6, 12566.151699983, 6.196904410 },
{ 4.770086e-6, 529.690965095, 0.444401603 },
{ 4.676740e-6, 6069.776754553, 4.021195093 },
{ 2.256707e-6, 213.299095438, 5.543113262 },
{ 1.694205e-6, -3.523118349, 5.025132748 },
{ 1.554905e-6, 77713.771467920, 5.198467090 },
{ 1.276839e-6, 7860.419392439, 5.988822341 },
{ 1.193379e-6, 5223.693919802, 3.649823730 },
/* 11, 20 */
{ 1.115322e-6, 3930.209696220, 1.422745069 },
{ 0.794185e-6, 11506.769769794, 2.322313077 },
{ 0.447061e-6, 26.298319800, 3.615796498 },
{ 0.435206e-6, -398.149003408, 4.349338347 },
{ 0.600309e-6, 1577.343542448, 2.678271909 },
{ 0.496817e-6, 6208.294251424, 5.696701824 },
{ 0.486306e-6, 5884.926846583, 0.520007179 },
{ 0.432392e-6, 74.781598567, 2.435898309 },
{ 0.468597e-6, 6244.942814354, 5.866398759 },
{ 0.375510e-6, 5507.553238667, 4.103476804 },
/* 21, 30 */
{ 0.243085e-6, -775.522611324, 3.651837925 },
{ 0.173435e-6, 18849.227549974, 6.153743485 },
{ 0.230685e-6, 5856.477659115, 4.773852582 },
{ 0.203747e-6, 12036.460734888, 4.333987818 },
{ 0.143935e-6, -796.298006816, 5.957517795 },
{ 0.159080e-6, 10977.078804699, 1.890075226 },
{ 0.119979e-6, 38.133035638, 4.551585768 },
{ 0.118971e-6, 5486.777843175, 1.914547226 },
{ 0.116120e-6, 1059.381930189, 0.873504123 },
{ 0.137927e-6, 11790.629088659, 1.135934669 },
/* 31, 40 */
{ 0.098358e-6, 2544.314419883, 0.092793886 },
{ 0.101868e-6, -5573.142801634, 5.984503847 },
{ 0.080164e-6, 206.185548437, 2.095377709 },
{ 0.079645e-6, 4694.002954708, 2.949233637 },
{ 0.062617e-6, 20.775395492, 2.654394814 },
{ 0.075019e-6, 2942.463423292, 4.980931759 },
{ 0.064397e-6, 5746.271337896, 1.280308748 },
{ 0.063814e-6, 5760.498431898, 4.167901731 },
{ 0.048042e-6, 2146.165416475, 1.495846011 },
{ 0.048373e-6, 155.420399434, 2.251573730 },
/* 41, 50 */
{ 0.058844e-6, 426.598190876, 4.839650148 },
{ 0.046551e-6, -0.980321068, 0.921573539 },
{ 0.054139e-6, 17260.154654690, 3.411091093 },
{ 0.042411e-6, 6275.962302991, 2.869567043 },
{ 0.040184e-6, -7.113547001, 3.565975565 },
{ 0.036564e-6, 5088.628839767, 3.324679049 },
{ 0.040759e-6, 12352.852604545, 3.981496998 },
{ 0.036507e-6, 801.820931124, 6.248866009 },
{ 0.036955e-6, 3154.687084896, 5.071801441 },
{ 0.042732e-6, 632.783739313, 5.720622217 },
/* 51, 60 */
{ 0.042560e-6, 161000.685737473, 1.270837679 },
{ 0.040480e-6, 15720.838784878, 2.546610123 },
{ 0.028244e-6, -6286.598968340, 5.069663519 },
{ 0.033477e-6, 6062.663207553, 4.144987272 },
{ 0.034867e-6, 522.577418094, 5.210064075 },
{ 0.032438e-6, 6076.890301554, 0.749317412 },
{ 0.030215e-6, 7084.896781115, 3.389610345 },
{ 0.029247e-6, -71430.695617928, 4.183178762 },
{ 0.033529e-6, 9437.762934887, 2.404714239 },
{ 0.032423e-6, 8827.390269875, 5.541473556 },
/* 61, 70 */
{ 0.027567e-6, 6279.552731642, 5.040846034 },
{ 0.029862e-6, 12139.553509107, 1.770181024 },
{ 0.022509e-6, 10447.387839604, 1.460726241 },
{ 0.020937e-6, 8429.241266467, 0.652303414 },
{ 0.020322e-6, 419.484643875, 3.735430632 },
{ 0.024816e-6, -1194.447010225, 1.087136918 },
{ 0.025196e-6, 1748.016413067, 2.901883301 },
{ 0.021691e-6, 14143.495242431, 5.952658009 },
{ 0.017673e-6, 6812.766815086, 3.186129845 },
{ 0.022567e-6, 6133.512652857, 3.307984806 },
/* 71, 80 */
{ 0.016155e-6, 10213.285546211, 1.331103168 },
{ 0.014751e-6, 1349.867409659, 4.308933301 },
{ 0.015949e-6, -220.412642439, 4.005298270 },
{ 0.015974e-6, -2352.866153772, 6.145309371 },
{ 0.014223e-6, 17789.845619785, 2.104551349 },
{ 0.017806e-6, 73.297125859, 3.475975097 },
{ 0.013671e-6, -536.804512095, 5.971672571 },
{ 0.011942e-6, 8031.092263058, 2.053414715 },
{ 0.014318e-6, 16730.463689596, 3.016058075 },
{ 0.012462e-6, 103.092774219, 1.737438797 },
/* 81, 90 */
{ 0.010962e-6, 3.590428652, 2.196567739 },
{ 0.015078e-6, 19651.048481098, 3.969480770 },
{ 0.010396e-6, 951.718406251, 5.717799605 },
{ 0.011707e-6, -4705.732307544, 2.654125618 },
{ 0.010453e-6, 5863.591206116, 1.913704550 },
{ 0.012420e-6, 4690.479836359, 4.734090399 },
{ 0.011847e-6, 5643.178563677, 5.489005403 },
{ 0.008610e-6, 3340.612426700, 3.661698944 },
{ 0.011622e-6, 5120.601145584, 4.863931876 },
{ 0.010825e-6, 553.569402842, 0.842715011 },
/* 91, 100 */
{ 0.008666e-6, -135.065080035, 3.293406547 },
{ 0.009963e-6, 149.563197135, 4.870690598 },
{ 0.009858e-6, 6309.374169791, 1.061816410 },
{ 0.007959e-6, 316.391869657, 2.465042647 },
{ 0.010099e-6, 283.859318865, 1.942176992 },
{ 0.007147e-6, -242.728603974, 3.661486981 },
{ 0.007505e-6, 5230.807466803, 4.920937029 },
{ 0.008323e-6, 11769.853693166, 1.229392026 },
{ 0.007490e-6, -6256.777530192, 3.658444681 },
{ 0.009370e-6, 149854.400134205, 0.673880395 },
/* 101, 110 */
{ 0.007117e-6, 38.027672636, 5.294249518 },
{ 0.007857e-6, 12168.002696575, 0.525733528 },
{ 0.007019e-6, 6206.809778716, 0.837688810 },
{ 0.006056e-6, 955.599741609, 4.194535082 },
{ 0.008107e-6, 13367.972631107, 3.793235253 },
{ 0.006731e-6, 5650.292110678, 5.639906583 },
{ 0.007332e-6, 36.648562930, 0.114858677 },
{ 0.006366e-6, 4164.311989613, 2.262081818 },
{ 0.006858e-6, 5216.580372801, 0.642063318 },
{ 0.006919e-6, 6681.224853400, 6.018501522 },
/* 111, 120 */
{ 0.006826e-6, 7632.943259650, 3.458654112 },
{ 0.005308e-6, -1592.596013633, 2.500382359 },
{ 0.005096e-6, 11371.704689758, 2.547107806 },
{ 0.004841e-6, 5333.900241022, 0.437078094 },
{ 0.005582e-6, 5966.683980335, 2.246174308 },
{ 0.006304e-6, 11926.254413669, 2.512929171 },
{ 0.006603e-6, 23581.258177318, 5.393136889 },
{ 0.005123e-6, -1.484472708, 2.999641028 },
{ 0.004648e-6, 1589.072895284, 1.275847090 },
{ 0.005119e-6, 6438.496249426, 1.486539246 },
/* 121, 130 */
{ 0.004521e-6, 4292.330832950, 6.140635794 },
{ 0.005680e-6, 23013.539539587, 4.557814849 },
{ 0.005488e-6, -3.455808046, 0.090675389 },
{ 0.004193e-6, 7234.794256242, 4.869091389 },
{ 0.003742e-6, 7238.675591600, 4.691976180 },
{ 0.004148e-6, -110.206321219, 3.016173439 },
{ 0.004553e-6, 11499.656222793, 5.554998314 },
{ 0.004892e-6, 5436.993015240, 1.475415597 },
{ 0.004044e-6, 4732.030627343, 1.398784824 },
{ 0.004164e-6, 12491.370101415, 5.650931916 },
/* 131, 140 */
{ 0.004349e-6, 11513.883316794, 2.181745369 },
{ 0.003919e-6, 12528.018664345, 5.823319737 },
{ 0.003129e-6, 6836.645252834, 0.003844094 },
{ 0.004080e-6, -7058.598461315, 3.690360123 },
{ 0.003270e-6, 76.266071276, 1.517189902 },
{ 0.002954e-6, 6283.143160294, 4.447203799 },
{ 0.002872e-6, 28.449187468, 1.158692983 },
{ 0.002881e-6, 735.876513532, 0.349250250 },
{ 0.003279e-6, 5849.364112115, 4.893384368 },
{ 0.003625e-6, 6209.778724132, 1.473760578 },
/* 141, 150 */
{ 0.003074e-6, 949.175608970, 5.185878737 },
{ 0.002775e-6, 9917.696874510, 1.030026325 },
{ 0.002646e-6, 10973.555686350, 3.918259169 },
{ 0.002575e-6, 25132.303399966, 6.109659023 },
{ 0.003500e-6, 263.083923373, 1.892100742 },
{ 0.002740e-6, 18319.536584880, 4.320519510 },
{ 0.002464e-6, 202.253395174, 4.698203059 },
{ 0.002409e-6, 2.542797281, 5.325009315 },
{ 0.003354e-6, -90955.551694697, 1.942656623 },
{ 0.002296e-6, 6496.374945429, 5.061810696 },
/* 151, 160 */
{ 0.003002e-6, 6172.869528772, 2.797822767 },
{ 0.003202e-6, 27511.467873537, 0.531673101 },
{ 0.002954e-6, -6283.008539689, 4.533471191 },
{ 0.002353e-6, 639.897286314, 3.734548088 },
{ 0.002401e-6, 16200.772724501, 2.605547070 },
{ 0.003053e-6, 233141.314403759, 3.029030662 },
{ 0.003024e-6, 83286.914269554, 2.355556099 },
{ 0.002863e-6, 17298.182327326, 5.240963796 },
{ 0.002103e-6, -7079.373856808, 5.756641637 },
{ 0.002303e-6, 83996.847317911, 2.013686814 },
/* 161, 170 */
{ 0.002303e-6, 18073.704938650, 1.089100410 },
{ 0.002381e-6, 63.735898303, 0.759188178 },
{ 0.002493e-6, 6386.168624210, 0.645026535 },
{ 0.002366e-6, 3.932153263, 6.215885448 },
{ 0.002169e-6, 11015.106477335, 4.845297676 },
{ 0.002397e-6, 6243.458341645, 3.809290043 },
{ 0.002183e-6, 1162.474704408, 6.179611691 },
{ 0.002353e-6, 6246.427287062, 4.781719760 },
{ 0.002199e-6, -245.831646229, 5.956152284 },
{ 0.001729e-6, 3894.181829542, 1.264976635 },
/* 171, 180 */
{ 0.001896e-6, -3128.388765096, 4.914231596 },
{ 0.002085e-6, 35.164090221, 1.405158503 },
{ 0.002024e-6, 14712.317116458, 2.752035928 },
{ 0.001737e-6, 6290.189396992, 5.280820144 },
{ 0.002229e-6, 491.557929457, 1.571007057 },
{ 0.001602e-6, 14314.168113050, 4.203664806 },
{ 0.002186e-6, 454.909366527, 1.402101526 },
{ 0.001897e-6, 22483.848574493, 4.167932508 },
{ 0.001825e-6, -3738.761430108, 0.545828785 },
{ 0.001894e-6, 1052.268383188, 5.817167450 },
/* 181, 190 */
{ 0.001421e-6, 20.355319399, 2.419886601 },
{ 0.001408e-6, 10984.192351700, 2.732084787 },
{ 0.001847e-6, 10873.986030480, 2.903477885 },
{ 0.001391e-6, -8635.942003763, 0.593891500 },
{ 0.001388e-6, -7.046236698, 1.166145902 },
{ 0.001810e-6, -88860.057071188, 0.487355242 },
{ 0.001288e-6, -1990.745017041, 3.913022880 },
{ 0.001297e-6, 23543.230504682, 3.063805171 },
{ 0.001335e-6, -266.607041722, 3.995764039 },
{ 0.001376e-6, 10969.965257698, 5.152914309 },
/* 191, 200 */
{ 0.001745e-6, 244287.600007027, 3.626395673 },
{ 0.001649e-6, 31441.677569757, 1.952049260 },
{ 0.001416e-6, 9225.539273283, 4.996408389 },
{ 0.001238e-6, 4804.209275927, 5.503379738 },
{ 0.001472e-6, 4590.910180489, 4.164913291 },
{ 0.001169e-6, 6040.347246017, 5.841719038 },
{ 0.001039e-6, 5540.085789459, 2.769753519 },
{ 0.001004e-6, -170.672870619, 0.755008103 },
{ 0.001284e-6, 10575.406682942, 5.306538209 },
{ 0.001278e-6, 71.812653151, 4.713486491 },
/* 201, 210 */
{ 0.001321e-6, 18209.330263660, 2.624866359 },
{ 0.001297e-6, 21228.392023546, 0.382603541 },
{ 0.000954e-6, 6282.095528923, 0.882213514 },
{ 0.001145e-6, 6058.731054289, 1.169483931 },
{ 0.000979e-6, 5547.199336460, 5.448375984 },
{ 0.000987e-6, -6262.300454499, 2.656486959 },
{ 0.001070e-6, -154717.609887482, 1.827624012 },
{ 0.000991e-6, 4701.116501708, 4.387001801 },
{ 0.001155e-6, -14.227094002, 3.042700750 },
{ 0.001176e-6, 277.034993741, 3.335519004 },
/* 211, 220 */
{ 0.000890e-6, 13916.019109642, 5.601498297 },
{ 0.000884e-6, -1551.045222648, 1.088831705 },
{ 0.000876e-6, 5017.508371365, 3.969902609 },
{ 0.000806e-6, 15110.466119866, 5.142876744 },
{ 0.000773e-6, -4136.910433516, 0.022067765 },
{ 0.001077e-6, 175.166059800, 1.844913056 },
{ 0.000954e-6, -6284.056171060, 0.968480906 },
{ 0.000737e-6, 5326.786694021, 4.923831588 },
{ 0.000845e-6, -433.711737877, 4.749245231 },
{ 0.000819e-6, 8662.240323563, 5.991247817 },
/* 221, 230 */
{ 0.000852e-6, 199.072001436, 2.189604979 },
{ 0.000723e-6, 17256.631536341, 6.068719637 },
{ 0.000940e-6, 6037.244203762, 6.197428148 },
{ 0.000885e-6, 11712.955318231, 3.280414875 },
{ 0.000706e-6, 12559.038152982, 2.824848947 },
{ 0.000732e-6, 2379.164473572, 2.501813417 },
{ 0.000764e-6, -6127.655450557, 2.236346329 },
{ 0.000908e-6, 131.541961686, 2.521257490 },
{ 0.000907e-6, 35371.887265976, 3.370195967 },
{ 0.000673e-6, 1066.495477190, 3.876512374 },
/* 231, 240 */
{ 0.000814e-6, 17654.780539750, 4.627122566 },
{ 0.000630e-6, 36.027866677, 0.156368499 },
{ 0.000798e-6, 515.463871093, 5.151962502 },
{ 0.000798e-6, 148.078724426, 5.909225055 },
{ 0.000806e-6, 309.278322656, 6.054064447 },
{ 0.000607e-6, -39.617508346, 2.839021623 },
{ 0.000601e-6, 412.371096874, 3.984225404 },
{ 0.000646e-6, 11403.676995575, 3.852959484 },
{ 0.000704e-6, 13521.751441591, 2.300991267 },
{ 0.000603e-6, -65147.619767937, 4.140083146 },
/* 241, 250 */
{ 0.000609e-6, 10177.257679534, 0.437122327 },
{ 0.000631e-6, 5767.611978898, 4.026532329 },
{ 0.000576e-6, 11087.285125918, 4.760293101 },
{ 0.000674e-6, 14945.316173554, 6.270510511 },
{ 0.000726e-6, 5429.879468239, 6.039606892 },
{ 0.000710e-6, 28766.924424484, 5.672617711 },
{ 0.000647e-6, 11856.218651625, 3.397132627 },
{ 0.000678e-6, -5481.254918868, 6.249666675 },
{ 0.000618e-6, 22003.914634870, 2.466427018 },
{ 0.000738e-6, 6134.997125565, 2.242668890 },
/* 251, 260 */
{ 0.000660e-6, 625.670192312, 5.864091907 },
{ 0.000694e-6, 3496.032826134, 2.668309141 },
{ 0.000531e-6, 6489.261398429, 1.681888780 },
{ 0.000611e-6, -143571.324284214, 2.424978312 },
{ 0.000575e-6, 12043.574281889, 4.216492400 },
{ 0.000553e-6, 12416.588502848, 4.772158039 },
{ 0.000689e-6, 4686.889407707, 6.224271088 },
{ 0.000495e-6, 7342.457780181, 3.817285811 },
{ 0.000567e-6, 3634.621024518, 1.649264690 },
{ 0.000515e-6, 18635.928454536, 3.945345892 },
/* 261, 270 */
{ 0.000486e-6, -323.505416657, 4.061673868 },
{ 0.000662e-6, 25158.601719765, 1.794058369 },
{ 0.000509e-6, 846.082834751, 3.053874588 },
{ 0.000472e-6, -12569.674818332, 5.112133338 },
{ 0.000461e-6, 6179.983075773, 0.513669325 },
{ 0.000641e-6, 83467.156352816, 3.210727723 },
{ 0.000520e-6, 10344.295065386, 2.445597761 },
{ 0.000493e-6, 18422.629359098, 1.676939306 },
{ 0.000478e-6, 1265.567478626, 5.487314569 },
{ 0.000472e-6, -18.159247265, 1.999707589 },
/* 271, 280 */
{ 0.000559e-6, 11190.377900137, 5.783236356 },
{ 0.000494e-6, 9623.688276691, 3.022645053 },
{ 0.000463e-6, 5739.157790895, 1.411223013 },
{ 0.000432e-6, 16858.482532933, 1.179256434 },
{ 0.000574e-6, 72140.628666286, 1.758191830 },
{ 0.000484e-6, 17267.268201691, 3.290589143 },
{ 0.000550e-6, 4907.302050146, 0.864024298 },
{ 0.000399e-6, 14.977853527, 2.094441910 },
{ 0.000491e-6, 224.344795702, 0.878372791 },
{ 0.000432e-6, 20426.571092422, 6.003829241 },
/* 281, 290 */
{ 0.000481e-6, 5749.452731634, 4.309591964 },
{ 0.000480e-6, 5757.317038160, 1.142348571 },
{ 0.000485e-6, 6702.560493867, 0.210580917 },
{ 0.000426e-6, 6055.549660552, 4.274476529 },
{ 0.000480e-6, 5959.570433334, 5.031351030 },
{ 0.000466e-6, 12562.628581634, 4.959581597 },
{ 0.000520e-6, 39302.096962196, 4.788002889 },
{ 0.000458e-6, 12132.439962106, 1.880103788 },
{ 0.000470e-6, 12029.347187887, 1.405611197 },
{ 0.000416e-6, -7477.522860216, 1.082356330 },
/* 291, 300 */
{ 0.000449e-6, 11609.862544012, 4.179989585 },
{ 0.000465e-6, 17253.041107690, 0.353496295 },
{ 0.000362e-6, -4535.059436924, 1.583849576 },
{ 0.000383e-6, 21954.157609398, 3.747376371 },
{ 0.000389e-6, 17.252277143, 1.395753179 },
{ 0.000331e-6, 18052.929543158, 0.566790582 },
{ 0.000430e-6, 13517.870106233, 0.685827538 },
{ 0.000368e-6, -5756.908003246, 0.731374317 },
{ 0.000330e-6, 10557.594160824, 3.710043680 },
{ 0.000332e-6, 20199.094959633, 1.652901407 },
/* 301, 310 */
{ 0.000384e-6, 11933.367960670, 5.827781531 },
{ 0.000387e-6, 10454.501386605, 2.541182564 },
{ 0.000325e-6, 15671.081759407, 2.178850542 },
{ 0.000318e-6, 138.517496871, 2.253253037 },
{ 0.000305e-6, 9388.005909415, 0.578340206 },
{ 0.000352e-6, 5749.861766548, 3.000297967 },
{ 0.000311e-6, 6915.859589305, 1.693574249 },
{ 0.000297e-6, 24072.921469776, 1.997249392 },
{ 0.000363e-6, -640.877607382, 5.071820966 },
{ 0.000323e-6, 12592.450019783, 1.072262823 },
/* 311, 320 */
{ 0.000341e-6, 12146.667056108, 4.700657997 },
{ 0.000290e-6, 9779.108676125, 1.812320441 },
{ 0.000342e-6, 6132.028180148, 4.322238614 },
{ 0.000329e-6, 6268.848755990, 3.033827743 },
{ 0.000374e-6, 17996.031168222, 3.388716544 },
{ 0.000285e-6, -533.214083444, 4.687313233 },
{ 0.000338e-6, 6065.844601290, 0.877776108 },
{ 0.000276e-6, 24.298513841, 0.770299429 },
{ 0.000336e-6, -2388.894020449, 5.353796034 },
{ 0.000290e-6, 3097.883822726, 4.075291557 },
/* 321, 330 */
{ 0.000318e-6, 709.933048357, 5.941207518 },
{ 0.000271e-6, 13095.842665077, 3.208912203 },
{ 0.000331e-6, 6073.708907816, 4.007881169 },
{ 0.000292e-6, 742.990060533, 2.714333592 },
{ 0.000362e-6, 29088.811415985, 3.215977013 },
{ 0.000280e-6, 12359.966151546, 0.710872502 },
{ 0.000267e-6, 10440.274292604, 4.730108488 },
{ 0.000262e-6, 838.969287750, 1.327720272 },
{ 0.000250e-6, 16496.361396202, 0.898769761 },
{ 0.000325e-6, 20597.243963041, 0.180044365 },
/* 331, 340 */
{ 0.000268e-6, 6148.010769956, 5.152666276 },
{ 0.000284e-6, 5636.065016677, 5.655385808 },
{ 0.000301e-6, 6080.822454817, 2.135396205 },
{ 0.000294e-6, -377.373607916, 3.708784168 },
{ 0.000236e-6, 2118.763860378, 1.733578756 },
{ 0.000234e-6, 5867.523359379, 5.575209112 },
{ 0.000268e-6, -226858.238553767, 0.069432392 },
{ 0.000265e-6, 167283.761587465, 4.369302826 },
{ 0.000280e-6, 28237.233459389, 5.304829118 },
{ 0.000292e-6, 12345.739057544, 4.096094132 },
/* 341, 350 */
{ 0.000223e-6, 19800.945956225, 3.069327406 },
{ 0.000301e-6, 43232.306658416, 6.205311188 },
{ 0.000264e-6, 18875.525869774, 1.417263408 },
{ 0.000304e-6, -1823.175188677, 3.409035232 },
{ 0.000301e-6, 109.945688789, 0.510922054 },
{ 0.000260e-6, 813.550283960, 2.389438934 },
{ 0.000299e-6, 316428.228673312, 5.384595078 },
{ 0.000211e-6, 5756.566278634, 3.789392838 },
{ 0.000209e-6, 5750.203491159, 1.661943545 },
{ 0.000240e-6, 12489.885628707, 5.684549045 },
/* 351, 360 */
{ 0.000216e-6, 6303.851245484, 3.862942261 },
{ 0.000203e-6, 1581.959348283, 5.549853589 },
{ 0.000200e-6, 5642.198242609, 1.016115785 },
{ 0.000197e-6, -70.849445304, 4.690702525 },
{ 0.000227e-6, 6287.008003254, 2.911891613 },
{ 0.000197e-6, 533.623118358, 1.048982898 },
{ 0.000205e-6, -6279.485421340, 1.829362730 },
{ 0.000209e-6, -10988.808157535, 2.636140084 },
{ 0.000208e-6, -227.526189440, 4.127883842 },
{ 0.000191e-6, 415.552490612, 4.401165650 },
/* 361, 370 */
{ 0.000190e-6, 29296.615389579, 4.175658539 },
{ 0.000264e-6, 66567.485864652, 4.601102551 },
{ 0.000256e-6, -3646.350377354, 0.506364778 },
{ 0.000188e-6, 13119.721102825, 2.032195842 },
{ 0.000185e-6, -209.366942175, 4.694756586 },
{ 0.000198e-6, 25934.124331089, 3.832703118 },
{ 0.000195e-6, 4061.219215394, 3.308463427 },
{ 0.000234e-6, 5113.487598583, 1.716090661 },
{ 0.000188e-6, 1478.866574064, 5.686865780 },
{ 0.000222e-6, 11823.161639450, 1.942386641 },
/* 371, 380 */
{ 0.000181e-6, 10770.893256262, 1.999482059 },
{ 0.000171e-6, 6546.159773364, 1.182807992 },
{ 0.000206e-6, 70.328180442, 5.934076062 },
{ 0.000169e-6, 20995.392966449, 2.169080622 },
{ 0.000191e-6, 10660.686935042, 5.405515999 },
{ 0.000228e-6, 33019.021112205, 4.656985514 },
{ 0.000184e-6, -4933.208440333, 3.327476868 },
{ 0.000220e-6, -135.625325010, 1.765430262 },
{ 0.000166e-6, 23141.558382925, 3.454132746 },
{ 0.000191e-6, 6144.558353121, 5.020393445 },
/* 381, 390 */
{ 0.000180e-6, 6084.003848555, 0.602182191 },
{ 0.000163e-6, 17782.732072784, 4.960593133 },
{ 0.000225e-6, 16460.333529525, 2.596451817 },
{ 0.000222e-6, 5905.702242076, 3.731990323 },
{ 0.000204e-6, 227.476132789, 5.636192701 },
{ 0.000159e-6, 16737.577236597, 3.600691544 },
{ 0.000200e-6, 6805.653268085, 0.868220961 },
{ 0.000187e-6, 11919.140866668, 2.629456641 },
{ 0.000161e-6, 127.471796607, 2.862574720 },
{ 0.000205e-6, 6286.666278643, 1.742882331 },
/* 391, 400 */
{ 0.000189e-6, 153.778810485, 4.812372643 },
{ 0.000168e-6, 16723.350142595, 0.027860588 },
{ 0.000149e-6, 11720.068865232, 0.659721876 },
{ 0.000189e-6, 5237.921013804, 5.245313000 },
{ 0.000143e-6, 6709.674040867, 4.317625647 },
{ 0.000146e-6, 4487.817406270, 4.815297007 },
{ 0.000144e-6, -664.756045130, 5.381366880 },
{ 0.000175e-6, 5127.714692584, 4.728443327 },
{ 0.000162e-6, 6254.626662524, 1.435132069 },
{ 0.000187e-6, 47162.516354635, 1.354371923 },
/* 401, 410 */
{ 0.000146e-6, 11080.171578918, 3.369695406 },
{ 0.000180e-6, -348.924420448, 2.490902145 },
{ 0.000148e-6, 151.047669843, 3.799109588 },
{ 0.000157e-6, 6197.248551160, 1.284375887 },
{ 0.000167e-6, 146.594251718, 0.759969109 },
{ 0.000133e-6, -5331.357443741, 5.409701889 },
{ 0.000154e-6, 95.979227218, 3.366890614 },
{ 0.000148e-6, -6418.140930027, 3.384104996 },
{ 0.000128e-6, -6525.804453965, 3.803419985 },
{ 0.000130e-6, 11293.470674356, 0.939039445 },
/* 411, 420 */
{ 0.000152e-6, -5729.506447149, 0.734117523 },
{ 0.000138e-6, 210.117701700, 2.564216078 },
{ 0.000123e-6, 6066.595360816, 4.517099537 },
{ 0.000140e-6, 18451.078546566, 0.642049130 },
{ 0.000126e-6, 11300.584221356, 3.485280663 },
{ 0.000119e-6, 10027.903195729, 3.217431161 },
{ 0.000151e-6, 4274.518310832, 4.404359108 },
{ 0.000117e-6, 6072.958148291, 0.366324650 },
{ 0.000165e-6, -7668.637425143, 4.298212528 },
{ 0.000117e-6, -6245.048177356, 5.379518958 },
/* 421, 430 */
{ 0.000130e-6, -5888.449964932, 4.527681115 },
{ 0.000121e-6, -543.918059096, 6.109429504 },
{ 0.000162e-6, 9683.594581116, 5.720092446 },
{ 0.000141e-6, 6219.339951688, 0.679068671 },
{ 0.000118e-6, 22743.409379516, 4.881123092 },
{ 0.000129e-6, 1692.165669502, 0.351407289 },
{ 0.000126e-6, 5657.405657679, 5.146592349 },
{ 0.000114e-6, 728.762966531, 0.520791814 },
{ 0.000120e-6, 52.596639600, 0.948516300 },
{ 0.000115e-6, 65.220371012, 3.504914846 },
/* 431, 440 */
{ 0.000126e-6, 5881.403728234, 5.577502482 },
{ 0.000158e-6, 163096.180360983, 2.957128968 },
{ 0.000134e-6, 12341.806904281, 2.598576764 },
{ 0.000151e-6, 16627.370915377, 3.985702050 },
{ 0.000109e-6, 1368.660252845, 0.014730471 },
{ 0.000131e-6, 6211.263196841, 0.085077024 },
{ 0.000146e-6, 5792.741760812, 0.708426604 },
{ 0.000146e-6, -77.750543984, 3.121576600 },
{ 0.000107e-6, 5341.013788022, 0.288231904 },
{ 0.000138e-6, 6281.591377283, 2.797450317 },
/* 441, 450 */
{ 0.000113e-6, -6277.552925684, 2.788904128 },
{ 0.000115e-6, -525.758811831, 5.895222200 },
{ 0.000138e-6, 6016.468808270, 6.096188999 },
{ 0.000139e-6, 23539.707386333, 2.028195445 },
{ 0.000146e-6, -4176.041342449, 4.660008502 },
{ 0.000107e-6, 16062.184526117, 4.066520001 },
{ 0.000142e-6, 83783.548222473, 2.936315115 },
{ 0.000128e-6, 9380.959672717, 3.223844306 },
{ 0.000135e-6, 6205.325306007, 1.638054048 },
{ 0.000101e-6, 2699.734819318, 5.481603249 },
/* 451, 460 */
{ 0.000104e-6, -568.821874027, 2.205734493 },
{ 0.000103e-6, 6321.103522627, 2.440421099 },
{ 0.000119e-6, 6321.208885629, 2.547496264 },
{ 0.000138e-6, 1975.492545856, 2.314608466 },
{ 0.000121e-6, 137.033024162, 4.539108237 },
{ 0.000123e-6, 19402.796952817, 4.538074405 },
{ 0.000119e-6, 22805.735565994, 2.869040566 },
{ 0.000133e-6, 64471.991241142, 6.056405489 },
{ 0.000129e-6, -85.827298831, 2.540635083 },
{ 0.000131e-6, 13613.804277336, 4.005732868 },
/* 461, 470 */
{ 0.000104e-6, 9814.604100291, 1.959967212 },
{ 0.000112e-6, 16097.679950283, 3.589026260 },
{ 0.000123e-6, 2107.034507542, 1.728627253 },
{ 0.000121e-6, 36949.230808424, 6.072332087 },
{ 0.000108e-6, -12539.853380183, 3.716133846 },
{ 0.000113e-6, -7875.671863624, 2.725771122 },
{ 0.000109e-6, 4171.425536614, 4.033338079 },
{ 0.000101e-6, 6247.911759770, 3.441347021 },
{ 0.000113e-6, 7330.728427345, 0.656372122 },
{ 0.000113e-6, 51092.726050855, 2.791483066 },
/* 471, 480 */
{ 0.000106e-6, 5621.842923210, 1.815323326 },
{ 0.000101e-6, 111.430161497, 5.711033677 },
{ 0.000103e-6, 909.818733055, 2.812745443 },
{ 0.000101e-6, 1790.642637886, 1.965746028 },
/* T */
{ 102.156724e-6, 6283.075849991, 4.249032005 },
{ 1.706807e-6, 12566.151699983, 4.205904248 },
{ 0.269668e-6, 213.299095438, 3.400290479 },
{ 0.265919e-6, 529.690965095, 5.836047367 },
{ 0.210568e-6, -3.523118349, 6.262738348 },
{ 0.077996e-6, 5223.693919802, 4.670344204 },
/* 481, 490 */
{ 0.054764e-6, 1577.343542448, 4.534800170 },
{ 0.059146e-6, 26.298319800, 1.083044735 },
{ 0.034420e-6, -398.149003408, 5.980077351 },
{ 0.032088e-6, 18849.227549974, 4.162913471 },
{ 0.033595e-6, 5507.553238667, 5.980162321 },
{ 0.029198e-6, 5856.477659115, 0.623811863 },
{ 0.027764e-6, 155.420399434, 3.745318113 },
{ 0.025190e-6, 5746.271337896, 2.980330535 },
{ 0.022997e-6, -796.298006816, 1.174411803 },
{ 0.024976e-6, 5760.498431898, 2.467913690 },
/* 491, 500 */
{ 0.021774e-6, 206.185548437, 3.854787540 },
{ 0.017925e-6, -775.522611324, 1.092065955 },
{ 0.013794e-6, 426.598190876, 2.699831988 },
{ 0.013276e-6, 6062.663207553, 5.845801920 },
{ 0.011774e-6, 12036.460734888, 2.292832062 },
{ 0.012869e-6, 6076.890301554, 5.333425680 },
{ 0.012152e-6, 1059.381930189, 6.222874454 },
{ 0.011081e-6, -7.113547001, 5.154724984 },
{ 0.010143e-6, 4694.002954708, 4.044013795 },
{ 0.009357e-6, 5486.777843175, 3.416081409 },
/* 501, 510 */
{ 0.010084e-6, 522.577418094, 0.749320262 },
{ 0.008587e-6, 10977.078804699, 2.777152598 },
{ 0.008628e-6, 6275.962302991, 4.562060226 },
{ 0.008158e-6, -220.412642439, 5.806891533 },
{ 0.007746e-6, 2544.314419883, 1.603197066 },
{ 0.007670e-6, 2146.165416475, 3.000200440 },
{ 0.007098e-6, 74.781598567, 0.443725817 },
{ 0.006180e-6, -536.804512095, 1.302642751 },
{ 0.005818e-6, 5088.628839767, 4.827723531 },
{ 0.004945e-6, -6286.598968340, 0.268305170 },
/* 511, 520 */
{ 0.004774e-6, 1349.867409659, 5.808636673 },
{ 0.004687e-6, -242.728603974, 5.154890570 },
{ 0.006089e-6, 1748.016413067, 4.403765209 },
{ 0.005975e-6, -1194.447010225, 2.583472591 },
{ 0.004229e-6, 951.718406251, 0.931172179 },
{ 0.005264e-6, 553.569402842, 2.336107252 },
{ 0.003049e-6, 5643.178563677, 1.362634430 },
{ 0.002974e-6, 6812.766815086, 1.583012668 },
{ 0.003403e-6, -2352.866153772, 2.552189886 },
{ 0.003030e-6, 419.484643875, 5.286473844 },
/* 521, 530 */
{ 0.003210e-6, -7.046236698, 1.863796539 },
{ 0.003058e-6, 9437.762934887, 4.226420633 },
{ 0.002589e-6, 12352.852604545, 1.991935820 },
{ 0.002927e-6, 5216.580372801, 2.319951253 },
{ 0.002425e-6, 5230.807466803, 3.084752833 },
{ 0.002656e-6, 3154.687084896, 2.487447866 },
{ 0.002445e-6, 10447.387839604, 2.347139160 },
{ 0.002990e-6, 4690.479836359, 6.235872050 },
{ 0.002890e-6, 5863.591206116, 0.095197563 },
{ 0.002498e-6, 6438.496249426, 2.994779800 },
/* 531, 540 */
{ 0.001889e-6, 8031.092263058, 3.569003717 },
{ 0.002567e-6, 801.820931124, 3.425611498 },
{ 0.001803e-6, -71430.695617928, 2.192295512 },
{ 0.001782e-6, 3.932153263, 5.180433689 },
{ 0.001694e-6, -4705.732307544, 4.641779174 },
{ 0.001704e-6, -1592.596013633, 3.997097652 },
{ 0.001735e-6, 5849.364112115, 0.417558428 },
{ 0.001643e-6, 8429.241266467, 2.180619584 },
{ 0.001680e-6, 38.133035638, 4.164529426 },
{ 0.002045e-6, 7084.896781115, 0.526323854 },
/* 541, 550 */
{ 0.001458e-6, 4292.330832950, 1.356098141 },
{ 0.001437e-6, 20.355319399, 3.895439360 },
{ 0.001738e-6, 6279.552731642, 0.087484036 },
{ 0.001367e-6, 14143.495242431, 3.987576591 },
{ 0.001344e-6, 7234.794256242, 0.090454338 },
{ 0.001438e-6, 11499.656222793, 0.974387904 },
{ 0.001257e-6, 6836.645252834, 1.509069366 },
{ 0.001358e-6, 11513.883316794, 0.495572260 },
{ 0.001628e-6, 7632.943259650, 4.968445721 },
{ 0.001169e-6, 103.092774219, 2.838496795 },
/* 551, 560 */
{ 0.001162e-6, 4164.311989613, 3.408387778 },
{ 0.001092e-6, 6069.776754553, 3.617942651 },
{ 0.001008e-6, 17789.845619785, 0.286350174 },
{ 0.001008e-6, 639.897286314, 1.610762073 },
{ 0.000918e-6, 10213.285546211, 5.532798067 },
{ 0.001011e-6, -6256.777530192, 0.661826484 },
{ 0.000753e-6, 16730.463689596, 3.905030235 },
{ 0.000737e-6, 11926.254413669, 4.641956361 },
{ 0.000694e-6, 3340.612426700, 2.111120332 },
{ 0.000701e-6, 3894.181829542, 2.760823491 },
/* 561, 570 */
{ 0.000689e-6, -135.065080035, 4.768800780 },
{ 0.000700e-6, 13367.972631107, 5.760439898 },
{ 0.000664e-6, 6040.347246017, 1.051215840 },
{ 0.000654e-6, 5650.292110678, 4.911332503 },
{ 0.000788e-6, 6681.224853400, 4.699648011 },
{ 0.000628e-6, 5333.900241022, 5.024608847 },
{ 0.000755e-6, -110.206321219, 4.370971253 },
{ 0.000628e-6, 6290.189396992, 3.660478857 },
{ 0.000635e-6, 25132.303399966, 4.121051532 },
{ 0.000534e-6, 5966.683980335, 1.173284524 },
/* 571, 580 */
{ 0.000543e-6, -433.711737877, 0.345585464 },
{ 0.000517e-6, -1990.745017041, 5.414571768 },
{ 0.000504e-6, 5767.611978898, 2.328281115 },
{ 0.000485e-6, 5753.384884897, 1.685874771 },
{ 0.000463e-6, 7860.419392439, 5.297703006 },
{ 0.000604e-6, 515.463871093, 0.591998446 },
{ 0.000443e-6, 12168.002696575, 4.830881244 },
{ 0.000570e-6, 199.072001436, 3.899190272 },
{ 0.000465e-6, 10969.965257698, 0.476681802 },
{ 0.000424e-6, -7079.373856808, 1.112242763 },
/* 581, 590 */
{ 0.000427e-6, 735.876513532, 1.994214480 },
{ 0.000478e-6, -6127.655450557, 3.778025483 },
{ 0.000414e-6, 10973.555686350, 5.441088327 },
{ 0.000512e-6, 1589.072895284, 0.107123853 },
{ 0.000378e-6, 10984.192351700, 0.915087231 },
{ 0.000402e-6, 11371.704689758, 4.107281715 },
{ 0.000453e-6, 9917.696874510, 1.917490952 },
{ 0.000395e-6, 149.563197135, 2.763124165 },
{ 0.000371e-6, 5739.157790895, 3.112111866 },
{ 0.000350e-6, 11790.629088659, 0.440639857 },
/* 591, 600 */
{ 0.000356e-6, 6133.512652857, 5.444568842 },
{ 0.000344e-6, 412.371096874, 5.676832684 },
{ 0.000383e-6, 955.599741609, 5.559734846 },
{ 0.000333e-6, 6496.374945429, 0.261537984 },
{ 0.000340e-6, 6055.549660552, 5.975534987 },
{ 0.000334e-6, 1066.495477190, 2.335063907 },
{ 0.000399e-6, 11506.769769794, 5.321230910 },
{ 0.000314e-6, 18319.536584880, 2.313312404 },
{ 0.000424e-6, 1052.268383188, 1.211961766 },
{ 0.000307e-6, 63.735898303, 3.169551388 },
/* 601, 610 */
{ 0.000329e-6, 29.821438149, 6.106912080 },
{ 0.000357e-6, 6309.374169791, 4.223760346 },
{ 0.000312e-6, -3738.761430108, 2.180556645 },
{ 0.000301e-6, 309.278322656, 1.499984572 },
{ 0.000268e-6, 12043.574281889, 2.447520648 },
{ 0.000257e-6, 12491.370101415, 3.662331761 },
{ 0.000290e-6, 625.670192312, 1.272834584 },
{ 0.000256e-6, 5429.879468239, 1.913426912 },
{ 0.000339e-6, 3496.032826134, 4.165930011 },
{ 0.000283e-6, 3930.209696220, 4.325565754 },
/* 611, 620 */
{ 0.000241e-6, 12528.018664345, 3.832324536 },
{ 0.000304e-6, 4686.889407707, 1.612348468 },
{ 0.000259e-6, 16200.772724501, 3.470173146 },
{ 0.000238e-6, 12139.553509107, 1.147977842 },
{ 0.000236e-6, 6172.869528772, 3.776271728 },
{ 0.000296e-6, -7058.598461315, 0.460368852 },
{ 0.000306e-6, 10575.406682942, 0.554749016 },
{ 0.000251e-6, 17298.182327326, 0.834332510 },
{ 0.000290e-6, 4732.030627343, 4.759564091 },
{ 0.000261e-6, 5884.926846583, 0.298259862 },
/* 621, 630 */
{ 0.000249e-6, 5547.199336460, 3.749366406 },
{ 0.000213e-6, 11712.955318231, 5.415666119 },
{ 0.000223e-6, 4701.116501708, 2.703203558 },
{ 0.000268e-6, -640.877607382, 0.283670793 },
{ 0.000209e-6, 5636.065016677, 1.238477199 },
{ 0.000193e-6, 10177.257679534, 1.943251340 },
{ 0.000182e-6, 6283.143160294, 2.456157599 },
{ 0.000184e-6, -227.526189440, 5.888038582 },
{ 0.000182e-6, -6283.008539689, 0.241332086 },
{ 0.000228e-6, -6284.056171060, 2.657323816 },
/* 631, 640 */
{ 0.000166e-6, 7238.675591600, 5.930629110 },
{ 0.000167e-6, 3097.883822726, 5.570955333 },
{ 0.000159e-6, -323.505416657, 5.786670700 },
{ 0.000154e-6, -4136.910433516, 1.517805532 },
{ 0.000176e-6, 12029.347187887, 3.139266834 },
{ 0.000167e-6, 12132.439962106, 3.556352289 },
{ 0.000153e-6, 202.253395174, 1.463313961 },
{ 0.000157e-6, 17267.268201691, 1.586837396 },
{ 0.000142e-6, 83996.847317911, 0.022670115 },
{ 0.000152e-6, 17260.154654690, 0.708528947 },
/* 641, 650 */
{ 0.000144e-6, 6084.003848555, 5.187075177 },
{ 0.000135e-6, 5756.566278634, 1.993229262 },
{ 0.000134e-6, 5750.203491159, 3.457197134 },
{ 0.000144e-6, 5326.786694021, 6.066193291 },
{ 0.000160e-6, 11015.106477335, 1.710431974 },
{ 0.000133e-6, 3634.621024518, 2.836451652 },
{ 0.000134e-6, 18073.704938650, 5.453106665 },
{ 0.000134e-6, 1162.474704408, 5.326898811 },
{ 0.000128e-6, 5642.198242609, 2.511652591 },
{ 0.000160e-6, 632.783739313, 5.628785365 },
/* 651, 660 */
{ 0.000132e-6, 13916.019109642, 0.819294053 },
{ 0.000122e-6, 14314.168113050, 5.677408071 },
{ 0.000125e-6, 12359.966151546, 5.251984735 },
{ 0.000121e-6, 5749.452731634, 2.210924603 },
{ 0.000136e-6, -245.831646229, 1.646502367 },
{ 0.000120e-6, 5757.317038160, 3.240883049 },
{ 0.000134e-6, 12146.667056108, 3.059480037 },
{ 0.000137e-6, 6206.809778716, 1.867105418 },
{ 0.000141e-6, 17253.041107690, 2.069217456 },
{ 0.000129e-6, -7477.522860216, 2.781469314 },
/* 661, 670 */
{ 0.000116e-6, 5540.085789459, 4.281176991 },
{ 0.000116e-6, 9779.108676125, 3.320925381 },
{ 0.000129e-6, 5237.921013804, 3.497704076 },
{ 0.000113e-6, 5959.570433334, 0.983210840 },
{ 0.000122e-6, 6282.095528923, 2.674938860 },
{ 0.000140e-6, -11.045700264, 4.957936982 },
{ 0.000108e-6, 23543.230504682, 1.390113589 },
{ 0.000106e-6, -12569.674818332, 0.429631317 },
{ 0.000110e-6, -266.607041722, 5.501340197 },
{ 0.000115e-6, 12559.038152982, 4.691456618 },
/* 671, 680 */
{ 0.000134e-6, -2388.894020449, 0.577313584 },
{ 0.000109e-6, 10440.274292604, 6.218148717 },
{ 0.000102e-6, -543.918059096, 1.477842615 },
{ 0.000108e-6, 21228.392023546, 2.237753948 },
{ 0.000101e-6, -4535.059436924, 3.100492232 },
{ 0.000103e-6, 76.266071276, 5.594294322 },
{ 0.000104e-6, 949.175608970, 5.674287810 },
{ 0.000101e-6, 13517.870106233, 2.196632348 },
{ 0.000100e-6, 11933.367960670, 4.056084160 },
/* T^2 */
{ 4.322990e-6, 6283.075849991, 2.642893748 },
/* 681, 690 */
{ 0.406495e-6, 0.000000000, 4.712388980 },
{ 0.122605e-6, 12566.151699983, 2.438140634 },
{ 0.019476e-6, 213.299095438, 1.642186981 },
{ 0.016916e-6, 529.690965095, 4.510959344 },
{ 0.013374e-6, -3.523118349, 1.502210314 },
{ 0.008042e-6, 26.298319800, 0.478549024 },
{ 0.007824e-6, 155.420399434, 5.254710405 },
{ 0.004894e-6, 5746.271337896, 4.683210850 },
{ 0.004875e-6, 5760.498431898, 0.759507698 },
{ 0.004416e-6, 5223.693919802, 6.028853166 },
/* 691, 700 */
{ 0.004088e-6, -7.113547001, 0.060926389 },
{ 0.004433e-6, 77713.771467920, 3.627734103 },
{ 0.003277e-6, 18849.227549974, 2.327912542 },
{ 0.002703e-6, 6062.663207553, 1.271941729 },
{ 0.003435e-6, -775.522611324, 0.747446224 },
{ 0.002618e-6, 6076.890301554, 3.633715689 },
{ 0.003146e-6, 206.185548437, 5.647874613 },
{ 0.002544e-6, 1577.343542448, 6.232904270 },
{ 0.002218e-6, -220.412642439, 1.309509946 },
{ 0.002197e-6, 5856.477659115, 2.407212349 },
/* 701, 710 */
{ 0.002897e-6, 5753.384884897, 5.863842246 },
{ 0.001766e-6, 426.598190876, 0.754113147 },
{ 0.001738e-6, -796.298006816, 2.714942671 },
{ 0.001695e-6, 522.577418094, 2.629369842 },
{ 0.001584e-6, 5507.553238667, 1.341138229 },
{ 0.001503e-6, -242.728603974, 0.377699736 },
{ 0.001552e-6, -536.804512095, 2.904684667 },
{ 0.001370e-6, -398.149003408, 1.265599125 },
{ 0.001889e-6, -5573.142801634, 4.413514859 },
{ 0.001722e-6, 6069.776754553, 2.445966339 },
/* 711, 720 */
{ 0.001124e-6, 1059.381930189, 5.041799657 },
{ 0.001258e-6, 553.569402842, 3.849557278 },
{ 0.000831e-6, 951.718406251, 2.471094709 },
{ 0.000767e-6, 4694.002954708, 5.363125422 },
{ 0.000756e-6, 1349.867409659, 1.046195744 },
{ 0.000775e-6, -11.045700264, 0.245548001 },
{ 0.000597e-6, 2146.165416475, 4.543268798 },
{ 0.000568e-6, 5216.580372801, 4.178853144 },
{ 0.000711e-6, 1748.016413067, 5.934271972 },
{ 0.000499e-6, 12036.460734888, 0.624434410 },
/* 721, 730 */
{ 0.000671e-6, -1194.447010225, 4.136047594 },
{ 0.000488e-6, 5849.364112115, 2.209679987 },
{ 0.000621e-6, 6438.496249426, 4.518860804 },
{ 0.000495e-6, -6286.598968340, 1.868201275 },
{ 0.000456e-6, 5230.807466803, 1.271231591 },
{ 0.000451e-6, 5088.628839767, 0.084060889 },
{ 0.000435e-6, 5643.178563677, 3.324456609 },
{ 0.000387e-6, 10977.078804699, 4.052488477 },
{ 0.000547e-6, 161000.685737473, 2.841633844 },
{ 0.000522e-6, 3154.687084896, 2.171979966 },
/* 731, 740 */
{ 0.000375e-6, 5486.777843175, 4.983027306 },
{ 0.000421e-6, 5863.591206116, 4.546432249 },
{ 0.000439e-6, 7084.896781115, 0.522967921 },
{ 0.000309e-6, 2544.314419883, 3.172606705 },
{ 0.000347e-6, 4690.479836359, 1.479586566 },
{ 0.000317e-6, 801.820931124, 3.553088096 },
{ 0.000262e-6, 419.484643875, 0.606635550 },
{ 0.000248e-6, 6836.645252834, 3.014082064 },
{ 0.000245e-6, -1592.596013633, 5.519526220 },
{ 0.000225e-6, 4292.330832950, 2.877956536 },
/* 741, 750 */
{ 0.000214e-6, 7234.794256242, 1.605227587 },
{ 0.000205e-6, 5767.611978898, 0.625804796 },
{ 0.000180e-6, 10447.387839604, 3.499954526 },
{ 0.000229e-6, 199.072001436, 5.632304604 },
{ 0.000214e-6, 639.897286314, 5.960227667 },
{ 0.000175e-6, -433.711737877, 2.162417992 },
{ 0.000209e-6, 515.463871093, 2.322150893 },
{ 0.000173e-6, 6040.347246017, 2.556183691 },
{ 0.000184e-6, 6309.374169791, 4.732296790 },
{ 0.000227e-6, 149854.400134205, 5.385812217 },
/* 751, 760 */
{ 0.000154e-6, 8031.092263058, 5.120720920 },
{ 0.000151e-6, 5739.157790895, 4.815000443 },
{ 0.000197e-6, 7632.943259650, 0.222827271 },
{ 0.000197e-6, 74.781598567, 3.910456770 },
{ 0.000138e-6, 6055.549660552, 1.397484253 },
{ 0.000149e-6, -6127.655450557, 5.333727496 },
{ 0.000137e-6, 3894.181829542, 4.281749907 },
{ 0.000135e-6, 9437.762934887, 5.979971885 },
{ 0.000139e-6, -2352.866153772, 4.715630782 },
{ 0.000142e-6, 6812.766815086, 0.513330157 },
/* 761, 770 */
{ 0.000120e-6, -4705.732307544, 0.194160689 },
{ 0.000131e-6, -71430.695617928, 0.000379226 },
{ 0.000124e-6, 6279.552731642, 2.122264908 },
{ 0.000108e-6, -6256.777530192, 0.883445696 },
/* T^3 */
{ 0.143388e-6, 6283.075849991, 1.131453581 },
{ 0.006671e-6, 12566.151699983, 0.775148887 },
{ 0.001480e-6, 155.420399434, 0.480016880 },
{ 0.000934e-6, 213.299095438, 6.144453084 },
{ 0.000795e-6, 529.690965095, 2.941595619 },
{ 0.000673e-6, 5746.271337896, 0.120415406 },
/* 771, 780 */
{ 0.000672e-6, 5760.498431898, 5.317009738 },
{ 0.000389e-6, -220.412642439, 3.090323467 },
{ 0.000373e-6, 6062.663207553, 3.003551964 },
{ 0.000360e-6, 6076.890301554, 1.918913041 },
{ 0.000316e-6, -21.340641002, 5.545798121 },
{ 0.000315e-6, -242.728603974, 1.884932563 },
{ 0.000278e-6, 206.185548437, 1.266254859 },
{ 0.000238e-6, -536.804512095, 4.532664830 },
{ 0.000185e-6, 522.577418094, 4.578313856 },
{ 0.000245e-6, 18849.227549974, 0.587467082 },
/* 781, 787 */
{ 0.000180e-6, 426.598190876, 5.151178553 },
{ 0.000200e-6, 553.569402842, 5.355983739 },
{ 0.000141e-6, 5223.693919802, 1.336556009 },
{ 0.000104e-6, 5856.477659115, 4.239842759 },
/* T^4 */
{ 0.003826e-6, 6283.075849991, 5.705257275 },
{ 0.000303e-6, 12566.151699983, 5.407132842 },
{ 0.000209e-6, 155.420399434, 1.989815753 }
};
/* Time since J2000.0 in Julian millennia. */
t = ((date1 - DJ00) + date2) / DJM;
/* ================= */
/* Topocentric terms */
/* ================= */
/* Convert UT to local solar time in radians. */
tsol = fmod(ut, 1.0) * D2PI + elong;
/* FUNDAMENTAL ARGUMENTS: Simon et al. 1994. */
/* Combine time argument (millennia) with deg/arcsec factor. */
w = t / 3600.0;
/* Sun Mean Longitude. */
elsun = fmod(280.46645683 + 1296027711.03429 * w, 360.0) * DD2R;
/* Sun Mean Anomaly. */
emsun = fmod(357.52910918 + 1295965810.481 * w, 360.0) * DD2R;
/* Mean Elongation of Moon from Sun. */
d = fmod(297.85019547 + 16029616012.090 * w, 360.0) * DD2R;
/* Mean Longitude of Jupiter. */
elj = fmod(34.35151874 + 109306899.89453 * w, 360.0) * DD2R;
/* Mean Longitude of Saturn. */
els = fmod(50.07744430 + 44046398.47038 * w, 360.0) * DD2R;
/* TOPOCENTRIC TERMS: Moyer 1981 and Murray 1983. */
wt = + 0.00029e-10 * u * sin(tsol + elsun - els)
+ 0.00100e-10 * u * sin(tsol - 2.0 * emsun)
+ 0.00133e-10 * u * sin(tsol - d)
+ 0.00133e-10 * u * sin(tsol + elsun - elj)
- 0.00229e-10 * u * sin(tsol + 2.0 * elsun + emsun)
- 0.02200e-10 * v * cos(elsun + emsun)
+ 0.05312e-10 * u * sin(tsol - emsun)
- 0.13677e-10 * u * sin(tsol + 2.0 * elsun)
- 1.31840e-10 * v * cos(elsun)
+ 3.17679e-10 * u * sin(tsol);
/* ===================== */
/* Fairhead et al. model */
/* ===================== */
/* T**0 */
w0 = 0;
for (j = 473; j >= 0; j--) {
w0 += fairhd[j][0] * sin(fairhd[j][1] * t + fairhd[j][2]);
}
/* T**1 */
w1 = 0;
for (j = 678; j >= 474; j--) {
w1 += fairhd[j][0] * sin(fairhd[j][1] * t + fairhd[j][2]);
}
/* T**2 */
w2 = 0;
for (j = 763; j >= 679; j--) {
w2 += fairhd[j][0] * sin(fairhd[j][1] * t + fairhd[j][2]);
}
/* T**3 */
w3 = 0;
for (j = 783; j >= 764; j--) {
w3 += fairhd[j][0] * sin(fairhd[j][1] * t + fairhd[j][2]);
}
/* T**4 */
w4 = 0;
for (j = 786; j >= 784; j--) {
w4 += fairhd[j][0] * sin(fairhd[j][1] * t + fairhd[j][2]);
}
/* Multiply by powers of T and combine. */
wf = t * (t * (t * (t * w4 + w3) + w2) + w1) + w0;
/* Adjustments to use JPL planetary masses instead of IAU. */
wj = 0.00065e-6 * sin(6069.776754 * t + 4.021194) +
0.00033e-6 * sin( 213.299095 * t + 5.543132) +
(-0.00196e-6 * sin(6208.294251 * t + 5.696701)) +
(-0.00173e-6 * sin( 74.781599 * t + 2.435900)) +
0.03638e-6 * t * t;
/* ============ */
/* Final result */
/* ============ */
/* TDB-TT in seconds. */
w = wt + wf + wj;
return w;
} |
374dca15-eee4-4d11-ad52-f8a017916af1 | 1 | @Override
public boolean onKeyDown(int key) {
if(key == Keyboard.KEY_ESCAPE) {
Application.get().getHumanView().popScreen();
return true;
}
return false;
} |
9c552c44-1a04-47c0-b6f6-073cf0d7dff5 | 7 | private void fill(Graphics g, int x, int y, int width, int height, boolean horizontal) {
if (horizontal) {
if (height > block) {
g.setColor(c_bg);
g.fillRect(x, y, width + evm, height - block + evm);
}
for (int i = 0; i < width; i += block) {
g.drawImage(hgradient, x + i, (height > block) ? (y + height - block) : y,
x + Math.min(i + block, width) + evm, y + height + evm,
0, 0, Math.min(block, width - i) + evm, Math.min(block, height) + evm, null);
}
}
else {
if (width > block) {
g.setColor(c_bg);
g.fillRect(x, y, width - block + evm, height + evm);
}
for (int i = 0; i < height; i += block) {
g.drawImage(vgradient, (width > block) ? (x + width - block) : x, y + i,
x + width + evm, y + Math.min(i + block, height) + evm,
0, 0, Math.min(block, width) + evm, Math.min(block, height - i) + evm, null);
}
}
} |
4661a04e-05bf-4a61-85fe-d194b8d8f5f2 | 7 | @Override
protected Match addInitialMatch(Edge e, Edge eP, String matchID)
{
Match m = new Match(graph, pattern, e, eP, matchID);
// get neighbor edges in pattern and all matches containing these neighbor edges
Set<Edge> neighborEdgePs = new HashSet<Edge>();
neighborEdgePs.addAll(pattern.getInEdges(eP.getFrom()));
neighborEdgePs.addAll(pattern.getOutEdges(eP.getFrom()));
neighborEdgePs.addAll(pattern.getInEdges(eP.getTo()));
neighborEdgePs.addAll(pattern.getOutEdges(eP.getTo()));
Set<Match> nMatches = new HashSet<Match>();
for(Edge neP : neighborEdgePs)
if(ePMatchIndex.containsKey(neP))
for(Iterator<Match> it = ePMatchIndex.get(neP).iterator(); it.hasNext();)
{
Match mc = it.next();
if(mc.isValid())
nMatches.add(mc);
else
it.remove();
}
// add other matches to candidates list
for(Match mi : nMatches)
m.considerCandidate(mi, eMatchIndex, ePMatchIndex, monitor);
// add to indexes
if(!eMatchIndex.containsKey(e))
eMatchIndex.put(e, new HashSet<Match>());
eMatchIndex.get(e).add(m);
if(!ePMatchIndex.containsKey(eP))
ePMatchIndex.put(eP, new HashSet<Match>());
ePMatchIndex.get(eP).add(m);
// add to global lists
matchQueue.add(m);
allMatches.add(m);
return m;
} |
1bdef044-1fda-4f16-82bb-1b0369fbc003 | 4 | private boolean lukeminenVoidaanAloittaa() {
if (syote == null) {
return false;
}
if (!paikkaSisaltyySyotteeseen()) {
return false;
}
if (paikkaSisaltaaNumeron() || paikkaSisaltaaDesimaalipisteen()) {
return true;
}
return false;
} |
5b716ba0-d5f6-46af-8f7e-34dc12eed07e | 7 | public void requestFocus(short control) {
if (control == ADDNEW && buttonNewTask != null) buttonNewTask.requestFocus();
if (control == PRIORITY) textPriority.requestFocus();
if (control == CONTENT) textContent.requestFocus();
if (control == DATE) textDate.requestFocus();
if (control == COMPLETED) checkDone.requestFocus();
if (control == DELETE) buttonDelete.requestFocus();
} |
d3374b1b-4a3c-43f7-918f-032732af939e | 8 | private void addStep(double startPrice, double endPrice, double fixedPrice, double variablePricePercent) {
if (billingServerSecure == null) {
System.out.println("ERROR: You are currently not logged in");
} // Checking for positive interval range
else if (endPrice != 0 && startPrice >= endPrice) {
System.out.println("ERROR: Negative or empty interval range");
} else {
try {
billingServerSecure.createPriceStep(startPrice, endPrice, fixedPrice, variablePricePercent);
System.out.println("Step [" + startPrice + " " + (endPrice == 0 ? "INFINITY" : endPrice) + "] successfully added");
} catch (RemoteException ex) {
if (ex.getCause() != null) {
Throwable t = ex.getCause();
if (t instanceof PriceStepIntervalCollisionException) {
System.out.println("ERROR: PriceStep overlaps with existing PriceStep");
} else if (t instanceof PriceStepNegativeArgumentException) {
System.out.println("ERROR: Only positive arguments allowed");
} else {
logger.error("Billing Server Remote Exception");
}
} else {
logger.error("Billing Server Remote Exception");
}
}
}
} |
23bd26ba-dfbb-47e0-86ed-915ecc710d3f | 3 | private void allocateQueueGridlet()
{
// if there are many Gridlets in the QUEUE, then allocate a
// PE to the first Gridlet in the list since it follows FCFS
// (First Come First Serve) approach. Then removes the Gridlet from
// the Queue list
if (gridletQueueList_.size() > 0 &&
gridletInExecList_.size() < super.totalPE_)
{
ResGridlet obj = (ResGridlet) gridletQueueList_.get(0);
// allocate the Gridlet into an empty PE slot and remove it from
// the queue list
boolean success = allocatePEtoGridlet(obj);
if (success) {
gridletQueueList_.remove(obj);
}
}
} |
e227cc4e-4ffb-45e4-b106-39e4402e4f73 | 6 | public String genFindOrb() {
String nextLine;
URL url;
URLConnection urlConn;
InputStreamReader inStream;
BufferedReader buff;
this.observations = "";
try {
for (NEOCP neocp : neocpData) {
url = new URL(
"http://scully.cfa.harvard.edu/cgi-bin/showobsorbs.cgi?Obj="
+ neocp.getTmpdesig() + "&obs=y");
urlConn = url.openConnection();
inStream = new InputStreamReader(
urlConn.getInputStream());
buff = new BufferedReader(inStream);
while (true) {
nextLine = buff.readLine();
if (nextLine != null) {
Pattern pattern = Pattern.compile("html");
Matcher matcher = pattern.matcher(nextLine);
if (matcher.find()) {
} else {
this.observations = this.observations + nextLine
+ (System.getProperty("line.separator"));
}
} else {
break;
}
}
}
} catch (MalformedURLException e) {
System.out.println("Please check the URL:" + e.toString());
} catch (IOException e1) {
Label err = new Label("Can't read from the Internet: "
+ e1.toString());
err.setWrapText(true);
Stage stage = new Stage();
StackPane layout = new StackPane();
layout.getChildren().setAll(err);
stage.setTitle("ERROR");
stage.setScene(new Scene(layout));
stage.show();
}
return (this.observations);
} |
37509300-d768-4b95-8d31-dafabf9a1f70 | 7 | private void expParamChanged() {
if (m_Exp == null) return;
if (m_ExperimentTypeCBox.getSelectedItem() == TYPE_CROSSVALIDATION_TEXT) {
try {
m_numFolds = Integer.parseInt(m_ExperimentParameterTField.getText());
} catch (NumberFormatException e) {
return;
}
} else {
try {
m_trainPercent = Double.parseDouble(m_ExperimentParameterTField.getText());
} catch (NumberFormatException e) {
return;
}
}
if (m_ExperimentTypeCBox.getSelectedItem() == TYPE_CROSSVALIDATION_TEXT) {
if (m_Exp.getResultProducer() instanceof CrossValidationResultProducer) {
CrossValidationResultProducer cvrp = (CrossValidationResultProducer) m_Exp.getResultProducer();
cvrp.setNumFolds(m_numFolds);
} else {
return;
}
} else {
if (m_Exp.getResultProducer() instanceof RandomSplitResultProducer) {
RandomSplitResultProducer rsrp = (RandomSplitResultProducer) m_Exp.getResultProducer();
rsrp.setRandomizeData(m_ExperimentTypeCBox.getSelectedItem() == TYPE_RANDOMSPLIT_TEXT);
rsrp.setTrainPercent(m_trainPercent);
} else {
//System.err.println("not rsrp");
return;
}
}
m_Support.firePropertyChange("", null, null);
} |
b4a15e8b-3c67-489a-97a1-12f948768acf | 7 | public void move(int xa, int ya) {
if (xa != 0 && ya != 0) {
move(xa, 0);
move(0, ya);
numSteps--;
return;
}
numSteps++;
if (!hasCollided(xa, ya)) {
if (ya < 0)
movingDir = 0;
if (ya > 0)
movingDir = 1;
if (xa < 0)
movingDir = 2;
if (xa > 0)
movingDir = 3;
x += xa * speed;
y += ya * speed;
}
} |
e3c116d5-2e7f-4b62-b170-97c15ba47fd4 | 6 | @Override
protected void handleProtocol() throws Exception {
handleLoop:
while(!aborted() && !isProtocolCompleted()) {
int timeout = getTimeout();
IPacket packet = socket.waitForPacket(timeout);
if(aborted()) {
return;
}
if(packet == null) {
int newTimeout = getTimeout();
if(newTimeout <= timeout) {
this.timeout = true;
throw new TimeoutException("Protocol timeout! Protocol was handled to slow!");
}
continue handleLoop;
}
distributor.distribute(packet);
if(!socket.isConnected()) {
throw new SocketException("Disconnect during protocol execution!");
}
}
} |
cb3992d6-9713-487c-9471-b63b332e5b4a | 3 | public synchronized void actualiza(long tiempoTranscurrido){
if (cuadros.size() > 1){
tiempoDeAnimacion += tiempoTranscurrido;
if (tiempoDeAnimacion >= duracionTotal){
tiempoDeAnimacion = tiempoDeAnimacion % duracionTotal;
indiceCuadroActual = 0;
}
while (tiempoDeAnimacion > getCuadro(indiceCuadroActual).tiempoFinal){
indiceCuadroActual++;
}
}
} |
75827ebd-40bc-46eb-b96b-c3fad2d67c18 | 8 | private static void FFT(){
if (numPoints == 1) return;
final double pi = Math.PI;
final int numStages = (int)(Math.log(numPoints) / Math.log(2));
int halfNumPoints = numPoints >> 1;
int j = halfNumPoints;
// FFT time domain decomposition carried out by "bit reversal sorting" algorithm
int k = 0;
for (int i = 1; i < numPoints - 2; i++){
if (i < j){
// swap
double tempReal = real[j];
double tempImag = imag[j];
real[j] = real[i];
imag[j] = imag[i];
real[i] = tempReal;
imag[i] = tempImag;
}
k = halfNumPoints;
while ( k <= j ){
j -= k;
k >>=1;
}
j += k;
}
// loop for each stage
for (int stage = 1; stage <= numStages; stage++){
int LE = 1;
for (int i = 0; i < stage; i++)
LE <<= 1;
int LE2 = LE >> 1;
double UR = 1;
double UI = 0;
// calculate sine & cosine values
double SR = Math.cos( pi / LE2 );
double SI = -Math.sin( pi / LE2 );
// loop for each sub DFT
for (int subDFT = 1; subDFT <= LE2; subDFT++){
// loop for each butterfly
for (int butterfly = subDFT - 1; butterfly <= numPoints - 1; butterfly+=LE){
int ip = butterfly + LE2;
// butterfly calculation
double tempReal = real[ip] * UR - imag[ip] * UI;
double tempImag = real[ip] * UI + imag[ip] * UR;
real[ip] = real[butterfly] - tempReal;
imag[ip] = imag[butterfly] - tempImag;
real[butterfly] += tempReal;
imag[butterfly] += tempImag;
}
double tempUR = UR;
UR = tempUR * SR - UI * SI;
UI = tempUR * SI + UI * SR;
}
}
} |
763ccd86-24f6-4f11-afe5-764e449d529e | 3 | public void solve()
{
solveStart = System.currentTimeMillis();
// The current state of the solver.
SolverState state = new SolverState();
// Clear solutions
solutions = new ArrayList<State<M>>();
// Clear initial state
initial.setParent( null );
initial.setDepth( 0 );
// Add the initial state in, and mark it as visited.
state.states.add( initial );
if (!revisitStates)
{
state.visited.add( initial.getHash() );
}
// Create & Run the Threads
for (int i = 0; i < workers; i++)
{
new Thread( new SolverThread( state ) ).run();
}
// Wait until they're finished
try
{
state.finishLatch.await();
}
catch (InterruptedException e)
{
throw new RuntimeException( e );
}
// Update the statistics
statesCreated = state.statesCreated.get();
statesVisited = state.statesVisited.get();
statesDuplicated = state.statesDuplicated.get();
statesDeviated = state.statesDeviated.get();
statesShort = state.statesShort.get();
solveEnd = System.currentTimeMillis();
} |
20cf203f-7b12-41ce-aa7c-58fa2e926794 | 2 | @Override
public int compareTo(Node otherNode) {
float thisTotalDistanceFromGoal = heuristicDistanceFromGoal + distanceFromStart;
float otherTotalDistanceFromGoal = otherNode.getHeuristicDistanceFromGoal() + otherNode.getDistanceFromStart();
if (thisTotalDistanceFromGoal < otherTotalDistanceFromGoal)
return -1;
else if (thisTotalDistanceFromGoal > otherTotalDistanceFromGoal)
return 1;
else
return 0;
} |
d55bf27a-c230-4941-9a2e-043632cd845a | 2 | private boolean isStart(char c) {
return c == '(' || c == '[' || c == '{';
} |
5e4fcd2b-24b9-4d25-804b-d25e3b84a846 | 0 | public PacketFactory(String ip, int port) {
this.ip = ip;
this.port = port;
} |
3cb0461f-05a4-4226-b464-4db1979a2a72 | 2 | private static boolean handleBishopMove(Board b, ArrayList<Move> moves, Position p, Position currentPosition, int opponentColor) {
if (b.spaceHasOpponent(currentPosition, opponentColor)) {
moves.add(new Move(p, currentPosition));
return false;
} else if (b.spaceIsEmpty(currentPosition)) {
moves.add(new Move(p, currentPosition));
return true;
}
return false;
} |
36873ac1-8e59-467f-84c0-f76dcd875abe | 3 | public BufferedImage[] loadStripImageArray(String fnm, int number)
/*
* Extract the individual images from the strip image file, <fnm>. We assume
* the images are stored in a single row, and that there are <number> of
* them. The images are returned as an array of BufferedImages
*/
{
if (number <= 0) {
System.out.println("number <= 0; returning null");
return null;
}
BufferedImage stripIm;
if ((stripIm = loadImage(fnm)) == null) {
System.out.println("Returning null");
return null;
}
int imWidth = (int) stripIm.getWidth() / number;
int height = stripIm.getHeight();
int transparency = stripIm.getColorModel().getTransparency();
BufferedImage[] strip = new BufferedImage[number];
Graphics2D stripGC;
// each BufferedImage from the strip file is stored in strip[]
for (int i = 0; i < number; i++) {
strip[i] = gc.createCompatibleImage(imWidth, height, transparency);
// create a graphics context
stripGC = strip[i].createGraphics();
// stripGC.setComposite(AlphaComposite.Src);
// copy image
stripGC.drawImage(stripIm, 0, 0, imWidth, height, i * imWidth, 0,
(i * imWidth) + imWidth, height, null);
stripGC.dispose();
}
return strip;
} // end of loadStripImageArray() |
27d61cc1-945e-41db-9c63-9728a03e3329 | 6 | private void superPlacing(List <Segment> prior) {
final Tile at = origin() ;
super.doPlace(at, at) ;
final Tile o = origin() ;
final World world = o.world ;
for (int i : N_ADJACENT) {
final Tile n = world.tileAt(o.x + (N_X[i] * 2), o.y + (N_Y[i] * 2)) ;
if (n == null) continue ;
if (n.owner() != null && n.owner().getClass() == this.getClass()) {
final Segment s = (Segment) n.owner() ;
if (prior != null && prior.includes(s)) continue ;
s.refreshFromNear(prior) ;
}
}
} |
e5801349-1587-4e9d-acd8-47234defb553 | 5 | public List<String> getStringList(String path) {
List<?> list = getList(path);
if (list == null) {
return new ArrayList<String>(0);
}
List<String> result = new ArrayList<String>();
for (Object object : list) {
if ((object instanceof String) || (isPrimitiveWrapper(object))) {
result.add(String.valueOf(object));
}
}
return result;
} |
ab18ab75-169a-4cdd-80db-c676c6960b27 | 4 | @EventHandler
private void hit(ProjectileHitEvent evt) {
if (evt.getEntity() instanceof Arrow && ids.contains(evt.getEntity().getEntityId())) {
ids.remove(evt.getEntity().getEntityId());
Location l = evt.getEntity().getLocation();
try {
SpellCraft.fep.playFirework(l.getWorld(), l,
FireworkEffect.builder().withColor(Color.RED, Color.ORANGE, Color.YELLOW).build());
evt.getEntity().getLocation().getWorld().createExplosion(l.getBlockX(), l.getBlockY(), l.getBlockZ(), 1.8F, false, false);
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
evt.getEntity().remove();
}
} |
296521c0-aeb5-47c6-8ea4-a043c7a5db98 | 3 | private void InstanceComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_InstanceComboBoxActionPerformed
try {
if (InstanceComboBox.getSelectedItem().toString().equals("<None>")) {
//Display 'no pack selected' content
loadPaneContentFromResourceImage("nopack.png", ModpackDescriptionPane);
ModpackList.setSelectedIndex(-1);
} else {
//Load pack description content
String selectedInstance = InstanceComboBox.getSelectedItem().toString();
try {
JSONObject instanceConfig = Util.readJSONFile("./users/" + getFriendlyName(Auth.AccountName) + "/" + selectedInstance + "/instance.json");
ModpackList.setSelectedValue(instanceConfig.get("pack").toString(), true);
loadPaneContentFromDirectory("./packs/" + instanceConfig.get("pack").toString(), ModpackDescriptionPane);
} catch (IOException ex) {
//Load 'no description' content if content loading fails
loadPaneContentFromResourceImage("nodesc.png", ModpackDescriptionPane);
}
}
} catch (Exception ex) { }
}//GEN-LAST:event_InstanceComboBoxActionPerformed |
4cbf6dae-87e7-4c2e-a021-2e50104a6567 | 2 | public static <T extends DC> Similarity getPhiSim(Set<Pair<Pair<T,PT<Integer>>,Pair<T,PT<Integer>>>> done)
{ if(done!=null)
{ if(done.getNext()!=null)
{ return new Similarity(done.getFst().fst().fst().delta(done.getFst().snd().fst()).simi().getValue()+(getPhiSim(done.getNext()).getValue()));
}
else
{ return new Similarity(done.getFst().fst().fst().delta(done.getFst().snd().fst()).simi().getValue());
}
}
else
{ return new Similarity(0.0);}
} |
9904d187-b2b5-467a-a08c-2c72edc527b3 | 1 | public Options() {
pane = this.getContentPane();
pane.setLayout(null);
this.setTitle(TITLE);
this.setResizable(false);
this.setSize(WIDTH, HEIGHT);
this.setLocationRelativeTo(MainFrame.getThis());
this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
this.setModal(true);
JLabel
themeLabel = new JLabel("Theme:");
themeLabel.setFont(Program.displayFont);
themeLabel.setBounds(5, 5, 100, 25);
themeLabel.setVerticalAlignment(SwingConstants.CENTER);
this.add(themeLabel);
themeSelect = new JComboBox<String>(new Vector<String>(Assets.themes.keySet()));
themeSelect.setSelectedItem(theme);
themeSelect.setFont(Program.displayFont);
themeSelect.setBounds(110, 5, 200, 25);
this.add(themeSelect);
JLabel
difficultyLabel = new JLabel("Difficulty:");
difficultyLabel.setFont(Program.displayFont);
difficultyLabel.setBounds(5, 40, 100, 25);
difficultyLabel.setVerticalAlignment(SwingConstants.CENTER);
this.add(difficultyLabel);
difficultySelect = new JComboBox<String>();
for (Difficulty level : Difficulty.values()) {
difficultySelect.addItem(level.name());
}
difficultySelect.setSelectedItem(difficulty.name());
difficultySelect.setFont(Program.displayFont);
difficultySelect.setBounds(110, 40, 200, 25);
this.add(difficultySelect);
multipleLivesCheck = new JCheckBox("Multiple Lives", multipleLives);
multipleLivesCheck.setFont(Program.displayFont);
multipleLivesCheck.setBounds(5, 75, 300, 25);
multipleLivesCheck.setVerticalAlignment(SwingConstants.CENTER);
this.add(multipleLivesCheck);
Ok = new JButton("Ok");
Ok.setBounds(5, HEIGHT - 68, (WIDTH - 20) / 2, 30);
Ok.setMnemonic(KeyEvent.VK_O);
Ok.setFont(Program.displayFont);
Ok.addActionListener(this);
pane.add(Ok);
Cancel = new JButton("Cancel");
Cancel.setBounds(10 + ((WIDTH - 20) / 2), HEIGHT - 68, (WIDTH - 20) / 2, 30);
Cancel.setMnemonic(KeyEvent.VK_C);
Cancel.setFont(Program.displayFont);
Cancel.addActionListener(this);
pane.add(Cancel);
this.setVisible(true);
} |
5ac96fe9-30f2-4a14-b33d-cedd23382cf0 | 0 | public void destroy() {
textArea = null;
} |
24be0744-1a1a-409f-b39e-9ae55ddb1e56 | 3 | public void buildBuilding(Building b, int x, int y) {
if (x >= 0 && y >= 0) {
// check player's gold!
if (buildings[x][y] == null) {
buildings[x][y] = b;
}
} else {
throw new IllegalArgumentException("Field position must be positive");
}
} |
5549def1-f868-46b6-ab52-b52b36b9030d | 5 | public void testEmptyClass () {
MethodAccess access = MethodAccess.get(EmptyClass.class);
try {
access.getIndex("name");
fail();
} catch (IllegalArgumentException expected) {
// expected.printStackTrace();
}
try {
access.getIndex("name", String.class);
fail();
} catch (IllegalArgumentException expected) {
// expected.printStackTrace();
}
try {
access.invoke(new EmptyClass(), "meow", "moo");
fail();
} catch (IllegalArgumentException expected) {
// expected.printStackTrace();
}
try {
access.invoke(new EmptyClass(), 0);
fail();
} catch (IllegalArgumentException expected) {
// expected.printStackTrace();
}
try {
access.invoke(new EmptyClass(), 0, "moo");
fail();
} catch (IllegalArgumentException expected) {
// expected.printStackTrace();
}
} |
f073a595-8b70-4c57-8434-7a655e51b211 | 7 | @SuppressWarnings("deprecation")
private void printStackTraceSync(Throwable t, boolean expected)
{
BukkitScheduler bs = plugin.getServer().getScheduler();
try
{
String prefix = "[AutoUpdate] ";
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
t.printStackTrace(pw);
String[] sts = sw.toString().replace("\r", "").split("\n");
String[] out;
if(expected)
out = new String[sts.length+25];
else
out = new String[sts.length+27];
out[0] = prefix;
out[1] = prefix+"Internal error!";
out[2] = prefix+"If this bug hasn't been reported please open a ticket at http://forums.bukkit.org/threads/autoupdate-update-your-plugins.84421/";
out[3] = prefix+"Include the following into your bug report:";
out[4] = prefix+" ======= SNIP HERE =======";
int i = 5;
for(; i-5 < sts.length; i++)
out[i] = prefix+sts[i-5];
out[++i] = prefix+" ======= DUMP =======";
out[++i] = prefix+"version : "+version;
out[++i] = prefix+"delay : "+delay;
out[++i] = prefix+"bukkitdevSlug : "+bukkitdevSlug;
out[++i] = prefix+"COLOR_INFO : "+COLOR_INFO.name();
out[++i] = prefix+"COLO_OK : "+COLOR_OK.name();
out[++i] = prefix+"COLOR_ERROR : "+COLOR_ERROR.name();
out[++i] = prefix+"pid : "+pid;
out[++i] = prefix+"av : "+av;
out[++i] = prefix+"config : "+config;
out[++i] = prefix+"lock : "+lock.get();
out[++i] = prefix+"needUpdate : "+needUpdate;
out[++i] = prefix+"updatePending : "+updatePending;
out[++i] = prefix+"UpdateUrl : "+updateURL;
out[++i] = prefix+"updateVersion : "+updateVersion;
out[++i] = prefix+"pluginURL : "+pluginURL;
out[++i] = prefix+"type : "+type;
out[++i] = prefix+" ======= SNIP HERE =======";
out[++i] = prefix;
if(!expected)
{
out[++i] = prefix+"DISABLING UPDATER!";
out[++i] = prefix;
}
bs.scheduleSyncDelayedTask(plugin, new SyncMessageDelayer(null, out));
}
catch(Throwable e) //This prevents endless loops.
{
e.printStackTrace();
}
if(!expected)
{
bs.cancelTask(pid);
bs.scheduleAsyncDelayedTask(plugin, new Runnable()
{
public void run()
{
while(!lock.compareAndSet(false, true))
{
try
{
Thread.sleep(1L);
}
catch(InterruptedException e)
{
}
}
pid = -1;
config = null;
needUpdate = updatePending = enabled = false;
updateURL = updateVersion = pluginURL = type = null;
lock.set(false);
}
});
}
} |
0db60b76-c4c6-42f5-943f-e28705fae642 | 1 | public static int getPortFileTransfer(String inString)
throws JDOMException, IOException, TagFormatException {
SAXBuilder mSAXBuilder = new SAXBuilder();
Document mDocument = mSAXBuilder.build(new StringReader(inString));
Element rootNode = mDocument.getRootElement();
String protType = rootNode.getName();
if (protType.equals(Tags.FILE_REQ_ACK)) {
return Integer.parseInt(rootNode.getChildText(Tags.PORT));
} else {
TagFormatException tfe = new TagFormatException(
"It's not a acknowledgement file protocol");
throw tfe;
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.