text stringlengths 14 410k | label int32 0 9 |
|---|---|
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 flatten(TreeNode root) {
if(root == null)
return;
TreeNode left = root.left;
TreeNode right = root.right;
previous = root;
flatten(left);
if(previous != root){
previous.right = right;
root.right = l... | 2 |
public int getPointCur() {
if (milestone.equalsIgnoreCase("alterations")) {
if (pointCur == 0)
return 0;
else if (pointCur < 3)
return -10;
else if (pointCur < 6)
return -15;
else
return -25;
}
return pointCur;
} | 4 |
public int exprHashCode() {
return 13 + (fromStack ? 0 : 1) + index + type.simple().hashCode();
} | 1 |
private void createBooks(Scanner s, ArrayList<Book> books, ArrayList<String> booksText) { // method to read Books.txt file and create user Objects
while (s.hasNextLine()) {
booksText.add(s.nextLine()); // fill string arraylist with lines from Books.txt
}
for (int i = 0; i < booksText.size(); i++) { // read eac... | 2 |
public void drawImg(ArrayList<Layer> layers) throws IOException {
int width = layers.get(0).colorArr[0].length;
int height = layers.get(0).colorArr.length;
BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
Graphics g = image.createGraphics();
f... | 3 |
public int getMaxValueLength(){
return maxValueLength;
} | 0 |
public void valueChanged( TreeSelectionEvent e )
{
TreePath path = warnings.getSelectionPath() ;
if (path != null)
{
Object source = path.getLastPathComponent() ;
if ( source != null )
{
if ( source instanceof TValueNode )
{
TValueNode vDummy = ( TValueNode ) so... | 4 |
public String getMFENumberVersion() {
if (mfeNumberVersion == null) {
return "1.0.0";
} else {
return mfeNumberVersion;
}
} | 1 |
private void init() throws Exception
{
// If this resource doesn't have any PEs then no useful at all
if (resource_.getNumPE() == 0)
{
throw new Exception(super.get_name() + " : Error - this entity " +
"has no PEs. Therefore, can't process any Gridlets.");
... | 4 |
public static void destroyDirectBuffer(Buffer toBeDestroyed) {
if (!isDirect(toBeDestroyed)) {
return;
}
BufferUtils.loadCleanerMethods();
try {
if (freeMethod != null) {
freeMethod.invoke(toBeDestroyed);
} else {
Obje... | 8 |
public void get(Powerup pu, Game game) {
if(pu.type == 0) {
level++;
if(level >= weapons[type].length) { level--; }
pu.die();
}
else if(pu.type == 1) {
level=0;
type++;
if(type >= 3) { type = 0; }
//if(level >= weapons[type].length) { level--; }
pu.die();
... | 7 |
private static boolean test4_3() throws FileNotFoundException {
String input = "new\n" + "drop key\n" + "drop rock\n" + "quit\n"
+ "yes\n";
HashMap<Integer, String> output = new HashMap<Integer, String>();
boolean passed = true;
try {
in = new ByteArrayInputStream(input.getBytes());
System.setIn(in... | 7 |
private void Declare() {
String name;
String type;
if(current.getId().substring(0,4).equals("TYPE")) {
type = current.getId();
nextToken();
if(current.getId().equals("VARNAME")) {
name = current.getLexeme();
nextToken();
if(current.getId().equals("ASSIGN")) {
Values.createVariable(type,n... | 6 |
@Override
public String getDefaultExtension() {
Iterator i = getExtensions();
while (i.hasNext()) {
String key = (String) i.next();
Boolean value = (Boolean) extensions.get(key);
if (value.booleanValue()) {
return key;
}
}
return null;
} | 2 |
public boolean executeLine(String line) {
if (system == null && line.startsWith("xearth")) {
extractDimension(line);
system = new PSystemXearth(width, height, config, markers);
return true;
}
if (system == null) {
return false;
}
if (line.startsWith("#") || line.startsWith("'")) {
return true;
... | 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 |
private JTabbedPane getFP() {
JTabbedPane tabbedPhases = new JTabbedPane();
for (int i = 0; i < xs.length; i++) {
for (int j = i + 1; j < xs.length; j++) {
String name = "x" + (j + 1) + "-x" + (i + 1);
FigurePanel phase = new FigurePanel(getName() + " " + name, "x"
+ (j + 1), "x" + (i + 1));
ph... | 3 |
public static void main(String args[]){
try{
ServerSocket ssocket = new ServerSocket(8888);
System.out.println("Server waiting!");
int clientcnt = 1; String name = "";
head = null;
while(true){
Socket socket = ssocket.accept();
System.out.println("A client has joined the rumble!");
MyConnec... | 2 |
public String tail(int lines) throws IOException {
java.io.RandomAccessFile fileHandler = null;
try {
fileHandler =
new java.io.RandomAccessFile( logFile, "r" );
long fileLength = logFile.length() - 1;
StringBuilder sb = new StringBuilder();
int line = 0;
... | 9 |
public <E> boolean validateSignature(Passable<E> sig, PublicKey pKey)
throws NoSuchAlgorithmException {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutput out = null;
try {
out = new ObjectOutputStream(bos);
out.writeObject(sig.data);
bos.close();
out.close();
} catch (IOExce... | 1 |
public boolean checkLimits(int x, int y, BoardModel boardModel) {
return (x >= 0 && x < boardModel.getBoardWidth() && y >= 0 && y < boardModel.getBoardHeight());
} | 3 |
final int getCurrentPercent() {
anInt3909++;
if (loadingStage == null)
return 0;
int stage = loadingStage.getStageId();
if (((LoadingStage) loadingStage).aBoolean1016 && (((LoadingStage) loadingStage).finalPercent > currentPercent))
return 1 + currentPercent;
if (stage < 0 || Class328_Sub2.loadingStages.... | 6 |
private void initCloseCode() throws InvalidFrameException {
code = CloseFrame.NOCODE;
ByteBuffer payload = super.getPayloadData();
payload.mark();
if( payload.remaining() >= 2 ) {
ByteBuffer bb = ByteBuffer.allocate( 4 );
bb.position( 2 );
bb.putShort( payload.getShort() );
bb.position( 0 );
code... | 7 |
void radf4(int ido, int l1, final double cc[], double ch[],
final double wtable[], int offset)
{
final double hsqt2=0.7071067811865475D;
int i, k, ic;
double ci2, ci3, ci4, cr2, cr3, cr4, ti1, ti2, ti3, ti4, tr1, tr2, tr3, tr4;
int iw1, iw2, iw3;
... | 7 |
public void buildMenu() {
logger.info("Building plugin menu");
menu.removeAll();
for (String name : constructors.keySet()) {
JMenuItem mi = new JMenuItem(name);
// ActionCommand contains the name of the plugin = key in the map
mi.setActionCommand(name);
mi.addActionListener(listener)... | 1 |
public void animate() {
for(int x = 0; x<mapTiles.size(); x++) {
mapTiles.get(x).animate();
}
} | 1 |
private boolean r_mark_suffix_with_optional_y_consonant() {
int v_1;
int v_2;
int v_3;
int v_4;
int v_5;
int v_6;
int v_7;
// (, line 153
// or, line 155
lab0: do {
... | 9 |
private boolean read() {
try {
final URLConnection conn = this.url.openConnection();
conn.setConnectTimeout(5000);
if (this.apiKey != null) {
conn.addRequestProperty("X-API-Key", this.apiKey);
}
conn.addRequestProperty("User-Agent", "U... | 4 |
public float getDiscount(int index){
return discount[index];
} | 0 |
@Override
public void run() {
//Attendre 1.5 seconde avant de faire exploser la bombe
try {
sleep((long) 1500);
}
catch(InterruptedException e) {}
state = true;
//Afficher l'animation d'explosion avec 0.05s entre chaque image
... | 4 |
public void checkDoors(){
for(int y = 0; y < height; y++){
for(int x = 0; x < width; x++){
if(getTile(x, y).equals(Tile.doorTileTD)) if(!getTile(x - 1, y).equals(Tile.wallTile) || !getTile(x + 1, y).equals(Tile.wallTile)) setTile(x, y, 1);
if(getTile(x, y).equals(Tile.doorTileLR)) if(!getTile(x, y - 1).equ... | 8 |
public Object nextElement() {
if (nextElement == null)
throw new NoSuchElementException();
Object answer = nextElement;
// Stay one ahead to facilitate the determination of hasMoreElements.
getNextElement();
return answer;
} | 1 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
EmailAddress that = (EmailAddress) o;
if (id != null ? !id.equals(that.id) : that.id != null) return false;
if (label != null ? !label.equals(t... | 7 |
public EditorPanel(EditorMain parent) {
addMouseWheelListener(new MouseWheelListener() {
public void mouseWheelMoved(MouseWheelEvent e) {
offy += e.getWheelRotation() * GRID_SIZE * 2;
repaint();
}
});
myparent = parent;
addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked... | 5 |
public void getTotalAtendimentosByStatus() {
Thread acao;
acao = new Thread(new Runnable() {
@Override
public void run() {
while (getTitle() != "") {
lb_qtdeAbertos.setText("0");
lb_qtdeExecutando.setText("0");
... | 7 |
public void shuffle(Align algorithm, String sq1, String sq2, final int numShuffles) {
if (monitor != null) {
monitor.setMinimum(0);
monitor.setMaximum(numShuffles);
}
float[] scores = new float[numShuffles];
float sumScores = 0;
for(int i = 0; i < numShu... | 7 |
@Override
public void move() {
Box newBounds = desiredLocation();
if (world.contains(newBounds)){
super.move();
}
} | 1 |
public void loadBoardConfig() {
try {
FileReader reader = new FileReader(layoutFile);
Scanner scan = new Scanner(reader);
String str;
String[] letters;
numColumns = 0;
numRows = 0;
for(int i=0; scan.hasNextLine(); i++, numRows++) {
str = scan.nextLine();
letters = str.split(",");
if (... | 7 |
public byte[] HandleRevealationMessage(RevealationMessageEventObject result)
{
//RevealationMessage message = new RevealationMessage(ByteBuffer.wrap(data));
switch(result.get_revealMessage()._revealationApi)
{
case (byte) 0xE3:
// ECM/Appliance Info
return HandleDeviceInformation(result.get_revealMes... | 7 |
public void unClick(Button b)
{
for(int i=0; i<buttons.size(); i++)
{
if(buttons.get(i).isSticky() && buttons.get(i)!=b)
{
buttons.get(i).deselect();
}
}
} | 3 |
public void waitForConsumers() {
Object[] threads;
synchronized(consumers) {
threads = new ArrayList(consumers.keySet()).toArray();
}
for(int i = 0; i < threads.length; i++) {
Thread thread = (Thread)threads[i];
if(thread != null && thread.isAlive()) {
try {
thread.join();
}
catch(Inte... | 4 |
@EventHandler
public void WitchHeal(EntityDamageByEntityEvent event) {
Entity e = event.getEntity();
Entity damager = event.getDamager();
String world = e.getWorld().getName();
boolean dodged = false;
Random random = new Random();
double randomChance = plugin.getWitchConfig().getDouble("Witch.Heal.DodgeCha... | 6 |
public Boolean getPlayerWin() {
return playerWin;
} | 0 |
private static boolean implementsLogFactory(Class logFactoryClass) {
boolean implementsLogFactory = false;
if (logFactoryClass != null) {
try {
ClassLoader logFactoryClassLoader = logFactoryClass.getClassLoader();
if (logFactoryClassLoader == null) {
... | 6 |
public void buildClassifier(Instances instances) throws Exception {
getCapabilities().testWithFail(instances);
// copy the dataset
m_train = new Instances(instances);
// new dataset in which examples with missing class value are removed
m_train.deleteWithMissingClass();
// build the Map for... | 8 |
public Node findLCA(Node root, Node element1, Node element2) {
if (root != null) {
boolean isContains = (isContains(root.left, element1) && isContains(root.right, element2)) || (isContains(root.left, element2) && isContains(root.right, element1));
if (isContains)
return ... | 7 |
public final boolean runLookAhead() throws FatalError, RestartLater {
int toRun;
if (lookAheadPlan == -1) {
// ersten LookAhead
toRun = getNextPlan(runningPlan);
} else {
// es war schon mindestens ein LookAhead
toRun = getNextPlan(lookAheadPlan);
}
if (toRun == -1) {
return false;
... | 7 |
private static void findAction(String action) {
} | 0 |
public static void printAll()
{
try
{
PreparedStatement stmt = Main.EMART_CONNECTION.prepareStatement("select * " +
"from ShippingNotice");
ResultSet rs = stmt.executeQuery();
System.out.println("Shippin' Notice:");
while (rs.next())
{
System.out.println(rs.getInt("ship_id") + "|" + rs.getS... | 3 |
private int buildJump(int xo, int maxLength)
{
int js = random.nextInt(4) + 2;
int jl = random.nextInt(2) + 2;
int length = js * 2 + jl;
boolean hasStairs = random.nextInt(3) == 0;
int floor = height - 1 - random.nextInt(4);
for (int x = xo; x < xo + length; x++)
... | 9 |
public int minStrokes(String stripe) {
int[][] dp = new int[stripe.length()][stripe.length()];
for (int x = 0; x < stripe.length(); x++)
dp[x][x] = 1;
for (int size = 1; size < stripe.length(); size++) {
for (int from = 0; from < stripe.length(); from++) {
int to = from + size;
if (to >= stripe.len... | 7 |
public static void main(String [] args) {
try {
PairedStats ps = new PairedStats(0.05);
java.io.LineNumberReader r = new java.io.LineNumberReader(
new java.io.InputStreamReader(System.in));
String line;
while ((line = r.readLine()) != null) {
line = line.trim();
if (l... | 9 |
@Override
public void createPlayerAccount(String player_name) {
PreparedStatement pst = null;
int player_id = getPlayerId(player_name);
if (player_id == 0) {
try {
pst = conn.prepareStatement("INSERT INTO ffa_leaderboards(player_name) VALUES (?)");
pst.setString(1, player_name);
pst.executeUpdate(... | 4 |
@Override
public void execute(CommandSender sender, String worldName, List<String> args) {
this.sender = sender;
reply("Environments provided by Bukkit:");
for (Environment thisEnv : World.Environment.values()) {
sender.sendMessage(thisEnv.toString());
}
reply("Environments provided by XcraftGate:")... | 3 |
public static GetFields_Result getFields(Database database, GetFields_Param params) throws APIException {
Logger.getLogger(API.class.getName()).log(Level.FINE, "Entering API.getFields()");
GetFields_Result result;
try { // Validate User
ValidateUser_Result vResult = validate... | 9 |
@Override
public void manageInput(InputEvent e) {
if (e.isMouseInput()) {
Vector v = e.getVector();
if (e.getType() == InputEvent.MOUSE_PRESSED) {
if (isWithinDims(v))
isPressed = true;
}
if (e.getType() == InputEvent.MOUSE_RELEASED) {
if (isPressed && (isWithinDims(v)))
notif... | 6 |
void move(int delta) {
try {
DateFormat df = new SimpleDateFormat("yyyy/MM/dd");
Date d = df.parse(currentDate);
Calendar calendar = Calendar.getInstance();
calendar.setTime(d);
calendar.add(Calendar.DATE, delta);
DateFormat df2 = new Simp... | 1 |
public boolean iterate() {
for(i=0;i<w;i++) for(j=0;j<h;j++) cells[i][j].setDestiny();
boolean temp = true;
for(i=0;i<w;i++) for(j=0;j<h;j++) if(cells[i][j].getDestiny() != cells[i][j].getStatus()) temp = false;
if(temp || this.checkForCycles()) return true;
for(i=0;i<w;... | 9 |
protected void signIn(String userName, String password) {
if (productSvc == null) {
productSvc = GWT.create(ProductService.class);
}
AsyncCallback<Boolean> callback = new AsyncCallback<Boolean>() {
public void onFailure(Throwable caught) {
}
public void onSuccess(Boolean valid) {
if(valid)
... | 2 |
public void mouseClicked(MouseEvent e) {
int i=0, j=0, found=0;
int xpos=extpad, ypos=extpad;
for(j=m_selectedAttribs.length-1; j>=0; j--) {
for(i=0; i<m_selectedAttribs.length; i++) {
if(e.getX()>=xpos && e.getX()<=xpos+cellSize+extpad)
if(e.getY()>=ypos && e.getY()<=ypos+cellSize+extpad... | 9 |
public void controlEvent(ControlEvent theEvent) {
if (theEvent.isGroup()) {
// an event from a group e.g. scrollList
// println(theEvent.group().value()+" from "+theEvent.group());
if (theEvent.isGroup() && theEvent.getName().equals("StationDepart")) {
AreaDepart = new ControlP5(this);... | 5 |
private HyperlinkListener getLinkListener() {
return new HyperlinkListener() {
public void hyperlinkUpdate(HyperlinkEvent e) {
if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
if (e instanceof HTMLFrameHyperlinkEvent) {
((HTMLDocument)html.getDocument()).processHTMLFrameHyperlinkEven... | 6 |
public Person getChild(int i) {
if (i < 1 || i > children.size())
return null;
else return children.get(i-1);
} | 2 |
public boolean containsNearbyAlmostDuplicate(int[] nums, int k, int t) {
if (nums == null || nums.length == 0 || t < 0 || k < 1) {
return false;
}
SortedSet<Long> set = new TreeSet<Long>();
for (int i = 0; i < nums.length; i++) {
int n = nums[i];
SortedSet<Long> subSet = set.subSet((long) n - t, (long)... | 7 |
public void buildClassifier(Instances insts) throws Exception {
m_NominalToBinary = null;
m_Filter = null;
if (!isPresent())
throw new Exception("liblinear classes not in CLASSPATH!");
// remove instances with missing class
insts = new Instances(insts);
insts.deleteWithMissingClass()... | 8 |
public static String toLowerCamel(String name) {
StringBuilder sb = new StringBuilder(name.length());
boolean toUpperCase = false;
for (int i = 0; i < name.length(); i++) {
char c = name.charAt(i);
if (c == ' ' || c == '_' || c == '-') {
toUpperCase = true;
} else if (toUpperCase) {
sb.append(Cha... | 8 |
public Menu(final Game game)
{
this.game = game;
// create font
PFont font = game.loadFont("fonts/Calibri-20.vlw");
game.textFont(font, this.c_fontSize);
int line = 130;
// add menu items
this.itemList.add(new MenuItem(830, line, 140, 30)
{
@Override
public String getText()
{
return "Ho... | 2 |
public boolean birthChecker() {
switch (state) {
case NONE:
// If leftHand is below leftElbow which is below leftShoulder (or right)
if (GestureInfo.gesturePieces[GestureInfo.LEFT_HAND_DOWN]
&& GestureInfo.gesturePieces[GestureInfo.RIGHT_HAND_D... | 9 |
public void run() {
final String methodName = "run";
MqttToken token = null;
while (running && (in != null)) {
try {
//@TRACE 852=network read message
log.fine(className,methodName,"852");
MqttWireMessage message = in.readMqttWireMessage();
if (message instanceof MqttAck) {
token =... | 7 |
private boolean jj_3R_51() {
if (jj_scan_token(ELIF)) return true;
if (jj_3R_50()) return true;
if (jj_scan_token(THEN)) return true;
return false;
} | 3 |
private void loadCurConf()
{
int iCnt = 0, iLen = 0;
// C U R R E N T S E T T I N G S ---------------------------------
// multicast group IP
this.jtfdMcGroup.setText(EzimConf.NET_MC_GROUP);
// multicast group port
this.jspnMcPort.setValue(EzimConf.NET_MC_PORT);
// direct transmission port
this.js... | 9 |
public Benutzer getBenutzervonBenutzername(String Benutzername) {
Benutzer rueckgabe = null;
try {
ResultSet resultSet;
resultSet = db
.executeQueryStatement("SELECT * FROM Benutzer WHERE Benutzername = '"
+ Benutzername + "'");
if(resultSet.next())
rueckgabe = new Benutzer(resultSet, db, th... | 2 |
public static boolean isUnsafe(JComponent c) {
Boolean b = (Boolean) c.getClientProperty(PROPERTY_UNSAFE);
if (b == null) {
b = Boolean.FALSE;
}
return b.booleanValue();
} | 1 |
@Override
public Company find(long id) {
String query = "SELECT * FROM company WHERE id="+id;
ResultSet results = null;
Connection connect = ConnectionMySql.getInstance();
Company company = null;
try (Statement stmt = connect.createStatement()){
results = stmt.executeQuery(query);
company = n... | 6 |
synchronized void setThumbImage(BufferedImage img,ImageType type){
MultiSizeImage setter;
if(type==ImageType.Icon) setter=iconImage;
else setter=originalImage;
if((img!=null)) setter.thumbDimensions=new Dimension(img.getWidth(),img.getHeight());
//if(img==null) {Log.Print(LogType... | 4 |
public static void memorizeObject(Object ob, String obFileName) {
System.out.println("memorizing object ... ");
File nextFile = new File(obFileName);
try {
nextFile.createNewFile();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
FileOutputStream fileout... | 2 |
public static int fib(int n){
if(n==0) return 0;
if(n==1 || n==2) return 1;
int[][] f = {{1,1},{1,0}};
powMatrix(f, n-1);
return f[0][0];
} | 3 |
public void breadthFirst(int bfi) {
for(int i=0; i<500; i=i+20) {
for(int j=0; j<500; j=j+20) {
if(grid[i/20][j/20].path_no == bfi) {
for(int k=0; k<grid[i/20][j/20].neighbors.size(); ++k) {
if... | 8 |
public static double getDouble() {
double x = 0.0;
while (true) {
String str = readRealString();
if (str == null) {
errorMessage("Floating point number not found.",
"Real number in the range " + (-Double.MAX_VALUE) + " to " + Double.MAX_VALUE);
}
... | 4 |
public void changePicture() throws InterruptedException{
//Get Image Name
path = getImageName();
//If image exists try to change the image
if(path!=null&&!path.equals("")){
try{
//Read in the new file
profileImage = ImageIO.read(new Fi... | 6 |
private static Board calculateTokenPositions(Size boardBounds,
LinkedList<Circle> redTokens, LinkedList<Circle> yellowTokens) {
Board result = new Board();
final float BLOCK_WIDTH = (float) boardBounds.width / Board.COLUMNS;
final float BLOCK_HEIGHT = (float) boardBounds.height / Board.ROWS;
for (int row = 0... | 6 |
public void setXY(Piste piste) {
this.x = piste.getX();
this.y = piste.getY();
} | 0 |
public static void writeScripts(){
/////////////////////////////////////////Create Properties///////////////////////////////////////////////
GenerateCommon gc=new GenerateCommon();
HashMap<String,ArrayList<String>> tlur=readTablesList();
if(tlur==null)
return;
ArrayLi... | 9 |
public void initialize() {
for( Long rootId : roots ) {
Queue<Long> q = new LinkedList<Long>();
q.add(rootId);
while ( !q.isEmpty() ) {
Long id = q.poll();
String text = getProcessedTweet(tweetMap.get(id).getTweetText());
... | 7 |
@Override
public void windowDeactivated(WindowEvent e) {
} | 0 |
public Timer getTimer() {
boolean test = false;
if (test || m_test) {
System.out.println("FileManager :: getTimer() BEGIN");
}
if (test || m_test) {
System.out.println("FileManager :: getTimer() END");
}
return m_timer;
} | 4 |
private void applyViewerLabel(ViewerCell cell, ViewerLabel label) {
if (label.hasNewText()) {
cell.setText(label.getText());
}
if (label.hasNewImage()) {
cell.setImage(label.getImage());
}
if (colorProvider!= null || label.hasNewBackground()) {
cell.setBackground(label.getBackground());
}
if (col... | 8 |
public String mapFieldName(String cls, String name, String descriptor) {
// Check the class itself first.
String key = cls + "/" + name;
if (fields.containsKey(key)) {
return fields.get(key);
}
// Then all of its ancestors
for (String ancestor : inheritance.g... | 3 |
@Override
public String execute() {
String actionResult = "";
Map<String, Object> session = ActionContext.getContext().getSession();
User user = (User) session.get("USER");
setCurrentUserName(user.getFname() + " " + user.getLname());
UserBusinesService userBusinesService = n... | 7 |
protected boolean decodeFrame() throws JavaLayerException
{
try
{
AudioDevice out = audio;
if (out==null)
return false;
Header h = bitstream.readFrame();
if (h==null)
return false;
// sample buffer set when decoder constructed
SampleBuffer output = (SampleBuffer)decoder.decod... | 4 |
@Override
public boolean equals(final Object object) {
if (object == this) return true;
if (!(object instanceof Conversion<?, ?>)) return false;
final Conversion<?, ?> data = (Conversion<?, ?>)object;
return Objects.equals(this.output(), data.output());
} | 8 |
public void generate_test() {
boolean lowerTail = true;
for (int i = 0; i < numTests;) {
int N = rand.nextInt(MAX) + 1;
int D = rand.nextInt(N) + 1;
int n = rand.nextInt(N) + 1;
int k = Math.max(rand.nextInt(Math.min(n, D)), 1);
if (Hypergeometric.get().checkHypergeometricParams(k, N, D, n)) {
d... | 3 |
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
if (rotation % 2 == 1) {
g.drawRect(50, 85, 100, 30);
g.drawLine(0, 100, 50, 100);
g.drawLine(150, 100, 200, 100);
g.drawLine(45, 130, 155, 70);
g.drawLine(145, ... | 2 |
public void SetText(){
for(int i = 0 ; i < 24; i++)
{
((JTextField) a [i]).setText(labels.elementAt(i));
}
for(int j = 0 ; j < 24; j++)
{
((JTextField) b [j]).setText(instruct.elementAt(j));
}
for(int k = 0 ; k < 24; k++)
{
((JTextField) c [k]).setText(operator.elementAt(k));
}
... | 6 |
public void isKingInCheckNotifier()
{
String currentTurnColor = whitePlayerTurn() ? white : black;
Position whiteKingPosition = team.getKingFromWhiteTeam();
Position blackKingPosition = team.getKingFromBlackTeam();
// detects if and when check and/or check mate happens
if(whitePlayerTurn())
{
if(isKi... | 8 |
public static void printPrimaryNumbers(int lessThan) {
if(lessThan < 2) {
System.out.println("No primary numbers less than 2");
}
System.out.println(2);
for(int i = 3; i < lessThan; i += 2) {
int sq = (int)Math.round(Math.sqrt(i));
for(int j = 3; j < s... | 4 |
public void setId(Long id) {
this.id = id;
} | 0 |
public static void insertStaff(Staff staff){
try {
if(conn == null || conn.isClosed()){
conn = DatabaseConnection.getConnection();
}
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
Login login = staff.getLogin();
try{
conn... | 4 |
static final int method592(boolean bool, byte i, boolean bool_0_, int i_1_,
int i_2_) {
anInt1105++;
if (i != -128)
return -20;
Class348_Sub13 class348_sub13
= Class258_Sub4.method1974((byte) -1, i_1_, bool_0_);
if (class348_sub13 == null)
return 0;
int i_3_ = 0;
for (int i_4_ = 0;
... | 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.