text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void dragg(Excel start, Excel finish)
{
} | 0 |
private void setHighlightPosition() {
if ( activePosition != null ) {
int x, y;
if ( perspective == WHITE ) {
x = activePosition.getX () - 1;
y = activePosition.getY () - 1;
}
else {
x = CELL_AMOUNT - activePosition.getX ();
y = CELL_AMOUNT - activePosition.ge... | 7 |
public Object [][] getDatos(){
Object[][] data = new String[getCantidad_Cuentas ()][colum_names.length];
//realizamos la consulta sql y llenamos los datos en "Object"
try{
if (colum_names.length>=0){
r_con.Connection();
String c... | 5 |
public void setDestinationStop(int value) {
this._destinationStop = value;
} | 0 |
public ArrayList<MusicObject> getAllSongs() {
ArrayList<MusicObject> retVals = new ArrayList<MusicObject>();
try {
if (connection == null) {
connection = getConnection();
}
String sql = "select "+getColumnNames("music")+" from org.music music";
log.info("About to execute: " + sql);
... | 3 |
public ParseException generateParseException() {
jj_expentries.clear();
boolean[] la1tokens = new boolean[34];
if (jj_kind >= 0) {
la1tokens[jj_kind] = true;
jj_kind = -1;
}
for (int i = 0; i < 23; i++) {
if (jj_la1[i] == jj_gen) {
for (int j = 0; j < 32; j++) {
i... | 9 |
@Test
public void testGetAllAvailableMoves() {
System.out.println("getAllAvailableMoves");
Board board = new Board(8, 12);
RuleManager instance = new RuleManager();
SetMultimap<Position, Position> expResult = HashMultimap.create();
for (int i = 1; i < board.getSize(); i += 2)... | 4 |
private static int decode4to3(
byte[] source, int srcOffset,
byte[] destination, int destOffset, int options ) {
// Lots of error checking and exception throwing
if( source == null ){
throw new NullPointerException( "Source array was null." );
} // end if
... | 8 |
@Override
public void executeMsg(final Environmental myHost, final CMMsg msg)
{
super.executeMsg(myHost,msg);
if((affected!=null)
&&(affected instanceof MOB)
&&(msg.amISource((MOB)affected)||msg.amISource(((MOB)affected).amFollowing())||(msg.source()==invoker()))
&&(msg.sourceMinor()==CMMsg.TYP_QUIT))
{
... | 7 |
public void keyReleased(KeyEvent arg0) {
switch (arg0.getKeyCode()) {
case KeyEvent.VK_UP:
upKey.setPressed(false);
break;
case KeyEvent.VK_DOWN:
downKey.setPressed(false);
break;
case KeyEvent.VK_SPACE:
spaceKey.setPressed(false);
break;
case KeyEvent.VK_LEFT:
leftKey.setPressed(false);... | 5 |
private void receive() {
receive = new Thread(this, "Receive") {
public void run() {
while (running) {
byte[] data = new byte[1024];
DatagramPacket packet = new DatagramPacket(data, data.length);
try {
socket.receive(packet);
} catch (IOException e) {
e.printStackTrace();
}... | 2 |
private void modifyThread(Map<String, Object> jsonrpc2Params) throws Exception {
Map<String, Object> params = getParams(jsonrpc2Params,
new NullableExtendedParam(Constants.Param.Name.THREAD_ID, false),
new NullableExtendedParam(Constants.Param.Name.HEADLINE, false),
... | 4 |
public void actionPerformed(ActionEvent e)
{
String command = e.getActionCommand();
if (command.equals("GEN"))
{
try {
editor.setPage(meriseRapport.createRapport());
} catch(IOException exc) {
... | 2 |
@Override
public void mouseDragged(MouseEvent e) {
if(px == null && py == null){
px = e.getX();
py = e.getY();
}
x = e.getX();
y = e.getY();
Graphics2D g2 = (Graphics2D) canvas.getImg().getGraphics();
g2.setColor(canvas.getColor());
g2.setStroke(canvas.getStroke());
if (x != -1 && y != -1) {
g... | 4 |
public void destroy() {
super.destroy(); // Just puts "destroy" string in log
// Put your code here
} | 0 |
@EventHandler(priority = EventPriority.NORMAL)
public void onChat(PlayerChatEvent event){
Player p = event.getPlayer();
String s = event.getMessage();
String active = bm.getSign(p.getName());
if(active != null) {
event.setCancelled(true); //Dont show the message.
bm.setSign(p.getName(), null);
if(act... | 4 |
public String getTypeDescription(File f) {
String extension = Utils.getExtension(f);
String type = null;
if (extension != null) {
if (extension.equals(Utils.jpeg)) {
type = "JPEG Image";
} else if(extension.equals(Utils.jpg)) {
... | 7 |
@Override
public String toString() {
String suiteDisplay, valueDisplay;
switch (suite) {
case "S":
suiteDisplay = "Spades";
break;
case "H":
suiteDisplay = "Hearts";
break;
case "D":
... | 9 |
public String[] getVariables() {
ArrayList list = new ArrayList();
String[] rhsVariables = getVariablesOnRHS();
for (int k = 0; k < rhsVariables.length; k++) {
if (!list.contains(rhsVariables[k])) {
list.add(rhsVariables[k]);
}
}
String[] lhsVariables = getVariablesOnLHS();
for (int i = 0; i < l... | 4 |
public Environment(Serializable object) {
theMainObject = object;
clearDirty();
initView();
} | 0 |
public static double[][] calculateDensity() {
int numGridLines = getNumGridlines();
double[][] density = new double[numGridLines][numGridLines];
double i1 = Settings.getMinimumRange();
// Calculate un-normalized density for each point in domain, looping across X1
for (int x1Ind = 0; x1Ind < numGridLines... | 5 |
private ArrayList<T> getList(Object... objects)
{
ArrayList<T> l = new ArrayList<T>();
for(Object obj : objects)
{
if(typeClass.isInstance(obj))
{
l.add(typeClass.cast(obj));
}
else
{
if(obj instanceof Object[])
{
l.addAll(getList((Object[])obj));
}
if(obj instanceof... | 5 |
private MouseListener createProductContainerTreeMouseListener() {
return new MouseAdapter() {
@Override
public void mousePressed(MouseEvent e) {
handleMouseEvent(e);
}
@Override
public void mouseReleased(MouseEvent e) {
handleMouseEvent(e);
}
private void handleMouseEvent(MouseEvent ... | 8 |
public void collisionCheck(){
if(bulletsInRoom.size() >0){
bullets = new CopyOnWriteArrayList<Bullet>(bulletsInRoom);
for(Bullet b: bullets){
b.updateBounds();
if(enemylist.size()>0){
enemies = new CopyOnWriteArrayList<Enemy>(enemylist);
for(Enemy e: enemies){
if(b.bounds.intersects(e.en... | 8 |
private int buildJump(int xo, int maxLength) {
gaps++;
//jl: jump length
//js: the number of blocks that are available at either side for free
int js = random.nextInt(4) + 2;
int jl = random.nextInt(2) + 2;
int length = js * 2 + jl;
boolean hasStairs = random.nex... | 9 |
@Override
public void actionPerformed(ActionEvent e) {
if (e.getActionCommand().equals(LevelEditorView.HELP)){
new HelpFrame();
} else if (e.getActionCommand().equals(LevelEditorView.SAVE)) {
this.save(); //save the level
}
} | 2 |
@OnOpen
public void onOpen(Session userSession) throws IOException {
chatroomUsers.add(userSession);
this.userSession = userSession;
Iterator<Session> iterator = chatroomUsers.iterator();
while (iterator.hasNext()) {
(iterator.next()).getBasicRemote().sendText(buildJsonUs... | 1 |
public boolean pairMatch(
LinkedHashMap<String, LinkedHashMap<String, String>> humanPropRoot,
String correctName1, String correctName2) {
if (humanPropRoot.containsKey(correctName1)
&& humanPropRoot.containsKey(correctName2)) {
String gender1 = humanPropRoot.get(correctName1).get("g");
String gender2 ... | 8 |
private CommunityAccount accountFromResultSet( Connection con, ResultSet rs ) throws SQLException {
long id = rs.getLong("uid");
/**
* Grab roles from other table. Don't use the wrapper since this is only called
* from process() (i.e., when we already have the lock)
*/
PreparedStatement s = con.prepa... | 3 |
public void shrink() {
trimWidth /= 2;
trimHeight /= 2;
byte image[] = new byte[trimWidth * trimHeight];
int off = 0;
for (int offY = 0; offY < height; offY++) {
for (int offX = 0; offX < width; offX++) {
image[(offX + offsetX >> 1) + (offY + offsetY >> 1) * trimWidth] = pixels[off++];
}
}
pixel... | 2 |
protected void search(String fileName){
startOutput(fileName);
while(!cobweb.getUnsearchQueue().isEmpty()){
final WebPage wp = cobweb.peekUnsearchQueue();// 查找列隊
System.out.println("!cobweb.getUnsearchQueue().isEmpty(): " + wp.getUrl());
//初始節點
if(wp.getDepth() == 0){
try {
leavesNodeFileWri... | 8 |
public static void ex4() throws NumberFormatException, IOException{
int [] array=new int[10];
for(int i=0; i<10; i++){
array[i]=(int)(Math.random()*100);
System.out.print(array[i]+"\t");
}
System.out.print("\nValor => ");
int val=Integer.parseInt(stdin.readLine());
boolean encontrado=false;
for(int i=0; i<10... | 5 |
public static Valign parse(HtmlElement element, String str){
switch(str){
case "top":
return TOP;
case "middle":
return MIDDLE;
case "bottom":
return BOTTOM;
case "baseline":
default:
return BASELINE;
}
} | 4 |
public static void main(String[] args) {
// TODO Auto-generated method stub
String marketIP = args[0];
//String marketIP = "192.168.1.107";
int numberOfAgent = Integer.valueOf(args[1]);
//int numberOfAgent = 100;
final int recycleTime = Integer.valueOf(args[2]);
//final int recycleTime = 100;
... | 8 |
final void method1556(ItemDefinition class213_9_, byte i,
ItemDefinition class213_10_) {
try {
anInt2808 = class213_9_.anInt2808;
((ItemDefinition) this).anInt2779 = ((ItemDefinition) class213_10_).anInt2779;
((ItemDefinition) this).anInt2819 = 0;
aShortArray2785 = class213_9_.aShortArray2785;... | 6 |
public static void main(String[] args) {
JFrame frame = new JFrame("GuiFrame");
frame.setContentPane(new GuiFrame().mainframe);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setVisible(true);
} | 0 |
public static java.sql.Connection openConnection(Properties properties) throws SQLException, ClassNotFoundException {
String userName = properties.getProperty("app.dao.userName") == null ? "" : properties.getProperty("app.dao.userName");
String daoHost = properties.getProperty("app.dao.host") == null... | 8 |
public static void computeRankings() {
/*
* 1) win% (4-1 > 3-2)
* 2) more wins (3-3 > 2-2)
* 3) less losses (0-2 > 0-4)
*/
if (roster.size()!=0) { // put first player in first
rankings.add(new LinkedList<Integer>());
rankings.get(0).add(0);
}
for(int i=1;i<roster.size();++i) { // loo... | 9 |
public void processStep() throws FroshProjectException {
// Increment the day number
//
day++;
// Log a message
//
FroshProject.getLogger().log(Level.FINE, "Processing day " + day);
// Get the new weather state
//
processWeatherChange();
... | 5 |
void portNumberKeyReleased(KeyEvent e) {
if (client.getCommunicator() != null) {
popUpWindow dialog = new popUpWindow(this, "Wollen Sie sich wirklich vom Server abmelden ?");
if (dialog.getResult()) {
client.disconnect();
}
}
if (client.getCommunicator() == null) {
isPortOk... | 6 |
public Track getTrack(final int trackRefNumber) throws SQLException
{
// First Build the bare track details
PreparedStatement s = Connect
.getConnection()
.getPreparedStatement(
"SELECT RecordNumber, TrackName, Length, TrackNumber,formtrack FROM Track WHERE Trac... | 2 |
private boolean listFind(ListNode<T> node ,T element )
{
ListNode<T> tmpNode = node;
if(tmpNode == null)
{
return false;
}
while(tmpNode.next !=null)
{
if(tmpNode.element.equals(element))
{
return true;
}
tmpNode = tmpNode.next;
}
if(tmpNode.element.equals(element))
{
return tru... | 4 |
private void calculateDiagonalsAndBounds() {
super.modelHeight = 0;
diagonal2DAboveOrigin = 0;
maxY = 0;
minX = 0xf423f;
maxX = 0xfff0bdc1;
maxZ = 0xfffe7961;
minZ = 0x1869f;
for (int vertex = 0; vertex < vertexCount; vertex++) {
int x = verticesX[vertex];
int y = verticesY[vertex];
int z = ver... | 8 |
public long getHostID(String link) throws ForceErrorException {
long retVal = 0;
try {
Memcached cache = Memcached.getInstance();
URL url = new URL(link);
String host = url.getHost();
Object cacheValue = cache.get("papayHostID:" + host);
if (cacheValue == null) {
retVal = this.selectHost(... | 3 |
public static Visiteur selectOneByNomPrenom(EntityManager em, String nom, String prenom) throws PersistenceException {
Visiteur visiteur = null;
Query query = em.createQuery("select v from Visiteur v where v.nom = :nom and v.prenom = :prenom");
query.setParameter("nom", nom);
query.setPa... | 0 |
static private int jjMoveStringLiteralDfa3_0(long old0, long active0)
{
if (((active0 &= old0)) == 0L)
return jjStartNfa_0(1, old0);
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
jjStopStringLiteralDfa_0(2, active0);
return 3;
}
switch(curChar)
{
cas... | 5 |
private void itemCounterDown(FieldItem item) {
switch (item.getType()) {
case 'T':
numberOfTrees--;
break;
case 'D':
numberOfDucks--;
break;
case 'H':
numberOfHunters--;
break;
... | 3 |
public double getEtxToNode(int nodeID) {
Iterator<Edge> it2 = this.outgoingConnections.iterator();
EdgeOldBetEtx e;
while (it2.hasNext()) {
e = (EdgeOldBetEtx) it2.next();
if (e.endNode.ID == nodeID)
return e.getEtx();
}
return 0.0;
} | 2 |
public void save(){
File newDir = new File(DocIO.SAVE_PATH+doc.getName()+"Results");
if (!newDir.exists())
newDir.mkdirs();
try (
OutputStream file = new FileOutputStream(newDir.getAbsolutePath()+"/"+takersName);
OutputStream buffer = new BufferedOutputStream(file);
ObjectOutput output = new Objec... | 2 |
public void trimRect(final Rectangle aRect)
{
int lastX = aRect.x;
int lastY = aRect.y;
int firstX = aRect.x + aRect.width;
int firstY = aRect.y + aRect.height;
boolean bFoundAPixel = false;
for (int y=aRect.y; y<aRect.y + aRect.height; ++y)
{
... | 8 |
public void setType(int type) {this.type = type;} | 0 |
@Override
public int hashCode() {
int result = user != null ? user.hashCode() : 0;
result = 31 * result + (role != null ? role.hashCode() : 0);
return result;
} | 2 |
private void loadMapFromFile(String mapFilePath) throws ParserConfigurationException, IOException, SAXException {
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
Document doc = dBuilder.parse(mapFilePath);
... | 9 |
private boolean r_postlude() {
int among_var;
int v_1;
// repeat, line 75
replab0: while(true)
{
v_1 = cursor;
lab1: do {
// (, line 75
... | 9 |
public void visitThrowStmt(final ThrowStmt stmt) {
if (stmt.expr == from) {
stmt.expr = (Expr) to;
((Expr) to).setParent(stmt);
} else {
stmt.visitChildren(this);
}
} | 1 |
public int largestRectangleArea(int[] height) {
intStack heights = new intStack(height.length);
intStack indexes = new intStack(height.length);
int LargestAres = 0;
for (int i = 0; i < height.length; i++) {
if (heights.isEmpty() || height[i] > heights.peek()) {
... | 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 StringBuffer();
for(;;) {
if(c == '<' || c == 0) {
back();
return sb.toString().t... | 7 |
@Override
public void mark(int boardPosition, Cell[] cellBoard, int rows, int columns) throws IllegalMark {
//Find the row.
int boardPositionRow = boardPosition / columns;
//Find the column.
int boardPositionColumn = boardPosition % columns;
if (boardPositio... | 2 |
public static void dswap_f77 (int n, double dx[], int incx, double
dy[], int incy) {
double dtemp;
int i,ix,iy,m;
if (n <= 0) return;
if ((incx == 1) && (incy == 1)) {
// both increments equal to 1
m = n%3;
for (i = 1; i <= m; i++) {
d... | 8 |
protected void determineUnusedIndices(Instances data) {
Vector<Integer> indices;
int i;
int n;
boolean covered;
// traverse all ranges
indices = new Vector<Integer>();
for (i = 0; i < data.numAttributes(); i++) {
if (i == data.classIndex())
continue;
covered = f... | 7 |
private void recalculateDimensions()
{
if(originalImage!=null)
originalSize = new Point(originalImage.getAbsoluteWidth(), originalImage.getAbsoluteHeight());
else
originalSize = new Point(correctImage.getAbsoluteWidth(), correctImage.getAbsoluteHeight());
scaledSize = new Point(originalSize);
if... | 5 |
public void testSetEndMillis_long2() {
MutableInterval test = new MutableInterval(TEST_TIME1, TEST_TIME2);
try {
test.setEndMillis(TEST_TIME1 - 1);
fail();
} catch (IllegalArgumentException ex) {}
} | 1 |
public void loadRegion(Region region){
regions.add(region);
this.attachChild(region);
} | 0 |
public boolean addItem(Item item){
if(item != null){
if(!checkOverLimit()){
itemList.add(item);
return true;
}
}
return false;
} | 2 |
public void arenaBoardcast(String message) {
for (Player p : players) {
plugin.sendtoplayer(p, message);
}
} | 1 |
public void actionPerformed(ActionEvent e) {
String selected = e.getActionCommand();
if (selected.indexOf("Font:") != -1) {
tp.setFont(selected.split("Font:")[1]);
} else if(selected.indexOf("FontSize:") != -1) {
tp.setFontSize(Integer.parseInt(selected.split("FontSize:")[1]));;
} else if(selected.indexO... | 8 |
@Override
public LoginUserResponse loginUser(String username, String password) {
ArrayList<Pair<String,String>> requestHeaders = new ArrayList<Pair<String,String>>();
requestHeaders.add(new Pair<String,String>(CONTENT_TYPE_STR, APP_JSON_STR));
UserRequest loginRequest = new UserRequest(username, password);
ICo... | 2 |
private void checkThreeOfAKind() {
for (int i = 0; i < 13; i++) {
if (getNumberOfValues(i) == 3) {
myEvaluation[0] = 4;
myEvaluation[1] = i;
myEvaluation[2] = i;
myEvaluation[3] = 0;// Find leftover card
break;
}
}
} | 2 |
public static void main(String[] args) {
try {
logger.info("Entering application.");
String inputFolder = null;
File jarFile = null;
// Path to the folder jar is executed from
String jarPath = App.class.getProtectionDomain().getCodeSource()
.getLocation().getPath();
String jarDecod... | 9 |
public double getTotalCostInATime(String beginTime,String endTime){
double totalCost=0.0;
ArrayList<Object> receipts=this.show();
for (Iterator iterator = receipts.iterator(); iterator.hasNext();) {
SalesReceiptPO object = (SalesReceiptPO) iterator.next();
if(changeDateToInt(object.getTime())>=changeDate... | 5 |
public Tfoot(HtmlMidNode parent, HtmlAttributeToken[] attrs){
super(parent, attrs);
for(HtmlAttributeToken attr:attrs){
String v = attr.getAttrValue();
switch(attr.getAttrName()){
case "align":
align = Align.parse(this, v);
break;
case "char":
charr = Char.parse(this, v);
break;
... | 5 |
public void read(String file_name) throws DataInitialisationException{
try{
reset();
DocumentBuilderFactory dBFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder = dBFactory.newDocumentBuilder();
Document doc = dBuilder.parse(new FileInputStream(file_name));
/* Document root eleme... | 6 |
private Token fetchBlockEntry () {
if (flowLevel == 0) {
if (!allowSimpleKey) throw new TokenizerException("Found a sequence entry where it is not allowed.");
if (addIndent(column)) tokens.add(Token.BLOCK_SEQUENCE_START);
}
allowSimpleKey = true;
forward();
tokens.add(Token.BLOCK_ENTRY);
return Token.... | 3 |
public String toString() {
String s = "RDFNode {";
if( subjectUri != null ) s += "\n subjectUri = "+subjectUri;
if( sourceUri != null ) s += "\n sourceUri = "+sourceUri;
if( simpleValue != null ) s += "\n simpleValue = "+simpleValue;
for( Map.Entry<String,Set<RDFNode>> prop : properties.entrySet() ) {
f... | 6 |
public int getHP()
{
int hp = totalHP%getDefense();
return hp == 0 ? getDefense() : hp;
} | 1 |
private static void removeThreshold(List<String> otuNames,
List<List<Double>> dataPointsUnNormalized, double threshold)
{
List<Boolean> removeList = new ArrayList<Boolean>();
for (int x = 0; x < otuNames.size(); x++)
{
int sum = 0;
for (int y = 0; y < dataPointsUnNormalized.size(); y++)
{
sum +... | 8 |
private boolean checkCommand() {
try {
CommandScanner commandscanner = new CommandScanner(
StockGameCommandType.values(), descriptor);
BufferedReader reader = new BufferedReader(new StringReader(commandstring));
commandscanner.checkCommandSyntax(reader);
return true;
} catch (WrongCommandException ... | 2 |
public Map edit(Map map)
{
return null;
} | 0 |
private void grow_leaves() {
if (internal_node)
return;
compute_divisions();
octant1 = new SpatialTree<E>(division_x, division_y, division_z, max_x, max_y, max_z, max_objects_per_leaf);
octant2 = new SpatialTree<E>(min_x, division_y, division_z, division_x, max_y, max_z, ma... | 2 |
@Override
public boolean test(String value) {
// TODO Auto-generated method stub
if (value == null || value.length() == 0) {
return false;
}
int len = value.length();
if (!Character.isUpperCase(value.charAt(0))) {
return false;
}
for (int i = 1; i < len; i++) {
char c = value.charAt(i);
if (!... | 7 |
private static String getRefreshTokenFromFile() {
String temp = null;
JsonObject j;
// checks if refresh token file exists
File f = new File("refresh_token.json");
if (!f.exists()) {
return null;
}
// reads in refresh token file and parses out token value
try {
j = JsonObject.readFrom(openFile("... | 2 |
public static void main(String[] args) {
int[] data = {1, 4, 2};
for (int barrier = data.length - 1; barrier >= 1; barrier--) {
for (int index = 0; index < barrier; index++) {
if (data[index] > data[index+1]) {
swap (data, index);//граничные условия!! м... | 3 |
void update(int delta) {
if (isFlashing) {
timeSinceFlashing += delta;
if (timeSinceFlashing >= FLASH_DURATION) {
isFlashing = false;
}
}
if(wasChargingLastUpdate && !isCharging()){
flashOnce(3, Color.white, true);
}
wasChargingLastUpdate = isCharging();
} | 4 |
@Override
public void start() throws RemoteException {
// TODO Auto-generated method stub
// determine the configure file is existed or not
if (isExistedFile(midwarePath + "conf", confFile) == false) {
throw new RemoteException("There is no " + confFile);
}
//System.out.println(serverName);
if (isExis... | 5 |
public Castle(CastleType t, String n)
{
type = t;
name = n;
for (int i=0; i<availableToRecruit.length; ++i) {
availableToRecruit[i] = 0;
}
} | 1 |
private String siteLastUpdated() {
String url = "http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xml";
HttpURLConnection.setFollowRedirects(false);
HttpURLConnection con;
long date = 0;
try {
con = (HttpURLConnection) new URL(url).openConnection();
date = con.getLas... | 2 |
public void run(){
try {
// Starting all threads at the same time (clock == 0 / "8:00AM").
startSignal.await();
} catch (InterruptedException e) {
e.printStackTrace();
}
//Initializing the current time and the Random object
startTime = System.currentTimeMillis();
Random r = new Random();
//System.... | 7 |
@Override
public void doGet(HttpServletRequest req, HttpServletResponse res)throws ServletException, IOException{
res.setContentType("text/html");
Connection con = null;
String lausend = null;
ResultSet rs = null;
PreparedStatement ps = null;
Gson gson=new Gson();
ArrayList<CreateByParty> byParty=new Arr... | 9 |
final void reflectX() {
byte[] is = ((ImageSprite) this).colorIndex;
if (((ImageSprite) this).alphaIndex == null) {
for (int i = (((ImageSprite) this).indexHeight >> 1) - 1; i >= 0; i--) {
int i_35_ = i * ((ImageSprite) this).indexWidth;
int i_36_ = ((((ImageSprite) this).indexHeight - i - 1)
* ((Ima... | 5 |
public TruncateHelper setSuffix(String suffix)
{
// Treat null as empty string
if(null == suffix) suffix = "";
this._suffix = suffix;
return this;
} | 1 |
public void generateWing(int y) {
int iEvent = this.randomGenerator.nextInt(6);
switch (iEvent) {
case 0:
this.generateKamikazeWingLeft(y);
break;
case 1:
this.generatePassiveWing(y);
break;
case 2:
break;
case 3:
this.generateShooterWing(y);
break;
c... | 6 |
protected Float coerceToFloat(Object value) {
if (value == null || "".equals(value)) {
return Float.valueOf(0);
}
if (value instanceof Float) {
return (Float)value;
}
if (value instanceof Number) {
return Float.valueOf(((Number)value).floatValue());
}
if (value instanceof String) {
try {
r... | 7 |
@Override
public void windowClosed(WindowEvent e)
{
} | 0 |
protected void end() {
Robot.driveTrain.tankDrive(0, 0);
} | 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 |
@Override
public int h(T myNode) {
TicTacToeBoard<T> tictac = (TicTacToeBoard<T>) myNode;
ListToMatrix<T> matrix = tictac.getMatrix();
int h = 0;
Vector<Tile> line = new Vector<Tile>(0);
boolean check;
check = tictac.compareTilesForH((Vector<Tile>) matrix.getRow(0));
if (check)
h++;
check... | 7 |
static int process(String line) {
line = line.trim();
int ind = 1;
while(true) {
if(line.compareTo("#") == 0)
break;
switch (line.trim()) {
case "HELLO":
System.out.println("Case "+ind+": ENGLISH");
break;
case "HOLA":
System.out.println("Case "+ind+": SPANISH");
break;
case... | 8 |
private ArrayList<String> wordLetterPairs(String text)
{
ArrayList<String> result = new ArrayList<String>();
// Tokenize the string and put the tokens/words into an array
String[] words = text.split("\\s");
// For each word
for (int wordCounter = 0; wordCounter < words.length; wordCounter++)
{
// Find t... | 2 |
public HashMap parse_v3_frames(RandomAccessFile s, long payload_len, int v3minor) throws IOException {
HashMap tags = new HashMap();
byte[] frame = new byte[10]; // a frame header is always 10 bytes
long bread = 0; // total amount of read bytes
while(bread < payload_len) {
bread += s.read(f... | 8 |
public void mostrarDatoDeVenta(String campo, beansVentas venta){
String descripcion = null, parametro = null;
switch(campo.trim()){
case "nombre":
descripcion = "Nombre del producto ";
parametro = venta.getNombre();
break;
case "nick":
descripcion = "Comprado por ";
parametro = venta... | 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.