text stringlengths 14 410k | label int32 0 9 |
|---|---|
public Segmentator(MatlabProxy proxy, MatlabTypeConverter processor){
this.proxy = proxy;
this.processor = processor;
} | 0 |
public void setJumping(boolean b) {
if(knockback) return;
if(b && !jumping && falling && !prevDoubleJump) {
doubleJump = true;
}
jumping = b;
} | 5 |
public static Boolean checkDate(int roomID, String dateOut, String dateIn) {
try {
if(conn == null || conn.isClosed()){
conn = DatabaseConnection.getConnection();
}
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
Statement stmnt = nu... | 5 |
public static void init() {
// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
try {
driveTrainRightFront = new CANJaguar(5);
} catch (CANTimeoutException ex) {
ex.printStackTrace();
}
try {
driveTrainRightBack = new ... | 4 |
private ArrayList<Dot> findAvailableDots(Dot dot, Capture capture) {
ArrayList<Dot> result = new ArrayList<Dot>();
// converts "i" into dots coordinates, starting from from the top dot,
// counterclockwise
int x = dot.getX() + 1;
int y = dot.getY() - 1;
for(int i = 0; i <... | 9 |
@Override
public List<AssemblyLine> generate(Context context)
{
final List<AssemblyLine> lines = Lists.newLinkedList();
if (Compiler.debug)
{
lines.add(new Comment("Start return"));
}
Function function = context.getFunction(context.getName());
... | 6 |
private static void consumer() throws InterruptedException {
Random random = new Random();
while (true) {
Thread.sleep(100);
if (random.nextInt(10) == 0) {
Integer value = queue.take();//if queue is empty waits
System.out.println("Taken value: " + ... | 2 |
public Ast.AstPrefixGenericName parse_PrefixGenericName()
{
int at = m_current;
if (!ok())
{
return null;
}
// PrefixGenericName : PrefixGenericSymbol Decoration
if (peek(TozeTokenizer.TOKEN_PSETONE)
|| peek(TozeTokenizer.TOKEN_FS... | 9 |
public static ArrayList<?> removeDuplicates(ArrayList<?> list) {
ArrayList<Object> temp = new ArrayList<Object>();
for(Object i : list) {
if(!temp.contains(i)) {
temp.add(i);
}
}
return temp;
} | 4 |
private void recalcularDistancia() {
double dist=0;
if(secuencia.size()!=0)
{
if(carro!=null){
Nodo primer= darPrimerNodo();
if(primer!=null)
{
if(primer.getPosX()==carro.getPosX() || carro.getPosY()==primer.getPosY())
{
dist++;
}else{
dist+=Math.sqrt(2);
}
}
... | 9 |
public static boolean email(String email){
if(email.matches("(\\w)+(\\.(\\w)+)*@(\\w)+(\\.(\\w)+)*\\.[a-z]{3}")&&email.length()<100)
return true;
return false;
} | 2 |
@Override
public boolean okMessage(final Environmental myHost, final CMMsg msg)
{
if(!super.okMessage(myHost,msg))
{
return false;
}
final MOB source=msg.source();
if((!msg.source().Name().equals(text()))&&((msg.source().getClanRole(text())==null))
&&(msg.tool() instanceof Ability)&&(msg.target()==aff... | 7 |
private short try_connect_mysql()
{
MsgDumperCmnDef.WriteDebugSyslog(__FILE__(), __LINE__(), "Try to connect to the MySQL database server...");
try
{
// Java要連接資料庫時,需使用到JDBC-Driver,連接MySQL資料庫使用Connector/j,下載後解開壓縮,mysql-connector-java-5.1.15-bin.jar就是MySQL的JDBC-Driver了.
// Go to http://blog.yslifes.com/archives/... | 5 |
protected void rebuildBeanConnections(Vector deserialized, Object key) throws Exception {
int i;
int n;
int sourcePos;
int targetPos;
String event;
boolean hidden;
Vector ... | 9 |
protected static void comm(final String s) {
if (PersistentBloatContext.DB_COMMIT || BloatContext.DEBUG) {
System.out.println(s);
}
} | 2 |
@Override
public void run() {
System.out.println("Starting statistics run");
long time = System.currentTimeMillis();
List<Individual> indv = new ArrayList<Individual>();
for(int k = 0; k < INDIVIDUALS; k++){
System.out.println("Evolving tracker "+(k+1));
List<Individual> ... | 8 |
public static void upData(String sql){
String currentPath = System.getProperty("user.dir");
ComJdbc.connection(currentPath + File.separator
+ "configdb.properties");
int rc = ComJdbc.execUpdate(sql);
if(rc != -1)
{
SuccessFrame sf = new SuccessFrame();
sf.setTitle("Successful !");
sf.... | 1 |
public JComboBox getCbSecteur() {
return jComboBoxSecteur;
} | 0 |
private Map<String, Field> getAllInstanceFields(Object object) {
Map<String, Field> fields = new HashMap<String, Field>();
Class<? extends Object> c = object.getClass();
while (c != null) {
for (Field f : c.getDeclaredFields()) {
try {
if (!Modifier.isStatic(f.getModifiers())
&& !fields.contai... | 6 |
public void rearangeAround(T value) {
Node<T> lessTail = null;
Node<T> lessRoot = null;
Node<T> moreTail = null;
Node<T> moreRoot = null;
Node<T> node = root;
Node<T> prev = null;
while (node != null) {
Node<T> nextNode = node.next;
if (node.value.compareTo(value) != 0) {
if (prev == null) {// r... | 7 |
@After
public void tearDown() {
} | 0 |
public void moveToPoint(Point a, Point b)
{
reachedGoal = false;
self = a;// new Point(x, y);
double distance = a.distance(b);
double steps = Math.round(distance / (speedMod * speed));
double deltaY = Math.round((b.getY() - a.getY()) / steps);
double deltaX = Math.round((b.getX() - a.getX()) / steps);
in... | 9 |
public LibraryBean getLibrary(int id){
LibraryBean bean = null;
try {
PreparedStatement statement = connection.prepareStatement(GET_LIBRARY_BY_ID);
statement.setString(1, new Integer(id).toString());
ResultSet resultSet = statement.executeQuery();
if(resultSet.next()) bean = readLibrary(result... | 3 |
public void quickLoot() {
for (int i = 0; i < inventorySize; i++) {
int qty = inventory.getQtyFromSlot(i);
if (qty > 0) {
int oldQty = qty;
String name = inventory.getNameFromSlot(i);
int level = inventory.getLevelFromSlot(i);
... | 3 |
public static boolean playAgain() {
Vector<Player> tempList = new Vector<Player>();
boolean playAgain;
String temp = "";
for (Player p : playerList) {
System.out.printf("%s, you have $%.2f.\n", p.getName(), p.getWallet());
System.out.print("Would you like to play again (yes or no)? ");
do {
... | 6 |
public void uniq_words()
{
try {
for(int i=0;i<list.size();i++)
writer.write(list.get(i)+"\r\n");
} catch (IOException e) {
e.printStackTrace();
}
try {
writer.close();
} catch (IOException e) {
e.printStackTrace();
}
} | 3 |
public void setName(String name) {
this.name = name;
} | 0 |
public void createNewFile(File f) {
if(!f.getName().endsWith(".wip")) {
JOptionPane.showMessageDialog(frame, "File must end with \".wip\"");
return;
}
if(f.exists()) {
int overwrite = JOptionPane.showConfirmDialog(frame, f.getName() + " already exists. Do you want to overwrite it?", "Overwrite?", JOptio... | 8 |
private void startSever(){
ServerSocket welcomeSocket;
Socket connectionSocket;
int counter = 0;
try {
welcomeSocket = new ServerSocket(PORT);
console.log("Listening Port " + PORT);
while (true) {
connectionSocket ... | 3 |
public void insert(K key, V value) {
//Make a new node so we don't need to later
RBTreeNode<K, V> insertedNode = new RBTreeNode<K, V>(key, value, Color.RED, null, null);
//If root is null, set the new node to root (inserting it as the only pair in the tree)
if (root == null) {
... | 6 |
public Perceptron(){
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// ファイルから点を読み込み、配列に格納する。
List<String[]> pointData = FileUtil.getStringsByQuot(inFileAddress);
Hyouhonpoint[] hyouhonpoints = new Hyouhonpoint[pointData.size()];
for(int i = 0; i < pointData.size(); i++){
h... | 9 |
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 fe... | 6 |
public SevenTally(int diceCount) {
diceScoreTracker = new int[diceCount];
} | 0 |
public Output(HtmlMidNode parent, HtmlAttributeToken[] attrs){
super(parent, attrs);
for(HtmlAttributeToken attr:attrs){
String v = attr.getAttrValue();
switch(attr.getAttrName()){
case "for":
forr = For.parse(this, v);
break;
case "form":
form = Form.parse(this, v);
break;
ca... | 4 |
public JPanel getNametextInTileChangesMenu() {
if (!isInitialized()) {
IllegalStateException e = new IllegalStateException("Call init first!");
throw e;
}
return this.nametextTilePanel;
} | 1 |
@SuppressWarnings("rawtypes")
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
MapEntry other = (MapEntry) obj;
if (key == null) {
if (other.key != null)
return false;
} else if (!key.... | 9 |
@Override
public void setStateBasedOffString(String status) {
switch(status) {
case "FirstRound":
state = new FirstRound();
break;
case "SecondRound":
state = new SecondRound();
break;
case "Playing":
state = new Playing();
break;
case "Discarding":
state = new Discarding();
break;... | 6 |
private boolean _jspx_meth_html_form_0(javax.servlet.jsp.tagext.JspTag _jspx_th_html_html_0, PageContext _jspx_page_context)
throws Throwable {
PageContext pageContext = _jspx_page_context;
JspWriter out = _jspx_page_context.getOut();
// html:form
org.apache.struts.taglib.html.FormTag _jspx_t... | 9 |
@Override
public Event next() {
try {
input = br.readLine();
} catch (IOException e1) {
}
if(input == null || input.equals(""))
{
return new UserHomeState(as, name);
}
else{
try{
as.bid(name, Integer.parseInt(input));
}
catch(Exception e){
// System.out.println("somet... | 4 |
private void drawFirstSelectedCase(Graphics g) {
if (selectedI != -1 && selectedJ != -1) {
g.setColor(Color.ORANGE);
g.fillRect(selectedI * caseWidth + 1, selectedJ * caseHeight + 1,
caseWidth - 1, caseHeight - 1);
}
} | 2 |
public void run() {
String msg = this.read();
if(msg.matches("^NEW\\s([a-zA-Z0-9]+)$")){
/* Create User */
String name = msg.substring(4);
String host = socket.getInetAddress().toString().substring(1);
this.user = new User(name, host);
... | 4 |
public static void main(String[] args) {
String[] liste_nouveaux_sujets = null;
if ( args.length > 0 ) {
liste_nouveaux_sujets = args;
}
if ( liste_nouveaux_sujets == null ) {
System.out.println("Usage : "+ "FounisseurDeSujet" + " <new_channel_name> [<new_channel_name>... | 6 |
void shiftOff(){
try{
Robot r = new Robot();
r.keyRelease(KeyEvent.VK_SHIFT);
}catch(Exception e){
System.out.println(e);
}
jButton6.setBackground(Color.white);
jButton6.setForeground(Color.black);
isShift = false;
} | 1 |
public Activite2012_2014(JSONObject json) throws Exception {
erreurs = new ArrayList<>();
description = json.getString("description");
categorie = json.getString("categorie");
heures = json.getInt("heures");
dateString = json.getString("date");
try {
date ... | 1 |
public static String diff(double[] o, double[] p) {
String status = "ok.";
if (o.length != p.length) {
status = "o.length != p.length";
} else {
for (int i = 0; i < o.length; i++) {
if (o[i] != p[i]) {
status += "error";
... | 3 |
@Override
protected final XYDataset createDataset() {
DefaultXYDataset dataset = new DefaultXYDataset();
//Map the name of the player to his energy
HashMap<String, double[]> map = new HashMap<>();
Turn t = _gameHistory.getCurrentTurn();
int turnCount = _gameHistory.count();
... | 6 |
private void refreshList() {
for (IDrawable d: tmpAddList) {
drawList.add(d);
}
for (IDrawable d: tmpRemoveList) {
drawList.remove(d);
}
tmpAddList = new ArrayList<IDrawable>();
tmpRemoveList = new ArrayList<IDrawable>();
Collections.sort(drawList, new DrawComparator());
} | 2 |
public TileLayer(BufferedReader reader, String tileSet, Point2D offset) {
String line;
int y = 0;
try {
while((line = reader.readLine()) != null && !line.contains("/layer")) {
if(!line.contains("data")) {
String[] temp = line.split(",");
for(int x = 0; x<temp.length; x++) {
if(Integer.parse... | 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://down... | 6 |
public int countNumberOfMerges(int n){
int count = 0;
for (int i = 0; i < 4; i++) {
for (int j = 1; j < 3; j++) {
if (this.board.get(i, j) == n) {
if (this.board.get(i, j) == this.board.get(i, j + 1)) {
count++;
j++;
}
}
}
}
for (int j = 0; j < 4; j++) {
for (int i = 1; ... | 8 |
public void collideVertical() {
setVelocityY(0);
} | 0 |
void radf4(final int ido, final int l1, final float in[], final int in_off, final float out[], final int out_off, final int offset) {
final float hsqt2 = 0.707106781186547572737310929369414225f;
int i, ic;
float ci2, ci3, ci4, cr2, cr3, cr4, ti1, ti2, ti3, ti4, tr1, tr2, tr3, tr4, w1r, w1i, w2r,... | 7 |
public boolean containsKey(String var) {
for (String line : this.lines) {
if (line.trim().length() == 0) {
continue;
}
if (line.charAt(0) == '#') {
continue;
}
if (line.contains("=")) {
int delimPositio... | 5 |
public AabbToAabbParameters getPointToPlaneParameters(AABB aabbscnd, MovingObject mo){
AABB aabbfst = mo.getPredictedAABB();
Vec2 expandedExtent = aabbscnd.getHalfExtent().addTo(aabbfst.getHalfExtent());
Vec2 expandedCenter = aabbscnd.getCenter();
Vec2 centersDifference = expandedC... | 4 |
@Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
MOB target=mob;
if((auto)&&(givenTarget!=null)&&(givenTarget instanceof MOB))
target=(MOB)givenTarget;
if(target.fetchEffect(this.ID())!=null)
{
mob.tell(target,null,null,L("<S-NAME> <S-IS... | 8 |
public static GlobalTimes getInstance() {
return instance;
} | 0 |
private void initBoard() {
JPanel bottomLabel = new JPanel(new GridLayout(1, 8));
for (int i = 0; i < 8; i++) {
bottomLabel.add(new JLabel("" + (char) ('a' + i),
SwingConstants.CENTER));
}
JPanel sideLabel = new JPanel(new GridLayout(8, 1));
for (i... | 2 |
public void setMetricType (SelectedTag d) {
if (d.getTags() == TAGS_SELECTION) {
m_metricType = d.getSelectedTag().getID();
}
if (m_significanceLevel != -1 && m_metricType != CONFIDENCE) {
m_metricType = CONFIDENCE;
}
if (m_metricType == CONFIDENCE) {
setMinMetric(0.9);
... | 7 |
@Override
public void renderTileLayer(TileLayer tilelayer, TileDrawTarget target,
int originX, int originY, float alpha) {
int tilewidth = map.getTileWidth();
int tileheight = map.getTileHeight();
int width = map.getWidth();
int height = map.getHeight();
// The origin point of every tile to-be-drawn is... | 7 |
public void asignarColumnaLetrasB(String nombreRespuesta, int numeroRespuesta){
switch(numeroRespuesta){
case 0: _jlbl6.setText(nombreRespuesta);
break;
case 1: _jlbl7.setText(nombreRespuesta);
break;
case 2: _jlbl8.setText(nombreRespuesta);
... | 5 |
public void addItemsToCombobox(ArrayList<StockItem> list) {
comboboxItems.clear();
String item = "";
if (driver.getStockDB().getStockList().size() > 0) {
for (StockItem stockItem : list) {
item = stockItem.getProduct().getProductName();
comboboxItems.add(item);
}
}
else {
comboBox.removeAllIt... | 2 |
public Object getField2() {
return field2;
} | 0 |
@Override
public void unInvoke()
{
int drunkness=this.drunkness;
MOB mob=null;
if(affected instanceof MOB)
{
mob=(MOB)affected;
if((CMLib.dice().rollPercentage()<(drunkness*10))&&(!((MOB)affected).isMonster()))
{
final Ability A=CMClass.getAbility("Disease_Migraines");
if(A!=null)
A.invo... | 7 |
public Object clone() {
ADTree clone = new ADTree();
if (m_root != null) { // check for initialization first
clone.m_root = (PredictionNode) m_root.clone(); // deep copy the tree
clone.m_trainInstances = new Instances(m_trainInstances); // copy training instances
// deep copy the... | 7 |
@Override
public void startElement(String uri, String localName, String qName, Attributes attr) {
switch (qName.toLowerCase().toString()) {
case "bd":
addDb(attr);
break;
case "tabela":
addTable(attr);
break;
... | 4 |
public static HashMap<String, String> readSrgFile()
{
File srgFile = new File("notch-srg.srg");
if (!srgFile.exists())
{
return null;
}
HashMap<String, String> mcClassMap = new HashMap<String, String>();
try
{
BufferedReader reader = n... | 6 |
@Override
public void mousePressed(MouseEvent e) {} | 0 |
public void doPost (HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
String output = "You have successfully signed up";
User user;
// See if the user exists in the database
try {
int a = Integer.parseInt(req.getParameter("age"));
boolean own = true;
// Create... | 4 |
@Override
public void updateGameState(eGameState state) {
switch (state) {
case abort:
JOptionPane.showMessageDialog(this.getParent(), "Oponent left the current game");
break;
case won:
ImageIcon winIcon = new ImageIcon(PlayingWindow.cl... | 3 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Transducer that = (Transducer) o;
if (lowerRangeLimit != that.lowerRangeLimit) return false;
if (type != that.type) return false;
if (u... | 7 |
public void setSignatureMethod(SignatureMethodType value) {
this.signatureMethod = value;
} | 0 |
public static String translateValue(String value,String locale) throws Exception {
if(debug)
{
System.out.println("TranslateValue:"+value);
if(value.equals("Password"))
return "密码";
else if(value.equals("OK"))
return "确认";
else if(value.equals("okButton"))
return "确认按钮";
else if(value... | 9 |
public ListNode deleteDuplicates(ListNode head) {
if (head == null) return head;
if (head.next == null) return head;
if (head.val == head.next.val)
{
int val = head.val;
while (head != null && head.val == val) head = head.next;
return deleteDuplicates(head);
}
h... | 5 |
private void addAnnotations(AnnotationTypeDoc annotationDoc, LinkInfoImpl linkInfo,
ContentBuilder annotation, AnnotationDesc.ElementValuePair[] pairs,
int indent, boolean linkBreak) {
linkInfo.label = new StringContent("@" + annotationDoc.name());
annotation.addContent(getLink(l... | 9 |
public void init() {
for (int i = 0; i < actions.size(); i++) {
TimedAction action = actions.get(i);
if (action.from == 0 && action.getNextAction().type == Type.HRAM && action.getNextAction().position == GbConstants.LCDC) {
if (initialLcdc != -1)
throw new RuntimeException("f... | 7 |
public static void PRM(Partition p) {
double hyperperiod = p.getHyperPeriod() * 1.0;
Logger log = new Logger("plot1");
for (double i = 1.0; i <= hyperperiod; i += 1.0) {
double per = 0.01;
System.out.println(p.getPartitionDBF(p.getHyperPeriod()));
System.out.println(getPRMsbf(p.getHyperPeriod(), i * p... | 4 |
public void getCredential() throws IOException, GeneralSecurityException {
LOG.debug("Generating MyProxyLogon object..");
MyProxyLogon myProxyLogon = getConnection();
LOG.debug("Retrieving credentials from the MyProxy server..");
try{
myProxyLogon.getCredentials();
}catch(SSLHandshakeException e){
//Av... | 3 |
public static Map<String,String> getPluginFileMap()
{
Map<String,String> pluginList = new HashMap<String,String>();
try
{
File jarLocation = new File(ControllerEngine.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath());
String parentDirName = jarLocation.getParent(); // to get the... | 5 |
public List<T> pesquisarComCondicaoComAlias(String alias, String propriedade, List<LogicalExpression> listExpress, String ordem) throws ValidacaoException {
List<T> lista = new ArrayList<T>();
try {
Criteria criteria = session.createCriteria(classe);
criteria.createAlias(propried... | 3 |
public StringBuffer printInterfaces(Class<?> cls, StringBuffer message){
if(cls.getInterfaces() != null){
Class[] iArray = cls.getInterfaces();
for(int i = 0; i < iArray.length; i++){
if(iArray[0] != null && i == 0){
message.append(" implements ");
}
message.append(iArray[i].getSimpleName()... | 6 |
@Override
public Solution solve(Bean input) {
// TODO Auto-generated method stub
Solution solution = new Solution();
ArrayList<Summit<String>> summits = new ArrayList<Summit<String>>();
DirectedGraph dgraph = new DirectedGraph();
//This loops creates the summits based on the number of summit there are ... | 4 |
public void testReopenOnCommit() throws Throwable {
Directory dir = new MockRAMDirectory();
IndexWriter writer = new IndexWriter(dir, new WhitespaceAnalyzer(), new KeepAllCommits(), IndexWriter.MaxFieldLength.UNLIMITED);
for(int i=0;i<4;i++) {
Document doc = new Document();
doc.add(new Field("id... | 6 |
public double[][] readFile(String pathname) throws Exception {
double[][] values = new double[Card.VALUE.values().length][Card.VALUE.values().length];
for(int i = 0; i < values.length; i++) {
for (int j = 0; j < values[i].length; j++) {
values[i][j] = 0;
}
}
File file = new File(pathname);
FileRe... | 6 |
public BufferedImage doScreenShot() {
BufferedImage bfImage = null;
try {
// 2. get Input and Output streams
byte[] doScreenShot = ClientMessageEncoder.encodeDoScreenShot();
out.write(doScreenShot);
out.flush();
// System.out.println("client executes command: screen shot");
//Read the message he... | 5 |
private int checkInputForTextField(JTextField toTest, int maxNumber){
if(!toTest.getText().equals("")){
int result = 0;
String text = toTest.getText();
boolean takeAwayLast = false;
if(text.length()> 2) text = text.substring(0, 2);
... | 5 |
@Override
public T set(int index, T element) {
if (index <= size()) {
MyList<T> node = first;
for(int i = 1; i < index; i++) {
node = node.right;
}
T temp = node.value;
node.value = element;
return temp;
}
return null;
} | 2 |
public static void main(String[] args) throws IOException {
// TODO code application logic here
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int choice = 0;
database = new PwdDB();
Banner();
System.out.print("\nDATABASE FILENAME [even new one... | 5 |
public static HashMap<String, HashSet<Integer>> getFileLineMap( ) throws Exception
{
System.out.println("Reading annotations...");
HashMap<String, HashSet<Integer>> map = new HashMap<String, HashSet<Integer>>();
BufferedReader reader = new BufferedReader(new FileReader(
new File(ConfigReader.getCREOrtho... | 8 |
@Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
if((!mob.isInCombat())||(mob.rangeToTarget()<1))
{
mob.tell(L("You really should be in ranged combat to cast this."));
return false;
}
for(int i=0;i<mob.location().numItems();i++)
{
fi... | 9 |
public int getQuantite() {
return quantite;
} | 0 |
@Override
public void collideWith(Element e) {
if (e instanceof Player) {
Player player = (Player) e;
for (int i = player.getRemainingActions(); i > 1; i--)
player.decrementAction();
} else if (e instanceof IdentityDisc)
((IdentityDisc) e).decrementLifetime();
} | 3 |
public boolean getColison() {
colBox.x += vec.x;
colBox.y += vec.y;
colBox.setBounds((int) (colBox.x), (int) (colBox.y), colBox.width, colBox.height);
for (int i = 0; i < world.tiles.length; i++) {
for (int j = 0; j < world.tiles[0].length; j++) {
if (colBox.intersects(world.tiles[i][j]) && world.tiles[i... | 4 |
@Override
protected void runImpl() throws ExecutionFailedException {
List<List<Long>> features = new ArrayList<List<Long>>();
for (File featuresFile : featuresFiles.get()) {
try {
features.add(readVector(featuresFile));
} catch (IOException e) {
... | 7 |
public boolean pickAndExecuteAnAction() {
if(!paused) {
synchronized(openChecks) {
for(Check c : openChecks)
if(c.state == CheckState.Created) {
ComputeCheck(c);
return true;
}
}
synchronized(openChecks) {
for(Check c : openChecks)
if(c.state == CheckState.Paying) {
M... | 6 |
public void eleShift()
{
} | 0 |
public int look(int bits){
int ret;
int m=mask[bits];
bits+=endbit;
if(endbyte+4>=storage){
if(endbyte+(bits-1)/8>=storage)
return (-1);
}
ret=((buffer[ptr])&0xff)>>>endbit;
if(bits>8){
ret|=((buffer[ptr+1])&0xff)<<(8-endbit);
if(bits>16){
ret|=((buffer[p... | 7 |
public boolean equals(Object o) {
Hexpos other = (Hexpos) o;
return ((row == other.row) && (col == other.col));
} | 1 |
public void highlightBloc(Point bloc) {
// RICORDARSI DI METTERE UNA COLORAZIONE DIVERSA NEL CASO
// DI UNA CELLA CON VALORE ALTERNATIVO!
Point baseCell = new Point();
baseCell.x = (m_t - 1) * bloc.x + 1;
baseCell.y = (m_t - 1) * bloc.y + 1;
int c, r;
this.clearHighlightColors();
... | 8 |
@Override
public void main() {
cleanOutput();
List<OldMachine> machines = new ArrayList<OldMachine>();
machines.add(new CoffeeMachine());
machines.add(new Microwave());
machines.add(new Adapter());
for (OldMachine machine : machines) {
machine.launch();
}
addOutput("all machines are working... | 2 |
public static void loadMessagesFile() {
// Create if missing
File file = new File(PlayerChat.plugin.getDataFolder(), "messages.yml");
try {
if (file.createNewFile()) {
Messenger.info("messages.yml created.");
YamlConfiguration yaml = Msg.toFile();
... | 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.