text stringlengths 14 410k | label int32 0 9 |
|---|---|
private void init() {
if(!isInited){
actions=new HashMap<String, MethodObject>();
List<Object> containers=new LinkedList<Object>();
containers.add(comp);
if(comp instanceof Component){
Component component=(Component)comp;
while((component=compon... | 7 |
public MapEdge getClosestRoad(double x, double y, boolean withName) {
x = outOfBoundsX(x);
y = outOfBoundsY(y);
MapEdge ed;
String ID = getID(x, y);
double distance;
ArrayList<MapEdge> a = getBranch(ID).getEdges();
if(a.isEmpty()) a = this.getParent(getBranch(ID))... | 6 |
public static void shuffle(Object[] array) {
int n = array.length;
while (n > 1) {
int k = gen.nextInt(n--); // decrements after using the value
Object temp = array[n];
array[n] = array[k];
array[k] = temp;
}
} | 1 |
public MortgageDialog(java.awt.Frame parent, boolean modal,int pl) {
super(parent, modal);
initComponents();
player=pl;
model = new DefaultListModel();
jList1.setModel(model);
fieldsR = new ArrayList<>();
for (Field field : Game.fields) {
String name="... | 9 |
public static void main(String[] args) throws Exception {
System.out.println("***************************************************");
System.out.println(" Using Hybrid MapReduce 3D Convex Hull Algorithm ");
System.out.println("***************************************************");
... | 5 |
public SuperFun() {
setTitle("Lottery生成器");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 450, 300);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
contentPane.setLayout(new BorderLayout(0, 0));
setContentPane(contentPane);
JPanel panel = new JPane... | 0 |
public void swapTileSets(int index0, int index1) {
if (index0 == index1) return;
TileSet set = tileSets.get(index0);
tileSets.set(index0, tileSets.get(index1));
tileSets.set(index1, set);
} | 1 |
@Override
public void onCreate(final SQLiteDatabase db) {
Ln.d("Creating Tables.");
List<Class<?>> tables = Dex.searchForClass(context, "Model");
for (Class<?> table : tables) {
db.execSQL(Model.getSQLCreateTable(table));
Ln.d("Table for class " + table.toString() + " created.");
}
Ln.d("Firing Databa... | 3 |
@EventHandler(priority = EventPriority.NORMAL)
public void setFormatChat(final PlayerLoginEvent e) {
if(e.getPlayer().hasPermission("bungeesuite.*")){
PermissionsManager.addAllPermissions(e.getPlayer());
}else if(e.getPlayer().hasPermission("bungeesuite.admin")){
PermissionsManager.addAdminPermissions(e.getP... | 3 |
public void buildGameMenu(final Stage stage) {
switch(gameMenuType) {
// Party menu
case STATS:
gameMenu.clear();
for(int x = 0; x<stage.party.getMembers().size(); x++) {
gameMenu.add(new PlainText(false, 0f, false));
if(x > 0) {
int y = 0;
for(int z = x; z>0; z--)
y += gameMenu.get(... | 7 |
public void deselectOthers(Button b)
{
for(int i=0; i<buttons.size(); i++)
{
if(buttons.get(i)!=b && !buttons.get(i).getOther())
{
buttons.get(i).deselect();
}
}
} | 3 |
public void initTestMap() {
for (int x = 0; x < chunkAmount; x++) {
for (int y = 0; y < chunkAmount; y++) {
chunks[x][y] = new Chunk();
chunks[x][y].create(x, y);
}
}
for (int x = 1; x < jps.grid.grid.length - 1; x++) {
for (i... | 9 |
public CellGrid(Map<Point, Component> mapComps) {
mapRows = new HashMap<>(25);
mapCols = new HashMap<>(25);
for (Map.Entry<Point, Component> entry : mapComps.entrySet()) {
int row = entry.getKey().y;
int col = entry.getKey().x;
List<Cell> rows = mapRows.get(ro... | 5 |
public String getLoginSgbd() {
return loginSgbd;
} | 0 |
Reader_FIFO (Semaphore sem, ArrayDeque<Byte> fifo) {
semaphore = sem;
FIFO = fifo;
new Thread(this).start();
} | 0 |
@Override
public void emitCode() {
Address address = null;
if (isDigit(firstParam.charAt(0))) {
System.out.println(lineNumber++ + ": LDC 0," + firstParam +ZERO_REGISTER);
} else {
address = manager.getAddressOfVar(firstParam);
System.out.println(lineNu... | 8 |
public void onMessage(String message) {
history.add(message);
try {
OutputStream out = reportFactory.openReport();
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(out));
for (String crnt : history) {
writer.wri... | 2 |
public static void showMessage(final String text, final String type) {
int msgWindowType = 0;
if (type.equals("Error")) {
msgWindowType |= SWT.ICON_ERROR;
addError(text);
}
if (type.equals("Information")) {
msgWindowType |= SWT.ICON_INFORMATION;
... | 2 |
public AlgorythmFile getAlgorythmFile(){
return algorythmFile;
} | 0 |
private static void db(final String s) {
if (StackHeightCounter.DEBUG) {
System.out.println(s);
}
} | 1 |
public static void drawPostRaceScreen() {
// Clear the last screen
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
// Preserve current GL settings
GL11.glPushAttrib(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_TEXTURE_BIT
| GL11.GL_LIGHTING_BIT | GL11.GL_DEPTH_BUFFER_BIT);
// Turn off lighting
... | 6 |
public String encode(String plain)
{
int period=key.length();
String plain_u=plain.toUpperCase();
if(plain_u.length()%2!=0)
{
plain_u+="X";
}
char[][] block=Incomp_column.build_block(plain_u, -1,period*2, 0);
StringBuilder sb=new StringBuilder();
for(int i=0;i<block.length;i++)
{
for(int j=0;j... | 4 |
public static boolean isMemberOf(String playerName, IReinforcement reinforcement)
{
if (reinforcement == null || !MachineFactoryPlugin.CITADEL_ENABLED) // All players have access to non-existing reinforcements
return true;
if (reinforcement instanceof PlayerReinforcement)
{
PlayerReinforcement playerRei... | 5 |
public String toString() {
StringBuilder b = new StringBuilder("\n---------------\n|");
for(int i = rows - 1; i >= 0; i--) {
for(int j = 0; j < columns; j++) {
switch (board[i][j]) {
case yellow: b.append("Y"); break;
case red: b.append("R"); break;
case empty: b.append(" "); break;
}
b.a... | 6 |
public static PcParts Questions3(PcParts thing){
for(int i=0; i < shopStock.size(); i++){
if ( thing.getManufacturer().equals(shopStock.get(i).getManufacturer()) && thing.getmodelName().equals(shopStock.get(i).getmodelName()) && thing.getmodelYear() == shopStock.get(i).getmodelYear()){
item = shopStock.get(i).... | 4 |
public static String encode(byte[] binaryValue) {
int binaryValueLen = binaryValue.length;
// Estimated output length (about 1.4x input, due to CRLF)
int maxChars = (binaryValueLen * 7) / 5;
// Buffer for encoded output
StringBuffer sb = new StringBuffer(maxChars);
int ... | 7 |
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
int numOfCases = sc.nextInt();
for(int i = 0; i < numOfCases;i++)
{
int numOfCoordinates = sc.nextInt();
//Just getting all the data into a usable form so we can analyze it later on
Coordinate[] coordinates = new Coordinate... | 7 |
public void paintComponent (Graphics g2)
{
// super.paintComponent(g2);
Graphics2D g = (Graphics2D) g2;
g.setRenderingHint ( RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
if (angle == 90) g.translate(height, 0);
else if (angle == 180) g.... | 6 |
public void downloadFile(String path, String fileName) throws UpYunExcetion {
try {
StringBuffer url = new StringBuffer();
for (String str : fileName.split("/")) {
if (str == null || str.length() == 0) {
continue;
}
url.... | 6 |
public void excluirContatoPorNome(String nomeContatoExcluir){
List<Contato> contatosBusca = FachadaSistema.getInstance().listarContatos();
for (Contato contato : contatosBusca) {
if(contato.getNome().equals(nomeContatoExcluir)){
contatoDAO.excluir(contato);
... | 2 |
public static Spawn getClosestAllowed(Player player) {
HashMap<String, Spawn> allowed = new HashMap<String, Spawn>();
for (Spawn point : FearTheReaper.getSpawnList().values()) {
if (player.hasPermission("graveyard.spawn.*") || player.hasPermission(("graveyard.spawn." + point.getGroup()).toLo... | 3 |
Class286_Sub3(OpenGlToolkit var_ha_Sub2, Class83 class83) {
super(var_ha_Sub2);
do {
try {
aClass83_6227 = class83;
if (!((OpenGlToolkit) ((Class286) this).aHa_Sub2_3684).aBoolean7841
|| (((OpenGlToolkit) ((Class286) this).aHa_Sub2_3684).anInt7795
< 2))
break;
aClass171_6220
= (Class50... | 9 |
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
if (jRadioButton3.isSelected())
result = OPTION_CONFIRM_CORRECT;
else
result = OPTION_CONFIRM_FALSE;
}//GEN-LAST:event_jButton1ActionPerformed | 1 |
@Override
public Object getValueAt(int rowIndex, int columnIndex) {
if (columnIndex == 0) {
return motherLangWordList.get(rowIndex);
}
if (columnIndex == 1) {
return foreignLangWordList.get(rowIndex);
}
if (columnIndex == 2) {
return sectio... | 5 |
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case WHAT:
return isSetWhat();
case WHY:
return isSetWhy();
}
throw new IllegalStateException();
} | 3 |
private int getAvailableBus(int[] busesList, Date day, service serv)
{
int bus_id = 0;
boolean temp = false;
boolean found = false;
for(int i=0; i<buses.length; i++)
{
temp = false;
found = false;
if(BusInfo.isAvailable(busesList[i], day))
{
for(int j=0; j<busesUsed... | 7 |
public void print(int depth)
{
int i;
// Print the indentation and the data from the current node:
for (i = 1; i <= depth; i++)
System.out.print(" hello ");
System.out.println(data);
// Print the left subtree (or a dash if there is a right child and no left child)
if (left != nul... | 7 |
public void rimuovi(T x) {
AlberoBin<T> curr = cercaNodo(x);
if (curr == null || !curr.val().equals(x)) return;
if (curr.sin() == null || curr.des() == null)
rimuoviNodo(curr);
else {
AlberoBin<T> curr2 = max(curr.sin());
curr.setVal(curr2.val());
rimuoviNodo(curr2);
}
} | 4 |
public static int parseSExpression (String aString) {
int length = aString.length();
int parenLevel = 0;
boolean isQuotedString = false;
boolean isLeadingWhitespace = true;
int charsParsed = 0;
char ch = ' ';
int index = 0;
// Bypass any leading whitespace... | 8 |
private String keyToString(JsonElement keyElement) {
if (keyElement.isJsonPrimitive()) {
JsonPrimitive primitive = keyElement.getAsJsonPrimitive();
if (primitive.isNumber()) {
return String.valueOf(primitive.getAsNumber());
} else if (primitive.isBoolean()) {
return Boo... | 5 |
private void initializeBottomLabels(JPanel bottom, PianoLabel[] bottomRowLabels)
{
for (int i = 0; i < KeyStats.NUM_KEYS; i++)
{
if ((i & 1) == 0) // whiteKey
{
bottomRowLabels[i] = new PianoLabel(new Dimension(i == 8 || i == 10 ? KeyStats.BOTTOM_FAT_WIDTH : KeyStats.BOTTOM_WHITE_WIDTH, KeyStats.BOTTOM_H... | 4 |
public boolean checkLocaleArrayForType(int x, String typeToFind){
boolean typeIsFound = false;
for(int y = 0; y < Main.localeInventory[x].length; y++){
if(typeIsFound){
break;
}
String[] tempTypeStor = fetchFromInventory("type", Main.localeInventory[x][y]);
try {
for(String tempTest : tempTypeSt... | 5 |
protected String getJsLineInitialization() {
String fileName = uri.replace("\\", "\\\\").replace("'", "\\'");
StringBuilder sb = new StringBuilder(format("if (! _$jscoverage['%s'].branchData) {\n", fileName));
sb.append(format(" _$jscoverage['%s'].branchData = {};\n", fileName));
for (I... | 2 |
public InputStream getInputStream() {
return inputStream;
} | 0 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
AttributeImpl other = (AttributeImpl) obj;
if (type == null) {
if (other.type != null)
return false;
} else if (!type.equals(other.type)... | 9 |
@Override
public int altaventa(TVenta venta,int idCliente) {
int idVenta = -1;
TransactionManager.obtenerInstanacia().nuevaTransaccion();
try
{
TransactionManager.obtenerInstanacia().getTransaccion().start();
TVenta tVenta = FactoriaDAO.obtenerInstan... | 6 |
private void downloadNatives(Logger logger){
logger.debug("Downloading natives");
try {
if (Vizun.getOs() == DataFolder.OPERATING_SYSTEM.Mac) {
DownloadManager.downloadFile(logger, "https://www.dropbox.com/s/0piww9yqly09enh/openal.dylib?dl=1", Vizun.getDataFolder().ge... | 5 |
public long mergeSortedFiles(List<File> files, File outputfile,
String tableTitle, final Comparator<TxtTable.Row> cmp,
String delimiter, char escape, boolean saveKey) throws IOException
{
PriorityQueue<TxtTable> pq = new PriorityQueue<TxtTable>(11,
new Comparator<TxtTable>() {
public int compare(TxtTa... | 7 |
public Clock(double x, double y){
// Instanciate the clock spritesheet and vars
try{
ss_clock_image = loader.loadImage("/sprite_sheet_clock.png");
clock_ss = new SpriteSheet(ss_clock_image);
}
catch(IOException e){}
this.x = x;
this.y = y;
... | 1 |
public Site findBestSite(Vector<Site> freeSites) {
// Your own code determining what the best Site is of all
// possible freeSites for the agent to move to;
Iterator<Site> i = freeSites.iterator();
Site bestSite = new Site();
double gain = Double.NEGATIVE_INFINITY;
double ne... | 3 |
@Override
public boolean tick(Tickable ticking, int tickID)
{
if(!super.tick(ticking,tickID))
return false;
if(tickID!=Tickable.TICKID_MOB)
return false;
if((affecting()!=null)&&(affecting() instanceof MOB))
{
final MOB M=(MOB)affecting();
final Room room=M.location();
if((room!=null)
&&(roo... | 8 |
@Override
public Object getValueAt(int rowIndex, int columnIndex) {
switch(columnIndex){
case 0 : return list.get(rowIndex).getKode();
case 1 : return list.get(rowIndex).getJudul();
case 2 : return list.get(rowIndex).getPengarang();
case 3 : return list.get(rowIndex).getPener... | 6 |
private void idleUpdate(Vector3f orientation, float distance)
{
double time = ((double)Time.getTime())/((double)Time.SECOND);
double timeDecimals = time - (double)((int)time);
if(timeDecimals < 0.5){
canLook = true;
material.setTexture(animations.get(0));
}el... | 4 |
public static int computeChange (int sum, int[] availableCoins)
{
int[] coinCount = new int [sum + 1];
int temp = 0;
for (int i = 1; i <= sum; i++)
coinCount[i] = INFINITY;
for (int i = availableCoins[0]; i <= sum; i++) {
for (int j = 0; j < availab... | 5 |
public synchronized void ProcessJob(String inFileName){
mLocalImgPath = mLocalBasePath + "/" + inFileName;
threadMessage("ServerCoordinator Process Job: " + mLocalImgPath);
mJobsStartTime = System.currentTimeMillis();
System.out.println("ServerCoordinator Process Job: " + mLocalImgPath);
//Determi... | 6 |
protected void selectImageFilter(){
FileNameExtensionFilter imageFilter;
imageFilter= new FileNameExtensionFilter("JPEG (*.jpg,*.jpeg,*.jpe,*.jfif)","jpg","jpeg","jpe","jfif");
this.stringSelectedExtension="jpg";
switch(this.selectedExtensionImage){
case bmp:
... | 4 |
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Plese enter how many days are in the month: ");
int days = sc.nextInt();
double sum = 0;
double[] temperatures = new double[days];
for (int i = 0; i < temperatures.length; i++) {
System.out.println("Enter t... | 9 |
public static ArmorType getArmorType(String name) {
if (armorTypes.containsKey(name)) {
return (ArmorType) armorTypes.get(name);
}
return null;
} | 1 |
private void selectSystem() {
squareSelector.reset();
squareSelector.setCriteria(new SquareCriteria() {
private final String desc = "Select: System";
public String getDescription() { return desc; }
public boolean isSquareValid( SquareSelector squareSelector, int roomId, int squareId ) {
if ( roomId <... | 6 |
public static void startupJavaTranslateFile() {
{ 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())));
... | 6 |
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
new Thread(new Runnable() {
public void run() {
System.exit(0);
}
}).start();
}
if (e.getKeyCode() == KeyEvent.VK_SPACE) {
this.tracing = true;
}
if (e.getKeyCode() == KeyEvent.VK_X) {
this.zoomIn = true... | 7 |
@Override
public Boolean[] segment(Utterance utterance, boolean training, boolean trace) {
// Return all segmentation points as true
Boolean[] boundaries = utterance.getBoundariesCopy();
// Randomly insert boundaries
for (int i=0; i<boundaries.length; i++) {
if (Math.random() < threshold) {
boundaries[... | 3 |
@Override
public void run() {
try {
reader = new BufferedReader(new InputStreamReader(socket.getInputStream()));
} catch (IOException ex) {
Logger.getLogger(ServerClient.class.getName()).log(Level.SEVERE, null, ex);
}
while (run) {
try {
String dir = reader.readLine();
if (dir.charAt(0) == '!'... | 5 |
@Override
public void handleStartTag(HTML.Tag tag, MutableAttributeSet attrs, int pos) {
logger.info("StartTag: " + tag);
HTMLComponent comp = null;
if (isWantedComplexTag(tag)) {
comp = HTMLComponentFactory.create(tag, attrs);
}
// If not a known start tag, but not utterly trivial, make generic tag.
if... | 7 |
public String getNotationPublicId(String nname)
{
Object notation[] = (Object[]) notationInfo.get(nname);
if (notation == null) {
return null;
} else {
return (String) notation[0];
}
} | 1 |
public static Node treeInsert(Node root,int key){
Node y =null;
Node z = new Node(key);
Node x = root;
while(x != null){
y = x;
if(x.key > z.key)
x = x.left;
else
x = x.right;
}
z.p = y;
if(y == null){
root = z;
}
else if(z.key <y.key){
y.left = z;
}
else
y.right = z... | 4 |
@RequestMapping(method = RequestMethod.GET)
public ModelAndView indexView() {
return new ModelAndView("uploadPage", "image", new Image());
} | 0 |
public boolean opEquals(Operator o) {
return (o instanceof ConvertOperator) && type == o.type;
} | 1 |
public LabelCorrectingTO labelCorrecting(List<Edge> links,List<Node> N, Node s, double[] costVector){
LabelCorrectingTO result = new LabelCorrectingTO();
double[] ds = new double[N.size()];
// double[] dj = new double[N.size() - 1];
//
ds = initializeDoubleArray(ds, 0.0);
// dj = initializeDoubleArray(dj, ... | 9 |
private List<String> imports() throws UnexpectedTokenException
{
List<String> imports = new ArrayList<String>();
if(this.accept(IMPORTS))
{
this.nextToken();
this.expect(LBRACE);
this.nextToken();
while(!this.accept(RBRACE))
{
StringBuilder _import = new StringBuilder();
while(!this.accep... | 4 |
public boolean readField(aos.apib.InStream in, aos.apib.Base o,int i) {
if ( i > __field_names.length )
return getBaseClassStreamer().readField( in, o, i - __field_names.length - 1 );
PeerInfo__Tuple v = (PeerInfo__Tuple)o;
switch (i) {
case 0:
v.id = in.getInt();
break;
case 1:
v.... | 6 |
private static int checkEuler(Graph graph) {
int count = 0;
for (int i = 0; i < graph.getVertexCount(); i++) {
if (graph.getDegree(i) % 2 == 1) {
count++;
}
}
if (count == 0) {
Log.print(Log.system, "The graph is euler");
return 0;
}
if (count == 2) {
Log.print(Log.system, "The graph is ... | 4 |
private SpriterBone[] interpolateBones(SpriterKeyFrame key1, SpriterKeyFrame key2, long currentAnimationTime){
SpriterBone[] tempBones = new SpriterBone[key1.getBones().length];
for (int b = 0; b < key1.getBones().length; b++) {
SpriterBone bone1 = key1.getBones()[b];
SpriterBone bone2 = key2.getBones()[b... | 7 |
public static AlgebraicParticle add(MixedNumber a, MixedNumber b, RoundingRule round) {
//if the mixednumbers are negative, make the numbers negative before adding
Number numA = a.numeral, numB = b.numeral;
Fraction fracA = a.fraction, fracB = b.fraction;
if(!a.sign()){numA = numA.cloneWithNewSign(false); fracA... | 5 |
@Override
public final void addHeaderLines(String... lines) {
if (lines != null && lines.length > 0) {
for (String line : lines) {
if (line == null) {
header.add(";# ");
}
else if (line.startsWith(";#")) {
he... | 5 |
private static void appendJSONPair(StringBuilder json, String key, String value) throws UnsupportedEncodingException {
boolean isValueNumeric = false;
try {
if (value.equals("0") || !value.endsWith("0")) {
Double.parseDouble(value);
isValueNumeric = true;
... | 5 |
private OrtsPunktBean getNextShortestPkt(List<StrasseDTO> nextList, OrtsPunktBean aktPktBean) {
OrtsPunktBean nextPkt = new OrtsPunktBean();
OrtsPunktBean nextShortestPkt = new OrtsPunktBean();
nextShortestPkt = new OrtsPunktBean();
nextShortestPkt.setStreckenInklGewichtung(DEFAULTDISTANZ);
for (StrasseDTO st... | 6 |
static List getScriptStack(RhinoException ex)
{
if (ex.interpreterStackInfo == null) {
return null;
}
List list = new ArrayList();
String lineSeparator = SecurityUtilities.getSystemProperty("line.separator");
CallFrame[] array = (CallFrame[])ex.interpret... | 7 |
public boolean esDoblePareja() {
boolean pareja = false;
for (int i = arrayNums.length - 1; i >= 0; i--) {
if ((arrayNums[i] >= 2) && (!pareja)) {
pareja = true;
this.cartasJugada[0] = Numeros.values()[i];
} else if ((arrayNums[i] >= 2) && (pareja)... | 5 |
public void setValueAt(Object value, int realRow, int realColumn)
{
if ((0 == realRow) || (1 == realRow))
{
displayError("Illegal row,column pair [" + realRow + "," + realColumn + "]", "Error");
return;
}
if (0 == realC... | 6 |
@Override
public void setPropertyFilterChain(String key, PropertyFilterChain filter_chain) {
this.filter_chains.put(key, filter_chain);
} | 0 |
public void updateValues(){
//Doesn't need to do anything in the case of a String
switch(this.type){
case INT:
this.intValue = Integer.parseInt(this.value);
break;
case DECIMAL:
this.doubleValue = Double.parseDouble(this.value);... | 3 |
public void setMainFrame(MainFrame frame)
{
mainFrame = frame;
if ( (user.lastLog == null)
|| (System.currentTimeMillis() - user.lastLog.getTime()) > 600_000)
{ // if lastlog is older then 10 min or first login
user.logins++;
}
mainFrame.setTitle("User: " + user.name
+ " - Logins: " + user.l... | 2 |
public void drawScores() {
int yi = 45;
// read from arraylist and draw on screen
for (int i = people.size() - 1; i >= 0; i--) {
Person temp = people.get(i);
// System.out.println("Name: " + people.get(i).getName());
int newY = 166 + (yi * i);
offScreenBuffer.setFont(new Font("Comic Sans MS", Font.P... | 1 |
public ClubSignupPage enterCoachReferral(Boolean value, String coachId) {
/*
if (value=false){
int cbSize = coachReferral.size();
for(int i=0; i < cbSize ; i++ ){
String sValue = coachReferral.get(i).getAttribute("value");
if (sValue.equalsIgnoreCase("6")){
coachReferral.get(i).click();
... | 7 |
public void processPressedKey(char pressed) {
if (waitForSpace && pressed == ' ') {
waitForSpace = false;
// Note: nextLetter() is not called here because the
// currentLetter is already set
}
else if (!waitForSpace) {
if (currentLetter.isCorrectKe... | 5 |
public int getNumMetadataBlocks() {
return numMetadataBlocks;
} | 0 |
public void minHeapify_top_down(int index) {
int small;
if (index * 2 + 1 >= heap.size())
return;
else if (2 * index + 2 == heap.size()) {
if (heap.get(2 * index + 1).f_val < heap.get(index).f_val) {
Values temp = heap.get(2 * index + 1);
heap.set(2 * index + 1, heap.get(index));
find_index.put... | 5 |
private void setPrincipleAmount(Loan loan) throws LoanEntryException {
// Loan pricinple amount
String principle_str = readPrincipleAmount();
double principle = 0d;
try {
principle =
(principle_str != null)?
Doub... | 3 |
public boolean isShipCollide(Point point,Ship s){
int sLength = s.getLength();
int rowStart, colStart, rowEnd, colEnd;
Cell startCell = (Cell) this.getComponentAt(point);
rowStart = startCell.getRow();
colStart = startCell.getColumn();
rowEnd = startCell.getRow();
colEnd = startCell.getColumn();
if(... | 9 |
void createExampleWidgets () {
/* Compute the widget style */
int style = getDefaultStyle();
if (shadowEtchedInButton.getSelection ()) style |= SWT.SHADOW_ETCHED_IN;
if (shadowEtchedOutButton.getSelection ()) style |= SWT.SHADOW_ETCHED_OUT;
if (shadowInButton.getSelection ()) style |= SWT.SHADOW_IN;
if (... | 6 |
public void testGetELCycTerm() {
System.out.println("\n**** testGetELCycTerm ****");
CycAccess cycAccess = null;
try {
try {
if (connectionMode == LOCAL_CYC_CONNECTION) {
cycAccess = new CycAccess(testHostName, testBasePort);
} else if (connectionMode == SOAP_CYC_CONNECTION)... | 5 |
public static double rotateTowardsSmooth(Spatial spatialOne,
Spatial spatialTwo, double sensitivity,
double maximumTurningDistance) {
double newRotationAngle = rotateTowards(spatialOne, spatialTwo, sensitivity);
double oldRotation = spatialOne.getRotation();
if (newRotationAngle != oldRotation) {
... | 3 |
public void showSalesProducto(String nombre){
if(ManejadorProductos.getInstancia().getListaVentas().size() > 0){
for(beansVentas registros : ManejadorProductos.getInstancia().getListaVentas()){
if(registros.getNombre().equals(nombre)){
System.out.println("");
System.out.println("---------------------... | 3 |
private boolean flags_ready() {
// Store the flags from the wire into the message structure.
msg_flags = 0;
int first = tmpbuf[0];
if ((first & V1Protocol.MORE_FLAG) > 0)
msg_flags |= Msg.more;
// The payload length is either one or eight bytes,
//... | 2 |
@SuppressWarnings("unchecked")
public Builder addList(String prefix, HandlersSubmapping list) {
for(HandlersMappingEntry<?> en : list.getMappingGet()) {
mappingGet.add(new HandlersMappingEntry(prefix, en));
}
for(HandlersMappingEntry<?> en : list.getMappingPos... | 8 |
private void bounceBall(int ball) {
int ball4 = ball * 4;
double rx = state[ball4];
double vx = state[ball4 + 1];
double ry = state[ball4 + 2];
double vy = state[ball4 + 3];
double vr;
switch (getApproxSector(ball)) {
case 1:
// first sector: bounce off circle
rx += l2;
... | 8 |
public static Channel getChannel( String name ) {
for ( Channel chan : channels ) {
if ( chan.getName().equals( name ) ) {
return chan;
}
}
return null;
} | 2 |
public City changeCityOwner(int cityID, Owner newOwner){
int tmpX = cityMap.get(cityID).getXLocation();
int tmpY = cityMap.get(cityID).getYLocation();
this.removeID(cityID);
City c = new City(cityID, tmpX, tmpY, newOwner);
this.addVertex(c);
return c;
} | 0 |
@Override
public void mouseClicked(MouseEvent e) {
// Catch for Solaris/Mac if they did the popup trigger.
if (e.isConsumed()) {
return;
}
textArea = (OutlinerCellRendererImpl) e.getComponent();
// Shorthand
Node currentNode = textArea.node;
JoeTree tree = currentNode.getTree();
// S... | 3 |
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.