text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void ClearCell(int x, int y, int cellState)
{
if(cells[x][y].IsConstant()) {
return;
}
SetValueAndState(x, y, cells[x][y].current, cellState);
repaint();
} | 1 |
private double calcPotAtX(double psiL, double xDistance){
double potAtX = 0.0D;
if(this.chargeSame){
//symmetric elctrolyte
double kappa = Math.sqrt(2.0D*Fmath.square(Fmath.Q_ELECTRON*this.chargeValue)*Fmath.N_AVAGADRO*this.electrolyteConcn/(Fmath.EPSILON_0*this.epsilon*Fmath.K_B... | 6 |
private ArrayList<String> arrayToLowercase(ArrayList<String> array) {
for (int i = 0; i < array.size(); i++) {
array.set(i, array.get(i).toLowerCase().trim());
}
return array;
} | 1 |
public VortexSpaceSet(String savefile, int savesize) {
this.vortexSpaces = new VortexSpace[savesize];
System.out.println(savefile);
String[] spaceList = savefile.split("\n");
if (savefile.length() == 0) {
return;
}
for (int i=0; i<spaceList.length; i++) { //last empty line not counted
System.out.pr... | 3 |
public void calc() {
if(operator== "+") {
firstNum += secondNum;
}
if(operator == "-"){
firstNum -= secondNum;
}
if(operator == "*") {
firstNum *= secondNum;
}
// division by non-zero
if((operator == "/") && secondNum != 0.0) {
firstNum /= secondNum;
}
// division by zero
if((operator... | 8 |
CheckListBoxModel(Object[] items) {
this.items = items;
} | 0 |
public String generate() {
StringBuffer buffer = new StringBuffer();
int amt = min;
if (min != max) {
Random rand = new Random();
if (max >= 0) {
amt += rand.nextInt(max - min + 1);
}
else {
amt += rand.nextInt(parent.getUndefinedMax());
}
}
for (int i = 1; i <= amt; i++) {
buffer.ap... | 3 |
public static void SetUpPlayers(ArrayList<Player> players, Deck deck, int numPlayers)
{
log.entering("SetupPlayers", "Main");
if(numPlayers < 2 || numPlayers > 10)
{
System.exit(345);
}
for (int i = 0; i < numPlayers; i++)
{
/*if(i == 0 )
... | 5 |
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((values == null) ? 0 : values.hashCode());
return result;
} | 1 |
private boolean nextItemIs(ByteBuffer buf, String match) throws IOException {
// skip whitespace
int c = nextNonWhitespaceChar(buf);
for (int i = 0; i < match.length(); i++) {
if (i > 0) {
c = buf.get();
}
if (c != match.charAt(i)) {
... | 3 |
public void run(int gameSecondsTimeout){
try {
Thread.sleep(500);
}
catch(InterruptedException e){}
Debug.info("waiting for graphics engine to connect");
while(true){
try {
Thread.sleep(100);
} catch (InterruptedException e){}
if(graphicsContainer.get() != null){
break;
}
}
graphicsC... | 7 |
private boolean addWordBruteForceSequentially(String word) {
for(int i=0;i<N;i++) {
if(addWordInRow(word, i)) {
return true;
}
}
for(int i=0;i<M;i++) {
if(addWordInCol(word, i)) {
return true;
}
}
ret... | 4 |
private boolean checkHaveInteraction(String stype) {
ArrayList<SpriteData> allSprites = currentGame.getSpriteData();
for (SpriteData sprite : allSprites) {
if (getInteraction(stype, sprite.name).size() > 0) {
return true;
}
if (getInteraction(sprite.name, stype).size() > 0) {
return true;
}
}... | 3 |
private static void fxmlOutput(Node node, StringBuilder code) {
String nodeClass = node.getClass().getSuperclass().getSimpleName();
code.append(" <").append(nodeClass);
GObject gObj = (GObject) node;
code.append(" fx:id=\"").append(gObj.getFieldName()).append("\" ");
for (... | 4 |
private static void setData(String row, Data data) {
// String regex = "('(.*?)'|(?))";
// Matcher m = getMatcher(regex, row);
// ArrayList<String> cells = new ArrayList<String>();
// while (m.find()) {
// cells.add(m.group(1));
// }
if (!isComment(row)) {
// System.out.println(row);
String[] temp =... | 2 |
private String getCipherInitString() {
if (algName.equalsIgnoreCase("SkipJack")) {
return "SKIPJACK/CBC/PKCS5Padding";
} else if (algName.equalsIgnoreCase("TwoFish")) {
return "TWOFISH/CBC/PKCS5Padding";
} else if (algName.equalsIgnoreCase("Salsa20")) {
return "Salsa20"; // stream
} else {
return al... | 3 |
public void lifetimeQuery() throws UtilityException, MessageAttributeException, MessageHeaderParsingException, MessageAttributeParsingException, IOException {
try {
DatagramSocket socket = new DatagramSocket();
socket.connect(InetAddress.getByName(stunServer), port);
socket.setSoTimeout(timeout);
... | 8 |
public void actionPerformed(ActionEvent e) {
if (e.getSource() == valider) {
String err = null;
int note = Integer.parseInt(textNote.getText());
if (textNom.getText() == "")
err += "Le nom du fichier ne peut être nul<br />";
if (note < 0 || note > 10)
err += "La note doit être comprise entre 0 et ... | 5 |
public Command getCommand()
{
String inputLine; // will hold the full input line
String word1 = null;
String word2 = null;
System.out.print("> "); // print prompt
inputLine = reader.nextLine();
// Find up to two words on the line.
Scanner tokenizer =... | 3 |
@Override
public boolean equals(Object object){
if(object instanceof Editor){
Editor e = (Editor)object;
if(e.getId() == this.getId() && e.getNome().equals(this.getNome()) && e.getLogin().equals(this.getLogin()) && e.getSenha().equals(this.getSenha()) && e.getEmail().equals(this.getE... | 6 |
long zipDir(File zipDir, ZipOutputStream zos, String name, long count) throws IOException {
// Create a new File object based on the directory we have to zip
if (name.endsWith(File.separator))
name = name.substring(0, name.length() - File.separator.length());
if (!name.endsWith(Comp... | 9 |
public void auctionList() {
auctions.removeAll(auctions);
try {
Class.forName("com.mysql.jdbc.Driver");
} catch (ClassNotFoundException e) {
System.out.println("Where is your MySQL JDBC Driver?");
e.printStackTrace();
}
PreparedStatem... | 6 |
@Override
public boolean canBomb() {
if (tile == null) {
return false;
}
return bombs > 0 && tile.passable();
} | 2 |
public static void assign(String result, String exp, int[] offset) throws Exception{
if(result.equals("MP_FIXED")){
result = "MP_FLOAT";
}
if(exp.equals("MP_FIXED")){
exp = "MP_FLOAT";
}
if(result.equals(exp)) {
// do nothing
} else if(result.equals("MP_FLOAT") && exp.equals("MP_INTEGER")) {
bw.... | 7 |
public static String numberToString(Number number) throws JSONException {
if (number == null) {
throw new JSONException("Null pointer");
}
testValidity(number);
// Shave off trailing zeros and decimal point, if possible.
String string = number.toString();
if (string... | 6 |
protected boolean in_grouping(char [] s, int min, int max)
{
if (cursor >= limit) return false;
char ch = current.charAt(cursor);
if (ch > max || ch < min) return false;
ch -= min;
if ((s[ch >> 3] & (0X1 << (ch & 0X7))) == 0) return false;
cursor++;
return true;
} | 4 |
private void butLimpiarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_butLimpiarActionPerformed
File archivo = bean.getArchivoDeRegla();
bean = new FirenzeBean();
resultTextArea.setText("");
listaHechosInicio.setSelectedIndices(new int[0]);
if (ComboObjetivo.g... | 2 |
public static String encode(String value) {
String encoded = null;
try {
encoded = URLEncoder.encode(value, "UTF-8");
} catch (UnsupportedEncodingException ignore) {
}
StringBuffer buf = new StringBuffer(encoded.length());
char focus;
for (int i = 0; i < encoded.length(); i++) {
focus = encoded.char... | 8 |
public State tryMove(Move m) {
// copy the state
State newstate = new State(this);
if (newstate.applyMove(m))
return newstate;
// apparently, move was not succesful
return null;
} | 1 |
public boolean createMember(String passport, String name, String password, String postal, int phone, String email) {
Query q = em.createQuery("SELECT t from SHSMember t");
for (Object o : q.getResultList()) {
SHSMemberEntity p = (SHSMemberEntity) o;
if (p.getPersonId().equals(pa... | 2 |
@Before
public void putDataSelectionSort(){
a_selectionSort = new Integer[MAX];
for(int i = 0; i < MAX; ++i){
a_selectionSort[i] = i + 1;
}
shuffleIntArray(a_selectionSort);
} | 1 |
public Claire() {
super();
} | 0 |
public boolean execute(CommandSender sender, String[] args, String label) {
FileConfiguration messages = plugin.getMessageConfig();
final String badPageNum = messages.getString("info.warnings.badPage");
final String helpHeader = messages.getString("commands.help.alerts.header");
final S... | 9 |
public static List<Node> interpolate(short x0, short y0, short x1, short y1)
{
short sx, sy, dx, dy, pow, offset;
List<Node> line = new ArrayList<>();
dx = (short) Math.abs(x1 - x0);
dy = (short) Math.abs(y1 - y0);
sx = (short) ((x0 < x1) ? 1 : -1);
sy = (short) ((y... | 7 |
public ArrayList<Pos> getCanSetList(Stone color) {
ArrayList<Pos> retList = new ArrayList<Pos>();
Pos workPos = new Pos();
for (int y = Common.Y_MIN_LEN; y < Common.Y_MAX_LEN; y++) {
workPos.setY(y);
for (int x = Common.X_MIN_LEN; x < Common.X_MAX_LEN; x++) {
workPos.setX(x);
if (CanSet(workPos, c... | 3 |
public void destroy(String[] split)
{
if (split.length != 4)
{
PrintMessage(DESTROYSYNTAX);
return;
}
Player giver;
giver = getPlayer(split[1]);
if (giver==null)
{
PrintMessage(split[1] + " does not exist");
return;
}
try
{
int amount = new Integer(split[2]);
if (amount < 0... | 4 |
public static void main(String[] args) {
Scanner reader1 = new Scanner(System.in);
System.out.println(".: MAYOR MENOR O IGUAL :.");
String v_numero1;
String v_numero2;
do {
System.out.println("Ingrese el primer numero: ");
v_numero1 = reader1.next();
} while (isNumeric(v_numero1));
do {
S... | 5 |
public int getFlags() {
int flags = 0;
flags |= lastUpdatePresent ? 1 : 0;
flags |= (biomeArrayPresent ? 1 : 0) << 1;
flags |= (addBlockArrayPresent ? 1 : 0) << 2;
flags |= (blockLightPresent ? 1 : 0) << 3;
flags |= (skyLightPresent ? 1 : 0) << 4;
flags |= (tileTi... | 8 |
public void update(int Delta) {
if(preMode) {
if(diaryElapsedTime > diaryDELAY) {
preMode = false;
diaryElapsedTime = 0;
} else diaryElapsedTime += Delta;
} else {
if(elapsedTime > timer) {
Play.lf = true;
}
elapsedTime += Delta;
}
} | 3 |
public static int getOffsetY(int direction)
{
if((direction & SOUTH) != 0)
{
return -1;
}
if((direction & NORTH) != 0)
{
return 1;
}
return 0;
} | 2 |
@Override
public void in() throws Exception {
if (data == null) {
// throw new ComponentException("Not connected: " + toString());
if (log.isLoggable(Level.WARNING)) {
log.warning("@In not connected : " + toString() + ", using default value.");
}
... | 6 |
@Override
public List<Class<?>> getDatabaseClasses() {
ArrayList<Class<?>> classes = new ArrayList<Class<?>>();
classes.add(Faction.class);
classes.add(Member.class);
classes.add(PlayerReinforcement.class);
classes.add(ReinforcementKey.class);
classes.add(FactionMembe... | 3 |
public Node23(Node12 node, Key key, Value value)
throws DuplicateKeyException {
int cmp = key.compareTo(node.key1);
if (cmp < 0) {
this.key1 = key;
this.value1 = value;
this.key2 = node.key1;
this.value2 = node.value1;
} else if (cmp > 0) {
this.key1 = node.key1;
this.value1 = node... | 2 |
protected static Thread startChatServer(Thread chatServerThread, ServerInfo serverInfo) {
if (chatServerThread == null) {
ChatServer chatServer = new ChatServer(serverInfo, verbose);
log.info("CREATE chat server object");
chatServerThread = new Thread(chatServer);
log.info("CREATE thread for chat server o... | 1 |
public static void runFromBattle()
{
b1.addText("You try to run away...");
if(!BATTLE_TYPE.equals("WILD"))
{
b1.addText("No! There's no running from a Trainer battle!");
}
else
{
if(user[userIndex].speed>enemy[enemyIndex].speed)
{
b1.addText("Got away safely!");
BATTLE_OVER=true;
}
... | 3 |
private Node<K,V> lower( V value ) {
if(value == null)
return null;
Node<K,V> node = mRoot;
Node<K,V> ret = null;
if(mValueComparator != null) {
Comparator<? super V> comp = mValueComparator;
while(node != null) {
int... | 9 |
@Override
public boolean Shutdown() {
//TODO: Bye Bye =(
return true;
} | 0 |
public String getTrueLink( String url, String encode ) {
Document doc = null;
try {
//System.out.println(url);
doc = getDocument(url, encode);
//System.out.println(doc.toString());
if ( doc.toString().contains("location.replace") ) {
String... | 7 |
private static boolean tryPlacementAt(
Tile t, BotanicalStation parent, Plantation allots[],
int dir, boolean covered
) {
for (int i = 0 ; i < allots.length ; i++) try {
final Plantation p = allots[i] = new Plantation(
parent, i == 0 ? TYPE_NURSERY : (covered ? TYPE_COVERED : TYPE_BED),
... | 5 |
public ArrayList<ArrayList<Integer>> levelOrder(treeNode root) {
ArrayList<ArrayList<treeNode>> listLevelNodes = new ArrayList<ArrayList<treeNode>>();
ArrayList<ArrayList<Integer>> listLevelValues = new ArrayList<ArrayList<Integer>>();
int curLevel = 0;
if (root == null)
return listLevelValues;
// put ro... | 6 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
BaseLocation other = (BaseLocation) obj;
if (x != other.x)
return false;
if (y != other.y)
return false;
return true;
} | 5 |
public static void main(String[] args){
try{
BufferedReader in=null;
if(args.length>0){
in = new BufferedReader(new FileReader(args[0]));
}
else{
in = new BufferedReader(new InputStreamReader(System.in));
}
ArrayList<String> input = new ArrayList<String>();
String inp = in.readLine();
... | 6 |
public static NpcDefinition forId(int id) {
for (int i = 0; i < 20; i++) {
if (NpcDefinition.cache[i].type == id) {
return NpcDefinition.cache[i];
}
}
NpcDefinition.totalNpcs = (NpcDefinition.totalNpcs + 1) % 20;
NpcDefinition npc = NpcDefinition.cache[NpcDefinition.totalNpcs] = new NpcDefinition();
... | 2 |
public boolean occurs(Term term) {
for (Term arg : args) {
if (arg.equals(term)) {
return true;
}
}
return false;
} | 2 |
private boolean includedInReplaceOrAdd(String nodePath) {
for (String path : replaceChildrenTags) {
if (path.startsWith(nodePath)) {
return true;
}
}
for (String path : addChildrenTags) {
if (path.startsWith(nodePath)) {
return true;
}
}
return false;
} | 4 |
public List<ArgPosition> getArgPositionsForTerm(final Object term) {
if (this.equals(term)) {
return Collections.emptyList();
}
List<ArgPosition> result = new ArrayList<ArgPosition>();
ArgPosition curArgPosition = ArgPosition.TOP;
internalGetArgPositionsForTerm(term, this, curArgPosition, resu... | 1 |
private int searchName(String name, String password) throws SQLException {
conn.commit();
s = conn.createStatement();
rs = s.executeQuery("select NAME,PASSWORD from " + tableName
+ " ORDER BY NAME");
if (!rs.next()) {
return 3; // database empty
}
do {
if (rs.getString("NAME").equalsIgnoreCase(na... | 4 |
private MetricStrategyInterface chosenStrategy(String metricParam) {
MetricEnum m = MetricEnum.valueOf(metricParam);
switch (m) {
case ETX:
return new EtxStrategy();
case ETT:
return new EttStrategy();
case MTM:
return new MtmStrategy();
default:
return new HopStrategy();
}
} | 3 |
private String getLanguage(HashMap<String, Object> map) {
@SuppressWarnings("unchecked")
ArrayList<Object> langs = (ArrayList<Object>) map
.get("primaryLanguages");
if (langs == null || langs.isEmpty()) {
return null;
} else {
if (langs.size() > 1)
System.out.println("Multiple languages for course... | 3 |
public static void ReadMessageTypes_Properties()
{
if(!irc_properties_file.exists())
{
Utils.Warning("Could not find plugins/AprilonIrc/messagetypes.properties!");
return;
}
try
{
InputStream reader = new FileInputStream(messagetyp... | 2 |
public boolean removeShift(Shift shift)
{
boolean success = false;
if(shift.getEndTime() == null)
{
working = false;
currentShift = null;
success = true;
}
else{
for(int x = 0; x < shifts.size(); x++)
{
Shift temp = shifts.get(x);
if(temp == shift)
{
shifts.remove(x);
suc... | 3 |
public void run() {
while(true) {
try {
Socket client=null;//客户Socket
client=serverSocket.accept();//客户机(这里是 IE 等浏览器)已经连接到当前服务器
if(client!=null) {
System.out.println("连接到服务器的用户:"+client);
try {
... | 9 |
public Type getGeneralizedType(Type type) {
if (type.typecode == TC_RANGE)
type = ((RangeType) type).getTop();
return type;
} | 1 |
private static Map<String, List<?>> defaultValues( Map<String, AbstractOptionSpec<?>> recognizedSpecs ) {
Map<String, List<?>> defaults = new HashMap<String, List<?>>();
for ( Map.Entry<String, AbstractOptionSpec<?>> each : recognizedSpecs.entrySet() )
defaults.put( each.getKey(), each.getVa... | 6 |
@Override
public boolean equals(Object obj) {
if (obj instanceof UserEntity) {
UserEntity user = (UserEntity) obj;
return user.equals(this.username);
}
return false;
} | 1 |
public void tabulate(ArrayList<Response> resp){ //Takes a list of relevant responses for a question and displays all choices made
HashMap<String, ArrayList<Integer>> count = new HashMap<String, ArrayList<Integer>>();
HashMap<String, ArrayList<String>> s = null;
ArrayList<String> vals = null;
for (int i = 0; i ... | 9 |
final void method1716(boolean bool) {
if (bool != false)
method1736(-57);
anInt5880++;
if (((Class239) this).aClass348_Sub51_3136.method3422(674)
!= Class10.aClass230_186)
((Class239) this).anInt3138 = 1;
else if (((Class239) this).aClass348_Sub51_3136.method3425(-95))
((Class239) this).anInt313... | 5 |
public Admin adminLogin(String username, String password) {
Admin admin;
try {
admin = (Admin) this.em.createNamedQuery("findByUsername")
.setParameter("paramUsername", username).getSingleResult();
if (!admin.getPassword().equals(password)) {
throw new Exception();
}
} catch (Exception e) {
... | 2 |
public static void initDB() {
File dbFile = new File(Settings.DB_PATH);
if (!dbFile.exists())
DB.createDB();
} | 1 |
public void paintComponent (Graphics g) {
super.paintComponent(g);
// 共通する部分をはここで
g.setFont(mpFont);
g.setColor(Color.BLACK);
g.drawImage(backgroundImage, 0, 0, WIDTH, HEIGHT, this);
// labelの位置は変わらないので共通部分に
start.setLocation(WIDTH/2 - start.getWidth()/2, HEIGHT/... | 7 |
@EventHandler
public void SnowmanFastDigging(EntityDamageByEntityEvent event) {
Entity e = event.getEntity();
Entity damager = event.getDamager();
String world = e.getWorld().getName();
boolean dodged = false;
Random random = new Random();
double randomChance = plugin.getsnowgolemConfig().getDouble("Snowma... | 6 |
@Override
public void clearInventoryMoney(MOB mob, String currency)
{
if(mob==null)
return;
List<Item> clear=null;
Item I=null;
for(int i=0;i<mob.numItems();i++)
{
I=mob.getItem(i);
if((I instanceof Coins)
&&(((Coins)I).container()==null))
{
if(clear==null)
clear=new ArrayList<Item... | 9 |
public void tail(Node node, int depth) {
String name = node.nodeName();
if (name.equals("br"))
append("\n");
else if (StringUtil.in(name, "p", "h1", "h2", "h3", "h4", "h5"))
append("\n\n");
else if (name.equals("a"))
append(... | 3 |
@Override
public <T extends Comparable<T>> boolean hasElement(T element, T[] sortedArray) {
int high = sortedArray.length - 1;
int low = 0;
int pivot;
while (low <= high) {
pivot = low + (high - low) / 2;
System.out.println(pivot);
if (sortedArr... | 3 |
public String readLine()
{
String s = null;
try
{
s = myInFile.readLine();
}
catch (IOException e)
{
if (myFileName != null)
System.err.println("Error reading " + myFileName + "\n");
myErrorFlags |= READERROR;
}
if (s == null)
myErrorFlags |= EOF;
... | 3 |
public static void compareStats() throws ParameterException, ExpectationException, VarianceException {
int trials = 100000;
RandomVariable X = new t(6);
double sum = 0;
double sumSq = 0;
for(int i = 0; i < trials; i++) {
double obs = X.observe();
sum += obs;
sumSq += Math.pow(obs, 2);
System.out.p... | 1 |
public static <T extends DC> MSet<DC> dMax(Set<Pair<Pair<T,PT<Integer>>,Pair<T,PT<Integer>>>> phiMax)
{ if(phiMax!=null)
{ if(phiMax.getNext()!=null)
{ return new MSet(phiMax.getFst().fst().fst().delta(phiMax.getFst().snd().fst()).diff(),dMax(phiMax.getNext()));
}
else
{ return new MSet(ph... | 2 |
public static void main(String[] args) {
Connection con = null;
PreparedStatement pst = null;
ResultSet rs = null;
String url = "jdbc:mysql://MySQL55.marlborough.int:3306/MHS_News";
String user = "Android_Client";
String password = "bA55nAFA";
try {
... | 7 |
public boolean isContained(char axis) {
switch (axis) {
case 'x':
if (center.x - corner.x < -0.5f * model.getLength() || center.x + corner.x > 0.5f * model.getLength())
return false;
break;
case 'y':
if (center.y - corner.y < -0.5f * model.getWidth() || center.y + corner.y > 0.5f * model.getWidth())
... | 9 |
public boolean host(Lobby alobby) {
this.lobby = alobby;
waitforclient = true;
ishost = true;
try {
serverSocket = new ServerSocket(port);
} catch (IOException ex) {
System.out.println(ex.getMessage());
return false;
}
System.ou... | 1 |
void releaseChildren(boolean destroy) {
if (items != null) {
for (int i = 0; i < itemCount; i++) {
TableItem item = items[i];
if (item != null && !item.isDisposed()) {
item.release(false);
}
}
items = null;
}
if (columns != null) {
for (int i = 0; i < columnCount; i++) {
TableColu... | 8 |
@Override
public void takeInfo(InfoPacket info) throws Exception {
if(!getFailed()){
super.takeSuperInfo(info);
Iterator<Pair<?>> i = info.namedValues.iterator();
Pair<?> pair = null;
Label label = null;
while(i.hasNext()){
pair = i.next();
label = pair.getLabel();
switch (label){
case... | 8 |
void checkNextProt(String genomeVer, String vcfFile, String effectDetails, EffectImpact impact) {
String args[] = { "-classic", "-v", "-nextProt", genomeVer, vcfFile };
SnpEff cmd = new SnpEff(args);
// Run
SnpEffCmdEff cmdEff = (SnpEffCmdEff) cmd.snpEffCmd();
List<VcfEntry> vcfEntries = cmdEff.run(true);
... | 5 |
public SubmitException(Result result){
this.result=result;
} | 0 |
public void visit_invokestatic(final Instruction inst) {
final MemberRef method = (MemberRef) inst.operand();
final Type type = method.nameAndType().type();
stackHeight -= type.stackHeight();
if (stackHeight < minStackHeight) {
minStackHeight = stackHeight;
}
stackHeight += type.returnType().stackHeigh... | 1 |
private BeaconState readBeacon( InputStream in ) throws IOException {
BeaconState beacon = new BeaconState();
boolean visited = readBool(in);
beacon.setVisited(visited);
if ( visited ) {
beacon.setBgStarscapeImageInnerPath( readString(in) );
beacon.setBgSpriteImageInnerPath( readString(in) );
beacon.... | 7 |
public double findMedianSortedArrays_3(int A[], int B[]){
int a = A.length;
int b = B.length;
if(a == 0){
if ((b & 1) == 1) return findKthSortedArrays(A, 0, B, 0, b/2+1);
else return (findKthSortedArrays(A, 0, B, 0, b/2+1) + findKthSortedArrays(A, 0, B, 0, b/2))/2.0;
}else if... | 5 |
public List<Item> zoekAlleItems()
{
List<Item> items = new ArrayList<>();
try (Connection conn = DriverManager.getConnection(JDBC_URL)) {
PreparedStatement queryAlleItems = conn.prepareStatement("SELECT * FROM ITEM");
try (ResultSet rs = queryAlleItems.executeQuery()) {
... | 3 |
public void close() {
if(running == true) {
running = false;
System.out.println("TCP Thread closed");
}
} | 1 |
private void generatePossibleTests() throws CloneNotSupportedException {
boolean randomGeneration = possibleTestsCount != 0;
if (possibleTestsCount == 0) {
possibleTestsCount = getPossibleTestsNumber(sizes);
}
if (possibleTestsCount > Integer.MAX_VALUE) {
throw ... | 7 |
void bufferAttribute(final char[] buffer,
final int nameOffset, final int nameLen,
final int nameLine, final int nameCol,
final int operatorOffset, final int operatorLen,
final int operatorLine, final int operatorCol,
... | 7 |
@SuppressWarnings("serial")
public Object readResolve() throws ObjectStreamException {
try {
ClassLoader cl = JMSRemoteSystem.INSTANCE.getUserClassLoader(this);
Class<?> superclass = cl.loadClass(this.superclass);
Class<?>[] interfaces = null;
... | 7 |
public void run() {
try {
BufferedReader in = new BufferedReader(
new InputStreamReader(socket.getInputStream()));
PrintWriter out = new PrintWriter(socket.getOutputStream(), true);
while (isRunning) {
String input = in.readLine();
... | 4 |
public double getIntencity() {
return intencity;
} | 0 |
protected JButton retrieveButton(int f) {
switch (f) {
case 1:
return a1Button;
case 2:
return a2Button;
case 3:
return a3Button;
case 4:
return a4Button;
case 5:
return a5... | 9 |
public static String getTypeName(Configuration config,
ClassDoc cd, boolean lowerCaseOnly) {
String typeName = "";
if (cd.isOrdinaryClass()) {
typeName = "doclet.Class";
} else if (cd.isInterface()) {
typeName = "doclet.Interface";
} else if (cd.isExceptio... | 7 |
private int findNearest(int value, int partition) {
return value/partition;
} | 0 |
public void addBlockHitEffects(int var1, int var2, int var3, int var4) {
int var5 = this.worldObj.getBlockId(var1, var2, var3);
if(var5 != 0) {
Block var6 = Block.blocksList[var5];
float var7 = 0.1F;
double var8 = (double)var1 + this.rand.nextDouble() * (var6.maxX - var6.minX - (d... | 7 |
public void CombatEventOccurred(CombatEvent e) {
switch (e.getAttackType()) {
case Melee:
case Ranged:
if (e.isSuccess()) {
gameLogger.append(((Entity)e.getAttacker()).getName() +
" inflicts " + e.getDamage() + " damage to " +
((Entity)e.getAttacked()).getName(... | 7 |
public boolean isSimple(List<Point> vertices) {
if (vertices == null || vertices.size() < 3) {
return false;
}
List<Segment> segments = new ArrayList<Segment>(vertices.size());
Point last = vertices.get(vertices.size() - 1);
for (int i = 0; i < vertices.size(); i++) ... | 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.