text stringlengths 14 410k | label int32 0 9 |
|---|---|
@Override
public boolean isDown() {
for (int i = 0; i < buttons.length; i++) {
if (buttons[i].isDown()) {
return true;
}
}
return false;
} | 2 |
public void makeNumbersMatch(int a, int b, int x, int y) {
//&& should be || because the number of times required for a to reach x and b to y may be different
while (a!=x || b!=y) {
//if a has already reached x, this part of the computation is not required
if (a!=x) {
... | 6 |
@Override
public void paintComponent(Graphics g) {
super.paintComponent(g);
this.setBackground(Color.BLACK);
l1.setText("Generation: " + lens.getLens().getNoGeneration());
g.setColor(new Color(192, 0, 0));
for (Ray r : lens.getRays()) {
for (int i = 0; i < r.ge... | 4 |
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// luodaan tyhjä lista tiedotteille
List<Tiedote> tiedotteet = new ArrayList<Tiedote>();
// luodaan olio businessluokasta
TiedoteService service = ne... | 2 |
public boolean isLetter(int token) {
return (token >= 0x41 && token <= 0x5A || token >= 0x61
&& token <= 0x7A || token >= 0xC0 && token <= 0xD6
|| token >= 0xD8 && token <= 0xF6 || token >= 0xF8
&& token <= 0xFF);
} | 9 |
@Override
public void setReadOnly(String key, boolean isReadOnly) {
if (key == null) {
key = "";
}
if (attributes == null || !(this.isReadOnly.containsKey(key))) {
return;
}
this.isReadOnly.put(key, new Boolean(isReadOnly));
} | 3 |
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
try {
String year,month;
year=request.getParameter("year");
month=request.getParameter("month");
String region=request.ge... | 5 |
public ExposureProgram fromVlue(short value) {
switch (value) {
case 0:
return UNDEFINED;
case 1:
return MANUAL;
case 2:
return NORMAL_PROGRAM;
case 3:
return APERTURE_PRIORITY;
case 4... | 9 |
public boolean equals(Group f) {
if(f == null) {
return false;
}
if (!this.activityIds.equals(f.activityIds)) {
return false;
}
if (!this.name.equals(f.name)) {
return false;
}
if (!this.userId.equals(... | 5 |
public void testZoneTransition() {
DateTime dt = new DateTime
(2005, 4, 3, 1, 0, 0, 0, DateTimeZone.forID("America/Los_Angeles"));
try {
dt.hourOfDay().setCopy(2);
fail();
} catch (IllegalFieldValueException e) {
assertEquals(DateTimeFieldType.hour... | 1 |
public void run() {
/**
* Three step: 1) get challenge, 2) send reponse, 3) parse list
*/
try {
URL url = new URL(BASE_URL + "?" + CommunityConstants.BASE64_PUBLIC_KEY + "=" + URLEncoder.encode(base64PubKey, "UTF-8"));
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
BufferedRead... | 4 |
void addClinit(final Type type) {
try {
final ClassEditor ce = context.editClass(type);
final MethodInfo[] methods = ce.methods();
for (int i = 0; i < methods.length; i++) {
final MethodEditor clinit = context.editMethod(methods[i]);
if (clinit.name().equals("<clinit>")) {
worklist.add(clinit.m... | 3 |
private void addInOrder(ArrayList<Long> timestamps, ArrayList<Double> values, long timestamp, double value){
for (int i = 0; i < timestamps.size(); i++){
if (timestamps.get(i) > timestamp){
timestamps.add(i,timestamp);
values.add(i,value);
return;
}
}
timestamps.add(timestamp);
values.add(valu... | 2 |
ImageSearchResponse(JSONObject jsonObject) {
super(jsonObject);
if (this.Count > 0) {
JSONArray results = (JSONArray) jsonObject.get("results");
@SuppressWarnings("unchecked") Iterator<JSONObject> iterator = results.iterator();
while (iterator.hasNext()) {
Results.add(new ImageResult(iterator.next()... | 2 |
public boolean mousedown(Coord c, int button) {
if(button == 1) {
if(ui.modshift)
wdgmsg("xfer");
else
wdgmsg("click");
return(true);
}
else if(button == 3 && ui.modshift) //Kerri
{
if(boxValues != null)
{... | 8 |
public SQLPermissionRcon() {
super("rcon");
} | 0 |
public ListNode reverseKGroup(ListNode head, int k) {
if(k == 1 || k == 0 || head == null) {
return head;
}
ListNode lastTail = null, ret = head;
ListNode[] points = new ListNode[k];
while(true) {
int leftLen = 0;
for(; leftLen < k; leftLen+... | 9 |
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jLayeredPane2 = new javax.swing.JLayeredPane();
jLabel1 = new javax.swing.JLabel();
val_token = new javax.swing.JTextField();
... | 1 |
public ListNode detectCycle(ListNode head) {
if (head == null || head.next == null) {
return null;
}
//find if exist cycle
ListNode p1 = head;
ListNode p2 = head;
while (p1 != null && (p2 != null && p2.next != null)) {
p1 = p1.next;
p2 ... | 8 |
public int countOccurrences(int target)
{
int answer;
int index;
answer = 0;
for (index = 0; index < manyItems; index++)
if (target == data[index])
answer++;
return answer;
} | 2 |
private void mergeFinallyBlock(FlowBlock tryFlow, FlowBlock catchFlow,
StructuredBlock finallyBlock) {
TryBlock tryBlock = (TryBlock) tryFlow.block;
if (tryBlock.getSubBlocks()[0] instanceof TryBlock) {
/*
* A try { try { } catch {} } finally{} is equivalent to a try {}
* catch {} finally {} so remove... | 1 |
public void stop() {
driver.quit();
String verificationErrorString = verificationErrors.toString();
if (!"".equals(verificationErrorString)) {
fail(verificationErrorString);
}
} | 1 |
public CreateActivityWindow() {
setTitle("Añadir actividad");
setResizable(false);
this.activityService = ActivityService.getInstance();
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
setBounds(100, 100, 462, 258);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
set... | 9 |
public void test_add_long_int() {
assertEquals(567L, iField.add(567L, 0));
assertEquals(567L + 1234000L, iField.add(567L, 1234));
assertEquals(567L - 1234000L, iField.add(567L, -1234));
try {
iField.add(LONG_MAX, 1);
fail();
} catch (ArithmeticException ex... | 1 |
static public void loadTweets(){
Statement stmt = null;
ResultSet rs = null;
for(int month = 1; month <=4; month ++)
try {
String monthStr = "" + month;
if(month < 10) monthStr = "0" + monthStr;
stmt = conn.createStatement();
String sqlTxt = "select published_time_GMT, status_ID, user_ID,... | 9 |
public void setNewNBOpcodes(Map<String, Integer> newNBOpcodes) {
for(Integer value : newNBOpcodes.values()) {
if(value < 0x02 || value > 0x3f) {
throw new IllegalArgumentException("Custom non-basic opcodes must be between 0x02 and 0x3f");
}
}
this.newNBOpc... | 3 |
public static double[] doLinearRegressionFromTo(int start,int end,double[][] args) //input int start, int end
{ //input double[1]=array of prices
double[] answer = new double[3];
int ... | 5 |
public List<Variant> variants() {
LinkedList<Variant> list = new LinkedList<Variant>();
// // Coverage
// int coverage = Gpr.parseIntSafe(getInfo("DP"));
//
// // Is it heterozygous, homozygous or undefined?
// Boolean isHetero = calcHetero();
// Create one SeqChange for each ALT
Chromosome chr = ... | 2 |
public void delArena(String name) {
arenas.remove(name);
} | 0 |
private boolean passwordAcceptable()
{
char[] pass1, pass2;
try
{
pass1 = passField.getPassword();
pass2 = repassField.getPassword();
}
catch (NullPointerException ex)
{
badPassLabel.setText("Password must have at least one characte... | 6 |
public static final boolean checkAncestry(final Class<?> cl, final Class<?> ancestorCl)
{
if (cl == null) return false;
if (cl.isPrimitive() || cl.isInterface()) return false;
if ( Modifier.isAbstract( cl.getModifiers()) || !Modifier.isPublic( cl.getModifiers()) ) return false;
if (ancestorCl == null) return t... | 8 |
public char scanChar() throws StringScanException {
int idxSave = idx;
skipWhiteSpace();
try {
if (buf[idx] == '\'') {
return scanQuotedChar();
} else {
return scanUnquotedChar();
}
} catch (StringScanException e) {
idx = idxSave;
throw e;
}
} | 2 |
public void mouseReleased(MouseEvent event) {
// Did we even start at a state?
if (first == null)
return;
State state = getDrawer().stateAtPoint(event.getPoint());
if (state != null) {
controller.transitionCreate(first, state);
}
first = null;
getView().repaint();
} | 2 |
private void calculateDoorPaths() {
doorPaths = new Path[doorGraph.length][doorGraph.length];
for (int i = 0; i < doorPaths.length; i++) {
for (int j = 0; j < i; j++) {
if (i == j || doorGraph[i][j] <= 0) {
// Doors are equal or not adjacent
doorPaths[i][j] = null;
continue;
}
Door fro... | 6 |
private void waitAnswer() throws Exception
{
for (long i=Sequence;i<((Sequence+WIN>nbSequence)?nbSequence:Sequence+WIN);i++)
{
DatagramPacket packet=new DatagramPacket(new byte[PAYLOADLENGTH], PAYLOADLENGTH);
rx(dataSocket, new byte[PAYLOADLENGTH]);
System.out.println("verifier si c'est un ACK" +mes... | 4 |
public static Logger getLogger() throws Exception{
if (filename == null){
throw new Exception("Cannot initialice Logger: Filename not defined.");
}
if (level == null){
level = Level.SEVERE;
}
if (logger == null){
try{
createLogger();
}
catch(IOException e){
throw new Exception("Ca... | 4 |
private void evalInvokeMethod(int opcode, int index, Frame frame) throws BadBytecode {
String desc = constPool.getMethodrefType(index);
Type[] types = paramTypesFromDesc(desc);
int i = types.length;
while (i > 0)
verifyAssignable(zeroExtend(types[--i]), simplePop(frame));
... | 3 |
private void parseArguements(String[] args, Job job) throws IOException {
for (int i = 0; i < args.length; ++i) {
if ("-input".equals(args[i])) {
String files = args[++i];
for (String file : files.split(",")) {
FileInputFormat.addInputPath(job, new Path(file));
}
} else if ("-output".equals(arg... | 9 |
public void openBraceNoSpace() {
if ((Options.outputStyle & Options.BRACE_AT_EOL) != 0)
println("{");
else {
if (currentLine.length() > 0)
println();
if ((Options.outputStyle & Options.BRACE_FLUSH_LEFT) == 0
&& currentIndent > 0)
tab();
println("{");
}
} | 4 |
public Path getImgPath_UserlistImage(Imagetype type) {
Path ret = null;
switch (type) {
case MOUSEFOCUS:
ret = this.imgUserlist_MFoc;
break;
case SELECTED:
ret = this.imgUserlist_Sel;
break;
case FOCUSS... | 4 |
@Override
public void execute(VirtualMachine vm) {
super.execute(vm);
((DebuggerVirtualMachine) vm).executionFinished();
} | 0 |
String PalabraNueva(String palabra) {
String temporal = "", muestra = "", acum = "";
for (int i = 0; i < palabra.length(); i++) {
temporal += palabra.charAt(i);
acum = temporal;
if (temporal.toLowerCase().equals(acum)) {
muestra += temporal.toUpperCas... | 3 |
public static void back(int length, int cur, int last) {
if (length == list.length - 1) {
if (cur + dis(list[last], start) < minPath)
minPath = cur + dis(list[last], start);
} else
for (int i = 1; i < list.length; i++)
if (!visited[i]) {
visited[i] = true;
back(length + 1, cur + dis(list[las... | 4 |
public RenderedImage create(ParameterBlock paramBlock,
RenderingHints renderHints) {
BorderExtender extender = renderHints == null ? null :
(BorderExtender)renderHints.get(JAI.KEY_BORDER_EXTENDER);
ImageLayout layout = renderHints == null ? null :
... | 9 |
public void getFrequencies(String taggedString){
String[] getTags = taggedString.split("\\s+");
String noun1 = "NNS";
String noun2 = "NN";
String noun3 = "NNP";
String noun4 = "NNPS";
String verb1 = "VB";
String verb2 = "VBD";
String verb3 = "VBG";
... | 9 |
Class<? extends LabFactory> getFactoryClass()
{
final String className = getProperty(PROPERTY_CLASS);
try
{
LOGGER.trace("Loading LabFactory class {}", className);
return Class.forName(className).asSubclass(LabFactory.class);
}
catch (final ClassNotFoundException e)
{
throw new IllegalStateException("F... | 2 |
@Override
public void tick() {
minions = Game.getInstance().getMobs();
for (GenericMinion gm : minions) {
if (pos.distance(gm.getPos()) < RADIUS) {
gm.attackPlayer();
gm.onKilled();
}
}
} | 2 |
@Test
public void testMoveForwardCharge() throws InsufficientChargeException
{
exception.expect(InsufficientChargeException.class);
Random rand = Mockito.mock(Random.class);
// On s'assure que le terrain et toujours franchissable.
Mockito.when(rand.nextInt(Land.CountLand())).then... | 3 |
public String showMessage() throws Exception {
Connection conn = null;
ResultSet rs = null;
Statement stmt = null;
try {
Class.forName("com.mysql.jdbc.Driver");
conn = DriverManager.getConnection(url, user, psw);
if (!conn.isClosed())
System.out.println("Success connecting to the Database!");
el... | 3 |
static final void method606(int i, boolean bool, String string) {
anInt1128++;
string = string.toLowerCase();
short[] is = new short[16];
int i_52_ = i;
int i_53_ = bool ? 32768 : 0;
int i_54_
= ((!bool ? ((Class355) Class239_Sub6.aClass355_5900).anInt4365
: ((Class355) Class239_Sub6.aClass355_5900).anInt4... | 9 |
@Override
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain)
throws IOException, ServletException {
String codeRequest = request.getCharacterEncoding();
// установка кодировки из параметров фильтра, если не установлена
if (code ... | 2 |
public static void UpperGenre(){
try {
if(conn == null || conn.isClosed()){
conn = DatabaseConnection.getConnection();
}
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
try{
conn.setAutoCommit(false);
PreparedStatement stmnt... | 4 |
public ForLine(Line parent, TokenStream stream, int indentationLevel)
{
super(parent);
Token variableName = stream.removeFirst();
if (!IdentifierMap.isValidIdentifier(variableName.toString()))
throw new SyntaxError("Invalid variable name in for statement: " + variableName);
variable = new ExpressionIdentifi... | 8 |
public final void grow(int size) {
if (locals != null) {
size += count;
if (size > locals.length) {
int nextSize = locals.length * 2;
// GlobalOptions.err.println("wanted: "+size+" next: "+nextSize);
LocalInfo[] newLocals = new LocalInfo[nextSize > size ? nextSize
: size];
System.arraycopy... | 4 |
@Override
public void setRank(int newRank) {
rank = newRank;
} | 0 |
public static List<JumpInsnNode> getTargeters(MethodNode m, LabelNode ln) {
List<JumpInsnNode> targeters = new LinkedList<JumpInsnNode>();
for (Iterator<AbstractInsnNode> it = m.instructions.iterator(); it
.hasNext();) {
AbstractInsnNode n = it.next();
if (n instanceof JumpInsnNode) {
JumpInsnNode jn... | 3 |
@Test
public void testForeignKeyPopulation() throws SQLException, IOException, ClassNotFoundException, ParseException {
SqlTester.executeSqlFile("test/resources/createTestDb.sql");
Populator p = new Populator();
p.generators.addAll(this.test1Generators());
p.populate("test1", "dim1",... | 0 |
private int decodeWhiteCodeWord() {
int current;
int entry;
int bits;
int isT;
int twoBits;
int code = -1;
int runLength = 0;
boolean isWhite = true;
while (isWhite) {
current = nextNBits(10);
entry = white[current];
// Get the 3 fields from the entry
isT = entry & 0x0001;
bits = (ent... | 5 |
public void setAlive(boolean alive) {this.alive = alive;} | 0 |
public CharacterSearchResults searchByQuery(String query) {
try {
query = URLEncoder.encode(query, "UTF-8");
} catch (Exception e) {}
String searchUrl = "character.php?q=" + query;
return new CharacterSearchResults(new Network().connect(searchUrl));
} | 1 |
public List<Modifier> getProductionModifiers(GoodsType goodsType,
UnitType unitType) {
if (goodsType == null) {
throw new IllegalArgumentException("Null GoodsType.");
}
List<Modifier> result = new ArrayList<Modifier>();
final ... | 9 |
public synchronized void gridletMove(int gridletId, int userId, int destId, boolean ack)
{
// cancels the Gridlet
ResGridlet rgl = cancel(gridletId, userId);
// if the Gridlet is not found
if (rgl == null)
{
logger.log(Level.INFO, super.resName_ +
... | 4 |
public String whatAreYou() {
return isVar()?"variable"
:isConst()?"constant"
:"OOPS Entry whatAreYou()";
} | 2 |
public static int fetchIdByName(String departmentName) {
ResultSet rs=null;
Connection con=null;
PreparedStatement ps=null;
int result=0;
try{
String sql="SELECT DEPTID FROM DEPARTMENT WHERE DEPTNAME=?";
con=ConnectionPool.getConnectionFromPool();
ps=con.prepareStatement(sql);
ps.setString(1, depa... | 8 |
private void menubar(){
//construct the menubar
JMenu M_patient = new JMenu("Patient");
menubar.add(M_patient);
JMenuItem newpatient = new JMenuItem("New");
JMenuItem searchpatient = new JMenuItem("Search");
M_patient.add(newpatient);
newpatient.addActionListener(new ActionListener(){
@Override
publ... | 9 |
private static void testX(){
//Below was for testing an issue I had with creating ArrayList holding the deck of cards.
//Apparently even when declared "private ArrayList<Integer> shuffledDeck = new ArrayList<>(52);" the size is still 0 until elements are added.
//Dealer dealer = new Dealer(17);
//for (int... | 0 |
@SuppressWarnings("CallToThreadDumpStack")
public static List<String> getListaDeStringDeArchivo(File archivo){
List<String> listaDeCadenas = new ArrayList<String>();
FileReader fr = null;
BufferedReader br;
try {
fr = new FileReader(archivo);
br = new Buffered... | 4 |
public void tick()
{
tick++;
switch(type)
{
case 1:
allyBar[0].tick();
allyBar[1].tick();
enemyBar[0].tick();
enemyBar[1].tick();
if(tick == 180)
{
tick += ally.aut... | 4 |
@SuppressWarnings("deprecation")
@Override
public void mouseMoved(MouseEvent e) {
for (Button b : buttons) {
if (e.getPoint().x > b.p.x && e.getPoint().x < b.p.x + b.d.width && e.getPoint().y > b.p.y && e.getPoint().y < b.p.y + b.d.height) {
b.setHovering(true);
display.frame.setCursor(Cursor.HAND_CURSOR... | 6 |
private boolean parseFields() {
boolean successful = true;
//surrounding with try and catch in order for the app not to blow because of casting
try {
if (debiterCombo.getSelectedIndex() != -1) {
e.setDebiterID(StrVal.parseIdFromString((String) debiterCombo.getSelecte... | 6 |
private void sendToClientZipFiles(IoSession session) throws IOException {
InputStream openStream = null;
try {
URL resource = this.getClass().getClassLoader()
.getResource("flume.properties");
openStream = resource.openStream();
Properties properties = new Properties();
properties.load(openStream);... | 5 |
public static String readLine(Socket socket){
String line = new String();
int c;
try {
while((c = socket.getInputStream().read()) != '\n'){
line += (char) c;
}
} catch (IOException e) {
System.err.println("Error reading line from strea... | 2 |
protected void consumeStreams(final Exec exec) {
if (page != null) {
page.getWorkbenchWindow().getShell().getDisplay().asyncExec(new Runnable() {
@Override
public void run() {
try {
GruntConsoleView view = (GruntConsoleView) page.showView(
GruntConsoleView.VIEW_ID, task, IWorkbenchPage.... | 2 |
public void updateIcon() {
if(isNode) {
if(isOpen) {
if(isSelected) {
setIcon(ICON_OPEN_NODE_SELECTED);
} else {
setIcon(ICON_OPEN_NODE);
}
} else {
if(isSelected) {
setIcon(ICON_CLOSED_NODE_SELECTED);
} else {
setIcon(ICON_CLOSED_NODE);
}
}
} else {
if(isSel... | 5 |
public boolean neloset(){
for(int i=0; i<5; i++){
if(nopat[i].getValue()==4){
return true;
}
}
return false;
} | 2 |
public static JSGUI_Widget unWrapGUI_Widget(Object obj) {
if (obj instanceof org.mozilla.javascript.Wrapper) {
Object temp = ((org.mozilla.javascript.Wrapper)obj).unwrap();
if (temp instanceof JSGUI_Widget)
return (JSGUI_Widget) temp;
}
return null;
} | 2 |
final protected PropertyTree getParent() {
return parent;
} | 0 |
@Override
public void service(Request request, Response response) {
// 色コードを取得する。
int[] color = getRGBColor(request);
// セッション ID とユーザー名を取得する。
String sessionId = request.getCookie("session_id");
String[] names = null;
try (ShopDB db = new ShopDB()) {
if (sessionId == null || ! db.checkSessionId(session... | 8 |
public void printJobFailed(PrintJobEvent pje) {
System.out.println("Failed");
PrinterStateReasons psr = pje.getPrintJob().getPrintService().getAttribute(PrinterStateReasons.class);
if (psr != null) {
Set<PrinterStateReason> errors = psr.printerStateReasonSet(Severity.REPORT);
... | 2 |
public void update()
{
int n;
double min = 9999999999999.0;
double dist = 0.0;
Element e;
focus = null;
n = listElements.size();
for(int i = 0; i < n; i++)
{
e = listElements.get(i);
if(e.type == Type.BOMBERMAN && (dist = distanceToElementPow(e)) < min)
{
focus = e;
pushEvent(focus,... | 6 |
static public Catalogo_Cursos instancia() {
if (UnicaInstancia == null) {
UnicaInstancia = new Catalogo_Cursos();
}
return UnicaInstancia;
} | 1 |
public static void UpperSurname(){
try {
if(conn == null || conn.isClosed()){
conn = DatabaseConnection.getConnection();
}
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
try{
conn.setAutoCommit(false);
PreparedStatement stm... | 4 |
public String nextToken() throws JSONException {
char c;
char q;
StringBuffer sb = new StringBuffer();
do {
c = next();
} while (Character.isWhitespace(c));
if (c == '"' || c == '\'') {
q = c;
for (;;) {
c = next();
... | 9 |
@BeforeClass
public static void setUpClass() {
} | 0 |
public final TLParser.exprList_return exprList() throws RecognitionException {
TLParser.exprList_return retval = new TLParser.exprList_return();
retval.start = input.LT(1);
Object root_0 = null;
Token char_literal100=null;
TLParser.expression_return expression99 = null;
... | 7 |
public String longestPalindrome(String s)
{
preProcess(s);
int center = 0;
int rightFrontier = 0;
int maxLength = 0;
int maxIndex = -1;
int[] palindromeLength = new int[preProcessed.length()];
palindromeLength[0] = 0;
for (int i = 1; ... | 7 |
public void updateCharAppearance(int[] styles, int[] colors) {
for(int j = 0; j < 7; j++) {
if(styles[j] > 0) {
styles[j] += 0x100;
pCHead = styles[0];
pCBeard = styles[1];
pCTorso = styles[2];
pCArms = styles[3];
pCHands = styles[4];
pCLegs = styles[5];
pCFeet = styles[6];
}... | 3 |
public static FileUtil getInstance() {
if(instance == null) {
instance = new FileUtil();
}
return instance;
} | 1 |
public Expr[] pop2() {
final Expr top = (Expr) stack.remove(stack.size() - 1);
Expr[] a;
final Type type = top.type();
if (type.isWide()) {
a = new Expr[1];
a[0] = top;
} else {
a = new Expr[2];
a[0] = (Expr) stack.remove(stack.size() - 1);
a[1] = top;
}
height -= 2;
return a;
} | 1 |
@Override
public Value evaluate(Value... arguments) throws Exception {
// Check the number of argument
if (arguments.length == 1) {
// get Value
Value value = arguments[0];
// If numerical
if (value.getType().isNumeric()) {
return new Value(new Double(Math.exp(value.getDouble())));
}
if (val... | 4 |
@Override
public int getYearsExperience() {
return super.getYearsExperience();
} | 0 |
public static void closePlayerWaitingModal() {
assert overlayStack.size() > 0;
assert window.getGlassPane() == overlayStack.peek().getOverlayPanel();
if (overlayStack.size() > 0) {
overlayStack.pop().getOverlayPanel().setVisible(false);
if (overlayStack.size() > 0) {
window.setGlassPane(overlayStack... | 2 |
public void moveFallingBlock(Move direction) {
switch (direction) {
case DOWN:
fallingBlock.moveDown();
break;
case LEFT:
fallingBlock.moveLeft();
break;
case RIGHT:
fallingBlock.moveRight();
... | 5 |
public void setElement(ZElement elem, String index)
{
if (index == Constantes.MCDENTITE1 )
this.elem1 = elem;
else if (index == Constantes.MCDENTITE2 )
this.elem2 = elem;
else if (index == Constantes.MCDASSOCIATION)
this.elem3 = elem;
else
... | 3 |
public static void main(String[] args) {
// Finding a min or max value
int[] nums = { 20, 4, 33, 101, 14, 76 };
int currMax = nums[0];
int currMin = nums[0];
for (int i = 1; i < nums.length - 1; i++) {
if (currMax < nums[i]) {
currMax = nums[i];
}
if (currMin > nums[i]) {
currMin = n... | 3 |
public int getQuantity() {
return this.quantity;
} | 0 |
private void createAmazonS3Bucket() {
try {
if (tx.getAmazonS3Client().doesBucketExist(bucketName) == false) {
tx.getAmazonS3Client().createBucket(bucketName);
}
} catch (AmazonClientException ace) {
JOptionPane.showMessageDialog(frame, "Unable to crea... | 2 |
public static Primer transcribePrimerSequences(String primerSequence, int numbMismatches){
Primer newPrimer;
String bottomSeq;
String topSeq = "";
//char[] nucleotides;
char currentNuc;
int index;
//int counter;
// bottom primer
bottomSeq = primerSequence;
// top primer
//counter = 0;
//nu... | 5 |
@SuppressWarnings("rawtypes")
public static JobConf getJobConf(Configuration conf, String[] args, Class callerClass) throws IOException {
// Directly create the path instances with the given paths and store them for later usage.
Path input = new Path(args[0]);
Path output = new Path(args[1]);
// Create new ge... | 5 |
public Queue<String> soldadoXMLUnit (){
try {
path = new File(".").getCanonicalPath();
FileInputStream file =
new FileInputStream(new File(path + "/xml/papabicho.xml"));
DocumentBuilderFactory builderFactory =
DocumentBuilderFactory.newInstance();
D... | 9 |
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.