text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void addParamsFromFile(String fName){
BufferedReader bufread = null;
String curLine = null;
boolean done = false;
// First attempt to open and read the config file
try{
FileInputStream is = new FileInputStream(fName);
bufread = new BufferedReader(new InputStreamReader(is));
curLine = bu... | 8 |
@Override
public String getDesc() {
return "HammerFall";
} | 0 |
@Override
public int castingQuality(MOB mob, Physical target)
{
if((mob!=null)&&(target!=null))
{
final Set<MOB> h=properTargets(mob,target,false);
if(h.size()<2)
return Ability.QUALITY_INDIFFERENT;
for(final MOB M : h)
if((M.rangeToTarget()<0)||(M.rangeToTarget()>0))
h.remove(M);
if(h.si... | 7 |
private MoveAndCost findBestMoveInternal(int[][] board, int allowedCallCnt) {
allowedCallCnt--; //this call
double minCost = Double.POSITIVE_INFINITY;
int[][] bestBoard = null;
Move bestMove = null;
int[][][] newBoards = getNewBoards(board);
int needCalls = getNeedCallsF... | 5 |
public LinkedList getQuery(){
LinkedList result = new LinkedList();
if(!intervalBtns.isEmpty())
{
if(firstBtn == null)
{
System.out.println("Error: firstBtn is null but intervalBtns list is not empty. Check.");
}
else
{
/*
*
* If it's a groupInterval, add all its interval a... | 8 |
public ArrayList<Integer> getShortestPaths(int src, GraphAPI gapi) {
ArrayList<Integer> shPaths = new ArrayList<Integer>();
for(int i=0; i<gapi.N; i++) {
if(i==src)
shPaths.add(0);
else
shPaths.add(INT_MAX_VAL);
}
// Loop over V-1 vertices
for(int i=0; i<gapi.N-i; i++) {
// Loop over all e... | 5 |
public ClientUpdaterModContainer()
{
super(new ModMetadata());
ModMetadata meta = super.getMetadata();
meta.authorList = Arrays.asList(new String[] {"robin4002"});
meta.modId = "clientupdater";
meta.version = "1.7.2";
meta.name = "Client Updater";
meta.version = "@VERSION@";
if(FMLCommonHandler.instan... | 8 |
private void rotateLeft( final Node node ) {
final Node right = node.mRight;
if( right == null ) {
return;
}
node.mRight = right.mLeft;
if( node.mRight != null ) {
node.mRight.mParent = node;
}
right.mLeft = node;
if( node == mRo... | 7 |
static Object tryInstantiate(final Class<?> clazz) throws InstantiationException {
Class<?> cl = clazz;
while (cl != Object.class) {
if (!isProxy(cl)) {
try {
return cl.newInstance();
} catch (ReflectiveOperationException goNext) {}
}
cl = cl.getSuperclass();
}
... | 8 |
public static Time toTime(Object length) {
if (length != null && String.class.isAssignableFrom(length.getClass())) {
String text = (String) length;
if(text.matches("\\d{1,2}:\\d{1,2}:\\d{1,2}")){
return Time.valueOf(text);
}
else if(text.matches("... | 5 |
private void exerciseObjectList(List<ObjectTypes> list, long length) {
assertEquals(length, list.size());
gcPrintUsed();
ObjectTypes.A a = new ObjectTypes.A();
ObjectTypes.B b = new ObjectTypes.B();
ObjectTypes.C c = new ObjectTypes.C();
ObjectTypes.D d = new ObjectTypes.D();
long start = ... | 7 |
public void acceptConnection(Connection con){
if(connectionTimer!=null){
connectionTimer.cancel();
}
//stop broadcasting
if(bcast!=null && bcast.isRunning()){
bcast.stop();
}
waitingOnPassword = false;
client_connected = true;
conID = con.getID();
ServerMsg msg = new Serve... | 3 |
public static void main(String[] args) {
BufferedReader input= new BufferedReader(new InputStreamReader(System.in));
boolean prima;
try{
System.out.print("Masukan batas bawah:");
int batas_bawah=Integer.parseInt(input.readLine());
System.out.print("Masukan bat... | 9 |
public static void setZero(int[][] array){
boolean[] col = new boolean[array[0].length];
boolean[] row = new boolean[array.length];
for(int i=0;i<array.length;i++){
for(int j=0;j<array[0].length;j++){
if(array[i][j] == 0){
col[j] = true;
row[i] = true;
}
}
}
for(int i=0;i<array.length;... | 7 |
public void run() {
super.init(Properties.PORT);//initialize the RMI registry
while (running) {
// send a message to each resource manager, requesting its load
for (String rmUrl : resourceManagerLoad.keySet())
{
/*
* TODO This part needs to be changed from localsocket to using RMI
*/
... | 5 |
public void clearRows() {
boolean [] notFullRows = new boolean[board.length];
for (int r = board.length - 1; r >= 0; r--) {
for (int c = 0; c < board[r].length && !notFullRows[r]; c++) {
if (board[r][c] == EMPTY)
notFullRows[r] = true;
}
}
boolean temp = false;
for (boolean b : notFullRows)... | 9 |
public int compareTo(Duration other) {
if (other == null) {
throw new NullPointerException("Cannot compare Duration to null.");
}
if (this.millis == other.millis) {
return nanos < other.nanos ? -1 : nanos == other.nanos ? 0 : 1;
}
return this.millis < othe... | 5 |
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
public Long getId() {
return id;
} | 0 |
public void createHexagons(int hexagonColumns, int hexagonRows, int r, int x, int y){
int originalX = x;
for(int j=0; j<hexagonRows; j++){
for(int i=0; i<hexagonColumns; i++){
singleHexagon = new Polygon();
for(int k=0; k<6; k++) {
singl... | 4 |
private void initUpperBars(){
upperBars = new JPanel();
upperBars.setLayout(new BorderLayout());
upperBars.add(menuBar, BorderLayout.NORTH);
upperBars.add(menuBarWithButtons, BorderLayout.SOUTH);
add(upperBars, BorderLayout.NORTH);
} | 0 |
public void setTypeNumber() {
if (type == Type.AIR) typeNumber = 0;
if (type == Type.DIRT) typeNumber = 1;
if (type == Type.WOOD) typeNumber = 2;
if (type == Type.STONE) typeNumber = 3;
if (type == Type.GLASS) typeNumber = 4;
} | 5 |
public Color[] fileToColorArray(File file) throws IOException {
int lim;
File2Hex converter = new File2Hex();
String hexString = converter.convertToHex(file);
Scanner hexStringScanner = new Scanner(hexString);
ArrayList<String> snipArray = new ArrayList<>();
while(hexSt... | 4 |
public void deposit (int amount)
{
org.omg.CORBA.portable.InputStream $in = null;
try {
org.omg.CORBA.portable.OutputStream $out = _request ("deposit", true);
$out.write_ulong (amount);
$in = _invoke ($out);
return;
} ... | 2 |
/* */ public String attemptingToConnect(String username, char[] password)
/* */ {
/* 76 */ Config.USERNAME = username.toLowerCase();
/* 77 */ String serverResponse = null;
/* */
/* 80 */ Player player = new Player(0, -1, username, 0, 193, 423, "cache/graphics/sprites/character.png", null... | 9 |
public void updateSubTypes() {
if (!staticFlag)
subExpressions[0].setType(Type.tSubType(classType));
} | 1 |
private TreeRow getBeforeFirstSelectedRow() {
TreeRow prior = null;
for (TreeRow row : new TreeRowViewIterator(this, mRoot.getChildren())) {
if (mSelectedRows.contains(row)) {
return prior;
}
prior = row;
}
return null;
} | 2 |
public static void loadOtherTabAccount(String serverID) {
Account account = null;
for (int i = 0; i < Account.allAccounts.length; i++) {
try {
if (!"OpenTransactionAccount".equals(Account.allAccounts[i]) && !"CashPurseAccount".equals(Account.allAccounts[i])) {
... | 5 |
@Override
public void executeMsg(final Environmental myHost, final CMMsg msg)
{
super.executeMsg(myHost,msg);
if((affected!=null)
&&(affected instanceof MOB)
&&(msg.amISource((MOB)affected)||msg.amISource(((MOB)affected).amFollowing())||(msg.source()==invoker()))
&&(msg.sourceMinor()==CMMsg.TYP_QUIT))
{
... | 7 |
public RSAKeyValueType createRSAKeyValueType() {
return new RSAKeyValueType();
} | 0 |
private void LoadFriends() throws SQLException
{
Grizzly.GrabDatabase().SetQuery("SELECT * FROM server_friendships WHERE user_id = '" + this.ID + "'");
if (Grizzly.GrabDatabase().RowCount() > 0)
{
ResultSet AsFirstFriend = Grizzly.GrabDatabase().GrabTable();
while(AsFirstFriend.next())
{
Fri... | 4 |
public void die(){
if (sound.Manager.enabled) {
sound.Event effect = new sound.Event(getPosition(), getVelocity(),sound.Library.findByName(DEATH_EFFECT));
effect.gain = EFFECT_VOLUME;
sound.Manager.addEvent(effect);
}
velocity.timesEquals(0);
if(Parti... | 3 |
private int getDistanceBetweenTiles(Tile from, Tile to) {
int distance = 14;
if (from.getX() == to.getX()) {
distance = 10;
}
if (from.getY() == to.getY()) {
distance = 10;
}
return distance;
} | 2 |
protected void doPost(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
HttpSession session = req.getSession(true);
String url = "/";
String action = (String)req.getParameter("action");
LoginViewHelper loginViewHelper =
ViewHelperFactory.getInstance().g... | 6 |
public static int createMenu(Menu menu, String accessToken) {
int result = 0;
// ƴװ˵url
String url = menu_create_url.replace("ACCESS_TOKEN", accessToken);
// ˵תjsonַ
String jsonMenu = JSONObject.fromObject(menu).toString();
// ýӿڴ˵
JSONObject jsonObject = httpRequest(url, "POST", jsonMenu);
if (null !... | 2 |
public void loadConfiguration() throws ParserConfigurationException, SAXException, IOException {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = factory.newDocumentBuilder();
Document doc = docBuilder.parse(configurationFile);
// Get th... | 8 |
public void testBinaryCycAccess2() {
System.out.println("\n**** testBinaryCycAccess 2 ****");
CycAccess cycAccess = null;
try {
try {
if (connectionMode == LOCAL_CYC_CONNECTION) {
cycAccess = new CycAccess(testHostName, testBasePort);
} else if (connectionMode == SOAP_CYC_CO... | 4 |
public void ShowHelp(CommandSender sender, String cmdLabel, int page) {
ArrayList<String> cmds = new ArrayList<String>();
cmds.add("/" + cmdLabel + " help " + prekick.language.GetText("PreKickCommand.Help.Help").replaceAll("%CMDLABEL%", cmdLabel));
if (p(sender, "prekick.blacklist.switch"))
cmds.add("/" + cm... | 8 |
public void setLastActivity(int lastActivity) {
this.lastActivity = lastActivity;
} | 0 |
private void createPlayHistory(int drawnCard){
DataInstance pdi = new DataInstance(playNet.inputNodes());
//Rack
int[] cur_rack = rack.getCards();
pdi.addFeature(cur_rack, game.card_count);
//Probabilities
if (USE_PROB_PLAY){
double[][] prob = rack.getProbabilities(false, 0);
pdi.addFeature(prob[0], 1... | 1 |
public boolean setNewValue(int depth, int value) {
if(isFull()) {
return false;
}
if(depth==1) {
if(o0==null) {
set0(new HuffmanNode(this, value));
return true;
}
else if(o1==null) {
set1(new HuffmanNode(this, value));
... | 5 |
private Vector<String> getAvailableLF()
{
final LookAndFeelInfo lfs[] = UIManager.getInstalledLookAndFeels();
lookNFeelHashMap = new HashMap<>(lfs.length);
final Vector<String> v = new Vector<>(lfs.length);
for (final LookAndFeelInfo lf2: lfs)
{
lookNFeelHashMap.put(lf2.getName(), lf2.getClassName());... | 4 |
protected void execute(final String action) throws MojoExecutionException, MojoFailureException {
final Properties properties;
try {
properties = PropertiesUtil.getInstance().loadProperties(propertiesPath);
} catch (IOException e) {
throw new MojoFailureException("Could n... | 7 |
public void solve() {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int res = 0;
for (int i = 1; i <= n; i++) {
if (gcd(i, n) == 1) {
res++;
}
}
System.out.println(res);
} | 2 |
public static void main (String[] args) {
int[] a = new int[14];
int[] b = new int[4];
for (int i=0; i !=4 ; i++) {
a[i] = i * i;
}
for ( int i=0; i != b.length; ++i ) {
b[i] = i * 2;
}
mergeB2A(a, b, 4, b.length);
System.out.println( Arrays.toString(a) );
} | 2 |
public void loadChannels() throws SQLException {
sql.initialise();
ResultSet res = sql.sqlQuery("SELECT * FROM BungeeChannels");
while(res.next()){
ChatChannel newchan = new ChatChannel(res.getString("ChannelName"), res.getString("ChannelFormat"),res.getString("Owner"), res.getBoolean("isServerChannel"));
p... | 2 |
private static void applyHysteresis(Image image, double t1, double t2,
ChannelType c) {
ChannelType color = c == null ? RED : c;
for (int x = 0; x < image.getWidth(); x++) {
for (int y = 0; y < image.getHeight(); y++) {
double pixel = image.getPixel(x, y, color);
double val = pixel;
if (pixel < t1... | 6 |
public int[][] getActualGrid()
{
int[][] gridActual = new int[sudokuSize][sudokuSize];
for (int i = 0; i < sudokuSize; i++) {
for (int j = 0; j < sudokuSize; j++) {
gridActual[i][j] = cells[i][j].current;
}
}
return gridActual;
} | 2 |
@Override
public void controllAnts(LinkedList<MyAnt> freeAnts, long time) {
for (MyAnt ant : freeAnts) {
Logger.printLine(ant + " tries to survive");
LinkedList<Field> neighbors = new LinkedList<Field>();
for (Field neighbor : ant.getField().getTurnNeighbors()) {
if (!neighbor.hasWater())
neighbors... | 5 |
public boolean collidesRectAgainstRect(double x1, double y1, int width1, int height1, double x2, double y2,
int width2, int height2) {
double right1 = x1 + width1;
double right2 = x2 + width2;
double bottom1 = y1 + height1;
double bottom2 = y2 + height2;
return (x1 <= x2 && x2 < right1 || x2 <= x1 && x1 <... | 7 |
public ArrayList<Employee> searchEmployee(String name) {
ArrayList<Employee> _searchResults = new ArrayList<Employee>();
for (Employee emp : employees)
{
if(emp.getFullName().contains(name)) {
_searchResults.add(emp);
}
}
return _searchResults;
} | 2 |
private void btnCadastrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCadastrarActionPerformed
//Tela de Cadastro de Departamento
if (txtNomeDep.getText().equals("") || txtCodDep.getText().equals("")) {
JOptionPane.showMessageDialog(null, " Preencha todos os campos... | 5 |
public static Direction findDirection(Point source, Point dest)
{
if(source.equals(dest))
return null;
long p = source.getX();
long q = source.getY();
long r = dest.getX();
long s = dest.getY();
if(p<r && q>s)
return Direction.SOUTHEAST;
else i... | 9 |
private int[] hideLay(int[][] lay) {
int hiddenLay[] = new int[HEIGHT * HEIGHT];
int k = 0;
for (int i = 0; i < HEIGHT; i++) {
for (int j = 0; j < HEIGHT; j++) {
hiddenLay[k++] = lay[i][j];
}
}
return hiddenLay;
} | 2 |
public void tableChanged(TableModelEvent e) {
// If we're not sorting by anything, just pass the event along.
if (!isSorting()) {
clearSortingState();
fireTableChanged(e);
return;
}
// If the ta... | 6 |
@Override
public void executeMsg(final Environmental myHost, final CMMsg msg)
{
super.executeMsg(myHost,msg);
if((myHost==null)||(!(myHost instanceof MOB)))
return;
final MOB mob=(MOB)myHost;
if(msg.amISource(mob)&&(msg.tool() instanceof Ability))
{
final Ability A=(Ability)msg.tool();
if((mob.is... | 7 |
public static void main(String[] args) throws InterruptedException{
int iloscProcesowA = 3;
int iloscProcesowB = 3;
int iloscProcesowAB = 3;
Thread procesyA[] = new Thread[iloscProcesowA];
Thread procesyB[] = new Thread[iloscProcesowB];
Thread procesyAB[] = new Thread[iloscProcesowAB];
Zasoby z... | 9 |
private void repaintChangedRollRow(Row rollRow) {
if (rollRow != mRollRow) {
Column column = mModel.getColumnAtIndex(0);
Rectangle bounds;
if (mRollRow != null) {
bounds = getCellBounds(mRollRow, column);
bounds.width = mModel.getIndentWidth(mRollRow, column);
repaint(bounds);
}
if (rollRo... | 3 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
PhpposSalesItemsEntityPK that = (PhpposSalesItemsEntityPK) o;
if (itemId != that.itemId) return false;
if (saleId != that.saleId) return false;... | 5 |
private static double calculatePeptideMass(AminoAcidSequence aminoAcidSequence,
List<PTModification> modifications,
boolean monoMass,
double... massCorrections) {
// calcu... | 7 |
public byte[] getNetworkBytes() {
ByteArrayOutputStream buf = new ByteArrayOutputStream();
buf.write((byte) 0x23);
buf.write((byte) 0x54);
buf.write((byte) 0x26);
buf.write((byte) 0x68);
for (int i = 7; i >= 0; i--) {
buf.write((byte) ((tstamp >> 8*i) & 0xff));
}
for (BLImageViewport viewpor... | 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 Counter winningMove(Move lastMove, Board b) {
boolean end = false;
int x = Board.MINWIDTH;
int y = b.getHeight();
Counter winner = Counter.EMPTY;
while((y >= Board.MINHEIGHT) && !end) {
while ((x <= b.getWidth() && !end)) {
//Check up
end = Util.checkCellInDirection(b, x, y, DirectionX.NO... | 9 |
public void endEditingTurn()
{
if(myTurnEditing) //finish with player 1
{
if(Main.isTwoPlayers)
{
myTurnEditing = false;
mySea.renderEditingShip = false;
theirSea.renderEditingShip = true;
editingPos = -1;
editNextShip();
Main.manualAdding = true;
Main.editingMode = true;
Ma... | 5 |
protected boolean stepSearch() {
if (maxSearched > 0 && flagged.size() > maxSearched) {
if (verbose) I.say("Reached maximum search size ("+maxSearched+")") ;
return false ;
}
final Object nextRef = agenda.leastRef() ;
final T next = agenda.refValue(nextRef) ;
agenda.deleteRef(nextRef) ;
... | 7 |
private Status testForTrack(int x, int y, int z) {
World world = tile.getWorldObj();
for (int jj = -2; jj < 4; jj++) {
if (!world.blockExists(x, y - jj, z))
return Status.UNKNOWN;
if (RailTools.isRailBlockAt(world, x, y - jj, z)) {
trackLocation = ... | 3 |
public void objectGroundCollision()
{
long time = System.currentTimeMillis();
if (gcontact==null) gcontact = new Contact(new Vector(), new Vector(), 0);
for (ObjectProperties object : scene.getObjects())
{
if (!object.isPinned && scene.getCount() > 0 && object !... | 7 |
public byte[] decoding(byte[] data) {
int bufLen = data.length - (data.length + 31) / 32 * 2;
ByteBuffer buf = ByteBuffer.allocate(bufLen);
ByteBuffer inDataBuf = ByteBuffer.wrap(data);
for(int i = 0; i != data.length / 2; i++) {
if(i % 16 == 15 || i == data.length / 2 - 1) ... | 3 |
@Override
public final String generateHtmlCode() {
final StringBuilder sb = new StringBuilder();
sb.append("<!-- TableHelper Generated Code -->\n");
sb.append("<table>\n");
if (this.headersTopRow != null) {
sb.append("\t<tr>\n");
if (this.headersLeftRow != null) {
sb.append("\t\t<th> </... | 6 |
@SuppressWarnings("deprecation")
public void testConstructor_RP_RP_PeriodType4() throws Throwable {
YearMonthDay dt1 = new YearMonthDay(2005, 7, 17);
YearMonthDay dt2 = null;
try {
new Period(dt1, dt2);
fail();
} catch (IllegalArgumentException ex) {}
} | 1 |
public List<Punto> ObtenerPunto(String consulta){
List<Punto> lista=new ArrayList<Punto>();
if (!consulta.equals("")) {
lista=cx.getObjects(consulta);
}else {
lista=null;
}
return lista;
} | 1 |
public void validatePassword(ComponentSystemEvent event)
{
UIComponent components = event.getComponent();
UIInput uiInputPassword = (UIInput) components
.findComponent("password");
password = uiInputPassword.getLocalValue() == null ? ""
: uiInputPassw... | 3 |
public String getTableName() {
return tableName;
} | 0 |
public static void fillHex(int i, int j, double wi, double hi, String n, int xWorm, int yWorm, Graphics2D g2) {
int xFrom, yFrom;
int xTo = (int) ((i * (s + t)) + s + BORDERS);
int yTo = (int) ((j * h + (i % 2) * h / 2) + r + BORDERS);
int x = i * (s + t);
int y = j * h + (i % 2)... | 8 |
private static void output (ArrayList <String> pseudographics){
for (String e : pseudographics){
System.out.println(e);
}
} | 1 |
public static Object load(String path){
if(! new File(path).exists()){
return null;
}
Object object = null;
try {
FileInputStream fis = new FileInputStream(path);
ObjectInputStream ois = new ObjectInputStream(fis);
try{
... | 3 |
private void readTrunks(File pngFile) throws IOException {
DataInputStream input = new DataInputStream(new FileInputStream(pngFile));
try {
byte[] nPNGHeader = new byte[8];
input.readFully(nPNGHeader);
trunks = new ArrayList<PNGTrunk>();
if ((nPNGHeader[0] == -119) && (nPNGHeader[1] == 0x50)
&& (n... | 9 |
public static int convertType(String type) throws Exception {
int t = 0;
if (SESSION_TRANSACTED.equals(type) || String.valueOf(Session.SESSION_TRANSACTED).equals(type)) {
t = Session.SESSION_TRANSACTED;
}
else if (CLIENT_ACKNOWLEDGE.equals(type) || String.valueOf(Session.CLIENT_ACKNOWLEDGE).equals(type)) {
... | 8 |
public static void main(String[] args) {
CL.setExceptionsEnabled(true);
int numPlatformsArray[] =new int[1];
int buffersize=0;
int n=1024*1024*10;
float srcArrayA[] = new float[n];
float srcArrayB[] = new float[n];
float dstArray[] = new float[n];
for (int i=0; i<n; i++)
{
... | 6 |
public void getEnvironmentExits () {
ResultSet rs = Main.mysql.getData("SELECT * FROM `environments_exits`");
try {
while (true) {
String[] tempString = new String[6];
tempString[0] = rs.getString(2); // Name
tempString[1] = rs.getString(3); //... | 4 |
public final int partitionByBarCode(int left, int right) // see the name version of this method
{
Product pivotElement = products[left];
int max = logicalSize;
int lb = left, ub = right;
Product temp;
while (left < right)
{
while((products[left].getBarCode() <= pivotElement.getBarCode()) && left +1 < ... | 8 |
private int ssMedian3 (final int Td, final int PA, int v1, int v2, int v3) {
final int[] SA = this.SA;
final byte[] T = this.T;
int T_v1 = T[Td + SA[PA + SA[v1]]] & 0xff;
int T_v2 = T[Td + SA[PA + SA[v2]]] & 0xff;
int T_v3 = T[Td + SA[PA + SA[v3]]] & 0xff;
if (T_v1 > T_v2) {
final int temp = v1;
v1... | 3 |
@Test
public void findDuplicateTypeHand_whenThreePairsExist_returnsHighestTwoPair() {
Hand hand = findDuplicateTypeHand(twoKingsTwoQueensTwoJacksSix());
assertEquals(HandRank.TwoPair, hand.handRank);
assertEquals(Rank.King, hand.ranks.get(0));
assertEquals(Rank.Queen, hand.ranks.get(1));
assertEquals(Rank.Ja... | 0 |
public static void staticExportSets() {
HashSet<ItemSet> setnames = new HashSet<>();
for (Shoes s : shoes) {
setnames.add(s.getItemset());
}
for (Pants s : pants) {
setnames.add(s.getItemset());
}
for (Gloves s : gloves) {
setnames.add(s.getItemset());
}
for (Armor s : armors) {
setnames.ad... | 6 |
public void replace(int depth, final Expr expr) {
for (int i = stack.size() - 1; i >= 0; i--) {
final Expr top = (Expr) stack.get(i);
if (depth == 0) {
stack.set(i, expr);
return;
}
depth -= top.type().stackHeight();
}
throw new IllegalArgumentException("Can't replace below stack bottom.");... | 2 |
public SimpleStringProperty countryCodeProperty() {
return countryCode;
} | 0 |
@Override
public boolean onMouseDown(int mX, int mY, int button) {
if(button == 0 && mX > x && mX < x + width && mY > y && mY < y + height) {
Application.get().getHumanView().popScreen();
return true;
}
return false;
} | 5 |
@RequestMapping(value = "/ay", method = RequestMethod.POST, params = "refresh")
public String salvestaAyl(@Valid @ModelAttribute("ayw") ayView ayw, // BindingResult
// result,
ModelMap model) {
System.out.println("kas siia ays POST jouab");
String liik_ID = ayw.getCurrent().getLiik_i... | 7 |
public boolean isWarningStopCodon() {
if (!Config.get().isTreatAllAsProteinCoding() && !isProteinCoding()) return false;
// Not even one codon in this protein? Error
String cds = cds();
if (cds.length() < 3) return true;
String codon = cds.substring(cds.length() - 3);
return !codonTable().isStop(codon);
... | 3 |
public void setId(Long id) {
this.id = id;
} | 0 |
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 org.apache.xalan.templates.ElemVariable getElemVariable()
{
// Get the current ElemTemplateElement, and then walk backwards in
// document order, searching
// for an xsl:param element or xsl:variable element that matches our
// qname. If we reach the top level, use the StylesheetRoot's ... | 9 |
public void checkConsistent() {
StructuredBlock[] subs = getSubBlocks();
for (int i = 0; i < subs.length; i++) {
if (subs[i].outer != this || subs[i].flowBlock != flowBlock) {
throw new AssertError("Inconsistency");
}
subs[i].checkConsistent();
}
if (jump != null && jump.destination != null) {
J... | 7 |
static boolean multipliable(AlgebraicParticle a, AlgebraicParticle b){
return a.getClass().equals(b.getClass()) && a.almostEquals(b)
//mixed number need to be converted to fractions first
|| Util.constant(a) && Util.constant(b) && !(a instanceof MixedNumber) && !(b instanceof MixedNumber);
} | 5 |
private void paintBlock(Graphics2D g2d, ThreesBlock block){
int blockWidth = MAX_WIDTH/4;
int blockHeight = MAX_HEIGHT/4;
// Image redTwoImage = Toolkit.getDefaultToolkit().getImage(Panel.class.getResource("E:\\javaProject\\Threes\\src\\threes\\2.png"));
// Image blueOneImage = new Image... | 9 |
public static String toString(long[] message) {
StringBuilder out = new StringBuilder();
for (int i = 0; i < message.length; i++) {
out.append(message[i]);
out.append(' ');
}
return out.toString();
} | 1 |
protected float transmitChance(Actor has, Actor near) {
//
//
if (! near.health.organic()) return 0 ;
if (has.species() != near.species()) return 0 ;
if (near.traits.traitLevel(this) != 0) return 0 ;
if (near.traits.test(VIGOUR, virulence / 2, 0.1f)) return 0 ;
//
// TODO: THERE HAS ... | 4 |
private void Order(ArrayList<Company> companies) {
Collections.sort(Companies, new Comparator<Company>() {
@Override
public int compare(Company p1, Company p2) {
return new String(p1.getName()).compareTo(p2.getName());
}
});
} | 0 |
public int _setValue(int key,String valueName, String value) throws RegistryErrorException
{
try
{
Integer ret = (Integer)setValue.invoke(null, new Object[] {new Integer(key), getString(valueName), getString(value)});
if(ret != null)
return ret.intValue();
else
return -1;
... | 4 |
public void removeAllOutgoingTransitions() {
for(Transition t:outgoingTransitions) {
t.getToState().removeIncomingTransition(t);
}
outgoingTransitions = new ArrayList<Transition>();
} | 1 |
public Set<Element> calcFermeture() {
List<Item> generators = new ArrayList<Item>();//Liste des générateurs
List<Double> support = new ArrayList<Double>();//Liste des supports
List<Set<Item>> fermeture = new ArrayList<Set<Item>>();//Liste des fermetures
Set<Element> retTable = new HashSet<Element>(); //Table à ... | 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.