text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void Update(GameTime gameTime)
{
//HandleExplosions();
mMousePosition = new Vector2(mInput.GetMouseX(), GameProperties.WindowHeight() - mInput.GetMouseY()).DividedBy(GameProperties.Scale()).Minus(mCameraOffset);
GameEntity.UpdateList(gameTime, mEnemyList);
GameEntity.UpdateList(gameTime, mBulletLi... | 5 |
public static void main(String[] argsv) {
// Setting op a bank.
Bank christmasBank = new Bank();
christmasBank.addAccount(new BankAccount(BigInteger.valueOf(100)));
christmasBank.addAccount(new BankAccount(BigInteger.valueOf(50), BigInteger.valueOf(-1000)));
BankAccount theAccou... | 4 |
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://... | 6 |
public void actionPerformed(ActionEvent e)
{
// get the strings to be added to the database...
String dateStr = dateField.getText();
String startTimeStr = startTimeField.getText();
String endTimeStr = endTimeField.getText();
// Date to indicate the start day (00:00 o... | 3 |
private void handleIOException( SelectionKey key, WebSocket conn, IOException ex ) {
onWebsocketError( conn, ex );// conn may be null here
if( conn != null ) {
conn.closeConnection( CloseFrame.ABNORMAL_CLOSE, ex.getMessage() );
} else if( key != null ) {
SelectableChannel channel = key.channel();
if( cha... | 6 |
public static String implodeArray(final String[] inputArray, final String glueString) {
String output = "";
if (inputArray.length > 0) {
StringBuilder sb = new StringBuilder();
sb.append(inputArray[0]);
for (int i = 1; i < inputArray.length; i++) {
sb... | 2 |
public static void main(String[] args) throws IOException {
Scanner in = new Scanner(System.in);
StringBuilder out = new StringBuilder();
int boards = in.nextInt();
v = new int[8][8];
allSol = new int[93][9];
nsol = 0;
board = new int[9];
queens(1);
for (int i = 0; i < boards; i++) {
for (int j = 0... | 5 |
public List<List<Integer>> generate(int numRows) {
Integer[][] triangle = new Integer[numRows][];
// error List<List<Integer>> triangle = new
// ArrayList<ArrayList<Integer>>();
//o(n*n)
for (int i = 1; i <= numRows; i++) {
Integer[] row = new Integer[i];
if (i == 1) {
row[0] = 1;
triangle[i-1]... | 4 |
public int agregarProspecto(String name, String surname1, String surname2, String mail, String DNI, String telefono, String contact_date) {
boolean Nocaracter = validarFormato(name);
boolean Nocaracter2 = validarFormato(surname1);
boolean Nocaracter3 = validarFormato(mail);
... | 8 |
public void readXMLInputString(String xmlString) {
try {
saxParser.parse(new InputSource(new StringReader(xmlString)), DPHreader.getInstance());
}
catch (final SAXException e) {
System.out.println("SAXException: " + e);
e.printStackTrace();
}
catch (final Throwable e... | 2 |
public Object clone() {
final StackExpr[] t = new StackExpr[target.length];
for (int i = 0; i < target.length; i++) {
t[i] = (StackExpr) target[i].clone();
}
final StackExpr[] s = new StackExpr[source.length];
for (int i = 0; i < source.length; i++) {
s[i] = (StackExpr) source[i].clone();
}
retu... | 2 |
public int findMaxScore(String[] grid){
int n = grid.length;
if(n==0) return 0;
int m = grid[0].length();
int N = n*m;
int E = 0;
Edge[] edges = new Edge[(n-1)*m+(m-1)*n];
for(int i=0; i<n; i++){
m = grid[i].length();
for(int j=0; j<m; j++)... | 8 |
@Test
@Ignore
public void test_AssociationListGet()
{
AssociationList laAssocList = laClient.getAssociationList(5,
"2012-01-25-12.36.43.023001", null);
System.out.println(laAssocList.getAssociationList().size());
if (laAssocList.getAssociationList().size() > 0)
{
for (Association laAssoc : laAssocList... | 2 |
public WebScraper(String[] args) throws IOException, BadLocationException {
ArrayList<URL> urls = new ArrayList<URL>();
//Is URL?
if(args[0].matches("^http\\://[a-zA-Z0-9\\-\\.]+\\.[a-zA-Z]{2,3}(/\\S*)?$"))
urls.add(new URL(args[0]));
//Is file?
else if (args[0].match... | 6 |
private static TexturePaint getCheckerPaint() {
if (checkerPaint == null) {
int t = 8;
BufferedImage bi = new BufferedImage(t * 2, t * 2, BufferedImage.TYPE_INT_RGB);
Graphics g = bi.createGraphics();
g.setColor(Color.white);
g.fillRect(0, 0, 2 * t, 2 ... | 1 |
public static boolean testContainment(double xin, double yin,
double[] pointsx, double[] pointsy) {
int i, j;
boolean result = false;
for (i = 0, j = pointsx.length - 1; i < pointsx.length; j = i++) {
if ((pointsy[i] > yin) != (pointsy[j] > yin)
&& (xin < (pointsx[j] - pointsx[i]) * (yin - pointsy[i])
... | 3 |
private void playnextsound()
{
// Only plays the next sound if the track is still playing
if (!isPlaying())
return;
// The sound is no longer delayed
this.delayed = false;
// Checks whether more loops are needed
// Loops the current sound if needed
if (this.currentloopcount > 0 ||
(this.cur... | 7 |
private void donebutton2MouseClicked(java.awt.event.ActionEvent evt) throws SQLException {//GEN-FIRST:event_donebutton2MouseClicked
// TODO add your handling code here:
//Check title
String bank = namefield.getText().toString();
String add = addressfield.getText().toString();
String accnum = a... | 9 |
public void clear() {
M = new byte[m];
if(intersectable) {
ts.clear();
}
} | 1 |
void appendInstruction(Instruction newInstr, BytecodeInfo codeinfo) {
newInstr.addr = nextByAddr.addr;
newInstr.nextByAddr = nextByAddr;
nextByAddr.prevByAddr = newInstr;
newInstr.prevByAddr = this;
nextByAddr = newInstr;
/* adjust exception handlers end */
Handler[] handlers = codeinfo.getExceptionHand... | 3 |
public void setVoornaam(String voornaam) {
this.voornaam = voornaam;
} | 0 |
public static void sort(Comparable[] a) {
int N = a.length;
int h = 1;
while (h < N/3) {
h = 3*h + 1;
}
while (h >= 1) {
for (int i = h; i < N; i++) {
for (int j = i; j >= h && less(a[j], a[j-h]); j-= h) {
... | 5 |
public void tick(EnemyWave allEnemies) { // TODO Move to shootingaction so that we have only data in this class(?)
//send action to all objects
for (Placeable obj : getPlacablesWithinRangeOfThisTower()) {
if (!obj.equals(this)) {
for (GameAction currentAction : getGameAction... | 4 |
public Tree(HuntField field) {
this.type = 'T';
synchronized (field) {
this.position = new Position(random.nextInt(field.getXLength()), random.nextInt(field.getYLength() + 1));
while (field.isOccupied(position)) {
this.position = new Position(random.nextInt(field.... | 1 |
protected void checkInitiate() {
if (!isInitiate) {
throw new IllegalStateException("RemoteClientCall is not initiate. First execute Init().");
}
} | 1 |
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException, SQLException {
HttpSession sesionOk = request.getSession();
if (sesionOk.getAttribute("usuario") != null) {
String alert = "";
response.setCon... | 7 |
@Override
public void close() throws XMLStreamException {
if (mWriter != null) {
try {
mWriter.close();
} finally {
mWriter = null;
}
}
} | 1 |
public boolean contestCommand(CommandSender sender, String[] args) {
if (args.length != 0) {
return false;
} else if (sender instanceof Player) {
Player player = ((Player) sender).getPlayer();
MCWarClanPlayer mcPlayer = _tc.getPlayer(player.getUniqueId());
... | 9 |
public int calcularAptitud(){
int aptitud = 1;
int cromFinX = 0;
int cromFinY = 0;
for(String mov : codificacion){
if(mov != null){
switch(mov){
case "up":
cromFinY -= 1;
break;
case "down":
... | 6 |
private static int countTokens(String template) {
int count = 0;
Matcher matcher = PATTERN.matcher(template);
while (matcher.find()) {
count++;
}
return count;
} | 1 |
private Vector enemyPixelMovement(Point goal) {
// Point goal = board.getCastle().getCenterOfObject();
Point enemyPos = this.getPixelPosition();
int deltaX = goal.getX()-enemyPos.getX();
int deltaY = goal.getY()-enemyPos.getY();
Vector newPos;
// kollar vilket håll som... | 7 |
public void paint(Graphics2D g,boolean draw,boolean fill){
if (calcularVar) {
calcular();
calcularVar = false;
}
if (draw && !fill) {
g.draw(path);
}else if(fill && !draw){
g.fill(path);
}else if(draw && fill){
... | 7 |
private StopForwarder() {
// JFormDesigner - Action initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
putValue(NAME, "Detener Forwarder");
putValue(SHORT_DESCRIPTION, "Detener Forwarder");
putValue(LONG_DESCRIPTION, "Detener Forwarder");
putValue(SMAL... | 0 |
public static void filledEllipse(double x, double y, double semiMajorAxis, double semiMinorAxis) {
if (semiMajorAxis < 0) throw new RuntimeException("ellipse semimajor axis can't be negative");
if (semiMinorAxis < 0) throw new RuntimeException("ellipse semiminor axis can't be negative");
double ... | 4 |
private String apply(String string) {
StringBuilder result = new StringBuilder();
for (int i = 0; i < string.length(); ++i) {
if (rules.containsKey(string.charAt(i))) {
result.append(rules.get(string.charAt(i)));
} else {
result.append(string.charA... | 2 |
protected void paintLineHighlight(Graphics gfx, int line, int y)
{
int height = fm.getHeight();
y += fm.getLeading() + fm.getMaxDescent();
int selectionStart = textArea.getSelectionStart();
int selectionEnd = textArea.getSelectionEnd();
if(selectionStart == selectionEnd)
{
if(lineHighlight)
{
g... | 9 |
public LinkOpener(String uri) {
try {
this.uri = new URI(uri);
} catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} | 1 |
private static List<String> getIdListInsertStatement(SDNEntry sdne) {
List<String> rtn = new ArrayList<>();
for (Map<String, Object> map : sdne.getIdList()) {
String cols = SDNConstants.ELEMENT_SDNENTRYID;
String vals = sdne.getUid() + "";
for (String key : map.keySet()) ... | 8 |
@Override
public Object getValueAt(int arg0, int arg1) {
if (arg1 == 0)
return (dfa.getStates().get(arg0).getState_Properties().getName()); else
return getEntry(arg0, arg1-1);
} | 1 |
public void testEqualSubsetIntersection() throws Exception {
for (int i = 0; i < 100; i++) {
int len = (int)(Math.random() * (10 - 1) + 1);
RBtree a = randomRB( len );
RBtree b = a;
if (!a.equal( b ) ) {
throw new Exception("FAILURE THE TWO SETS ARE NOT EQUAL");
}
if (!a.subset( a.intersect... | 4 |
static void process_changesets_url_common ( URL passed_url, String passed_display_name, String passed_uid, String passed_id,
String passed_min_lat_string, String passed_min_lon_string, String passed_max_lat_string, String passed_max_lon_string,
String passed_download_changeset, String passed_building, boolean ... | 5 |
@GET
@Path("/{id}")
@Produces(MediaType.LIBROS_API_LIBRO)
public Libro getLibro(@PathParam("id") int id) {
Libro libro = new Libro();
Connection conn = null;
Statement stmt = null;
String sql;
try {
conn = ds.getConnection();
} catch (SQLException e) {
throw new ServiceUnavailableException(e.getMe... | 4 |
public void readConfig() {
/* private boolean useDefaultUQuest = true;
*
* Database:
* private boolean useSQLite = false;
* protected boolean broadcastSaving = true;
* protected int SaveQuestersInfoIntervalInMinutes = 30;
*
* PluginSupport:
* private String MoneyPlugin = "none";
*... | 3 |
@EventHandler
public void onRedstoneChange(BlockRedstoneEvent e) {
Block block = e.getBlock();
int startX = block.getX()-1;
int startY = block.getY()-1;
int startZ = block.getZ()-1;
int endX = block.getX()+1;
int endY = block.getY()+1;
int endZ = block.getZ()+1;
for(int x = startX; x <= endX; x++)
... | 8 |
@Override
public void messageReceived(MessageEvent arg0) {
final String msg = arg0.getMessage().toLowerCase();
if (msg.contains("you successfully chop away some ivy.")) {
chopped++;
}
if (msg.contains("a bird's nest falls out of the") && !Inventory.isFull()) {
... | 3 |
public void moveBothServos(int pos1, int pos2)
{
if (!isConnected())
{
error("Robot is not connected!", "RXTXRobot", "moveBothServos");
return;
}
debug("Moving both servos to positions " + pos1 + " an... | 6 |
public int[] plusOne(int[] digits) {
int carry = 1;
for(int i = digits.length - 1; i >= 0; --i){
int tmp = digits[i] + carry;
digits[i] = tmp % 10;
carry = tmp / 10;
}
if(carry == 1){
int [] res = new int[digits.length+1];
res[0... | 2 |
public void actionPerformed(ActionEvent e) {
log(e);
if(((JButton)e.getSource()).getText().equals(STARTMENU_BUTTON_START)){
} else if(((JButton)e.getSource()).getText().equals(STARTMENU_BUTTON_ABOUT)){
forwardAction("MyStyles.MyFrames.AboutMenuFrame");
} else if(((JButton)e.getSource()).getText().e... | 3 |
public void Architecture() throws IOException{
bins=new Bin[binNo];
for(int i=0; i<binNo; i++)
bins[i]=new Bin();
sortBins();
for(int i=0; i<archL; i++){
hiddenLayersNo=i+1;
updateArchNodes(hiddenLayersNo-1);
}
System.out.print("\nBest architecture:\n");
for(int l=0; l < bestArch.length; l++) ... | 3 |
public void flipVertical() {
byte image[] = new byte[width * height];
int off = 0;
for (int j = height - 1; j >= 0; j--) {
for (int k = 0; k < width; k++) {
image[off++] = pixels[k + j * width];
}
}
pixels = image;
offsetY = trimHeight - height - offsetY;
} | 2 |
public Display(Alloy alloy, String[] hn, String message) {
super(message);
this.alloy = alloy;
this.hostNames = hn;
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setSize(alloy.getWidth() + 5, alloy.getHeight() + 36);
this.setLocationRelativeTo(null);
t... | 1 |
private AVLNode balance()
{
switch( heightRightMinusLeft() )
{
case 1:
case 0:
case -1:
return this;
case -2:
if( left.heightRightMinusLeft() > 0 )
{
setLeft( left.rotateLeft(), null );
}
return rotateRight();
case 2:
if( right.heightRightMinusLeft() < 0 )... | 7 |
private void timeOut() {
boolean timedOutBeforeConnecting = false;
boolean timedOutAfterConnecting = false;
synchronized(CONNECTION_LOCK) {
if(isAttemptingToConnect) {
logger.fine("Connection to " + serverAddress + ":" + serverPort + " timed out");
closeConnection();
timedOutBeforeConnecting = true... | 4 |
public static boolean isCollision(Circle c1, Circle c2) {
if (c1 == null || c2 == null) return false;
int xDist = c1.x - c2.x;
int yDist = c1.y - c2.y;
int rSum = c1.r + c2.r;
if (Math.pow(xDist, 2) + Math.pow(yDist, 2) <= Math.pow(rSum, 2)) {
return true;
}
return false;
} | 3 |
public String allFits(){
return this.fitnessArr.toString();
} | 0 |
public boolean temPermissao(String nome, String senha) {
if ((getNome().compareToIgnoreCase(nome) == 0) && (getSenha().compareToIgnoreCase(senha) == 0)) {
return true;
}
return false;
} | 2 |
public Integer getPrimaryGroup(Connection con, String user) {
/* Compose query. */
String SQL_QUERY = "SELECT user_group_id "
+ "FROM xf_user "
+ "WHERE username=?;";
/* Execute query. */
try {
PreparedStatement stmt = con.prepareStatement(SQL_QUERY);
stmt.setString(1, user);
ResultSet rs = st... | 2 |
protected void onRemoveModerated(String channel, String sourceNick, String sourceLogin, String sourceHostname) {} | 0 |
private static void configureDevelopmentLogging() {
// Configure console logger
devConsoleHandler = new ExtendedConsoleHandler();
devConsoleHandler.setFormatter(new DevLogFormatter());
// Configure file logger
try {
new File("./log").mkdir();
devFileHandler = getFileHandler(true);
if (DEV_MODE)... | 6 |
public static FileCache foruser() {
try {
String path = System.getProperty("user.home", null);
if(path == null)
return(null);
File home = new File(path);
if(!home.exists() || !home.isDirectory() || !home.canRead() || !home.canWrite())
return(null);
File base = new File(new File(home, ".hav... | 8 |
public void update() {
up = keys[KeyEvent.VK_UP];
down = keys[KeyEvent.VK_DOWN];
right = keys[KeyEvent.VK_RIGHT];
left = keys[KeyEvent.VK_LEFT];
space = toggle(KeyEvent.VK_SPACE);
enter = toggle(KeyEvent.VK_ENTER);
escape = toggle(KeyEvent.VK_ESCAPE);
if(JudokaComponent.gameState == Judoka... | 4 |
private void overwriteShapeDefault(Attributes attrs) {
// loop through all attributes, setting appropriate values
for (int i = 0; i < attrs.getLength(); i++) {
if (attrs.getQName(i).equals("color"))
shapeDef.setColor(new Color(Integer.valueOf(attrs.getValue(i),
16)));
else if (attrs.getQName(i).equa... | 6 |
public HTML addClasses(final String...classtypes) {
if ( classtypes == null )
return this;
final String classesAsString = this.getOrCreateAttr("class");
final List<String> classesAsArray = new ArrayList<String>( );
for (final String s : classesAsString.split(" "))
classesAsArray.add(s);
for (fi... | 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 createScreenShot()
{
File screenshotFile = null;
JFileChooser chooser = new JFileChooser();
UIManager.put("FileChooser.saveDialogTitleText", "Save Michelizer Screenshot");
SwingUtilities.updateComponentTreeUI(chooser);
chooser.setSelectedFile(new File("Michelizer_Output.jpg"));
screenshotFile ... | 6 |
private void cutButtonAction()
{
// No ads found
if (results.isEmpty())
{
text.append(String.format("No ads found.%s", newline));
setStateInitial();
return;
}
// Validate specified cut times
if (!validateCutTimes())
{
... | 3 |
public double getRad(){
return rad;
} | 0 |
private void moveComponents(
Container target, int x, int y, int width, int height, int columnStart, int columnEnd, boolean ttb)
{
switch (align)
{
case TOP:
y += ttb ? 0 : height;
break;
case CENTER:
y += height / 2;
... | 8 |
private int countCompletelySolvedTopEdgeCubie() {
int count = 0;
RubiksCube rc = this.initialRcConfig;
// Get the four top layer edge cubies
Cubie frontTopFaceEdgeCubie = rc.getCubie(2, 3, 3);
Cubie rightTopFaceEdgeCubie = rc.getCubie(3, 3, 2);
Cubie backTopFaceEdgeCubie = rc.getCubie(2, 3, 1);
... | 8 |
public void gaFram ()
{
if (aktuell >= 0 && aktuell < Polylinje.this.horn.length - 1) aktuell++;
else aktuell = -1;
} | 2 |
static private void parseVariables(DodsV parent, Enumeration children) {
while (children.hasMoreElements()) {
opendap.dap.BaseType bt = (opendap.dap.BaseType) children.nextElement();
if (bt instanceof DList){
String mess = "Variables of type "+bt.getClass().getName()+" are not supported.";
... | 8 |
public double[] marginalProbability(int x_i) {
int n = potentials.chainLength();
int k = potentials.numXValues();
double[] result = new double[k+1];
sum = 0;
result[0] = 0;
for (int v =1 ; v <= k ; v++) {
result[v] = messageFactor2Node(x_i, x_i, v);
if (x_i != 1) {
// not the first one
... | 4 |
public SingleTreeNode treePolicy() {
SingleTreeNode cur = this;
while (!cur.state.isGameOver() && cur.m_depth < ROLLOUT_DEPTH)
{
if (cur.notFullyExpanded()) {
return cur.expand();
} else {
SingleTreeNode next = cur.uct();
... | 3 |
public Decifra(File arquivo){//construtor
try{ //tratamento de erro sobre a read do arquivo
arquivoR = new FileReader(arquivo); //abre o arquivo
buffer = new BufferedReader(arquivoR);
while(buffer.ready()){
code[read]=buffer.readLine();//code recebe o que esta na buffer a cada linha, assim cad... | 4 |
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
try{
Boolean result = (Boolean) resultFututre.get();
if (wasInsert == true) {
if (result == true) {
request.setAttribute("er... | 7 |
public void mouseDragged(MouseEvent e) {
if(this.laf.bh.ccol.getState()==false)
{
Graphics g;
Color c=Color.BLACK;
g=this.getGraphics();
g.clearRect(0,0,this.getWidth(),this.getHeight());
this.paint(g);
xf=e.getX();
yf=e.getY();
switch(th... | 7 |
private void setTrafficNodes(InterfaceRequiredMethods n, double duration,
Distribution dist) {
if (dist instanceof UniformDistribution) {
int rate = (int) dist.nextSample();
double interval = duration / rate;
// uniforme distribuição para escolher um tempo de 0 a 10 minutos para iniciar a sequencia de... | 2 |
public Matrix solve(Matrix B) {
if (B.getRowDimension() != n) {
throw new IllegalArgumentException("Matrix row dimensions must agree.");
}
if (!isspd) {
throw new RuntimeException("Matrix is not symmetric positive definite.");
}
// Copy right hand side.
double[][] X = B.getArrayCopy... | 8 |
final void method546(int i, int i_40_, int i_41_) {
if (i_41_ == -2) {
if (i_40_ == 0) {
anInt5280 = -(i >= 0 ? i : -i) + anInt5278;
anInt5289 = 4096;
anInt5280 = anInt5280 * anInt5280 >> -1109421716;
anInt5290 = anInt5280;
} else {
anInt5289 = anInt5280 * anInt5298 >> -640192180;
if ((anInt5289 ... | 6 |
@Override
protected void logBindInfo(Method method) {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("绑定" + getDescription() + "到方法[" + method + "]成功");
}
} | 1 |
public void generateDataforCassandraHector(int uID, int noOfReplicas, int minute, int rate) {
int tsID = 0;
long executedTime = 0;
String timeStampOutput = "";
int noOfSamples = minute * rate * 60;
try {
DateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
uconn.cse.cass... | 9 |
public static MaplePacket charInfo(final MapleCharacter chr) {
MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
mplew.writeShort(SendPacketOpcode.CHAR_INFO);
// mplew.writeShort(0x31);
mplew.writeInt(chr.getId());
mplew.write(chr.getLevel());
mpl... | 8 |
public void read() {
if (db.exists()) {
if (hasRead)
return;
try {
FileReader f = new FileReader(db);
BufferedReader in = new BufferedReader(f);
String line;
while ((line = in.readLine()) != null) {
lines.add(line);
}
} catch (Exception ex) {
ex.printStackTrace();
}
has... | 5 |
public void SetSolenoidValue(int channel, boolean value){
solenoid[channel - 1] = (byte) (value ? 1:0);
} | 1 |
@BeforeClass
public static void setUpClass() throws Exception {
System.out.println("start");
MyUnit.getDriver().get("http://www.google.com");
} | 0 |
public BST() {
this.count = 0;
root = null;
} | 0 |
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String nombre =request.getParameter("usuario");
String clave =request.getParameter("clave");
List<Usuario> lista = usuarioFacade.findByLogin(nombre,... | 3 |
private void newtonAlg(double point) {
int count = 1;
double step = point;
double nextStep = point - calcValue(point)/calcDerivative(point);
double epsilon = Math.pow(10, -7);
while (Math.abs(nextStep - step) > epsilon) {
count++;
step = nextStep;
... | 1 |
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.print("Enter the number of lines for the characters to be printed: ");
int num = scan.nextInt();
for (int i = 1; i <= num; i++) {
for (int j = 1; j <= num; j++)
if (i == 1 || i == num || j == 1 || j == num)
Sy... | 6 |
public static String substring(String s, int beginIndex, int endIndex) throws IndexOutOfBoundsException {
// Discovered somthing new. String.substring is basically a
// memory leak. See: http://developer.java.sun.com/developer/bugParade/bugs/4637640.html for more details.
// Use string.getChars to avoid this whe... | 0 |
public AdjacencyList getAdjacencyList() {
return adjacencyList;
} | 0 |
public CellHandle[] getCells()
{
List<? extends BiffRec> mycells;
try
{
Boundsheet boundsheet = mySheet.getBoundsheet();
int colFirst = getColFirst();
mycells = boundsheet.getCellsByCol( colFirst );
}
catch( CellNotFoundException e )
{
return new CellHandle[0];
}
CellHandle[] ch = new Cell... | 5 |
public int getBlue(){
return _blue.get();
} | 0 |
public PumpingLemma getCurrent()
{
return get(myCurrent);
} | 0 |
public void set_order_to_idx( String idxFileName )
{
if(canIfNoCdx())
{
order = "[idx]";
Idx = new idx();
try { Idx.fidx = new RandomAccessFile( new File( g_idxname(idxFileName) ), fmode()); }
catch (FileNotFoundException e1) { e1.printStackTrace(); }
Idx.read_header();
Idx.recno = recno;
updateseek... | 2 |
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
BufferedImage originalImage = new BufferedImage(85, 85,
BufferedImage.TYPE_INT_RGB);
try {
originalImage = ImageIO.read(getClass().getResource(
"/imgs/menu/background.jpg"));
} catch (IOException e1) {
System.out.pri... | 6 |
private void makeSit(Chair chair){
pDir = chair.getPlayerSitDir();
setCharLoc(chair.getPlayerX(),chair.getPlayerY());
stopMoveChar();
sitting = true;
sittingHigh = chair.isHigh();
sittingLow = chair.isLow();
if(chair.getChairDir() == 0){
sittingDown = true;
}else{
sittingDown = false;
}
if(cha... | 4 |
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other == this)
return true;
Cinema otherCinema = (Cinema) other;
return this.name.equals(otherCinema.name);
} | 2 |
@Override
public Cible putCible(Cible c) throws JSONException, BadResponseException {
Representation r = new JsonRepresentation(c.toJSON());
r = serv.putResource("intervention/" + interId + "/cible", null, r);
Cible cible = null;
try {
JSONObject jobj = new JsonRepresentation(r).getJsonObject();
cible =... | 2 |
@Override
protected boolean canRun(ClassNode node) {
if (!node.superName.endsWith("Object") || classNodes.containsKey("NodeHashTable"))
return false;
if (node.fields.size() >= 2) {
for (int fni=0; fni < node.fields.size(); fni++) {
FieldNode fn = (FieldNode) n... | 5 |
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.