text stringlengths 14 410k | label int32 0 9 |
|---|---|
@EventHandler
public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent e)
{
String[] split = e.getMessage().split(" ");
if(!split[0].equalsIgnoreCase("/me")) return;
e.setCancelled(true);
String message = Utils.ArrayToString(split, 1, 0);
String message_labeled ... | 5 |
public void accelerate() {
double accelRate = baseAccelRate;
double currentMagnitude = Math.sqrt(dx*dx + dy*dy);
if (isBoosting) {
accelRate *= 2;
} else if (this instanceof Ship && currentMagnitude < accelRate) {
// If currently travelling slowly, then ... | 7 |
final int[] method1275(int i, boolean flag) {
int ai[] = super.aClass18_3308.method210(i, flag);
if (super.aClass18_3308.aBoolean359) {
int j = Class129.anIntArray2049[i];
int k = -2048 + j >> 1;
for (int l = 0; l < Class117.anInt1861; l++) {
int j1 = ... | 6 |
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((level == null) ? 0 : level.hashCode());
result = prime * result + ((model == null) ? 0 : model.hashCode());
result = prime * result + ((version == null) ? 0 : version.hashCode());
result = prime * result + (... | 4 |
private String getPattern() {
if ((config.getPattern() != null) || (config.getPattern().isEmpty())) return config.getPattern();
else return "%23.23d{dd.MM.yyyy HH:mm:ss.SSS} %-5p [%t] %-8.8x %c ==>> %m%n";
} | 2 |
public void writeTo(Socket socket, String data) {
try {
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(
socket.getOutputStream()));
out.write(data + "\n");
out.flush();
} catch (Exception ex) {
ex.printStackTrace();
}
} | 1 |
@Override
public Answer getRightAnswer() {
if (leftPriority == rightPriority) {
return ZeroAnswer.getInstance();
} else if (leftPriority < rightPriority) {
return OneAnswer.getInstance();
} else {
return TwoAnswer.getInstance();
}
} | 2 |
@Override
protected boolean handleTask(DownloadTask mainTask) {
myTask = getMyTask(mainTask);
while (myTask.getState() != DownloadTaskState.finished &&
mainTask.getState() == DownloadTaskState.downloading &&
maxTryTimesPtr.value > 0) {
try {
myTask.download(mainTask, (long) Math.ceil((float)mainT... | 7 |
private Display createDisplay(Class cl)
{
try
{
String className = cl.getName();
Class dcl = Class.forName(className + "Display");
if (Display.class.isAssignableFrom(dcl))
{
Display display = (Display) dcl.newInstance();
... | 3 |
public static void startupStartup() {
{ Object old$Module$000 = Stella.$MODULE$.get();
Object old$Context$000 = Stella.$CONTEXT$.get();
try {
Native.setSpecial(Stella.$MODULE$, Stella.$STELLA_MODULE$);
Native.setSpecial(Stella.$CONTEXT$, ((Module)(Stella.$MODULE$.get())));
if (S... | 6 |
public static String exeCmd(String cmd) {
log.info("execute cmd : " + cmd);
InputStream inputStream = null;
InputStream errorStream = null;
OutputStream outputStream = null;
String str = null;
String error = null;
try {
Process process = Runtime.getRuntime().exec(cmd);
// int ret = process.waitFor();... | 9 |
public static void main(String[] args)
{
int i;
TestEncoder te = new TestEncoder("Test PNG Alpha/Filter Encoder");
i = 0;
te.encodeAlpha = false;
te.filter = 0;
te.pixelDepth = 24;
te.compressionLevel = 1;
while (i < args.length)
{
... | 9 |
public OptionFrame() {
setResizable(false);
setTitle("Options");
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e2) {
e2.printStackTrace();
}
setDefault... | 5 |
public static void setLevel(int l) {
switch (l) {
case 0:
level = ERROR;
break;
case 1:
level = INFO;
break;
case 2:
level = DEBUG;
println("Ausgabe auf DEBUG gesetzt.", 2);
break;
}
} | 3 |
@Override
public Article find(int id) {
Article found = null;
PreparedStatement pst = null;
ResultSet rs = null;
try {
pst=this.connect().prepareStatement("select * from Article where id= ?");
pst.setInt(1, id);
rs=pst.executeQuery();
... | 6 |
static String unpluralize(String word) {
if (word.startsWith("border") || word.startsWith("motion")) return word;
return word.length() > PLURAL_TRESHOLD && !word.contains(" ") && word.endsWith("s") ? word.substring(0, word.length() - 1) : word;
} | 5 |
public boolean actionMigrate(Fauna actor, Target point) {
if (point instanceof Nest) {
final Nest nest = (Nest) point ;
if (Nest.crowdingFor(this) < 0.5f) return false ;
if (Nest.crowdingFor(nest, species, world) > 0.5f) return false ;
if (! nest.inWorld()) {
nest.clearSurroun... | 4 |
private static int findit( int key )throws RuntimeException {
int low = 0, high = 4887, mid;
while ( low <= high )
{
mid = (high+low) >> 1; // divide by two
if ( key < products[mid] )
high = mid - 1;
else if ( key > products[mid] )
low = mid + 1;... | 3 |
void addHoveringElement(PositionChangedObservable e) {
if (e == null || !e.getPositions().contains(position))
throw new IllegalArgumentException("The given Element is invalid!");
hoveringElements.add(e);
} | 2 |
@Override
public void mouseReleased(MouseEvent e) {
Node mouseOverN = manager.getMouseOverN();
if (mouseOverN != null && dragAddNode != null && mouseOverN != dragAddNode) {
Edge ed = manager.findEdge(dragAddNode, mouseOverN);
if (ed == null)
manager.addEdge(dragAddNode, mouseOverN, Edge.DEFAULT_LENGTH);... | 8 |
public void loadGame() {
String filename = JOptionPane.showInputDialog(this,
"Please enter your name:");
if (filename == null) {
return;
}
File savegame = new File(PATH + filename + ".csg");
try {
Scanner input = new Scanner(savegame);
name = input.nextLine();
money = input.nextInt();
input... | 4 |
public void requestStop() {
logger.debug("Server stop requested");
keepRunning = false;
//drop ourselves a small useless message to break the loop (kind-of hasckish, but meh)
try {
DatagramSocket clientSocket = new DatagramSocket();
InetAddress IPAddress = InetAd... | 3 |
public double intersection(Ray ray)
{
Vector rayOrigin = ray.o(), rayDirection = ray.d();
//get distance to planes along ray
double topDistance = topPosition.sub(rayOrigin).dot(orientation),
bottomDistance = bottomPosition.sub(rayOrigin).dot(orientation),
raySpeed = orientation.dot(rayDirection);
t... | 8 |
private void loadContent() {
try {
background_image = ImageIO.read(this.getClass().getClassLoader().getResource("img/Backgound.PNG"));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} | 1 |
public ImportAmountOfCostsAndPlus(){
importBuilding=new int[7][12];
// forester
for(int i=0;i<10;i++)
{
importBuilding[0][i]=forester[i];
}
// clay pit
for(int i=0;i<10;i++)
{
importBuilding[1][i]=clayPit[i];
... | 7 |
@Override
public boolean removeAll(Collection<?> c) {
// TODO Auto-generated method stub
return false;
} | 1 |
private void onSave(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_onSave
toggler.setState(false);
chooser.showSaveDialog(this);
if (chooser.getSelectedFile() != null) {
try (DataOutputStream dos = new DataOutputStream(new FileOutputStream(chooser.getSelectedFile()))) {
... | 6 |
private int nextNBits(int bitsToGet) {
byte b, next, next2next;
int l = data.length - 1;
int bp = this.bytePointer;
if (fillOrder == 1) {
b = data[bp];
if (bp == l) {
next = 0x00;
next2next = 0x00;
} else if ((bp + 1) == l) {
next = data[bp + 1];
next2next = 0x00;
} el... | 9 |
@Override
public void run()
{
running = true;
if (LifecycleAware.class.isAssignableFrom(handler.getClass()))
{
((LifecycleAware)handler).onStart();
}
T entry = null;
long nextSequence = sequence + 1 ;
while (running)
{
try
... | 6 |
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
if(request.getMethod().equals("GET"))
{
request.getRequestDispatcher("registrarse.jsp").forwa... | 3 |
public static float moveRate(Actor actor, boolean basic) {
int motionType = MOTION_NORMAL ; for (Behaviour b : actor.mind.agenda) {
final int MT = b.motionType(actor) ;
if (MT != MOTION_ANY) { motionType = MT ; break ; }
}
final float luck = actor.motionWalks() ? moveLuck(actor) : 0.5f ;
... | 9 |
private void join() {
team.addPlayer(player);
oldLoc.put(player, new Location(player.getWorld(), player.getLocation().getX(), player.getLocation().getY(), player.getLocation().getZ()));
potato++;
player.setGameMode(GameMode.ADVENTURE);
if(potato == 5){
for (OfflinePlayer online : team.getPlayers()) {
... | 3 |
private void applyData(){
if (selectedRow != -1){
dataBase.getFile(selectedRow).setAlgorythmName(textFieldName.getText());
dataBase.getFile(selectedRow).setAlgorythmType(comboBoxType.getSelectedItem().toString());
dataBase.getFile(selectedRow).setAlgorythmFile(file);
... | 1 |
public static String SentenceTrim(String sentence){
String temp[];
if(sentence.indexOf("null")>-1){
temp=sentence.split("null");
sentence="";
for(int i=0;i<temp.length;i++){
sentence=sentence+temp[i];
}
}
if(sentence.indexOf("</p>")>-1){
temp=sentence.split("</p>");
sentence="";
f... | 8 |
private void collectGenerator(Generator generator) {
if (generator != null) {
Class<?> klass = generator.klass();
// I'm unsure if this can happen
if (klass == null) {
throw new RuntimeException("Bad @Generator found.");
}
Class<? ext... | 5 |
protected JPanel buildFilterPanel() {
JPanel ans = new JPanel();
GridBagLayout layout = new GridBagLayout();
GridBagConstraints c = new GridBagConstraints();
ans.setLayout(layout);
//
filter = new JTextField("ѧŻ", 20);
JButton filterByNo = new JButton("ѧŲѯ");
JButton filterByName = new JButton("ѯ");
... | 0 |
@Override
public void copyStudyInto(String newName, Study study) {
File newStudyDir = new File("./studies/", newName);
if(newStudyDir.exists()) {
// Override eixsting study
// Need to delete directory contents before deleting directory
for(Fi... | 6 |
private void checkEnabled()
{
Tag tag = env.getTag(env.getActive());
// setEnabled(!(tag instanceof PermanentTag));
if(env.tabbed.getTabCount() == 1)
setEnabled(false);
else
setEnabled(!(tag instanceof PermanentTag));
} | 1 |
public void drawRotatedSprite(int arg0, double arg1, int arg2) {
int j = 15;
int k = 20;
int l = 15;
int j1 = 256;
int k1 = 20;
try {
int i2 = -k / 2;
int j2 = -k1 / 2;
int k2 = (int) (Math.sin(arg1) * 65536D);
int l2 = (int) (Math.cos(arg1) * 65536D);
k2 = k2 * j1 >> 8;
l2 = l2 * j1 >> 8;... | 4 |
public MulticastMessagePasser(MessagePasser gMessagePasser){
this.groupSpg = new Hashtable<String, Integer> ();
this.localHostName = gMessagePasser.getLocalName();
this.messagePasser = gMessagePasser;
for(String key : gMessagePasser.groupsRpg.groups.keySet()){
this.groupSpg.put(key, 0);
}
this.groupRpg =... | 2 |
public void saveData(final String contents) throws IOException {
Configuration conf = new Configuration();
// conf.set("yarn.resourcemanager.address","localhost:9005");
// conf.set("fs.defaultFS","hdfs://localhost:9000");
// conf.set("mapreduce.framework.name", "yarn");
// conf.set("yarn.resourcemanager.sched... | 8 |
@Override
public String toString() {
String content;
if(resolvable != null)
content = resolvable.toString();
else
content = label;
return Integer.toString(position)+": "+content;
} | 1 |
public void setLargest() {
largest = getCurrentLargest();
} | 0 |
static private int jjMoveStringLiteralDfa6_0(long old0, long active0)
{
if (((active0 &= old0)) == 0L)
return jjStartNfa_0(4, old0);
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
jjStopStringLiteralDfa_0(5, active0);
return 6;
}
switch(curChar)
{
cas... | 8 |
@Test
@TestLink(externalId="ASSUMPTION_FAILED")
public void testBlockedBecauseOfFailingAssumption() {
// Servername is äöüß - this file should be UTF-8.
assumeNoException(new IllegalStateException(
"can not proceed because server 'äöüß' not available"));
... | 0 |
protected void OnDataRangeChanged() {
if (selectedIndex != null) {
try {
lastData = NetworkManager.showMore(selectedIndex.getSymbol(), selectedRange);
lineChart.getData().clear();
if (pointerType != null && !pointerType.equals("hide")) {
... | 6 |
public Map<Integer, InventoryItem> GrabWalls()
{
Map<Integer, InventoryItem> Items = new HashMap<Integer, InventoryItem>();
for(InventoryItem Item : this.Inventory.values())
{
if (Item.GrabBaseItem().Type.contains("i"))
{
Items.put(Item.ID, Item);
}
}
return Items;
} | 2 |
public Scenery getScenery(int x, int y) {
if ((x < width && y < height) && (x >= 0 && y >= 0)) {
return data[y][x];
} else {
return null;
}
} | 4 |
public String getW()
{
return w;
} | 0 |
public void setI(int id) {
this.id = id;
} | 0 |
private void addRowToTable(List<UserDTO> usersList) {
for (UserDTO user : usersList) {
if (user.getUserGame() != null) {
tableModel.addRow(user.toArray());
} else {
tableModel.addRow(user.toArrayOnlyUser());
}
}
} | 2 |
private boolean packCardHasBeenPressed(Point pressPt) {
if (aFaceDownCard.pressPointIsInsideCard(pressPt)) {
return true;
}
return false;
} | 1 |
public static void handleKick(String params) {
String syntax = "Nesprávná syntaxe příkazu: /kick #kanál uživatel [důvod]";
String match = "#\\w+ \\S+( .+)?";
if ( !params.matches(match) ) {
appendError(syntax);
return;
}
String[] parts = params.split(" ",... | 2 |
public static String escape(String string) {
char c;
String s = string.trim();
StringBuffer sb = new StringBuffer();
int length = s.length();
for (int i = 0; i < length; i += 1) {
c = s.charAt(i);
if (c < ' ' || c == '+' || c == '%' ... | 6 |
public void func_73189_a(int par1, int par2, byte par3ArrayOfByte[], BiomeGenBase par4ArrayOfBiomeGenBase[])
{
byte byte0 = 2;
int i = byte0 + 1;
byte byte1 = 33;
int j = byte0 + 1;
densities = func_73187_a(densities, par1 * byte0, 0, par2 * byte0, i, byte1, j);
for ... | 7 |
public void afterThrowing(Method method, Object[] args, Object target,
Throwable subclass) {
log.error("发生异常!");
log.error(subclass.getMessage(), subclass);
} | 0 |
public long getCallId() {
return callId;
} | 0 |
public static String[] RemoveEmptyStrings(String[] data)
{
ArrayList<String> result = new ArrayList<String>();
for(int i = 0; i < data.length; i++)
if(!data[i].equals(""))
result.add(data[i]);
String[] res = new String[result.size()];
result.toArray(res);
return res;
} | 2 |
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
response.setContentType("text/html");
PrintWriter out = response.getWriter();
String actionDelete = request.getParameter("Delete");
String actionChange = request.getParameter("Change");
Stri... | 5 |
public Iterator<Seance> showNextSeances() {
List<Seance> nextSeances = new ArrayList<Seance>();
Calendar now = Calendar.getInstance();
for (Seance seance : seances) {
if (seance.getStartDateTime().after(now)) {
nextSeances.add(seance);
}
}
Collections.sort(nextSeances, new Seance... | 2 |
final void method774(Class318_Sub4 class318_sub4, int i) {
anInt1280++;
Class318_Sub1 class318_sub1
= ((Class318_Sub4) class318_sub4).aClass318_Sub1_6410;
boolean bool = true;
Class318_Sub3[] class318_sub3s
= ((Class318_Sub4) class318_sub4).aClass318_Sub3Array6414;
for (int i_6_ = 0; class318_sub3s.lengt... | 9 |
@Test
public void testWord2num() {
String num = PhonewordFinder.word2num("FLOWER");
assertEquals("356937", num);
} | 0 |
public EGrepResult(EGrepGrader problem_grader, File file) {
super(problem_grader, file);
regex_file = file;
if (file == null || !file.canRead()) {
return;
}
missing = false;
BufferedReader br;
try {
br = new BufferedReader(new FileReader(regex_file));
regex = "";
String line = null;
if ((li... | 9 |
public void actionPerformed(ActionEvent event) {
if(event.getActionCommand().equals("newsize")&& !this.getText().equals("Width Depth")) {
String text = this.getText();
String[] splitted = text.split("\\s+");
int width = 0;
int depth = 0;
try { width = Integer.parseInt(splitted[0]);
depth = Intege... | 6 |
private final boolean cons(int i)
{ switch (b[i])
{ case 'a': case 'e': case 'i': case 'o': case 'u': return false;
case 'y': return (i==0) ? true : !cons(i-1);
default: return true;
}
} | 7 |
private boolean checkForWinVertical() {
for (int i = 0; i < ROW_COUNT; i++) {
Cell cell1 = arrayOfLogicCells[i][0];
Cell cell2 = arrayOfLogicCells[i][1];
Cell cell3 = arrayOfLogicCells[i][2];
if (cell1.isZeroChecked() && cell2.isZeroChecked()
... | 7 |
public boolean followUrl(final Url url) {
if (url.depth() > depth) {
return false;
}
return visitor.followUrl(url);
} | 1 |
public void keyPressed(KeyEvent e){
if(e.getKeyCode() == KeyEvent.VK_UP){
direction = 1;
}
if(e.getKeyCode() == KeyEvent.VK_DOWN){
direction = 2;
}
if(e.getKeyCode() == KeyEvent.VK_LEFT){
direction = 3;
}
if(e.getKeyCode() == KeyEvent.VK_RIGHT){
direction = 4;
}
froggy.moveFrog... | 4 |
private void initUI() {
toolkit = this.getToolkit();
menu = new JPopupMenu();
JMenuItem menuItemBeep = new JMenuItem("Beep");
menuItemBeep.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
toolkit.beep();
}
});
menu.add(menuItemBeep);
JMenuItem menuItemClo... | 1 |
public int getBase() {
return baseWeeklySalary;
} | 0 |
private boolean jj_3_42() {
if (jj_scan_token(LEFTPARENTHESES)) return true;
if (jj_3R_61()) return true;
if (jj_scan_token(RIGHTPARENTHESES)) return true;
return false;
} | 3 |
public void drawName(Graphics g, Board board, int width, int height){
int leftCoord = this.getCellColumn()*width;
int topCoord = this.getCellRow()*height;
if(this.getPrintsRoom() && this.getRoomInitial()!='X') {
String room = board.getRooms().get(this.getRoomInitial());
Font font = new Font("Verdana", Font.... | 4 |
public void addInterface(CtClass anInterface) {
checkModify();
if (anInterface != null)
getClassFile2().addInterface(anInterface.getName());
} | 1 |
public boolean isSailable() {
switch(value) {
case 13: case 14: case 15: return true;
default: return false;
}
} | 3 |
public static void paintButton(MinesButton inButton, Graphics inG) {
MinesNode node = inButton.getCorrespondingNode();
int x = inButton.getInsets().top;
int y = inButton.getInsets().left;
int height = inButton.getHeight() - inButton.getInsets().top - inButton.getInsets().bottom;
int width = inButton.getWidth... | 7 |
public void setSource(String source) {
this.source = source;
} | 0 |
public static <E extends Comparable<E>> E kthSmallest(E[] array, int k) {
if (array == null || k >= array.length || k < 0)
return null;
MaxHeap<E> maxheap = new MaxHeap<E>();
for (E e : array) {
if (maxheap.size() < k + 1)
maxheap.add(e);
else if (e.compareTo(maxheap.findMax()) < 0) {
maxhe... | 6 |
private static int greatestCommonDivisor( int m, int n )
{
// Базовый случай:
if ( m == n )
{
return m;
}
if ( m == 0 )
{
return n;
}
if ( n == 0 )
{
return m;
}
// Рекурсивный случай:
... | 7 |
public String getAnswer() throws Exception {
int retVal = 0;
boolean [][] duplicates = new boolean[101][101];
//Too avoid using big ints, I simply mark duplicates
for (int a = 2; a<= 100; a++) {
int power = a*a;
for (int b = 2; power<= 100; b++) {
... | 9 |
public String getName() {
String name = txt_name.getText().trim();
return name;
} | 0 |
@EventHandler(priority = EventPriority.NORMAL)
public void onSignChange(SignChangeEvent event) {
Player player = event.getPlayer();
String[] line = event.getLines();
int i;
if (line[0].toLowerCase().contains("[endersgame]")) {
try {
i = Integer.parseInt(line[1]);
} catch (NumberFormatException e) {
... | 6 |
private void outputData(){
// dimension arrays
this.nData = this.xAndYvalues.size()/2;
System.out.println("nData " + this.nData);
this.xPositions = new double[this.nData];
this.yPositions = new double[this.nData];
this.xPosPixel = new double[this.nData];
this.yPo... | 9 |
public Set<Point> getPointSet(){
return new HashSet<Point>(points);
} | 0 |
private static String[] separateIntoTokens(String step) {
// Basically, each token is a chain of characters delimited by a ' ' character
// However, we treat anything between double quotes (") as a single token
// That is because anything between double quotes will be a parameter and... | 5 |
@Override
public boolean equals (Object target) {
if(target instanceof TaskList) {
TaskList taskList = (TaskList) target;
if(target.getClass() != this.getClass() ||
this.hashCode() != taskList.hashCode())
return false;
else {
... | 6 |
public void genAllMoves(){
int basic = 0, king = 0;//keeps a record of the value of a piece for black or white
deleteList = new ArrayList<Move>();
if (colourToPlay == 1){
basic = 2; king = 4;
}
else{
basic = -2; king = -4;
}
for (int row = 0; row < EDGE_LENGTH; row++){
for (int col = 0; col < ... | 8 |
protected void stepBackward() {
CellElement currentCell;
switch (m_currentPhase) {
case PHASE_CALC_GRID:
m_currentStep--;
if (m_currentStep <= 0) {
stepZero();
return;
}
Point realD = getCoordsByStep(m_currentStep);... | 8 |
@EventHandler
public void onPlayerJoin(PlayerJoinEvent event) {
for (String p : BungeeUtilities.getInstance().hasPlayersHidden) {
Player player = BungeeUtilities.getInstance().getServer().getPlayerExact(p);
if (player == null) {
BungeeUtilities.getInstance().hasPlayersHidden.remove(p);
return;
}
... | 8 |
public Integer getSizeOfProducts() {
return sizeOfProducts;
} | 0 |
private Student getStudentFromTable() {
DefaultTableModel dtm = (DefaultTableModel) studentsTable.getModel();
Vector data = dtm.getDataVector();
int rowSelected = studentsTable.getSelectedRow();
String name = ((Vector) data.elementAt(rowSelected)).elementAt(1)
.toString();
String lastName = ((Vector) data... | 1 |
public State createStateWithStates(Automaton dfa, State[] states,
Automaton nfa) {
StatePlacer sp = new StatePlacer();
State state = dfa.createState(sp.getPointForState(dfa));
state.setLabel(getStringForStates(states));
if (hasFinalState(states, nfa)) {
dfa.addFinalState(state);
}
return state;
} | 1 |
public String getClusterName(int index) {
String name = "...";
switch (index) {
case (1):
name = "Advanced";
break;
case (2):
name = "FAQ";
break;
case (3):
name = "3 Shots";
break;
case (4):
name = "Big 'n Fast";
break;
case (5):
name = "High Debated";
break;
case (6):
... | 6 |
@Override
public void addWord(String s) {
// Equivalent of rho function
int nbTrailingZeros = Integer.numberOfTrailingZeros(func.hashString(s));
// Consider only words whose hash value begins with more than b zeros.
if (nbTrailingZeros >= b) {
HashMap<String, Integer> l = strTab.get(... | 3 |
public FeatureList getFeatureList(FeatureVector featureVector)
{
final FeatureList featureList = new FeatureList();
final int size = featureVector.size();
for (int i = 1; i <= size; i++) {
final FeatureValue featureValue = featureVector.getFeatureValue(i-1);
if (featureValue != null && !(excludeNullValues... | 9 |
public boolean getIsIgnored(UUID passedUUID) {
for (String s : ignoredPlayers) {
UUID thisUUID = UUID.fromString(s);
if (thisUUID.equals(passedUUID)) {
return true;
}
}
return false;
} | 2 |
public static void getDividers() {
for (Integer prime : primes) {
for (Integer pr : primes) {
if (pr > prime) {
if (primes.contains(pr + pr - prime)) {
if (checkNumbers(prime, pr) && checkNumbers(prime, pr + pr - prime) && checkNumbers(pr... | 7 |
public static void main(String[] args) {
while(true){
System.out.println("Enter the file path of a file you want to encrypt or decrypt: ");
filePath = input.nextLine();
System.out.println("Processing...");
reader = new ReadFile(filePath);
int k = 1;
boolean fileExists = true;
String newP... | 8 |
public static final BruteParams<?>[] valuesLocal() {
final BruteParams<?>[] values_ = values();
for (int i = 0; i < values_.length; i++) {
if (!values_[i].local) {
values_[i] = null;
}
}
return values_;
} | 4 |
@SuppressWarnings("empty-statement")
public static void main(String[] args){
List<String> namen = new ArrayList<>();
try (Scanner scanner = new Scanner(System.in)){
System.out.println("Tik soortnamen, tik stop na de laatste naam");
for (String naam; ! "stop".equalsIgnoreCase(... | 4 |
public BeanDeepCopyLens(String fieldName, Class<A> theType) {
for (Method m : theType.getMethods()) {
if (m.getName().toLowerCase()
.equals("get" + fieldName.toLowerCase())) {
this.getMethod = m;
}
if (m.getName().toLowerCase()
.equals("set" + fieldName.toLowerCase())) {
this.setMethod = m;... | 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.