text stringlengths 14 410k | label int32 0 9 |
|---|---|
@RequestMapping(value = "/projectForm")
public ModelAndView showProjectForm(HttpServletRequest request) {
//I need customers list, assignments list and worktypes list !!!
ModelAndView modelAndView = new ModelAndView("projectForm");
String method = request.getParameter("action");
if ... | 2 |
public JSONStringer() {
super(new StringWriter());
} | 0 |
public Set<HTTPHeaderLine> getAll( String name )
throws NullPointerException {
if( name == null )
throw new NullPointerException( "Cannot retrieve header lines if the passed key (name) is null." );
// Get the set widht the elements
Set<HTTPHeaderLine> set = this.map.get( name );
// make a copy
S... | 3 |
public void defineModules(String... moduleNames) {
fragments.clear();
for (String moduleName : moduleNames) {
fragments.add(moduleName);
}
} | 1 |
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String line = "";
StringBuilder out = new StringBuilder();
int times = 1;
int[] a = new int[10001];
while ((line = in.readLine()) != null && line.length() != 0) {
int[] v ... | 8 |
protected void updateAge() {
age++;
if (age > maxAge && maxAge != 0) {
isAlive = false;
}
} | 2 |
public static void keyTyped(KeyEvent keyEvent) {
Iterator<PComponent> it = components.iterator();
while(it.hasNext()) {
PComponent comp = it.next();
if(comp == null)
continue;
if (shouldHandleKeys) {
if (comp.shouldHandleKeys())
... | 8 |
public void add( V val,K key){
if (root == null) {
root = new BinaryNode<K,V>(val,key,null,null);
}
else{
root.insert(val,key);
}
} | 1 |
public static int maxSubArray(int[] a){
if (a == null || a.length <0)return 0;
int sum = 0;
int max = 0;
int num = 0;
for (int i = 0; i < a.length; i++){
sum += a[i];
//如果sum小于0,则将其置为0,否则负值与后边的数相加会肯定会使总的和变小
if (sum < 0) sum = 0;
if ... | 8 |
private String wrapText(String text) {
int spaceSpace = GenericLabel.getStringWidth(" ");
int spaceAvailable = getWidth();
int spaceRemaining = spaceAvailable;
String[] words = text.split(" ");
String result = "";
for (int i = 0; i < words.length; i++) {
int ... | 4 |
private Object handleLdsOrdinance(Object tos, boolean isPersonalOrdinance, String tagName) {
if ((tos instanceof Person && isPersonalOrdinance) ||
(tos instanceof Family && !isPersonalOrdinance)) {
LdsOrdinance ldsOrdinance = new LdsOrdinance();
((PersonFamilyCommonContainer)tos).addLd... | 4 |
public boolean start() {
synchronized (optOutLock) {
// Did we opt out?
if (isOptOut()) {
return false;
}
// Is metrics already running?
if (task != null) {
return true;
}
// Begin hitting the s... | 7 |
private String getModelFileData(){
String modelData = null;
FileInputStream fis = null;
BufferedReader br = null;
try{
fis = new FileInputStream(modelDataFileName);
if(fis != null){
System.out.println("aaaaaaaaa");
}
br = new Buffere... | 3 |
public void deleteElement(String value) {
int codeValue = hashCode.hashCounter(value, length);
if (exists(value)) {
hashTable[codeValue].deleteElement(value);
}
} | 1 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Student other = (Student) obj;
if (!Objects.equals(this.group, other.group)) {
return false;
... | 5 |
protected final void addItemToPlayersInventory(Player player) throws InvalidActionException {
if (player == null)
throw new IllegalArgumentException("The given player is invalid!");
if (!(this instanceof Pickupable))
throw new InvalidActionException("The selected item can't be picked up!");
if (player.getRe... | 4 |
@Override
public void run() {
long currentTime = System.currentTimeMillis();
//generate report
Map<String, StringBuilder> successLogMap = new HashMap<String, StringBuilder>();
Map<String, StringBuilder> failLogMap = new HashMap<String, StringBuilder>();
//collect log
for (TestData data : datas) {
Abs... | 7 |
@Override
public void updatePatient(Patient patient) throws Exception {
// Get JDBC Connection
Connection conn= JDBCManager.getConnection();
PreparedStatement stmt=null;
String sql="Update Patient "+
"SET FirstName=?,LastName=?,Gender=?,Age=? "+
"WHERE HealthRecordNumber=?";
try... | 3 |
public void keyReleased(KeyEvent e) {
keyCode = e.getKeyCode();
if (keyCode == 38) {
lastdir = 1;
UP = false;
} else if (keyCode == 40) {
lastdir = 2;
DOWN = false;
} else if (keyCode == 37) {
lastdir = 3;
LEFT = fal... | 7 |
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case ID:
if (value == null) {
unsetId();
} else {
setId((Integer)value);
}
break;
case NOME:
if (value == null) {
unsetNome();
} else {
setNome((String)value);
... | 8 |
private synchronized void auto_reconnect(){
System.out.println("Attempting Auto-Reconnect...");
//Clean and desrtoy anything that may be left
try{mysql_connection.close(); mysql_connection = null;}catch(SQLException e){}
//On a sucesufull connection stop retrying
... | 6 |
private JSONObject readObject() throws JSONException {
JSONObject jsonobject = new JSONObject();
while (true) {
if (probe) {
log("\n");
}
String name = readName();
jsonobject.put(name, !bit() ? readString() : readValue());
if (!... | 4 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
IpAndMask other = (IpAndMask) obj;
if (ip == null) {
if (other.ip != null)
return false;
} else if (!ip.equals(other.ip))
return fals... | 9 |
public Type intersection(Type type) {
if (this == tError || type == tError)
return tError;
if (this == tUnknown)
return type;
if (type == tUnknown || this == type)
return this;
/*
* We have two different singleton sets now.
*/
if ((GlobalOptions.debuggingFlags & GlobalOptions.DEBUG_TYPES) != 0)... | 6 |
public void omniSend(Message m){
rover = head;
while(rover != null){
if(rover.status == 1){
rover.sendMessage(m);
if(m.header.equals("APPEND GIRL")){
Girl xxx = getGirl(randlist[conn.currgirl]);
System.out.print(xxx.name + " ");
}
System.out.println(m.header + " : " + conn.name + " - "... | 3 |
public void run() {
logger.finer("Receiving packets...");
isReceiving = true;
while(isReceiving) {
byte[] bytes = new byte[Packet.MAXIMUM_PACKET_SIZE];
DatagramPacket datagramPacket = new DatagramPacket(bytes, bytes.length);
try {
socket.receive(datagramPacket);
try {
Packet packet = Packet.... | 4 |
public int getV(){
return velocity;
} | 0 |
private void listAmount() {
System.out.println("files to process: " + listImg.size());
System.out.println("start convert names... " );
for (int i = 0; i < listImg.size() ; i++) {
String oldName = listImg.get(i);
Utils.percentCounter(i,listImg.size());
//System.out.println(oldName);
String ... | 8 |
void printMap() {
for (int i = 0; i < _map.length; i++) {
double[] row = _map[i];
for (int j = 0; j < row.length; j++) {
System.out.print(_map[i][j] + "\t");
}
System.out.print("\n");
}
} | 2 |
private void handleIOSERDES(){
// Remove ISERDES/OSERDES
for(Instance inst : design.getInstances()){
if(inst.getType().equals(PrimitiveType.ISERDES) ||
inst.getType().equals(PrimitiveType.OSERDES)){
instancesToRemove.add(inst);
}
boolean foundBadInstance = false;
if(inst.getName().contains("XD... | 9 |
public void setPosition(int x){
System.out.println(time);
if(x < startX){
x = startX;
}else if(x > startX + distance){
x = startX + distance;
}
rect.x = x;
this.time = (x - startX) * endTime / distance;
System.out.println(time);
} | 2 |
public void draw(Graphics g) {
g.setColor(new Color(255, 255, 250, 50));
g.fillOval(x + 1, y + 1, size, size);
g.setColor(color);
g.fillOval(x, y, size, size);
g.setColor(new Color(255, 255, 255, 50));
g.fillOval(x + 2, y + 2, size - 4, size - 10);
g.setColor(new Color(255, 255, 255, 60));
g.fillOval(x ... | 4 |
public MenuRenderer()
{
try
{
Background = ImageIO.read(new File(Main.loc + "/Textures/Menu/Background.png"));
Button1 = ImageIO.read(new File(Main.loc + "/Textures/Menu/Button1.png"));
Button2 = ImageIO.read(new File(Main.loc + "/Textures/Menu/Button2.png"));
}
catch (Exception e1)
{
//JOptio... | 1 |
@Override
public boolean okMessage(final Environmental myHost, final CMMsg msg)
{
if(!(myHost instanceof MOB))
return super.okMessage(myHost,msg);
final MOB myChar=(MOB)myHost;
if(!super.okMessage(myChar, msg))
return false;
if(msg.amISource(myChar)
&&(!myChar.isMonster())
&&(msg.sourceMinor()==CMM... | 8 |
private static double rombergGradoN(double extremoIzq, double extremoDer, Funcion fun, double k, double n){
if (n == 0){
//Si el grado es 0, significa que tengo que calcular trapecio, por lo que me devuelve T(h/2^k)
return trapecio(extremoIzq, extremoDer, fun, k);
} else {
... | 1 |
public void actionPerformed(ActionEvent e) {
String action = e.getActionCommand();
String str, textFinal, text;
if (action.equals("SAVEMLD")) {
String fileName = chooseFile();
if (fileName == null)
return;
try {
PrintStream out = new PrintStream(new FileOutputStream(
fileName));
... | 5 |
private static boolean isValueAnArmstrongNumber(int input) {
// convert user int value to a String object in order to use the charAt() method
StringBuffer valueAsStr = new StringBuffer(String.valueOf(input));
int combinedTotal = 0;
// determine the number of digits in the users input
... | 2 |
public void setMonthlySalary(double monthly)
{
if(monthly < 0)
{
monthlySalary =0;
}
else monthlySalary = monthly;
} | 1 |
public static void main(String[] args) throws Exception {
int ponder = 5;
if (args.length > 0)
ponder = Integer.parseInt(args[0]);
int size = 5;
if (args.length > 1)
size = Integer.parseInt(args[1]);
ExecutorService exec = Executors.newCachedThreadPool();
... | 7 |
public void advance() throws ControllerException {
try {
switch (parser.ttype) {
case StreamTokenizer.TT_NUMBER:
tokenType = TYPE_INT_CONST;
intValue = (int)parser.nval;
currentToken = String.valueOf(intValue);
... | 5 |
public int getID(Class<? extends APacket> p) {
return PList.indexOf(p);
} | 1 |
public TaskThread() {
// TODO Auto-generated constructor stub
} | 0 |
public void checkCollision() {
if (snake.getPosition().equals(food.getPosition())) {
snake.tail.add(new Point());
food.reset();
}
for (int i = 0; i < snake.tail.size() - 1; i++) {
if (snake.getPosition().equals(snake.tail.get(i))) {
gameOver = true;
}
}
if (snake.getPosition().getX() < 0
... | 7 |
private int getTarget()
{
InfoDetail cil = null;
int state;
if (this.data != null) {
for (InfoDetail o : this.data.getEnemies()) {
if (o != null) {
cil = o;
}
}
if (cil == null) {
state = -1;
return state;
}
int dX ... | 7 |
public static final boolean isJava(String fileName) {
for (String file : JAVA) {
if (file.equals(fileName)) {
return true;
}
}
return false;
} | 2 |
static long nextMonthDay(int index){
long start=startDay.getTime();
start+=index*milliSecondsOnyDay;
Calendar calendar=new GregorianCalendar(TimeZone.getTimeZone("GMT"));
calendar.setTime(new Date(start));
int thisMonthDay=calendar.get(Calendar.DAY_OF_MONTH);
calendar.add... | 1 |
@Override
public void processPacket(final Client c, int packetType, int packetSize) {
c.walkingToItem = false;
c.pItemY = c.getInStream().readSignedWordBigEndian();
c.pItemId = c.getInStream().readUnsignedWord();
c.pItemX = c.getInStream().readSignedWordBigEndian();
if (Math.abs(c.getX() - c.pItemX) > 25 || Math.... | 7 |
private void find(ArrayList<Integer> current, HashMap<Integer, Boolean> diagonal1,
HashMap<Integer, Boolean> diagonal2, ArrayList<String[]> result, int n) {
if (current.size() == n) {
result.add(getFormartStrings(current));
} else {
//find available column
... | 6 |
public AcyclicLP(EdgeWeightedDigraph G, int s)
{
distTo = new double[G.V()];
for (int i = 0; i < G.V(); i++)
distTo[i] = Double.NEGATIVE_INFINITY;
distTo[s] = 0;
edgeTo = new WeightedDirectedEdge[G.V()];
Topological topological = new Topological(G.digraph());
for (Integer v : topological.order())
re... | 2 |
public Integer getErrorType() {
return this.errorType;
} | 0 |
private void play()
{
Player[] pList = new Player[playerNumber];
ArrayList<Color> factions = Faction.allFactions();
ArrayList<PlayerInfo> infoList = new ArrayList<PlayerInfo>(infos.length);
for(PlayerInfo info : infos)
{
infoList.add(info);
}
Random random = new Random();
int index = 0;
while(... | 4 |
public String formatHTMLTable(StatCollector stat){
add("<!doctype HTML>");
add("<html>");
add("<body>");
add("<table border=1>");
add("<tr>Server statistic:");
// Total requests
add("<tr><td>Total requests<td>");
add(stat.getRequests());
// Unique requests number
add("<tr><td>Unique IP requ... | 8 |
public void saveGame() {
File file = new File("Saved_Games.txt");
FileWriter writer;
boolean flag = false;
ArrayList<String> data = new ArrayList<String>();
ListIterator<String> iterator;
String currentPuzzle = getCurrentPuzzle();
try {
Scanner s = new Scanner(file);
while(s.hasNextLine()) {
dat... | 8 |
public TaskWithResult(int id) {
this.id = id;
} | 0 |
static public HashMap<String, String[]> loadDomain(){
try{
@SuppressWarnings("resource")
BufferedReader csvFile = new BufferedReader(new FileReader("parserResult/authorDomain.csv"));
String[] dataArray;
String target;
while((target = csvFile.readLine())!= null){
dataArray = target.split(",");
domai... | 2 |
private int maximised_triangles() {
int a; int b;
HashMap<Integer,Integer> store = new HashMap<Integer,Integer>();
for(a = 1; a < 1000; a++) {
for(b = 1; b < 1000; b++) {
double c = Math.sqrt(IntMath.pow(a, 2) + IntMath.pow(b, 2));
if(Math.floor(c) == ... | 7 |
private static void EnemyMoveChoice(){
if(opponentHealth > 0){
Random rng = new Random();
int move = 1 + rng.nextInt(4);
//move = 2;
switch(move){
case 1:
System.out.println("Zubat used Tackle!");
System.out.print("\n"); // line break
playerHealth = DealDamage(playerHealth, tackle);
br... | 5 |
@EventHandler(priority = EventPriority.HIGH)
public void registerAccount(PlayerJoinEvent event) {
final Player player = event.getPlayer();
final User user = EdgeCoreAPI.userAPI().getUser(player.getName());
if (user == null)
return;
if (!Economy.isAllowAccounts())
return;
try {
if (Ec... | 5 |
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 startBall() {
_isBallStart = false;
for (int i = 0; i < _gameField.balls().size(); i++) {
_gameField.balls().get(i).setSpeed(0, -0.3);
}
} | 1 |
public boolean canCastle(Castle castle) {
if(!castle.isValid(this)) {
return false;
}
Move kingMove = castle.getKingMove();
Move rookMove = castle.getRookMove();
if(get(kingMove.getFrom()).hasMoved() || get(rookMove.getFrom()).hasMoved()) {
return false;
... | 7 |
@Override
public String processCommand(String[] arguments)
throws SystemCommandException {
String guid = facade.getCurrentUserGUID();
if (guid == null)
throw new SystemCommandException("No current user set.");
Date start = DateUtil.parseArgumentDate(arguments[1], arguments[2]);
Date stop = DateUtil.par... | 3 |
public NamiBeitragConfiguration(File configFile)
throws ConfigFormatException {
// Lese Konfigurationsdatei ein (inkl. Validierung)
Document doc;
try {
XMLReaderJDOMFactory schemafac = new XMLReaderXSDFactory(XSDFILE);
SAXBuilder builder = new SAXBuilder(schem... | 9 |
public static void saveProperties(Properties props, File propertyFile, String headerText) {
OutputStream out = null;
try {
out = new FileOutputStream(propertyFile);
if (StringUtils.isNotBlank(headerText)) {
props.store(out, headerText);
}
} ca... | 5 |
private String determinePixelSymbol(int intensity) {
String result = null;
if (intensity > 240) {
result = " ";
} else if (intensity > 200) {
result = ".";
} else if (intensity > 160) {
result = "^";
} else if (intensity > 120) {
result = "*";
} else if (intensity > 90) {
result = "&";
... | 9 |
@Override
public void modifiedStateChanged(DocumentEvent e) {} | 0 |
private void saveXMLFile(ArrayList<String[]> data) {
String xml = createXMLString(data);
File xmlfile = new File("ports.xml");
// OutputStreamWriter to enable forcing UTF-8 encoding.
OutputStreamWriter writer = null;
try {
writer = new OutputStreamWriter(new FileOutputStream(xmlfile),
Charset.forNa... | 1 |
private String collectionsAsString(List<String> list) {
String str = "( ";
Iterator<String> iterator = list.iterator();
while (iterator.hasNext()) {
String s = iterator.next();
str += s;
if (iterator.hasNext()) {
str += " ,";
}
... | 2 |
public void updateStatus(String text) {
if (text.length() + statusText.length() > MAX_STATUS_SIZE) {
// Remove the last line
statusText.delete(statusText.lastIndexOf("\n"),statusText.length());
}
// Update the master text
statusText.insert(0, text+"\n");
// And then add it to the text area
if... | 2 |
public int getSize() throws IteratorException {
int size = 0;
if (list != null) {
size = list.size();
} else {
throw new IteratorException(); //No Data
}
return size;
} | 1 |
public JSONNode addArrayElement(Object value) {
NodeType type;
if (getNodeType() != NodeType.ARRAY)
return null;
type = null;
if (value != null) {
if (value instanceof Boolean)
type = NodeType.PRIMITIVE;
else if (value instanceof Integer)
type = NodeType.PRIMITIVE;
e... | 7 |
public static void addPreLive(final String name) {
if (CallGraph.preLive == null) {
CallGraph.init();
}
CallGraph.preLive.add(name);
} | 1 |
private void zoom(double upperLeftX2, double upperLeftY2, double utmWidth2, double utmHeight2, boolean zoomIn,
double x1utm2, double x2utm2, double y1utm2, double y2utm2) {
if(zoomIn) {
if(x1utm2 > x2utm2) { //If x1 > x2 then switch
double temp = x1utm2;
x1utm2 = x2utm2;
x2utm2 = temp;
}
if(y... | 9 |
public String getCreditByUID(Statement statement,String UID)//根据用户名获取信用度
{
String result = null;
sql = "select credit from Users where UID = '" + UID +"'";
try
{
ResultSet rs = statement.executeQuery(sql);
while (rs.next()) {
result = rs.getString("credit");
}
}
catch (SQLException e)
{
... | 2 |
private void addIgnore(long l)
{
try
{
if(l == 0L)
return;
if(ignoreCount >= 100)
{
pushMessage("Your ignore list is full. Max of 100 hit", 0, "");
return;
}
String s = TextClass.fixName(TextClass.nameForLong(l));
for(int j = 0; j < ignoreCount; j++)
if(ignoreListAsLongs[j] == l)
... | 7 |
@Override
public GameState doAction(GameState state, Card card, int time) {
if(time == Time.DAY)
{
state = beggarDayAction(state, card);
}
else if(time == Time.DUSK)
{
PickTreasure temp = new PickTreasure();
state = temp.doAction(state, card, time);
}
else if(time == Time.NIGHT)
{
//Do noth... | 3 |
public Person3(String pname){
name = pname;
} | 0 |
private void printRow(String header, String[] cells)
{
printCell(header);
for (String cell : cells)
{
printCell(cell);
}
System.out.println();
} | 1 |
private int readCodeBit() throws IOException {
int temp = input.read(); // read one digit after freq in inputBitstream
if (temp != -1)
return temp;
else // Treat end of stream as an infinite number of trailing zeros
return 0;
} | 1 |
public static String unescape(String string) {
int length = string.length();
StringBuffer sb = new StringBuffer();
for (int i = 0; i < length; ++i) {
char c = string.charAt(i);
if (c == '+') {
c = ' ';
} else if (c == '%' && i + 2 < length) {
... | 6 |
protected void searchByName(String mask) {
if (mask.isEmpty()) {
searchFromIdx = 0;
return;
}
try {
Pattern p = Pattern.compile(mask);
ArrayList<CourseRec> all = courseModel.getFilteredCourses();
for (int i = searchFromIdx; i < all.size(); i++) {
CourseRec cr = all.get(i);
if (p.matcher(cr.... | 5 |
private boolean isCrossWin(){
if(model.getField().getCell(1, 1)==Field.DEFAULT_VALUE) return false;
if(
(model.getField().getCell(1, 1) == model.getField().getCell(0, 0) &&
model.getField().getCell(1, 1) == model.getField().getCell(2, 2)) ||
(model.getFiel... | 5 |
@Override
public String toString(){
return "id= "+this.getId()+", "+this.getName()+"\n"+getTime()+"\n"+"Ребро: "+this.getEdge()+"\n"+"Высота: "+this.getHig()+"\n"+"Сумма рёбер: "+this.getSum()+"\n"+" Площадь грани: "+this.getArea_surf()+"\n"+"S=: "+this.getArea()+" V=: "+this.getVolume()+"\n";
} | 0 |
public static String[] concatenateStringArrays(String[] array1, String[] array2) {
if (SpringObjectUtils.isEmpty(array1)) {
return array2;
}
if (SpringObjectUtils.isEmpty(array2)) {
return array1;
}
String[] newArr = new String[array1.length + array2.length];
System.arraycopy(array1, 0, newArr, 0, arr... | 2 |
public Matrix plus(Matrix B) {
Matrix A = this;
if (B.M != A.M || B.N != A.N) {
throw new RuntimeException("Illegal matrix dimensions.");
}
Matrix C = new Matrix(M, N);
for (int i = 0; i < M; i++) {
for (int j = 0; j < N; j++) {
C.data[i][j... | 4 |
public static void main(String[] args) throws Exception {
int ponder = 5;
if (args.length > 0)
ponder = Integer.parseInt(args[0]);
int size = 3;
if (args.length > 1)
size = Integer.parseInt(args[1]);
ExecutorService exec = Executors.newCachedThreadPool();
Chopstick[] sticks = new Chopstick[size];
for (... | 6 |
public List<ParkBoy> getBoyList() {
return boyList;
} | 0 |
public void hits() {
if (getState() != STATE_HIT) {
setCanHitEnemy(false);
setSpeed(0f);
setState(STATE_HIT);
switch (getFacing()) {
case Entity.UP:
moveY(-50);
break;
case Entity.DOWN:
moveY(50);
break;
case Entity.LEFT:
moveX(-50);
break;
case Entity.R... | 5 |
public void cliqueDeclin() {
if( etape == 0 && joueurEnCours.getPeupleDeclin() == null && Game.getInstance().askConf("Confirmer le passage en déclin ?") ){
//joueurEnCours.getPeuple().decliner();
//joueurSuivant();
tempEnDeclin = true;
setEtape(2);
miseEnMain();
Game.getInstance().showTe... | 3 |
public void run()
{
edge.addElement(GridCell.getStartCell());
int attempts =0;// variable to count how many attempts
int state=NOT_FOUND;
while(state==NOT_FOUND && attempts<maxSteps)//while a path hasnt been found and the whole grid hasnt been checked
{
attempts++;
... | 5 |
public LocalLog(String className) {
// get the last part of the class name
this.className = LoggerFactory.getSimpleClassName(className);
Level level = null;
if (classLevels != null) {
for (PatternLevel patternLevel : classLevels) {
if (patternLevel.pattern.matcher(className).matches()) {
// if leve... | 8 |
@Test
public void testGetDefaults() {
List<String> keys = new ArrayList<String>();
List<String> args = Arrays.asList("get");
String scriptResult = "";
try {
scriptResult = (String) _luaScript.callScript("config.lua", keys,
args);
} catch (LuaScriptException e1) {
System.out.println("Exception: " ... | 4 |
public static boolean isOpp(ChipColor color1, ChipColor color2) {
if((color1 == BLACK && color2 == WHITE) ||
(color1 == WHITE && color2 == BLACK))
return true;
else
return false;
} | 4 |
public void savePlayerMap(boolean resetValues) {
if (resetValues) {
for (Player Player : PlayerMap.values()) {
resetPlayerData(Player);
}
}
checkFile();
try {
FileOutputStream fos = new FileOutputStream(getFile());
ObjectOutputStream oos = new ObjectOutputStream(fos);
oos.writeObject(PlayerM... | 4 |
public void maxHeapify(int[] A, int len, int n) {
while (n <= len / 2) {
int max = n;
int left = n << 1;
if (left <= len && A[max] < A[left]) {
max = left;
}
int right = (n << 1) + 1;
if (right <= len && A[max] < A[right]) {... | 6 |
public Shape select(int qx, int qy) {
for (int i = shapes.size() - 1; i >= 0; i--) {
Shape shape = shapes.get(i);
if (shape instanceof Square) {
if (testInSquare((Square) shape, qx, qy)) {
System.out.println("Square selected!");
return shape;
}
}
else if (shape instanceof Circle) {
i... | 9 |
public VueComptesRendus getVue() {
return vue;
} | 0 |
protected void interrupted() {
end();
} | 0 |
private void invokeInsn(final int opcode, final Type type,
final Method method) {
String owner = type.getSort() == Type.ARRAY ? type.getDescriptor()
: type.getInternalName();
mv.visitMethodInsn(opcode, owner, method.getName(),
method.getDescriptor());
} | 1 |
public String toString() {
if (x!=0 && y>0) {
return x+" + "+y+"i";
}
if (x!=0 && y<0) {
return x+" - "+(-y)+"i";
}
if (y==0) {
return String.valueOf(x);
}
if (x==0) {
return y+"i";
}
// shouldn't get... | 6 |
Subsets and Splits
SQL Console for giganticode/java-cmpx-v1
The query retrieves a limited number of text entries within a specific length range, providing basic filtering but minimal analytical insight.