text stringlengths 14 410k | label int32 0 9 |
|---|---|
public boolean prove(int evenNumber) {
if(evenNumber<2){
throw new IllegalArgumentException();
}
for (int i = 0; i < evenNumber; i++) {
int number1 = i;
int number2 = evenNumber - i;
if (MathUtil.isPrime(number1) && MathUtil.isPrime(number2)) {
System.out.println(evenNumber + "=" + number1 + "... | 4 |
public static void main(String args[]) throws Throwable {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
StringBuilder sb = new StringBuilder();
for (String ln;(ln=in.readLine())!=null;) {
StringTokenizer st=new StringTokenizer(ln);
int n=parseInt(st.nextToken()),m=parseInt(st.nex... | 9 |
private byte[] HandleRevealSubscriptionCommands(short transId, byte api, byte opcode)
{
switch(opcode)
{
case 0x01:
break;
case 0x02:
break;
case 0x03:
break;
case 0x04: return GetSubscribeListVersion(transId,(byte)0xED,api,opcode)
;
case 0x05: return SendAck(transId, (byte)0xED, api... | 5 |
public void buildMateriiProf() {
// materia is the key
for (Materie m : materii) {
// map is the value
HashMap<Clasa, Profesor> map = new HashMap<Clasa, Profesor>();
// seek teachers with corresponding materie
for (Profesor p : profesori) {
if (p.getMaterie().equals(m)) {
// in the classes wher... | 6 |
private int[][] dijkstras(int source){
//TODO: Stop once we reach the right planet
int numVertices = G.numVertices();
int[] dist = new int[numVertices];
int[] prev = new int[numVertices];
HashSet<Integer> Q = new HashSet<Integer>(numVertices);
for(int v = 0; v < numVertices; v++){
dist[v] = Integer.MAX_V... | 7 |
final Object pop() {
int size = stack.size();
return size == 0 ? null : stack.remove(size - 1);
} | 1 |
public String getTheme() {
if (theme == 1) {
return "Животные";
} else if (theme == 2) {
return "Марки автомобилей";
} else {
return "Рок-группы";
}
} | 2 |
private void btnEliminarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEliminarActionPerformed
int res = JOptionPane.showConfirmDialog(
this,
"Seguro que deseas eliminar el personal",
"Advertencia",
JOptionPane.YES_NO_OPTION
);
... | 2 |
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
try {
DataServer dataServer = (DataServer)Naming.lookup("//localhost:1111/showScore");
System.out.println("create table student");
dataServer.CreateTable();
System.out.println("Create succeed。。");
boolean isrunning = true;
... | 8 |
void changeBackground() {
String background = backgroundCombo.getText();
if (background.equals(bundle.getString("White"))) {
imageCanvas.setBackground(whiteColor);
} else if (background.equals(bundle.getString("Black"))) {
imageCanvas.setBackground(blackColor);
} else if (background.equals(bundle.getStrin... | 5 |
public Queue<E> enqueue(E e){
Node current = last;
last = new Node();
last.e = e;
if(total++ ==0) first = last;
else current.next = last;
return this;
} | 1 |
@Test
public void testGetAnthillCells() {
System.out.println("getAnthillCells");
World instance = new World();
instance.generateRandomContestWorld();
List expResult = new ArrayList<>();
List result = instance.getAnthillCells();
assertEquals(expResult, result);
} | 0 |
private String getAvailableShares() {
Share[] bufferShare = sharepriceinfo.getAvailableShare();
String s = "";
for (int j = 0; j < bufferShare.length; j++) {
if(bufferShare[j].getExchange()!=null){
s += bufferShare[j].name +"<pre>"+ (float)bufferShare[j].... | 2 |
public void mousePressed(MouseEvent e) {
if (isRunning) {
if (player.canShoot)
player.shoot();
player.canShoot = false;
} else if (isIntro) {
int x = (int) e.getX();
int y = (int) e.getY();
if (x>=172 && x<=438 && y>=400 && y<=464) {
isIntro=false;
isRunning=true;
}
} els... | 7 |
public void generateTerrain() {
for (int row = 26; row < thisTick.length; row++) {
for (int col = 0; col < thisTick[row].length; col++) {
//thisTick[row][col] = new Entity(EntityType.ground.id);
}
}
} | 2 |
public static void benchmarkFloatLargeArrayInANewThread()
{
System.out.println("Benchmarking FloatLargeArray in a new thread.");
final long length = (long) Math.pow(2, 32);
long start = System.nanoTime();
final FloatLargeArray array = new FloatLargeArray(length);
System.out.p... | 3 |
public void startCountdown(PhoneFriendResult phoneFriendResult) {
final String[] conversation = getConversation(phoneFriendResult);
setVisible(true);
if (conversation != null) {
friendConversationLabel.setText(setForLabel(conversation[0]));
friendConversationLabel.setVis... | 8 |
private void renderSchedule() {
try {
ArrayList<ScheduleInfo> info = new ArrayList<ScheduleInfo>();
Staff stf = new Staff();
stf.setId(Integer.valueOf(Controller.Instance().getLoggedIn().getId()));
for (Flight f : Controller.Instance().getFlights()) {
... | 7 |
private void SetStopBusStop(int stopBusStop)
{
this.stopBusStop = stopBusStop;
} | 0 |
static private int jjMoveStringLiteralDfa6_0(long old0, long active0)
{
if (((active0 &= old0)) == 0L)
return jjStartNfa_0(4, old0);
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
jjStopStringLiteralDfa_0(5, active0);
return 6;
}
switch(curChar)
{
cas... | 7 |
public JSONObject getData() {
JSONObject o = new JSONObject();
try {
for (Attribute a : Attribute.values())
o.put(a.name(), get(a));
} catch (JSONException e) {
e.printStackTrace();
}
return o;
} | 2 |
public void setPartnerList(final List<Partner> partnerList) {
this.partnerList = partnerList;
} | 0 |
private void readDataFromDecoder() {
try {
while (decoder.hasNext()) {
InterfaceHttpData data = decoder.next();
if (data != null) {
switch (data.getHttpDataType()) {
case Attribute:
requestBody.at... | 5 |
@SuppressWarnings("unchecked")
public GridSpace(Settings settings, int width, int height, Class siteClass) {
this.settings = settings;
if (width < 1)
throw new IllegalArgumentException("width must be > 0");
if (height < 1)
throw new IllegalArgumentException("height must be > 0");
if (siteClass == null)
... | 7 |
public void setCity(String city)
{
city = city.trim();
if ( city.isEmpty() ) {
throw new RuntimeException( "'city' should not be empty" );
}
this.city = city;
} | 1 |
public static int numTrees(int n) {
if (n < 0) return 0;
if (0 == n || 1 == n) return 1;
int[] result = new int[n + 1];
result[0] = 1; result[1] = 1;
for (int i = 2; i < n + 1; i++) {
for (int j = 0; j < i; j++) {
result[i] = result[i] + result[j] * result[i - j - 1];
... | 5 |
private void variableMutation(){
//Check if any max fitness the last few generations has differed greatly. If not increase mutation, if yes then reduce
HashMap temp = (HashMap) stats.get(stats.size()-1);
double lastFitness = (Double) temp.get("maxFitness");
boolean thresholdBreache... | 5 |
private int priorityTree(int y, int x, int level, boolean turn, Pezzi[][] campo, int direction) {
//se la direzione è -1 la pedina non può muoversi, di conseguenza il thread terminerà con 0
// se invece ha un valore diverso compreso tra 0 e 3 il calcolo delle possibilità inizierà
if (direction ... | 8 |
@Override
public void delScript(ScriptingEngine S)
{
if(scripts!=null)
{
if(scripts.remove(S))
{
if(scripts.isEmpty())
scripts=new SVector(1);
if(((behaviors==null)||(behaviors.isEmpty()))&&((scripts==null)||(scripts.isEmpty())))
CMLib.threads().deleteTick(this,Tickable.TICKID_ITEM_BEHAVIO... | 7 |
public boolean addAll(Collection<? extends T> c) {
// the reason we have to write "? extends E" is because we don't really
// care what class is passed in -- just as long as it inherits from type
// T at some point.
boolean retVal = false; // see official documentation for return value
// specs
for (T... | 3 |
public static TreeNode buildTree() {
TreeBuilder builder = new TreeBuilder("Animations");
for (Building bld : Building.getAll()) {
if (!bld.hasAnimation()) continue;
String name = bld.getName();
if (name.startsWith("comp_"))
builder.add(bld, false, "Buildings", "comp", name);
else if (name.startsWit... | 9 |
public static Class<?> getClass(String fqn) throws ClassNotFoundException {
return Class.forName(fqn);
} | 1 |
public void continueGame(){
this.running = true;
this.lastLoopTime = System.currentTimeMillis();
this.showGame();
} | 0 |
public boolean checkContinuous(Player myHand) {
boolean continuous = true;
int i = 0;
while (continuous = true && i <= 3) {
int rank1 = myHand.getCard(i).getRank();
int rank2 = myHand.getCard(i + 1).getRank();
if ((rank1++) == rank2) {
continuous = true;
} else {
continuous = false;
}
//... | 9 |
@Override
public String getSynopsis() {
if (synopsis == null || isEmpty(synopsis.getText())) {
return "";
}
return synopsis.getText();
} | 2 |
public void create(Telecommunications telecommunications) throws PreexistingEntityException, RollbackFailureException, Exception {
if (telecommunications.getItItemCollection() == null) {
telecommunications.setItItemCollection(new ArrayList<ItItem>());
}
EntityManager em = null;
... | 8 |
public static void findPotentials(String data_file) {
ChainMRFPotentials p = new ChainMRFPotentials(data_file);
SumProduct sp = new SumProduct(p);
for(int i=1; i<=p.chainLength(); i++) {
double[] marginal = sp.marginalProbability(i);
if(marginal.length-1 != p.numXValues()) // take off 1 for 0 index which i... | 9 |
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
} | 1 |
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String line = "";
StringBuilder out = new StringBuilder();
int LIM = 251;
BigInteger[] ans = new BigInteger[LIM];
ans[0] = BigInteger.ONE;
ans[1] = BigInteger.ONE;
BigInt... | 3 |
public void Answer(final String channel) {
new Thread() {
public void run() {
HangupBridgeCalls();
PrintWriter writer = MainFrame.TelnetWriter();
writer.print("Action: Redirect\r\n");
writer.print("Channel: SIP/" + channel + "\r\n");
writer.print("Exten: " + Phone.MainExtension + "\r\n"... | 1 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
MultipleWritable other = (MultipleWritable) obj;
if (intField != other.intField)
return false;
if (Float.floatToIntBits(floatField) != Float... | 8 |
public void printLongString(int type, int max, String text) throws Exception
{
HashMap map = new HashMap();
String line = "";
int row_id = 0;
String[] words = text.split(" ");
for(int i = 0; i < words.length; i++)
{
line = "";
if (map.conta... | 4 |
@Override
public void run() {
while (!interrupted) {
long time0 = System.currentTimeMillis();
rotation.mul(deltaRotation);
long duration = System.currentTimeMillis() - time0;
if (duration < FRAME_DELAY) {
try {
Thread.sleep(FRAME_DELAY - duration);
} catch (InterruptedException e) ... | 3 |
public void execute() {
boolean skipHash = false;
String baseURL = "patch/" + patchName;
Map<String, File> patchedFiles = new Hashtable<String, File>();
InstallerPacker.collectFiles(patchedFiles, new File(patchedFolder), false);
Set<FileListEntry> patchedEntries = InstallerPacker.generateFileList(patchedFi... | 7 |
private void logarUsuario(String usuario, String senha) {
String senhaAtual,usuarioAtual;
String senhaTeste = "";
int pontuacaoUsuario = 0;
boolean naoApareceu = true;
File dados = new File("data");
try {
Scanner reader = new Scanner(dados);
while ... | 7 |
@Override
public int doStartTag() throws JspException {
User user = (User) pageContext.getSession().getAttribute(JSP_USER);
if (user != null) {
ClientType type = ClientTypeManager.clientTypeOf(user.getRole().getRoleName());
if (type == ClientType.USER || type == ClientType.AD... | 3 |
public FiniteStateAutomaton convertToDFA(Automaton automaton) {
/** check if actually nfa. */
AutomatonChecker ac = new AutomatonChecker();
if (!ac.isNFA(automaton)) {
return (FiniteStateAutomaton) automaton.clone();
}
/** remove multiple character labels. */
if (FSALabelHandler.hasMultipleCharacterLabel... | 4 |
@Override
protected void readChild(XMLStreamReader in) throws XMLStreamException {
String childName = in.getLocalName();
if (Limit.getXMLElementTagName().equals(childName)) {
if (limits == null) {
limits = new ArrayList<Limit>();
}
Limit limit = ne... | 7 |
@Test
public void getIncome() {
Trainer test = null;
Trainer test1 = null;
try {
test = new Trainer("Franz", 3);
test1 = new Trainer("Karl", 5);
} catch (Exception e) {
fail("Unexpected Exception");
}
try {
Trainer test3 = new Trainer("Sepp", 12);
} catch (ValueException e) {
// expected
... | 5 |
public ImagePlus applyWithMask()
{
final int width = input.getWidth();
final int height = input.getHeight();
final int depth = input.getStackSize();
//final ImagePlus imageOutput = input.duplicate();
//final ImageStack imageStackOutput = imageOutput.getStack();
final ImageStack inputStack = input.getStac... | 8 |
@Override
public void say(String toSay) {
int fileNum = 0;
for (String s : cut(conform(toSay))) {
try {
download(
BASE_URL + "?tl=" + lang + "&q=" + s,
TEMP_PATH+"part"+fileNum++ + ".mp3");
} catch (IOException e) {
Logger.w("Impossible de télécharger le fichier à lire de " +
... | 5 |
public static void main(String[] args) {
double d = 0.05 ;
double sum = 0;
for (int i = 0; i < 60; i++) {
double t = ExponentialRandomNumber(d);
sum += t;
System.out.println(t);
}
System.out.println(sum/100);
} | 1 |
public FilterFactory(Properties[] configs) {
this.configs = configs;
} | 0 |
@Before
public void setUp() {
TestHelper.signon(this);
MongoHelper.setDB("fote");
MongoHelper.getCollection("users").drop();
MongoHelper.getCollection("suggestions").drop();
for (User user : users) {
if(!MongoHelper.save(user, "users")) {
... | 4 |
public static final int getIndex(String segment) {
if (isArraySegment(segment)) {
Matcher matcher = ARRAY_SYNTAX_PATTERN.matcher(segment);
matcher.find();
return Integer.parseInt(matcher.group(2));
}
return -1;
} | 1 |
public static void setSelectedY(int y) {
if (Main.selectedId != -1 && !Main.getSelected().locked) {
RSInterface rsi = Main.getInterface();
if (rsi != null) {
if (rsi.children != null) {
rsi.childY.set(getSelectedIndex(), y);
}
}
}
} | 4 |
@Override
public Object getValueAt(int arg0, int arg1) {
//return percent dl
Torrent t = allTorrents.toArray(new Torrent[0])[arg0];//slow
switch(arg1){
case 0:
return t.name;
case 1:
String s =null;
if(t.totalBytes/1024 <999){
s=""+dg.format(t.totalBytes/1024.0)+" KB";
}else if(t.totalBytes/(... | 9 |
private static Fontstyle getFontstyle(String s) {
Fontstyle ret = null;
if ((s != null) && !s.equals("")) {
try {
ret = Fontstyle.valueOf(s.trim().toUpperCase());
} catch (IllegalArgumentException e) {
ret = null;
}
}
... | 3 |
private void calculateEnabledState(JoeTree tree) {
if (tree.getComponentFocus() == OutlineLayoutManager.ICON) {
setEnabled(true);
} else {
if (tree.getCursorPosition() == tree.getCursorMarkPosition()) {
setEnabled(false);
} else {
setEnabled(true);
}
}
} | 2 |
public boolean removeMovie(String title)
{
boolean deleted = false;
if (aMovieIndex.containsKey(title)) {
Item tempMovie = aMovieIndex.remove(title);
directorIndex.remove(((Movie)tempMovie).getDirector());
for (String s: ((Movie) tempMovie).getActors()) {
... | 3 |
public static ArrayList<Planet> forShips(PlanetWars pw){
// Tested
ArrayList<Planet> asw = new ArrayList<Planet>(2);
asw.add(null);
asw.add(null);
// Find the biggest fleet to attack with and our weakest planet to know what is our goal of fleet to be destroyed in the enemey
int maxShips = 0;
int minShips ... | 6 |
public static final boolean isDirect(Buffer buffer) {
if (buffer == null) {
return true;
}
if (!(buffer instanceof ByteBuffer)) {
if (buffer instanceof FloatBuffer) {
return ((FloatBuffer) buffer).isDirect();
}
if (buffer i... | 8 |
@Override
protected void logBindInfo(Method method) {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("绑定" + getDescription() + "到方法[" + method + "]成功");
}
} | 1 |
private Pioche() {
for (Couleur c : Couleur.values()) {
if(c != Couleur.NOIR){
for (Label l : Label.values()) {
Carte carte = new Carte(CarteFactory.getCarte(l, c));
this.add(carte);
if(l != Label.ZERO && l != Label.PLUS4 && l != Label.JOKER) {
this.add(carte);
}
}
... | 6 |
private void processDeskSave(RdpPacket_Localised data,
DeskSaveOrder desksave, int present, boolean delta)
throws RdesktopException {
int width = 0, height = 0;
if ((present & 0x01) != 0) {
desksave.setOffset(data.getLittleEndian32());
}
if ((present... | 7 |
@Override
public void paintComponent(Graphics g) {
super.paintComponent(g);
this.g = g;
width = getWidth();
height = getHeight();
if (drawAxis) {
drawVerticals();
}
if (click_state == STATE_DROPPED && edit) {
drawEdge(x0, y0, x1, y1,... | 6 |
public void renderAll(){
Camera camera = this.raycaster.getCamera();
double x = camera.getX();
double z = camera.getZ();
double width = raycaster.getWidth();
for(int i = 0; i < width; i++){
double grad = ((double)i)/(width/2) - 1;
double angle = Math.... | 2 |
@SuppressWarnings("rawtypes")
public static byte[] generateCanonicalRRsetData(RRset rrset, long ttl,
int labels) {
DNSOutput image = new DNSOutput();
if (ttl == 0) {
ttl = rrset.getTTL();
}
Name n = rrset.getName();
if (labels == 0) {
la... | 7 |
public boolean hitMe(){
if (getHandCount()<getHold())
hit = true;
else
hit = false;
return hit;
} | 1 |
private void setOrientation(String o) {
if ("isometric".equalsIgnoreCase(o)) {
map.setOrientation(Map.ORIENTATION_ISOMETRIC);
} else if ("orthogonal".equalsIgnoreCase(o)) {
map.setOrientation(Map.ORIENTATION_ORTHOGONAL);
} else if ("hexagonal".equalsIgnoreCase(o)) {
... | 4 |
public void takeColor()
{
Object inputObj = null;
Integer outputObj = null;
// repeat until a Color is received and confirmation is sent
do {
// read the Color
try {
inputObj = in.readObject();
} catch ( Exception e ) {
... | 9 |
public final void registerToNewObservables() {
for(PositionChangedObservable o : observables) {
o.register(observers);
}
observables.clear();
} | 1 |
void copyUcs4ReadBuffer(int count, int shift1, int shift2, int shift3,
int shift4) throws java.lang.Exception
{
int j = readBufferPos;
int value;
if (count > 0 && (count % 4) != 0) {
encodingError(
"number of bytes in UCS-4 encoding not divisible ... | 6 |
@Parameters
public static Collection<Object[]> getParameters() throws Exception {
List<Object[]> res = new ArrayList<>();
SpdyNameValueBlock blockCorrect = new SpdyNameValueBlock();
SpdyNameValueBlock blockCorrect2 = new SpdyNameValueBlock();
SpdyNameValueBlock blockinCorrect = new S... | 8 |
@Override
public HashMap<Long, Float> getScores(HashMap<String, Integer> query) {
ArrayList<Long> ids = weighter.getAllIds();
HashMap<Long, Float> docScores = new HashMap<Long, Float>();
HashMap<String, Float> queryWeight = weighter.getWeightsForQuery(query);
float norm = 0;
... | 8 |
public static void setSize(int w, int h){
WINDOW_HEIGHT = h;
WINDOW_WIDTH = w;
init();
} | 0 |
public void init(int nplayers, int[] pref) {
this.nplayer=nplayers;
this.pref=pref;
this.position=this.getIndex();// position start from 0
this.record = new int[2*nplayer];
if(nplayers-position<=9)
magic=magic_table[nplayers-position];
else
magic=(int) Math.round(0.369... | 1 |
public void loadUserDict(File userDict) {
InputStream is;
try {
is = new FileInputStream(userDict);
}
catch (FileNotFoundException e) {
System.err.println(String.format("could not find %s", userDict.getAbsolutePath()));
return;
}
try {
... | 6 |
@Override
public List<AdminCol> getColDsplTblList(String tblNm) {
log.debug("get column display table list for table = " + tblNm);
Connection conn = null;
PreparedStatement statement = null;
ResultSet rs = null;
ArrayList<AdminCol> list = new ArrayList<AdminCol>();
StringBuilder sql = new StringBuilder(... | 8 |
public static int[] fill1(char[] c) {
int[] i = new int[c.length];
for (int x = 0; x < c.length; x++) {
i[x] = ((int) c[x]) - 65;
i[x] = h[i[x]];
}
return i;
} | 1 |
public ArrayList<Action> getPossibleActions() {
ArrayList<Action> possibleActions = new ArrayList<Action>();
if (this.movementCounter > 0){
for (Relative_Direction absoluteExitDirection : this.getCurrentRoom().getAbsoluteExits()) {
possibleActions.add(new MoveAction(absoluteExitDirection));
}
}
... | 8 |
public K findKey(Object value, boolean identity) {
V[] valueTable = this.valueTable;
if (value == null) {
K[] keyTable = this.keyTable;
for (int i = capacity + stashSize; i-- > 0;) {
if (keyTable[i] != null && valueTable[i] == null) {
return ke... | 9 |
@Override
public int setup(XTreeCompiler compiler, XCodeGen codeGen) {
result = scope.get(ident, ident.name, access);
switch(result.r){
case DUPLICATED:
compiler.addDiagnostic(ident, "duplicated.var", ident.name, result.var.t.position.position.line);
break;
case FOUND:
break;
case DECLARED:
if(re... | 9 |
public int labelIndex(final Label label) {
final Integer i = (Integer) labels.get(label);
if (i != null) {
return i.intValue();
}
throw new IllegalArgumentException("Label " + label + " not found");
} | 1 |
protected void push(char x, int num)
{
queueNode trc;
//Check if the element is forbidden
trc = iHead;
while(trc!=null)
{
if(trc.getData()==x)
return;
trc = trc.getNext();
}
//Check if the element is in the holding queue
trc = jHead;
while(trc!=null)
{
if(trc.getKeyNum()==num)
{
... | 5 |
public int NumShips(int playerID) {
int numShips = 0;
for (Planet p : planets) {
if (p.Owner() == playerID) {
numShips += p.NumShips();
}
}
for (Fleet f : fleets) {
if (f.Owner() == playerID) {
numShips += f.NumShips();
}
}
return numShips;
} | 4 |
public static void main(String[] args) throws Exception {
String hostAddress = args[0];
String namingAddress = args[1];
RemoteDrunkardCompanion companion = (RemoteDrunkardCompanion) Naming.lookup(hostAddress);
BufferedReader cmd = new BufferedReader(new InputStreamReader(System.in));
... | 4 |
public String getType() {
return type;
} | 0 |
private static <T> void handleWindows(final String framesetid, final Class<? extends Component> clz, Component comp) {
if (comp instanceof Window) {
TitleIconImage title = clz.getAnnotation(TitleIconImage.class);
if (title != null) {
setWindowTitle(comp, title);
... | 6 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
RepeatNode other = (RepeatNode) obj;
if (exp1 == null) {
if (other.exp1 !... | 9 |
static void draw_priority_sprites(osd_bitmap bitmap, int prioritylayer)
{
int offs;
/* sprites must be drawn in this order to get correct priority */
for (offs = 0;offs < spriteram_size[0];offs += 8)
{
int i,incr,code,col,flipx,flipy,sx,sy;
if (prioritylayer==0 || (prioritylayer!=0 && (spriteram.re... | 9 |
public void stop()
{
synchronized (routes)
{
for (Route route : routes)
{
route.stop();
}
}
} | 1 |
private void applyTransform(BufferedImage sourceImage, BufferedImage destinationImage, PerspectiveTransform transform) {
for(int x = 0; x < destinationImage.getWidth(); x++) {
for(int y = 0; y < destinationImage.getHeight(); y++) {
try {
final Point2D sourcePoint ... | 7 |
@Override
public void onNIOEvent(SelectionKey key)
{
if( key.isWritable() )
{
boolean removeEvent = false;
ChannelEvent event = writeQueue.peek();
try
{
if( removeEvent = (event != null && handleOutgoingEvent(event)) )
event.getFuture().onSuccess();
}
catch(Exception e)
{
remove... | 7 |
public static void enqueueEvent( String method, Object target, Object... parameters )
{
Event event = new Event(); // create the event
try
{
// determine the classes of our parameters
Class< ? >[] paramClasses = new Class< ? >[ parameters.length ];
for ( ... | 6 |
@Override
@XmlElement(name="nachname")
public String getNachname() {
return this.nachname;
} | 0 |
private BeerResponseList(Iterable<Beer> beers) {
if (beers != null) {
for (Beer beer : beers) {
this.beers.add(BeerResponse.createBeerResponse(beer));
}
}
} | 2 |
void createToolBar(final Composite parent) {
final Display display = parent.getDisplay();
toolBar = new ToolBar(parent, SWT.FLAT);
ToolItem back = new ToolItem(toolBar, SWT.PUSH);
back.setText(getResourceString("Back")); //$NON-NLS-1$
back.setImage(loadImage(display, "back.gif")); //$NON-NLS-1$
back.addLis... | 3 |
public Wave06(){
super();
MobBuilder m = super.mobBuilder;
for(int i = 0; i < 65; i++){
if(i < 5){
if(i % 2 == 0)
add(m.buildMob(MobID.RATTATA));
else
add(m.buildMob(MobID.PIDGEY));
}
else if (i >= 5 && i < 45){
if(i % 2 == 0)
add(m.buildMob(MobID.PIDGEY));
else
add(m.... | 9 |
public static void main(final String[] args)
{
EventQueue.invokeLater(new Runnable()
{
@Override
public void run()
{
try {
final GUIrscGenerator frame = new GUIrscGenerator();
frame.setVisible(true);
} catch (final Exception e) {
e.printStackTrace();
}
}
});
} | 1 |
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.