text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void NESSIEfinalize(byte[] digest) {
// append a '1'-bit:
buffer[bufferPos] |= 0x80 >>> (bufferBits & 7);
bufferPos++; // all remaining bits on the current byte are set to zero.
// pad with zero bits to complete 512N + 256 bits:
if (bufferPos > 32) {
while (buf... | 4 |
public Tree constructTrie(List<String> patternList) {
trie = new Tree("", 1);
Tree.Node root = trie.getRoot();
List<Tree.Node<String, Integer>> children = new ArrayList<Tree.Node<String, Integer>>();
root.setChildren(children);
int positionOfNode = 2;
for (String patte... | 3 |
public WorldTile getTile(TileType tileType) {
// Try to get the tile, if it's null, create it and keep a reference
// to it so that it can be returned next time.
WorldTile foundTile = tileMap.get(tileType);
if (foundTile == null) {
foundTile = new WorldTile(tiles[tileType.val], passable, minimapColor, c... | 1 |
public static void main(String[]args)
{
try
{
//new ClassFolder();
System.out.println(ClassFolder.getAbsolutePath());
File f = new File("C:\\Users\\thapaliya\\Desktop\\codes");
System.out.println("Abs File Path: "+f.getAbsolutePath());
Sys... | 3 |
private void ConnectSocket(){
int tries = 0;
int maxTries = 5;
while(tries < maxTries) {
try {
localServerSocket = new Socket(Ip, Port);
localServerSocket.setSoTimeout(100);
in = new DataInputStream(localServerSocket.getInputStream());
... | 3 |
public List<ItemType> getItem() {
if (item == null) {
item = new ArrayList<ItemType>();
}
return this.item;
} | 1 |
@Override
public void startSetup(Attributes atts) {
super.startSetup(atts);
addActionListener(this);
} | 0 |
@Override
public String toString() {
String out = "";
for (ScrapedPage scraped : scrapers) {
out += scraped.toString() + "\n";
}
return out;
} | 1 |
@Override
public boolean equals(Object obj) {
if (obj instanceof Operator) {
Operator o = (Operator) obj;
return symbol.equals(o.symbol) && priority == o.priority && associativity == o.associativity;
}
return false;
} | 3 |
private boolean r_shortv() {
int v_1;
// (, line 49
// or, line 51
lab0: do {
v_1 = limit - cursor;
lab1: do {
// (, line 50
if (!(out_grouping_... | 8 |
public void render(boolean editor, float interpolation)
{
ColliderBox ra = map.camera.getMapRenderArea(interpolation);
for(int i=0;i<entityList.size();i++)
{
try
{
if(Collider.collides(entityList.get(i).getGeneralCollider(interpolation), ra))
entityList.get(i).render(editor,interpolation);
} ca... | 4 |
@Override
public double calculate(double x) {
return -Math.pow(x, 2) * (x + 1) * ((x - 2 < 0) ? -Math.pow(2 - x, 1 / 3.) : Math.pow(x - 2, 1 / 3.));
} | 1 |
public boolean similar(Object other) {
try {
if (!(other instanceof JSONObject)) {
return false;
}
Set<String> set = this.keySet();
if (!set.equals(((JSONObject)other).keySet())) {
return false;
}
Iterator<St... | 9 |
private void buildVertexPath(RoutePath inRoute, boolean randomStart) {
mPath.clear();
ListIterator ti = inRoute.getPath().listIterator();
while (ti.hasNext()) {
Trip t = (Trip) ti.next();
if (!mPath.isEmpty()
&& mPath.get(mPath.size() - 1).getRawDistance(
t.getVertices().get(0)) == 0.0) {
... | 7 |
private Field findField(Class<?> clazz, String name) {
for (Field field : clazz.getDeclaredFields()) {
if (!isTransient(field.getModifiers()) && !field.isAnnotationPresent(Transient.class)
&& field.getName().equals(name)) {
return field;
}
}
... | 5 |
private static void nextWindow() {
try {
sLock.lock();
if(!sWindowOpen && sWindows.size() > 0) {
sWindowOpen = true;
final JWindow window = sWindows.removeFirst();
Timer delayVisibleTimer = new Timer(DELAY, new ActionListener() {
public void actionPerformed(ActionEvent e) {
final Timer t ... | 2 |
static final String method572(String string, int i) {
anInt8677++;
if (i != 23034)
aClass356_8679 = null;
int i_11_ = string.length();
int i_12_ = 0;
for (int i_13_ = 0; i_11_ > i_13_; i_13_++) {
char c = string.charAt(i_13_);
if (c == '<' || c == '>')
i_12_ += 3;
}
StringBuffer stringbuffer = n... | 7 |
@Override
public void handleBitfieldAvailability(SharingPeer peer,
BitSet availablePieces) { /* Do nothing */ } | 0 |
public Game create(GameType gameType) {
Game game = null;
Player player1 = null;
Player player2 = null;
if (gameType == null) {
throw new IllegalArgumentException ("MainCommands - create: gameType is null");
}
if (gameType == GameType.ONE_PLA... | 3 |
public List<TravelDataBean> getSearchArticles(int start, int end,String search, String val, int area) throws Exception{
Connection conn = null;
Statement stmt = null;
ResultSet rs = null;
List<TravelDataBean> articleList = null;
try{
conn = getConnection();
val = new String(val.getBytes("iso_8859-1"),"u... | 9 |
public CheckResultMessage check2(int day) {
return checkReport.check2(day);
} | 0 |
@Override
public void onDisable(){
try {
SQLManager.disconnect();
} catch(Exception e){
log.severe("SQL Database encountered an error while disconnecting.");
if(e.getMessage()!=null) log.severe("Error: " + e.getMessage());
if(e.getCause()!=null) log.severe("Caused by: " + e.getCause().toString());
}
... | 4 |
@Override
protected void press() {
switch (selected) {
case 0:
break;
case 1:
break;
case 2:
try {
new Client((host.equals("")?"localhost":host), 1999, gameTag);
setState(gameId);
} catch (Exception e) {
System.out.println("Check your internet connection");
}
... | 6 |
public void maxheap(int i){
left=2*i;
right=2*i+1;
if(left <= n && numbers[left] > numbers[i]){
largest=left;
}
else{
largest=i;
}
if(right <= n && numbers[right] > numbers[largest]){
largest=right;
}
if(largest!=i){
exchange(i,largest);
maxheap(largest);
}
} | 5 |
private Integer[] mergeArrays(int low, int high, int middle) {
// Copy both parts into the helper array
System.arraycopy(numbers, low, helper, low, high + 1 - low);
int i = low;
int j = middle + 1;
int k = low;
// Copy the smallest values from either the left or the ... | 4 |
private ManagerSocketServer() {
super();
for (String word : badWords) {
bannedWords.add(word);
}
badWords = null; // Dispose of string to save memory
} | 1 |
public void addNode(T data) {
boolean goLeft;
Node<T> temp = root;
if(this.root == null) {
this.root = new BiDirectionalNode<T>(data);
return;
}
do {
goLeft = ((int)(Math.random()*31))%2 == 0 ? true : false;
if (null == (goLeft ? temp.getLeft() : temp.getRight())) {
break;
} else {
temp... | 7 |
@Before
public void setUp() {
for (int i = 0; i < test1.length; i++) {
t1.insert(test1[i]);
}
for (int i = 0; i < test2.length; i++) {
t2.insert(test2[i]);
}
} | 2 |
private void drawMouse(Graphics g) {
int offset = 2;
g.setColor(new Color(currentColor));
if (winner == 0) {
if ((mx >= boxX1 - offset) && (mx <= boxX2 + offset) && (my >= boxY1 + boxSize - (offset * 2 + 4)) && (my <= boxY2 + boxSize - (offset * 2 + 4))) {
g.fillOval(mx - boxSize / 3, my - boxSize, boxSize... | 5 |
public void body()
{
// wait for a little while for about 3 seconds.
// This to give a time for GridResource entities to register their
// services to GIS (GridInformationService) entity.
super.gridSimHold(3.0);
LinkedList resList = super.getGridResourceList();
// in... | 6 |
public void setFesIdFuncionario(Integer fesIdFuncionario) {
this.fesIdFuncionario = fesIdFuncionario;
} | 0 |
public static Day fromString(String inputString) {
if (inputString != null) {
for (Day day : Day.values()) {
if (inputString.equalsIgnoreCase(day.value)) {
return day;
}
}
}
return SUNDAY;
} | 3 |
public void sort(Comparable[] arr, int start, int end) {
int low = start;
int high = end;
if(low >= high) {
return;
} else if(low == high - 1) {
if(Compare.gt(arr[low], arr[high])) {
swap(arr, low, high);
}
return;
}... | 9 |
public void loadPlates(){
File file = new File(getDataFolder(),"Plates.prop");
if(!file.exists()){
getLogger().info("Error Loading Plates, Shuting Down");
Bukkit.getPluginManager().disablePlugin(this);
}
try{
BufferedReader bufferedReader = new BufferedReader(new FileReader(file));
Strin... | 4 |
public void genWeapon(){
rand = new Random();
secRoll = (rand.nextInt(100)+1);
if(secRoll <= 70){
genCommonWep();
} else if(secRoll <= 80){
genUncommonWep();
} else if(secRoll <=100){
RangedRoll rr = new RangedRoll();
rr.doRoll();
arrowList = rr.getAmmoOutput();
item = rr.getItem();
va... | 3 |
public static void main(String[] args) throws FileNotFoundException {
long start = System.currentTimeMillis();
Scanner in = new Scanner(new FileInputStream("files/new/triplets/input03.txt"));
// Scanner in = new Scanner(System.in);
int c = in.nextInt();
long[] n = new long[c];
... | 9 |
@SuppressWarnings("deprecation")
public static void main(String[] args) {
HashMap<String, ArrayList<Integer>> finalMap = new HashMap<String, ArrayList<Integer>>();
HashMap<String, HashMap<Integer,Integer>> dayCountForStnMap = new HashMap<String, HashMap<Integer,Integer>>();
HashMap<Integer, String> stationIdName... | 8 |
public synchronized Object[] receiveBinary()
throws IOException, CycApiException {
cfaslInputStream.resetIsInvalidObject();
final Object status = cfaslInputStream.readObject();
cfaslInputStream.resetIsInvalidObject();
final Object response = cfaslInputStream.readObject();
final Object[] an... | 3 |
public void testPresent5() {
try {
TreeNode result = contains(mkChain(new String[]{ "label1", "label2" }), new TreeNode("label2"));
assertTrue(null, "Failed to locate the leaf node of a chain!",
result != null
&& result.getData() != null
&... | 7 |
public void escribir_Arch_Maestro(String nombre_archi) throws IOException {
long lreg, desplaza;
int n;
StringBuffer buffer = null;
System.out.println("Archivo Maestro");
RandomAccessFile archi = new RandomAccessFile(nombre_archi, "rw");
try {
archi.readInt(... | 7 |
private static void expandEverything(OutlinerDocument doc) {
OutlinerCellRendererImpl textArea = doc.panel.layout.getUIComponent(doc.tree.getEditingNode());
if (textArea == null) {return;}
try {
if (doc.tree.getComponentFocus() == OutlineLayoutManager.TEXT) {
TextKeyListener.expandEverything(doc.tree);
... | 4 |
@Basic
@Column(name = "FUN_HABILITADO")
public String getFunHabilitado() {
return funHabilitado;
} | 0 |
public static void savePokemon()
{
String output ="savedata/"+idString+".pkmn";
try
{
PrintWriter fout=new PrintWriter(new FileWriter(output));
encryptionKey=0;
if(VERSION.equals("Peaches"))
fout.println("PDAE"+idString);
else
fout.println("CDAE"+idString);
for (Pokemon aParty... | 8 |
public static void main(String[] args) throws VehicleException, SimulationException {
CarPark cp = new CarPark();
Simulator s = null;
Log l = null;
try {
s = new Simulator();
l = new Log();
} catch (IOException | SimulationException e1) {
e1.printStackTrace();
System.exit(-1);
}
if(args.le... | 5 |
@Override
public Class getObjectType() {
// TODO Auto-generated method stub
return Person.class;
} | 0 |
static boolean isXmlDeclarationStart(final char[] buffer, final int offset, final int maxi) {
// No upper case allowed in XML Declaration. XML is case-sensitive!!
return ((maxi - offset > 5) &&
buffer[offset] == '<' &&
buffer[offset + 1] == '?' &&
... | 9 |
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Tile other = (Tile) obj;
if (key == null) {
if (oth... | 9 |
public Shader()
{
program = glCreateProgram();
uniforms = new HashMap<String, Integer>();
if(program == 0)
{
System.err.println("Shader creation failed: Could not find valid memory location in constructor");
System.exit(1);
}
} | 1 |
public static void disposeAll(Class<? extends Component> clz){
for(Set<Component> components : frames.values()){
Set<Component> disposal=new HashSet<Component>();
for(Component component : components){
if(component.getClass().equals(clz)){
disposal.add... | 5 |
protected void addEntry(SimpleAutoCompleteEntry entry) {
if(mClassRestrictions != null) {
Class<?> thisEntryClass = entry.getInstanceClass();
for(Class<?> restriction : mClassRestrictions) {
if(restriction.isAssignableFrom(thisEntryClass)) {
mAllEntries.add(entry);
break;
}
}
} else { ... | 5 |
public void keyReleased(KeyEvent e){
switch(e.getKeyCode()){
case 37:
case 65:
left = false;
break;
case 38:
case 87:
up = false;
break;
case 39:
case 68:
right = false;
break;
case 40:
case 83:
down = false;
break;
}
} | 8 |
public void print(InstanceList docs, double limit, int num, String file) {
assert docs.size() == D;
try {
PrintWriter pw = new PrintWriter(file, "UTF-8");
pw.println("#doc source topic proportion ...");
Probability[] probs = new Probability[T];
for (int d=0; d<D; d++) {
pw... | 8 |
public static boolean getMoney(int money) {
Output.printTab("Hole "
+ (money == 0 ? "alles Geld" : money + " D-Mark") + " ab: ",
Output.DEBUG);
String moneyPage = Utils.getString("sparkasse/auszahlen");
Control.quietSleep(500);
int pos = moneyPage.indexOf("<div align=\"center\">");
if (pos == -1) {... | 6 |
@Override public Iterator<Color> iterator() {
return new Iterator<Color>() {
private int[] cs = null;
private boolean finalized = false;
private int[] next_coordinates(int[] cs) {
if (finalized)
return null;
if (cs == null) {
cs = new int[]{ 0, 0 };
} else {
cs = cs.clone();
... | 7 |
private void inputScore(Scanner scanner, int playerNum, int frameNum) {
Frame frame = player[playerNum].frame[frameNum];
do {
System.out.print("first score : ");
int first = scanner.nextInt();
frame.first = first;
} while (frame.first > 10);
if (frame.first != 10) {
do {
System.out.print("... | 6 |
public String getActualLogin(String login) {
Connection connection = null;
PreparedStatement statement = null;
ResultSet rs = null;
try {
connection = getConnection();
statement = connection.prepareStatement(userQuery);
int paramCount = u... | 4 |
@Override
public void warning(SAXParseException e) {
System.out.println("SAXParserException Warning: " + e.getMessage());
this.errorOccurred = true;
} | 0 |
private static <E> void merge(E[] array, E[] temp,int begin, int end, Comparator<E> comparator){
int i = begin;
int tracker = begin;
int middex = (begin+end)/2;
int rightstart = middex+1;
// Goes through and compares the two segments of the array that we are focusing on... | 5 |
public void run() {
while(threadFlag){
try{
LogController.addNumLogs();
detectEnd();
String _item = queue.take();
this.handleItem(_item);
}catch(InterruptedException e){
System.out.println("InterruptedException");
}
}
//System.out.println("ConsumerImplement thread End");
... | 3 |
public void removeProvince(int id) {
if (provinceIDCache.containsKey(id)) {
String together = provinceIDCache.get(id).worldName + "+" + provinceIDCache.get(id).x + "+" + provinceIDCache.get(id).z;
if (provinceLocCache.containsKey(together))
provinceLocCache.remove(together);
provinceIDCache.remove(id);
... | 2 |
public int successThreshold(Player patk, Player pdef){
int successThreshold = 0;
if(patk.inventory.contains(Card.spade) && !spectralImmune(patk)){
successThreshold += 1;
}
if(patk.inventory.contains(Card.spadeii) && !spectralImmune(patk)){
successThreshold += 2;
}
if(patk.inventory.contains(Card.longbowii)){
... | 9 |
public static Color getToolTipBackground() {
Color c = UIManager.getColor("ToolTip.background");
// Tooltip.background is wrong color on Nimbus (!)
boolean isNimbus = isNimbusLookAndFeel();
if (c==null || isNimbus) {
c = UIManager.getColor("info"); // Used by Nimbus (and others)
if (c==null || (isNimbus... | 6 |
public ProjectMainView() {
setTitle("Edytor LoW");
campaign = new Campaign();
setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
this.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent evt) {
boolean quit = true;
if (!campaign.isSaved()) {
int dialogButton... | 2 |
public void actionPerformed(ActionEvent e) {
if (e.getSource() == saveFile) {
int choice = fileChooser.showSaveDialog(PrintWindow.this);
if (choice == JFileChooser.APPROVE_OPTION) {
File file = fileChooser.getSelectedFile();
String file... | 7 |
@Override
public String getCalle() {
return super.getCalle();
} | 0 |
@Override
public String paginate(int page) {
// is there a need to paginate?
if(this.rows <= 0 || this.rows <= this.per_page)
return this.query;
// check if the page is valid
if(page <= 0) page = 1;
if(page > this.pages) page = this.pages;
// calculate rows
this.currPage = page;
int row_fro... | 4 |
public static double benchmarkMiceNumber(Path path, int nbOcc){
Hashtable<String, Double> tab = new Hashtable<String, Double>();
for (String s : new WordReader(path))
if (!tab.containsKey(s))
tab.put(s, 1.);
else {
double d = tab.remove(s);
tab.put(s, d+1.);
... | 4 |
public void load(){
/**
* - FOR TAM -
* Database Requirements
*
* Get dungeon data BASED OF USER ID.
*
* NEED: Dungeon data - tile_ids (it will be a long string like below), spawner_str (shorter string containing spawner details), trap_srt (same as spawner string).
*
*/
//TODO: ... | 4 |
public static void main(String[] args) {
Reflections reflections = new Reflections("de.drlanka.euler");
List<Class<? extends EulerProblem>> types = new ArrayList<>(reflections.getSubTypesOf(EulerProblem.class));
Collections.sort(types, new Comparator<Class<?>>() {
@Override
public int compare(... | 9 |
public void write(final ProtocolEncoder encoder) throws Exception
{
final StringBuilder log = logger.isLoggable(Level.FINER) ? new StringBuilder() : null;
buffer.clear();
encoder.encode(buffer, log);
if (log != null)
logger.finer("Protocol Encoding\n" + log.toString());
buffer.flip();
if (logger.i... | 5 |
private List<String> getParsedList (NodeList n) {
List<String> list = new ArrayList<String>();
for (int i = 0; i < n.getLength(); i++) {
String s = n.item (i).getTextContent();
if (!s.trim().isEmpty()) list.add (s);
}
return list;
} | 2 |
@SuppressWarnings("unused")
protected Entry readEntry(InputStream in) throws IOException {
Entry entry = new Entry();
byte temp[] = new byte[4];
in.read(temp);
if (!new String(temp).equals("File")) throw new IOException("FileFormat error :: " + new String(temp));
int entryLength = (int)read_s64(in);
in.... | 7 |
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://down... | 6 |
@Override
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) {
//System.out.println("getScrollableUnitIncrement");
switch(orientation) {
case SwingConstants.VERTICAL:
return visibleRect.height / 10;
case SwingConstants.HORIZONTAL:
return visibleRect.widt... | 2 |
public boolean issueAssetType(String serverID, String nymID, String contract) throws InterruptedException {
if (!otapiJNI.OTAPI_Basic_IsNym_RegisteredAtServer(nymID, serverID)) {
OTAPI_Func theRequest = new OTAPI_Func(OTAPI_Func.FT.CREATE_USER_ACCT, serverID, nymID);
String str... | 3 |
public void run() throws IOException {
// MyXMLFileWriter.printNewUserToXMLFile();
String s;
System.out.println("Hello, my dear friend!");
printMenu(PrintMenuName.MAIN_MENU);
while (true) {
s = br.readLine();
System.out.println(s);
if (s.equals("1")) {
printUsersCount();
} else if (s.equa... | 6 |
@Test
public void testCheckOut() throws Exception {
checkHelper.deleteCheckOut(b.getIsbn(), 1, 2);
bh.deleteBook(-2);
bh.addBook(b);
// Nothing should be added to the list of checkouts since the book is null
checkHelper.checkOut(null, start, 1, 2);
CheckOut co = checkHelper.getCorrespondingCheckOut(b.ge... | 6 |
@Override
public T mode() {
if (N == 0)
return null;
T mode = null;
long found = 0;
for (T k : freqTable.keySet()) {
long time = freqTable.get(k);
if (time > found) {
found = time;
mode = k;
}
}
return mode;
} | 3 |
private void initComponents() {
// JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
panelMenu = new JPanel();
menuBar1 = new JMenuBar();
menu1 = new JMenu();
menuItem1 = new JMenuItem();
menu2 = new JMenu();
menuItem4 = new JMen... | 3 |
private void formWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowOpened
//Set basic frame properties
this.getContentPane().setBackground(new Color(152, 174, 196));
this.setLocationRelativeTo(null);
//Load window icons
Image moddleIcon =... | 5 |
@Override
public List<Person> meetCriteria(List<Person> persons) {
List<Person> femalePersons = new ArrayList<>();
for (Person person : persons) {
if (person.getGender().equalsIgnoreCase("Female")) {
femalePersons.add(person);
}
}
return femalePersons;
} | 2 |
public static String downloadPhoto(String address, String path, String fileName) {
try {
URL html = new URL(address);
URI method = new URI(html.getProtocol(), html.getUserInfo(), html.getHost(), html.getPort(), html.getPath(), html.getQuery(), html.getRef());
address = method... | 9 |
public void paintComponent(Graphics g) {
Log.debug("Painting the canvas.");
// Let the swing framework do it's drawing of the JPanel first.
super.paintComponent(g);
// The following two commands draw the background:
// Set the color of the "pen". This color will be used in the following
// drawing commands.... | 2 |
public void setFunctionInfo(String functionName, int startLineNumber,
int endLineNumber) {
environmentStack.peek().setEndLineNumber(endLineNumber);
environmentStack.peek().setFunctionName(functionName);
environmentStack.peek().setStartLineNumber(startLineNumber);
... | 0 |
public long sort(String inputFile, String outputFile, String tmpdirectory, long numberLinePerFile,
int maxNumberOfFile, boolean saveKey, boolean keepTmp, String delimiter,
char escape, KeyGenerator keyGenerator, Filter filter) throws DiffException
{
if (maxNumberOfFile > MAX_FILE_NUMBER)
{
throw new Dif... | 9 |
private long removeRefBitcoinServer(long lIndex) {
//
// loop through the elements in the actual container, in order to find the one
// at lIndex. Once it is found, then loop through the reference list and remove
// the corresponding reference for that element.
//
BitcoinServer refActualElement = GetBitcoinServe... | 5 |
public int recorrerfin() throws FileNotFoundException, IOException {
long ap_actual, ap_final;
int contador = 0;
RandomAccessFile leer_archi = new RandomAccessFile("base_conocimiento", "r");
while ((ap_actual = leer_archi.getFilePointer()) != (ap_final = leer_archi.length())) {
... | 3 |
public static <T> List<T> select(String query, ReadGetter<T> rg,
ReadFilter<T> rf) {
List<T> container = new LinkedList<T>();
try {
ResultSet result = Database.getConnection().prepareStatement(query)
.executeQuery();
rg.takeResultSet(result);
T ref;
while (result.next()) {
ref = rg.read();
... | 4 |
public static void insertAbove(Node currentNode, JoeTree tree, OutlineLayoutManager layout) {
// Abort if node is not editable
if (!currentNode.isEditable()) {
return;
}
tree.clearSelection();
insertAboveText(currentNode, tree, layout);
} | 1 |
private boolean followsFileOrFolderLink(InputStream is, String str) throws IOException {
int i, c;
int pos = str.indexOf("master");
if (pos != -1) {
String beforeMaster = str.substring(0, pos);
String afterMaster = str.substring(pos+6);
//Syst... | 8 |
public static void main( String[] argv ) {
String filename = "document_root/system/errors/GenericError.template.html";
CustomLogger logger = new ikrs.util.DefaultCustomLogger("test");
Map<byte[],byte[]> replacementMap = new java.util.TreeMap<byte[],byte[]>( new ikrs.util.ByteArrayComparator() );
try {
rep... | 3 |
public String[] prettify(int arr, String prefix, String suffix)
{
String[] array = new String[keys.length];
int index = 0;
if(arr == 0)
{
for(String string : keys)
{
StringBuilder builder = new StringBuilder();
builder.append(prefix);
builder.append(string);
builder.append(suffix);
ar... | 3 |
public void setProtocol(FileProtocol protocol) {
this.protocol = protocol;
setText(protocol.getName());
} | 0 |
@Test
public void testCheckVictory() {
GameController gc = new GameController(paddle1,paddle2,ball,view,padq1,ballq1);
int radius = Ball.getSize();
//ball is not near paddle zone
boolean b = gc.checkDefeat();
if(b)
fail("Failure Trace: ");
//ball y=300
ball.setPosition(250, 300, 0);
b= gc.checkVi... | 9 |
@Override
public boolean addAll( Collection<? extends E> c ) {
vacuum();
int num = c.size();
if( num == 0 ) {
return false;
}
if( num > mThreshold ) {
int targetCap = (int)(num / mLoadFactor + 1);
if( targetCap > MAXIMUM_CAPACITY ) {
... | 8 |
public void ComputeBigWindowStatisticByToeflDataSet() throws IOException{
int correctAnswers = 0;
File testFile = new File(testFileName);
BufferedReader testReader = new BufferedReader(new FileReader(testFile));
String rdline;
int LineNo = 0;
String[] question = new String[6];
while ((rdline = t... | 9 |
int getScheduleFitness(Schedule s){
int scheduleFitness = 0;
for (RoomScheme[] schedule : s.schedule) {
for (RoomScheme sch: schedule) {
scheduleFitness += sch.getFitness();
}
} return scheduleFitness;
} | 2 |
public static final void exampleTemplate() {
System.out.println("Starting Cyc connection examples.");
try {
CycConstant cycAdministrator = access.getKnownConstantByName("CycAdministrator");
CycConstant generalCycKE = access.getKnownConstantByName("GeneralCycKE");
access.setCyclist(cycAdministr... | 3 |
public void setDepotlegal(String depotlegal) {
this.depotlegal = depotlegal;
} | 0 |
public void setIntellingentMovementHistory(
List<Integer> intellingentMovementHistory) {
this.intellingentMovementHistory = intellingentMovementHistory;
} | 0 |
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.