text stringlengths 14 410k | label int32 0 9 |
|---|---|
@Override
public void run() {
open = true;
System.err.println("Die Kasse mit Id: " + cashpointId + " soll geöffnet werden!");
try {
Thread.sleep(6000);
} catch (InterruptedException e1) {
e1.printStackTrace();
}
System.err.println("Die Kasse mit Id: " + cashpointId + " wurde geöffnet!");
while ... | 8 |
private void getPerson() throws SQLException {
clear();
curPerson = peopleSet.getInt("idCustomer");
firstTF.setText(peopleSet.getString("First"));
lastTF.setText(peopleSet.getString("Last"));
streetTF.setText(peopleSet.getString("Street"));
cityTF.setText(peopleSet.getString("City"));
stateTF.setText(peop... | 7 |
public boolean read(long byteStart, int byteCount, int arrayOffset, byte bytes[]) throws IOException
{
if(byteStart < 0)
throw new IllegalArgumentException("negative start position");
final long limit = byteStart + byteCount;
if(limit > size)
throw new IllegalArgumentException("exceeds device size");
i... | 9 |
@Test
public void deleteTest() {
for (int i = 1; i < 9; i++) {
System.out.println("");
printTime(testJavaLinkedListDeletions(10000 * (int) Math.pow(2, i)));
printTime(testDoublyLinkedListDeletions(10000 * (int) Math.pow(2, i)));
}
} | 1 |
public SubForum getSubForumById(String id) {
for (int i=0; i<subForums.size(); i++) if (id.equals(subForums.get(i).getId())) return subForums.get(i);
return null;
} | 2 |
public void drawRandomPattern(int num) {
writeTo.print("\n");
writeTo.print("/design{\nnewpath\n10 neg unit 10 mul moveto\n");
int dir;
for(int i = 0; i < num; i++){
dir = (int) (Math.random() * 6);
switch (dir) {
case 0: writeTo.print("U ");
break;
case 1: writeTo.print("D ");
break;
case ... | 7 |
public static ArrayList<TestDistance> findTestDistanceByTestId(ArrayList<TestDistance> testDistances, int id) {
ArrayList<TestDistance> outputDistances = new ArrayList<TestDistance>();
for(TestDistance td:testDistances) {
if(td.test==id) {
outputDistances.add(td);
}
}
return outputDistances;
} | 2 |
public static void describeClass(CtClass c) throws ClassNotFoundException, NotFoundException {
StringBuilder bb = new StringBuilder();
bb.append("name: ").append(c.getName()).append("\n");
bb.append("annotations: ");
Object[] ann = c.getAnnotations();
if (ann.length == 0) {
bb.ap... | 8 |
public void updateMonster(int w, Character mon) {
Monster tempMonster = (Monster) mon;
int tempy = tempMonster.getY();
int tempx = tempMonster.getX();
int temph = tempMonster.getHV();
int tempv = tempMonster.getVV();
int vcount = tempMonster.getVcount();
int hcount = tempMonster.getHcount();
int mid ... | 6 |
public int[] getInts(int par1, int par2, int par3, int par4)
{
int[] var5 = this.parent.getInts(par1 - 1, par2 - 1, par3 + 2, par4 + 2);
int[] var6 = IntCache.getIntCache(par3 * par4);
for (int var7 = 0; var7 < par4; ++var7)
{
for (int var8 = 0; var8 < par3; ++var8)
... | 7 |
public static void saveImageAsJpeg(String src, String dest,
int formatWidth, int formatHeight) throws IOException {
File saveFile = new File(dest);
BufferedImage destImage = imageZoomOut(src, formatWidth, formatHeight);
ImageIO.write(destImage, "JPEG", saveFile);
} | 0 |
protected boolean nearPlayer() {
if(targetEntity.x > x-(width/2)-detectionRadius && targetEntity.x < x+(width/2)+detectionRadius && targetEntity.side != side){
if(targetEntity.y > y-(height/2)-detectionRadius && targetEntity.y < y+(height/2)+detectionRadius ){
return true;
} else return false;
} else retu... | 5 |
public void fireKeyEvent(KeyEvent event) {
processKeyEvent(event);
} | 0 |
public void addToData(List<Float> list, int i) {
if (TMIData.containsKey(i)) {
TMIData.get(i).addAll(list);
} else {
TMIData.put(i, new ArrayList<Float>(list));
}
} | 1 |
public GameState doAction(GameState state, Card card, int time)
{
Color faction = card.getFaction();
Player player = state.getPlayer(faction);
if(!player.checkCPU())
{
//First we just display all the possible choices for treasure
String choice = "";
Loot Lbag = state.getBoard().getLoot(state.getDay(... | 4 |
BitSet getVersionsLeading( int index )
{
BitSet bs = new BitSet();
if ( index == pairs.size()-1 )
{
for ( int i=0;i<versions.size();i++ )
bs.set( i+1 );
}
else
{
Pair p1 = pairs.get( index );
Pair p2 = pairs.get( ind... | 5 |
protected void _socketReceivingMessage(ByteBuffer _buf)
{
//将数据放入缓冲中
try
{
_m_bByteBuffer.put(_buf);
}
catch (BufferOverflowException e)
{
ALServerLog.Error("_socketReceivingMessage length is too long, Socket Buffer need more!");
_m... | 9 |
public int getParameter(String paramname){
if(paramname == "HoodSize"){return 0;}
if(paramname == "NextX"){return -1;}
if(paramname == "NextY"){return -1;}
if(paramname == "Mat"){ return mat;}
if(paramname == "Matcount"){ return matcount;}
if(paramname == "InMode"){return inmode;}
if(paramname... | 7 |
public void send(ConduitMessage msg) {
while (true) {
try {
msg.send(mOutput);
return;
} catch (Exception exception) {
reconnect();
}
}
} | 2 |
public Expression getValueBySlot(int slot) {
slot--; // skip this parameter (not an outer value)
for (int i = 0; i < headCount; i++) {
if (slot == 0) {
Expression expr = head[i];
if (i >= headMinCount)
headMinCount = i;
return expr;
}
slot -= head[i].getType().stackSize();
}
return nul... | 3 |
public Octave(int seed) {
p = p_supply.clone();
if (seed == RANDOMSEED) {
Random rand = new Random();
seed = rand.nextInt();
}
// the random for the swaps
Random rand = new Random(seed);
// the seed determines the swaps that occur between the default order
// and the order we're actually going to... | 3 |
@EventHandler
public void onPlayerJoin(PlayerJoinEvent event) {
try {
String playerName = event.getPlayer().getName().toLowerCase();
Benutzer sp;
if (!this.plugin.alleBenutzer.keySet().contains(playerName)){
// User aus der DB holen
ResultS... | 6 |
public static void main(String[] args) {
// TODO Auto-generated method stub
Controller test=new Controller();
TowerDefense_TransData data;
test.startTurn(1, 0, null);
test.run();
data=test.getInfo(1, 0);
for(int i=0;i<data.getSize();i++)
System.out.println(data.TowerDefense_TransArray[i]);
test.run()... | 2 |
public void onBlockBreak(BlockBreakEvent event) {
Sign sign;
if (!event.isCancelled()
&& event.getBlock() != null
&& (event.getBlock().getType() == Material.WALL_SIGN || event
.getBlock().getType() == Material.SIGN_POST)) {
sign = (Sign) event.getBlock().getState();
if ... | 6 |
public Scene getScene() {
return scene;
} | 0 |
public boolean valid(String url) {
if (url == null || url.isEmpty())
return false;
try {
String cssURL = getCssURL(url);
if (cssURL == null)
return false;
String content = getContent(cssURL);
ValidationResponse response = new ValidatorBuilder().css().validate(content);
warnings = response.war... | 4 |
private void idCmbxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_idCmbxActionPerformed
String id = "";
try {
if (idCmbx.getSelectedItem() != null) {
ComboBoxUtility.setComboItem(currentClasses, "select classID from classdetail where studentID='" + idCmbx.... | 6 |
final public CycVariable simpleVariable(boolean requireEOF) throws ParseException {
CycVariable val = null;
Token t = null;
t = jj_consume_token(SIMPLE_VARIABLE);
val = new CycVariable(t.image);
eof(requireEOF);
{if (true) return val;}
throw new Error("Missing return st... | 1 |
private boolean statStarters()
{
if((currentToken.kind == Token.NAME) || (currentToken.kind == Token.LPAREN) || (currentToken.kind == Token.DO) || (currentToken.kind == Token.WHILE) || (currentToken.kind == Token.REPEAT) || (currentToken.kind == Token.IF) || (currentToken.kind == Token.FOR) || (currentToken.kind =... | 9 |
public Object getValueAt(int row, int column) {
switch(column) {
case 0 : return row;
case 1 :
// Get memory value
int memoryValue = Integer.parseInt(memory.get(row));
switch(modelType) {
case ACSII :
... | 6 |
@Override
public void actionPerformed(ActionEvent e) {
if(e.getSource() == acceptadress){
accept();
}
if (e.getSource() == changeNick){
nick.setText(nickGenerator.getNew());
}
} | 2 |
public static void main(String[] args) {
} | 0 |
public void mouseMoved(MouseEvent e) {
//鼠标移动到了返回按钮处
if( e.getX() >= 850 && e.getX() <= 890 && e.getY() >= 300 && e.getY() <= 340){
this.returnBtnFlag = true ;
}else{
this.returnBtnFlag = false ;
}
//鼠标移动到了存档按钮处
if( e.getX() >= 850 && e.getX() <= 890 && e.getY() >= 350 && e.getY() <= 390){
this.... | 8 |
final int read(int len, int off, int i_3_, byte[] dest) throws IOException {
anInt4555++;
if ((len ^ 0xffffffff) > -1 || (off ^ 0xffffffff) > -1 || (off + len ^ 0xffffffff) < (dest.length ^ 0xffffffff))
throw new IOException();
synchronized (this) {
int i_4_;
if ((anInt4558 ^ 0xffffffff) <= (anInt4556... | 8 |
private void getData_with_index(ByteBuffer buf, final int index, OnDataListener dataListener) {
int offset = index;
final int idx[] = new int[6];
getIndex(buf, offset * 10, idx);
int wordid = -1;
if ((idx[3] == 0) && ((idx[5] - idx[1]) > 0)) {
//word
wordid = dataListener.OnWordData(WordFlag.... | 8 |
public void close() throws IOException {
init();
internalIn2.close();
} | 0 |
public static void main(String[] args) throws Throwable{
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
for (String linea; (linea=in.readLine())!=null;) {
StringTokenizer st = new StringTokenizer(linea);
int H = Integer.parseInt(st.nextToken());
double U = Integer.parseInt(st.nex... | 9 |
@Override
public void run() {
try {
parsRequest();
if (response.isOK()) {
if (isSMTPorIndexRequest()) {
SMTPRequest.handler(request, response);
} else {
buildResponse();
}
}
} catch (Exception e) {
this.response.setInternalServerError(request.GetHttpVer());
} finally {
... | 5 |
public void addWatcher(Watcher watcher)
{
list.add(watcher);
System.out.println("Add One Watcher !");
} | 0 |
@Override
public void controlPressed(Command c) {
if (c.equals(up)) {
choice -= 1;
if (choice < 0) {
choice = 0;
}
}
if (c.equals(down)) {
choice += 1;
if (choice >= buttons.size()) {
choice = buttons.size() - 1;
}
}
} | 4 |
@Override
public boolean containsFloatArray(String name) {
JOSObject<? , ?> raw = this.getObject(name);
if(raw == null) return false;
if(raw.getName().equalsIgnoreCase(FLOAT_ARRAY_NAME)) return true;
return false;
} | 4 |
public void setQuantities()
{
if(isElement())
{
int protons = miniCompounds[0].elements[0].protons;
for(int i = 0; i < Element.eDiatomic.length; i++)
{
if(protons == Element.eDiatomic[i])
{
miniCompounds[0].elements[0].quantity = 2;
}
}
}
else if(miniCompounds.length == 1)
{
... | 4 |
public int compareTo(Object other)
{
Location otherLoc = (Location) other;
if (getRow() < otherLoc.getRow())
return -1;
if (getRow() > otherLoc.getRow())
return 1;
if (getCol() < otherLoc.getCol())
return -1;
if (getCol() > otherLoc.getCol(... | 4 |
public Case chercheMouvementCase(Case CaseObjectif) {
Case nouvelleCase = new Case(0, 0, null);
int deplacement_X, deplacement_Y;
int deplacement_effectif_X = 0, deplacement_effectif_Y = 0;
deplacement_X = CaseObjectif.getAbscisse() - this.position.getAbscisse();
deplacement_Y = CaseObject... | 6 |
public static int findIndex(String src, String... delimiter)
{
int i = -1;
for (String s : delimiter)
{
int lastIndexOf = src.toUpperCase().lastIndexOf(s.toUpperCase());
if ((lastIndexOf > 0) && (lastIndexOf < (src.length() - 1)))
i = (i == -1) ? lastIndexOf : Math.min(i, lastIndexOf);... | 4 |
public static PlaneDimension loadDimension(File file) {
try {
FileReader reader = new FileReader(file);
BufferedReader br = new BufferedReader(new FileReader(file));
String line;
ArrayList<ArrayList<Integer>> seatList = new ArrayList<ArrayList<Integer>>();
... | 9 |
private void selectionUp() {
pointer--;
if (pointer < 0) {
pointer = buttons.size()-1;
}
} | 1 |
public String getNextComponent(Identifier ident) {
if (isOr == AND) {
for (int i = 0; i < matchers.length; i++) {
String next = matchers[i].getNextComponent(ident);
if (next != null && matchesSub(ident, next))
return next;
}
return null;
}
// OR case
String next = null;
for (int i = 0; i... | 9 |
static void lsp_to_curve(float[] curve, int[] map, int n, int ln,
float[] lsp, int m, float amp, float ampoffset){
int i;
float wdel=M_PI/ln;
for(i=0; i<m; i++)
lsp[i]=Lookup.coslook(lsp[i]);
int m2=(m/2)*2;
i=0;
while(i<n){
int k=map[i];
float p=.7071067812f;
floa... | 9 |
private static Image getScaledImage(Image image, float x, float y) {
// set up the transform
AffineTransform transform = new AffineTransform();
transform.scale(x, y);
transform.translate(
(x-1) * image.getWidth(null) / 2,
(y-1) * image.getHeight(null) / 2);
... | 0 |
public int getIdAlmacen() {
return idAlmacen;
} | 0 |
public MethodInfo[] getMethods() {
if ((status & METHODS) == 0)
loadInfo(METHODS);
return methods;
} | 1 |
public void updateBoutonsDifficultee(String diff) {
switch(diff) {
case "Facile":
// On change la partie en facile
this.buttonFacile.setEnabled(false);
this.buttonFacile.setForeground(new Color(102,153,255));
this.but... | 3 |
public Collector() {
try {
sock = new DatagramSocket(2055);
} catch(SocketException e) {
System.out.println("Can't open socket on port 2055.");
System.exit(-1);
}
if (!ConfigParser.isInitialized()) {
try {
new ConfigParser(new FileInputStream(new File("./collector.cfg")));
} catch (... | 7 |
public static String sign(byte[] data, String privateKey) throws Exception {
// 解密由base64编码的私钥
byte[] keyBytes = SecurityCoder.base64Decoder(privateKey);
// 构造PKCS8EncodedKeySpec对象
PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(keyBytes);
// KEY_ALGORITHM 指定的加密算法
KeyFactory keyFactory = KeyFac... | 0 |
public boolean isAlive(Snake snake){
ArrayList<Cell> body = (ArrayList<Cell>) snake.getSnakeBody();
Cell head = body.get(0);
for(int i = 0; i < body.size(); i++){
Cell c = body.get(i);
if(!inBounds(c) || (i != 0 && cellEquals(head, c)))return false;
}
return true;
} | 4 |
public final void log(final Level level, final String logMsg, final Throwable exception) throws Throwable {
if (!shouldLog(level)) {
return;
}
String formatedLog = formatter.giveFormat(level, logMsg);
if (this.shouldFilter(formatedLog)) {
for (Output output: outputs) {
try {
output.write(formated... | 4 |
public void scheduler()
{
this.getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable()
{
@Override
public void run()
{
List<String> promotedPlayers = new ArrayList<String>();
synchronized (timepromote)
{
for(String playername : timepromote.keySet())
{
... | 8 |
public void mouseMoved(MouseEvent e) {
if (this.horizontalAxisTrace) {
drawHorizontalAxisTrace(e.getX());
}
if (this.verticalAxisTrace) {
drawVerticalAxisTrace(e.getY());
}
Object[] listeners = this.chartMouseListeners.getListeners(
ChartMo... | 7 |
@Override
public void actionPerformed(ActionEvent e) {
if(e.getActionCommand().equals("crack")){
int publicKey = Integer.parseInt(this.window.publicKeyTextField.getText());
int moduloN = Integer.parseInt(this.window.moduloNTextField.getText());
String encryptedText = this.window.encryptedTextTextField.ge... | 7 |
public String getDirectionStr() {
String dir = direction.name().toLowerCase();
switch(dir) {
case "northwest":
dir = "NW";
break;
case "northeast":
dir = "NE";
break;
case "east":
dir = "E";
break;
case "west":
dir = "W";
break;
case "southwest":
dir = "SW";
break;
case ... | 6 |
private void jButtonPreviousActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonPreviousActionPerformed
ctrlP.precedent();
}//GEN-LAST:event_jButtonPreviousActionPerformed | 0 |
public void checkOutFile( ByteBlob data, long mtime, String path, OnFileCollision onFileCollision, Run run )
throws CollisionException, IOException
{
FileMetadata md = filesystem.getMetadata(path);
if( md != null ) {
switch( onFileCollision ) {
case ABORT: throw new CollisionException(path+" already exists... | 8 |
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 void setBiggestP() {
biggestRank = Rank.Engineer;
for (int row = 0; row < RowNum; ++row) {
// for all pieces on the board
// find the piece with the biggest rank on the board
// that belongs to us
for (int col = 0; col < ColNum; ++col) {
Piece p = getPi... | 9 |
public static WifesGlobalState getSingleton(){
// needed because once there is singleton available no need to acquire
// monitor again & again as it is costly
if(singleton==null) {
synchronized(WifesGlobalState.class){
// this is needed if two threads are waiting at the monitor at t... | 2 |
public boolean setParams(Properties props) {
// TODO Consider having it fall back to defaults for missing props
// Look up each property
SEGMENTER_NAME = props.getProperty(SEGMENTER_PROP);
STRESS_SENSITIVE_LOOKUP = new Boolean(props.getProperty(STRESS_SENSITIVE_PROP));
USE_TRUST = new Boolean(props.getProper... | 6 |
protected String createXYZ()
{
return "<i>xy</i><sup>" + myLemma.getI() + "</sup><i>z</i>";
} | 0 |
public static int keyIdRequired(int roomId) {
return keyRequired[roomId-1];
} | 0 |
private static ArrayList<Ability> generateAbilities(int numberOfAbilities) {
ArrayList<Ability> abilities = new ArrayList<Ability>(numberOfAbilities+1);
abilities.add(Ability.ATTACK);
ArrayList<Ability> possibleAbilities = new ArrayList<Ability>(Arrays.asList(Ability.values()));
possibleAbilities.remove(Ability... | 3 |
private void putMarkInTheConnerOfTheMatrix (Square square, Mark mark) {
Random rand = new Random(System.currentTimeMillis());
do {
switch (rand.nextInt(4)) {
case 0:
mark.setLeftCoord('1');
mark.setTopCoord('a');
... | 5 |
public XMLNode setName(String name) {
if(name == null || name.isEmpty()) {
throw new TXMLException("Names of nodes cannot be null or empty");
} else if(name.matches("[0-9" + TXML.PUNC + "](.+)?")) {
throw new TXMLException("Name '" + name + "'is invalid,"
+ " names of nodes cannot start with numbers or p... | 4 |
public void draw(Graphics2D g) {
// Draw the map image
g.drawImage(_image, 0, 0, null);
//Draw the locations
for(int i=0;i<mygraph.getCurr();i++){
mygraph.locations[i].draw(g);
}
// Draw the line
for(int i=0;i<mygraph.getCurr();i++){
for(int j=i+1;j<mygraph.getCurr();j++){
... | 7 |
public static void main(String[] args) {
DB database = new DB();
if (database.init()) {// ɹݿ¼
LoginFrame frame = new LoginFrame(database);
frame.setVisible(true);
} else
JOptionPane.showMessageDialog(null, "ݿʧ", "",
JOptionPane.ERROR_MESSAGE);
} | 1 |
public static String getShortUnitText(double v, String u) {
double va = Math.abs(v);
if (va < 1e-13) {
return null;
}
if (va < 1e-9) {
return shortFormat.format(v * 1e12) + "p" + u;
}
if (va < 1e-6) {
return shortFormat.format(v * 1e9) ... | 8 |
public HawkWwwAuthenticateContext build() throws HawkException {
/*
* If this is a builder for/from a header that has a ts-parameter...
* (tsm can be set (when parsed from header) or null, in which case
* it will be generated when a header is built from us.
*/
if (this.ts != 0) {
/*
* Si... | 6 |
private void computerTurn() {
if(!isPlay) return;
int []pos = game.nextMove(computer);
if(pos!=null) {
int i = pos[0];
int j = pos[1];
buttons[i][j].setText(chars[computer]);
game.setBoardValue(i,j,computer);
}
checkState();
} | 2 |
private void printTime(double time) {
System.out.println("Average time taken: " + time + " ms");
} | 0 |
public boolean ModificarProveedor(Proveedor p){
if (p!=null) {
cx.Modificar(p);
return true;
}else {
return false;
}
} | 1 |
@Override
public void run() {
// InputStream.read(buf, offs, len)
InputStream is;
byte[] length_buffer = new byte[4];
byte[] message_buffer = new byte[2048];
int message_length;
int num_touches;
ByteBufferView view = new ByteBufferView(length_buffer);
... | 7 |
private void createAttachements( List<EndPoint> endPoints, Side side ){
sort( endPoints, side );
int sx = startX( side );
int sy = startY( side );
int tx = endX( side );
int ty = endY( side );
int dx = (tx - sx) / (endPoints.size()+1);
int dy = (ty - sy) / (endPoints.size()+1);
int d... | 1 |
public List<String> getSongPath() {
if (songPath == null) {
songPath = new ArrayList<String>();
}
return this.songPath;
} | 1 |
public static PassengerCommsFacilityEnumeration fromValue(String v) {
for (PassengerCommsFacilityEnumeration c: PassengerCommsFacilityEnumeration.values()) {
if (c.value.equals(v)) {
return c;
}
}
throw new IllegalArgumentException(v);
} | 2 |
public void doLoop() {
String insert="insert into paperTermcount(paperid,count)values(?,?);";
int num=0;
try {
PreparedStatement statement=sqLconnection.conn.prepareStatement(insert);
this.rs=getPaperID();
while (rs.next()) {
int id = rs.getInt("paperid");
int termcount = getCount(id);
statem... | 3 |
private void maybeReconnectOnOpen() {
if (!this.openReconnect && !this.reconnecting && this._reconnection) {
this.openReconnect = true;
this.reconnect();
}
} | 3 |
public void create(){
if(!sDir.exists()){
sDir.mkdir();
}
if(!playerData.exists()){
playerData.create();
setupPlayerData();
}
if(!inventoryData.exists()){
inventoryData.create();
}
if(!worldData.exists()){
worldData.create();
}
} | 4 |
private void InitDH()
{
this.PublicKey = new BigInteger("0");
while (this.PublicKey.equals(zero))
{
this.Prime = BigInteger.probablePrime(BITLENGTH, new Random());
this.Generator = BigInteger.probablePrime(BITLENGTH, new Random());
this.PrivateKey = new BigInteger(GenerateRandomHexString(30), 16);
... | 2 |
public Shape rotateRight() {
if (pieceShape == Tetrominoes.SquareShape)
return this;
Shape result = new Shape();
result.pieceShape = pieceShape;
for (int i = 0; i < 4; ++i) {
result.setX(i, -y(i));
result.setY(i, x(i));
}
return result;
} | 2 |
@Override
public void actionPerformed(ActionEvent e) {
if (e.getSource() == addbtn) {
AddProduct s = new AddProduct("เพิ่มสินค้า");
}
if (e.getSource() == salebtn) {
ProductSale s = new ProductSale("ขายสินค้า");
}
if (e.... | 3 |
public V put(K key, V value) {
searchElement(key);
// Previous value associated with the key
V previousValue = null;
if (_searchHolder == null) {
// Create the bucket sub-array if there is none
if (buckets.getElement(_searchBucketIndex) == null) {
... | 3 |
@SuppressWarnings("unchecked")
public List<Order> getAllPendingOrders() {
return (List<Order>)this.em.createNamedQuery("findAllPendingOrders").getResultList();
} | 0 |
public Bncd(File f)
{
ArrayReader inp = new ArrayReader(f.getContents());
inp.readInt(); //Magic;
unk = inp.readShort();
int entryCount = inp.readShort();
int entriesOffset = inp.readInt();
int subEntriesOffset = inp.readInt();
int dataOffset = inp.readInt();
... | 3 |
public byte[] parse() {
if ( filename == null ) return null;
Scanner file = readerOpen();
if ( file == null ) return null;
// Checks for nulls and returns, expects
// Caller to do something with this
byte[] squares = new byte[128];
String x;
for ( int i = 0; i < 128; i ++ ) {
if ( ( i & 0x88 ) != 0 )... | 6 |
public synchronized byte[] getBlock(int offset, int length){
if(!this.completed)
return null;
if(offset + length > this.length)
return null;
byte[] block = new byte[length];
for(int i = 0; i < length; i++){
block[i] = this.data[offset + length];
}
return block;
} | 3 |
public boolean move() {
decreaseMoveDelay(); //csökkenti a késleltetést
if (moveDelay==0) { //ha 0 a késleltetés
if (((PathTile) currentTile).getNextTiles().size()>0) {
ArrayList<Tile> nextTile = ((PathTile) currentTile).getNextTiles();//lekéri az elérhető cellákat
((PathTil... | 5 |
static final public void primaire() throws ParseException {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case VRAI:
case FAUX:
case entier:
case ident:
valeur();
break;
case 52:
jj_consume_token(52);
expression();
jj_consume_token(54);
break;
default:
jj_... | 6 |
public void run() {
// Launch the pipeline, and execute each stage in sequence.
while (this.isRunning) {
// Start FETCG stage.
if (fetchStage.execute() != 0) {
// FETCH stage failed.
log.error("FETCH stage failed. Please check");
}
// Start ISSUE stage
if (issueStage.execute() != 0... | 9 |
private void sendOrderCaps(RdpPacket_Localised data) {
byte[] order_caps = new byte[32];
order_caps[0] = 1; /* dest blt */
order_caps[1] = 1; /* pat blt */// nb no rectangle orders if this is 0
order_caps[2] = 1; /* screen blt */
order_caps[3] = (byte) (Options.bitmap_caching ? 1 : 0); /* memblt */
order_c... | 7 |
private void input() {
if (Keyboard.isKeyDown(Keyboard.KEY_W) || Keyboard.isKeyDown(Keyboard.KEY_UP)) {
platform.setDY(-SPEED);
}
else if (Keyboard.isKeyDown(Keyboard.KEY_S) || Keyboard.isKeyDown(Keyboard.KEY_DOWN)) {
platform.setDY(SPEED);
}
else if (Keyb... | 8 |
private AlgebraicParticle multiply(AlgebraicParticle a, AlgebraicParticle b) {
//if a is a fraction and b is the bottom of that fraction
if(a instanceof Fraction && ((Fraction)a).getBottom().equals(b)) {
Fraction frac = (Fraction) a;
//return the top of the fraction, making sure it's got the right sign
ret... | 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.