text stringlengths 14 410k | label int32 0 9 |
|---|---|
static public boolean playsRole(final CSProperties p, String key, String role) {
String r = p.getInfo(key).get("role");
if (r == null) {
return false;
}
return r.contains(role);
} | 1 |
private int indexOf(float[] a, float x) {
for (int i = 0; i < a.length; i++) {
if (a[i] == x) {
return i;
}
}
return -1;
} | 2 |
private void instantiateType(){
isSensor= true;
switch(ID){
case "mutagenicHorror":
case "fireyField":
case "chillyWind":
duration = 3;
damageStrength = 1.5f;
break;
case "electricField":
duration = 3;
damageStrength = 1.8f;
break;
case "boulderFist":
//only lasts as long as the anima... | 5 |
@Override
public String decrypt(String cipherText) {
String text = processInput(cipherText);
int r = transpositionLevel;
int length = text.length();
int c=length/transpositionLevel;
char mat[][]=new char[r][c];
int k=0;
String plainText="";
for(int i=0;i< r;i++) {
for(int j=0;j<... | 4 |
static void doTest(String desc, R btx, R xml) throws Throwable {
Timer t;
p("--------------------------");
p("Start test: " + desc);
for (int r = 0; r < 3; r++) {
t = new Timer();
for (int i = 0; i < 50; i++) {
btx.r();
t.mark();
}
t.report("btx");
t = new Timer();
for (int i... | 3 |
public void move() {
for (Organism org : Ecosystem.getOrange()) {
if (getDist(org) < sight) {
int x = posX - org.posX;
int y = posY - org.posY;
double d = Math.sqrt(x * x + y * y);
movX += 10 * (x / d);
movY += 10 * (y / d);
}
}
int dist = 1000;
for ... | 9 |
private void extract(String name) {
File actual = new File(getDataFolder(), name);
if (!actual.exists()) {
InputStream input = getClass().getResourceAsStream("/" + name);
if (input != null) {
FileOutputStream output = null;
try
{
output = new FileOutputStream(actual... | 8 |
public static ListNode mergeKLists(ArrayList<ListNode> lists) {
if (lists == null || lists.size() == 0) {
return null;
}
Queue<ListNode> heap = new PriorityQueue<ListNode>(lists.size(), listNodeComparator);
// add element to heap
for (int i = 0; i < lists.size(); i++) {
if (lists.get(i) != null) {
/... | 6 |
private void initializeVariables() {
variables = new TreeMap<Integer, Integer>();
variablesSnapshot = new TreeMap<Integer, Integer>();
// each site has copies of variables with even indexes
for(int i = 1; i<=10; i++) {
variables.put(2*i, 20*i);
variablesSnapshot.put(2*i, 20*i);
}
// if the sid of a si... | 2 |
public void setEffectImage() throws SlickException{
Random rand = new Random();
int randomEffect = rand.nextInt(8); //Four pictures
switch (randomEffect){
case 0: effectImage = new Image("data/effects/powerup.png");
effectType = "Larger Paddle";
break;
case 1: effectImage = new Image("data/effects/powerd... | 8 |
public void setUserlistPosition(Position position) {
if (position == null) {
this.userlist_Position = UIPositionInits.USERLIST.getPosition();
} else {
if (position.equals(Position.NONE)) {
IllegalArgumentException iae = new IllegalArgumentException("Position none... | 2 |
@Around("execution(* ProfileServiceImpl.shareProfile(..))")
public void aroundShare(ProceedingJoinPoint joinPoint) throws Throwable{
ProfileServiceImpl profileService = (ProfileServiceImpl)joinPoint.getTarget();
Object [] args = joinPoint.getArgs();
System.out.println(args[0] + " shares the profile of " + args... | 7 |
public static boolean anoBissexto(int a) {
if ( a%4==0 && a%100!=0 || a%400==0 )
return true;
return false;
} | 3 |
public void run() {
if(duration != -1) {
Robot.getInstance().getMotion().getPilot().forward();
Delay.msDelay(duration);
if(!getInterrupted()) {
Robot.getInstance().getMotion().getPilot().stop();
Robot.getInstance().getMotion().setRunnableRobot(null);
Robot.getInstance().warn(new Event(TypeEvent.G... | 7 |
public void Move(Location newloc)
{
Block array[] = null;
int a = 0,b = 0,c = 0 ;
int cux,cuy,cuz;
cux = flags.get("sx");
cuy = flags.get("sy");
cuz = flags.get("sz");
Server server = Bukkit.getServer();
//Location loc = new org.bukkit.Location(init.server.getWorld(getProp("world")), cux, cuy, cuz);
... | 8 |
@Override
public void runTask(InstallTasksQueue queue) throws IOException, InterruptedException {
String currentPath = relauncher.getRunningPath();
Utils.getLogger().log(Level.INFO, "Moving running package from " + currentPath + " to " + launcher.getAbsolutePath());
File source = new File(c... | 5 |
private static int calcMinValueNeeded(int curActiveFrame,int minAValueNeeded,int minBValueNeeded, Map<PII, Integer> imActiveFrame, boolean optimizeA) {
int minValueNeeded = (optimizeA ? minAValueNeeded : minBValueNeeded);
for(Entry<PII, Integer> e : imActiveFrame.entrySet())
if(curActiveFrame > e.getValue() && (... | 6 |
@Override
public List<LayoutNode> generate(int num, int dir)
{
final Vector<LayoutNode> set = new Vector<LayoutNode>();
Vector<TreeStem> progress = new Vector<TreeStem>();
final long[] rootCoord = new long[]{0,0};
final LayoutSet lSet = new LayoutSet(set,num);
originalDirection=dir;
final TreeStem root =... | 7 |
@Override
public V remove(Object key) {
int index = keys.indexOf(key);
if (index != - 1) {
V temp = values.get(index);
keys.remove(index);
values.remove(index);
return temp;
}
return null;
} | 1 |
protected void setCurrentStyle(String code) {
String oldStyle = currentStyle;
currentStyle = "";
String newStyle = "";
if (code.length() == 2) {
if (code.contains("0")) {
newStyle = defaultColor;
} else if (code.contains("-")) {
if ... | 7 |
public boolean fireballCollideCheck(Fireball fireball)
{
if (deadTime != 0) return false;
float xD = fireball.x - x;
float yD = fireball.y - y;
if (xD > -16 && xD < 16)
{
if (yD > -height && yD < fireball.height)
{
if (noFireballDeath... | 8 |
public Dialog saveDialog(int categoryId, Dialog dialog){
DialogCategory category = categories.get(categoryId);
if(category == null)
return dialog;
dialog.category = category;
while(containsDialogName(dialog.category, dialog)){
dialog.setTitle(dialog.getTitle() + "_");
}
if(dialog.id < 0){
lastUsed... | 6 |
public boolean shouldActivate(Duel duel, Duelist duelist) {
if(!this.hasEffect()) return false;
try {
PluginVars.engine.eval(new FileReader(this.effectFile));
try {
Object ret = PluginVars.engineinv.invokeFunction("shouldActivate", duel, duelist);
if(Boolean.class.isInstance(ret)) {
Boolean retva... | 5 |
private static String bytetoString(byte[] digest) {
String str = "";
String tempStr = "";
for (int i = 0; i < digest.length; i++) {
tempStr = (Integer.toHexString(digest[i] & 0xff));
if (tempStr.length() == 1) {
str = str + "0" + tempStr;
... | 2 |
private Tile(final char c, final boolean solid) {
this.solid = solid;
this.c = c;
switch (c) {
case '2':
img = ImageLoader.tile_glass_grey;
break;
case '3':
img = ImageLoader.tile_glass_black;
break;
case '4':
img = ImageLoader.tile_dirt;
break;
case '5':
img = ImageLoader.tile_grass... | 7 |
private void split(Hand hand) {
int card1Value = this.playerHand.getCard(0).getValue1();
int card2Value = this.playerHand.getCard(1).getValue2();
// money check
if ((2 * hand.getBet()) <= this.getBalance()) {
// make sure conditions met
if ((this.playerHand.countCards() == 2)
&& (card1Value == card... | 7 |
public boolean equals(LigneMarqueur liMarq2){
for(int i=0; i < tabMarq.length; i++){
if(tabMarq[i] != liMarq2.getMarq(i)){
return false; // Si les 2 tables de marqueur ne sont pas égales
}
}
return true;
} | 2 |
@Test
public void testReportDuplicate() throws Exception{
ParkedUsers garage = ParkedUsers.getInstance();
ParkingSpot spot = garage.searchBySpotNumber("312");
spot.setPrintWriter(new PrintWriter(System.out)); //2223432
String testedSpot = "312";
String userType = "student";
String tested... | 3 |
@SuppressWarnings("unchecked")
public Object invoke(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
if (type == Type.FORWARD) {
request.getRequestDispatcher(target).forward(request, response);
} else if (type == Type.REDIRECT || type == Ty... | 9 |
public Resource gatherResources(World world, int x, int y, int amount) {
if(x >= world.width || x < 0 || y >= world.height || y < 0 || world.getTile(x, y).id != this.getID()) return null;
int available = getResources(world, x, y);
int newAmount = available - amount; if(newAmount < 0) newAmount = 0;
int gathe... | 7 |
public void updateVersion() {
fileNumber = 0;
currentFile = 0;
try {
versions = OberienURL.getVersions();
status.append("Update finished\n\n");
status.append("Reinitialize verion label...\n");
serverVersion = versions[0];
status.append("Getting local version...\n");
try {
clientVersion =... | 4 |
public void popularCbEncarregado() {
ArrayList<String> Encarregado = new ArrayList<>();
UsuarioBO EncarregadoBO = new UsuarioBO();
try {
Encarregado = EncarregadoBO.ComboBoxEncarregadoPorDepartamento(this.usuarioLogado.getDepartamento().getCodigo());
} catch (SQLException ex... | 2 |
@Override
public void update(UpdateSubject updater) {
for (SquareGraphic sq : squareGraphicList) {
sq.setState(Service.getWorstState(sq.getStock()));
}
} | 1 |
public static void compareMomentumHL(String filename, int reps, int epochsPerRep, int printFrequency,
ANN ann, double[] mentums, int[] hlsizes, double[][] inputs, double[][] outputs) throws IOException {
File file = new File(filename);
FileWriter f = new FileWriter(file.getAbsolutePath());
int numDataPoints =... | 9 |
public String toString() {
return this.mode == 'd' ? this.writer.toString() : null;
} | 1 |
public static boolean isAddress(String address) {
if (isNull(address)) {
return false;
}
String[] tokens = address.split(StringPool.AT);
if (tokens.length != 2) {
return false;
}
for (String token : tokens) {
for (char c : token.toCharArray()) {
if (Character.isWhitespace(c)) {
return f... | 5 |
public void operation() {
System.out.println("concrete ImplementorA operation!");
} | 0 |
public void collide(){ // CHECKS COLLISIONS
this.south = (Map.checkCollide(this.x, this.y + length + 1 ) || Map.checkCollide(this.x + length, this.y + length + 5));
this.north = (Map.checkCollide(this.x, this.y - 1) || Map.checkCollide(this.x + length, this.y - 1));
this.west = (Map.checkCollide(this.x - 1, th... | 4 |
@Override
public void onClick(Position position)
{
if (board == null)
{
return;
}
if (!board.isEmpty(position) && board.getPiece(position).getColor() == playerColor)
{
if (selectedPosition == position)
{
selectedPosition = null;
gui.clearReachablity();
return;
}
possibleMoves = M... | 8 |
private static void solve_one_class(svm_problem prob, svm_parameter param,
double[] alpha, Solver.SolutionInfo si)
{
int l = prob.l;
double[] zeros = new double[l];
byte[] ones = new byte[l];
int i;
int n = (int)(param.nu*prob.l); // # of alpha's at upper bound
for(i=0;i<n;i++)
alpha[i] = 1;
if... | 4 |
public static void createEvents(GameModel model) throws IOException {
URL url = Room.class.getResource(eventsDescriptorFilePath);
BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()));
assert reader != null;
String line = null;
while ((line = reade... | 6 |
public void save() throws IOException {
File file = new File(System.getProperty("resources") + "/database/factions");
if(file.exists()) {
file.delete();
file.createNewFile();
} else {
file.createNewFile();
}
BufferedWriter writer = new BufferedWriter(new FileWriter(file));
for(int x = 0; x<li... | 2 |
public void addVertex(Object vertex, Point2D point) {
verticesToPoints.put(vertex, point.clone());
} | 0 |
public boolean stem() {
int v_1;
int v_2;
int v_3;
int v_4;
// (, line 157
// do, line 159
v_1 = cursor;
lab0: do {
// call prelude, line 159
if... | 8 |
private void closeOutput(){
try {
leavesNodeFileWriter.write("結束時間: " + getRightNowTimeStr("/", ":", " ") + "\r\n");
leavesContentFileWriter.write("結束時間: " + getRightNowTimeStr("/", ":", " ") + "\r\n");
leavesNodeFileWriter.close();
leavesContentFileWriter.close();
} catch (IOException e) {
// TODO A... | 1 |
public String getLanguage() {
ConsoleFEData cd = (ConsoleFEData)extra.get(ConsoleFEData.signature);
if (cd == null) {
cd = new ConsoleFEData();
extra.put(ConsoleFEData.signature, cd);
}
return cd.getLanguage();
} | 1 |
public static void loadKeys() {
HashMap<String, String[]> oldKeys = loadKey();
if (oldKeys == null) {
ColorKeys.Log(Level.SEVERE, "Unable to load old Keys file.");
return;
}
for (String player : oldKeys.keySet()) {
for (String k : oldKeys.get(player)) {
String[] parts;
int uses = -1;
if... | 6 |
public synchronized static void main(String[] args) {
SetupClient setupClient = new SetupClient();
try{
QuizServer quizAccess = (QuizServer)Naming.lookup("//127.0.0.1:1099/Quiz");
//quizList = quizAccess.getQuizList();
System.out.println("Quiz, Player and Result data are now availabe to setup ... | 6 |
public void runCommand(String command) {
for (Command x : commands) {
if (x.isMine(command)) {
String answer = x.execute();
if (answer != null) {
output.println(answer);
output.flush();
} else {
... | 5 |
@Override
public List<SocialCommunity<?>> getCommunities(String query, Integer page) {
List<Group> groups = new ArrayList<Group>();// getGroups(query, page);
return Lists.transform(groups,
new Function<Group, SocialCommunity<?>>() {
@Override
public SocialCommunity<?> apply(Group object) {
re... | 3 |
public java.awt.Component prepareEditor(
javax.swing.table.TableCellEditor editor, int row, int col )
{
final java.awt.Component c = super.prepareEditor( editor, row, col );
if ( drawStripes && !isCellSelected( row, col ) )
c.setBackground( rowColors[row&1] );
return c;
... | 2 |
public ArrayList<String> getTextureFilenames()
{
HashMap<String, Integer> tempMap = new HashMap<String, Integer>();
ArrayList<String> list = new ArrayList<String>();
list.add(this.tex);
if (this.tex_data != null)
{
for (String tex : this.tex_data.values())
{
if (!tempMap.containsKey(tex))
{
... | 9 |
private AttributeSet getTokenTextAttributes(TokenType token) {
if (token == null) {
return defaultAttributes;
}
switch (token) {
case ID:
return identifierAttributes;
case KEYWORD:
return keywordAttributes;
case KEYCHAR:
... | 7 |
static final void method2486(int i, int i_5_, int i_6_, int i_7_, int i_8_,
int i_9_) {
if (i_8_ >= Class369.anInt4960
&& (Class113.anInt1745 ^ 0xffffffff) <= (i_5_ ^ 0xffffffff)
&& (i_9_ ^ 0xffffffff) <= (Class132.anInt1910 ^ 0xffffffff)
&& Class38.anInt513 >= i_7_)
Class125.method1111(i_7_, ... | 5 |
private boolean check() {
if (N == 0) {
if (first != null) return false;
}
else if (N == 1) {
if (first == null) return false;
if (first.next != null) return false;
}
else {
if (first.next == null) return false;
}
... | 8 |
public LocalVariableTable(int maxLocals, LocalVariableInfo[] lvt) {
locals = new LocalVariableRangeList[maxLocals];
for (int i = 0; i < maxLocals; i++)
locals[i] = new LocalVariableRangeList();
for (int i = 0; i < lvt.length; i++)
locals[lvt[i].slot].addLocal(lvt[i].start.getAddr(),
lvt[i].end.getAddr... | 2 |
public static LocationList getPermutation( final List<LocationList> variations, long variationi ) {
if (( null == variations ) || ( 0 == variations.size() )) return null;
if ( 0 > variationi ) return null;
long numVariations = getPermutationCount( variations );
if ( variationi >= numVariations ) return null;
... | 7 |
private static void cleanCells() {
String fullFileName = "/Users/Johan/Documents/CellTowers/cells_exact_samples67-120_2036.json";
String newFileName = "/Users/Johan/Documents/CellTowers/cells_exact_samples67-120_cleaned.json";
JSONFile jsonFile = new JSONFile(newFileName);
jsonFile.iWannaStartAnArray("cells"... | 6 |
public void convert() {
try {
// File file = new File("E:\\Install\\levelssource.txt");
write(read());
} catch (JAXBException e) {
e.printStackTrace();
} catch (FileNotFoundException e) {
e.printStackTrace();
}
} | 2 |
public void parse(String input) throws ParseException {
String line;
String lastOpcodeLine = null;
List<String> lineBuffer = new ArrayList<String>();
Iterator<String> it = Splitter.on('\n').split(input).iterator();
while (it.hasNext()) {
line = it.next();
boolean isOpcode = (line.length() > 0 && l... | 9 |
public static String getPrintValue(AutomatonActions a) {
switch (a) {
case DRAGON:
return "D";
case SWORD:
return "S";
case ARC:
return "A";
case RIVER:
return "R";
case KEY:
... | 8 |
public void setName(String name) {
this.name = name;
} | 0 |
public int getMeetingAdminIndexByUsernameAndMeetingID(int meetingAdminID, String username){
for(MeetingAdmin meetingAdmin : meetingAdmins){
if(meetingAdminID == meetingAdmin.getMeetingID() && username.equals(meetingAdmin.getUsername())) return meetingAdmins.indexOf(meetingAdmin);
}
... | 3 |
public String getPastUpdate() {
String past_update = (String) cache.get("past_update");
if (past_update != null)
return past_update;
Entity past_entity = null;
DatastoreService datastore = DatastoreServiceFactory
.getDatastoreService();
try {
past_entity = datastore.get(KeyFactory.createKey("past_st... | 2 |
public int minDepth(TreeNode root) {
if(root==null){
return 0;
}
if(root.left==null&&root.right==null){
return 1;
}
if(root.right==null){
return 1+minDepth(root.left);
}
if(root.left==null){
return 1+minDepth(root.ri... | 5 |
public void outputTrainingData(String outputFile, List<Fortune> trainFortuneList){
Writer writer = null;
try {
writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outputFile), "utf-8"));
for(String word : this.vocabulary) {
writer.write(word + ... | 7 |
public boolean editMessage(String title, String content){
if(title!=null)this.title =title;
if(content!=null)this.content = content;
save();
return true;
} | 2 |
@Id
@GenericGenerator(name = "generator", strategy = "increment")
@GeneratedValue(generator = "generator")
@Column(name = "consignment_id")
public int getConsignmentId() {
return consignmentId;
} | 0 |
public void setType(UpgradeType type) {
this.type = type;
} | 0 |
public void cleanHeroes()
{
heroes = new ArrayList<core.Hero>();
while (heroesInner.count() > 0) {
heroesInner.takeAt(0).widget().dispose();
}
heroesSelected = -1;
} | 1 |
private final Parameterization[] getParameterizations(
String serializedParameters, final IParameter[] parameters)
throws SerializationException {
if (serializedParameters == null
|| (serializedParameters.length() == 0)) {
return null;
}
if ((parameters == null) || (parameters.length == 0)) {
re... | 9 |
public void writeMeanAndStdDevFiles(int[] placeIndicies) {
DecimalFormat form = new DecimalFormat("0.0");
StringBuilder meanBuffer = new StringBuilder("Totals\t");
StringBuilder standDevBuffer = new StringBuilder("Totals\t");
//begin by labeling the columns...
for (int i = 0; i < placeIndicies.length; i++)... | 8 |
public static Vector<Integer> alea(int k, int n) {
Vector<Boolean> val = new Vector<>(n, 0);
for (int i = 0; i < val.capacity(); i++) {
val.addElement(false);
}
Vector<Integer> tab = new Vector<>(k, 0);
int cpt = 0;
for (int i = 0; i < k; i++) {
int r = rand.nextInt(n);
tab.insertElementAt(r, i)... | 3 |
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
long n = 0, m = 0, a = 0, b = 0, x = 2;
int T = sc.nextInt();
for (int t = 0; t < T; t++) {
n = sc.nextLong();
if (n == 0) {
break;
}
... | 9 |
public void writeInformation(Description d, int categoryID, HUD UI) {
if (categoryID >= 3) return ;
else super.writeInformation(d, categoryID, UI) ;
if (categoryID == 0) {
final String
uS = needMessage(upgradeLevel),
tS = needMessage(upgradeLevel + 1) ;
if (uS != null) {
... | 4 |
public void testAddYear() {
Date date = DateUtils.addYear(testDate, 1);
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
assertEquals(2013, calendar.get(Calendar.YEAR));
} | 0 |
private boolean isRankConsistent() {
for (int i = 0; i < size(); i++)
if (i != rank(select(i))) return false;
for (Key key : keys())
if (key.compareTo(select(rank(key))) != 0) return false;
return true;
} | 4 |
public static void psychic5_draw_sprites(osd_bitmap bitmap)
{
int offs,sx,sy,tile,palette,flipx,flipy;
int size32,tileofs0,tileofs1,tileofs2,tileofs3,temp1,temp2;
/* Draw the sprites */
for (offs = 11 ;offs < spriteram_size[0]; offs+=16)
{
if (!(spriteram.read(offs+4)==0 && spriteram.read(offs)==0xf0)... | 8 |
public T pop() {
if(nodes.size() == 0)
return null;
T t = this.getLast();
nodes.remove(nodes.size() - 1);
return t;
} | 1 |
public boolean getFood() {
return this.hasFood;
} | 0 |
@Override
public void Configure(Context context) {
// TODO Auto-generated method stub
LOG.info("Config MultiLineParser");
buffer_size_ = context.getInteger("read_buffer_size",
FlumeConstants.READ_BUFFER_SIZE).intValue();
read_buffer_ = new byte[buffer_size_];
max_buffer_size_ = context.ge... | 9 |
@Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
final MOB target=(givenTarget instanceof MOB)?(MOB)givenTarget:mob;
if(target.fetchEffect(ID())!=null)
{
target.tell(L("You are no longer automatically marking traps."));
target.delEffect(mob... | 9 |
private void setLogger(ILogger logger) {
if (logger == null) {
System.err.println("[RemoteServerConnection WARN] Logger isn't assigned.");
this.logger = new FakeLogger();
}
else {
this.logger = logger;
}
} | 1 |
public Login() {
initComponents();
ImageIcon iconLogo = new ImageIcon(IMG.getImage("menu_soldados.png"));
ImageIcon iconLogo2 = new ImageIcon(IMG.getImage("Label_nombre.png"));
//obtener usuario
Lusuario.setIcon(iconLogo);
JTextField TextUsuario = new ja... | 2 |
public void run()
{
while(running)
{
if(connected)
{
if(debugMode) TEMPReadFromSocket();
else ReadFromSocket();
}
/*else
{
//if not connected, wait a bit before rechecking
try ... | 6 |
public static Tile getUnexplored(
IntelMap intelMap, Target target
) {
//
// TODO: Restrict this to within a given Box2D area if possible.
final Vec3D pos = target.position(null) ;
final MipMap map = intelMap.fogMap() ;
int high = map.high() + 1, x = 0, y = 0, kX, kY ;
final Co... | 7 |
public static byte[] decodeLines(String s) {
char[] buf = new char[s.length()];
int p = 0;
for (int ip = 0; ip < s.length(); ip++) {
char c = s.charAt(ip);
if (c != ' ' && c != '\r' && c != '\n' && c != '\t') {
buf[p++] = c;
}
}
... | 5 |
public boolean isDocDateExistsInTable(String docTableName) throws SQLException {
ArrayList<String> columnNames = new ArrayList<String>();
Connection conn = DriverManager.getConnection(ConnectionController.getConnParams);
String query = "select COLUMN_NAME from INFORMATION_SCHEMA.COLUMNS where TA... | 5 |
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result
+ ((buyNowPrice == null) ? 0 : buyNowPrice.hashCode());
result = prime * result
+ ((description == null) ? 0 : description.hashCode());
result = prime * result + ((endTime == null) ? 0 : endTime.hashCode()... | 8 |
@Override
public void render(GameContainer arg0, StateBasedGame arg1, Graphics graphics)
throws SlickException {
//Draw debug information
if (debug) {
//Draw mouse position
graphics.drawString("Mouse X: " + (mouseX < 0 ? "??" : mouseX) +
", Y: " + (mouseY < 0 ? "??" : mouseY), 10, 30);
}
} | 3 |
public void setTypeName(int titleID) {
switch (titleID) {
case 0: typeName = "The Ditzy ";
break;
case 1: typeName = "Cryptic";
break;
case 2: typeName = "The Seer of Fates";
break;
case 3: typeName = "Flirtatous";
break;
case 4: typeName = "King of the Mountain";
break;
case 5: typeNa... | 6 |
StringTokenizer(String value, char delim) {
string = value;
// Loop on the characters counting the separators and remembering
// their positions
StringCharacterIterator sci = new StringCharacterIterator(string);
char c = sci.first();
while (c != CharacterIterator.DONE) {
if (c == delim) {
// ... | 3 |
private void jbtnSend_ActionPerformed()
{
if
(
this.contacts != null && this.contacts.size() > 0
&& this.etaMsg.getText().length() > 0
)
{
EzimMsgSender jmsTmp = new EzimMsgSender(this);
EzimThreadPool.getInstance().execute(jmsTmp);
}
} | 3 |
public TargetPIDTilt(Target target, double timeout, boolean continuous){
super(target,Target.Axis.Y,timeout,continuous,
0.7, 0.15, 1, // P, I, D
0.7,1, // tolerance, maxOutput
1.5/10); // period - high to allow for network latency.
requires(Robot.til... | 0 |
public static synchronized void endProfiling(final String reportPath) throws IOException {
if (reportPath == null)
throw new NullPointerException("reportPath must not be null");
if (reportPath.length() == 0)
throw new IllegalArgumentException("reportPath must not be an empty string");
subLC... | 3 |
@POST
@Path("/Add")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response Add (UserResponse data)
{
if (data == null
|| data.password == null
|| data.username == null)
return Response
.status(400) // Bad... | 7 |
void createSubs()
{
int toDo = subs.size();
while (done<toDo)
{
for (int i=done;i<toDo;i++)
{
Expr expr = subs.elementAt(i);
procName = expr.name;
out.box(procName + " = " + Convert.toComment(expr.asString()));
out.line("private boolean " + ... | 6 |
public List<EloStatistik> getEloStatistik(String teamId, String datePattern, String dateStart) {
Team team = eloPersistence
.createQuery("select distinct t from Team t join fetch t.punktzahlHistorie h where t.id = :teamId", Team.class)
.setParameter("teamId", teamId).getSingleResult();
TreeMap<String, EloPu... | 7 |
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://downlo... | 9 |
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
StringBuilder out = new StringBuilder();
String line;
while ((line = in.readLine()) != null) {
int n = Integer.parseInt(line.trim());
if (n == 0)
break;
while (true)... | 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.