text stringlengths 14 410k | label int32 0 9 |
|---|---|
@Column(name = "item_id")
@Id
public int getItemId() {
return itemId;
} | 0 |
public void mouseEntered(MouseEvent e) {
} | 0 |
* @param string2
* @param otherstrings
* @return String
*/
public static String string_concatenate(String string1, String string2, Cons otherstrings) {
if (otherstrings.length() == 0) {
return (Native.stringConcatenate(string1, string2));
}
{ StringBuffer result = null;
int length = s... | 6 |
private boolean positionJouable(Couleur uneCouleur, Position unePosition)
{
Case laCase = this.plateau.obtenirCase(unePosition);
if (laCase.estOccupee())
return false;
for (Direction direction : Direction.values())
{
if (encercleAdversaire(uneCouleur, laCase.obtenirPosition(),
direction))
retur... | 3 |
public static void Mute(CommandSender sender, String muted, Long time){
if (sender instanceof Player) {
if (!Access.canMute((Player) sender)){
sender.sendMessage(Msg.$("not-permitted"));
return;
}
if (time == -1) {
if (!Access.c... | 7 |
private void checkWorkerLiveness(){
//System.out.println("monitor timer expire!");
Set<Integer> workerIdSet = workerStatusMap.keySet();
Iterator<Integer> idIterator = workerIdSet.iterator();
while(idIterator.hasNext()){
int id = idIterator.next();
if(work... | 3 |
public int read(byte[] buffer, int offset, int length) {
if (closed) {
return -1;
}
int totalBytesRead = 0;
while (totalBytesRead < length) {
int numBytesRead = super.read(buffer,
offset + totalBytesRead,
length - totalBytesRead);
... | 3 |
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
CreateManager frame = new CreateManager();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
} | 1 |
@Test
public void resolve() {
long[][] data = loadArrays("data"+File.separator+"p018.txt");
int E=data.length-1;
for(int i=E-1;i>=0;i--){
for(int j=0;j<=i;j++){
data[i][j]+=data[i+1][j]>data[i+1][j+1]?data[i+1][j]:data[i+1][j+1];
}
}
print(data[0][0]);
} | 3 |
public static ThrowCalculator makeCalculator(String difficulty) {
if (difficulty.equalsIgnoreCase("random")) {
return new RandomThrow();
} else {
return new SmartThrow();
}
} | 1 |
public static void cppHelpOutputBinaryOperator(Cons expression, int nestlevel) {
{ Stella_Object arg1 = expression.value;
StringWrapper op = ((StringWrapper)(expression.rest.value));
Stella_Object arg2 = expression.rest.rest.value;
if (StringWrapper.cppNestedOperatorNeedsParenthesesP(op, arg1)) {... | 9 |
public void setQuery(String query) {
this.query = query;
if (this.query != null) {
this.query_list = new ArrayList();
parseQuery(this.query_list, this.query);
}
} | 1 |
@Test
public void testIsBrowser() {
assertTrue(Application.GMAIL.isInReferrerString("http://mail.google.com/mail/?ui=1&ik=xx&view=cv&search=inbox&th=xx&ww=xx&cvap=5&qt=&zx=xx"));
} | 0 |
@SuppressWarnings("static-access")
public ProcessCommandImpl(Socket requestSocket1,
PropertiesConfiguration prop2) {
try {
this.requestSocket = requestSocket1;
this.prop =prop2;
wait = prop.getInt("ThreadSleep_period");
timePeriod=prop.getInt("TimePeriod");
printWriter = new PrintWriter(request... | 6 |
public PerformanceRecord getPerformanceRecord(String fileName) throws IOException {
BufferedReader reader = new BufferedReader (new FileReader(fileName));
String line;
String result = "";
String propertyVerified = "";
double userTime = 0;
double systemTime = 0;
long bddNodes = 0;
String formatted = "... | 9 |
private void setScores(){
String eol = System.getProperty("line.separator");
String name;
String score;
try{
Writer output = new BufferedWriter(new FileWriter(scorecard));
if(scores.size() == 0){
output.write("JCAL" + eol);
output.w... | 3 |
public int getRightDiag(int i, int j, int r) {
int sum = 0;
int imax = this.length;
int jmax = this.width;
for (int n = 0; n <= 2 * r; n++) {
int ii = topo.idI(i + r - n, j - r + n, imax, jmax);
int jj = topo.idJ(i, j - r + n, imax, jmax);
if ( (!(ii < 0) && !(ii >= imax)) && (!(jj < 0) && !(jj >= jmax... | 7 |
public int destroy() {
if (lifecycleSupport == null) {
return handleErrno(Errno.ENOTSUPP);
}
if (log != null && log.isDebugEnabled()) {
log.debug("destroy: shutdown filesystem");
}
try {
return handleErrno(lifecycleSupport.destroy());
... | 4 |
static void build_key_square(char[][] square,String key)
{
boolean[] filled=new boolean[26];
String key_u=key.toUpperCase();
int cur_row=0;
int cur_col=0;
for(int i=0;i<key_u.length();i++)
{
char cur_c=key_u.charAt(i);
if(cur_c=='J')
{
cur_c='I';
}
int order=cur_c-'A';
i... | 8 |
public float getPreferredSpan(int axis) {
int extra = 2*(getBorder()+getSpace(axis));
switch (axis) {
case View.X_AXIS:
return fWidth+extra;
case View.Y_AXIS:
return fHeight+extra;
default:
throw new IllegalArgumentException("Invalid axis: " + axis);
}
} | 2 |
public static int numberOfDays (int num)//enter month number
{
if (num==1||num==3||num==5||num==7||num==8||num==10||num==12)
return 31;
else if (num==2)
return 28;
else if (num==-2)//leap year
return 29;
else
return 30;
} | 9 |
public void update(World w)
{
repaint();
currGeneration = w.getGeneration();
int nxtPopulation = w.getPopulation();
double growthRate = 0.0, deathRate = 0.0;
if (currGeneration == 0)
{
maxPopulation = nxtPopulation;
minPopulation = nxtPopulation;
}
else
{
growthRa... | 5 |
static public Object deserializeArray(InputStream in, Class elemType, int length)
throws IOException
{
if (elemType==null)
throw new NullPointerException("elemType");
if (length<-1)
throw new IllegalArgumentException("length");
Object obj = deserialize(in);
Class cls = obj.getClass();
... | 6 |
public void update() {
getNextPosition();
checkTileMapCollision();
setPosition(xtemp, ytemp);
//check flinching
if(flinching) {
long elapsed = (System.nanoTime() - flinchTimer) / 1000000;
if(elapsed > 400) {
flinching = false;
}
}
// if hits a wall, go other direction
if(facingRigh... | 6 |
public static String escapeString(String str) {
try
{
escapeHelper.setString(1, str);
} catch (SQLException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
String rtn = escapeHelper.toString();
return rtn.substring( rtn.indexOf( ": " ) + 2 );
} | 1 |
@Override
protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws IOException {
try {
String title=request.getParameter(Room.TITLE);
int masterRoom=Integer.parseInt(request.getParameter(Room.MULTIPURPOSE_ROOM));
int capacity=Integer.parseInt(request.getParameter(Room.C... | 5 |
public static void multiplicatoria(TreeMap<Integer, Integer> raiz) {
TreeMap<Integer, Integer> casa = (TreeMap<Integer,Integer>)raiz.clone();
for (Entry<Integer, Integer> entry : casa.entrySet()) {
if (entry.getKey() < 500 && !arr[entry.getKey()])
continue;
int i = 0;
for (i = 0; i < primos.length; i+... | 9 |
public void close(Connection con,PreparedStatement preparedStatement,ResultSet rs){
try {
if(rs!=null){
rs.close();
rs = null;
}if(preparedStatement!=null){
preparedStatement.close();
preparedStatement = null;
}if(con!=null&&!con.isClosed()){
con.close();
con = null;
}
} catch (S... | 5 |
static public void decodeFile(String src)
{
byte[] fileBytes;
try {
fileBytes = read(new File(src));
for(int n=0;n<fileBytes.length;n++)
{
fileBytes[n]-=key;
}
write(src, fileBytes);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IO... | 3 |
@Override
public void execute(VGDLSprite sprite1, VGDLSprite sprite2, Game game)
{
int[] gameSpriteOrder = game.getSpriteOrder();
int spriteOrderCount = gameSpriteOrder.length;
for(int i = 0; i < spriteOrderCount; ++i)
{
int spriteTypeInt = gameSpriteOrder[i];
... | 4 |
public void stopCurrentBattle() {
if(current != null) {
// shut it down to stop it quickly
current.stop();
current.setFPS(BattleRunner.START_FPS);
// unpause it (or it will never stop)
if(current.isPaused()) {
current.setPaused(false);
}
current = null;
}
} | 2 |
protected void doTestCycAccess14(CycAccess cycAccess) {
long startMilliseconds = System.currentTimeMillis();
if (cycAccess.getCycConnection() != null) {
System.out.println(cycAccess.getCycConnection().connectionInfo());
} else {
System.out.println("CycConnection info is null.");
}
rese... | 4 |
@Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
if((mob.location().domainType()!=Room.DOMAIN_INDOORS_CAVE)
&&((mob.location().getAtmosphere()&RawMaterial.MATERIAL_ROCK)==0))
{
mob.tell(L("This magic only works in caves."));
return false;
... | 7 |
@SuppressWarnings ( {
"unused", "resource"
} )
@Test
public void testWriteJournal () throws Exception {
if ( this.socketAddress == null ) {
return;
}
try ( AFUNIXSocket sock = connectToServer() ) {
System.err.println("Client running");
In... | 2 |
public void randomState()
{
Random rand = new Random();
int index = rand.nextInt(5);
this.clearLore();
int copy = index;
HashMap<String,Integer> map = new HashMap<String, Integer>();
for(Map.Entry<String,Sender> entry : Main.map.entrySet()){
if(entry.... | 5 |
@Override
public String toString() {
return "MESSAGE(MULTICASTMESSAGE)\n{"+ source +"->"+ dest +" seqNum:"+ seqNum +" duplicate:"+ duplicate +" kind:"+ kind
+" data:"+ data +" \nTIMESTAMP[:" + this.timeStamp + " ]\nACK:" + this.acknowledgement + "} "
+ "\nGROUPCLOCK = {" + clockForGroup.toString() + "}";... | 0 |
public DatosIteracion masVisibles() {
DatosIteracion d = new DatosIteracion("auxiliar");
Lectura l = new Lectura(999999, 0, 0);
d.getValoresLecturas().add(l);
for (int i = 0; i < this.getValoresIteraciones().size(); i++) {
if (d.getValoresLecturas(d.getValoresLecturas().size() - 1)
.getnNodos() < thi... | 4 |
public boolean deleteProdutos(Produtos produtos){
this.getConectaBanco();
try {
if (this.getConn()!= null || !this.getConn().isClosed()) {
this.getConn().setAutoCommit(false);
this.setStmt(this.getDeleteProdutos());
this.getStmt().setInt(1, produtos.getIdProduto());
this.get... | 5 |
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
CadQuestButton = new javax.swing.JButton();
ConsQuestButton = new javax.swing.JButton();
ImportAlunoButton = new javax.swing.JButton()... | 7 |
@EventHandler
public void onPlayerJoin(PlayerJoinEvent event) {
Player player = event.getPlayer();
if (!playerConfig.contains("players." + player.getUniqueId().toString())) {
playerConfig.set("players." + player.getUniqueId().toString() + ".name", player.getName());
playerConfigClass.saveConfig();
... | 5 |
public void setLineeOrdine(List<OrderLine> lineeOrdine) {
this.lineeOrdine = lineeOrdine;
} | 0 |
Node add(Node t, Object key, Object val, Box found){
if(t == null)
{
if(val == null)
return new Red(key);
return new RedVal(key, val);
}
int c = doCompare(key, t.key);
if(c == 0)
{
found.val = t;
return null;
}
Node ins = c < 0 ? add(t.left(), key, val, found) : add(t.right(), key, val, found);
... | 6 |
public String getFixedFee() {
return FixedFee;
} | 0 |
double rate(Board board) {
int holes = 0;
// Count the holes, and sum up the heights
for (int x=0; x<board.getWidth(); x++) {
final int colHeight = board.getColumnHeight(x);
int y = colHeight - 2; // addr of first possible hole
while (y>=0) {
if (!board.getGrid(x,y)) {
holes++;
}
... | 3 |
private boolean checkModels(List<Particle> seqParticles, List<Particle> paraParticles) {
for(Particle p1: seqParticles){
for(Particle p2: paraParticles){
if(compareParticles(p1,p2)){
paraParticles.remove(p2);
break;
}
}
}
if(paraParticles.size() == 0)
return true;
return false;
} | 4 |
private void dealtDamage()
{
if (player.equals("P1"))
{
if (direction)
{
getWorld().addObject(new P1AttackArea(x,y,1000,50,1,0,2.0,2,direction),x, y);
}
else
{
getWorld().addObject(new P1AttackArea(x,y,10... | 4 |
public static void main(String[] args) throws IOException {
Scanner in = null;
FileReader fin = null;
/* If there is one argument, it is the file to be read from. */
if (args.length == 0) {
in = new Scanner(System.in);
} else if (args.length == 1) {
fin =... | 7 |
public int getColumnHeight(int x) {
if(caching && !columnHeightDirties[x]) {
return _columnHeights[x];
}
columnHeightDirties[x] = false;
for (int j = height - 1; j >= 0; j--) {
if (grid[x][j]) {
return (_columnHeights[x] = j+1);
}
}
return (_columnHeights[x] = 0);
} | 4 |
public void update(double time_difference) {
// Update delay
if (is_delaying) {
if (delay_timer <= 0) {
is_delaying = false;
} else {
delay_timer = Math.max(0, delay_timer - time_difference);
return;
}
}
// Update timer
timer += time_difference;
if (timer >= typing_wait) {
timer -= t... | 8 |
Atom merge( Atom other ) throws Exception
{
if ( other instanceof Fragment )
{
// if the other is a fragment then add it as a new row
Fragment f = (Fragment)other;
if ( !contains(f) )
{
Row r = new Row( sigla, groups, base );
... | 3 |
@Override
protected Void doInBackground()
{
String search = "https://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=";
search += button.getText().replace(" ", "+") + "+imdb";
try
{
URL url = new URL(search);
URLConnection connection = url.openConnection();
String line;
... | 7 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Funcionario other = (Funcionario) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return ... | 6 |
public static void changeGrade() throws IOException
{
fillArray.createArraylist();
makeGPA.createGPA();
for(int x=0;x<Students.database.size(); x++)
{
System.out.println("\n" + (x+1)+".)"+" "+Students.database.get(x));
}
System.out.println("What is the number of the student you would like to change."... | 5 |
private double getSimpleMass(Body body1, Body body2) {
double mass = 0;
Body ancestor = body1.parent;
while (ancestor != null) {
if (ancestor == body2) {
return body2.mass;
}
ancestor = ancestor.parent;
}
if (body1.parent == body2.parent
// Sibling case: bundle niblings with siblings
|| bod... | 6 |
public boolean tarkistaLoppusumma(){
int summa = 0;
for (Tulosruutu ruutu : pelaaja.annaTulosrivi().annaTulosruudut()){
if(ruutu.annaTyyppi().tyyppi!=17&&ruutu.annaTyyppi().tyyppi!=18){
summa = summa + ruutu.annaPisteet();
}
}
pelaaja.... | 3 |
private void drawStores(Graphics g){
int screenRes = Toolkit.getDefaultToolkit().getScreenResolution();//Using Toolkit class and the calculate the correct font size
int fontSize = (int)Math.round(7 * screenRes / 72.0); //calculate the correct font size
Font f = new Font("Arial", Font.BOLD, fontSize);
... | 3 |
public int diferenca(Data d1) {
int totalDias = contaDias();
int totalDias1 = d1.contaDias();
return Math.abs(totalDias-totalDias1);
} | 0 |
public Double checkEmotionalSentiment ( String str ) {
// System.out.println("hhh : " + str);
if ( isPositiveSentiment(str) ) return 1.0;
else if ( isNegativeSentiment(str) ) return -1.0;
return 0.0;
} | 2 |
public boolean isUpperHessenberg(){
boolean test = true;
for(int i=0; i<this.numberOfRows; i++){
for(int j=0; j<this.numberOfColumns; j++){
if(j<(i+1) && this.matrix[i][j]!=0.0D)test = false;
}
}
return test;
} | 4 |
protected void update(Color winner, Board finalBoard, boolean[][][] moves) {
sims++;
if (winner != turn)
wins++;
// Update AMAF (RAVE) values
if (isLeaf && !isRoot) {
int parentTurn = parent.turn.ordinal();
for (Node sibling: parent.children) {
int x = sibling.recentPoint.x, y = sibling.recentPoin... | 9 |
public void saveNewItem(PosListaPrecio itemOracle,
int idPos){
if (itemOracle.getPcaPrecioVenta() == null) {
logger.info(" ======== ITEM NO CREADO Precio de Venta NULO ======== ");
logger.info("itemOracle.getPcaIdElemento() = " + itemOracle.getPcaIdElemento());
logger.info("item... | 3 |
private boolean isColorTaken(JoinGameRequest request,
List<PlayerDescription> players, int playerGameIndex) {
boolean colorTaken = false;
for (int i = 0; i < players.size(); i++) {
PlayerDescription pd = players.get(i);
if (pd.getColor().toLowerCase().equals(request.getColor().toLowerCase()) && i != player... | 3 |
private static boolean isFloat(String lexeme) {
// Double.parseDouble and Float.parseFloat does not work for this
char firstChar = lexeme.charAt(0);
if (firstChar == '.') {
return false;
}
if (!lexeme.contains(".")) {
return false;
}
int count = 0;
char[] lexemeArray = lexeme.toCharArray();
f... | 6 |
public void resetTabIcons() {
ArrayList icons = new ArrayList();
DockKey k = getDockable().getDockKey();
if(k.isCloseEnabled() && isCloseButtonDisplayed) {
icons.add(closeSmartIcon);
}
if(k.isMaximizeEnabled() && isMaximizeButtonDisplayed) {
icons.add(maximizeSmartIcon);
}
if(k.isAutoHideEnabled() &... | 9 |
private void affine_nearest_xy(final Image image, final Image affined) {
// Initialization:
messenger.log("Nearest-neighbor sampling in x-y");
progressor.status("Affine transforming"+component+"...");
progressor.steps(odims.c*odims.t*odims.z*odims.y);
// Affine transform using the backward transformatio... | 9 |
public void run() {
if (this.recipients == null) {
for (String messageLine : this.message.split("\n")) Bukkit.broadcastMessage(messageLine);
}
else if (this.recipients.isEmpty()) {
for (String messageLine : this.message.split("\n")) this.sender.sendMessage(messageLine);
}
else {
Str... | 6 |
static String isField(ClassPool pool, ConstPool cp, CtClass fclass,
String fname, boolean is_private, int index) {
if (!cp.getFieldrefName(index).equals(fname))
return null;
try {
CtClass c = pool.get(cp.getFieldrefClassName(index));
if (c =... | 5 |
public static String getServerIP(){
if(serverip == null) {
final int port = Bukkit.getPort();
if(Bukkit.getServer().getIp() == null){
serverip = Bukkit.getServer().getIp();
if (port != 25565)
serverip += ":"+port;
}
URL whatismyip;
try {
whatismyip = new URL("http://BattlePunishme... | 5 |
public Drivability isDriveable(Vehicle c) {
if (c.getOrientation()== _lightControl.getState().getAllowedOrientation()) {
if (_lightControl.getState().isYellow()) {
return Drivability.Caution;
}
return Drivability.Driveable;
} else {
return Drivability.NotDriveable;
}
} | 2 |
public void testSetSecondOfMinute_int2() {
MutableDateTime test = new MutableDateTime(2002, 6, 9, 5, 6, 7, 8);
try {
test.setSecondOfMinute(60);
fail();
} catch (IllegalArgumentException ex) {}
assertEquals("2002-06-09T05:06:07.008+01:00", test.toString());
} | 1 |
@Override
public void maskedCopyFrom(MapLayer other, Area mask) {
Rectangle boundBox = mask.getBounds();
for (int y = boundBox.y; y < boundBox.y + boundBox.height; y++) {
for (int x = boundBox.x; x < boundBox.x + boundBox.width; x++) {
if (mask.contains(x,y)) {
... | 3 |
public boolean shouldDefer(StringAppender inBuf) {
char[] buffer = new char[inBuf.length()];
inBuf.getChars(0, inBuf.length(), buffer, 0);
depth = cdepth = 0;
for (int i = 0; i < buffer.length; i++) {
switch (buffer[i]) {
case '/':
if (i + 1 < buffer.length && buffer[i + 1] == '... | 9 |
public static void download(URL url, File file) throws IOException {
if (!file.getParentFile().exists())
file.getParentFile().mkdir();
if (file.exists())
file.delete();
file.createNewFile();
int size = url.openConnection().getContentLength();
Util.info("Downloading " + file.getName() + " (" + size / 102... | 4 |
private void sendColorMessage(Color c, Node to) {
S4Message msg = new S4Message();
msg.color = c;
if(Tools.isSimulationInAsynchroneMode()) {
// sending the messages directly is OK in async mode
if(to != null) {
send(msg, to);
} else {
broadcast(msg);
}
} else {
// In Synchronous mode, a n... | 3 |
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onBlockPlace(BlockPlaceEvent event)
{
// CAUTION:This event fires, BEFORE the placed block is removed from the inventory!
// therefore, delay all checks for 1 tick because "itemInHand()" is needed for checks
// ... | 7 |
void test() {
// Объявляем переменные
int x=127, y;
// y - не инициализированная переменная,
// использовать её компилятор не даст
//x=y; // => Ошибка компиляции
double фыва=77.7; // можно, но не нужно!
String myFirstString="Hello!"; /... | 8 |
public ArrayList<String> getSensorRecord(String sensor_id) throws NotFoundException, IllegalAccessError, SocketTimeoutException {
ArrayList<String> recordList = new ArrayList<String>();
try {
clientSocket.Escribir("HISTORICO " + sensor_id + '\n');
serverAnswer = clientSocket.Leer();
recordList.add(new Stri... | 7 |
public static void main (String args[]){
Scanner entrada = new Scanner(System.in);
System.out.println("Digite um número: \n"+
"1 – calcular o fatorial de um número dado\n" +
"2 – calcular a raiz quadrada de 3 números dados\n" +
"3 – imprimir a tabuada comp... | 7 |
public static Method getAsMethodOfPublicBase(Class<?> c, Method m){
for(Class<?> iface : c.getInterfaces()){
for(Method im : iface.getMethods()){
if(isMatch(im, m)){
return im;
}
}
}
Class<?> sc = c.getSuperclass();
if(sc == null){
return null;
}
for(M... | 9 |
@Override
public void ParseIn(Connection Main, Server Environment)
{
DatabaseClient DB;
try {
DB = new DatabaseClient(Environment.DataBase);
}
catch (Exception ex)
{
Environment.Log.Print(ex);
Main.Disconnect();
return;
... | 7 |
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 |
private GuanYu fetchValueFromRequest(HttpServletRequest request,GuanYu guanYu) {
String id = StringUtil.toString(request.getParameter("id"));
String gsjianjie = StringUtil.toString(request.getParameter("gsjianjie"));//公司简介 中文
String tzcelue = StringUtil.toString(request.getParameter("tzcelue"))... | 7 |
@Override
public void mouseReleased(MouseEvent e) {
if (!potentialDrag) {
return;
}
source.removeMouseMotionListener(this);
potentialDrag = false;
if (changeCursor) {
source.setCursor(originalCursor);
}
if (destination instanceof JCo... | 7 |
private byte compareDate(byte[] date1, short offset1, byte[] date2,
short offset2) {
short year1 = (short) ((short) (date1[offset1] * 10) + date1[(short) (offset1 + 1)]);
short year2 = (short) ((short) (date2[offset2] * 10) + date2[(short) (offset2 + 1)]);
short month1 = (short) ((sh... | 6 |
public void inputHandler() {
if(Keys.isPressed(Keys.ENTER)) select();
if(Keys.isPressed(Keys.UP)) {
if(currentChoise > 0) {
//AudioBox.play("menuChanged", 0);
currentChoise--;
}
}
if(Keys.isPressed(Keys.DOWN)) {
if(currentChoise < options.length - 1) {
//AudioBox.play("menuChanged", 0);
... | 5 |
@Deprecated
public boolean createTable(String query) {
Statement statement = null;
if (query == null || query.equals("")) {
this.writeError("Could not create table: query is empty or null.", true);
return false;
}
try {
statement = connection.createStatement();
statement.execute(query);
... | 3 |
public ContentObject changeTypeOfRegion(ContentObject region, RegionType newType) throws IllegalArgumentException {
if (region == null || !(region.getType() instanceof RegionType))
throw new IllegalArgumentException("Not a region: "+region.getType());
if (region.getType().equals(newType))
return region;
... | 8 |
public Priority getPriority() {
return priority;
} | 0 |
public void draw(Graphics2D g) {
Tool tool = controls.getTool();
// vykresli polhranu
if (begin != null && graph.player.state == RunState.stopped
&& tool.compatible(ToolType.create) && tool.compatible(ToolTarget.edge)) {
g.setColor(new Color(0, 0, 0));
g.d... | 4 |
public void setState(int state) {
this.state = state;
if(container != null) {
container.fireEvent(new StateChangeEvent(this, this.state));
}
} | 1 |
protected void setFocusToButton(int i) {
if (i > this.buttons.length) {
throw new IllegalArgumentException();
}
this.buttons[i].grabFocus();
} | 1 |
public Knowledge() {
//ArrayList<Event> tempEvents = new ArrayList<>();
events = new ArrayList<>();
/*
************************************************************************
*/
String[] czajowniaDescription;
czajowniaDescription = new String[4];
czajo... | 0 |
public void testContains() {
final String cols = "stringCol,doubleCol,dateCol,bigDecimalCol,intCol\r\n"//
+ "hello,2.20,20140523,123.45,6\r\n"//
+ ",,,,"//
;
final Parser p = DefaultParserFactory.getInstance().newDelimitedParser(new StringReader(cols), ','... | 2 |
public String toString()
{
final StringBuffer buf = new StringBuffer(30);
buf.append("Busmon.ind ");
if (tstampType == TYPEID_TIMESTAMP_EXT)
buf.append("ext.");
buf.append("timestamp ");
buf.append(tstamp);
buf.append(" seq ").append(getSequenceNumber());
// buf.append(" status 0x").append(Integer.toHe... | 7 |
@Override
public void run() {
try {
String inputQuestion = this.mainForm.getInputQuestion().getText();
if (inputQuestion.equals(VAL)) {// 验证接入
vali();
} else if (inputQuestion.equals(EVENT_CLICK_KEY)){
handleClick();
} else if(inputQuestion.equals(EVENT_VIEW_KEY)){
handleView();
}else ... | 4 |
@Override
public void mouseClicked(MouseEvent e) {
} | 0 |
public void exit(SimpleFrame frame)
{
File tempFile = new File(frame.fileName);
if(tempFile.exists()) tempFile.delete();
JFileChooser chooser = new JFileChooser();
chooser.setCurrentDirectory(new File("."));
if(frame.getIsChanged())
{
int selection = JOptionPane.showConfirmDialog(null,"Do you w... | 8 |
@Override
public boolean tick(Tickable ticking, int tickID)
{
if(tickID==Tickable.TICKID_MOB)
{
if((affected!=null)&&(affected instanceof MOB)&&(invoker!=null))
{
final MOB mob=(MOB)affected;
if(((mob.amFollowing()==null)
||(mob.amDead())
||(mob.location()!=invoker.location())))
{
m... | 8 |
private JPanel createCSSSettingsPanel()
{
final JPanel jp = new JPanel();
jp.setBorder(default_border);
BoxLayout bl = new BoxLayout(jp, BoxLayout.PAGE_AXIS);
jp.setLayout(bl);
JComponent cp = new JLabel(UIStrings.UI_CSS_NAME_LABEL);
setItemAlignment(cp);
jp.add(cp);
... | 8 |
public String getPositionOfPerson(Person person) {
if (person != null) {
for (Entry<String, Person> entry : castAndCrew.entrySet()) {
if (person.equals(entry.getValue())) {
return entry.getKey();
}
}
}
return "";
} | 3 |
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.