text stringlengths 14 410k | label int32 0 9 |
|---|---|
public boolean createTable(String tableName, List<String> columnNames) throws DataBaseTableException {
if (tableHashMap.containsKey(tableName)) {
return false;
}
Table table = new Table(tableName, columnNames);
tableHashMap.put(tableName, table);
return true;
} | 1 |
public void reserve(int num)
{
if(num >= 0 && num < seat.length && !seat[num])
{
seat[num] = true;
System.out.println("the seat is reserved for you");
}
else
{
System.out.println("already reserved or invalid number");
}
} | 3 |
public static Ability electrifiedCharge(){
float[] cooldown = {15, 15, 15, 15};
int[] manacost = {70, 80, 90, 100};
String name = "Electrified Charge";
String[] tooltip = new String[5];
for(int a=0;a<5;a++){
StringBuilder sb = new StringBuilder();
sb.appen... | 7 |
@Override
public void run(){
ResourceMonitorFrame frame = new ResourceMonitorFrame();
frame.setAlwaysOnTop( this.frameAlwaysOnTop );
String max, tot, free;
String maxP = "-max heap size %15d MB";
String totP = "-total memory %15d MB";
String freeP = "-free heap %15d KB";
int k = 1024;
... | 3 |
public int[][] stdDevColumns() {
long[] sum = new long[columns];
int[] count = new int[columns];
int[] avg = averageColumns();
for (int j = 0; j < columns; j++) {
sum[j]=0;
count[j]=0;
}
for (int i = 0; i < row_count; i++... | 6 |
public void run()
{
while(pelotaIniciada)
{
try {
Thread.sleep(16);
} catch( Exception e)
{
System.out.println("Hilo se desperto anticipadamente");
}
int antX = (int) laPelota.getX();
int antY = (int) laPelota.getY();
int x, y;
x = antX + incX;
... | 8 |
@EventHandler
public void playerMove(PlayerMoveEvent event) {
EditTeam team = null;
for (CTFTeam t : Teams) {
if (t.inTeam( CTFPlugin.getTeamPlayer(event.getPlayer()) )) {
team = (EditTeam) t;
break;
}
}
if (team == null){
return;
}
Goal goal = team.getGoal();
if (goa... | 6 |
private void attenteConnexionClients() {
if (serveur != null) {
Socket s = null;
while (!stopServeur) {
System.out.println("Attente de la connexion du client n°"
+ numeroClient + "...");
try {
s = serveur.accept();
if (s != null) {
System.out
.println("Connexion effective... | 4 |
public void deleteEvent(String eventID, String user) {
boolean active;
String activeBoolean = null;
try {
String table = "events";
String[] fields = {"active", "createdBy"};
String[] fieldsUpdate = {"active"};
crs = qb.selectFrom(fields, table).where("eventID", "=", eventID).executeQuery();
if(... | 8 |
public double getRatingForUser(int userId){
int beginIndex = 0, halfIndex, endIndex = userIds.length;
if(userIds.length > 0){
while(true){
halfIndex = (endIndex - beginIndex) / 2 + beginIndex;
if(userId < userIds[halfIndex]){
if(endIndex - beginIndex <= 1){
return -1.0;
}
endIndex = ... | 6 |
public static boolean checkLimits(int x, int y, BoardModel boardModel) {
return (x >= 0 && x < boardModel.getBoardWidth() && y >= 0 && y < boardModel.getBoardHeight());
} | 3 |
private static <T> List<Order> getOrders(CriteriaBuilder cb, Root<T> root,
Map<String, OR> sort) {
List<Order> orders = new ArrayList<Order>();
if (sort != null) {
for (String field : sort.keySet()) {
OR way = sort.get(field);
try {
Order or = null;
/**
* separate field and function
... | 9 |
public static boolean isValidCuit(String cuit) {
char[] cuitChars = cuit.toCharArray();
ArrayList<Integer> cuitNumbers = new ArrayList<Integer>();
for (int i = 0; i < cuitChars.length; i++) {
if(cuitChars[i] == ' ' || cuitChars[i] == '-')
continue;
if(cuitChars[i] > '9' && cuitChars[i] < '0')
throw... | 9 |
public String getLogin() {
return login;
} | 0 |
@Override//Implementado y verificado
public int loginUsuario(String login, String password) throws RemoteException {
/*
-1: No esta registrado
0: Registrado, login y password no coinciden
1: UsuarioImp regular
2: Admin
*/
int result = -1;
... | 6 |
public int[][] solver(int[][] matrix) {
HashSet<Integer> x = new HashSet<Integer>();
HashSet<Integer> y = new HashSet<Integer>();
for (int i = 0; i < matrix.length; i++)
{
for (int j = 0; j < matrix[i].length; j++)
{
if (matrix[i][j] == 0)
{
if (!x.contains(i))
x.add(i);
if (!y.... | 9 |
public Object nextContent() throws JSONException {
char c;
StringBuffer sb;
do {
c = next();
} while (Character.isWhitespace(c));
if (c == 0) {
return null;
}
if (c == '<') {
return XML.LT;
}
sb = new Str... | 7 |
public static void formComboCrews() {
SpaceObject vehicle = Players.currentPlayer.spaceObjectArray.findMannedByName(comboVehicle.getSelectedItem().toString());
int crewamount = vehicle.getCrew();
Object[][] storage = new String[constcrews][crewamount];
ArrayList<Object> listunique = new ... | 9 |
@Override
public void stateChanged(ChangeEvent args) {
if(this.views.getSelectedComponent() != this.requestView) {
String text = this.requestView.getContents();
if(!Utilities.isNullOrWhitespace(text)) {
try {
Document doc = Utilities.parseXml(text);
this.getRequest().process(doc);
this.query... | 3 |
public static <E> FunctionExecutor<Void> createAdd(final FeatureDefinition<? extends Property<? extends Collection<E>>> propertyDefinition) {
return new FunctionExecutor<Void>() {
@SuppressWarnings ("unchecked")
@Override
public Void invoke(FunctionInvocation<Void> invocati... | 5 |
public void floor(int ydirection, int xrotation, int xdirection) {
Render texture = Texture.grass;
if (ydirection > 0) ymove -= 0.5;
if (ydirection < 0) ymove += 0.5;
//if (xrotation > 0) xrotate += 0.01;
//if (xrotation < 0) xrotate -= 0.01;
if (xdirection < 0) horizontalmove -= 0.3;
if (xdirection > ... | 8 |
public void endOfTurn() {
if( playerInTurn == Player.BLUE ){
playerInTurn = Player.RED;
endOfRound();
} else if ( playerInTurn == Player.RED ){
playerInTurn = Player.BLUE;
}
for( GameObserver observer : gameObservers){
observer.turnEn... | 3 |
@Override
public boolean processVideo() {
boolean isConvertationSuccess = true;
// Make input file list
LOGGER.info(MAKING_INPUT_FOLDER_LIST);
List<File> inputFoldersList = fileService.getInputFolderList(properties
.getPropertyValue(ApplicationSetting.INPUT_FOLDERS));
Map<File, File> inputFilePairs = nul... | 8 |
private void jCheckBoxVisiteursActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBoxVisiteursActionPerformed
//Récupération de la méthode contrôleur 'afficherVisiteur'
this.getCtrlM().afficherVisiteur();
}//GEN-LAST:event_jCheckBoxVisiteursActionPerformed | 0 |
public void steplsqr( PaceMatrix b, IntVector pvt, int ks, int j,
boolean adjoin ) {
final int kp = pvt.size(); // number of columns under consideration
int [] p = pvt.getArray();
if( adjoin ) { // adjoining
int pj = p[j];
pvt.swap( ks, j );
double dq[] = h1( pj, ks );
i... | 7 |
@Override
public void handleKeyEvent(KeyEvent keyEvent) {
if(keyEvent.getID() == KeyEvent.KEY_PRESSED){
switch(keyEvent.getKeyCode()){
case KeyEvent.VK_LEFT:
if(Game.gameGrid.getSnake().getDirection() != Cardinal.EAST)
Game.gameGrid.getSnake().setDirection(Cardinal.WEST);
break;
case KeyEvent.V... | 9 |
public static void setFilePath() {
String pathBin = Main.class.getClass().getResource("/").getFile();
String path = pathBin.substring(0, pathBin.lastIndexOf("/"));
path = path.substring(0, path.lastIndexOf("/"));
path = path + "/doc/";
Config.FILE_PATH = path;
System.out.println("file save path " + Config.F... | 0 |
boolean setPosition(Position p) {
if (p.x >= Map.grid.length || p.y >= Map.grid.length || p.x < 0
|| p.y < 0)
return false;
else if (Map.grid[p.x][p.y] == Color.BLUE) {
System.out
.println("Your just drowned... Bottom line, you have to start from the beginning\n");
Position newP = new Position(sta... | 6 |
@Override
public void unInvoke()
{
final Physical P=affected;
super.unInvoke();
if((P instanceof MOB)&&(this.canBeUninvoked)&&(this.unInvoked))
{
if((!P.amDestroyed())&&(((MOB)P).amFollowing()==null))
{
final Room R=CMLib.map().roomLocation(P);
if(!CMLib.law().doesHavePriviledgesHere(invoker(), ... | 8 |
public static void main(String[] args) throws Exception {
if (args.length < 1) {
//System.err.println("Usage: java " + CometServletClientTest.class.getName()
// + " URL [n] [max] [delay]");
System.err.println("Usage: java " + CometServletSSLClientTest.class.getName()
... | 8 |
public void paintComponent(Graphics g) {
super.paintComponent(g);
for (int i=0; i < cards.length; i++) {
cards[i].drawCard(g, this);
}
} | 1 |
public InputConnectionHandler(ObjectInputStream in, ServerConnectionHandler serverConnectionHandler, DtoExtractor dtoExtractor) {
this.in = in;
this.dtoExtractor = dtoExtractor;
this.serverConnectionHandler = serverConnectionHandler;
} | 0 |
public int Colorize() {
/*для каждого узла устанавливаем */
for (Node node : nodes.values()) {
/*нулевой номер компоненты*/
node.SetComponentNumber(0);
/*узел не просмотрен*/
node.SetVisited(false);
}
/*текущий номер компоненты*/
in... | 7 |
Point computeSize(Control control, int wHint, int hHint, boolean flushCache) {
if (flushCache)
flushCache();
if (wHint == SWT.DEFAULT && hHint == SWT.DEFAULT) {
if (defaultWidth == -1 || defaultHeight == -1) {
Point size = control.computeSize(wHint, hHint, flushCache);
defaultWidth = size.x;
defau... | 9 |
protected void setWidth(int _width) {
this.width = _width;
updateAspectRatio();
} | 0 |
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 |
/* @ pure */ public LinkedList<Coordinate> getEdgeFields() {
LinkedList<Integer> occupied = new LinkedList<Integer>();
//@loop_invariant 0 < index && index < DIM * DIM;
for (int index = 0; index < DIM * DIM; index++) {
if (!(fields[index] == Mark.EMPTY)) {
occupied.add(index);
}
}
LinkedList<Coord... | 6 |
protected void updateArc()
{
// arc was fully matched - save it
addToPath( arc );
boolean extended = false;
ListIterator<Arc> iter = arc.to.outgoingArcs();
while ( iter.hasNext() )
{
Arc a = iter.next();
if ( a.versions.intersects(versions)
&&a.versions.nextSetBit(mum.version)!=mum.version
&&... | 6 |
@Override
public void execute() {
System.out.println("Banking");
if (RSC.waitFor(new Condition() {
@Override
public boolean validate() {
//If the bank isn't open
return !Bank.isOpen();
}
}, 1500)) {
//Open the bank
Bank.open();
} else if (RSC.waitFor(new Condition() {
@Override
pub... | 8 |
public void iconst(final int cst) {
if (cst >= -1 && cst <= 5) {
mv.visitInsn(Opcodes.ICONST_0 + cst);
} else if (cst >= Byte.MIN_VALUE && cst <= Byte.MAX_VALUE) {
mv.visitIntInsn(Opcodes.BIPUSH, cst);
} else if (cst >= Short.MIN_VALUE && cst <= Short.MAX_VALUE) {
mv.visitIntInsn(Opcodes.SIPUSH, cst);
... | 6 |
public Vector<Container> getSheaths(MOB mob)
{
final Vector<Container> sheaths=new Vector<Container>();
if(mob!=null)
for(int i=0;i<mob.numItems();i++)
{
final Item I=mob.getItem(i);
if((I!=null)
&&(!I.amWearingAt(Wearable.IN_INVENTORY))
&&(I instanceof Container)
&&(((Container)I).capacity()>0)... | 9 |
public void update(){
time.update();
key.update();
switch(state.getState()){
case 1:
menu.update();
break;
case 2:
menu.update();
break;
case 3:
dungeon.update();
break;
case 4:
dungeon.update();
break;
case 5:
//World map update
break;
default:
menu... | 5 |
public static String sendPost(String urlPath, String params) {
HttpURLConnection connection = null;
DataOutputStream out = null;
BufferedReader reader = null;
try {
URL url = new URL(urlPath);
connection = (HttpURLConnection) url.openConnection();
/*
* connection.setRequestProperty("User-Agent",Com... | 8 |
public void run() {
for(;;) { // animation loop never ends
if(newfruit) {fruits.add(new Fruit()); newfruit = false;}
bufferGraphics.clearRect(0, 0, getSize().width,getSize().height);
/*for(Fruit f: fruits){
if (f.isFalling) {
if(f.radius... | 9 |
/** @return The first row to display. By default, this would be 0. */
public int getFirstRowToDisplay() {
return mFirstRow < 0 ? 0 : mFirstRow;
} | 1 |
public String moveCardOntoKingFromAce(int indexFrom, int indexTo) {
List<Card> from = acePiles.get(indexFrom);
if (from.size() == 1) {
return wouldMakePileEmpty();
} else {
return moveCardOntoKingPile(from, -1, indexTo);
}
} | 1 |
public void parseSharedDiskSectionTag(HashMap<String, SharedDisk> sdisks, HashMap<String,File> files, XMLEvent e, XMLEventReader r) throws XMLStreamException{
boolean end = false;
while (!end && r.hasNext()){
e = r.nextEvent();
end = (e.isEndElement() && e.asEndElement().getName().getLocalPart().contentEquals... | 8 |
private double generateRatings() {
double value = 0;
int dice1 = random.nextInt(11);
int dice2 = random.nextInt(10);
if (dice1 == 10) {
value = 10;
} else if (dice1 == 0 && dice2 == 0) {
value = 0.1;
} else {
value += dice1 + (double... | 3 |
public ArrayList<String> getServers()
{
ArrayList<String> toReturn;
if (offline)
{
toReturn = new ArrayList<>();
StringTokenizer st = new StringTokenizer(p.getProperty("servers"));
while (st.hasMoreElements())
{
toReturn.add(st.nextT... | 4 |
public boolean removeFirstOccurrence(Object o) {
if (o == null)
return false;
int mask = elements.length - 1;
int i = head;
E x;
while ( (x = elements[i]) != null) {
if (o.equals(x)) {
delete(i);
return true;
}
... | 3 |
private final void method505(byte i) throws IOException {
anInt996++;
while (((Class348_Sub23) aClass348_Sub23_Sub2_1001)
.anOggStreamState6869.packetOut(anOggPacket993)
!= 1) {
Class348_Sub23 class348_sub23 = method521(1);
if (class348_sub23 != null) {
if (class348_sub23 == aClass348_Sub23_S... | 5 |
public void keyReleased(KeyEvent e) {
// je nach Taste das passende Gotchi erzeugen
switch (e.getKeyChar()) {
case '1':
mainScreen.setGotchi(new Dog("Bello"));
break;
case '2':
mainScreen.setGotchi(new Cat("Murmur"));
break;
case '3':
mainScreen.setGotchi(new Bunny("Hermine"));
break;
}
... | 4 |
public Person() {
} | 0 |
public void removeLiens(List<ZLien> supp)
{
for (Iterator<ZLien> e = supp.iterator(); e.hasNext();)
removeLien((ZLien) e.next());
} | 1 |
private boolean isLoop() {
if (loops == -1) {
return true;
}
return (loops > currentLoop);
} | 1 |
public static void startupClTranslate() {
{ Object old$Module$000 = Stella.$MODULE$.get();
Object old$Context$000 = Stella.$CONTEXT$.get();
try {
Native.setSpecial(Stella.$MODULE$, Stella.$STELLA_MODULE$);
Native.setSpecial(Stella.$CONTEXT$, ((Module)(Stella.$MODULE$.get())));
i... | 9 |
private void btnEliminarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEliminarActionPerformed
int res = JOptionPane.showConfirmDialog(
this,
"Seguro que deseas eliminar el personal",
"Advertencia",
JOptionPane.YES_NO_OPTION
);
... | 2 |
public ArrayList<ArrayList<String>> makeGroup(ArrayList<String> input)
{
ArrayList<ArrayList<String>> output= new ArrayList<ArrayList<String>>();
int i=0;
while(i<input.size())
{
Character currentFirst=input.get(i).charAt(0);
ArrayList<String> currentGroup = new ArrayList<String>();
... | 3 |
public static void write(String saveName, GameState state) {
JSONObject gameState = new JSONObject();
gameState.put("Save name", saveName);
gameState.put("node", state.getNodeID());
// for ease of use
Player p = state.getPlayer();
JSONObject player = new JSONObject();
player.put("name", p.... | 5 |
public TreePath getPath(String fullName) {
if (fullName == null || fullName.length() == 0)
return new TreePath(root);
int pos = -1;
int length = 2;
while ((pos = fullName.indexOf('.', pos + 1)) != -1)
length++;
TreeElement[] path = new TreeElement[length];
path[0] = root;
int i = 0;
pos = -1;
ne... | 7 |
public String getPicByPID(Statement statement,String PID)//根据PID获取图片地址
{
String result = null;
sql = "select pic from Park where PID = '" + PID +"'";
try
{
ResultSet rs = statement.executeQuery(sql);
while (rs.next()) {
result = rs.getString("pic");
}
}
catch (SQLException e)
{
System.... | 2 |
private Class defineClass(byte[] bytes) {
try {
Method defineClass = ClassLoader.class.getDeclaredMethod("defineClass", String.class /*name*/, byte[].class /*b*/, int.class /*off*/, int.class /*len*/);
defineClass.setAccessible(true);
return (Class) defineClass.invoke(classLoader, null, bytes, 0, ... | 3 |
@SuppressWarnings("unchecked")
public T findById(ID id) {
if(id == null){
return null;
}
Session session = HibernateUtil.getSessionFactory().openSession();
Transaction transaction = session.beginTransaction();
T entity = (T) session.get(getPersistentClass(), id);
transaction.commit();
session.close();... | 1 |
public void test_DateTime_setHourForward_Moscow_Spring() {
DateTime dt = new DateTime(2007, 3, 25, 0, 0, 0, 0, ZONE_MOSCOW);
assertEquals("2007-03-25T00:00:00.000+03:00", dt.toString());
try {
dt.hourOfDay().setCopy(2);
fail();
} catch (IllegalFieldValueE... | 1 |
@Override
public void keyPressed(KeyEvent event) {
} | 0 |
public static DB connect() {
if (database == null) {
database = new DB();
}
return database;
} | 1 |
public static void main(String[] args)
{
if (args.length > 2)
{
String option = args[0].toLowerCase();
String fileName = args[1];
boolean encrypt = false;
if (option.equals("-e"))
encrypt = true;
else if (!option.equals("-d"))
{
System.err.printf("'%s' is... | 7 |
public Configuration getConfiguration() {
return config;
} | 0 |
private Command getInheritedCommand(String alias)
{
if(parent == null)
{
return null;
}
return parent.getCommand(alias);
} | 1 |
public void renderTile(int xp, int yp, Tile tile, Level level) {
for (int y = 0; y < tile.sprite.height; y++) {
int ya = y + yp;
for (int x = 0; x < tile.sprite.width; x++) {
int xa = x + xp;
if (xa < -tile.sprite.width || xa >= width || ya < 0 || ya >= height) break;
if (xa < 0) xa = 0;
level.c... | 7 |
private boolean accountedForAllStates(Automaton automaton) {
if (getUnaccountedForState(automaton) == null)
return true;
return false;
} | 1 |
public StatePlacer() {
} | 0 |
protected void placeLabels(Object[] v, Object[] e)
{
mxIGraphModel model = graph.getModel();
// Moves the vertices to build a circle. Makes sure the
// radius is large enough for the vertices to not
// overlap
model.beginUpdate();
try
{
for (int i = 0; i < e.length; i++)
{
mxCellState edge = (... | 5 |
public static void main(String path) throws IOException
{
// Save the image file as a BufferedImage object
File f=new File(path);
BufferedImage cat = ImageIO.read(f);
f.delete();
path=path.replace(".jpg_binary.png","");
path=path.replace(".J... | 9 |
public Object[] getArrayRows (boolean includeCommentLine) {
// filter header and comment rows
ArrayList<CSVRow> myrows = new ArrayList<CSVRow>();
for (CSVRow row : rows) {
// should we return the comment line
if (row.isCommentLine()) {
if (includeCommentLi... | 4 |
public String toString() {
// only ZeroR model?
if (m_ZeroR != null) {
StringBuffer buf = new StringBuffer();
buf.append(this.getClass().getName().replaceAll(".*\\.", "") + "\n");
buf.append(this.getClass().getName().replaceAll(".*\\.", "").replaceAll(".", "=") + "\n\n");
buf.append("Wa... | 9 |
public Card drawCard() {
try {
Card card = cardPile.pop();
if (component != null) {
component.updateTopCard();
}
return card;
} catch (NoSuchElementException ex) {
System.out.println("ERROR: Pile Empty");
return null... | 2 |
public static void main(String args[]) {
AskNumber test = new AskNumber();
System.out.println(test.jTextField1);
/* 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 no... | 6 |
public static void main(String[] args) {
//iterate to print the 10 first number of fibonacci sequence
for(int i=0;i<10;i++){
if(i==9){
System.out.print(noRecursionFib(i));
}
else{
System.out.print(noRecursionFib(i)+",");
}
}
}//end main | 2 |
public void addEntry(String caReference,
List<CVCertificate> terminalCertificates, PrivateKey terminalKey) {
if (caReference == null || certificateListsMap.containsKey(caReference)) {
// For now we disallow this.
throw new IllegalArgumentException(
"Bad key (already present or null).");
}
if (termin... | 5 |
public static void main(String[] args) throws IOException {
PrintWriter writer = new PrintWriter("C:\\output.txt");
for (int i = 10; i <= 12; i++) {
HashMapRandom randomInt = new HashMapRandom(i);
randomInt.random(writer);
}
writer.close();
} | 1 |
public static boolean accept(AbstractSyntaxNode node, TokenReader reader)
{
boolean result = false;
if (reader.lookahead(0).code() == Token.IDENTIFIER
&& reader.lookahead(1).code() == Token.OPEN_PAREN)
{
final Token funcName = reader.lookahead(0);
... | 5 |
public void setRight(IntBTNode newRight)
{
right = newRight;
} | 0 |
public PartCombinator(PeekReader in, PartCombinator parent) {
this.parent = parent;
try {
StringBuilder out = new StringBuilder();
for (; ; ) {
int c = in.read();
if (c == -1 || c == ')') {
break;
} else if (c =... | 5 |
public Writer write(Writer writer) throws JSONException {
try {
boolean b = false;
Iterator keys = keys();
writer.write('{');
while (keys.hasNext()) {
if (b) {
writer.write(',');
}
Object k = ke... | 5 |
public static void main(String[] args) {
try {
Plic plic;
//System.out.println("args : "+args.length);
if(args.length==1)
plic = new Plic(args[0]);
else
plic = new Plic(args[0],args[1]);
} catch (ArrayIndexOutOfBoundsExcepti... | 5 |
@Override
public int update(Integer idMetier, Visiteur objetMetier) throws Exception {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
} | 0 |
public BrowserExample(Composite parent, boolean top) {
this.parent = parent;
try {
browser = new Browser(parent, SWT.BORDER);
} catch (SWTError e) {
error = e;
/* Browser widget could not be instantiated */
parent.setLayout(new FillLayout());
Label label = new Label(parent, SWT.CENTER | SWT.WRAP);
... | 3 |
@Override
public Object execute(HttpServletRequest request, HttpServletResponse response) throws Exception {
Contexto oContexto = (Contexto) request.getAttribute("contexto");
oContexto.setVista("jsp/empresa/form.jsp");
EmpresaBean oEmpresaBean;
EmpresaDao oEmpresaDao;
oEmpres... | 1 |
public void rotateCounterClockwise(Board board) {
Point[] newRel = new Point[3];
for (int i = 0; i < rel.length; i++) {
newRel[i] = new Point(rel[i].getY(), -rel[i].getX());
}
int r = 0;
if (getRotation() == 0) r = 2;
if (getRotation() == 1) r = 1;
if ... | 6 |
@Override
public void run() {
while (true) {
updateNetwork();
game.update(0.01);
try {
Thread.sleep(10);
} catch (InterruptedException e) {
System.err.println("Server thread interrupted");
}
}
} | 2 |
@Override
public Matrix select(int matrix_id) throws SQLException {
statement = connection.prepareStatement(selectColsString);
statement.setInt(1, matrix_id);
result = statement.executeQuery();
int cols = 0;
while (result.next()) {
cols = result.getInt(1);
... | 5 |
private int endX( Side side ){
if( side == Side.WEST ){
return boundaries.x;
}
else{
return boundaries.x + boundaries.width;
}
} | 1 |
public static boolean setHitType(final IClientContext ctx, final HitType hitType) {
if (getCurrentHitType(ctx) == hitType) {
return true;
}
final org.powerbot.script.rt6.Component buttonWidget = hitType.getButtonWidget(ctx);
if (buttonWidget.valid()) {
final Rectangle rect = buttonWidget.boundingRect();
... | 4 |
public String lastStr() {
switch(lastType) {
case ULSTRING:
return yytext();
case DLSTRING:
return getDLString();
case COMMENT:
return getComment();
default:
return "";
}
} | 3 |
public void transitionFunction(Alphabet symbol) {
switch (currentState) {
case q0:
switch (symbol) {
case lessThanMinimum:
currentState = State.q1;
break;
case moreThanMaximum:
currentState = State.q2;
break;
default:
break;
}
break;
case q1:
switch (symbol) {
case more... | 9 |
public DataClusterer(double[][] data , double[][] lapPoints) {
TunableParameters params = TunableParameters.getInstance();
int numClusters = params.getNumberOfClusters();
_clusterAssignment = new int[data.length];
KMeans evClusters = new KMeans(lapPoints, numClusters);
//double[][] clusters = evCluster... | 1 |
public double getSquaredError(DataPoint dp) {
double holder = Math.pow(getOutputNeuron().evaluate()-dp.getExpected(), 2);
dp.setError(holder);
return holder;
} | 0 |
public void printToFile(String fileName){
String protocolString = "";
protocolString += "\n" + "#include \"biocoder.h\"";
protocolString += "\n" + "void main()";
protocolString += "\n" + "{";
protocolString += "\n" + "\t" + "start_protocol(\"Quik Change Site Directed Mutagenesis\");" + "\n";
protoc... | 6 |
public static String timeIntervalToString(long millis) {
StringBuffer sb = new StringBuffer();
if (millis < 10 * Constants.SECOND) {
sb.append(millis);
sb.append("ms");
} else {
boolean force = false;
String stop = null;
for (int ix = 0... | 7 |
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.