text stringlengths 14 410k | label int32 0 9 |
|---|---|
private static Statistic generateStatistic(int duration, int rightCount, int mistakeCount) {
DateTime start = new DateTime();
Date startTime = start.toDate();
Date finishTime = start.plusSeconds(duration).toDate();
Statistic statistic = new StatisticImpl();
statistic.setStartTim... | 2 |
@Test
public void hahmonPutoaminenPysahtyyEsteeseenAlkeellisesti() {
int hahmonKoordinaattiAlussa = pe.getY();
t.lisaaEste(e);
for (int i = 0; i < 200; i++) {
pe.eksistoi();
}
assertTrue("Hahmo ei pysähtynyt esteesen vaan jatkoi y = "
+ pe.getY(),... | 1 |
public ArrayList<Integer> getRow(int rowIndex) {
ArrayList<Integer> res = new ArrayList<Integer>();
if (rowIndex < 0)
return res;
int[] pre = new int[rowIndex + 1];
int[] cur = new int[rowIndex + 1];
for (int i = 0; i <= rowIndex; i++) {
if (i == 0) {
cur[0] = 1;
... | 8 |
public static Direction getDir(int i) {
switch (i) {
case 0:
return TOP_LEFT;
case 1:
return TOP;
case 2:
return TOP_RIGHT;
case 3:
return BOT_RIGHT;
case 4:
return BOT;
... | 6 |
private static void drawOcean(Graphics graphics, Ocean ocean) {
if (ocean != null) {
int width = ocean.width();
int height = ocean.height();
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
int contents = ocean.cellContents(x, y);
if (contents == Oc... | 5 |
@Override
public int read() throws IOException {
synchronized (this) {
if(streamClosed){
throw new IOException();
}
}
//test if the available input has reached its end
//and the EOS should be returned
if((str != null && pos == str.length())){
str =null;
return java.io.StreamTokenizer.TT_E... | 8 |
public void sampling () {
int z = 0;
int N = 0;
int wordId = 0;
float probZ [] = new float [K];
double probZ_ = 0.0;
double probSum = 0.0;
Random random = new Random ();
//Iter
for (int it=0;it<iter;++it) {
System.out.println ... | 7 |
private static int countSpace(String s){
int t=0;
for(int i=0; i < s.length(); i++) {
if(s.charAt(i) == ' ') {
t++;
if ((i>0)&&(s.charAt(i-1)==' ')){
t--;
}//count result from "asd asdsd asdasd" must be 2
... | 4 |
@Before
public void setUp() throws Exception {
view = new MainWindowView();
view.addPropertyChangeListener(this);
controller.addView(view);
propertyChangeSupport.addPropertyChangeListener(controller);
} | 0 |
public void mouseMoved(MouseEvent e) {
if( e.getX() >= 5 && e.getX() <= 45 && e.getY() >= 5 && e.getY() <= 45){
this.returnBtnFlag = true ;
}else{
this.returnBtnFlag = false ;
}
} | 4 |
public static TextBuffer jmpWrapper(Statement stat, int indent, boolean semicolon, BytecodeMappingTracer tracer) {
TextBuffer buf = stat.toJava(indent, tracer);
List<StatEdge> lstSuccs = stat.getSuccessorEdges(Statement.STATEDGE_DIRECT_ALL);
if (lstSuccs.size() == 1) {
StatEdge edge = lstSuccs.get(0)... | 9 |
public void replaceWithLargerNeighbor()
{
// TODO: Replace all but the first and last elements with the larger of its to neighbors
if (list.size() == 0)
{
}
else
{
for (int i = 1; i < list.size()-1; i++)
{
String current = list.get(i);
String prev = list.g... | 4 |
private void loadLine() throws InputExeption {
try {
// 現在位置を初期化
position = 0;
lineNo += 1;
// 行バッファをクリアする
lineBuff.setLength(0);
// 繰り返し処理
while (!closed) {
// 次の文字を取得
final int c0 = reader.read();
// 文字のコード値が-1であるかどうか判定
if (c0 == -1) {
// 文字のコード値が−1ならストリームの終了
// ストリームを... | 9 |
public void testToLocalDateTime_nullLocalTime() {
LocalDate base = new LocalDate(2005, 6, 9, COPTIC_PARIS); // PARIS irrelevant
try {
base.toLocalDateTime((LocalTime) null);
fail();
} catch (IllegalArgumentException ex) {
// expected
}
} | 1 |
public ModelHandler()
{
Models = new HashMap<String, Model>();
Grizzly.GrabDatabase().SetQuery("SELECT * FROM server_room_models");
try
{
ResultSet Results = Grizzly.GrabDatabase().GrabTable();
while (Results.next())
{
Models.put(Results.getString("id"), new Model(Results));
}
}
... | 2 |
private InputStream getCorrectInputStream() throws IOException {
// if in cached mode use the tmp file
if (isCached) {
if (tempFile != null) {
// initiate a new input stream in needed
if (fileInputStream == null) {
fileInputStream = new Fil... | 5 |
public static void main(final String[] args) throws LWJGLException,
IOException
{
System.setProperty("org.lwjgl.util.Debug", "true");
Display.setDisplayMode(new DisplayMode(800, 600));
Display.setResizable(true);
Display.create();
final Shader vertexShader = Shader
.buildShader(
"C:\\Users\\Ad... | 5 |
private boolean read () {
String reply = null;
if (socket != null) {
try {
/* Await reply */
reply = b.readLine();
} catch (IOException ignored) {}
}
if (reply == null)
return false;
return ((reply.equals("OK")) ? true : false);
} | 4 |
private static boolean clearBuilder(StringBuilder builder, List<Token> tokens,
File sourceDir, String sourceFile, int lineNumber)
throws TokenizeError {
if(builder.length() > 0) {
tokens.add(createToken(builder.toString(), sourceDir, sourceFile, lineNu... | 1 |
static private void addBadColor(Integer a, Integer b,TreeMap<Integer, TreeSet<Integer> > noeuds)
{
TreeSet<Integer> tmp = noeuds.get(a);
if(tmp == null)
{
tmp = new TreeSet<Integer>();
}
tmp.add(b);
noeuds.put(a, tmp);
} | 1 |
public void setDateFrom(Date dateFrom) {
this.dateFrom = dateFrom;
} | 0 |
public static void checkNearRideable(Player p) {
RideThaMob.player.add(p.getName());
List<Entity> l = new ArrayList<Entity>();
for (int i = 1; i < (RideThaMob.pl.getConfig().getInt(
"entity_check_radius") + 1); i++) {
l = p.getNearbyEntities(i, i, i);
if (!l.isEmpty()) {
for (Entity e : l) {
if... | 8 |
public int[] getArray(BufferedImage image, int x, int y) {
int[] n; // store the pixel values of position(x, y) and its neighbors
int h = image.getHeight();
int w = image.getWidth();
int xmin, xmax, ymin, ymax; // the limits of the part of the image on
// which the filter operate on
xmin = x - size /... | 6 |
public static final void main(String[] args) {
Scanner in = new Scanner(System.in);
int testCases = in.nextInt();
while (testCases > 0) {
maxChoc(in.nextInt());
testCases--;
}
} | 1 |
public Object next() {
Ball ball = ballContainer.getBallAt(index);
index++;
return ball;
} | 0 |
public static int strSearchKMP(String subS, String longS){
int[] next = new int[subS.length()];
for (int i = 0;i<subS.length();i++){
String t = subS.substring(0,i+1);
next[i]=t.length();
int j = t.length()-1;
while(j>0){
String prefix =t.substring(0, j);
String suffix = t.substring(t.length() - ... | 9 |
final int[][] method1274(int i, int j) {
if (j != 6) {
return null;
}
int ai[][] = super.aClass112_3320.method1036(j ^ 0xffffff9c, i);
if (super.aClass112_3320.aBoolean1822) {
int k = Class117.anInt1861 / anInt4074;
int l = Class142_Sub27_Sub11.anInt48... | 5 |
public long getDateLength() {
if (this.getPayloadLenExtendedContinued() > 0){
return this.getPayloadLenExtendedContinued();
}
if (this.getPayloadLenExtended() > 0){
return this.getPayloadLenExtended();
}
if (this.getPayloadLen() == HAS_EXTEND_DATA || this.getPayloadLen() == HAS_EXTEND_DATA_CONTINUE){... | 4 |
private boolean validatePath(ExchangeTestbed.Case CASE, String path, boolean isLocal) {
String result;
if (isLocal) {
result = ExchangeTestbed.expectedLocalPath(CASE);
} else {
result = ExchangeTestbed.expectedRemotePath(CASE);
}
return path.compareTo(resu... | 1 |
public int compareTo(Object o) {
int result;
int major;
int minor;
int revision;
int [] maj = new int [1];
int [] min = new int [1];
int [] rev = new int [1];
// do we have a string?
if (o instanceof String) {
parseVersion((Str... | 7 |
public HashSet<Integer> getUsed() {
Config data = Server_Loader.data;
String tries = data.getString(id + "#BadTries");
String solved = data.getString(id + "#Solved");
HashSet<Integer> used = new HashSet();
if(tries != null && !tries.equals("")) {
String[] args = tries... | 8 |
protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
int ID_Membre_Courant = Integer.parseInt(request.getParameter(ParametresServlet.ID_Membre_Courant));
int NumExpPro_Courante = Integer.parseInt(request.getParameter("NumExpPro_Courante"));
Stri... | 9 |
public void SelectEndState(){
Random Rand = new Random();
int StateIndex = Rand.nextInt(getNumStates());
Iterator<GameState> i = AllStates.iterator();
int n = 0;
while(i.hasNext()){
i.next();
if(n == StateIndex){
// state is chosen
} else { //state was not chosen, and is removed.
i.remove();... | 2 |
public void populate_with_dummy(){
try{
Connection connection = DriverManager.getConnection(connectionString);
Statement s = connection.createStatement();
s.executeUpdate("CREATE TABLE ingredient(id integer primary key, name text)");
s.executeUpdate("CREATE TABLE parent(idIngredient integer, idParent inte... | 1 |
public int tLineCount(){
int tline = condition.tLineCount() + truePart.tLineCount() + 2;
if(falsePart != null)
tline += falsePart.tLineCount() + 1;
return tline;
} | 1 |
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 static String convertToInt(String s)
{
for(Season se : Season.values())
{
if(se.toString().equals(s))
{
return String.valueOf(se.getSeasonInt());
}
}
//Checks if it is an, if so returns the string
try{
return String.valueOf(Integer.valueOf(s));
}
catch(NumberFormatException e)
{
... | 3 |
public Element getNewElement(Point2D startPt, Point2D endPt) throws NoShapeChosenException {
switch (shapeSelector) {
case 1:
return new Room(startPt, endPt, win.getSelectedMaterial());
case 2:
return new Wall(startPt, endPt, win.getSelectedMaterial());
case 3:
... | 4 |
boolean checkMyType(Object object) {
if (object == null || !(object instanceof MyType[]) || ((MyType[])object).length == 0) return false;
MyType[] myTypes = (MyType[])object;
for (int i = 0; i < myTypes.length; i++) {
if (myTypes[i] == null ||
myTypes[i].firstName == null ||
myTypes[i].firstName.length() =... | 9 |
public void advanceTo(String contig, int pos) {
//Advance to wholly new site
//Expand leading edge until the next record is beyond target pos
advanceToContig(contig);
if (pos > contigMap.get(contig)) {
throw new IllegalArgumentException("Contig " + contig + " has only " + contigMap.get(contig) + " base... | 7 |
private void menuDeleteBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuDeleteBoxActionPerformed
PokemonBox box = (PokemonBox)listBoxes.getSelectedValue();
int option = JOptionPane.showConfirmDialog(this, "Are you sure you want " +
" to delete " + box.getName() +... | 7 |
@Override
public boolean canAttack(Board board, Field currentField, Field occupiedField) {
return this.validSetupForAttack(currentField, occupiedField) && inSameRankOrFile(currentField, occupiedField) && board.clearPathBetween(currentField, occupiedField);
} | 2 |
@Override
public boolean onCommand(CommandSender sender, Command bukkitCommand, String label, String[] arguments) {
if (arguments.length == 0) {
displayUnknownCommand(sender, label);
return true;
}
AbstractCommand<P> command = commands.get(arguments[0].toLowerCase());
if (command == null) {
displayUnk... | 6 |
public void displayReflection(int img[][]) {
for (int i = 0; i < img.length; i++) {
for (int j = 0; j < img[i].length; j++) {
//---- Top ---//
if (i == 0) {
int a = i+2;
if(a>9) a=9;
System.out.format("%3d... | 9 |
private void reset() {
for (FileRequest request : waiting.values()) {
requests.offer(request);
}
waiting.clear();
try {
socket.close();
} catch (IOException ioex) {
ioex.printStackTrace();
}
socket = null;
input = null;
output = null;
current = null;
lastUpdate = 0;
} | 2 |
public static void main(String args[]) {
JobTestClient jobClient = new JobTestClient();
try {
jobClient.run();
} catch (IOException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
MetaDataNodeForHtt... | 4 |
public void giveAP(double amount) {
for (int c = 0; c < active_actors.size(); c++) {
Actor a = active_actors.get(c);
a.giveAP(amount);
}
} | 1 |
@Override
protected void update(float delta) {
if (mInput.action() && !start) {
mCodeoutput.setText(mCode.getCode());
start = true;
updateOutput();
Timer.schedule(task, 1f, 1f);
}
if ((mCode.isFinished() || mRemainingTime <= 0) && !mDoneHandle... | 6 |
public void generateTable(int precision){
sin = new double[precision];
cos = new double[precision];
tan = new double[precision];
for(int i = 0; i < precision; i++){
double theta = (((double)i) / ((double)precision)) * tau;
sin[i] = Math.sin(theta);
c... | 2 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Bairro other = (Bairro) obj;
if (!Objects.equals(this.idBairro, other.idBairro)) {
return fal... | 3 |
public static void main(String... args) throws InterruptedException {
final CountDownLatch countDownLatch = new CountDownLatch(1000);
ExecutorService service = Executors.newFixedThreadPool(5);
for (int i__ = 0; i__ < 1000; i__++) {
Callable<Void> task = new Callable<Void>() {
... | 1 |
public void setValue(ELContext context, Object base, Object property, Object value) {
if ((base == null) || (property == null)) {
return;
}
context.setPropertyResolved(true);
FacesContext fcontext = (FacesContext) context.getContext(FacesContext.class);
ELContext el... | 6 |
public void getNextPosition() {
if (left) {
dx -= moveSpeed;
if (dx < -maxSpeed) {
dx = -maxSpeed;
}
} else if (right) {
dx += moveSpeed;
if (dx > maxSpeed) {
dx = maxSpeed;
}
}
if (falling && !isFlightEnabled) {
dy += fallSpeed;
}
} | 6 |
@SuppressWarnings("static-access")
private void manejarRequest() throws UnknownHostException, IOException {
PaqueteDHCP data = new PaqueteDHCP();
String TempIP = new String();
byte[] unicast = null;
// Ingresamos valores al data para hacer el DHCPACK
OpcionDHCP opServ = pack.existInOption(54);
if (opServ... | 9 |
public static BigInteger K(byte[] s, byte[] w) {
BigInteger base = BigInteger.valueOf(s.length);
BigInteger sum = BigInteger.ZERO;
for (int i = 0; i < w.length; i++) {
BigInteger value = BigInteger.valueOf(ConCh.indexOf(s, w[i]));
sum = sum.add(value.multiply(bas... | 1 |
@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 String multiply(String first, String second) {
int l1 = first.length();
int l2 = second.length();
// Base Condition 1
if (l1 == 0 || l2 == 0) {
return "";
}
// Base Condition 2
if (l1 == 1 && l2 == 1) {
int result = atoi(fir... | 6 |
@Override
public void Update(int delta, Input input) {
mx = input.getMouseX();
my = input.getMouseY();
if (input.isKeyPressed(Input.KEY_NUMPAD0)) {
renderGround = !renderGround;
}
if (input.isKeyPressed(Input.KEY_NUMPAD1)) {
renderObjects = !renderObjects;
}
if (input.isKeyPressed(Input.KEY_NUMPAD... | 3 |
private void rotateLeft(Entry<K,V> p) {
Entry<K,V> r = p.right;
p.right = r.left;
if (r.left != null)
r.left.parent = p;
r.parent = p.parent;
if (p.parent == null)
root = r;
else if (p.parent.left == p)
p.parent.left = r;
else
... | 3 |
public static List<ConnectedPair> list(String fileName) {
assert fileName != null;
List<ConnectedPair> pairs = new ArrayList<ConnectedPair>();
File file = new File(fileName);
try {
FileReader fileReader = new FileReader(file);
BufferedReader reader = new Buf... | 4 |
public static String install(String forgeUrl, boolean isServer)
throws IOException, ClassNotFoundException, NoSuchMethodException,
IllegalAccessException, InvocationTargetException {
String forgeFileName = UrlUtils.fileName(forgeUrl);
String forgeVersionId = null;
if (!isServer) {
forgeVersionId = Minec... | 9 |
@Override
public void handleMouse(int posX, int posY, int flag) {
if (!enabled) return;
this.flag = flag;
if (flag == 2 && clickEvent != null) clickEvent.trigger();
} | 3 |
@Override
public void apply(Object targetEntity, Object value) {
try {
if (value instanceof String && f.getType().isEnum()) {
value = QueryBuilder.enumValueOf(f.getType(), (String)value);
}
if (value instanceof BigDecimal && (f.getType().equals(Integer.class) || f.getType().equals(Integer.TYPE))) {
... | 9 |
public static void main(String[] args) throws IOException, ParseException {
BibleContentTw bc = new BibleContentTw();
// bc.makeTextbook();
String str = bc.getSqlStatement();
bc.createSQL(str);
// System.out.println(str);
} | 0 |
public boolean is2byte() {
char c = currentChar();
return c == 'D' || c == 'J';
} | 1 |
private void init(List<FileItem> inputItems) {
Map<String, List<String>> map = new HashMap<String, List<String>>();
for (FileItem item : inputItems) {
if (item.isFormField()) {
List<String> currentValues = map.get(item.getFieldName());
if (currentValues == null) {
currentValues = new ArrayList<Stri... | 5 |
public void dumpTweets() throws IOException {
BufferedWriter fileWriter = new BufferedWriter(new FileWriter(IndexConfig.statLoc + File.separator + "tweets.txt"));
for( Long rootId : roots ) {
Stack<Pair<Long,Integer>> s = new Stack<Pair<Long,Integer>>();
s.add(new Pair<Long, ... | 5 |
@Override
public boolean equals(Object obj)
{
if (this == obj)
{
return true;
}
if (obj == null)
{
return false;
}
if (!(obj instanceof Bigram))
{
return false;
}
Bigram other = (Bigram) obj;
... | 9 |
private String createCompareRecordsMethod( String variable ) {
StringBuilder sb = new StringBuilder();
sb.append( "\n\n" + TAB + "public static void compareRecords( " + variable + " " + toJavaCase( variable )
+ ", " + variable + " readRecord ) {\n\n" );
for ( Column column : ta... | 6 |
@Override
public void startSetup(Attributes atts) {
super.startSetup(atts);
addActionListener(this);
Outliner.documents.addOutlinerDocumentListener(this);
Outliner.documents.addDocumentRepositoryListener(this);
Outliner.documents.addTreeSelectionListener(this);
setEnabled(false);
} | 0 |
@Override
public void actionPerformed(ActionEvent e) {
if (messagesQueue.size() == 0)
{
messageDelay.stop();
activeDelay = 1;
}
else
{
String channel = addHash(messagesQueue.get(0).split(" ", 2)[0]);
if (!acebotCore.getChannel(c... | 3 |
public boolean enchantItem(EntityPlayer par1EntityPlayer, int par2)
{
ItemStack var3 = this.tableInventory.getStackInSlot(0);
if (this.enchantLevels[par2] > 0 && var3 != null && (par1EntityPlayer.experienceLevel >= this.enchantLevels[par2] || par1EntityPlayer.capabilities.isCreativeMode))
{... | 7 |
public int compareTo( Object obj ) {
if( obj == null ) {
return( 1 );
}
else if( obj instanceof GenKbSecSessionByStartIdxKey ) {
GenKbSecSessionByStartIdxKey rhs = (GenKbSecSessionByStartIdxKey)obj;
if( getRequiredSecUserId() < rhs.getRequiredSecUserId() ) {
return( -1 );
}
else if( getRequired... | 9 |
final void imc_addkey(PACKET p, String key, String value)
{
for(int i = 0; i < value.length(); i++)
{
if(value.substring(i, i+1).equals("\""))
{
String tmp = value.substring(0, i);
tmp = tmp.concat("\\\"").concat(value.substring(i+1, value.length()));
value = tmp;
i++;
}
}
for (int i... | 9 |
public static void main(String[] args) {
String datamodel = args[0];
String testfile = args[1];
String predictionsOutput = args[2];
DataModel model = null;
try {
model = new FileDataModel(new File(datamodel));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
re... | 8 |
public Device hasDevice(String type) {
Device targetDevice = deviceFactory(type, 0);
for (Device device : deviceList) {
if(device.equals(targetDevice) && device.getAmount()>0) return device;
}
return null;
} | 3 |
static void crossValidationRandomForest(String inputFileNameX, String inputFileNameY) {
ArrayList<Sample> allSamples = Parser.parse(inputFileNameX, inputFileNameY);
System.out.println("Random Forest");
int[] numTrees = {80,100};
double[] numSubSampleRatios = {0.8, 0.85};
double[] numFeaturesRatios = {0.2, 0.3... | 7 |
public static DefaultListModel RefreshList (DefaultListModel listobjects){
listobjects.removeAllElements();
// Generate state of buttons.
if (Globals.ListTypeControl == 0) { // CUSTOMER
for (int i = 0 ;i < Globals.ATA.CustomerArray.length; i++){
listobjects.addElement(
"ID: " + ... | 8 |
@Override
public void keyReleased(KeyEvent ke) {
switch (ke.getKeyCode()) {
case KeyEvent.VK_UP:
keyState[KeyCode.UP.ordinal()] = false;
break;
case KeyEvent.VK_DOWN:
keyState[KeyCode.DOWN.ordinal()] = false;
break;
case KeyEvent.VK_LEFT:
keyState[KeyCode.LEFT.ordinal()] = false;
b... | 8 |
public int getY() {
return this.y;
} | 0 |
@Override
public boolean hasNext() {
if (reader == null) return false;// No input stream?
if (!seqReady) {
seqReady = readSeq(); // Try reading a sequence.
// End of file or any problem? => Close file
if (seqReady == false) close();
}
return seqReady;
} | 3 |
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(br.readLine());
int n = Integer.parseInt(st.nextToken());
int m = Integer.parseInt(st.nextToken());
int s =... | 9 |
public void dispose() {
if (namesAndValues != null) {
namesAndValues.clear();
namesAndValues.trimToSize();
}
if (kidsReferences != null) {
kidsReferences.clear();
kidsReferences.trimToSize();
}
if (kidsNodes != null) {
k... | 3 |
private String getXmlStringFromUrl(String urlStr) throws Exception {
URL url = new URL(urlStr);
BufferedReader reader = null;
StringBuffer xmlStr = new StringBuffer();
try {
reader = new BufferedReader(new InputStreamReader(url.openStream()));
String temp = null;
... | 2 |
@Override
public void run() {
String CurLine = ""; // Line read from standard in
String[] line = null;
String args = null;
String cmd = null;
System.out.println("Neuronales Netz gestartet... Es sind folgende Kommandos aktiv:");
printCommandList(); // Geladene Kommandos ausgeben
InputStreamReader conv... | 4 |
@EventHandler
public void CaveSpiderNightVision(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.getCaveSpiderConfig().getDouble("Ca... | 6 |
public Socket connectSocket(Socket sock, String host, int port, InetAddress localAddress, int localPort, HttpParams params)
throws IOException, UnknownHostException, ConnectTimeoutException
{
int connTimeout = HttpConnectionParams.getConnectionTimeout(params);
int soTimeout = HttpConnectionParams.getSoTimeout(p... | 4 |
public static AccountsField getFieldFromAbbreviation(String a)
{
for (AccountsField field : AccountsField.values())
{
if (field.toString().equals(a))
{
return field;
}
}
return null;
} | 2 |
private void parseLine(final String line)
throws IllegalInstructionException {
final String[] lineParts = line.split("[\\s]");
if (lineParts.length > 0) {
try {
this.commandWord =
CommandWord.valueOf(lineParts[0].toUpperCase());
} cat... | 8 |
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
// start DB transaction by opening it
boolean connectSuccess=Helper.openConnection();
// connection successful - proceed
if(connectSuccess)
{
// get the res... | 7 |
public void visitTableSwitchInsn(
final int min,
final int max,
final Label dflt,
final Label[] labels)
{
minSize += 13 + labels.length * 4;
maxSize += 16 + labels.length * 4;
if (mv != null) {
mv.visitTableSwitchInsn(min, max, dflt, labels);
... | 1 |
public static int discrete(double[] a) {
double EPSILON = 1E-14;
double sum = 0.0;
for (int i = 0; i < a.length; i++) {
if (a[i] < 0.0) throw new IllegalArgumentException("array entry " + i + " is negative: " + a[i]);
sum = sum + a[i];
}
if (sum > 1.0 + EP... | 7 |
public String computeHash(String serverid, byte[] sharedSecret, byte[] serverPublicKey ) {
String resulthash = "";
MessageDigest md;
try {
md = MessageDigest.getInstance("SHA1");
md.update(serverid.getBytes());
md.update(sharedSecret);
md.update(serverPublicKey);
byte[] hash = md.digest()... | 6 |
private void loadLocalConfig() throws StagingException {
Map<URI, SharedStagingArea> localAreas = new HashMap<URI, SharedStagingArea>();
this.areas.put(LOCAL_CONFIG_URL, localAreas);
try {
JsonNode rnode;
ObjectMapper om = new ObjectMapper();
rnode = om.readTree(this.localConfig);
if (rnode.has("custo... | 8 |
public List<DicCat> getCatList()
{
List<DicCat> catList = null;
BufferedReader br = null;
try {
br = new BufferedReader(new InputStreamReader(new FileInputStream("naver_cat_all.txt"), "utf-8"));
String line = null;
DicCat cat = null;
Hashtable<String, DicCat> catMap = new Hashtable<String, DicCat>()... | 8 |
public String getBICString() {
Iterator<BankAccount> it = accountsList.iterator();
StringBuilder builder = new StringBuilder();
if(it.hasNext()){
String bic = it.next().getBic();
builder.append(bic!=null?bic : "");
}
while(it.hasNext()){
String... | 4 |
private static void writeInput(int input, PrintWriter out) throws IOException {
out.print("|");
out.print((input & Move.RESET) != 0 ? "P" : ".");
out.print("|");
out.print((input & Move.UP) != 0 ? "U" : ".");
out.print((input & Move.DOWN) != 0 ? "D" : ".");
out.print((input & Move.LEFT) != 0 ? "L" : ".");
... | 9 |
public List<BipolarQuestion> getResponseBipolarList(String oppositeFileName, String teamType) {
List<BipolarQuestion> bipolarQuestionList = new ArrayList<BipolarQuestion>();
Element bipolarQuestionE;
BipolarQuestion bipolarQuestion;
BipolarQuestionDao parentBipoarQuestion = new BipolarQuestionDao(oppositeFil... | 4 |
public static long readHello(DataInputStream in, boolean writableExpected) throws IOException
{
long helloMagic1 = in.readLong();
if(helloMagic1 != 0x4E42444D41474943L) // NBDMAGIC
throw new RuntimeException(String.format("not NBDMAGIC: 0x%x", helloMagic1));
long helloMagic2 = in.readLong();
if(helloMagic... | 8 |
private void initComponents()
{
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 575, 260);
JMenuBar menuBar = new JMenuBar();
setJMenuBar(menuBar);
JMenu jMenuFile = new JMenu("File");
menuBar.add(jMenuFile);
JMenuItem jMenuItemClear = new JMenuItem("Clear");
jMenuFile.add... | 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.