text stringlengths 14 410k | label int32 0 9 |
|---|---|
public int randomMod(int k) {
if (k < 0)
throw new IllegalArgumentException("negative modulus");
return (int) (nextUnsignedLong() % k);
} | 1 |
private List<Set<Integer>> enlargeAggregates(List<Set<Integer>> C,
List<Set<Integer>> N, boolean[] R) {
// Contains the aggregates each node is coupled to
List<List<Integer>> belong = new ArrayList<List<Integer>>(R.length);
for (int i = 0; i < R.length; ++i)
... | 9 |
protected void initSpecialParameters() throws MaltChainedException {
if (getConfiguration().getOptionValue("singlemalt", "null_value") != null && getConfiguration().getOptionValue("singlemalt", "null_value").toString().equalsIgnoreCase("none")) {
excludeNullValues = true;
} else {
excludeNullValues = false;
... | 9 |
public static void main(String[] args) {
System.out.println("- - Multibox - -");
Integer nbrProductor = 0;
Integer nbrConsumer = 0;
try{
nbrProductor = Integer.parseInt(args[0]); // cast
nbrConsumer = Integer.parseInt(args[1]); // cast
}catch (ArrayIndex... | 6 |
public void kaynnista() throws Exception {
tulostaAloitusTekstit();
while (true) {
int valinta = Integer.parseInt(lukija.nextLine());
if (valinta == 1) {
luoUusiPeli();
break;
} else if (valinta == 2) {
avaaTallennettuP... | 8 |
private static void prepare(){
if (!SystemUtil.getModulesDirectory().exists()) SystemUtil.getModulesDirectory().mkdirs();
WebLookAndFeel feel = new WebLookAndFeel();
try {
UIManager.setLookAndFeel(feel);
} catch (UnsupportedLookAndFeelException e) {
DebugUtils.error(e.getMessage());
e.printStackTrace()... | 2 |
public PumbTransaction parsePumbSms(String msg) {
Matcher m = transactionSmsPattern.matcher(msg);
if (m.find()) {
// for (int i = 0; i <= m.groupCount(); i++) {
// System.out.println("group " + i + " " + m.group(i));
// }
PumbTransaction pumbTransaction ... | 9 |
public ImageIcon createLargeImage(double[][] vectors)
{
BufferedImage neuronImage = neuronImage = new BufferedImage(402, 81, BufferedImage.TYPE_INT_RGB);
for (int j = 0;j<vectors.length;j++)
{
double[] vector = vectors[j];
int firstX = 0, firstY = 0;
if (... | 6 |
private void queryDb(ActionEvent event) {
String query = hqlQuery.getText();
String[] meta;
java.util.List<String[]> data = new ArrayList<String[]>();
try {
SQLResultInterface res = mdi.executeHqlQuery(query, c_deref.isSelected());
if (res == null)
return;
List<String> header = res.getHeader();
... | 6 |
final void method2654(int i, OggPacket oggpacket) {
anInt9943++;
if ((anInt7234 ^ 0xffffffff) <= -4) {
if ((aVorbisBlock9951.synthesis(oggpacket) ^ 0xffffffff) == -1) {
aDSPState9935.blockIn(aVorbisBlock9951);
}
float[][] fs = aDSPState9935.pcmOut(aVorbisInfo9931.channels);
aDouble9949 = aDSPState99... | 9 |
private void nodeId(String s,int t) {
nextToken("error occurred in node_id");
if (m_st.ttype == '}') {
//creates a node if t is zero
if (t == 0) {
m_nodes.addElement(new InfoObject(s));
}
m_st.pushBack();
}
else if (m_st.ttype == '-') {
nextToken("error occurred chec... | 8 |
public void savePossibleTreasure() throws IOException
{
numberOfTreasures = possibleTreasures.size();
FileOutputStream fos = new FileOutputStream(TreasureHunt.getInstance().getDataFolder() + "/numberOfTreasures.xml");
if(fos == null) return;
ObjectOutputStream oos = new ObjectOutputStream(... | 4 |
public static GameStage getFrom(String args) {
switch (args.toLowerCase()) {
case "waiting":
return GameStage.Waiting;
case "lobby":
return GameStage.Lobby;
case "pregame":
return GameStage.PreGame;
case "ingame":
return GameStage.I... | 4 |
public boolean update() {
response = null;
--remainingTime;
if(remainingTime <= 0) {
response = "Removing timer, " + Stopwatch.timeToString(baseTime) + " has elapsed";
return false;
}
if(period != 0 && Stopwatch.dv(remainingTime, period) == 0)
... | 3 |
public boolean equals(Object o) {
if (o == this)
return true;
if (o instanceof IntegerType) {
IntegerType other = (IntegerType) o;
return other.possTypes == possTypes && other.hintTypes == hintTypes;
}
return false;
} | 3 |
@EventHandler(priority = EventPriority.HIGHEST)
public void onPlayerInteract(PlayerInteractEvent event) {
Player player = event.getPlayer();
// make sure the player is vanished before we do anything
if(!isVanished(player)) {
return;
}
// deal with right click
if(event.getAction() == Action.RIGHT_CLIC... | 6 |
@Override
public final String generateHtmlCode() {
final StringBuilder sb = new StringBuilder();
sb.append("<!-- TableHelper Generated Code -->\n");
sb.append("<table " + "cellpadding=\"0\" cellspacing=\"0\" " + "id=\""
+ this.tableHtmlId + "\" " + "class=\"" + this.tableHtmlClass
+ "\">\n");
if (th... | 6 |
public String tryInviteNewMember(String account, int cid) { // needs dao's isMember & isInviting
int user = this.userDao.findUidByAccount(account);
// if that guy already existed in the club's member list
for (int existedMember : this.userDao.clubMembersUid(cid)) {
if (user == existedMember)
return "member... | 8 |
public void playFade() throws InterruptedException{
try
{
in = new FileInputStream(fade);
as = new AudioStream(in);
ap.player.start(as);
}
catch(Exception e)
{
System.out.println("Got an IOException: " + e.getMessage());
e.printStackTrace();
}... | 1 |
public static void main(String[] args) throws IOException, NoSuchAlgorithmException {
String baseDir = args[0];//"C:\\Users\\Playtech\\New Folder\\gc\\hl";
String outFile = args[1];//"C:\\Users\\Playtech\\New Folder\\gc\\hl\\texts.dump";
Path base = Paths.get(baseDir);
List<HomelandStrin... | 8 |
public static void main(String[] args) throws IOException, ClassNotFoundException {
SerialCtl sc = new SerialCtl("Test1", "Test2");
System.out.println("Before write \n" + sc);
ByteArrayOutputStream buf = new ByteArrayOutputStream();
ObjectOutput out = new ObjectOutputStream(buf);
... | 0 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Address address = (Address) o;
return abonentId == address.abonentId;
} | 3 |
public static String fetchURLPost(final String u, String parameters) {
String returnedString = "";
try {
final URL url = new URL(u);
HttpURLConnection connection = (HttpURLConnection) url
.openConnection();
connection.setDoOutput(true);
connection.setRequestMethod("POST");
OutputStreamWriter wri... | 4 |
@Override
public void run() {
try {
// Eclipse doesn't support System.console()
BufferedReader console = new BufferedReader(new InputStreamReader(System.in));
ConfigManager config = NetBase.theNetBase().config();
String targetIP = config.getProperty("net.server.ip");
if ( targetIP == null ) {
... | 9 |
private void rotate()
{
//orient++;
if (orient%4==0)
{
litPositions=new int[][] {{0,0,0,0},
{0,0,0,0},
{1,1,1,1},
{0,0,0,0}};
}
if (orient%4==1)
{
litPositions=new int[][] {{0,1,0,0},
{0,1,0,0},
{0,1,0,0},
{0... | 4 |
public static void acceptTradeRequest(Player player, String partner) {
Player target = Bukkit.getPlayer(partner.toLowerCase());
if (target != null && target.isOnline()) {
TradeRequest tr = Storage.getTradeRequest("target", player.getUniqueId().toString());
float balance = BankManager.getBalance(player);
... | 4 |
public void initializeId() {
String hashSequence = "";
for (DeployedComponent dc : deployedComponents)
hashSequence += dc.getId();
id = Utils.getHash(hashSequence);
} | 1 |
private static User getUserById(Integer id){
Element rootElement = dom.getDocumentElement();
NodeList nodeList = rootElement.getElementsByTagName("user");
if(nodeList != null && nodeList.getLength()>0) {
for(int i=0; i<nodeList.getLength();i++){
Element element = (Ele... | 5 |
@Override
public void draw(Graphics2D g) {
g.drawImage(img.getSubimage(0, 0, 100, 108), GamePanel.WIDTH/2 - 150/2, GamePanel.HEIGHT/2 - 75/2 ,null);
int time = lantern.burnTime/20;
int minutes = time/60;
int seconds = time%60;
String sec = seconds < 10 ? "0"+seconds : ""+seconds;
g.drawString(minutes+":... | 8 |
private void doDrawing(Graphics g) {
Graphics2D g2d = (Graphics2D) g;
g2d.setColor(Color.black);
Dimension size = getSize();
Insets insets = getInsets();
int w = size.width - insets.left - insets.right;
int h = size.height - insets.top - insets.bottom;
/* Фоку... | 6 |
public Teacher(){
super("N/A");
} | 0 |
private void cancel() {
hide();
} | 0 |
@Override
public void performStep() {
if(checkIfTargetNearby())
return;
turnRight();
if (!goForward()) { // can go right?
turnLeft();
if (!goForward()) { // can go straight?
turnLeft();
if (!goForward()) { // what about left?
turnLeft();
goForward(); // OK, dead end
}
}
}
} | 4 |
@Before
public void setUp() {
calendarUsers = new CalendarUser[numInitialNumUsers];
events = new Event[numInitialNumEvents];
eventAttendees = new EventAttendee[numInitialNumEventAttendees];
this.calendarUserDao.deleteAll();
this.eventDao.deleteAll();
this.eventAttendeeDao.deleteAll();
for (int i = ... | 7 |
@Override
public double getPrecision(String classValue)
throws IllegalArgumentException {
if( classValue == null)
throw new IllegalArgumentException("Error: null class value");
if( this.valueToIndex.get(classValue) == null)
throw new IllegalArgumentException("Error: state = " + classValue + " didn't fo... | 8 |
public static double norm_rmse(double[] obs, double[] sim, double missing) {
double sum = 0, size = 0;
for (int i = 0; i < obs.length; i++) {
if (obs[i] > missing) {
sum += obs[i];
size++;
}
}
double measuredMean = sum / size;
... | 5 |
public void dumpCode(java.io.PrintWriter output) {
for (Iterator iter = instructions.iterator(); iter.hasNext();) {
Instruction instr = (Instruction) iter.next();
output.println(instr.getDescription() + " "
+ Integer.toHexString(hashCode()));
Instruction[] succs = instr.getSuccs();
if (succs != null)... | 6 |
@SuppressWarnings("unchecked")
public String getTeamMatchTable() {
PreparedStatement st = null;
ResultSet rs = null;
JSONArray json = new JSONArray();
try {
conn = dbconn.getConnection();
st = conn.prepareStatement("SELECT m.id, m.event_id, e.name, m.match_num... | 3 |
public void train() {
Arrays.fill(theta, 0.0);
theta0 = 0.0;
double error = getCEError();
double deltaEta = DELTA_ETA;
if(lambda >= 100) {
deltaEta /= lambda;
}
while(true) {
double[] delta = new double[trainSet.nFeatures];
double delta0 = 0.0;
for(int i = 0; i < trainSet.m; i++) ... | 8 |
public void onRender(GameContainer gc, Graphics g, StateBasedGame game){
float scale = 1;
float mouseX = gc.getInput().getMouseX();
float mouseY = gc.getInput().getMouseY();
boolean scaled = false;
if(mouseX >= x && mouseX <= x + levelWidth && mouseY >= y && mouseY <= y+levelHeight && !c.equals(levelLocked)){... | 9 |
@Override
public Vector normalize() {
double length = 0;
for (int i = 0; i < getFieldsNumber() - 1; i++) {
try {
length += (getElementAt(i + 1) * getElementAt(i + 1));
} catch (OutOfBoundsException e) {
// Też nie ma prawa się wydarzyć
e.printStackTrace();
}
}
Math.sqrt(length);
length ... | 4 |
public void saveText(String conversation, boolean appendToEnd)
{
String fileName = "/Users/jhaf4009/Documents/saved text.txt";
PrintWriter outputWriter;
if(appendToEnd)
{
try
{
outputWriter = new PrintWriter(new BufferedWriter(new FileWriter(fileName, appendToEnd)));
outputWriter.append(con... | 4 |
public SelfManaged() {
t.start();
} | 0 |
public void setKind(String kind){
this.kind = kind;
} | 0 |
@Override
public void run() {
long lastTime = System.nanoTime();
double nsPerTick = 1000000000.0 / TICKS_PER_SECOND;
double unprocessed = 0;
int ticks = 0;
int frames = 0;
long lastTimer1 = System.currentTimeMillis();
init();
while (running) {
long now = System.nanoTime();
unprocessed += (... | 4 |
public void showFilePopupMenu(JButton fileOperations, boolean layoutsaving) {
JPopupMenu menu = new JPopupMenu();
JMenuItem item = new JMenuItem("Export Graph As JPEG");
item.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
JFil... | 8 |
private void reflectInvokeMethod(Object invokeVictim, Method method,
String[] args) throws Exception
{
Class[] parameterTypes = method.getParameterTypes();
Object[] conformingArguments = new Object[parameterTypes.length];
if (args.length < parameterTypes.length) {
th... | 6 |
private void acceptButtonInsertActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_acceptButtonInsertActionPerformed
boolean error = false;
String errorString = "";
Object[] what = new Object[7];
what[0] = enabledConnectionInsert.isSelected();
if (!userDataInsert.g... | 8 |
public static JavaArchive getRuntimeArchive() {
for (File jarFile : FileUtils.listFiles(new File(
System.getProperty("java.home")), new String[] {"jar"}, true)) {
String jarFileName = jarFile.getName();
if (jarFileName.equals("rt.jar") || jarFileName.equals("classes.jar"))
try {
return new JavaArch... | 4 |
public void makePots() {
while (notZero(bets)) {
int min = bets[0];
for (int i = 1; i < bets.length; i++) {
if (min == 0 || (bets[i] < min && bets[i] != 0)) {
min = bets[i];
}
}
ArrayList<Integer> elig = new Arra... | 7 |
public void setPrecio(double precio) {
this.precio = precio;
} | 0 |
private Arc pairToArc( Pair p, HashMap<Pair,Arc> pnts,
HashMap<Pair,Arc> kids )
{
nArcs++;
char[] pData = (p.isChild()||p.isHint())?null:p.getChars();
Arc a = new Arc( cloneVersions(p.versions), pData );
if ( p.isChild() )
{
// we're a child - find our parent
Pair parent = p.getParent();
Arc b = ... | 9 |
public static List<Point> listify(int[] points, int width) {
List<Point> list = new ArrayList<Point>();
int x, y;
for (int i = 0; i < points.length; i++) {
x = points[i] % width;
y = points[i] / width;
list.add(new Point(x, y));
}
return list;
} | 1 |
public void printRecord (String rec,JFrame JFMainParent) {
StringReader SRReader = new StringReader (rec);
LineNumberReader LNRReader = new LineNumberReader (SRReader);
Font typeface = new Font ("Courier New", Font.PLAIN,10);
PrintJob PJPrint = Toolkit.getDefaultToolkit().getPrintJob (JFMainParent, "", new Pro... | 9 |
public static void internalBuildGeneratedFileFrom(
final String[] descriptorDataParts,
final FileDescriptor[] dependencies,
final InternalDescriptorAssigner descriptorAssigner) {
// Hack: We can't embed a raw byte array inside generated Java code
// (at least, not efficiently), bu... | 6 |
private void atomicSaveFile(InputStream is, String fullPath, long fileSize,
long lastModifiedTime, boolean isDir, TextProcessor textProcessor) throws Exception {
DropboxFileUtil util = new DropboxFileUtil(this.rootDirAddr);
String relativePath = util.getFileRelativePath(... | 5 |
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://down... | 6 |
public String getLabel() {
if (label == null)
label = "flow_" + addr + "_" + (serialno++) + "_";
return label;
} | 1 |
public static void reverse(int[] arr, int from, int to){
int iters=0;
if(from>to){
iters=((arr.length-from)+to+1)/2;
} else {
iters=(to-from+1)/2;
}
while(iters>0){
swap(arr,from,to);
iters--;
if(++from>=arr.length){ from=0; }
if(--to<0){ to=arr.length-1; }
}
} | 4 |
public void applyMove(int player, Move m)
{
if (m != null) {
if (player==0)
m.sortDescend();
else
m.sortAscend();
Iterator iter = m.getAtomicMoves();
try {
while (iter.hasNext()) {
AtomicMove am = (AtomicMove) iter.next();
if (verbose) {
out_stream.println("Agent"+ player... | 5 |
private void loop() throws Exception {
buffer = new FrameBuffer(800, 600, FrameBuffer.SAMPLINGMODE_NORMAL);
buffer.disableRenderer(IRenderer.RENDERER_SOFTWARE);
buffer.enableRenderer(IRenderer.RENDERER_OPENGL);
while (!org.lwjgl.opengl.Display.isCloseRequested()) {
box.rotateY(0.01f);
buffer.clear(java.a... | 1 |
private static void Quicksortusinglastpivot(int l, int k) {
// TODO Auto-generated method stub
if(l==k){
return;
}
if (k>l){
int i=l+1; // startelement
int j=l+1; //
int temp;
temp = array[l];
array[l] = array[k];
array[k]=temp;
int pivot = 0;
pivot = array[l];
for(j=l+1;j<k+1... | 4 |
@Override
public boolean equals(Object o) {
if (o == null) {
return false;
}
if (o.getClass() != this.getClass()) {
return false;
}
Project pr = (Project) o;
if (pr.projectId != this.projectId) {
return false;
}
if (... | 7 |
@Override
public void run() {
for (String lst : testList){
if (lst.equals(x)) {
System.err.println("Duplicate found " + testList.size());
}
}
} | 2 |
public double applyMinMaxRescaleCast(double prediction) throws Exception {
if (m_optype != Optype.CONTINUOUS) {
throw new Exception("[TargetMetaInfo] target must be continuous!");
}
if (!Utils.isMissingValue(m_min) && prediction < m_min) {
prediction = m_min;
}
if (!Utils.isMissingValue... | 9 |
public int aktuelleWertung() {
int wert, anzahl;
boolean istAss;
wert = 0;
istAss = false;
anzahl = getAnzahlKarten();
Karte karte;
int kartenWert;
// wir durchlaufen unseren aktuellen Kartenstapel
for (int i=0; i < anzahl; i++) {
karte = ge... | 5 |
@Override
public void actionPerformed(ActionEvent e) {
if (e.getSource() == viewBarChartButton) {
BarChartSales demo = new BarChartSales("Sales History", account.getFirstquarter2014(),
account.getSecondquarter2014(), account.getThirdquarter2014(), account
.getFourthquarter2014(), account.getFirstquar... | 3 |
private static String[] getDefaultFontSearchPath()
{
String osName = null;
try {
osName = System.getProperty("os.name");
} catch (SecurityException e) {
// preserve null osName
}
if (osName == null) {
// Makes it a bit tricky to figure out... | 9 |
public void setPolicy(PolicyType value) {
this.policy = value;
} | 0 |
public ChampionSelect (Container mainPanel) {
SelectListener selectListener = new SelectListener();
HoverListener hoverListener = new HoverListener();
Dimension spacer = new Dimension (0, 12);
Box allyPositions = new Box (BoxLayout.PAGE_AXIS);
allyPositions.setBorder (new EmptyBorder (0, 6, 6, 6));
a... | 4 |
private void showStock(List<StockItem> stock) {
System.out.println("-------------------------");
for (StockItem si : stock) {
System.out.println(si.getId() + " "
+ si.getName() + " "
+ si.getPrice() + "Euro ("
+ si.getQuantity() + " items)");
}
if (stock.size() == 0) {
System.out.println("\... | 2 |
private void whitePawnMove(Point currentPoint, Piece currentPiece) {
addToMovesLocal(currentPoint, currentPiece);
if (((int) currentPoint.getY() == 6 && currentPiece.getColor())) {
whitePawnMoveFirst(currentPoint, currentPiece);
}
Point targetPoint = pieceMove(currentPoint, 0, -1);
if (isOpen(targetPoint))... | 5 |
public void setBaud(int baud) throws ChannelException {
try {
port.setSerialPortParams(
baud,
SerialPort.DATABITS_8,
SerialPort.STOPBITS_1,
SerialPort.PARITY_NONE);
}
catch (Exception ex) {
throw new Chann... | 1 |
public Money execute() throws IOException {
Currency currency;
Number amount = null;
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
boolean gotCorrect = false;
while(!gotCorrect){
try{
System.out.println("Introduzca una c... | 2 |
@Override
public void run() {
while (isAlive) {
try {
launch();
if (enemy_Launcher.alive() && this.isAlive) {
fly();
}
synchronized (this) {
wait();
}
} catch (InterruptedException e) {
}
}
} | 4 |
protected JsonType getType(Object object) {
if (object == null) return JsonType.NULL;
if (object instanceof String) return JsonType.STRING;
if (object instanceof Number) return JsonType.NUMBER;
if (object instanceof Boolean) return JsonType.BOOLEAN;
if (object instanceof Collecti... | 7 |
@Override
public void putChar(char c) throws ParsingException {
switch (c) {
case Characters.SPACE:
context.putSpace();
break;
case Characters.SEPARATOR:
context.putSeparator();
break;
case Characters.END:
context.putEnd();
break;
case Characters.PARAMETER:
context.putParameter();
bre... | 7 |
public static double normalizeLongitude(double longitude) {
if (Double.isNaN(longitude) || Double.isInfinite(longitude))
return Double.NaN;
double longitudeResult = longitude % 360;
if (longitudeResult > 180) {
double diff = longitudeResult - 180;
longitudeResult = -180 + diff;
} else if (longitudeResu... | 4 |
public synchronized boolean cancelReservation(ReservationMessage message) {
ServerReservation sRes = null;
int resId = message.getReservationID();
String msg = "Reservation # " + resId + " cannot be cancelled ";
if(!reservTable.containsKey(resId)
&& !expiryTable.containsKey(resId)) {
logger.info(msg +... | 4 |
@Override
public boolean hasNext() {
int available = 0;
try {
available = logFileStream.available();
} catch (IOException e) {
logger.error("Fail to access log file and try to close stream, log file path: " + currentFileName, e);
try {
logF... | 4 |
@Override
public void setName(String name) {
this.name = name;
} | 0 |
public static float getFloat(byte[] b, int offset) {
if (isBlank(b)) {
throw new IllegalArgumentException("blank byte array.");
}
if (offset < 0) {
throw new IllegalArgumentException("invalid array offset:" + offset + ".");
}
int out = b[0] < 0 ? -1 : 0;
for (int l = b.length - offset, i = l < FLOAT_B... | 5 |
public boolean containsKey(Object key) {
return this.map.containsKey(key);
} | 0 |
@Override
public String toString() {
return "info.toegepaste.www.entity.Lid[ id=" + id + " ]";
} | 0 |
public void writeTimes() {
Path path = Paths.get("Sudoku Saves\\BestTimes");
ArrayList<String> stringList = new ArrayList();
try {
Files.delete(path);
} catch (IOException x) {
System.out.print("ERROR: " + x.getMessage());
}
if (!stringList.isEmpt... | 4 |
public void setDirection(Direction direction)
{
if ((this.direction == Direction.Up && direction != Direction.Down) ||
(this.direction == Direction.Down && direction != Direction.Up) ||
(this.direction == Direction.Left && direction != Direction.Right) ||
(this.direction ... | 8 |
private String romC(int c) {
switch (c) {
case 1: return "C";
case 2: return "CC";
case 3: return "CCC";
case 4: return "CD";
case 5: return "D";
case 6: return "DC";
case 7: return "DCC";
case 8: return "DCCC";
case 9: return "CM";
default:return "";
}
} | 9 |
protected void move() {
setNaam("mcAwesome");
PApplet app = getApp();
ellapsed++;
if(ellapsed>60){
lastPosY = getEnemyYPos();
lastPosX = getEnemyXPos();
ox = getEnemyXPos();
oy = getEnemyYPos();
ellapsed = 0;
} else {
float movedX = (getEnemyXPos()/ellapsed)-lastPosX;
float movedY = (getE... | 7 |
void shiftPc(int where, int gapLength, boolean exclusive) {
int n = tableLength();
for (int i = 0; i < n; ++i) {
int pos = i * 10 + 2;
int pc = ByteArray.readU16bit(info, pos);
int len = ByteArray.readU16bit(info, pos + 2);
/* if pc == 0, then the local v... | 6 |
public Teams getWinner() {
if(this.getScore_res_score_home()>this.getScore_res_score_away())
return Teams.HOME;
else if(this.getScore_res_score_home()<this.getScore_res_score_away())
return Teams.AWAY;
else
return Teams.ALL;
} | 2 |
public VariableStack mapStackToLocal(VariableStack stack) {
VariableStack newStack;
if (exceptionLocal == null) {
pushedLocal = new LocalInfo();
pushedLocal.setType(exceptionType);
newStack = stack.push(pushedLocal);
} else
newStack = stack;
return super.mapStackToLocal(newStack);
} | 1 |
public void processFiles(
Boolean outputCounts,
Boolean outputDistances,
File directory,
Dictionary dictionary1,
Dictionary dictionary2,
String delimiter,
Boolean audit,
MainFrame mf,
Writer output) {
... | 6 |
public int movingAverageVariablePeriodLookback( int optInMinPeriod,
int optInMaxPeriod,
MAType optInMAType )
{
if( (int)optInMinPeriod == ( Integer.MIN_VALUE ) )
optInMinPeriod = 2;
else if( ((int)optInMinPeriod < 2) || ((int)optInMinPeriod > 100000) )
return -1;
if( (... | 6 |
@Override
public StringBuffer getOOXML( String catAxisId, String valAxisId, String serAxisId )
{
StringBuffer cooxml = new StringBuffer();
// chart type: contains chart options and series data
cooxml.append( "<c:ofPieChart>" );
cooxml.append( "\r\n" );
cooxml.append( "<c:ofPieType val=\"" + (ofPie.isPieOfP... | 6 |
public boolean isFinished() {
return (this.cycles >= DURATION);
} | 0 |
public Socket getanonyMousProt(){
Socket manageSocket = null;
try {
manageSocket = new Socket(manageHost,managePort);
BufferedReader br = new BufferedReader(new InputStreamReader(manageSocket.getInputStream()));
Thread.sleep(1000);
String anonymoutProt = null;
while ((anonymoutProt= br.readLine())!=n... | 6 |
public void updateBlocks(){
for(int x = getPoint().getBlockX() - getRadius(); x <= getPoint().getBlockX() + getRadius(); x++){
for(int y = getPoint().getBlockY() - getRadius(); y <= getPoint().getBlockY() + getRadius(); y++){
for(int z = getPoint().getBlockZ() - getRadius(); z <= getPoint().getBlockZ() + getRa... | 4 |
public void actionPerformed( java.awt.event.ActionEvent evt )
{
if ( evt.getActionCommand().equals( Wizard.CANCEL_BUTTON_ACTION_COMMAND ) )
{
cancelButtonPressed() ;
}
else if ( evt.getActionCommand().equals( Wizard.BACK_BUTTON_ACTION_COMMAND ) )
{
backButtonPressed() ;
}
else... | 4 |
protected int waitForNextFrame() {
long current = System.currentTimeMillis();
// handle first frame case
if (lastUpdate == 0) {
lastUpdate = current;
return 1;
}
long elapsed = current - lastUpdate;
int frames = (int)(elapsed / FRAME_RATE) + 1;
... | 2 |
public static void main(String[] args) throws InterruptedException,
TransformerException, IOException {
/*
* Incarca fisierul de config, iar daca citirea fisierului de
* configurare a esuat atunci inchide aplicatia cu mesaj de eroare.
*/
if (Config.load() == false) {
JOptionPane.showMessageDialog(nu... | 4 |
Subsets and Splits
SQL Console for giganticode/java-cmpx-v1
The query retrieves a limited number of text entries within a specific length range, providing basic filtering but minimal analytical insight.