text stringlengths 14 410k | label int32 0 9 |
|---|---|
private static TIntIntHashMap getWidthMap(Font font) {
TIntIntHashMap map = WIDTH_MAP.get(font);
if (map == null) {
map = new TIntIntHashMap();
WIDTH_MAP.put(font, map);
FontMetrics fm = Fonts.getFontMetrics(font);
for (int i = 32; i < 127; i++) {
map.put(i, fm.charWidth((char) i));
}
}
retur... | 2 |
public List<FormasPagamento> ListarTodos(){
try{
PreparedStatement comando = banco.getConexao()
.prepareStatement("SELECT * FROM tipos_pagamento WHERE ativo "
+ "= 1");
ResultSet rs = comando.executeQuery();
List<FormasPagamen... | 2 |
@Override
public int getAlignMedianFacValue(Faction.Align eq)
{
int bottom=Integer.MAX_VALUE;
int top=Integer.MIN_VALUE;
final Enumeration<FRange> e = getRanges(AlignID());
if(e==null)
return 0;
for(;e.hasMoreElements();)
{
final Faction.FRange R=e.nextElement();
if(R.alignEquiv()==eq)
{
i... | 8 |
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 double[] getLocalGrid(long density) {
int numberOfDots = (int) (density * getWidth());
double gridStep = 1 / (double) density;
double[] grid = new double[numberOfDots];
for (int i = 0; i < numberOfDots; i++) {
grid[i] = ((double) i + 0.5) * gridStep;
}
... | 1 |
public void readFromNBT(NBTTagList par1NBTTagList)
{
this.mainInventory = new ItemStack[36];
this.armorInventory = new ItemStack[4];
for (int var2 = 0; var2 < par1NBTTagList.tagCount(); ++var2)
{
NBTTagCompound var3 = (NBTTagCompound)par1NBTTagList.tagAt(var2);
... | 6 |
public boolean method195(int j) {
int k = maleEquip1;
int l = maleEquip2;
int i1 = anInt185;
if (j == 1) {
k = femaleEquip1;
l = femaleEquip2;
i1 = anInt162;
}
if (k == -1)
return true;
boolean flag = true;
if (!Model.method463(k))
flag = false;
if (l != -1 && !Model.method463(l))
fl... | 7 |
protected void parse(PDFObject obj) throws IOException {
// read the size array (required)
PDFObject sizeObj = obj.getDictRef("Size");
if (sizeObj == null) {
throw new PDFParseException("Size required for function type 0!");
}
PDFObject[] sizeAry = sizeObj.getArray();... | 8 |
private static void addFile(File source, JarOutputStream target) throws IOException
{
BufferedInputStream in = null;
try{
if (source.isDirectory())
{
String name = source.getPath().replace("\\", "/");
if (!name.isEmpty())
{
if (!name.endsWith("/"))
name += "/";
JarEntry entry = ne... | 7 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ColorBean colorBean = (ColorBean) o;
if (b != null ? !b.equals(colorBean.b) : colorBean.b != null) return false;
if (g != null ? !g.equals(colo... | 9 |
public boolean isSelected()
{
for(int i=0;i<markers;i++)
{
if(marker[i].isSelected())
{
return true;
}
}
return false;
} | 2 |
public void updateTropes() {
// Clear the trope lists
narrativeTropes.clear();
genreTropes.clear();
topicTropes.clear();
ArrayList<NarrativeType> _narrative =
new ArrayList<NarrativeType>(Arrays.asList(NarrativeType.values()));
ArrayList<GenreType> _genre =
new ArrayList<GenreType>(Arrays.asList(G... | 9 |
public void printAnalysisResults() {
String string = "";
for (int i = 0; i < bestSequenceAlternativesEnergyPoint.size(); i++)
string += i + ": " + bestSequenceAlternativesEnergyPoint.get(i) + "CONSUMPTION:" + consumptionEnergyPoints[i] + "EP\n";
for (int i = 0; i < bestSequenceAlternativesWatt.size(); i++)
... | 2 |
private void init ( ) {
updateLogDate = "";
tempSensors = new NumberWithLabel[MAX_TEMP_SENSORS];
int i;
for ( i = 0; i < MAX_TEMP_SENSORS; i++ ) {
tempSensors[i] = new NumberWithLabel( (byte) 1 );
}
pH = new NumberWithLabel( (byte) 2 );
pHExp = new NumberWithLabel( (byte) 2 );
atoLow = false;
atoHi... | 8 |
@EventHandler(priority = EventPriority.NORMAL)
public void onProjectileLaunch (ProjectileLaunchEvent event)
{
Projectile projectile = event.getEntity();
if (projectile.getType() != EntityType.THROWN_EXP_BOTTLE
|| ! (projectile.getShooter() instanceof Player))
return;
... | 7 |
public JSONObject append(String key, Object value) throws JSONException {
testValidity(value);
Object object = opt(key);
if (object == null) {
put(key, new JSONArray().put(value));
} else if (object instanceof JSONArray) {
put(key, ((JSONArray) object).put(value))... | 2 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof PointData)) return false;
PointData pointData = (PointData) o;
if (!category.equals(pointData.category)) return false;
if (!id.equals(pointData.id)) return false;
if (!Arrays.... | 6 |
@Override
public List<Account> findAccountByRoleId(int roleId) {
List<Account> list = new ArrayList<Account>();
Connection cn = null;
PreparedStatement ps = null;
ResultSet rs = null;
try {
cn = ConnectionHelper.getConnection();
ps = cn.prepareStatem... | 5 |
private static Image getImage(String filename) {
// to read from file
ImageIcon icon = new ImageIcon(filename);
// try to read from URL
if ((icon == null) || (icon.getImageLoadStatus() != MediaTracker.COMPLETE)) {
try {
URL url = new URL(filename);
... | 6 |
public void visitVarExpr(final VarExpr expr) {
if(!(expr.isDef() || (expr.def() != null)
|| (expr.parent() instanceof PhiStmt))) {
System.out.println(expr.getClass());
}
Assert.isTrue(expr.isDef() || (expr.def() != null)
|| (expr.parent() instanceof PhiStmt), "Null def for variable "
+ expr);
v... | 5 |
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {
stream.defaultReadObject();
b = (String)stream.readObject();
} | 0 |
public boolean addShow(Show show){
if (show instanceof Movie){
if (showExists(show)){
return false;
}else {
Movie tmp = new Movie((Movie) show);
shows.add(tmp);
}
}else{
if (showExists(show)){
... | 3 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final TOutlet other = (TOutlet) obj;
if (!Objects.equals(this.scyOutCode, other.scyOutCode)) {
retu... | 3 |
public void setSymbols(final Hashtable<K, String> symbols) {
this.symbols = symbols;
} | 0 |
public static void main(String[] args) {
final Count count = new Count();
for (int i = 0; i < 2; i++) {
new Thread() {
public void run() {
count.get();
}
}.start();
}
for (int i = 0; i < 2; i++) {
n... | 2 |
public ArrayList<MealData> mealsForCategory(MealCategoryData category) {
ArrayList<MealData> meals = new ArrayList<MealData>();
for (LineData canteenLine : canteenData.getLines()) {
for (MealData meal : canteenLine.getTodayMeals()) {
if (meal.getMealCategory().equals(category)) {
meals.add(meal);
}
}
}... | 3 |
public String execute() {
String returnVal = SUCCESS;
if (getSubmit() != null && SUBMIT.equals(getSubmit())) {
LibraryManagementFacade facade = new LibraryManagementFacade();
try {
Calendar calendar = Calendar.getInstance();
if ("issue".equals(getAction())) {
Date issueDate = calendar.getTime();... | 5 |
@SuppressWarnings("unchecked")
@Override
public final boolean equals(Object o)
{
if (o == this) return true;
if (o == null) return false;
/* Here we assume final classes, and comparisons only
* between leaf (final) classes
*/
if (o.getClass() != getClass()) ... | 3 |
public void movement() {
if (body == null)
return;
Vector3D oldPosition = getLocation();
body.updateBodyEuler(0.1);
if (body.getX() > getArenaWidth() - getWidth() ||
body.getY() > getArenaHeight() - getHeight() ||
body.getX() < 0 ||
body.getY() < 0 ||
getArena().isBlockedByTe... | 7 |
double isApproxEqual(MembershipFunction mf, InnerOperatorset op) {
if(mf instanceof FuzzySingleton)
{ return op.moreorless(isEqual( ((FuzzySingleton) mf).getValue())); }
if((mf instanceof OutputMembershipFunction) &&
((OutputMembershipFunction) mf).isDiscrete() ) {
double[][] val = ((OutputMembershi... | 9 |
public void propertyChange(PropertyChangeEvent evt) {
if (calendar != null) {
Calendar c = (Calendar) calendar.clone();
if (evt.getPropertyName().equals("day")) {
c.set(Calendar.DAY_OF_MONTH,
((Integer) evt.getNewValue()).intValue());
... | 5 |
public ArrayList<Integer> getRow(int rowIndex) {
ArrayList<Integer> res = new ArrayList<Integer>();
if(rowIndex < 0) return res;
res.add(1);
if(rowIndex == 0) return res;
res.add(1);
if(rowIndex == 1) return res;
for(int i = 1; i <= rowIndex-1; ++i){
... | 5 |
private static int partition(int[] array, int start, int end) {
int center = (start + end) / 2;
//mediaan van 3
if (array[center] < array[start]) {
swap(array, center, start);
}
if (array[end] < array[start]) {
swap(array, start, end);
}
if... | 8 |
public ReceptKompDTO getReceptKomp(int receptId, int raavareId) throws DALException {
ResultSet rs = Connector.doQuery("SELECT * FROM receptkomponent WHERE recept_id = " + receptId + " AND raavare_id = " + raavareId);
try {
if (!rs.first()) throw new DALException("Receptkomponenten " + receptId + ", " + raavareI... | 2 |
public Window(GraphCanvas canvas) {
this.canvas = canvas;
} | 0 |
protected Pair<Item,String> makeItemContainer(String data)
{
int x=data.indexOf(';');
if(x<0)
return null;
Item I=null;
if(data.substring(0,x).equals("COINS"))
I=CMClass.getItem("StdCoins");
else
I=CMClass.getItem(data.substring(0,x));
if(I!=null)
{
String container="";
String xml = data.... | 8 |
* @return String
*/
public static String getShortName(Stella_Object obj) {
{ Surrogate testValue000 = Stella_Object.safePrimaryType(obj);
if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_SKOLEM)) {
{ Skolem obj000 = ((Skolem)(obj));
return (null);
}
}
else if... | 6 |
public void showDialog()
{
org.i4qwee.chgk.trainer.new_brain.actionlisteners.MouseListener.setHandle(false);
super.showDialog();
org.i4qwee.chgk.trainer.new_brain.actionlisteners.MouseListener.setHandle(true);
} | 0 |
public static ComboBoxModel getAllParameters() {
if(parameterModel==null)
{
checkParameterList();
parameterModel = new DefaultComboBoxModel();
for(String v:parameters.keySet())
{
if(v.equals("Neighbore")|| v.equals("Datapoint"))
... | 4 |
private String getAbbreviatedName(String name) {
if (!isTooLarge(name)) {
return name;
}
String[] partNames = name.split(" ");
// Abbreviate middle names:
for (int i = 1; i < partNames.length - 1 && isTooLarge(Utils.join(" ", partNames)); i++... | 9 |
@Test
public void testNoAgregarTodasEntidades() {
Object[][] entidades = new Object[4][4];
entidades[0][0] = new Long(2000);
entidades[0][1] = "Tuercas";
entidades[0][2] = new Double(250);
try {
entidades[1][0] = new Long(100);
entidades[1][1] = "Lla... | 2 |
public static UndirectedGraphNode cloneGraph(UndirectedGraphNode node) {
List<UndirectedGraphNode> nodes = new ArrayList<UndirectedGraphNode>();
UndirectedGraphNode headnode = null;
int index = 0;
if (null == node) return null;
nodes.add(node);
while (index != nodes.size()) {
Undirec... | 8 |
private void searchRentacars() {
if (dateFieldReturnDate.getDate() < dateFieldPickUp.getDate()) {
Dialog.alert("Return date should be greater or equals to Pick up date");
return;
}
if (rentalcarSearchParameters.getFromAirportId() == null || rentalcarSearchParameters.getToAirportId() == null) {
Dialog.ale... | 5 |
public static void main(String[] args) {
// ConcreteClassの実装次第で独自ロジックを切り替える。共通処理は親クラスで実装。
AbstractClass c1 = new ConcreteClass();
c1.templateMethod();
System.out.println("--------------------");
// 無名クラスを使ってみたり。
AbstractClass c2 = new AbstractClass() {
@Override
void method() {
System.out.pr... | 0 |
public void renderShipMorphBehaviors(int glMode, RenderStyle renderStyle, Ship ship, boolean preMorphRendering) {
for (Morph morph : ship.getMorphsByIds().values()) {
if (glMode == GL11.GL_RENDER) {
for (Behavior<?> behavior : morph.getAlwaysActiveBehaviorList()) {
renderBehavior(glMode, renderStyle, beha... | 8 |
protected int getKnownAttributeCount() {
int count = 0;
if (lvt != null)
count++;
if (lnt != null)
count++;
return count;
} | 2 |
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
// Entering a sub-command without parameters is assumed to be a request
// for information. So display some detailed help.
if (args.length == 0) {
sender.sendMessage(plugin.t... | 9 |
@Override
public void run() {
if (!mNoFurtherWrites) {
try {
// Wait for any pending writes to finish, but not forever
long maxWait = System.currentTimeMillis() + TimeUnit.MILLISECONDS.convert(1, TimeUnit.MINUTES);
while (mServer.hasPendingWrite(mChannel) && System.currentTimeMillis() < maxWait) {
... | 5 |
private V active(){
//we know at the start, we clearly aren't done
//and we also know the params are also set
rec.get().req.done = false;
while(true){
boolean locked = true;
if(!lock.lock()){ //NOT the combiner
while(!rec.get().req.done &&
rec.get().active &&
(locked = lock.isLocked()));
... | 7 |
@Test
public void SpeakerToTopicWriterTest() {
String theSpeaker = "Cameron Thomas";
String topic = "CS 246";
String base = "CS 246";
String content = "This is the content";
//HashMap<String, List<Session>> topicMap = new HashMap<>();
ArrayList<Spea... | 4 |
public static void main(String[] args) {
String filename = args[0];
String separator = args[1];
In in = new In(filename);
ST<String, Queue<String>> st = new ST<String, Queue<String>>();
ST<String, Queue<String>> ts = new ST<String, Queue<String>>();
while (in.hasNextLin... | 9 |
public static Configuration loadConfiguration( InputStream input ) throws Exception
{
Configuration config = new Configuration();
config.delays = Tries.forInsensitiveStrings( 0 );
config.inclusion = Tries.forInsensitiveStrings( Boolean.FALSE );
config.mode = AgentMode.CSV;
Element root... | 4 |
@Override
public void start(Character player) {
System.out.println("Starting Treasure Event...");
int randomizedEvent = generator.nextInt(100) + 1;
if(randomizedEvent > 75){
//Drop gold
randomGold = generator.nextInt(10) + 1;
System.out.println("You opened the chest and found " + this.getGold() + " G... | 4 |
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
double amount;
boolean isLent = false;
String description;
String dateString;
Date date = null;
SimpleDateFormat dateFormate = new SimpleDateFormat("yyyy-MM-dd");
if(e.getSource() instanceof JButton){
if(... | 9 |
public void setLeafIcons(String menuName, ImageIcon normal, ImageIcon selected) {
for (AccordionRootItem menu : getMenus()) {
if (menu.getName().equals(menuName)) {
if (normal != null) {
for (AccordionLeafItem leaf : getLeafsOf(menuName)) {
... | 6 |
public static void initScore() {
int[][] moviercount = new int[DataInfo.numItems][DataInfo.softmax];
Function.zero(moviercount, DataInfo.numItems, DataInfo.softmax);
for(int user = 0; user < DataInfo.numUsers; user++) {
int num = DataInfo.TrainSet[user].length;
for(int j = 0; j < num; j++) {
i... | 8 |
public long getTimestamp()
{
System.out.println("getTimestamp():");
if (timestamp==null) return 0;
long ts=0;
if ( timestamp == null ) timestamp = "";
else
{
// timestamp=timestamp.trim();
if ( timestamp.length()>0 )
{
try
{
ts = new Lo... | 9 |
void launchThreads(final int numIter) {
for(int i=0;i<NUM_THREADS;i++) {
threads[i] = new Thread() {
@Override
public void run() {
try {
final Directory[] dirs = new Directory[NUM_COPY];
for(int k=0;k<NUM_COPY;k++)
d... | 7 |
public void UpdateLayout()
{
for(GuiField button :displayedFields)
{
button.UpdateLayout();
}
} | 1 |
public void fuseTimeAndStylo(List info) {
List tempInfo = new ArrayList();
tempInfo.addAll(info);
// System.out.println("List: ");
// for (Object a : info) {
// System.out.println(a);
// }
List sortedStyloList = new ArrayList();
List sortedTimeList = new A... | 7 |
public Parser build(Grammar grammar, boolean useHeadSet) {
NontermTable nontermTable = new NontermTable();
// Construct automation.
State.StateGenerator stateGenerator = new State.StateGenerator();
State startState = stateGenerator.generate();
for (Grammar.Production production:... | 8 |
public boolean addElement(T element) throws InterruptedException {
lock.lock();
try {
while (isFull()) {
emptyCondition.await();
}
boolean result = tasksQueue.add(element);
fullCondition.signalAll();
return result;
} fi... | 1 |
public void close(){
try {
ps.close();
} catch (SQLException e){
if( debug ) System.out.println("Error in DBComm.close(): "+e.getMessage());
}
} | 2 |
public Integer pop() throws EmptyException {
counter -= 1;
if (counter < 0) {
counter = 0;
throw new EmptyException();
}
return table[counter];
} | 1 |
public static TheoraPacket create(OggPacket packet) {
byte type = packet.getData()[0];
// Special header types detection
if(isTheoraSpecial(packet)) {
switch(type) {
case (byte)TYPE_IDENTIFICATION:
return new TheoraInfo(packet);
case (byte)TYP... | 4 |
private boolean r_mark_suffix_with_optional_s_consonant() {
int v_1;
int v_2;
int v_3;
int v_4;
int v_5;
int v_6;
int v_7;
// (, line 143
// or, line 145
lab0: do {
... | 9 |
private List<Trade> auctionOrderList() {
List<Trade> tra = new ArrayList<Trade>();
while ( buyOrderQueue.size() != 0 && sellOrderQueue.size() != 0 && buyOrderQueue.get(0).getPrice() >= sellOrderQueue.get(0).getPrice() )
{
Order buyOrder = buyOrderQueue.get(0);
Order sellOrder = sellOrderQueue.get(0);
Tr... | 6 |
private Expr factor() throws IOException {
Expr e;
switch (token) {
case '(':
token = tokenizer.nextToken();
e = expr();
if (token != ')')
throw new XLException("expecting \")\", found: " + token);
token = tokenizer.nextToken();
... | 6 |
public static DenseMatrix64F handleV(DenseMatrix64F V, boolean transpose, boolean compact,
int m , int n , int min ) {
int w = n > m ? min + 1 : min;
if( compact ) {
if( transpose ) {
if( V == null ) {
V = new DenseMatri... | 6 |
public void tick()
{
if(dmgLen > 0)
{
dmgTick++;
if(dmgTick > 120) //120 = 2 seconds
{
dmgLen = dmgTick = 0;
}
}
if(moving)
{
walkTick++;
if(count >= walkList.size())
... | 6 |
RGBImage magnify(int n) {
RGBImage m = new RGBImage(n * width, n * height);
for (int row = 0; row < height; row++) {
for (int col = 0; col < width; col++) {
int c = image.getRGB(col, row);
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
m.image.setRGB(n * col + j, n * row + i, c);... | 4 |
public void print(Byte[] jeu){
for (int i=0; i < 37; i++){
if (i==4 || i==9 || i==15 || i==22 || i==28 || i==33)
System.out.println();
System.out.print(jeu[i]);
}
System.out.println();
} | 7 |
public String XAuth(String username, String password)
{
URL url;
try {
url = new URL("http://fanfou.com/oauth/access_token");
} catch (MalformedURLException e)
{
setLog(e.getMessage());
return null;
}
long timestamp = System.currentTimeMillis() / 1000;
long nonce = System.nanoTime();
String p... | 8 |
private String CheckIfUpdate(String modFolder, String mod) {
boolean foundit=false;
File oldMod = new File(modFolder+"/"+mod);
if(oldMod.isDirectory()){
con.log("Log","IS DIRECTORY");
foundit=true;
}
else con.log("Log","NOT DIRECTORY ... " + oldMod);
if(foundit){
if(McLauncher.tglbtnDelete... | 4 |
public static boolean isAPageTag(String str, boolean state) {
if (state == true) {
StringUtility.pattern = OPEN_PAGE_TAG;
} else {
StringUtility.pattern = CLOSE_PAGE_TAG;
}
StringUtility.matcher = pattern.matcher(str);
return StringUtility.matcher.matches... | 1 |
private void miLoadCourseMousePressed(java.awt.event.MouseEvent evt) {
Object[] courseNames = Manager.getInstance().getCourseNames().toArray();
String selectedCourse = (String) JOptionPane.showInputDialog(this,
"Select a course.",
"Course Select",
JOptionPane.QUESTION_M... | 1 |
public void histogrammeBruit() {
Iterator<Float> itr = valeursBruit.iterator();
float vb;
Integer val;
while (itr.hasNext()) {
vb = itr.next();
// regard de l'occurence d'un élément
vb = (float) (Math.round((vb * 100.0)) / 100.0);
val = mapHisto.get(vb);
if (val != null) {
mapHisto.put(vb, va... | 3 |
public Ingredient getIngredient() {
if (ingredient == null) {
ingredient = new Ingredient();
}
return ingredient;
} | 1 |
public void waitForConnection() {
if (!server.isConnecting() && !server.isConnected()) {
if (server.isConnectedToNetwork()) {
new Thread(new Runnable() {
@Override
public void run() {
updateStatus(WAITING);
while (!server.waitForConnection()) {
if (server.isAbortRequestSent())
... | 5 |
@Override
public boolean execute(MOB mob, List<String> commands, int metaFlags)
throws java.io.IOException
{
final PlayerStats pstats=mob.playerStats();
if(pstats==null)
return false;
final StringBuffer buf=new StringBuffer(L("Available channels: \n\r"));
int col=0;
final String[] names=CMLib.channels(... | 7 |
public static void writeArxFile(HashMap<String, String> map, File dest) {
try {
if (!dest.exists()) {
dest.mkdirs();
dest.createNewFile();
}
String output = "";
Set<String> keySet = map.keySet();
String[] keys = keySet... | 3 |
private Raum[] getNachbarn(String[] richtungen, Raum raum)
{
Raum nordNachbar = null;
Raum ostNachbar = null;
Raum suedNachbar = null;
Raum westNachbar = null;
for(String s : richtungen)
{
if(s.equals(TextVerwalter.RICHTUNG_NORDEN))
{
nordNachbar = raum.getAusgang(s);
}
else if(s.equals(Te... | 5 |
private void load() throws FileNotFoundException {
Scanner in = new Scanner(new File(FILE_NAME));
while (in.hasNextLine()) {
String line = in.nextLine();
if (!line.startsWith("#")) {
String[] bisect = line.split("=");
// If the field was defined;
if (bisect.length > 1) {
if (line.startsWith(... | 9 |
private void acao123() throws SemanticError {
if (tipoLimiteInferior != tipoConstante)
throw new SemanticError(
"Constantes de intervalo de tipos diferentes");
int valorLimiteSuperior = tipoConstante == Tipo.INTEIRO ? Integer
.parseInt(valorConstante) : valorConstante.charAt(0);
if (valorLimiteSuper... | 3 |
@Override
public void run(){
try{
if(!window.IsFull()){
socket.setName(recvStringMsg());
window.socket.getLast().setName(socket.getName());
window.sendStringMsg(socket.getName()+" entrou na sala...", window);
while(socket.getSocket(... | 5 |
public void borrarRegistros(String nombreTabla, int id)
{
try {
this.bd.open();
this.table = this.bd.getTable(nombreTabla);
this.bd.beginTransaction(SqlJetTransactionMode.WRITE);
// Esta función busca por calve primaria aquel id que concuerde con el pasado po... | 2 |
public void runGameTimedSpeedOptimised(Controller<MOVE> pacManController,Controller<EnumMap<GHOST,MOVE>> ghostController,boolean fixedTime,boolean visual)
{
Game game=new Game(0);
GameView gv=null;
if(visual)
gv=new GameView(game).showGame();
if(pacManController instanceof HumanController)... | 9 |
public synchronized int hashCode() {
if (__hashCodeCalc) {
return 0;
}
__hashCodeCalc = true;
int _hashCode = 1;
if (getName() != null) {
_hashCode += getName().hashCode();
}
if (getCurrency() != null) {
_hashCode += getCurrency... | 4 |
public DateFormat getTimeFormat() {
return timeFormat;
} | 0 |
public static boolean checkForClick(int button){
while(Mouse.next()){
if(Mouse.getEventButtonState()){
if(Mouse.getEventButton() == button) return true;
}
}
return false;
} | 3 |
public static List readWatchableObjects(DataInputStream par0DataInputStream) throws IOException
{
ArrayList arraylist = null;
for (byte byte0 = par0DataInputStream.readByte(); byte0 != 127; byte0 = par0DataInputStream.readByte())
{
if (arraylist == null)
{
... | 9 |
public void falling() {
if(!isBlocked(x, y + velY + 1f)){
timer += delta;
if(velY < 16){
if(timer > 100){
velY = velY += 1f;
timer = 0;
}
}
mapY += velY;
isOnGround = false;
}else if(velY < 16){
velY = 0;
isOnGround = true;
}else{
velY = 0;
isOnGround = true;
i... | 4 |
@Override
public boolean addGroup(String group) {
if (groups.contains(group)) {
return false;
}
return groups.add(group);
} | 1 |
public static int sqrt(int x) {
if (0 == x) return 0;
long bit = 1l << 16;
long res = 0;
while (bit != 0) {
res = res | bit;
if (res * res > x) res = res ^ bit;
bit = bit >> 1;
}
return (int) res;
} | 3 |
public void Run() {
// Рестарт при повторном вызове. Зарпет на две копии одного скрипта при
// одновременном выполнии
if (isScriptRunning()) {
Stop();
}
Update();
scrThread = new JSThread(this) {
@Override
public void OnStart() {
super.OnStart();
AddStopMenuElement();
}
@Override
... | 1 |
public void mouseDown(org.eclipse.swt.events.MouseEvent e) {
// TODO Auto-generated method stub
if (e.getSource() == buttonOk) {
String host = comboHost.getText();
String user = comboUser.getText();
String password = textPassword.getText();
// String protocol = comboProtocol.getText();
... | 9 |
@BeforeClass
public static void setUp() {
bmTestManager = BmTestManager.getInstance();
plan = new Plan("HV40KOD", 40000, 40, true, 1000, 0);
users = new Users("1689", "dzmitrykashlach", "dzmitry.kashlach@blazemeter.com",
"1394008114", "1392730300", "1324748306", true, plan, n... | 1 |
@Override
protected void controlUpdate(float tpf) {
if(GameStarted.gameStart){
if(!init){
if(comboNumber == 1){
// currentComboNo = animationToInt(((Node)spatial.getParent().getChild("Model")).getChild("Player1").getControl(ComboSetupControl.class).getCombo1_1(... | 8 |
static int checkAck(InputStream in) throws IOException
{
int b = in.read();
// b may be 0 for success,
// 1 for error,
// 2 for fatal error,
// -1
if (b == 0)
return b;
if (b == -1)
return b;
if (b == 1 || b == 2)
{
... | 7 |
public void init() {
if (CollectionUtils.isEmpty(messageConverters)) {
StringHttpMessageConverter stringHttpMessageConverter = new StringHttpMessageConverter();
stringHttpMessageConverter.setWriteAcceptCharset(false); // See SPR-7316
this.messageConverters = new ArrayList<Htt... | 2 |
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.