text stringlengths 14 410k | label int32 0 9 |
|---|---|
@Override
public void paint(Graphics2D g2, boolean tmp) {
// TODO Auto-generated method stub
int diffX = sx - ex;
int diffY = sy - ey;
int tempx = ex;
int tempy = ey;
if (tmp == false) {
// float[] dash = { 10, 2 };
g2.setStroke(new BasicStroke(1, BasicStroke.CAP_SQUARE,
BasicStroke.JOIN_MITER, ... | 5 |
public MainWindow() {
//basic window configuration
super();
super.setSize(WINDOW_WIDTH, WINDOW_HEIGHT);
super.setLocationRelativeTo(null);
super.setTitle(WINDOW_TITLE);
super.setResizable(false);
super.setUndecorated(false);
//changing L&F
try {
... | 4 |
@Test
public void random_test() {
try{
double []mat= {1.0,2.0,3.0,1.0};
int m=4;
double[]result = Vector.random(m);
double exp[]={1.0,2.0,3.0,1.0};
Assert.assertNotSame(exp, result);
}
catch (Exception e) {
// TODO Auto-generated catch block
fail("Not yet implemented");
}
} | 1 |
public void getFps() {
delta = getTime() - currentTime;
currentTime = getTime();
lastLoopTime += delta;
fps++;
if(lastLoopTime >= 1000) {
screen.updateHeader();
fps = 0;
lastLoopTime = 0;
/*if(debug) {
System.out.println("Load Time: " + loadTime + "ms\nDraw Time: " + Screen.drawTime + "ms\nAct... | 1 |
public void process() {
for (int j = 0; j < globalObjects.size(); j++) {
if (globalObjects.get(j) != null) {
Objects o = globalObjects.get(j);
if(o.objectTicks > 0) {
o.objectTicks--;
}
if (o.objectTicks == 1) {
Objects deleteObject = objectExists(o.getObjectX(), o.getObjectY(), o.getObje... | 6 |
public boolean resume() {
if (state == EnumStopWatchState.PAUSE) {
state = EnumStopWatchState.RUNNING;
log.info("resume stopwatch, it's state:" + state + ", elapseTime:"
+ elapseTime);
return true;
}
return false;
} | 1 |
public UserDao getUserDao() {
if (userDao == null)
userDao = new UserDaoImp();
return userDao;
} | 1 |
public void setUserid(String userid) {
this.userid = userid;
} | 0 |
public boolean[] getAction()
{
// this Agent requires observation integrated in advance.
if (mergedObservation[11][13] != 0 || mergedObservation[11][12] != 0 || DangerOfGap())
{
if (isMarioAbleToJump || ( !isMarioOnGround && action[Mario.KEY_JUMP]))
{
... | 7 |
public Point computeSize (int wHint, int hHint, boolean changed) {
checkWidget ();
int count = data.size();
GC gc = new GC (this);
int titleWidth = gc.stringExtent (title).x;
Point valueSize = gc.stringExtent (new Integer(valueMax).toString());
int itemWidth = 0;
for (int i = 0; i < count; i++) {
Objec... | 3 |
@Override
public void statsChanged(PlayerEvent e) {
if(e.getPlayer().isDead())
{
MouseListener[] mlis = this.getMouseListeners();
for(MouseListener m: mlis)
{
this.removeMouseListener(m);
}
}
} | 2 |
public String nextToken() throws JSONException {
char c;
char q;
StringBuffer sb = new StringBuffer();
do {
c = next();
} while (Character.isWhitespace(c));
if (c == '"' || c == '\'') {
q = c;
for (;;) {
c = next();
... | 9 |
public V remove(Object key) {
CachedValue<V> oldVal = cache.remove((K)key);
return (oldVal == null) ? null : oldVal.get();
} | 1 |
public Script[][][] load(AssetManager assets, MapHandler map, String mapName) {
Script[][][] s = new Script[map.getLayer()][map.getX()][map.getY()];
for (Trigger t : triggers) {
if(t.script.startsWith("$Warp:")) {
String[] arg = t.script.split(":");
s[t.layer][t.x][t.y] = new Script((Script) assets.get("... | 4 |
public void animateParticle(Node particle, Shape path) {
PathTransition transition = new PathTransition();
transition.setPath(path);
transition.setNode(particle);
transition.setDuration(Duration.seconds(getRandom()));
transition.setCycleCount(-1);
animations.add(transition);
transition.play();
} | 0 |
public static double[] box_box_p(double ax0, double ay0, double ax1, double ay1, double bx0, double by0, double bx1, double by1){
double[] result = NONE;
double topA = FastMath.min(ay0, ay1);
double botA = FastMath.max(ay0, ay1);
double leftA = FastMath.min(ax0, ax1);
double rightA = FastMath.max(ax0, ax1);
... | 8 |
public void progressEnd()
{
--block;
if (block == 0) {
}
} | 1 |
@Override
public void prepareInternal(int skips, boolean assumeOnSkip) {
if(!assumeOnSkip)
if (metric != null)
twoFrames = EflUtil.runToNextInputFrameForMetricNoLimit(move, metric);
else
twoFrames = EflUtil.runToNextInputFrameNoLimit(move);
while(skips-- > 0) {
curGb.step();
if (metric !=... | 4 |
public boolean[] tallyPieces() throws IOException
{
boolean[] myPieces = new boolean[torrentInfo.piece_hashes.length];
byte[] comparator = new byte[]{ 0, 0, 0, 0,};
byte[] temp = new byte[4];
int i = 0;
for (i = 0; i < torrentInfo.piece_hashes.length; i += 1)
{
raf.seek(i * torrentInfo.piece_length);
... | 4 |
private int jjMoveStringLiteralDfa1_1(long active0){
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
return 1;
}
switch(curChar)
{
case 47:
if ((active0 & 0x80L) != 0L)
return jjStopAtPos(1, 7);
break;
default :
return 2;
... | 3 |
void setItemForeground () {
if (!instance.startup) {
textNode1.setForeground (itemForegroundColor);
imageNode1.setForeground (itemForegroundColor);
}
/* Set the foreground button's color to match the foreground color of the item. */
Color color = itemForegroundColor;
if (color == null) color = textNode1... | 3 |
@Override
public void enumerate(String uid, String connectedUid, char position,
short[] hardwareVersion, short[] firmwareVersion,
int deviceIdentifier, short enumerationType) {
// configure bricks on first connect (ENUMERATION_TYPE_CONNECTED)
// or configure bricks if enumerate was raised externally (ENUME... | 7 |
public void checkCells() {
for (Cell temp : cells) {
if (temp.openValues.size() == 1) {
for (Cell temp1 : jointCell(temp)) {
temp1.removeOpenValues(temp.returnValue());
}
}
}
} | 3 |
public void drawRoad(Road r, boolean highlighted, Graphics2D g2) {
Player player = r.getOwner();
Graphics2D g2c = (Graphics2D) g2.create();
if (player == null) {
if (highlighted)
g2c.setColor(Color.WHITE);
else
return;
}
else {
if (highlighted)
return;
else
g2c.setColor(player.getC... | 6 |
@Test
public void getNextQuestionNumbers() {
for (int i = 1; i < 10; i++) {
assertEquals(i, st.getNextQuestionNumber());
if (i % 2 == 0) {
st.incRightQuestions();
} else {
st.incMistakeQuestions();
}
}
} | 2 |
public void move(int xa, int ya, List<Block> blocks) {
if (xa != 0 && ya != 0) {
move(xa, 0, blocks);
move(0, ya, blocks);
return;
}
if (!collision(xa, ya, blocks)) {
x += xa * speed;
y += ya * speed;
}
} | 3 |
public MainMenu(ProBotGame game) {
super(game);
// TODO Auto-generated constructor stub
} | 0 |
@Override
public PixelEval call() throws Exception {
for (int row = rs; row < re; row++) {
for (int col = cs; col < ce; col++) {
Ray ray = getRay(row, col, dx, dy);
Color color = scene.getColor(scene.getClosest(ray));
image.setPixel(col, row, color);
}
}
return this;
} | 2 |
public File saveSVGDialog(final JComponent parent) {
File start = HOME;
if(LAST_DIR.exists()) {
try {
final Scanner s = new Scanner(LAST_DIR, UTF8);
if(s.hasNextLine()) {
start = new File(s.nextLine().trim());
}
s.close();
} catch(final IOException e) {
... | 7 |
public static void main( String[] args ) throws UnknownHostException, IOException
{
WriteLog.initLogging();
try {
MyBatisManager.initDBFactory("development", "Projects");
MyBatisManager.initDBFactory("development", "Data");
RequestProjectsSessionManager.initialize... | 1 |
@Override
public boolean onCommand(final CommandSender sender, final Command command, final String label, final String[] args) {
final long lastPlayed = ( sender instanceof Player ? ((Player) sender).getLastPlayed() : System.currentTimeMillis() );
final List<Declaration> history = this.records.getH... | 8 |
protected void processCommand(JSONModel jsonModel){
String type = "";
try {
type = jsonModel.getString("_type");
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
L.i("type", type);
if (type.equals("launch_url")) {
try {
JSONObject obj = jsonModel.jsonObje... | 9 |
Map<Pair<Class<?>, Class<?>>, TypeConverter<?, ?>> getRegistry() {
return registry;
} | 4 |
public Face getOpposingFace() throws UnsupportedOperationException
{
switch ( this )
{
case LEFT:
return RIGHT;
case RIGHT:
return LEFT;
case BOTTOM:
return TOP;
case TOP:
return BOTT... | 6 |
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 int compareTo(Datum o) {
// TODO: is there a better way of coding this?
if (this.jaar > o.jaar) {
return 1;
} else if (this.jaar < o.jaar) {
return -1;
} else { // this.jaar == o.jaar
if (this.maand > o.maand) {
ret... | 6 |
public MultipleChoiceQuestView() {
super();
this.add(new JLabel("Multi"));
// quest = QuestFactory.createQuest(QuestType.CHOICEQUEST);
addAnswersTable();
} | 0 |
protected Widget wdg() {
Object wdg = local_widgets.get(wdgid);
if (wdg instanceof Widget) {
return (Widget) wdg;
} else
return null;
} | 1 |
public double rawAllResponsesMaximum(){
if(!this.dataPreprocessed)this.preprocessData();
if(!this.variancesCalculated)this.meansAndVariances();
return this.rawAllResponsesMaximum;
} | 2 |
private double[] computeTransform() {
double[] frequencyData = null;
FastFourierTransformer transformer = new FastFourierTransformer(
DftNormalization.STANDARD);
try {
Complex[] complx = transformer.transform(dataToTransform,
TransformType.FORWARD);
frequencyData = new double[complx.length];
Sy... | 3 |
public DcClient(String alias){
super(alias);
inputAvailable = new Semaphore(0);
inputBuffer = new LinkedList<byte[]>();
scheduler = DCConfig.schedulingMethod.getScheduler();
mb = new MessageBuffer(DCPackage.PAYLOAD_SIZE - scheduler.getScheduleSize());
// We initially don't know the current round of the... | 0 |
private static String createNode(HardwareAlternative hardwareAlternative, boolean showAllAlternativeComponents) {
String node = "";
if (showAllAlternativeComponents)
for (HardwareComponent hardwareComponent : hardwareAlternative.getHardwareComponents())
node += "\t\t<nestedNode xmi:id=\"" + hardwareComponent... | 2 |
public void ignoreMultiLineComment() {
// this method is called by nextChar() in the event that a '/*'
// has been encountered. The method will simply pull off all characters
// until the stop sequence of '*/' is encountered.
lookedAhead = false;
boolean removingComments = true;
char pluckedChar = ' ';
Sy... | 9 |
public void updateUI() {
privatekey.setEnabled(!DaEncrypter.symmetric());
if (input.getText().isEmpty()) {
output.setText("");
return;
}
if (key.getText().isEmpty()) {
return;
}
String outputTxt;
... | 3 |
@RequestMapping(value = "getById.json", method = RequestMethod.GET)
public String getModelById(@RequestParam int id, ModelMap model) {
List<Employee> employee = employeeDao.getAll();
model.addAttribute(employee);
return "jsonView";
} | 0 |
public void paintComponent(Graphics g) {
paintScreens(g);
if(startGame) {
g.setColor(new Color(75,75,75)); //background color
g.fillRect(0, 0, getWidth(), getHeight()); //Clear screen.
g.setColor(new Color(0, 0, 0)); //border color
for(int i = 0; i < myBorder + 1; i++) {
g.drawLine(... | 7 |
public List<Map<TableArticle, Integer>> getBestSellers(Connection conn) {
String sql = "select id_article, sum(qty_contains) as qty_sold "
+ "from article natural join cart_contains_article "
+ "where ( "
+ "select date_checkout "
+ "from cart where cart.id_cart = cart_contains_... | 2 |
@Override
public void create() {
addPart(new Explosion(new Position(getNextPosition().getX(), getNextPosition().getY())));
if(currentDir == -1) { //Special case to handle starting position.
currentDir++;
} else {
distance++;
}
if((distance == power || stopNextStep) && currentDir < getDirectionLis... | 4 |
public HashMap<String, LiveRange> getLiveRanges()
{
HashMap<String, LiveRange> liveRanges = new HashMap<String, LiveRange>();
for(int i = 0; i < lines.size(); i++)
{
String[] lineParams = lines.get(i).split(",");
for(int j = 1; j < lineParams.length; j++)
{
String key = lineParams[j].replaceAll("\\s... | 6 |
private void downloadFile() {
BufferedInputStream in = null;
FileOutputStream fout = null;
try {
URL fileUrl = new URL(this.versionLink);
final int fileLength = fileUrl.openConnection().getContentLength();
in = new BufferedInputStream(fileUrl.openStream());
... | 9 |
private boolean loadPoints() {
clearCollections();
int retval = fc.showOpenDialog(this);
if(retval == JFileChooser.APPROVE_OPTION) {
points_loaded = false;
File file= fc.getSelectedFile();
String filename = file.getAbsolutePath();
... | 6 |
@Override public boolean next(PixelRayBuffer b) {
if( totalSamples == targetSamples ) return false;
b.vectorSize = (int)Math.min(targetSamples - totalSamples, b.maxVectorSize);
if( screenX == null || screenX.length < b.vectorSize ) {
screenX = new double[b.vectorSize];
screenY = new double[b.vectorSize];... | 7 |
@Override
public void caseAParanthesisHexp(AParanthesisHexp node)
{
//for(int i=0;i<indent;i++) System.out.print(" ");
//indent++;
//System.out.println("(");
inAParanthesisHexp(node);
if(node.getLPar() != null)
{
node.getLPar().apply(this);
}
... | 3 |
public Status solve() {
Object solved = this.solvedCopy();
if (solved.getClass() != Grid.class) {
return (Status) solved;
}
history.add(Change.marker());
for (int i = 0; i < size*size; i++) {
for (int j = 0; j < size*size; j++) {
i... | 6 |
public int countWords(String s){
int wordCount = 0;
boolean word = false;
int endOfLine = s.length() - 1;
for (int i = 0; i < s.length(); i++) {
// if the char is a letter, word = true.
if (Character.isLetter(s.charAt(i)) && i != endOfLine) {
word = true;
// if... | 7 |
@Override
public List<Frage> getZufallsFragen(Modul modul) {
List<Frage> result = new ArrayList<Frage>();
try {
PersistenceService database = PersistenceServiceImpl.getInstance();
ResultSet rSet = database.sendQuery("Select * from frage LIMIT 10");
Vector<Vector<S... | 4 |
private void run() {
while(running) {
if(derpMode) {
table.setBackground(new Color(rng.nextInt(256),rng.nextInt(256),rng.nextInt(256)));
}
if(filterString != null) {
if(searchBar != null) {
try {
Thread.sleep(10);
} catch (InterruptedException e) {
// TODO Auto-generated catch b... | 7 |
public void update() throws MaltChainedException {
// Retrieve the address value
final AddressValue arg1 = addressFunction1.getAddressValue();
final AddressValue arg2 = addressFunction2.getAddressValue();
try {
if (arg1.getAddress() == null || arg2.getAddress() == null) {
featureValue.setIndexCode(tabl... | 9 |
private void formWindowActivated(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowActivated
if (!ACTIVATED) {
reloadTimer();
ACTIVATED = true;
}
}//GEN-LAST:event_formWindowActivated | 1 |
public List getDecoders() {
return Collections.unmodifiableList(decoders);
} | 0 |
@Test
public void testArray() throws Exception{
FileWriter FW = getFileWriter();
TestClass[] tests = FW.getArray("arr",new TestClass());
assert tests.length == testArray.length;
for(int i=0;i<tests.length;i++){
assert tests[i].val==testArray[i];
}
} | 1 |
public boolean getBoolean(int index) throws JSONException {
Object o = get(index);
if (o.equals(Boolean.FALSE) ||
(o instanceof String &&
((String)o).equalsIgnoreCase("false"))) {
return false;
} else if (o.equals(Boolean.TRUE) ||
(o in... | 6 |
private void search(TrieNode node, int row, int col)
{
if (row < 0 || row >= rows || col < 0 || col >= cols) {
return;
}
if (visited[row][col]) {
return;
}
char boardChar = board[row][col];
TrieNode next = node.getNext(boardChar);
... | 7 |
public void run() {
while (true) {
try {
loadWorlds();
} catch (DynmapInitException e) {
logger.warn("Error in getting new Worlds", e);
}
players = new ArrayList<>();
alreadyPlayers = new... | 8 |
void doStep() {
boolean v1 = volts[0] > 2.5;
boolean v2 = volts[1] > 2.5;
if (v1 && !pins[0].value)
ff1 = true;
if (v2 && !pins[1].value)
ff2 = true;
if (ff1 && ff2)
ff1 = ff2 = false;
double out = (ff1) ? 5 : (ff2) ? 0 : -1;
//System.out.println(out + " " + v1 + " " + v2);
if (out != -1)
si... | 9 |
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
BDConexion bd = new BDConexion();
bd.conectar();
ResultSet consulta = bd.seleccionar();
try {
while(consulta.next()){
response.getWriter().print("fila... | 2 |
public DBBasedCobweb(){
// init data
for(int i=0;i<2;i++){
this.staticList.add("a");
}
} | 1 |
byte[] buildBrushAA(byte[] brush, CPBrushInfo brushInfo) {
int intSize = (int) (brushInfo.curSize + .99f);
float center = intSize / 2.f;
float sqrRadius = (brushInfo.curSize / 2) * (brushInfo.curSize / 2);
float sqrRadiusInner = ((brushInfo.curSize - 2) / 2) * ((brushInfo.curSize - 2) / 2);
float sqrRadiusOut... | 7 |
public void charger(Element deplacement,Partie partie)
{
//ATTENTION A NE PAS TOUCHER
int positionDepart = Integer.valueOf(deplacement.getChildText("caseDepart"));
int positionArriver = Integer.valueOf(deplacement.getChildText("caseArriver"));
CouleurCase couleur;
if (positionDepart==0)
coul... | 6 |
@RequestMapping(method = RequestMethod.POST, value = "")
public Task postTask(@RequestBody TaskCreateRequest request) {
Integer taskId = tasksService.createTask(request.getJournalId(), request.getTaskName()).getId();
return tasksService.getById(taskId);
} | 0 |
public Event createItemFromElement(DomElement element) {
// if (element == null)
// return null;
Event event = new Event();
ImageHolder.loadImages(event, element);
event.id = Integer.parseInt(element.getChildText("id"));
event.title = element.getChildText("title");
event.description = element.getChi... | 8 |
public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
super.doGet(req, res);
header("Programme de la saison");
if (!testConnection()){ footer(); return; }
try {
out.println(ConvertHTML.vectorProgrammeToHTML(BDRequetes.getRepresentations(null), false));
... | 2 |
public void stats(Stage stage) {
if(Keybinds.CANCEL.clicked()) {
closeMenu();
} else if(Keybinds.MENU_RIGHT.clicked()) {
gameMenuType = GameMenuType.EQUIPMENT;
buildGameMenu(stage);
} else if(Keybinds.MENU_LEFT.clicked()) {
gameMenuType = GameMenuType.OPTIONS;
buildGameMenu(stage);
} else if(Keyb... | 7 |
private void updatePlayingBall() {
if (ballY >= 0.95 || ballY <= -0.95) {
ballYSpeed = -ballYSpeed;
}
//Left Paddle (AI)
if (ballX <= -0.9) {
if (isLeftPaddlePresent(ballY)) {
this.ballXSpeed = -this.ballXSpeed;
} else {
playerScore+=1;
resetRandomBall();
}
} else if (ballX >... | 6 |
@Override
public void run() {
if (Updater.this.url != null) {
// Obtain the results of the project's file feed
if (Updater.this.read()) {
if (Updater.this.versionCheck(Updater.this.versionName)) {
if ((Updater.this.versionLink != null) && (Updater.this.type != UpdateType.NO_DOWNLOAD)) {
S... | 6 |
static void add(File f, int index) throws FileNotFoundException, IOException {
File in = new File (ExtractorModel.appDir + "/" + "bookmarks.txt");
File out = new File(ExtractorModel.appDir + "/" + "tmp.txt");
out.createNewFile();
try(FileOutputStream fout = new FileOutputStream(out);
... | 7 |
private void sortHeap(int[] array) {
if(array==null || array.length==0) {
return;
}
for(int i=array.length-1;i>0;i--) {
int biggest = array[0];
array[0] = array[i];
array[i] = biggest;
// percolateDown
int hole = 0+1;
int child = 0;
int current = array[hole-1];
for(;hole*2<=i;hole=... | 7 |
public int getFromMemory(int start, int offset) {
if(start >= 0x10010000 && start <= 0x10010000 + 4*1024)
return data.get(start+offset);
if(start <= 0x7FFFEFFF && start >= 0x7FFFEFFF-2*1024)
return stack.get(start+offset);
if(start >= 0x00400000 && start <= 0x00400000 + 2*1024)
return instr.get(start+off... | 6 |
public static final boolean isObjectiveC(String fileName) {
for (String file : OBJECTIVE_C) {
if (file.equals(fileName)) {
return true;
}
}
return false;
} | 2 |
private void visiteurQuitter() {
if (ctrlMenu == null) {
ctrlMenu = new CtrlMenu(this);
}
ctrlVisiteur.getVue().setVisible(false);
ctrlMenu.getVue().setEnabled(true);
ctrlMenu.getVue().setVisible(true);
} | 1 |
public void setPlayer2Score(int score){
boolean test = false;
if (test || m_test) {
System.out.println("Drawing :: setPlayer2Score() BEGIN");
}
m_player2Score.setText("" + score);
if (test || m_test)
System.out.println("Drawing:: setPlayer2Score() - END");
} | 4 |
@Test
public void laskeRivitTest(){
List<Palikka> palikat = new ArrayList<Palikka>();
for (int i = 1; i < 10; i++){
palikat.add(new Palikka(i, 19));
}
ai.lisaaKentalle(palikat);
Muodostelma muod = new Muodostelma(Muoto.L, peli);
ai.siirraMuodostelma(muod, ... | 1 |
public Set<Map.Entry<K,Short>> entrySet() {
return new AbstractSet<Map.Entry<K,Short>>() {
public int size() {
return _map.size();
}
public boolean isEmpty() {
return TObjectShortMapDecorator.this.isEmpty();
}
public b... | 6 |
public String getNExt(String name) {
String res = "";
int lastposOflang = name.lastIndexOf("_");
if (lastposOflang == -1) { // pas de _XX
if (verbose) {
System.out.println("no extension _XX:" + name);
}
return res;
}
// System.... | 9 |
static void dradb4(int ido,int l1,float[] cc,float[] ch,
float[] wa1, int index1,
float[] wa2, int index2,
float[] wa3, int index3){
int i,k,t0,t1,t2,t3,t4,t5,t6,t7,t8;
float ci2,ci3,ci4,cr2,cr3,cr4,ti1,ti2,ti3,ti4,tr1,tr2,tr3,tr4;
t0=l1*ido;
t1=0;
t2=ido<<2;
t3=0;
t6... | 7 |
public void lerpToGameObject(GameObject object, double xOffset, double yOffset, double delta, double pps)
{
if (x < object.getX() + xOffset)
{
x += delta * pps;
if (x > object.getX() + xOffset)
{
x = object.getX() + xOffset;
}
}
else if (x > object.getX() + xOffset)
{
x -= delta * pps;... | 8 |
private String makeKingPilesMove(CardGame game) {
switch (moveTypeTo) {
case TO_ACE_PILES:
return game.moveCardOntoAceFromKing(indexFrom, indexTo);
case TO_KING_PILES:
return "Can only move to a pile of the same suit";
case TO_HAND:
... | 3 |
public void setVisiteur(String visiteur) {
this.visiteur = visiteur;
} | 0 |
public Result iddfs_helper(Integer i)
{
Deque<Node> stack = new ArrayDeque<Node>();
int nodesProcessed = 0;
stack.addFirst(initial);
while(!stack.isEmpty())
{
Node temp = stack.removeFirst();
nodesProcessed++;
if(temp.getCost() <= i)
{
if(temp.getState().equals(finalState)) {
long... | 7 |
public void Listen() {
if (reader == null)
return;
readerthread = new Reader(this);
readerthread.start();
pm.server.Log("Listening..");
} | 1 |
public static void playSound(String pathToFX) {
try {
soundFile = new File(pathToFX);
} catch (Exception e) {
e.printStackTrace();
}
try {
audioStream = AudioSystem.getAudioInputStream(soundFile);
} catch (Exception e) {
e.printStackTrace();
}
audioFormat = audioStream.getFormat();
Da... | 7 |
void incluirValoracion(UsuarioRegistrado usuario, float puntuacion){
boolean existe = existeContenidoValorado(usuario);
if (existe){
for (ContenidoValorado contenidoValorado : misvaloraciones) {
if (contenidoValorado.getAutor() == usuario)
contenidoValorad... | 3 |
public Matrix solve (Matrix B) {
if (B.getRowDimension() != n) {
throw new IllegalArgumentException("Matrix row dimensions must agree.");
}
if (!isspd) {
throw new RuntimeException("Matrix is not symmetric positive definite.");
}
// Copy right hand side.
double[][]... | 8 |
public static List<String[]> getData() throws IOException {
final List<String[]> data = new ArrayList<String[]>();
final URL url = new URL("http://fluid.com/repo/info.php");
final HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setDoInput(true);
conn.setDo... | 4 |
private void lab(EnvironnementAbs environnement){
int x;
int y;
x = environnement.taille_envi/2;
for(y = environnement.taille_envi/8; y < environment.taille_envi-(environnement.taille_envi/8) + 1; y++){
environment.grille[x][y] = new Mur("Mure", x, y);
environment.grille[y][x] = new Mur("Mure", y, x... | 2 |
public void setActive(Component component) {
tabbed.setSelectedComponent(component);
// The change event should be automatically distributed by the
// model of the tabbed pane
} | 0 |
public void setMonthStored(Month m)
{
monthStored = new Month (m);
} | 0 |
public static void main(String[] args) throws Exception {
if (args.length == 0) {
System.out.println("DisassemblyTool [-f <format style>] <file or class name>");
System.out.println();
System.out.println("The format style may be \"assembly\" (the default) or \"builder\"");
... | 9 |
void activateProject(String idx) {
try {
int i = Integer.parseInt(idx);
if (i > -1 && i < workCombo.getItemCount()) {
workCombo.setSelectedIndex(i);
}
} catch (NumberFormatException E) {
}
} | 3 |
public void reorderList(ListNode head) {
if (head == null || head.getNext() == null || head.getNext().getNext() == null) {
return;
}
//use the slow and fast, to divide the list into two parts
ListNode slow = head;
ListNode fast = head;
while (fast != null &&... | 6 |
Subsets and Splits
SQL Console for giganticode/java-cmpx-v1
The query retrieves a limited number of text entries within a specific length range, providing basic filtering but minimal analytical insight.