query
stringlengths
8
1.54M
document
stringlengths
9
312k
negatives
sequencelengths
19
20
metadata
dict
Marks the leaf "cellaccessmode" with operation "create".
public void markCellAccessModeCreate() throws JNCException { markLeafCreate("cellAccessMode"); }
[ "public void markMajorActionCreate() throws JNCException {\n markLeafCreate(\"majorAction\");\n }", "public void markMajorAbateCreate() throws JNCException {\n markLeafCreate(\"majorAbate\");\n }", "public void markMinorAbateCreate() throws JNCException {\n markLeafCreate(\"minorAbate\");\n }", "public void markMinorActionCreate() throws JNCException {\n markLeafCreate(\"minorAction\");\n }", "public void markUtilizedCreate() throws JNCException {\n markLeafCreate(\"utilized\");\n }", "public void markEnodebIdCreate() throws JNCException {\n markLeafCreate(\"enodebId\");\n }", "public void createAction ()\n\t{\n\t\tDefaultMutableTreeNode parent = getParentForCreate();\n\t\tif (null == parent)\n\t\t\treturn;\n\t\t\n\t\tcreateNode(parent);\n\t}", "public void markMajorOnsetCreate() throws JNCException {\n markLeafCreate(\"majorOnset\");\n }", "@Override\n public boolean isInCreateMode() {\n return true;\n }", "public void markVersionCreate() throws JNCException {\n markLeafCreate(\"version\");\n }", "public void markOdbPsCreate() throws JNCException {\n markLeafCreate(\"odbPs\");\n }", "public void create(String path,\n\t\t short mode,\n\t\t FUSEFileInfo fi) throws JFUSEException;", "public void markPlmnIdCreate() throws JNCException {\n markLeafCreate(\"plmnId\");\n }", "public void markEnodebTypeCreate() throws JNCException {\n markLeafCreate(\"enodebType\");\n }", "public void markCriticalAbateCreate() throws JNCException {\n markLeafCreate(\"criticalAbate\");\n }", "Leaf createLeaf();", "public void markEnodebNameCreate() throws JNCException {\n markLeafCreate(\"enodebName\");\n }", "public void markAvailableCreate() throws JNCException {\n markLeafCreate(\"available\");\n }", "public void markMinorOnsetCreate() throws JNCException {\n markLeafCreate(\"minorOnset\");\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The functions that a Cart item should have to interact with Database
public interface CartItemDao { /** * Add the cart item into cart * * @param cartItem */ void addCartItem(CartItem cartItem); /** * Remove the cart item from cart * * @param CartItemId */ void removeCartItem(int CartItemId); /** * Clear the cart * * @param cart */ void removeAllCartItems(Cart cart); }
[ "hipstershop.Demo.CartItem getItem();", "void addCartItem(CartItem cartItem);", "public void insertCart(Cart cart) throws UserApplicationException;", "public interface IShoppingCart {\n\t/**\n\t * add a simple product to the cart\n\t * \n\t * @param product\n\t */\n\tpublic Product addProduct(String name, String category, float price, int quantity);\n\n\t/**\n\t * change the amount of one product in the cart\n\t * \n\t * @param product\n\t * @param quantity\n\t */\n\tpublic Product changeAmount(String product, int quantity);\n\n\t/**\n\t * remove a existing product of the cart\n\t * \n\t * @param product\n\t */\n\tpublic Product removeProduct(String product);\n\n\t/**\n\t * \n\t * @return the Subtotal of the purchase\n\t */\n\tpublic float getSubtotal();\n\n\t/**\n\t * calculate the total of the purchase and delete all products of the cart\n\t * \n\t * @return total price\n\t */\n\tpublic float process();\n\n\t/**\n\t * \n\t * @return the amount of products in the list\n\t */\n\tpublic int amountProducts();\n\n\t/**\n\t * \n\t * @return the list of rows\n\t */\n\tpublic Collection<RowCart> getRows();\n}", "public void saveShoppingCart() throws BackendException;", "public interface CartRepository {\n\n void addToCart(Vehicle product, int countOfProduct);\n\n Map<Vehicle, Integer> getCartMap();\n\n void clearCart();\n}", "public void makeSavedCartLive();", "@SuppressWarnings({ \"rawtypes\", \"unchecked\" })\n\t@Override\n\tpublic boolean addItemToCart(CartDTO cartItem) throws RetailerException, ConnectException {\n\t\t// function variables\n\t\tboolean itemAddedToCart = false;\n\t\tString retailerId = cartItem.getRetailerId();\n\t\tString productId = cartItem.getProductId();\n\t\tint quantity = cartItem.getQuantity();\n\t\t\n\t\t// hibernate access variables\n\t\tSession session = null;\n\t\tSessionFactory sessionFactory = null;\n\t\tTransaction transaction = null;\n\t\t\n\t\ttry {\n\t\t\t// IOException possible\n\t\t\texceptionProps = PropertiesLoader.loadProperties(EXCEPTION_PROPERTIES_FILE);\n\t\t\t\n\t\t\tsessionFactory = HibernateUtil.getSessionFactory();\n\t\t\tsession = sessionFactory.getCurrentSession();\n\t\t\ttransaction = session.beginTransaction();\n\t\t\t\n\t\t\tQuery query = session.createQuery(HQLQuerryMapper.CART_ITEM_QTY_FOR_PRODUCT_ID);\n\t\t\tquery.setParameter(\"product_id\", productId);\n\t\t List<CartItemEntity> quant = (List<CartItemEntity>) query.list();\n\t\t \n\t\t Query query1 = session.createQuery(HQLQuerryMapper.GET_PRODUCT_QTY_FROM_DB);\n\t\t query1.setParameter(\"product_id\", productId);\n\t\t List<ProductEntity> availableQuants = (List<ProductEntity>) query1.list();\n\t\t \n\t\t if (quant.size() == 0) {\n\t\t \t// the user is adding this product to the cart for the first time\n\t\t\t if (quantity < availableQuants.get(0).getQuantity()) {\n\t\t\t \t// add this item to cart and reduce the quantity in PRODUCT table by quantity amount\n\t\t\t \tCartItemEntity obj = new CartItemEntity (retailerId, productId, quantity);\n\t\t\t \tsession.save(obj);\n\t\t\t \t\n\t\t\t \tQuery query3 = session.createQuery(HQLQuerryMapper. UPDATE_QTY_IN_PRODUCT);\n\t\t\t \tint availableQuantity = availableQuants.get(0).getQuantity();\n\t\t\t \tquery3.setParameter(\"quantity\", availableQuantity );\n\t\t\t \tquery3.setParameter(\"product_id\", productId);\n\t\t\t \tquery3.executeUpdate();\n\t\t\t \tavailableQuantity -= quantity;\n\t\t\t \titemAddedToCart = true;\n\t\t\t } else {\n\t\t\t \t// the requested number of items is not available\n\t\t\t \titemAddedToCart = false;\n\t\t\t \tGoLog.logger.error(exceptionProps.getProperty(\"prod_not_available\"));\n\t\t\t\t\tthrow new RetailerException(exceptionProps.getProperty(\"prod_not_available\"));\n\t\t\t }\n\t\t } else {\n\t\t \t// the user has previously added this item to his cart and is trying to increase quantity\n\t\t \tif (quantity < availableQuants.get(0).getQuantity()) {\n\t\t \t\t// add quantity to that already present in the cart and reduce the quantity in PRODUCT table by quantity amount\n\t\t \t\tQuery query4 = session.createQuery(HQLQuerryMapper.UPDATE_CART);\n\t\t \t\tint quantityPresent = quant.get(0).getQuantity();\n\t\t \t\tquery4.setParameter(\"product_id\", productId);\n\t\t \t\tquery4.executeUpdate();\n\t\t \t\tquantityPresent += quantity;\n\t\t \t\t\t \t\t\n\t\t\t \tQuery query3 = session.createQuery(HQLQuerryMapper. UPDATE_QTY_IN_PRODUCT);\n\t\t\t \tint availableQuantity = availableQuants.get(0).getQuantity();\n\t\t\t \tquery3.setParameter(\"quantity\", availableQuantity );\n\t\t\t \tquery3.setParameter(\"product_id\", productId);\n\t\t\t \tquery3.executeUpdate();\n\t\t\t \tavailableQuantity -= quantity;\n\t\t \t\titemAddedToCart = true;\n\t\t \t\t\n\t\t \t} else {\n\t\t \t\t// the requested quantity of items is not available \t\n\t\t \t\titemAddedToCart = false;\n\t\t \t\tGoLog.logger.error(exceptionProps.getProperty(\"prod_not_available\"));\n\t\t\t\t\tthrow new RetailerException(exceptionProps.getProperty(\"prod_not_available\"));\n\t\t \t}\n\t\t }\t\t \n\t\t} catch (IOException e) {\n\t\t\tGoLog.logger.error(e.getMessage());\n\t\t\tthrow new RetailerException (\"Could not open Error Properties File\");\n\t\t} catch (Exception e) {\n\t\t\t\n\t\t}\n\t\treturn itemAddedToCart;\n\t}", "void addProductToCartList(Product product);", "public interface CartService {\n\n\t/**\n\t * Returns all carts present in the system.\n\t * \n\t * @return list of carts\n\t */\n\tList<Cart> getAllCarts();\n\n\t/**\n\t * Returns cart for User Id\n\t * \n\t * @param userId the User Id\n\t * @return cart\n\t */\n\tCart getCartForUser(String userId);\n\n\t/**\n\t * Adds product to cart\n\t * \n\t * @param productCode the product code\n\t * @param quantity the quantity of product to be added\n\t * @param userId the User Id\n\t * @return updated cart\n\t */\n\tCart addToCart(String productCode, Long quantity, String userId);\n\n\t/**\n\t * Returns cart for cart code.\n\t * \n\t * @param orderCode the order code\n\t * @return cart\n\t */\n\tCart getCartForCode(String orderCode);\n\n\t/**\n\t * Removes product from cart\n\t * \n\t * @param code the product code\n\t * @param quantity the quantity of to be removed\n\t * @param userId the User Id\n\t * @return updated cart\n\t */\n\tCart deleteFromCart(String code, Long quantity, String userId);\n}", "public interface CartService {\n\n /**\n * Returns an instance of CartDTO representing a representation of an\n * existing cart.\n *\n * @param name name of the customer\n * @return cart of the user\n * @throws NotFoundException if the cart does not exist\n */\n CartDTO getCart(String name) throws NotFoundException;\n\n /**\n * Returns a list of CartItemDTOs representing the cart items from a\n * specific cart.\n *\n * @param username name of the customer where you want to retrieve items\n * @return list of all items from the targeted cart\n * @throws NotFoundException if the cart does not exist\n */\n List<CartItemDTO> getItems(String username) throws NotFoundException;\n\n /**\n * Add a product to cart.\n *\n * @param productId id of the desired product to add\n * @param username name of the customer where you want to add a product\n * @throws InternalServerErrorException if there is an error in the persistence\n * layer\n * @throws NotFoundException if the cart or the product do no exist\n */\n CartDTO addProduct(long productId, String username) throws InternalServerErrorException, NotFoundException, InsufficientStockException;\n\n /**\n * Delete a product from cart.\n *\n * @param productId id of the desired product to add\n * @param username name of the customer where you want to add a product\n * @throws InternalServerErrorException if there is an error in the persistence\n * layer\n * @throws NotFoundException if the cart or the product do no exist\n */\n CartDTO deleteProduct(long productId, String username) throws InternalServerErrorException, NotFoundException;\n}", "public void retrieveProductFromDatabase(){\r\n // retrieve product from the database here\r\n System.out.println(\"Product Retrieved using ID --> \" + this.productId);\r\n \r\n }", "List<CartModificationData> addDealToCart(AddDealToCartData addDealToCartData);", "public Cart findCartById(int cartId) throws UserApplicationException;", "public void insertDiscToCart(Disc disc, Cart cart) throws UserApplicationException;", "public void testdatenErzeugen(){\n\t\tCart_ cart = new Cart_();\n\t\tcart.setUserID(\"123\");\n\t\tcart.setTotalPrice(new BigDecimal(\"15.5\"));\n\t\tcart.setOid(UUID.randomUUID());\n\t\t\n\t\t//insert example data for CartItem_\n\t\tCartItem_ cartItem = new CartItem_();\n\t\tcartItem.setProduct(\"123\");\n\t\tcartItem.setQuantity(1L);\n\t\t\n\t\t// Set relations\n\t\tcart.getItems().add(cartItem);\n\t\t\n\t\t//Save all example Entities in an order that won't cause errors\n\t\tcartRepo.save(cart);\n\t}", "Cart getCartForUser(String userId);", "public interface DealCartFacade\n{\n\t/**\n\t * This method allows to add a deal to the cart\n\t *\n\t * @param addDealToCartData\n\t * @return list\n\t */\n\tList<CartModificationData> addDealToCart(AddDealToCartData addDealToCartData);\n\n\t/**\n\t * Checks whether current cart contains a deal.\n\t *\n\t * @return boolean\n\t */\n\tboolean isDealInCart();\n}", "public interface CartConstants {\n\n public static final String PREFIX_JSON_MSG = \"{\\\"message\\\":\\\"\";\n public static final String SUFFIX_JSON_MSG = \"\\\"}\";\n\n public static final String PRIMARY_KEY_DESC = \"primary key\";\n public static final String CART_ID = \"cart id\";\n public static final String CART_RESOURCE_NAME = \"cart\";\n public static final String CART_RESOURCE_PATH_ID_ELEMENT = \"id\";\n public static final String CART_RESOURCE_PATH_ID_PATH = \"/{\" + CART_RESOURCE_PATH_ID_ELEMENT + \"}\";\n \n \n public static final String GET_CART_OP_DESC = \"Retrieves list of carts\";\n public static final String GET_CART_OP_200_DESC = \"Successful, returning carts\";\n public static final String GET_CART_OP_403_DESC = \"Only admin's can list all carts\";\n public static final String GET_CART_OP_404_DESC = \"Could not find carts\";\n public static final String GET_CART_OP_403_JSON_MSG =\n PREFIX_JSON_MSG + GET_CART_OP_403_DESC + SUFFIX_JSON_MSG;\n \n public static final String GET_CART_BY_ID_OP_DESC = \"Retrieve specific cart\";\n public static final String GET_CART_BY_ID_OP_200_DESC = \"Successful, returning requested cart\";\n public static final String GET_CART_BY_ID_OP_403_DESC = \"Only user's can retrieve a specific cart\";\n //? Only user's can retrieve a specific cart\n public static final String GET_CART_BY_ID_OP_404_DESC = \"Requested cart not found\";\n public static final String GET_CART_OP_403_DESC_JSON_MSG =\n PREFIX_JSON_MSG + GET_CART_BY_ID_OP_403_DESC + SUFFIX_JSON_MSG;\n \n public static final String ADD_CART_OP_DESC = \"Add to list of Carts\";\n public static final String ADD_CART_OP_200_DESC = \"Successful, adding cart\";\n public static final String ADD_CART_OP_403_DESC = \"Only admin's can add carts\";\n public static final String ADD_CART_OP_404_DESC = \"Could not add cart\";\n \n public static final String OWNING_CUST_ID = \"customer id\";\n public static final String CART_RESOURCE_PATH_CUST_ID_PATH = \"/{\" + OWNING_CUST_ID + \"}\";\n public static final String CART_RESOURCE_PATH_CUST_ID_ELEMENT = \"customerId\";\n \n public static final String UPDATE_CART_OP_DESC = \"Update list of carts\";\n public static final String UPDATE_CART_OP_200_DESC = \"Successful, updating cart\";\n public static final String UPDATE_CART_OP_403_DESC = \"Only admin's can update cart\";\n public static final String UPDATE_CART_OP_404_DESC = \"Could not find cart\";\n \n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Pulls the column names from the fitting criteria columns for a single markov chain
private ArrayList<String> populateTableColumnNames(){ ArrayList<String> columnNames = new ArrayList<>(); if(this.digPopGUIInformation.getFittingCriteriaColumnNames() != null){ columnNames = this.digPopGUIInformation.getFittingCriteriaColumnNames(); } else{ //Census Value Names columnNames.addAll(Arrays.asList("ID","Census Region Trait" ,"Census Region Total","Survey Trait Table" ,"Survey Trait Select","Survey Trait Field" ,"Survey Total Table", "Survey Total Field" , "User Entered Description", "Trait Weight")); this.digPopGUIInformation.setFittingCriteriaColumnNames(columnNames); } return columnNames; }
[ "abstract String[] getColumnNamesForConstraint(String constraintName);", "private String generateColumnNames() {\n String text = SUBJECT_ID + DELIMITER\n + SUBJECT_AGE + DELIMITER\n + SUBJECT_GENDER + DELIMITER\n + LEFT_CHOICE + DELIMITER\n + RIGHT_CHOICE + DELIMITER\n + WHICH_SIDE_CORRECT + DELIMITER\n + WHICH_SIDE_PICKED + DELIMITER\n + IS_CORRECT + DELIMITER\n + DIFFICULTY + DELIMITER\n + DISTANCE + DELIMITER\n + LEFT_CHOICE_SIZE + DELIMITER\n + RIGHT_CHOICE_SIZE + DELIMITER\n + FONT_RATIO + DELIMITER\n + WHICH_SIZE_CORRECT + DELIMITER\n + WHICH_SIZE_PICKED + DELIMITER\n + NUMERICAL_RATIO + DELIMITER\n + RESPONSE_TIME + DELIMITER\n + DATE_TIME + DELIMITER\n + CONSECUTIVE_ROUND + \"\\n\";\n return text;\n }", "public FittingCriteria() {\n this.digPopGUIInformation = new DigPopGUIInformation();\n //load table\n myTable = populateTableModel(new MarkovChain());\n initComponents();\n \n setupCustomTable();\n }", "String[] getColumnNames();", "String framesetCols(FrameSet frameset) {\n return evaluator.attribute(frameset.id(), Attribute.cols);\n }", "public CyNetwork calcCols() {\n colDone = false;\n //Date date = new Date();\n //DRand RD = new DRand(date);\n //String RDS = RD.toString();\n //String uniqueTag = RDS.substring(RDS.length()-4,RDS.length());\n if (colNetName.equals(\"Cond Network\")) {\n nameNetwork();\n }\n return calcCols(colNetName + \": \" + colNegCutoff + \" & \" + colPosCutoff, colNegCutoff, colPosCutoff);\n }", "public String[] getColumnsName(ResultSet results) throws SQLException\n {\n ResultSetMetaData rsmd=results.getMetaData();\n int n=rsmd.getColumnCount();\n String[] names=new String[n];\n for(int i=1;i<=n;i++)\n {\n names[i-1]=rsmd.getColumnName(i);\n }\n return names;\n }", "com.factset.protobuf.stach.v2.table.ColumnDefinitionProto.ColumnDefinition getColumns(int index);", "public List<String> getColumnsName();", "List<Column> getQueryColumns();", "public Vector getColumnHeadings() {\n\tVector cols = new Vector();\n\tboolean addedGroupCol = false;\n\n\tcols.addElement(\"Epoch\");\n\n\tif (isAgg()) {\n\t //it's an agg; the columns that are returned\n\t //are the group and the aggregate value\n\t for (int i = 0; i < numExprs(); i++) {\n\t\tQueryExpr e = getExpr(i);\n\n\t\tif (e.isAgg()) {\n\t\t AggExpr ae = (AggExpr)e;\n\t\t if (ae.getGroupField() != -1 && !addedGroupCol) {\n\t\t\tcols.addElement(groupColName());\n\t\t\taddedGroupCol = true;\n\t\t }\n\t\t cols.addElement(ae.getAgg().toString() + \"(\" + getField(ae.getField()).getName() + \")\" );\n\n\t\t}\n\t }\n\t \n\t} else {\n\t //its a selection; the columns that are returned\n\t //are the exprs\n\t for (int i =0; i < numFields(); i++) {\n\t\tQueryField qf = getField(i);\n\t\tcols.addElement(qf.getName());\n\t }\n\n\t}\n\n\treturn cols;\n }", "public static String[] generatePredictorNames(MaxRGLMModel.MaxRGLMParameters parms) {\n List<String> excludedNames = new ArrayList<String>(Arrays.asList(parms._response_column));\n if (parms._ignored_columns != null)\n excludedNames.addAll(Arrays.asList(parms._ignored_columns));\n if (parms._weights_column != null)\n excludedNames.add(parms._weights_column);\n if (parms._offset_column != null)\n excludedNames.add(parms._offset_column);\n \n List<String> predNames = new ArrayList<>(Arrays.asList(parms.train().names()));\n predNames.removeAll(excludedNames);\n return predNames.toArray(new String[0]);\n }", "public List<String> getGridColumnNames() throws Exception {\n\n\t\tLog = Logger.getLogger(\"DashboardFunctions.class\");\n\t\tPropertyConfigurator.configure(\"log4j.properties\");\n\n\t\tList<WebElement> GridColumnCount = driver.findElements(By.xpath(config.getColumnssOnGrid()));\n\n\t\tStringBuilder Name = new StringBuilder();\n\t\tName = Name.append(config.getColumnAppend());\n\t\tint ColumnCount = GridColumnCount.size();\n\n\t\tList<String> ColumnNames = new ArrayList<String>();\n\n\t\tif (ColumnCount > 0) {\n\t\t\tfor (int ColumnNumber = 1; ColumnNumber <= ColumnCount; ColumnNumber++) {\n\t\t\t\tColumnNames.add(driver\n\t\t\t\t\t\t.findElement(By.xpath(Name.toString().replace(\"columnNumber\", String.valueOf(ColumnNumber))))\n\t\t\t\t\t\t.getAttribute(\"textContent\").toString().trim());\n\n\t\t\t//\tLog.info(\"Column Name loaded is \" + ColumnNames);\n\t\t\t}\n\t\t\tLog.info(\"Column Names loaded are \" + ColumnNames);\n\t\t\tLog.info(\"All Column Names are loaded Completely and Present on Grid \");\n\n\t\t} else {\n\t\t\tLog.info(\"Member Grid do not have any columns to prepare the list for validation\");\n\t\t\tColumnNames = null;\n\t\t}\n\t\treturn ColumnNames;\n\t}", "String[] getColumnSelectorNames();", "public String getColumnName();", "private String[] getHeaderColumns() {\n int length = CallLogQuery._PROJECTION.length;\n String[] columns = new String[length + 1];\n System.arraycopy(CallLogQuery._PROJECTION, 0, columns, 0, length);\n columns[length] = CallLogQuery.SECTION_NAME;\n return columns;\n }", "Variable[] allColumns();", "List<String> getColumns();", "public String getColumnName(int column);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generates a (relative) directory name based on a class name. Uses the appropriate separators for the platform.
public static String generateDirectorynameFromClassname(String classname) { // the generated directory name is usable on both Linux and Windows // (which uses \ as a separator). return OUTPUT_FOLDER_PREFIX + classname.replace('.', '/') + '/'; // File tmp = new File(OUTPUT_FOLDER_PREFIX + classname.replace('.', // '/') + '/'); // return tmp.getAbsolutePath(); }
[ "protected final String toClassFileName(final String name) {\n String className = name.replace('.', File.separatorChar);\n\n className = className.replace('/', File.separatorChar);\n\n className = className + \".class\";\n\n return className;\n }", "private String generateClassPath(String name) {\n\t\treturn path + generateObjectType(name);\n\t\t\n\t}", "private String getClassName(File classFile) {\n \tStringBuffer sb = new StringBuffer();\n \tString className = classFile.getPath().substring(sourceDir.length()+1);\n for (int i=0; i<className.length()-5; i++) {\n if (className.charAt(i) == '/' || className.charAt(i) == '\\\\') {\n sb.append('.');\n } else {\n sb.append(className.charAt(i));\n }\n }\n return sb.toString();\n }", "public String asClassFileName() {\r\n String fileName = getQualifiedClassName().replace('.', '/');\r\n return fileName + \".class\";\r\n }", "protected String getClassName(String fullPath) {\n\tfullPath = fullPath.trim();\n\tint lastSlash = fullPath.lastIndexOf('/');\n\tif (lastSlash == -1) {\n\t // Probably an error, but just in case we'll do this and let it\n\t // fail later.\n\t return JSP_CLASS_PREFIX+JspUtil.makeJavaIdentifier(fullPath);\n\t}\n\n\t// The packageName is the full path minus everything after last '/'\n\tString packageName = fullPath.substring(0, ++lastSlash);\n\n\t// The jspName is everything after the last '/'\n\tString jspName = fullPath.substring(lastSlash);\n\n\t// Make sure to get rid of any double slashes \"//\"\n\t//This may never happen to our application.\n\tfor (int loc=packageName.indexOf(\"//\"); loc != -1;\n\t\tloc=packageName.indexOf(\"//\")) {\n\t packageName = packageName.replaceAll(\"//\", \"/\");\n\t}\n\n\t// Get rid of leading '/'\n\tif (packageName.startsWith(\"/\")) {\n\t packageName = packageName.substring(1);\n\t}\n\n\t// Iterate through each part of path and call makeJavaIdentifier\n\tStringTokenizer tok = new StringTokenizer(packageName, \"/\");\n\tStringBuffer className = new StringBuffer(JSP_CLASS_PREFIX);\n\twhile (tok.hasMoreTokens()) {\n\t // Convert .'s to _'s + other conversions\n\t className.append(JspUtil.makeJavaIdentifier(tok.nextToken()));\n\t className.append('.');\n\t}\n\n\t// Add on the jsp name\n\tclassName.append(JspUtil.makeJavaIdentifier(jspName));\n/* Commenting out for now, log later\n\tif (Util.isLoggableFINER()) {\n\t Util.logFINER(\"CLASSNAME = \"+className);\n\t}\n*/\n\t// Return the classname\n\treturn className.toString();\n }", "private static String makeFolderName(){\n\t\tString folderNameFormat = props.getProperty(\"folderNameFormat\");\n\t\tif(folderNameFormat == null){\n\t\t\tfolderNameFormat = \"yyyyMMdd\";\n\t\t}\n\t\tSimpleDateFormat format = new SimpleDateFormat(folderNameFormat);\n\t\tString folderName = format.format(new Date());\n\t\treturn folderName;\n\t}", "private String expandClassName(String className) {\n\t\tString packageName = getPackageName();\n\t\tif (className.startsWith(\".\"))\n\t\t\treturn packageName + className;\n\t\telse if (!className.contains(\".\"))\n\t\t\treturn packageName + \".\" + className;\n\t\telse\n\t\t\treturn className;\n\t}", "protected static String pathToClassName(String path){\n \n String name=\"\";\n \n if(path!=null && ! path.equals(\"\") && path.endsWith(classExtension)){\n \n name=path.replace(resourceSep, classSep);\n name=name.substring(0, name.indexOf(classExtension));\n }\n \n return name;\n }", "public static String toResourcePath(String className) {\n return className.replace(PACKAGE_SEPARATOR, PATH_SEPARATOR);\n }", "private String getClassNameFromFile(File file) {\n\t\tStringBuilder result = new StringBuilder();\n\t\t\n\t\tFile curr = file;\n\t\tint pathCount = 0;\n\t\t\n\t\tdo {\n\t\t\tif (pathCount++ > 0) {\n\t\t\t\tresult.insert(0, \".\");\n\t\t\t}\n\t\t\tresult.insert(0, curr.getName().split(\"[\\\\.\\\\$]\",2)[0]);\n\t\t\tcurr = curr.getParentFile();\n\t\t} while(!curr.equals(classPathRootFile));\n\t\t\n\t\treturn result.toString();\n\t}", "private String getClassName (String classPath) {\n String[] path = classPath.split(\"[.]\");\n String str = path[path.length - 1];\n return str;\n }", "protected String nameToFileNameInRootGenerationDir(String name, String dirName)\n {\n // Ensure that the output directory exists for the location, if it has not already been created.\n if (!createdOutputDirectories.contains(dirName))\n {\n File dir = new File(dirName);\n dir.mkdirs();\n createdOutputDirectories.add(dirName);\n }\n\n // Build the full path to the output file.\n return dirName + File.separatorChar + name;\n }", "@Override\n public final String getDirname() {\n PathFragment parent = execPath.getParentDirectory();\n return (parent == null) ? \"/\" : parent.getSafePathString();\n }", "public static String constructQualifiedClassName(Symbol symbol) {\n String className = symbol.getLocation().orElseThrow().lineRange().fileName().replaceAll(BAL_FILE_EXT + \"$\", \"\");\n if (symbol.getModule().isEmpty()) {\n return className;\n }\n\n ModuleID moduleMeta = symbol.getModule().get().id();\n // for ballerina single source files, the package name will be \".\" and therefore,\n // qualified class name ::= <file_name>\n if (moduleMeta.packageName().equals(\".\")) {\n return className;\n }\n\n // for ballerina package source files,\n // qualified class name ::= <package_name>.<module_name>.<package_major_version>.<file_name>\n return new StringJoiner(\".\")\n .add(encodeModuleName(moduleMeta.orgName()))\n .add(encodeModuleName(moduleMeta.moduleName()))\n .add(moduleMeta.version().split(MODULE_VERSION_SEPARATOR_REGEX)[0])\n .add(className)\n .toString();\n }", "private String jarName(){\n // determine the name of this class\n String className=\"/\"+this.getClass().getName().replace('.','/')+\".class\";\n // find out where the class is on the filesystem\n String classFile=this.getClass().getResource(className).toString();\n\n if( (classFile==null) || !(classFile.startsWith(\"jar:\")) ) return null;\n \n // trim out parts and set this to be forwardslash\n classFile=classFile.substring(5,classFile.indexOf(className));\n classFile=FilenameUtil.setForwardSlash(classFile);\n\n // chop off a little bit more\n classFile=classFile.substring(4,classFile.length()-1);\n \n return FilenameUtil.URLSpacetoSpace(classFile);\n }", "String createName(String base);", "protected String nameToJavaFileName(String rootDirName, String prefix, String name, String postfix)\n {\n // Work out the full path to the location to write to.\n String packageName = (outputPackage != null) ? outputPackage : model.getModelPackage();\n\n return nameToJavaFileName(rootDirName, packageName, prefix, name, postfix);\n }", "private static String getFQClassName(final String root, final String path) {\r\n\t\t//Remove root from front of path and \".class\" from end of path\r\n\t\tString trimmed = path.substring(path.indexOf(root) + root.length(), path.indexOf(\".class\"));\r\n\t\t\r\n\t\t//Replace backslashes with periods\r\n\t\treturn trimmed.replaceAll(Matcher.quoteReplacement(\"\\\\\"), \".\");\r\n\t}", "static String compactClassName(String str) {\n return str.replace('/', '.'); // Is `/' on all systems, even DOS\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to create and write the output in a _Decoded.txt file
private void createDecodedFile(String decodedValues, String encodedFileName) throws Exception { String decodedFileName = encodedFileName.substring(0, encodedFileName.lastIndexOf(".")) + "_decoded.txt"; //FileWriter and BufferedWriter to write and it overwrites into the file. FileWriter fileWriter = new FileWriter(decodedFileName, false); BufferedWriter bufferedWriter = new BufferedWriter(fileWriter); bufferedWriter.write(decodedValues); //Flush and Close the bufferedWriter bufferedWriter.flush(); bufferedWriter.close(); }
[ "private void createDecodedFile() {\r\n try {\r\n //Keep iterating until all characters have been written to outfile\r\n int iter = 0; \r\n while(iter < characters) {\r\n //Continue reading file bytes until at a character leaf\r\n while(!tree.atLeaf()) {\r\n //Get the bit value \r\n int bit = input.readBit();\r\n \r\n //Determine which way to move through the tree\r\n if(bit == 0) {\r\n tree.moveToLeft();\r\n } else {\r\n tree.moveToRight();\r\n }\r\n }\r\n //Get the character leaf value\r\n int data = tree.current(); \r\n //Write out to file\r\n bw.write(data);\r\n //Reset current back to root\r\n tree.moveToRoot();\r\n //Increment since character has been found\r\n iter++;\r\n }\r\n \r\n //Close writer\r\n bw.close();\r\n } catch(Exception ex) {\r\n ex.printStackTrace();\r\n }\r\n }", "public void CreateDecodedFile(byte[] decoded_values, String File_Input, String alg) throws IOException {\n String FileName = File_Input.substring(0, File_Input.indexOf(\".\")) + \"_decoded\" + alg + \".txt\";\n\n FileOutputStream outputStream = new FileOutputStream(FileName);\n outputStream.write(decoded_values);\n outputStream.close();\n }", "private void writeDecodedFile(String fileName, String totalBinaryCodes, HuffmanTree Htree) {\n String tempKey = \"\";\n String originalText = \"\";\n \n System.out.println(\"totalBinaryCodes length: \" + totalBinaryCodes.length());\n \n final int ORIGINAL_BIN_LENGTH = totalBinaryCodes.length();\n \n while(totalBinaryCodes.length() > 0){\n tempKey = tempKey + totalBinaryCodes.substring(0, 1);\n totalBinaryCodes = totalBinaryCodes.substring(1);\n \n if (Htree.keyMap.containsKey((String) tempKey)){\n Character tempChar = (Character) Htree.keyMap.get(tempKey);\n originalText = originalText + tempChar.charValue();\n tempKey = \"\";\n }\n \n if (totalBinaryCodes.length() % 7500 == 0)\n if (totalBinaryCodes.length() - ORIGINAL_BIN_LENGTH > 0)\n frame.setTextArea(\"Encoded file loaded 100.00%!\\nDecoding encoded file \" + \n Double.toString( (totalBinaryCodes.length() - ORIGINAL_BIN_LENGTH)\n * 100.0 /ORIGINAL_BIN_LENGTH).substring(0, 5) + \"%...\");\n }\n frame.setTextArea(\"Encoded file loaded 100.00%!\\nDecoding encoded file completed!\"\n + \"\\n\\nEncoded file:\\n\\n\" + originalText);\n System.out.println(originalText);\n try{\n PrintWriter newWriter = new PrintWriter(new File(\n fileName.substring(0, fileName.length() - 4) + \"x.txt\"));\n newWriter.write(originalText);\n newWriter.close();\n \n } catch(IOException ex){\n System.out.println(ex.getMessage());\n }\n }", "private void encodeMessage() {\n encodedMessage = \"\";\n try(BufferedReader inputBuffer = Files.newBufferedReader(inputPath)) {\n String inputLine;\n while((inputLine = inputBuffer.readLine()) != null) {\n //walks the input message and builds the encode message\n for(int i = 0; i < inputLine.length(); i++) {\n encodedMessage = encodedMessage + codeTable[inputLine.charAt(i)];\n }\n encodedMessage = encodedMessage + codeTable[10];\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n //writes to the output file\n try(BufferedWriter outputBuffer = Files.newBufferedWriter(outputPath)) {\n outputBuffer.write(encodedMessage, 0, encodedMessage.length());\n outputBuffer.newLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }", "private static void writeDecodedFile (HuffmanNode root) throws IOException {\r\n HuffmanNode current = root;\r\n BufferedWriter bw = new BufferedWriter(new FileWriter(\"decoded.txt\"));\r\n File file = new File(binPath);\r\n byte[] data = new byte[(int) file.length()];\r\n DataInputStream dis = new DataInputStream(new FileInputStream(file));\r\n dis.readFully(data);\r\n dis.close();\r\n\r\n String temp;\r\n for (int i = 0; i < data.length; i++) {\r\n temp = Integer.toBinaryString((data[i] & 0xFF) + 0x100).substring(1);\r\n for (int bit = 0; bit < temp.length(); bit++) {\r\n if (temp.charAt(bit) == '1') {\r\n current = current.right;\r\n }\r\n else if (temp.charAt(bit) == '0') {\r\n current = current.left;\r\n }\r\n if (current.isLeaf()) {\r\n bw.write(current.data + \"\\n\");\r\n current = root;\r\n }\r\n }\r\n }\r\n bw.close();\r\n }", "public static void printOut(){\n try {\n PrintWriter fileOutput = new PrintWriter(\"a3q3out.txt\", \"UTF-8\");// output file creation\n fileOutput.println(\"The secret message (plaintext) is: \");\n fileOutput.println();\n fileOutput.println(plainText);\n fileOutput.close();\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (UnsupportedEncodingException e) {\n e.printStackTrace();\n }\n }", "@Override\n public void writeToFile() {\n try {\n String joinOutput = \" \";\n FileWriter f = new FileWriter(Driver.outFile);\n for (int i = 0; i < Driver.entireOutput.size(); i++) {\n joinOutput = joinOutput + Driver.entireOutput.get(i);\n joinOutput = joinOutput + \"\\n\";\n }\n f.write(joinOutput);\n f.close();\n MyLogger.writeMessage(\"Output.txt is generated\", MyLogger.DebugLevel.FILE_GENERATE);\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n }", "void outToFile(String file, String fileExtension, String tree, String encoded, int extraBits) throws IOException{ \n BufferedOutputStream stream = new BufferedOutputStream(new FileOutputStream(file+\".MZIP\"));\n \n try{\n \n //Write the file name\n for (int i =0; i<file.length(); i++){\n stream.write(file.charAt(i));\n }\n fileExtension = fileExtension.toUpperCase();\n for (int i = 0; i<fileExtension.length(); i++){\n stream.write(fileExtension.charAt(i));\n }\n if(encoded != null){ //If file has data, proceed to print the lines out\n //New line\n stream.write(13);\n stream.write(10);\n //Write the huffman tree on one line\n for (int i = 0; i<tree.length(); i++){\n stream.write(tree.charAt(i));\n }\n //New line\n stream.write(13);\n stream.write(10);\n //Write the leftover bits\n String extra = \" \" + extraBits;\n for(int i=1; i<extra.length();i++){\n stream.write(extra.charAt(i));\n }\n //New line\n stream.write(13);\n stream.write(10);\n //Write the encoded data\n int times;\n times = encoded.length()/8;\n for (int i=0;i<times;i++){\n stream.write(Integer.parseInt(encoded.substring(0,8),2));\n encoded = encoded.substring(8);\n }\n }\n } finally{\n if (stream != null) {\n stream.close();\n }\n }\n }", "public static void main(String[] args) {\n TextFileGenerator textFileGenerator = new TextFileGenerator();\n HuffmanTree huffmanTree;\n Scanner keyboard = new Scanner(System.in);\n PrintWriter encodedOutputStream = null;\n PrintWriter decodedOutputStream = null;\n String url, originalString = \"\", encodedString, decodedString;\n boolean badURL = true;\n int originalBits, encodedBits, decodedBits;\n\n while(badURL) {\n System.out.println(\"Please enter a URL: \");\n url = keyboard.nextLine();\n\n try {\n originalString = textFileGenerator.makeCleanFile(url, \"original.txt\");\n badURL = false;\n }\n catch(IOException e) {\n System.out.println(\"Error: Please try again\");\n }\n }\n\n huffmanTree = new HuffmanTree(originalString);\n encodedString = huffmanTree.encode(originalString);\n decodedString = huffmanTree.decode(encodedString);\n // NOTE: TextFileGenerator.getNumChars() was not working for me. I copied the encoded text file (pure 0s and 1s)\n // into google docs and the character count is accurate with the String length and not the method\n originalBits = originalString.length() * 16;\n encodedBits = encodedString.length();\n decodedBits = decodedString.length() * 16;\n\n decodedString = fixPrintWriterNewLine(decodedString);\n\n try { // creating the encoded and decoded files\n encodedOutputStream = new PrintWriter(new FileOutputStream(\"src\\\\edu\\\\miracosta\\\\cs113\\\\encoded.txt\"));\n decodedOutputStream = new PrintWriter(new FileOutputStream(\"src\\\\edu\\\\miracosta\\\\cs113\\\\decoded.txt\"));\n encodedOutputStream.print(encodedString);\n decodedOutputStream.print(decodedString);\n }\n catch(IOException e) {\n System.out.println(\"Error: IOException!\");\n }\n\n encodedOutputStream.close();\n decodedOutputStream.close();\n\n System.out.println(\"Original file bit count: \" + originalBits);\n System.out.println(\"Encoded file bit count: \" + encodedBits);\n System.out.println(\"Decoded file bit count: \" + decodedBits);\n System.out.println(\"Compression ratio: \" + (double)originalBits/encodedBits);\n }", "private void output() {\r\n\t\t// Write new contents to the file\r\n\t\ttry {\r\n\t\t\toutputFile = new File(outputPath);\r\n\t\t\t// Check if file already exists\r\n\t\t\tif (outputFile.exists() == false) {\r\n\t\t\t\toutputFile.createNewFile();\r\n\t\t\t}\r\n\t\t\t// Setup file writing\r\n\t\t\tFileWriter fw = new FileWriter(outputFile);\r\n\t\t\tBufferedWriter bw = new BufferedWriter(fw);\r\n\t\t\tbw.write(conversion);\r\n\t\t\tbw.close();\r\n\t\t\tfw.close();\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public void printDataToFile(){\n\ttry {\n\t File file = new File(\"media/gameOutput.txt\");\n \n\t // if file doesnt exists, then create it\n\t if (!file.exists()) {\n\t\tfile.createNewFile();\n\t }\n \n\t FileWriter fw = new FileWriter(file.getAbsoluteFile());\n\t BufferedWriter bw = new BufferedWriter(fw);\n\t bw.write(printString);\n\t bw.close();\n\t} catch (IOException e) {\n\t e.printStackTrace();\n\t}\n }", "public static String[] fileOutput() throws IOException{\n File swout = new File(swOutputFile), enout = new File(enOutputFile);\n FileWriter fwsw = new FileWriter(swout), fwen = new FileWriter(enout);\n\n Set<String> keys = sw.keySet();\n for(String s : keys){\n\n fwsw.write(sw.get(s) + \"\\n\");\n fwen.write(en.get(s) + \"\\n\");\n\n }\n\n fwsw.close();\n fwen.close();\n\n extend_MT();\n\n return new String[]{swOutputFile, enOutputFile, goldOutputFile, engoldOutputFile};\n }", "private static void textFilesOutput() {\n\n // make output directory if it doesn't already exist\n new File(\"output\").mkdirs();\n\n Output airportFlightCounter = new AirportFlightCounter(airports);\n Output flightInventory = new FlightInventory(flights);\n Output flightPassengerCounter = new FlightPassengerCounter(flights);\n Output mileageCounter = new MileageCounter(flights, airports);\n\n try {\n airportFlightCounter.toTextFile();\n flightInventory.toTextFile();\n flightPassengerCounter.toTextFile();\n mileageCounter.toTextFile();\n } catch (FileNotFoundException e) {\n logger.error(\"Could not write to one or more text files - please close any open instances of that file\");\n e.printStackTrace();\n }\n\n logger.info(\"Output to text files completed\");\n }", "private void export() {\n print(\"Outputting Instructions to file ... \");\n\n // Generate instructions right now\n List<Instruction> instructions = new ArrayList<Instruction>();\n convertToInstructions(instructions, shape);\n\n // Verify Instructions\n if (instructions == null || instructions.size() == 0) {\n println(\"failed\\nNo instructions!\");\n return;\n }\n\n // Prepare the output file\n output = createWriter(\"output/instructions.txt\");\n \n // TODO: Write configuration information to the file\n \n\n // Write all the Instructions to the file\n for (int i = 0; i < instructions.size(); i++) {\n Instruction instruction = instructions.get(i);\n output.println(instruction.toString());\n }\n\n // Finish the file\n output.flush();\n output.close();\n\n println(\"done\");\n }", "public void writeAsString(String m)\n {\n File textFile = new File(\"text.txt\");\n\n try (FileOutputStream fop = new FileOutputStream(textFile)) {\n\n // if file doesn't exists, then create it\n if (!textFile.exists()) {\n textFile.createNewFile();\n }\n\n // get the content in bytes\n byte[] contentInChar = m.getBytes();\n fop.write(contentInChar);\n fop.flush();\n fop.close();\n\n System.out.println(\"Done with decrypting and writing the Decryption into text.txt\");\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n\n}", "public void writeOutToFile() throws IOException {\r\n try (BufferedWriter writer = Files.newBufferedWriter(outName, ENCODING)) {\r\n for (String line : contents) {\r\n writer.write(line);\r\n writer.newLine();\r\n }\r\n }\r\n }", "private void writeOut() throws IOException {\n\t\t// Create a string buffer\n\t\tStringBuilder buffer = new StringBuilder();\n\t\t// append the prefix\n\t\tfor (int i = 0; i < huiSets.size(); i++) {\n\t\t\tbuffer.append(huiSets.get(i).itemset);\n\t\t\t// append the utility value\n\t\t\tbuffer.append(\"#UTIL: \");\n\t\t\tbuffer.append(huiSets.get(i).fitness);\n\t\t\tbuffer.append(System.lineSeparator());\n\t\t}\n\t\t// write to file\n\t\twriter.write(buffer.toString());\n\t\twriter.newLine();\n\t}", "public void writeCSV(){\n\t\tPrintWriter printer = null;\n\t\ttry {\n\t\t\tFile file = new File(\"./outputs/\"+\"testOutput.txt\"); //+encoder.getName());\n\t\t\tprinter = new PrintWriter(file);\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.out.println(\"Cannot print to target.\");\n\t\t\te.printStackTrace();\n\t\t}\n\t\tprinter.print(\"This is a test string\");\n\t\tprinter.print(\"This is a test string (x2!)\");\n\t\tprinter.close();\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "void fileWrite() {\r\n try {\r\n FileWriter fw = new FileWriter(fileout);\r\n BufferedWriter bw = new BufferedWriter(fw);\r\n for(int i = 0; i < results.size(); i++) {\r\n bw.write(results.get(i));\r\n bw.newLine();\r\n }\r\n bw.close();\r\n }\r\n catch(IOException ex) {\r\n System.out.println(\r\n \"Error reading file '\"\r\n + \"mpa3.in\" + \"'\");\r\n }\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the Bcc header field of this message to the specified address.
public void setBcc(Address bcc) { setAddressList(FieldName.BCC, bcc); }
[ "public void setBcc(Address... bcc) {\n setAddressList(FieldName.BCC, bcc);\n }", "public void setBccAddress(String strAddress) {\n\t\tif(strAddress!=null)\n\t\t{\n\t\t\tString[] alAddress = StringUtil.toArr(strAddress,\";\"); \n\t \tthis.bccAddress = new Address[alAddress.length]; \n\t \tfor (int i = 0; i < alAddress.length; i++)\n\t \t{\n\t \t\ttry {\n\t \t\t String temStr=alAddress[i];\n\t \t\t if(temStr!=null&&!\"\".equals(temStr.trim()))\n\t\t\t\t\tthis.bccAddress[i] = new InternetAddress(temStr.trim());\n\t\t\t\t} catch (AddressException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t} \t\n\t \t}\n\t\t}\n\t}", "public void bcc(String bcc) throws IOException {\n sendRcpt(bcc);\n // No need to keep track of Bcc'd addresses\n }", "public void addBcc(String... address) {\n\t\tbcc.addAll(java.util.Arrays.asList(address));\n\t}", "public void setCc(Address... cc) {\n setAddressList(FieldName.CC, cc);\n }", "@Override\n public void setBcc(String bcc) throws OscarMailException {\n this.bcc = new String[] {bcc};\n }", "public void setBcc(Object bcc) throws ApplicationException\t{\n \t\tif(StringUtil.isEmpty(bcc)) return;\n \t\ttry {\n \t\t\tsmtp.addBCC(bcc);\n \t\t} catch (Exception e) {\n \t\t\tthrow new ApplicationException(\"attribute [bcc] of the tag [mail] is invalid\",e.getMessage());\n \t\t}\n \t}", "public void addCc(String... address) {\n\t\tcc.addAll(java.util.Arrays.asList(address));\n\t}", "public void setCc(Address cc) {\n setAddressList(FieldName.CC, cc);\n }", "@Override\n public void setBcc(String[] bcc) throws OscarMailException {\n this.bcc = bcc;\n }", "public void cc(String cc) throws IOException {\n sendRcpt(cc);\n this.cc.addElement(cc);\n }", "public void setBcc(Collection<Address> bcc) {\n setAddressList(FieldName.BCC, bcc);\n }", "void addBcc(String email);", "public void set_address(String address){\n\t\tthis.mac_address = address;\n\t}", "public void setCc(Object cc) throws ApplicationException\t{\n \t\tif(StringUtil.isEmpty(cc)) return;\n \t\ttry {\n \t\t\tsmtp.addCC(cc);\n \t\t} catch (Exception e) {\n \t\t\tthrow new ApplicationException(\"attribute [cc] of the tag [mail] is invalid\",e.getMessage());\n \t\t}\n \t}", "@Override\n public void forceAddress(SimpleString address) {\n message.setAddress(address);\n }", "public void setCcAddress(String strAddress) {\n\t\tif(strAddress!=null)\n\t\t{\n\t\t\tString[] alAddress = StringUtil.toArr(strAddress,\";\"); \n\t \tthis.ccAddress = new Address[alAddress.length]; \n\t \tfor (int i = 0; i < alAddress.length; i++)\n\t \t{\n\t \t\ttry {\n\t \t\t String temStr=alAddress[i];\n\t \t\t if(temStr!=null&&!\"\".equals(temStr.trim()))\n\t\t\t\t\tthis.ccAddress[i] = new InternetAddress(temStr.trim());\n\t\t\t\t} catch (AddressException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t} \t\n\t \t}\n\t\t}\n\t}", "public void setAddress(Client cl, String address) {\n\t\tcl.setAddress(address);\n\t}", "public void setCSeq\n (CSeqHeader cseqHeader) {\n this.setHeader(cseqHeader);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the value of the 'PRPSL_AGCY_ID' field.
public org.LNDCDC_ADS_PRPSL.PRPSL_AGCY_XMAP.apache.nifi.LNDCDC_ADS_PRPSL_PRPSL_AGCY_XMAP.Builder setPRPSLAGCYID(java.lang.Long value) { validate(fields()[4], value); this.PRPSL_AGCY_ID = value; fieldSetFlags()[4] = true; return this; }
[ "public void setPRPSLAGCYID(java.lang.Long value) {\n this.PRPSL_AGCY_ID = value;\n }", "public void setPRPSLAGCYXMAPID(java.lang.Long value) {\n this.PRPSL_AGCY_XMAP_ID = value;\n }", "public java.lang.Long getPRPSLAGCYID() {\n return PRPSL_AGCY_ID;\n }", "public java.lang.Long getPRPSLAGCYID() {\n return PRPSL_AGCY_ID;\n }", "public org.LNDCDC_ADS_PRPSL.PRPSL_AGCY_XMAP.apache.nifi.LNDCDC_ADS_PRPSL_PRPSL_AGCY_XMAP.Builder setPRPSLAGCYXMAPID(java.lang.Long value) {\n validate(fields()[0], value);\n this.PRPSL_AGCY_XMAP_ID = value;\n fieldSetFlags()[0] = true;\n return this;\n }", "public org.LNDCDC_ADS_PRPSL.PROPOSAL_LINE.apache.nifi.LNDCDC_ADS_PRPSL_PROPOSAL_LINE.Builder setINITSRCAPPRGSTRYID(java.lang.Long value) {\n validate(fields()[23], value);\n this.INIT_SRC_APP_RGSTRY_ID = value;\n fieldSetFlags()[23] = true;\n return this;\n }", "public org.LNDCDC_ADS_PRPSL.PRPSL_AGCY_XMAP.apache.nifi.LNDCDC_ADS_PRPSL_PRPSL_AGCY_XMAP.Builder setAPPRGSTRYID(java.lang.Long value) {\n validate(fields()[5], value);\n this.APP_RGSTRY_ID = value;\n fieldSetFlags()[5] = true;\n return this;\n }", "public void setINITSRCAPPRGSTRYID(java.lang.Long value) {\n this.INIT_SRC_APP_RGSTRY_ID = value;\n }", "public org.LNDCDC_ADS_PRPSL.PRPSL_AGCY_XMAP.apache.nifi.LNDCDC_ADS_PRPSL_PRPSL_AGCY_XMAP.Builder clearPRPSLAGCYID() {\n PRPSL_AGCY_ID = null;\n fieldSetFlags()[4] = false;\n return this;\n }", "public void setSPCASPCLID(java.lang.CharSequence value) {\n this.SPCA_SPCL_ID = value;\n }", "public void setSPCAID(java.lang.Long value) {\n this.SPCA_ID = value;\n }", "public void setYgid(Long ygid) {\n\t\tthis.ygid = ygid;\n\t}", "public void setPCatgryId(Number value) {\n\t\tsetNumber(P_CATGRY_ID, value);\n\t}", "public java.lang.Long getPRPSLAGCYXMAPID() {\n return PRPSL_AGCY_XMAP_ID;\n }", "public org.LNDCDC_ADS_PRPSL.PRPSL_OTLT.apache.nifi.LNDCDC_ADS_PRPSL_PRPSL_OTLT.Builder setSRCSYSAPPRGSTRYID(java.lang.Long value) {\n validate(fields()[11], value);\n this.SRC_SYS_APP_RGSTRY_ID = value;\n fieldSetFlags()[11] = true;\n return this;\n }", "public org.LNDCDC_NCS_TCS.SPORT_CATEGORIES.apache.nifi.LNDCDC_NCS_TCS_SPORT_CATEGORIES.Builder setSPCASPCLID(java.lang.CharSequence value) {\n validate(fields()[1], value);\n this.SPCA_SPCL_ID = value;\n fieldSetFlags()[1] = true;\n return this;\n }", "public void setCY_CODE(BigDecimal CY_CODE) {\r\n this.CY_CODE = CY_CODE;\r\n }", "public java.lang.Long getPRPSLAGCYXMAPID() {\n return PRPSL_AGCY_XMAP_ID;\n }", "public void setAPPRGSTRYID(java.lang.Long value) {\n this.APP_RGSTRY_ID = value;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Editar VisitaFinalCasoCovid19 existente en la base de datos
public boolean editarVisitaFinalCasoCovid19(VisitaFinalCasoCovid19 visitacaso) throws Exception{ ContentValues cv = VisitaFinalCasoCovid19Helper.crearVisitaFinalCasoCovid19ContentValues(visitacaso); return mDb.update(Covid19DBConstants.COVID_VISITA_FINAL_CASO_TABLE , cv, Covid19DBConstants.codigoVisitaFinal + "='" + visitacaso.getCodigoVisitaFinal() + "'", null) > 0; }
[ "public boolean editarCuestionarioCovid19(CuestionarioCovid19 partcaso) throws Exception{\n\t\tContentValues cv = CuestionarioCovid19Helper.crearCuestionarioCovid19ContentValues(partcaso);\n\t\treturn mDb.update(Covid19DBConstants.COVID_CUESTIONARIO_TABLE, cv, Covid19DBConstants.codigo + \"='\"\n\t\t\t\t+ partcaso.getCodigo() + \"'\", null) > 0;\n\t}", "public boolean editarSintomasVisitaFinalCovid19(SintomasVisitaFinalCovid19 visitacaso) throws Exception{\n\t\tContentValues cv = SintomasVisitaFinalCovid19Helper.crearSintomasVisitaFinalCovid19ContentValues(visitacaso);\n\t\treturn mDb.update(Covid19DBConstants.COVID_SINT_VISITA_FINAL_CASO_TABLE , cv, Covid19DBConstants.codigoVisitaFinal + \"='\"\n\t\t\t\t+ visitacaso.getCodigoVisitaFinal() + \"'\", null) > 0;\n\t}", "public boolean editarDatosAislamientoVisitaCasoCovid19(DatosAislamientoVisitaCasoCovid19 DatosAislamientoVisitaCasoCovid19) throws Exception{\n\t\tContentValues cv = DatosAislamientoVisitaCasoCovid19Helper.crearDatosAislamientoVisitaCasoCovid19ContentValues(DatosAislamientoVisitaCasoCovid19);\n\t\treturn mDb.update(Covid19DBConstants.COVID_DATOS_AISLAMIENTO_VC_TABLE , cv, Covid19DBConstants.codigoAislamiento + \"='\"\n\t\t\t\t+ DatosAislamientoVisitaCasoCovid19.getCodigoAislamiento() + \"'\", null) > 0;\n\t}", "public boolean editarCasoCovid19(CasoCovid19 casacaso) throws Exception{\n\t\tContentValues cv = CasoCovid19Helper.crearCasoCovid19ContentValues(casacaso);\n\t\treturn mDb.update(Covid19DBConstants.COVID_CASOS_TABLE, cv, Covid19DBConstants.codigoCaso + \"='\"\n\t\t\t\t+ casacaso.getCodigoCaso() + \"'\", null) > 0;\n\t}", "public boolean editarVisitaFinalCaso(VisitaFinalCaso visitaFinal) throws Exception{\n ContentValues cv = VisitaFinalCasoHelper.crearVisitaFinalCasoContentValues(visitaFinal);\n return mDb.update(CasosDBConstants.VISITAS_FINALES_CASOS_TABLE , cv, CasosDBConstants.codigoParticipanteCaso + \"='\"\n + visitaFinal.getCodigoParticipanteCaso().getCodigoCasoParticipante() + \"'\", null) > 0;\n }", "public boolean editarCandidatoTransmisionCovid19(CandidatoTransmisionCovid19 partcaso) throws Exception{\n\t\tContentValues cv = CandidatoTransmisionCovid19Helper.crearCandidatoTransmisionCovid19ContentValues(partcaso);\n\t\treturn mDb.update(Covid19DBConstants.COVID_CANDIDATO_TRANSMISION_TABLE, cv, Covid19DBConstants.codigo + \"='\"\n\t\t\t\t+ partcaso.getCodigo() + \"'\", null) > 0;\n\t}", "public boolean editarParticipanteCovid19(ParticipanteCovid19 partcaso) throws Exception{\n\t\tContentValues cv = ParticipanteCovid19Helper.crearParticipanteCovid19ContentValues(partcaso);\n\t\treturn mDb.update(Covid19DBConstants.PARTICIPANTE_COVID_TABLE, cv, Covid19DBConstants.participante + \"=\"\n\t\t\t\t+ partcaso.getParticipante().getCodigo(), null) > 0;\n\t}", "public boolean editarVisitaSeguimientoCasoCovid19(VisitaSeguimientoCasoCovid19 visitacaso) throws Exception{\n\t\tContentValues cv = VisitaSeguimientoCasoCovid19Helper.crearVisitaSeguimientoCasoCovid19ContentValues(visitacaso);\n\t\treturn mDb.update(Covid19DBConstants.COVID_VISITAS_CASOS_TABLE , cv, Covid19DBConstants.codigoCasoVisita + \"='\"\n\t\t\t\t+ visitacaso.getCodigoCasoVisita() + \"'\", null) > 0;\n\t}", "public boolean editarParticipanteCasoCovid19(ParticipanteCasoCovid19 partcaso) throws Exception{\n\t\tContentValues cv = ParticipanteCasoCovid19Helper.crearParticipanteCasoCovid19ContentValues(partcaso);\n\t\treturn mDb.update(Covid19DBConstants.COVID_PARTICIPANTES_CASOS_TABLE, cv, Covid19DBConstants.codigoCasoParticipante + \"='\"\n\t\t\t\t+ partcaso.getCodigoCasoParticipante() + \"'\", null) > 0;\n\t}", "public boolean editarSintomasVisitaCasoCovid19(SintomasVisitaCasoCovid19 sintomasVisitaCasoCovid19) throws Exception{\n\t\tContentValues cv = SintomasVisitaCasoCovid19Helper.crearSintomasVisitaCasoCovid19ContentValues(sintomasVisitaCasoCovid19);\n\t\treturn mDb.update(Covid19DBConstants.COVID_SINTOMAS_VISITA_CASO_TABLE , cv, Covid19DBConstants.codigoCasoSintoma + \"='\"\n\t\t\t\t+ sintomasVisitaCasoCovid19.getCodigoCasoSintoma() + \"'\", null) > 0;\n\t}", "public void editar_ultima_vez(String id, String ultima_vez_compartida) {\n String sql = \"UPDATE publicaciones SET \"\n + \"ultima_vez_compartida = '\" + ultima_vez_compartida + \"' \"\n + \"WHERE id = \" + id;\n try (Connection conn = this.connect();\n PreparedStatement pstmt = conn.prepareStatement(sql)) {\n //EJECUTAMOS EL COMANDO\n pstmt.executeUpdate();\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }", "public boolean editarOtrosPositivosCovid(OtrosPositivosCovid partcaso) throws Exception{\n\t\tContentValues cv = CandidatoTransmisionCovid19Helper.crearOtrosPositivosCovidContentValues(partcaso);\n\t\treturn mDb.update(Covid19DBConstants.COVID_OTROS_POSITIVOS_TABLE, cv, Covid19DBConstants.codigo + \"='\"\n\t\t\t\t+ partcaso.getCodigo() + \"'\", null) > 0;\n\t}", "public boolean editarEncuestaCasa(EncuestaCasa encuestaCasa) {\n ContentValues cv = EncuestaCasaHelper.crearEncuestaCasaContentValues(encuestaCasa);\n return mDb.update(EncuestasDBConstants.ENCUESTA_CASA_TABLE, cv, EncuestasDBConstants.casa_chf + \"='\"\n + encuestaCasa.getCasa().getCodigoCHF() + \"'\", null) > 0;\n }", "public void crearDatosAislamientoVisitaCasoCovid19(DatosAislamientoVisitaCasoCovid19 DatosAislamientoVisitaCasoCovid19) throws Exception {\n\t\tContentValues cv = DatosAislamientoVisitaCasoCovid19Helper.crearDatosAislamientoVisitaCasoCovid19ContentValues(DatosAislamientoVisitaCasoCovid19);\n\t\tmDb.insertOrThrow(Covid19DBConstants.COVID_DATOS_AISLAMIENTO_VC_TABLE, null, cv);\n\t}", "public boolean editarVisitaSeguimientoCaso(VisitaSeguimientoCaso visitacaso) throws Exception{\n ContentValues cv = VisitaSeguimientoCasoHelper.crearVisitaSeguimientoCasoContentValues(visitacaso);\n return mDb.update(CasosDBConstants.VISITAS_CASOS_TABLE , cv, CasosDBConstants.codigoCasoVisita + \"='\"\n + visitacaso.getCodigoCasoVisita() + \"'\", null) > 0;\n }", "public boolean editarCasa(Casa casa) {\n\t\tContentValues cv = CasaHelper.crearCasaContentValues(casa);\n\t\treturn mDb.update(MainDBConstants.CASA_TABLE , cv, MainDBConstants.codigo + \"=\" \n\t\t\t\t+ casa.getCodigo(), null) > 0;\n\t}", "public void Editar(ProveedoresSQL prov) throws ClassNotFoundException, InstantiationException, IllegalAccessException{\n try {\n bd = new Conexion_SQL();\n \n String sql = \"update ProveedoresSQL set CodProd=?, Proveedor=?, Direccion=?, Ciudad=?, Telefono=?, RFC=?, CP=?, Correo=? where CodProd=?\";\n PreparedStatement ps = bd.Conectarse().prepareStatement(sql);\n ps.setString(1, prov.getCodProvee());\n ps.setString(2, prov.getNomProvee());\n ps.setString(3, prov.getDireccion());\n ps.setString(4, prov.getCiudad());\n ps.setLong(5, prov.getTelefono());\n ps.setString(6, prov.getRFC());\n ps.setInt(7, prov.getCP());\n ps.setString(8, prov.getCorreo());\n ps.setString(9, prov.getCodProvee());\n \n int n = ps.executeUpdate();\n \n if(n>0){\n JOptionPane.showMessageDialog(null, \"Registro Modificado Correctamente!\");\n bd.CerrarConexion();\n }\n \n } catch (SQLException ex) {\n Logger.getLogger(MantenimientoProveedoresSQL.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n }", "public void modificaVenta(Connection conexion,int idEmpleado, LocalDate fechaVenta){\n String query = \"UPDATE Transaccion.Venta SET idEmpleado = ?, FechaVenta = ? WHERE IdVenta = ?\";\n try{\n preparedStatement = conexion.prepareCall(query);\n preparedStatement.setInt(1, idEmpleado);\n preparedStatement.setDate(2, Date.valueOf(fechaVenta));\n preparedStatement.setInt(3,getIdVenta());\n int register = preparedStatement.executeUpdate();\n if(register > 0){\n JOptionPane.showMessageDialog(null, \"Se modificó correctamente\");\n }\n }\n catch(Exception ex){\n JOptionPane.showMessageDialog(null, \"Hubo un error en la modificación\");\n }\n }", "private void modificarReserva() throws Exception {\r\n\t\tif (mngRes.existeReservaPeriodo(getSitio().getId())) {\r\n\t\t\tif (mayorEdad) {\r\n\t\t\t\tmngRes.modificarReserva(getEstudiante(), periodo.getPrdId(), getSitio(), null);\r\n\t\t\t\tlibres = mngRes.traerLibres(getSitio().getId().getArtId());\r\n\t\t\t} else {\r\n\t\t\t\tmngRes.modificarReserva(getEstudiante(), periodo.getPrdId(), getSitio(),\r\n\t\t\t\t\t\tgetDniRepresentante() + \";\" + getNombreRepresentante());\r\n\t\t\t\tlibres = mngRes.traerLibres(getSitio().getId().getArtId());\r\n\t\t\t}\r\n\t\t\tMensaje.crearMensajeINFO(\"Reserva realizada correctamente, no olvide descargar su contrato.\");\r\n\t\t} else {\r\n\t\t\tMensaje.crearMensajeWARN(\"El sitio seleccionado ya esta copado, favor eliga otro.\");\r\n\t\t}\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Helper method. Forwards a request to the default dispatcher.
private void forward(final HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { RequestDispatcher rd = getServletContext().getNamedDispatcher("default"); rd.forward(request, response); }
[ "public void sendNowWith(RequestDispatcher viaThis);", "public void sendGlobalWith(RequestDispatcher viaThis);", "public void bindDefaultRequestHandler(DmpRequestProcessorIF requestProcessor);", "void dispatchRequest(String urlPath) throws Exception;", "public interface ActionDispatcher {\n\n /**\n * Dispatches the provided action to a proper handler that is responsible for handling of that action.\n * <p/> To may dispatch the incomming action a proper handler needs to be bound\n * to the {@link com.clouway.gad.dispatch.ActionHandlerRepository} to may the dispatch method dispatch the\n * incomming request to it.\n * \n * @param action the action to be handled\n * @param <T> a generic response type\n * @return response from the provided execution\n * @throws ActionHandlerNotBoundException is thrown in cases where no handler has been bound to handle that action\n */\n <T extends Response> T dispatch(Action<T> action) throws ActionHandlerNotBoundException;\n \n}", "protected void paramBasedReqestForward(SlingHttpServletRequest request,\r\n\t\t\tSlingHttpServletResponse response){\r\n\t\t\r\n\t\ttry {\r\n\t\t\tString forwardPath = (String) request.getParameter(\"fPath\");\r\n\t\t\tif(log.isDebugEnabled()){\r\n\t\t\t\tlog.debug(String.format(\"paramBasedReqestForward: forwardPath[%s]\", forwardPath));\r\n\t\t\t}\r\n\t\t\trequest.getRequestDispatcher(forwardPath).forward(request, response);\r\n\t\t} catch (ServletException e) {\r\n\t\t\tlog.error(String.format(\"paramBasedReqestForward: encountered ServletException\", e));\r\n\t\t} catch (IOException e) {\r\n\t\t\tlog.error(String.format(\"paramBasedReqestForward: encountered IOException\", e));\r\n\t\t}\r\n\t}", "public abstract String getRequestAction();", "@Override\n\tpublic void dispatch(Request request) {\n\t\tif(request instanceof ElevatorRequest){\n\t\t\tfor(RequestListener listener: listeners){\n\t\t\t\tlistener.handleRequest((ElevatorRequest)request);\n\t\t\t}\n\t\t}\n\t}", "public void handleRequest()\n\t{\n\n\t\tgetSuccessor().handleRequest();\n\t}", "void sendForward(HttpServletRequest request, HttpServletResponse response, String location) throws AccessControlException, ServletException, IOException;", "public DispatchedRequest(HttpServletRequest request, String redirectURL) throws ServletException\n {\n super(request);\n \n redirected = true;\n pushDispatch(new Dispatch(DispatchType.FORWARD, redirectURL));\n }", "@Override\n protected ModelAndView handleRequestInternal(final HttpServletRequest\n request, final HttpServletResponse response) throws Exception {\n log.trace(\"Entering handleRequestInternal\");\n\n ModelAndView mav = new ModelAndView(\"home\");\n\n log.trace(\"Leaving handleRequestInternal\");\n return mav;\n }", "protected void doForward(\r\n\t\tString uri,\r\n\t\tHttpServletRequest request,\r\n\t\tHttpServletResponse response)\r\n\t\tthrows IOException, ServletException {\r\n \r\n\t\t// Unwrap the multipart request, if there is one.\r\n\t\tif (request instanceof MultipartRequestWrapper) {\r\n\t\t\trequest = ((MultipartRequestWrapper) request).getRequest();\r\n\t\t}\r\n\r\n\t\tRequestDispatcher rd = getServletContext().getRequestDispatcher(uri);\r\n\t\tif (rd == null) {\r\n\t\t\tresponse.sendError(\r\n\t\t\t\tHttpServletResponse.SC_INTERNAL_SERVER_ERROR,\r\n\t\t\t\tgetInternal().getMessage(\"requestDispatcher\", uri));\r\n\t\t\treturn;\r\n\t\t}\r\n\t\trd.forward(request, response);\r\n\t}", "protected void internalModuleRelativeForward(\r\n\t\tString uri,\r\n\t\tHttpServletRequest request,\r\n\t\tHttpServletResponse response)\r\n\t\tthrows IOException, ServletException {\r\n \r\n\t\t// Construct a request dispatcher for the specified path\r\n\t\turi = moduleConfig.getPrefix() + uri;\r\n\r\n\t\t// Delegate the processing of this request\r\n\t\t// :FIXME: - exception handling?\r\n\t\tif (log.isDebugEnabled()) {\r\n\t\t\tlog.debug(\" Delegating via forward to '\" + uri + \"'\");\r\n\t\t}\r\n\t\tdoForward(uri, request, response);\r\n\t}", "private void forward(ServletRequest request, ServletResponse response, AuthTokenState state){\n\t\tRequestDispatcher dispatcher = null;\n\t\t\n\t\t/**\n\t\t * Following codes not work in case of couple with Spring Security !!!\n\t\t * FilterConfig filterConfig = this.getFilterConfig();\n\t\t * filterConfig.getServletContext().getRequestDispatcher(FILTER_PREFIX + ACT_REISSUE_TOKEN);\n\t\t **/\n\t\ttry {\n\t\t\tif(AuthTokenState.NEED_AUTHC == state){\n\t\t\t\n\t\t\t\tdispatcher = request.getRequestDispatcher(FILTER_PREFIX + ACT_AUTH_TOKEN);\n\t\t\t\n\t\t\t}else if(AuthTokenState.BAD_TOKEN == state ||\n\t\t\t\t\tAuthTokenState.GHOST_TOKEN == state ||\n\t\t\t\t\tAuthTokenState.INVALID_TOKEN == state){\n\t\t\t\n\t\t\t\tdispatcher = request.getRequestDispatcher(FILTER_PREFIX + ACT_BAD_TOKEN);\n\t\t\t\n\t\t\t}else if(AuthTokenState.EXPIRE_TOKEN == state){\n\t\t\t\t\n\t\t\t\tdispatcher = request.getRequestDispatcher(FILTER_PREFIX + ACT_EXPIRE_TOKEN);\n\t\t\t}else if(AuthTokenState.REISSUE_TOKEN == state){\n\t\t\t\t\n\t\t\t\tdispatcher = request.getRequestDispatcher(FILTER_PREFIX + ACT_REISSUE_TOKEN);\n\t\t\t}\n\t\t\telse{\n\t\t\t\t\n\t\t\t\tdispatcher = request.getRequestDispatcher(FILTER_PREFIX + ACT_TRAP_ALL);\n\t\t\t}\n\t\t\t\n\t\t\tdispatcher.forward(request, response);\n\t\t} catch (ServletException | IOException e) {\n\t\t\t\n\t\t\tLOGGER.error(\"fail to forward the request\", e);\n\t\t\t// ignore\n\t\t}\n\t}", "public ServletMappingDispatcher() {\n super(new ServletMethodResolver());\n }", "public void handleRequest(Request req) {\n\n }", "private void routeRequest(RoutingContext context) {\r\n\r\n\t\tSystem.out.println( \"GatewayService called...\");\r\n\r\n\t\t// get request path\r\n\t\tString path = context.request().uri();\r\n\r\n\t\tint port = 0;\r\n\r\n\t\t// get the port - crude - we obviously need a better service discovery process...!\r\n\t\tif(Arrays.stream(new String[]{\"/account\",\"/accountdetails/\"}).parallel().anyMatch(path::contains)) {\r\n\t\t\tport = 8082;\r\n\t\t}\r\n\t\telse if (Arrays.stream(new String[]{\"/limitorder\",\"/orderdetails/\"}).parallel().anyMatch(path::contains)) {\r\n\t\t\tport = 8083;\t\t\t\r\n\t\t}\t\t\r\n\r\n\t\tHttpClient client = vertx.createHttpClient();\r\n\r\n\t\tdispatch(context, port, path, client); \r\n\r\n\t}", "private Dispatcher getDispatcher()\r\n \t{\r\n \t\treturn getDirectory().getContext().getDispatcher();\r\n \t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
stop if there are some errors
public boolean proceedOnErrors() { return false; }
[ "public boolean abortOnFailedAnalysis()\n {\n return true;\n }", "private void error() {\n this.error = true;\n this.clients[0].error();\n this.clients[1].error();\n }", "public boolean hasContinueOnError();", "private void checkHalt() {\n if (state.getIsStop()) {\n console.shutdown();\n monitor.shutdown();\n System.exit(0);\n }\n }", "public boolean hasError();", "void recordExecutionError() {\n hadExecutionError = true;\n }", "private void checkTerminationCondition() {\n \n // If at least 30 detections were made, the app's end has been reached.\n if (detectionCount >= 30) {\n String newline = System.getProperty(\"line.separator\");\n System.out.println(newline + newline + \"Terminating due to machting condition.\" + newline + newline);\n \n driveForward = false;\n run = false;\n }\n }", "protected void userErrorOccurred()\n {\n traceOK = false;\n }", "private void raiseError() {\n System.out.println(\"Unexpected token at \" + currentTokenIndex);\n System.exit(1); //die.\n }", "@Override\n\tpublic void stop() {\n\t\tabort = true;\n\t}", "public synchronized boolean isFailed() {\n\t\treturn isStateError() || (exitValue != 0) || !checkOutputFiles().isEmpty();\n\t}", "private static void error( Exception e ) {\n e.printStackTrace();\n System.exit(-1);\n }", "public void breakDown() {\n\t\tbroken = true;\n\t}", "protected void firstFailure() {\n }", "protected boolean stopConditionLoop() {\n return false;\n }", "public void checkErrorLimit(int increment) {\n errorCounter += increment;\n if (errorCounter >= AppyAdService.getInstance().maxErrors()) {\n setAdProcessing(false);\n // todo ????\n }\n }", "boolean isFailed();", "public void checkError() {\n if (this.threadError != null) {\n throw new EncogError(this.threadError);\n }\n }", "public boolean foundError () {\n // alludes to how we will implement the other error catching\n return aquaponicsError();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if sensor is in hybrid mode
public boolean isHybridMode(long sensorAddress) throws SQLException { boolean isHybrid = false; PreparedStatement l_pstmt = m_db .prepareStatement("select sens_is_in_hybrid_mode from sensor where sens_address = ?"); l_pstmt.setLong(1, sensorAddress); ResultSet l_rs = l_pstmt.executeQuery(); if (l_rs.next()) isHybrid = l_rs.getBoolean(1); l_rs.close(); l_pstmt.close(); return isHybrid; }
[ "public boolean canDetectSensors();", "private boolean onlineMode() {\n SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);\n boolean allowed = preferences.getBoolean(Constants.PREF_ALLOW_TRACKING_WITHOUT_WLAN, false);\n\n ConnectivityManager connManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);\n NetworkInfo activeInfo = connManager.getActiveNetworkInfo();\n\n return (allowed && activeInfo != null && activeInfo.isConnected());\n }", "public boolean HasGotSensorCaps()\n {\n PackageManager pm = context.getPackageManager();\n\n // Require at least Android KitKat\n\n int currentApiVersion = Build.VERSION.SDK_INT;\n\n // Check that the device supports the step counter and detector sensors\n\n return currentApiVersion >= 19\n && pm.hasSystemFeature(PackageManager.FEATURE_SENSOR_STEP_COUNTER)\n && pm.hasSystemFeature(PackageManager.FEATURE_SENSOR_STEP_DETECTOR)\n && pm.hasSystemFeature(PackageManager.FEATURE_SENSOR_ACCELEROMETER);\n }", "boolean isSensorIsHigh();", "boolean hasSensorEvent();", "boolean isPlatform();", "private boolean isModeDriver()\n {\n return ledMode.getDouble(0.0) == LEDMode.OFF.modeValue && camMode.getDouble(0.0) == CamMode.DRIVER.modeValue;\n }", "boolean isInStandbyMode();", "@Schema(description = \"Flag indicating a hybrid organism.\")\n @Nullable\n public Boolean isHybrid() {\n return hybrid;\n }", "boolean hasDevicebrand();", "private boolean isSmartModeEnabled()\n {\n try\n {\n return Integer.parseInt((String) _smartModeComboBox.getSelectedItem()) > 0;\n }\n catch (NumberFormatException neverOccurs)\n {\n return false;\n }\n }", "public static boolean isAutoTechnologySwitch() { return cacheAutoTechnologySwitch.getBoolean(); }", "boolean needSensorRunningLp() {\n if (mSupportAutoRotation) {\n if (mCurrentAppOrientation == ActivityInfo.SCREEN_ORIENTATION_SENSOR\n || mCurrentAppOrientation == ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR\n || mCurrentAppOrientation == ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT\n || mCurrentAppOrientation == ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE) {\n // If the application has explicitly requested to follow the\n // orientation, then we need to turn the sensor on.\n return true;\n }\n }\n if ((mCarDockEnablesAccelerometer && mDockMode == Intent.EXTRA_DOCK_STATE_CAR) ||\n (mDeskDockEnablesAccelerometer && (mDockMode == Intent.EXTRA_DOCK_STATE_DESK\n || mDockMode == Intent.EXTRA_DOCK_STATE_LE_DESK\n || mDockMode == Intent.EXTRA_DOCK_STATE_HE_DESK))) {\n // enable accelerometer if we are docked in a dock that enables accelerometer\n // orientation management,\n return true;\n }\n if (mUserRotationMode == USER_ROTATION_LOCKED) {\n // If the setting for using the sensor by default is enabled, then\n // we will always leave it on. Note that the user could go to\n // a window that forces an orientation that does not use the\n // sensor and in theory we could turn it off... however, when next\n // turning it on we won't have a good value for the current\n // orientation for a little bit, which can cause orientation\n // changes to lag, so we'd like to keep it always on. (It will\n // still be turned off when the screen is off.)\n\n // When locked we can provide rotation suggestions users can approve to change the\n // current screen rotation. To do this the sensor needs to be running.\n return mSupportAutoRotation &&\n mShowRotationSuggestions == Settings.Secure.SHOW_ROTATION_SUGGESTIONS_ENABLED;\n }\n return mSupportAutoRotation;\n }", "public boolean getDeviceStatus();", "protected boolean isDndOn() {\n return mZenModeController.getZen() != Settings.Global.ZEN_MODE_OFF;\n }", "boolean hasDeviceRestriction();", "public boolean isAbovePlatform() { return isAbovePlatform; }", "private boolean isHIDGametelConnected() {\r\n return true;\r\n }", "public abstract boolean hasControlMode();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test of getMagnitude method, of class Unit.
@Test public void testGetMagnitude() { System.out.println("getMagnitude"); Unit instance = new Unit(); Magnitude expResult = null; Magnitude result = instance.getMagnitude(); assertEquals(expResult, result); // TODO review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
[ "@Test\n public void testSetMagnitude() {\n System.out.println(\"setMagnitude\");\n Magnitude magnitude = null;\n Unit instance = new Unit();\n instance.setMagnitude(magnitude);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }", "boolean testMag(Tester t) {\n return t.checkExpect(this.p6.magnitude(), 1) && t.checkExpect(this.p7.magnitude(), 1)\n && t.checkExpect(this.p2.magnitude(), 150);\n }", "@Test\r\n public void testMag() {\r\n double expected = 5;\r\n Complex c = new Complex(-4, -3);\r\n double actual = c.mag();\r\n assertEquals(expected, actual);\r\n \r\n }", "@Test\r\n public void testAppartentMagnitude() {\r\n System.out.println(\"appartentMagnitude\");\r\n \r\n // Test case one.\r\n System.out.println(\"Test case #1\"); \r\n \r\n double magnitude = 12;\r\n double distance = 200;\r\n \r\n SceneControl instance = new SceneControl();\r\n \r\n double expResult = 0.0003;\r\n double result = instance.appartentMagnitude(magnitude, distance);\r\n assertEquals(expResult, result, 0.0001);\r\n \r\n // Test case two.\r\n System.out.println(\"Test case #2\"); \r\n \r\n magnitude = 13;\r\n distance = -50;\r\n \r\n expResult = -999999;\r\n result = instance.appartentMagnitude(magnitude, distance);\r\n assertEquals(expResult, result, 0.0001);\r\n \r\n // Test case three.\r\n System.out.println(\"Test case #3\"); \r\n \r\n magnitude = 56;\r\n distance = 20;\r\n \r\n expResult = -999999;\r\n result = instance.appartentMagnitude(magnitude, distance);\r\n assertEquals(expResult, result, -999999);\r\n \r\n // Test case four.\r\n System.out.println(\"Test case #4\"); \r\n \r\n magnitude = 56;\r\n distance = 20;\r\n \r\n expResult = -999999;\r\n result = instance.appartentMagnitude(magnitude, distance);\r\n assertEquals(expResult, result, 0.0001);\r\n \r\n // Test case five.\r\n System.out.println(\"Test case #5\"); \r\n \r\n magnitude = 14;\r\n distance = 0;\r\n \r\n expResult = -999999;\r\n result = instance.appartentMagnitude(magnitude, distance);\r\n assertEquals(expResult, result, 0.0001);\r\n \r\n // Test case six.\r\n System.out.println(\"Test case #6\"); \r\n \r\n magnitude = -50;\r\n distance = 12;\r\n \r\n expResult = -0.3472;\r\n result = instance.appartentMagnitude(magnitude, distance);\r\n assertEquals(expResult, result, 0.0001);\r\n \r\n // Test case seven.\r\n System.out.println(\"Test case #7\"); \r\n \r\n magnitude = 50;\r\n distance = 20;\r\n \r\n expResult = 0.125;\r\n result = instance.appartentMagnitude(magnitude, distance);\r\n assertEquals(expResult, result, 0.0001);\r\n \r\n // Test case eight.\r\n System.out.println(\"Test case #8\"); \r\n \r\n magnitude = 13;\r\n distance = 1;\r\n \r\n expResult = 13;\r\n result = instance.appartentMagnitude(magnitude, distance);\r\n assertEquals(expResult, result, 0.0001);\r\n \r\n }", "boolean hasMagnitudeStatus();", "public void setMagnitude()\n {\n magnitude = (float) Math.sqrt(Math.pow(fx, 2) + Math.pow(fy, 2) + Math.pow(fz, 2));\n }", "public float getMagnitude() {\r\n\t\treturn Float.parseFloat(getProperty(\"magnitude\").toString());\r\n\t}", "public double getMagnitude() {\r\n\t\t\r\n\t\treturn Math.sqrt(Math.pow(real, 2) + Math.pow(imaginary, 2));\r\n\t}", "Unit getUnit();", "@Test\r\n public void testMedia() {\r\n EstatisticasUmidade e = new EstatisticasUmidade();\r\n e.setValor(5.2);\r\n e.setValor(7.0);\r\n e.setValor(1.3);\r\n e.setValor(6);\r\n e.setValor(0.87);\r\n double result= e.media(1);\r\n assertArrayEquals(\"ESPERA RESULTADO\", 5.2 , result, 0.1);\r\n }", "@Test\n\tpublic void testGetCarSpeed() {\n\t\tSystem.out.println(\"getCarSpeed\");\n\t\tMeasure expResult = new Measure(22.2, \"km\");\n\t\tthis.step.setCarSpeed(expResult);\n\t\tassertEquals(expResult, this.step.getCarSpeed());\n\t}", "String getUnit();", "public double getMagnitude() {\n\t\treturn Math.sqrt(Math.pow(real, 2) + Math.pow(imaginary, 2));\n\t}", "public double getMagnitude() {\n\t\treturn Math.sqrt(imaginary * imaginary + real * real);\n\t}", "public void setMagnitude(int magnitude)\r\n {\r\n this.magnitude = magnitude; \r\n }", "private void countMagnitudes(){\n\t\tif(!transformed){\n\t\t\ttransform();\n\t\t}\n\t\t\n\t\tfor (int i = 0; i< (toTransform.length / 2); i++){\n\t\t\tdouble re = toTransform[2*i];\n\t\t\tdouble im = toTransform[2*i+1];\n\t\t\tmagnitudes[i] = Math.sqrt(re*re + im*im);\n\t\t}\n\t}", "public double magnitude(){\n return Math.sqrt((this.x * this.x) + (this.y * this.y));\n }", "public double getMagnitude() {\n\t\treturn Math.sqrt(real * real + imaginary * imaginary);\n\t}", "public void setMagnitude(float magnitude) {\n this.magnitude = magnitude;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sorts an array of clocks in place, using insertion sorting. Used public because the method needs to be accessed from outside, void because the method does not return something
public void inPlaceInsertionSort(Clock [] s){ int x; int i; Clock temp= new Clock(0,0,0); for(x=1;x<s.length;x++){ temp = s[x]; for (i=x-1;(i>=0)&&(s[i].isAfter(temp));i--){ s[i+1]= s[i]; } s[i+1]=temp; } }
[ "@Test\n public void testInsertionSort() {\n Integer[] copy = Arrays.copyOf(data, data.length);\n System.out.println(\"\\nUnsorted Data\");\n sorter.timedSort(SortAlgorithm.INSERTION, copy, comp);\n assertTrue(\"Not sorted\", isSorted(copy, comp));\n System.out.println(\"\\nSorted Data\");\n sorter.timedSort(SortAlgorithm.INSERTION, copy, comp);\n assertTrue(\"Not sorted\", isSorted(copy, comp));\n }", "private void insertionSort() {\r\n\t\t//Runs through the 30 arrays.\r\n\t\tfor (int i = 0; i < 30; i++)\r\n\t\t\tSorting.insertionSort(array[i]);\r\n\t}", "private void happyHourSort() {\r\n\t\t//Runs through the 30 arrays.\r\n\t\tfor (int i = 0; i < 30; i++)\r\n\t\t\tSorting.happyHourSort(array[i], array[i].length);\r\n\t}", "public void insertionSort() {\n Comparable p = (Comparable) array[0];\n Comparable[] sorted = new Comparable[array.length];\n sorted[0] = p;\n for (int i = 0; i < array.length - 1; i++) {\n if (p.compareTo(array[i + 1]) < 0) {\n p = (Comparable) array[i + 1];\n sorted[i + 1] = p;\n } else {\n Comparable temp = (Comparable) array[i + 1];\n int j = i;\n while (j >= 0 && sorted[j].compareTo(array[i + 1]) > 0) {\n j--;\n }\n for (int q = i; q > j; q--) {\n sorted[q + 1] = sorted[q];\n }\n sorted[j + 1] = temp;\n }\n }\n this.array = (T[]) sorted;\n }", "public void sort(long[] array, boolean ascending);", "public void sort(long[] array, boolean ascending, int from, int to);", "public void sort(long[] array);", "public void sort() {\r\n int k = start;\r\n for (int i = 0; i < size - 1; i++) {\r\n int p = (k + 1) % cir.length;\r\n for (int j = i + 1; j < size; j++) {\r\n if ((int) cir[p] < (int) cir[k % cir.length]) {\r\n Object temp = cir[k];\r\n cir[k] = cir[p];\r\n cir[p] = temp;\r\n }\r\n p = (p + 1) % cir.length;\r\n }\r\n k = (k + 1) % cir.length;\r\n }\r\n }", "static double [] insertionSort (double a[]){\r\n \t\r\n \tfor(int i = 1; i < a.length; i++) {\r\n \t\t\r\n \t\tint j = i - 1;\r\n \t\tdouble currentKey = a[i];\r\n \t\t\r\n \t\t// If j is not less than 0 and is greater than the currentKey\r\n \t\t// move it up one position in the array and decrement j\r\n \t\twhile(j >= 0 && a[j] > currentKey)\r\n \t\t\ta[j + 1] = a[j--];\r\n \t\t\r\n \t\t// Swap currentKey with a[j+1]\r\n \t\t// (i.e put currentKey in the position where the key to its right\r\n \t\t// is greater than currentKey and the key to its left is less than\r\n \t\t// or equal to currentKey\r\n \t\ta[j + 1] = currentKey;\t\t\r\n \t}\r\n \r\n \treturn a;\r\n }", "private static Long[] sortTimestamps(Long[] ts) {\n\t\tfor (int i = 0; i < ts.length - 1; i++) {\n\t\t\tfor (int j = 1; j < ts.length; j++) {\n\t\t\t\tif (ts[j] < ts[i]) {\n\t\t\t\t\tlong temp = 0;\n\t\t\t\t\ttemp = ts[i];\n\t\t\t\t\tts[i] = ts[j];\n\t\t\t\t\tts[j] = temp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn ts;\n\t}", "@Test\r\n public void testSort() {\r\n System.out.println(\"sort\");\r\n int[] array = {6, 3, 7, 9, 4, 1, 3, 7, 0};\r\n int[] expResult = {0, 1, 3, 3, 4, 6, 7, 7, 9};\r\n\r\n int[] result = new InsertionSort().sort(array);\r\n\r\n assertArrayEquals(expResult, result);\r\n \r\n array = new int[10000];\r\n for (int i = 0; i < array.length; i++) {\r\n array[i] = new Random().nextInt(Integer.MAX_VALUE);\r\n }\r\n expResult = Arrays.copyOf(array, array.length);\r\n Arrays.sort(expResult);\r\n \r\n result = new InsertionSort().sort(array);\r\n\r\n assertArrayEquals(expResult, result);\r\n }", "public void sort(long[] array, int from, int to);", "static double [] insertionSort (double a[]){\r\n \tdouble temp;\r\n \tfor(int i=1; i<a.length; i++)\r\n\t\t{\r\n\t\t\tfor(int j=i;j>0;j--)\r\n\t\t\t{\r\n\t\t\t\tif(a[j]<a[j-1])\r\n\t\t\t\t{\r\n\t\t\t\t\ttemp = a[j];\r\n\t\t\t\t\ta[j] = a[j-1];\r\n\t\t\t\t\ta[j-1] = temp;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn a;\r\n //todo: implement the sort\r\n }", "@Test\n public void shellSort() {\n int[] array = {57, 68, 59, 52, 72, 28, 96, 33, 24};\n int[] arrayEx = {24, 28, 33, 52, 57, 59, 68, 72, 96};\n for (int gap = array.length / 2; gap > 0; gap = gap / 2) {\n for (int i = gap; i < array.length; i++) {\n int tmp = array[i];\n int j = i;\n\n for (; j >= gap && tmp < array[j - gap]; j -= gap) {\n array[j] = array[j - gap];\n }\n array[j] = tmp;\n }\n }\n\n printResult(array, arrayEx);\n\n }", "public void sort() {\n\t\tthis.sort(\"qk\", \"dt\", 1);\n\t}", "void sort() {\n\t\tint n = array.length;\n\t\tint temp = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tfor (int j = 1; j < (n - i); j++) {\n\t\t\t\tif (array[j - 1] > array[j]) { // if the first term is larger\n\t\t\t\t\t\t\t\t\t\t\t\t// than the last term, then the\n\t\t\t\t\t\t\t\t\t\t\t\t// temp holds the previous term\n\t\t\t\t\ttemp = array[j - 1];\n\t\t\t\t\tarray[j - 1] = array[j];// swaps places within the array\n\t\t\t\t\tarray[j] = temp;\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t}", "public void sortSpeeds() {\n\n//\t\tSystem.out.println(\"BEGIN: SORT SPEEDS\");\n\t\tthis.printMoves();\n\n\t\tArrayList<Move> temp = new ArrayList<Move>();\n\t\tint i = 1;\n\t\tint x = 0;\n\t\tboolean y = true;\n\n\t\ttemp.add(niceMoves.get(0));\n\t\tint size = niceMoves.size();\n\n\t\twhile (i < niceMoves.size()) {\n\n//\t\t\tSystem.out.println(\"Reiterating.\");\n\t\t\ty = true;\n\n\t\t\twhile (y) {\n\n\t\t\t\t//System.out.println(\"I: \" + i + \" X: \" + x);\n\n\t\t\t\ttry {\n\n\t\t\t\t\tif (niceMoves.get(i).getSpeed() > temp.get(x).getCalcedSpeed()) {\n\n//\t\t\t\t\t\tSystem.out.println(\"Adding \" + niceMoves.get(i).getCaster() + \" to spot \" + x);\n\t\t\t\t\t\ttemp.add(x, niceMoves.get(i));\n\t\t\t\t\t\ty = false;\n\t\t\t\t\t}\n\t\t\t\t\t//X has cycled through temp, meaning nicemoves.i should be added to the end\n\t\t\t\t\t//The only way to check for this is to let it overflow lol\n\t\t\t\t} catch (Exception E) {\n//\t\t\t\t\tSystem.out.println(\"Adding \" + niceMoves.get(i).getCaster() + \" to spot \" + x);\n\t\t\t\t\ttemp.add(x, niceMoves.get(i));\n\t\t\t\t\ty = false;\n\n\t\t\t\t}\n\n\t\t\t\tx += 1;\n\t\t\t}\n\n\t\t\ti += 1;\n\t\t\tx = 0;\n\t\t}\n\n\t\tniceMoves = temp;\n\n//\t\tSystem.out.println();\n//\t\tSystem.out.println(\"Sorting Complete! New Order: \");\n//\t\tthis.printMoves();\n\t\t//end of sort speeds\n\t}", "private static void allSorts(int[] array) {\n\t\tSystem.out.printf(\"%12d\",array.length);\n\t\tint[] temp;\n\t\tStopWatch1 timer;\n\t\t\n\t\t//Performs bubble sort\n\t\ttimer = new StopWatch1();\n\t\ttemp = copyArray(array);\n\t\ttimer.start();\n\t\tSort.bubbleSort(temp);\n\t\ttimer.stop();\n\t\tSystem.out.printf(\"%10d\",timer.getElapsedTime());\n\t\tfourSorts(array);\n\t\tSystem.out.println();\n\t}", "@Test\r\n\tpublic void testSortInsert() throws FileNotFoundException {\n\t\tsw.start();\r\n\t\tInsertion.sortInsert(wordArray16);\r\n\t\tsw.stop();\r\n\t\tt11 = sw.getNanoTime();\r\n\t\tsw.reset();\r\n\r\n//Starts stop watch, performs simple insertion sort on 256 word array, stores result in t12, stops and resets timer\r\n\t\tsw.start();\r\n\t\tInsertion.sortInsert(wordArray256);\r\n\t\tsw.stop();\r\n\t\tt12 = sw.getNanoTime();\r\n\t\tsw.reset();\r\n\r\n//Starts stop watch, performs simple insertion sort on 4096 word array, stores result in t13, stops and resets timer\r\n\t\tsw.start();\r\n\t\tInsertion.sortInsert(wordArray4096);\r\n\t\tsw.stop();\r\n\t\tt13 = sw.getNanoTime();\r\n\t\tsw.reset();\r\n\t\t\r\n\t\tassertTrue(Insertion.isSorted(wordArray16));\r\n\t\tassertTrue(Insertion.isSorted(wordArray256));\r\n\t\tassertTrue(Insertion.isSorted(wordArray4096));\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Represents the status of the changed resource. .google.ads.googleads.v0.enums.ChangeStatusOperationEnum.ChangeStatusOperation resource_status = 8;
public com.google.ads.googleads.v0.enums.ChangeStatusOperationEnum.ChangeStatusOperation getResourceStatus() { @SuppressWarnings("deprecation") com.google.ads.googleads.v0.enums.ChangeStatusOperationEnum.ChangeStatusOperation result = com.google.ads.googleads.v0.enums.ChangeStatusOperationEnum.ChangeStatusOperation.valueOf(resourceStatus_); return result == null ? com.google.ads.googleads.v0.enums.ChangeStatusOperationEnum.ChangeStatusOperation.UNRECOGNIZED : result; }
[ "public com.google.ads.googleads.v0.enums.ChangeStatusOperationEnum.ChangeStatusOperation getResourceStatus() {\n @SuppressWarnings(\"deprecation\")\n com.google.ads.googleads.v0.enums.ChangeStatusOperationEnum.ChangeStatusOperation result = com.google.ads.googleads.v0.enums.ChangeStatusOperationEnum.ChangeStatusOperation.valueOf(resourceStatus_);\n return result == null ? com.google.ads.googleads.v0.enums.ChangeStatusOperationEnum.ChangeStatusOperation.UNRECOGNIZED : result;\n }", "com.google.ads.googleads.v1.resources.ChangeStatus getChangeStatus();", "public Builder setResourceStatus(com.google.ads.googleads.v0.enums.ChangeStatusOperationEnum.ChangeStatusOperation value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n resourceStatus_ = value.getNumber();\n onChanged();\n return this;\n }", "com.google.ads.googleads.v6.resources.ChangeStatus getChangeStatus();", "com.google.ads.googleads.v1.resources.ChangeStatusOrBuilder getChangeStatusOrBuilder();", "com.google.ads.googleads.v6.resources.ChangeStatusOrBuilder getChangeStatusOrBuilder();", "@java.lang.Override\n public com.google.cloud.compute.v1.ResourceStatus getResourceStatus() {\n return resourceStatus_ == null\n ? com.google.cloud.compute.v1.ResourceStatus.getDefaultInstance()\n : resourceStatus_;\n }", "@java.lang.Override\n public com.google.cloud.compute.v1.ResourceStatusOrBuilder getResourceStatusOrBuilder() {\n return resourceStatus_ == null\n ? com.google.cloud.compute.v1.ResourceStatus.getDefaultInstance()\n : resourceStatus_;\n }", "public String getResourceStatus() {\n return this.resourceStatus;\n }", "public com.google.ads.googleads.v0.enums.ChangeStatusResourceTypeEnum.ChangeStatusResourceType getResourceType() {\n @SuppressWarnings(\"deprecation\")\n com.google.ads.googleads.v0.enums.ChangeStatusResourceTypeEnum.ChangeStatusResourceType result = com.google.ads.googleads.v0.enums.ChangeStatusResourceTypeEnum.ChangeStatusResourceType.valueOf(resourceType_);\n return result == null ? com.google.ads.googleads.v0.enums.ChangeStatusResourceTypeEnum.ChangeStatusResourceType.UNRECOGNIZED : result;\n }", "com.google.container.v1beta1.Operation.Status getStatus();", "public com.google.ads.googleads.v0.enums.ChangeStatusResourceTypeEnum.ChangeStatusResourceType getResourceType() {\n @SuppressWarnings(\"deprecation\")\n com.google.ads.googleads.v0.enums.ChangeStatusResourceTypeEnum.ChangeStatusResourceType result = com.google.ads.googleads.v0.enums.ChangeStatusResourceTypeEnum.ChangeStatusResourceType.valueOf(resourceType_);\n return result == null ? com.google.ads.googleads.v0.enums.ChangeStatusResourceTypeEnum.ChangeStatusResourceType.UNRECOGNIZED : result;\n }", "public Integer getOperationStatus() {\n return operationStatus;\n }", "@ApiModelProperty(value = \"Possible values: 1: Pending 2: Failed 3: Scheduled 4: Pending_Rev 5: Failed_Rev 6: Scheduled_Rev \")\n public Integer getStatus() {\n return status;\n }", "public java.lang.String getOperationStatus() {\r\n return operationStatus;\r\n }", "@ApiModelProperty(required = true, value = \"The new status of the alert level\")\n public StatusEnum getStatus() {\n return status;\n }", "@javax.annotation.Nullable\n @ApiModelProperty(example = \"scheduled\", value = \"The incident status. For realtime incidents, valid values are investigating, identified, monitoring, and resolved. For scheduled incidents, valid values are scheduled, in_progress, verifying, and completed.\")\n\n public StatusEnum getStatus() {\n return status;\n }", "@Schema(example = \"PAID\", description = \"Status of the refund. Status Description: --- - PENDING > The refund has been scheduled and will be completed as soon as there is enough money in the account. If there is not enough money in the account on a particular day, the refund will be carried over to the next day, and completed when the amount is available. > The refund will remain in a scheduled state indefinitely, until the amount is available and the refund is executed. - PAID > The refund has been paid out. \")\n public StatusEnum getStatus() {\n return status;\n }", "public CMnServicePatch.RequestStatus getStatus() {\n return status;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Dokumentacni komentar metody na zaklade hlavnich parametru obrazovky, vypocet parametru: PPI na vysku a na sirku a vypocet horizontalni roztec bodu "pitch"
public static void main(String[] args) { //zakladni parametry obrazovky int hSize = 332; int vSize = 186; int hResolution = 1920; int vResolution = 1080; //vypocet PPI na vysku a na sirku double hPPI = hResolution/(hSize/25.4); double vPPI = vResolution/(vSize/25.4); double rPPI = hPPI/vPPI; //vypocet horizontalni roztec bodu (pitch) a velikost obrazku v milimetrech double pitch = ((double)(1) / hResolution)*hSize; double width = (200 / hPPI)* 25.4; double height = (100/vPPI)*25.4; /*vypis vsech parametru */ System.out.println("hSize [mm] = "+hSize); System.out.println("vSize [mm] = "+vSize); System.out.println("hResolution [pixels] = "+hResolution); System.out.println("vResolution [pixels] = "+vResolution); System.out.println("----------------------------"); System.out.println("hPPI = "+hPPI); System.out.println("vPPI = "+vPPI); System.out.println("rPPI = "+rPPI); System.out.println("pitch [mm] = "+pitch); System.out.println("width [mm] = "+width); System.out.println("height [mm] = "+height); }
[ "public void setPitch(int pitch);", "@Override\r\n public void setParams() {\r\n addParam(PERIOD, 10, 1200, 10, 360);\r\n addParam(ENTRY, 1, 30, 1, 12);\r\n }", "public void setPitch(double x){\n pitch = x;\n }", "float getPitch();", "public float getPitchAngle() { return PitchAngle; }", "public String getPitchAsString(){ return Integer.toString(this.pitch);}", "public PitchImpl(int pitch) {\n if (pitch < -1 || pitch > 127) {\n throw new IllegalArgumentException(\"This is not a valid pitch\");\n }\n this.pitch = pitch;\n }", "public void setPitchWeight(double pitch_weight)\n {\n pitch_weight_ = pitch_weight;\n }", "public void setPitch(int pitch) {\n\t\tsetPitch((float)pitch);\n\t}", "public int getPitch() {\n return pitch;\n }", "private void calPitch() {\n int index = midiValue % 12;\n this.pitchClass = PitchClass.readPitchClass(index);\n }", "public Pocisk() \n {\n\t\tziemia = true;\n\t\tzatrzymaj = true;\n\t\tvPocz = 30.0;\n\t\tkatPocz = Math.PI / 4;\n yPocz = 0;\n k = 0;\n dt = 0.08;\n\t}", "public void setPitch(double pitch) {\n\t\tsetPitch((float)pitch);\n\t}", "public Pitch getPitch() {\n return pitch;\n }", "private String pitchToScale(float pitch) {\n String scale=\"?!?!\";\n // 뭔가 녹음이 됐을때 일한다.\n if (pitch != -1){\n //피아노 기준 C1\n if(33<=pitch && pitch<65){\n scale=\"1\";\n if(33<=pitch && pitch<35){\n scale=\"C\"+scale;\n }else if(35<=pitch && pitch<37){\n scale=\"C#\"+scale;\n }else if(37<=pitch && pitch<39){\n scale=\"D\"+scale;\n }else if(39<=pitch && pitch<41){\n scale=\"D#\"+scale;\n }else if(41<=pitch && pitch<44){\n scale=\"E\"+scale;\n }else if(44<=pitch && pitch<46){\n scale=\"F\"+scale;\n }else if(46<=pitch && pitch<49){\n scale=\"F#\"+scale;\n }else if(49<=pitch && pitch<52){\n scale=\"G\"+scale;\n }else if(52<=pitch && pitch<55){\n scale=\"G#\"+scale;\n }else if(55<=pitch && pitch<58){\n scale=\"A\"+scale;\n }else if(58<=pitch && pitch<62){\n scale=\"A#\"+scale;\n }else if(62<=pitch && pitch<65){\n scale=\"B\"+scale;\n }\n }\n //C2\n else if(65<=pitch && pitch<131){\n scale=\"2\";\n if(65<=pitch && pitch<69){\n scale=\"C\"+scale;\n }else if(69<=pitch && pitch<73){\n scale=\"C#\"+scale;\n }else if(73<=pitch && pitch<78){\n scale=\"D\"+scale;\n }else if(78<=pitch && pitch<82){\n scale=\"D#\"+scale;\n }else if(82<=pitch && pitch<87){\n scale=\"E\"+scale;\n }else if(87<=pitch && pitch<92.5){\n scale=\"F\"+scale;\n }else if(92.5<=pitch && pitch<98){\n scale=\"F#\"+scale;\n }else if(98<=pitch && pitch<104){\n scale=\"G\"+scale;\n }else if(104<=pitch && pitch<110){\n scale=\"G#\"+scale;\n }else if(110<=pitch && pitch<116.5){\n scale=\"A\"+scale;\n }else if(116.5<=pitch && pitch<123.5){\n scale=\"A#\"+scale;\n }else if(123.5<=pitch && pitch<131){\n scale=\"B\"+scale;\n }\n }\n //C3\n else if(131<=pitch && pitch<262){\n scale=\"3\";\n if(131<=pitch && pitch<139){\n scale=\"C\"+scale;\n }else if(139<=pitch && pitch<147){\n scale=\"C#\"+scale;\n }else if(147<=pitch && pitch<156){\n scale=\"D\"+scale;\n }else if(156<=pitch && pitch<165){\n scale=\"D#\"+scale;\n }else if(165<=pitch && pitch<175){\n scale=\"E\"+scale;\n }else if(175<=pitch && pitch<185){\n scale=\"F\"+scale;\n }else if(185<=pitch && pitch<196){\n scale=\"F#\"+scale;\n }else if(196<=pitch && pitch<208){\n scale=\"G\"+scale;\n }else if(208<=pitch && pitch<220){\n scale=\"G#\"+scale;\n }else if(220<=pitch && pitch<233){\n scale=\"A\"+scale;\n }else if(233<=pitch && pitch<247){\n scale=\"A#\"+scale;\n }else if(247<=pitch && pitch<262){\n scale=\"B\"+scale;\n }\n }\n //C4\n else if(262<=pitch && pitch<523){\n scale=\"4\";\n if(262<=pitch && pitch<139){\n scale=\"C\"+scale;\n }else if(277<=pitch && pitch<294){\n scale=\"C#\"+scale;\n }else if(294<=pitch && pitch<311){\n scale=\"D\"+scale;\n }else if(311<=pitch && pitch<330){\n scale=\"D#\"+scale;\n }else if(330<=pitch && pitch<349){\n scale=\"E\"+scale;\n }else if(349<=pitch && pitch<370){\n scale=\"F\"+scale;\n }else if(370<=pitch && pitch<392){\n scale=\"F#\"+scale;\n }else if(392<=pitch && pitch<415){\n scale=\"G\"+scale;\n }else if(415<=pitch && pitch<440){\n scale=\"G#\"+scale;\n }else if(440<=pitch && pitch<466){\n scale=\"A\"+scale;\n }else if(466<=pitch && pitch<494){\n scale=\"A#\"+scale;\n }else if(494<=pitch && pitch<523){\n scale=\"B\"+scale;\n }\n }\n //C5\n else if(523<=pitch && pitch<1046.5){\n scale=\"5\";\n if(523<=pitch && pitch<554){\n scale=\"C\"+scale;\n }else if(554<=pitch && pitch<587){\n scale=\"C#\"+scale;\n }else if(587<=pitch && pitch<622){\n scale=\"D\"+scale;\n }else if(622<=pitch && pitch<659){\n scale=\"D#\"+scale;\n }else if(659<=pitch && pitch<698.5){\n scale=\"E\"+scale;\n }else if(698.5<=pitch && pitch<740){\n scale=\"F\"+scale;\n }else if(740<=pitch && pitch<784){\n scale=\"F#\"+scale;\n }else if(784<=pitch && pitch<831){\n scale=\"G\"+scale;\n }else if(831<=pitch && pitch<880){\n scale=\"G#\"+scale;\n }else if(880<=pitch && pitch<932){\n scale=\"A\"+scale;\n }else if(932<=pitch && pitch<988){\n scale=\"A#\"+scale;\n }else if(988<=pitch && pitch<1046.5){\n scale=\"B\"+scale;\n }\n }\n //C6\n else if(1046.5<=pitch && pitch<2093){\n scale=\"6\";\n if(1046.5<=pitch && pitch<1109){\n scale=\"C\"+scale;\n }else if(1109<=pitch && pitch<1175){\n scale=\"C#\"+scale;\n }else if(1175<=pitch && pitch<1244.5){\n scale=\"D\"+scale;\n }else if(1244.5<=pitch && pitch<1318.5){\n scale=\"D#\"+scale;\n }else if(1318.5<=pitch && pitch<1397){\n scale=\"E\"+scale;\n }else if(1397<=pitch && pitch<1480){\n scale=\"F\"+scale;\n }else if(1480<=pitch && pitch<1568){\n scale=\"F#\"+scale;\n }else if(1568<=pitch && pitch<1661){\n scale=\"G\"+scale;\n }else if(1661<=pitch && pitch<1760){\n scale=\"G#\"+scale;\n }else if(1760<=pitch && pitch<1865){\n scale=\"A\"+scale;\n }else if(1865<=pitch && pitch<1975.5){\n scale=\"A#\"+scale;\n }else if(1975.7<=pitch && pitch<2093){\n scale=\"B\"+scale;\n }\n }\n //C7\n else if(2093<=pitch && pitch<4186){\n scale=\"7\";\n if(2093<=pitch && pitch<2217.5){\n scale=\"C\"+scale;\n }else if(2217.5<=pitch && pitch<2349){\n scale=\"C#\"+scale;\n }else if(2349<=pitch && pitch<2489){\n scale=\"D\"+scale;\n }else if(2489<=pitch && pitch<2637){\n scale=\"D#\"+scale;\n }else if(2637<=pitch && pitch<2794){\n scale=\"E\"+scale;\n }else if(2794<=pitch && pitch<2960){\n scale=\"F\"+scale;\n }else if(2960<=pitch && pitch<3136){\n scale=\"F#\"+scale;\n }else if(3136<=pitch && pitch<3322.5){\n scale=\"G\"+scale;\n }else if(3322.5<=pitch && pitch<3520){\n scale=\"G#\"+scale;\n }else if(3520<=pitch && pitch<3729){\n scale=\"A\"+scale;\n }else if(3729<=pitch && pitch<3951){\n scale=\"A#\"+scale;\n }else if(3951<=pitch && pitch<4186){\n scale=\"B\"+scale;\n }\n }\n }\n return scale;\n }", "public Pitch getPitch() {\n return this.pitch;\n }", "public float getPitch() {\n return pitch;\n }", "public double getPitch()\n\t{\n\t\treturn this.pitch;\n\t}", "public void editPAParameters() {\r\n \t\tdialogFactory.getDialog(new ParametricAnalysisPanel(model, model, model, this), \"Define What-if analysis parameters\");\r\n \t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Define o valor da propriedade dsComplementoCep.
public void setDsComplementoCep(int value) { this.dsComplementoCep = value; }
[ "double setPrecioCompra(double dtopp,double prCompraEdicion,double impPortes,double impComision)\n {\n return prCompraEdicion+impPortes+impComision;\n }", "@gw.internal.gosu.parser.ExtendedProperty\n public java.math.BigDecimal getProdsCompldOpsELPOverride();", "public PaqueteComerciar getPaqueteComercio() {\r\n\treturn paqueteComercio;\r\n }", "public BigDecimal getCOMP_CODE() {\r\n return COMP_CODE;\r\n }", "public String getCpe() {\n return cpe;\n }", "public BigDecimal getCOMP_CODE()\r\n {\r\n\treturn COMP_CODE;\r\n }", "public String getEQP_POS_CD() {\n return EQP_POS_CD;\n }", "public String getCompanyCd() {\r\n return companyCd;\r\n }", "public TblEditOffrCncptDataRecord() {\n\t\tsuper(Wetrn.WETRN, \"TBL_EDIT_OFFR_CNCPT_DATA\", org.jooq.udt.TEditOffrCncptData.T_EDIT_OFFR_CNCPT_DATA.getDataType());\n\t}", "@gw.internal.gosu.parser.ExtendedProperty\n public java.lang.String getProdsCompldOpsBIPDDeductible();", "public java.lang.String getCEP() {\r\n return CEP;\r\n }", "public java.lang.String getComplemento() {\r\n return complemento;\r\n }", "public BigDecimal getIdpartieproduitpfnlconsultation() {\n return (BigDecimal) getAttributeInternal(IDPARTIEPRODUITPFNLCONSULTATION);\n }", "public java.lang.String getComplemento() {\n return complemento;\n }", "public double getPrecioCompra() {\n return precioCompra;\n }", "public float getPrecioCompra() {\n\treturn precioCompra;\n}", "public java.math.BigDecimal getImportoCompensi() {\r\n return importoCompensi;\r\n }", "public BigDecimal getCodPart() {\r\n return codPart;\r\n }", "public void setProdsCompldOpsELPOverride(java.math.BigDecimal value);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Try to find and set a path to EntityLiving. Returns true if successful. Args : entity, speed
public boolean tryMoveToEntityLiving(WrappedEntity entityIn, double speedIn) { return navigation.a(entityIn.getEntity(), speedIn); }
[ "public boolean tryMoveToEntityLiving(org.bukkit.entity.Entity entityIn, double speedIn) {\n\t\treturn navigation.a(((CraftEntity) entityIn).getHandle(), speedIn);\n\t}", "public void walkTo(Location loc, float speed) {\n try {\n\n Object handle = getHandle();\n\n // Set the onGround status, in case the entity spawned slightly above ground level.\n // Otherwise walking does not work.\n handle.getClass().getField(\"onGround\").set(handle, true);\n\n // Invoke the .a(double x, double y, double z, double speed) method in NavigationAbstract.\n Object nav = handle.getClass().getMethod(\"getNavigation\").invoke(handle);\n Method walk = nav.getClass().getMethod(\"a\", double.class, double.class, double.class, double.class);\n walk.invoke(nav, loc.getX(), loc.getY(), loc.getZ(), speed);\n\n } catch (Exception ex) {\n MirrorMirror.logger().warning(\"Error walking entity: \" + baseEntity.getUniqueId());\n MirrorMirror.logger().warning(ex.getMessage());\n ex.printStackTrace();\n }\n }", "private void checkTarget () {\n\t\ttry {\n\t\t\tif (targetEntity.getEntity().getMovement().teleported() || !targetEntity.getEntity().exists()) {\n\t\t\t\t//If the entity has teleported or no longer exists, remove them as a target\n\t\t\t\tentity.stopAll();\n\t\t\t\tstop();\n\t\t\t} else if (targetEntity.getEntity().getCurrentTile().equals(entity.getCurrentTile())) {\n\t\t\t\tmoveAdjacent();\n\t\t\t} else if (entity.getCurrentTile().withinDistance(\n\t\t\t\t\ttargetEntity.getEntity().getCurrentTile(), targetEntity.getRange())) {\n\t\t\t\tif (targetEntity.onReachTarget()) {\n\t\t\t\t\tstop();\n\t\t\t\t}\t\t\t\n\t\t\t} else if (walkSteps.isEmpty()) {\t\t\t\n\t\t\t\tif (!calculateTargetPath(targetEntity.getEntity())) {\n\t\t\t\t\tstop();\n\t\t\t\t}\n\t\t\t}\t\n\t\t} catch (RuntimeException ex) {\n\t\t\tlogger.error(\"Error processing target for entity \"+entity.getName(), ex);\n\t\t\tstop();\n\t\t}\n\t\t/*if (targetEntity.getEntity().getCurrentTile().equals(targetTile)) {\n\t\t\t//Recalculate the path if the entity has moved\n\t\t\twalkSteps.clear();\n\t\t\t\n\t\t}*/\n\t}", "public void followPath(List<Node> path) {\r\n\t\tfloat xlocation = creature.getXlocation();\r\n\t\tfloat ylocation = creature.getYlocation();\r\n\t\t//Path check timer\r\n\t\t/*-------------------------------------------------------------*/\r\n\t\tpathCheck += System.currentTimeMillis() - lastPathCheck;\r\n\t\tlastPathCheck = System.currentTimeMillis();\r\n\t\tif(pathCheck >= pathCheckCooldown) {\r\n\t\t/*-------------------------------------------------------------*/\r\n\t\t\tcreature.xMove = 0;\r\n\t\t\tcreature.yMove = 0;\r\n\t\t\tcreature.path = path;\r\n\t\t\tif (creature.path != null) {\r\n\t\t\t\tif (creature.path.size() > 0) {\r\n\t\t\t\t\tVector2i vec = creature.path.get(creature.path.size() - 1).tile;\r\n\t\t\t\t\tif (xlocation / Tile.TILEWIDTH < vec.getX() + .5) creature.xMove = creature.speed;\t\t//Right\r\n\t\t\t\t\telse if (xlocation / Tile.TILEWIDTH > vec.getX() + .5) creature.xMove = -creature.speed;\t//Left\t\t/\r\n\t\t\t\t\tif (ylocation / Tile.TILEHEIGHT < vec.getY() + .5) creature.yMove = creature.speed;\t\t//Down\r\n\t\t\t\t\telse if (ylocation / Tile.TILEHEIGHT > vec.getY() + .5) creature.yMove = -creature.speed;\t//Up\t\t/\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tPoint p = moveToCenter(2, creature);\r\n\t\t\t\t\tif(p.getX() == 0 && p.getY() == 0) {\r\n\t\t\t\t\t\tcreature.travelling = false;\r\n\t\t\t\t\t} else {\t\t\t\t\r\n\t\t\t\t\tcreature.xMove = creature.speed * p.getX();\r\n\t\t\t\t\tcreature.yMove = creature.speed * p.getY();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static void setSpeed(LivingEntity entity, double speed) {\n\t\tEntityLiving nmsEntity = CommonNMS.getNative(entity);\n\t\tnmsEntity.getAttributeInstance(GenericAttributes.d).setValue(speed);\n\t}", "protected boolean teleportToEntity(Entity entity) {\n Vec3 vector = Vec3.createVectorHelper(this.posX - entity.posX, this.boundingBox.minY + this.height / 2.0F - entity.posY + entity.getEyeHeight(), this.posZ - entity.posZ);\n vector = vector.normalize();\n double x = this.posX + (this.rand.nextDouble() - 0.5) * 8.0 - vector.xCoord * 16.0;\n double y = this.posY + (this.rand.nextInt(16) - 8) - vector.yCoord * 16.0;\n double z = this.posZ + (this.rand.nextDouble() - 0.5) * 8.0 - vector.zCoord * 16.0;\n return this.teleportTo(x, y, z);\n }", "@Override\r\n\tprotected void process(Entity e) {\n\t\tif (state == State.FIND_PATH) {\r\n\t\t\tstate = State.ENTITY_SELECTED;\r\n\t\t\tlastState = State.FIND_PATH;\r\n\t\t\t\r\n\t\t\t// Get the entity's position\r\n\t\t\tMapPosition pos = pm.getSafe(e);\r\n\t\t\t\r\n\t\t\t// Add a Movement component to the entity\r\n\t\t\tMovement movement = new Movement(pos.x,pos.y,pathTarget.x,pathTarget.y, gameMap);\r\n\t\t\te.addComponent(movement);\r\n\t\t\te.changedInWorld();\r\n\t\t}\r\n\t\t\r\n\t}", "public boolean shouldReplace (Entity entity) {\n if (entity != null)\n {\n\n if (entity instanceof Creeper)\n {\n if (replaceAbove)\n {\n if (isAbove (entity.getLocation ()))\n return creepers;\n return false;\n }\n return creepers;\n }\n else if (entity instanceof TNTPrimed)\n {\n if (replaceAbove)\n {\n if (isAbove (entity.getLocation ()))\n return tnt;\n return false;\n }\n else\n return tnt;\n }\n else if (entity instanceof Fireball)\n {\n if (replaceAbove)\n {\n if (isAbove (entity.getLocation ()))\n return ghast;\n return false;\n }\n else\n return ghast;\n }\n else if (entity instanceof EnderDragon)\n return dragons;\n else if (entity instanceof Wither)\n return wither;\n else\n return magical;\n\n }\n else\n return magical;\n }", "public boolean updateBullet()\r\n\t{\r\n\t\tPoint foeLoc = target.getLocation();\r\n\t\tPoint direction = new Point(foeLoc.x - location.x, foeLoc.y - location.y);\r\n\t\t/*Normalize direction vector*/\r\n\t\tdouble magnitude = Math.sqrt(direction.x*direction.x + direction.y*direction.y);\r\n\t\tdouble xDirection = direction.x / magnitude;\r\n\t\tdouble yDirection = direction.y / magnitude;\r\n\t\t/* Multiply by speed*/\r\n\t\txDirection *= speed;\r\n\t\tyDirection *= speed;\r\n\r\n\t\tlocation.x = Math.round((float)xDirection) + location.x;\r\n\t\tlocation.y = Math.round((float)yDirection) + location.y;\r\n\r\n\t\tboolean hit = Math.abs(location.x - foeLoc.x) <= targetLeeway;\r\n\t\thit = hit && Math.abs(location.y - foeLoc.y) <= targetLeeway;\r\n\r\n\t\treturn hit;\r\n\t}", "public void path(){\n\t\tif(myTarget==null || !me.exists())\n\t\t\treturn;\n\t\tSystem.out.println(me.getTilePosition() + \" \" + myTarget);\n\t\tsteps = 0;\n\t\twaiting = false;\n\t\tpath = (new AStarThreat()).getPath(threatGrid,me.getTilePosition(),myTarget);\n\t}", "public boolean applyDynamicCollisions(Step step, Entity entity) {\n boolean collided = false;\n for (Entity e : localStore.getEntities()) {\n MinimumTranslationVector vector = applyCollision(step, entity, e);\n collided = collided || (vector != null);\n // Update current position to resolve collision\n if (vector != null) {\n step.position.x += vector.normal.x * vector.depth;\n step.position.y += vector.normal.y * vector.depth;\n }\n }\n return collided;\n }", "public abstract boolean entityUnderPoint(Point point);", "@Test\n public void testPathEntityDefAvailable() throws Exception {\n AtlasEntityDef pathEntityDef = atlasClientV2.getEntityDefByName(\"Path\");\n assertNotNull(pathEntityDef);\n }", "public boolean canMoveEntity (Entity entity, Point dest) {\n if (entity == null) throw new IllegalArgumentException(\"Entity is null\");\n if (dest == null) throw new IllegalArgumentException(\"Point is null\");\n if (!grid.containsKey(dest)) throw new IllegalArgumentException(\"The cell is not on the grid\");\n\n Point origin = entity.getCoords();\n\n if (origin.equals(dest)) return false;\n\n Vector vector = Vector.findStraightVector(origin, dest);\n\n if (vector == null) return false;\n Vector step = new Vector(vector.axis(), (int) (1 * Math.signum(vector.length())));\n Point probe = (Point) origin.clone();\n while (!probe.equals(dest)) {\n probe = step.applyVector(probe);\n if (!grid.containsKey(probe)) return false;\n }\n\n\n return true;\n }", "public boolean PlaceEntity(Entity entity){\n return PlaceEntityAt(entity, entity.GetCoordinates());\n }", "boolean isObstacle(final IEntity entity);", "private void checkPathing() {\n if(pathing == null) {\n while(pathing == null) {\n map.destroyRandomTower();\n pathing = findPath(74, 17, xDest, yDest);\n }\n }\n }", "public boolean isProjectile();", "@SuppressWarnings(\"ConstantConditions\")\n private boolean isStuck(Position pos, Position posNow) {\n if (pos.isSimilar(posNow)) {\n return true;\n }\n\n Instance instance = getInstance();\n Chunk chunk = null;\n Collection<Entity> entities = null;\n\n /*\n What we're about to do is to discretely jump from the previous position to the new one.\n For each point we will be checking blocks and entities we're in.\n */\n double part = .25D; // half of the bounding box\n Vector dir = posNow.toVector().subtract(pos.toVector());\n int parts = (int) Math.ceil(dir.length() / part);\n Position direction = dir.normalize().multiply(part).toPosition();\n for (int i = 0; i < parts; ++i) {\n // If we're at last part, we can't just add another direction-vector, because we can exceed end point.\n if (i == parts - 1) {\n pos.setX(posNow.getX());\n pos.setY(posNow.getY());\n pos.setZ(posNow.getZ());\n } else {\n pos.add(direction);\n }\n BlockPosition bpos = pos.toBlockPosition();\n Block block = instance.getBlock(bpos.getX(), bpos.getY() - 1, bpos.getZ());\n if (!block.isAir() && !block.isLiquid()) {\n teleport(pos);\n return true;\n }\n\n Chunk currentChunk = instance.getChunkAt(pos);\n if (currentChunk != chunk) {\n chunk = currentChunk;\n entities = instance.getChunkEntities(chunk)\n .stream()\n .filter(entity -> entity instanceof LivingEntity)\n .collect(Collectors.toSet());\n }\n /*\n We won't check collisions with entities for first ticks of arrow's life, because it spawns in the\n shooter and will immediately damage him.\n */\n if (getAliveTicks() < 3) {\n continue;\n }\n Optional<Entity> victimOptional = entities.stream()\n .filter(entity -> entity.getBoundingBox().intersect(pos.getX(), pos.getY(), pos.getZ()))\n .findAny();\n if (victimOptional.isPresent()) {\n LivingEntity victim = (LivingEntity) victimOptional.get();\n victim.setArrowCount(victim.getArrowCount() + 1);\n callEvent(EntityAttackEvent.class, new EntityAttackEvent(this, victim));\n remove();\n return super.onGround;\n }\n }\n return false;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
stop() is used to stop event simulation
public synchronized void stop() { isStopped = true; generators.forEach(EventGenerator::stop); EventSimulatorDataHolder.getSimulatorMap().remove(uuid); if (log.isDebugEnabled()) { log.debug("Stop event simulation for uuid : " + uuid); } }
[ "private void handleStop(ActionEvent actionEvent)\n {\n simulator.stop();\n }", "public void stop() {\n setClosedLoopControl(false);\n }", "public void stop ()\n {\n stopped = true;\n\t\ttrc.info( \"signal is stopped \" + Coroutine.getTime () );\n // trc.show (\"run\", \"signal is stopped\", Coroutine.getTime ());\n runCoroutine.end();\n\n }", "public void stop() {\n intake(0.0);\n }", "@Override\n protected void doStop()\n {\n }", "public void onStopSimulation()\n {\n setStatus(\"STATUS\", \"Stopping simulation.\");\n ProcessSimulator.endThread = true;\n disableButtons(false);\n }", "public void stop() {\n synchronized (eventQueue) {\n isAlive = false;\n }\n }", "public synchronized void stop() {\n\t\t// stop the test here\n\t}", "protected void on_stop()\n {\n }", "boolean shouldStop();", "public void stop() {\n\t\tthis.stopped = true;\n\t\tthis.sendRawMessage(\"Stopping\"); //so that the bot has one message to process to actually stop\n\t}", "@Override\n public void stop() {\n buzz(STOP_FREQUENCY);\n }", "public void stop() {\n _running = false;\n }", "TimeInstrument stop();", "void stopPumpingEvents();", "Stop createStop();", "private synchronized void stop(){\n this.go = false;\n }", "public synchronized void stop(){\n\t\tif (tickHandle != null){\n\t\t\ttickHandle.cancel(false);\n\t\t\ttickHandle = null;\n\t\t}\n\t}", "public void stopSequencer() {this.cancelEvent();}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method increases the number of visited nodes by 1.
public void UpNumberOfVisitedNodes() { NumberOfVisitedNodes++; }
[ "public void setNumberOfVisitedNodes(int numberOfVisitedNodes) {\n NumberOfVisitedNodes = numberOfVisitedNodes;\n }", "public void markAllNodesAsUnvisited() {\r\n visitedToken++;\r\n }", "public void increaseInEdgeCount() {\n\t\tinEdgeCount++;\n\t}", "protected void incEdgeCount() {\n ++ownerGraph.edgeCount;\n }", "public void setVisited() { visited = true; }", "public void setVisited()\r\n {\r\n visited = true;\r\n }", "public void setVisited()\n {\n visited = true;\n }", "public void setVisited()\n\t{\n\t\tthis.visited = true;\n\t}", "public void setNumberOfNodes () {\n this.numOfStates++;\n }", "public void updateNeighbourCount();", "public static void resetNodeCount() {\n\t\tnodeCount = 0;\n\t}", "private void resetVisited() {\n listFriendships.forEach(friendship -> {\n visited.put(friendship.getId().getLeft(), 0L);\n visited.put(friendship.getId().getRight(), 0L);\n });\n }", "public int countReachableNodes() {\n\t\t\n\t\tvar visited = new java.util.HashSet<LinkedListNode<T>>();\n\n\t\tvar node = this;\n\n\t\twhile (!visited.contains(node) && node != null) {\n\t\t\tvisited.add(node);\n\t\t\tnode = node.next;\n\t\t}\n\t\t\n\t\treturn visited.size();\n\t}", "public int getNodeCount(){\r\n HashSet<FlowGraphNode> visited = new HashSet<>();\r\n LinkedList<FlowGraphNode> queue = new LinkedList<>();\r\n queue.add(start);\r\n visited.add(start);\r\n while(!queue.isEmpty()){\r\n FlowGraphNode node = queue.pop();\r\n for(FlowGraphNode child : node.to){\r\n if(visited.add(child)){\r\n queue.add(child);\r\n }\r\n }\r\n }\r\n return visited.size();\r\n }", "public void isVisited() \n\t{\n\t\tvisited = true;\n\n\t}", "public void loadNodesToVisit(){\n for(int i = 0; i <= nodesToVisit.length - 1; i++){\n nodesToVisit[i] = i;\n }\n }", "public void increaseOutEdgeCount() {\n\t\toutEdgeCount++;\n\t}", "public void update(){\n\t\t\n\t\t\n\n\t\tLinkedHashSet<Node> nodes = network.getNodes();\n\t\tint sizeNodes = nodes.size();\n\t\tint sizeArray = this.nodeCounts.size();\n\t\tif (sizeNodes > sizeArray){\n\t\t\tint diff = sizeNodes-sizeArray;\n\t\t\t\n\t\t\tfor (int i =0 ; i < diff ; i++){\n\t\t\t\t\n\t\t\t\tArrayList<Integer> tmp = new ArrayList<Integer>(9);\n\t\t\t\t\n\t\t\t\tfor(int j = 0 ; j < 9;j++){\n\t\t\t\t\ttmp.add(0);\n\t\t\t\t}\n\t\t\t\t\n\t\t\n\t\t\t\t\n\t\t\t\tthis.nodeCounts.add(tmp);\n\t\t\t}\n\t\t\n\t\t}\n\t\telse if (sizeArray> sizeNodes){\n\t\t\t\n\t\t\tint diff = sizeArray-sizeNodes;\n\t\t\tfor (int i =0 ; i < diff ; i++){\n\t\t\t\t\n\t\t\t\tthis.nodeCounts.remove(this.nodeCounts.size()-1);\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tint i = 0;\n\t\tthis.nodeToNodeCount.clear();\n\t\tfor (Node a: network.getNodes()){\n\t\t\tthis.nodeToNodeCount.put(a, i);\n\t\t\t\n\t\t\tthis.count(a,network,i);\n\t\t\ti++;\n\t\t}\n\t\t\n\t\t\n\t\tthis.graphletCount();\n\t\tthis.graphletFrequency();\n\t\t\n\t\tthis.inited = true;\n\n\t}", "public int getNextNodeCount();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test the connection with bad password
@Test public void testConnectionWhenBadPass() { Form form = new Form(); form.param("login", "user"); form.param("psw", "00000"); Response connect = target.path(auth).request().post(Entity.form(form)); assertEquals(530,connect.getStatus()); }
[ "public void testIncorrectPassword() {\n Password p = new Password(\"jesus\".toCharArray());\n assertFalse(p.checkPassword(\"buddha\".toCharArray()));\n }", "@Test\n public void testConnectionWhenBadUser() {\n \tForm form = new Form();\n \tform.param(\"login\", \"test\");\n \tform.param(\"psw\", \"12345\");\n \t\n \tResponse connect = target.path(auth).request().post(Entity.form(form));\n \tassertEquals(530,connect.getStatus());\n }", "@Test\n\tpublic void testLoginBadPassword()\n\t{\n\t\ttry\n\t\t{\n\t\t\tbetFair.login(userName, password + \"A\", filePassword, new File(\"./certs/client-2048.p12\"));\n\t\t\tfail(\"BadLoginDetailsException expected in testLoginBadPassword()\");\n\t\t}\n\t\tcatch (BadLoginDetailsException expectedException)\n\t\t{\n\t\t\tSystem.out.println(\"testLoginBadPassword() pass!\");\n\t\t}\n\t}", "@Test\n\tpublic void testCheckPasswordWrong() {\n\t\tassertFalse(u1.checkPassword(\"dsauj\"));\n\t}", "@Test\n public void testCorrectUAndWrongP() {\n assertFalse(\"Invalid Credentials\",\n instance.login(\"admin\", \"password@123\"));\n }", "@Test\n public void testConnectionNeg() throws Exception {\n miniHiveKdc.loginUser(MiniHiveKdc.HIVE_TEST_USER_1);\n try {\n String url = miniHS2.getJdbcURL().replaceAll(\";principal.*\", \"\");\n hs2Conn = DriverManager.getConnection(url);\n fail(\"NON kerberos connection should fail\");\n } catch (SQLException e) {\n // expected error\n assertEquals(\"08S01\", e.getSQLState().trim());\n }\n }", "@Test\n public void getPasswordTest() {\n Assert.assertEquals(\"123456\", credentials.getPassword());\n }", "void validatePassword(String usid, String password) throws Exception;", "@Test\n public void invalidCredentials_errorMessage()\n {\n \tString invalidEmail = \"admin@gmail.com\";\n \tString invalidPwd = \"123456\";\n \tloginToLynkmanager(invalidEmail, invalidPwd);\n \tverifyInvalidCredentialsErrorMsg();\n }", "@Test\n public void testWrongUAndCorrectP() {\n assertFalse(\"Invalid Credentials\", instance.login(\"Users\", \"epam123\"));\n }", "@Test\n public void testJmxDoesNotExposePassword() throws Exception {\n final MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();\n\n try (Connection c = ds.getConnection()) {\n // nothing\n }\n final ObjectName objectName = new ObjectName(ds.getJmxName());\n\n final MBeanAttributeInfo[] attributes = mbs.getMBeanInfo(objectName).getAttributes();\n\n assertTrue(attributes != null && attributes.length > 0);\n\n Arrays.asList(attributes).forEach(attrInfo -> {\n assertFalse(\"password\".equalsIgnoreCase(attrInfo.getName()));\n });\n\n assertThrows(AttributeNotFoundException.class, () -> {\n mbs.getAttribute(objectName, \"Password\");\n });\n }", "@Test\n public void testEmptyUAndP() {\n assertFalse(\"Invalid Credentials\", instance.login(\"\", \"\"));\n }", "public void testCorrectPassword() {\n Password p = new Password(\"jesus\".toCharArray());\n assertTrue(p.checkPassword(\"jesus\".toCharArray()));\n }", "@Test\r\n public void getPasswordTest()\r\n {\r\n Assert.assertEquals(stub.getPassword(), PASS);\r\n }", "@Test(expected = SQLException.class)\n public void testNegativeProxyAuth() throws Exception {\n miniHiveKdc.loginUser(MiniHiveKdc.HIVE_TEST_SUPER_USER);\n hs2Conn = DriverManager\n .getConnection(miniHS2.getJdbcURL(\"default\", \";hive.server2.proxy.user=\" + MiniHiveKdc.HIVE_TEST_USER_2));\n }", "@Test\r\n\tpublic void testLoginWrong() {\r\n\t\tboolean b;\r\n\t\tb=mc.input(\"!login adminZ adminY\");\r\n\t\tassertFalse(b);\r\n\t}", "@Test\n public void testGetPassword() {\n assertEquals(\"test_pass\", account.getPassword());\n }", "@Test\n\tpublic void testInvalidLengthPassword1()\n\t{\n\t\tString password = \"2Shrt\";\n\t\tassertFalse(Validate.password(password));\n\t}", "public void testIncorrectUserPassword() {\n final String key = \"mysecret\";\n final String value = \"keepsafe\";\n\n SecurePreferences securePrefs = new SecurePreferences(getContext(), \"password\", USER_PREFS_WITH_PASSWORD);\n securePrefs.edit().putString(key, value).commit();\n securePrefs=null;\n\n SecurePreferences securePrefsWithWrongPass = new SecurePreferences(getContext(), \"incorrectpassword\", USER_PREFS_WITH_PASSWORD);\n String myValue = securePrefsWithWrongPass.getString(key, null);\n if(value.equals(myValue)){\n fail(\"Using the wrong password, should not return the decrpyted value\");\n }\n\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds the given item to the heap.
public void add(T item) { ensureCapacity(); array_heap[num_items + 1] = item; num_items++; bubbleUp(num_items); }
[ "public void add(int item)\n {\n if (isEmpty())\n {\n heap[1] = item;\n }\n else\n {\n int newIndex = lastIndex + 1;\n int parentIndex = newIndex / 2;\n while (parentIndex > 0 && item > heap[parentIndex])\n {\n heap[newIndex] = heap[parentIndex];\n swapsAdd++;\n newIndex = parentIndex;\n parentIndex = newIndex / 2;\n }\n heap[newIndex] = item;\n lastIndex++;\n }\n }", "@Override\n public void add(T item, int priority) {\n if (item == null) {\n throw new IllegalArgumentException();\n }\n\n heap.add(new Node(item, priority));\n size++;\n swim(size);\n\n }", "@Override\n public void add(T item, double priority) {\n if (contains(item)) {\n throw new IllegalArgumentException();\n }\n\n heap.add(new Node(item, priority));\n itemMapIndex.put(item, heap.size() - 1);\n swim(heap.size() - 1);\n }", "public void insert(Process item) {\n if(numItems >= data.length)\n doubleCapacity();\n\n data[numItems] = item;\n heapAndFreeStack[numItems] = numItems;\n bubbleUp(numItems);\n numItems++;\n }", "public int Insert(DHeap_Item item) \n { \n \tthis.size++;\n \tthis.array[this.size-1]=item;\n \titem.setPos(this.size-1);\n \tint compCnt=heapifyUp(this,item.getPos());\n \treturn compCnt;\n }", "public void push(Item item){\n this.stack.add(item);\n\n }", "@Override\n public void addElement(T element) {\n if (count == heap.length) {\n expandCapacity();\n }\n heap[count++] = element;\n heapifyAdd(); // call this to ensure that the item swaps up, as needed\n\n }", "public void insert(Item it) {\n // If the array is at capacity, resize it up.\n if (N >= heap.length) {\n Item[] temp = (Item[]) new Comparable[2*N];\n for (int i=0; i<N; i++)\n temp[i] = heap[i];\n heap = temp;\n }\n heap[N] = it;\n N++;\n swim(N);\n }", "@Override\n public void insert(Item itemToAdd){\n if(numberOfItems == pq.length){\n resize(2*pq.length);\n }\n pq[numberOfItems++] = itemToAdd; // add item to pq and increment numberOfItems\n }", "public void add(T item, double priority) {\n if(contains(item)) throw new IllegalArgumentException();\n /* Add to the last */\n array.add(size + 1, new PQNode<>(item, priority));\n size += 1;\n /* Take care of MAP */\n map.put(item, size);\n /* The new node should go to the right place */\n goToRightPlace(size, 1);\n }", "public void addItem(HashItem item) {\r\n\t\thashTable.add(item);\r\n\t}", "public void push(ByteBufferWithInfo item)\n {\n list.addFirst(item);\n }", "public void push(T item)\r\n\t{\r\n\t\t if (size == Stack.length) \r\n\t\t {\r\n\t\t\t doubleSize();\r\n\t }\r\n\t\tStack[size++] = item;\r\n\t}", "public boolean add(AgeData item){\r\n\r\n boolean isFound = false;\r\n int child;\r\n int parent;\r\n int index = 0;\r\n\r\n for(int i=0; i < heap_list.size(); i++){\r\n if(heap_list.get(i).compareTo(item) ==0){\r\n heap_list.get(i).numberOfPeople++;\r\n isFound = true;\r\n index = i;\r\n break;\r\n }\r\n }\r\n if(!isFound){\r\n item.numberOfPeople++;\r\n heap_list.add(item);\r\n child = heap_list.size() - 1;\r\n parent = (child - 1) / 2;\r\n }\r\n else{\r\n child = index;\r\n parent = (child-1)/2;\r\n }\r\n while(parent >= 0 && comparator.compare(heap_list.get(parent),heap_list.get(child)) == 1){\r\n AgeData temp = heap_list.get(parent);\r\n heap_list.set(parent, heap_list.get(child));\r\n heap_list.set(child, temp);\r\n child = parent;\r\n parent = (child - 1) / 2;\r\n }\r\n return true;\r\n }", "public void add(Answer item) {\r\n for (int i = AIKey.MAX_HISTORY-1; i > 0; i--) {\r\n history[i] = history[i-1];\r\n }\r\n history[0] = item;\r\n currentSize++;\r\n }", "public void add(T item)\n\t{\n\t\tint index = 0;\n\t\tboolean found = false;\n\t\t\n\t\t// Find the location to insert item in array\n\t\t// Iterate until index does not reach the end of the list and location has not been found yet\n\t\twhile(index < this.num && found != true)\n\t\t{\n\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\tT curr = (T) this.data[index];\n\t\t\t\n\t\t\t// Found the location of the first object that is greater than the provided item\n\t\t\tif(curr.compareTo(item) > 0)\n\t\t\t{\n\t\t\t\tfound = true;\n\t\t\t}\n\t\t\t\n\t\t\telse\n\t\t\t{\n\t\t\t\tindex++;\n\t\t\t}\n\t\t}\n\t\t\t\t\t\t\n\t\t// Shift elements to right of the array starting at the new space (located next to the last item in array)\n\t\tfor(int j = this.num; j > index; j--)\n\t\t{\n\t\t\tthis.data[j] = this.data[j - 1];\n\t\t}\n\t\t\n\t\tthis.data[index] = item; // insert item at the proper location\n\t\tthis.num++; // increment number of elements in array\n\t}", "public void push(ILocation item)\n {\n stack.add(top, item);\n top++;\n }", "void push(T item, int priority);", "public void add(Node node) {\n this.heapSize ++;\n int i = this.heapSize;\n while ((i > 1) && !(this.heap[parent(i)].smaller(node))) {\n this.heap[i] = this.heap[parent(i)];\n i = parent(i);\n }\n this.heap[i] = node;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The UriDelegationPeer is used as a mechanism to pass arguments from the UriArgManager which resides in "launcher space" to our argument delegation service implementation that lives as an osgi bundle. An instance of this peer is created from within the argument delegation service impl and is registered with the UriArgManager.
public interface ArgDelegationPeer { /** * Handles <code>uriArg</code> in whatever way it finds fit. * * @param uriArg the uri argument that this delegate has to handle. */ public void handleUri(String uriArg); /** * Called when the user has tried to launch a second instance of * SIP Communicator while a first one was already running. A typical * implementation of this method would simply bring the application on * focus but it may also show an error/information message to the user * notifying them that a second instance is not to be launched. */ public void handleConcurrentInvocationRequest(); }
[ "void addPeerEndpoint(PeerEndpoint peer);", "java.lang.String getDelegatorAddress();", "protected void setPeer() {\n //--ARM-- setPeer()\n }", "public void setPeer(Peer peer);", "void addPeer(Uuid peer) throws RemoteException;", "public P2PSocketLeaseManager(PeerGroup group,PipeAdvertisement adv,Object referent) {\n this.group = group;\n this.disc = group.getDiscoveryService();\n this.adv = adv;\n this.reference = new WeakReference(referent);\n thread = new Thread(this);\n }", "@Mangling({\"_Z18udp_set_remote_urlP10URLContextPKc\", \"?udp_set_remote_url@@YAHPAUURLContext@@PAD@Z\"}) \n\tint udp_set_remote_url(URLContext h, String uri);", "@Test\n public void undelegatedUri() {\n XMLResolverConfiguration uconfig = new XMLResolverConfiguration(Collections.emptyList(), Collections.emptyList());\n uconfig.setFeature(ResolverFeature.CATALOG_FILES, Collections.singletonList(catalog2));\n CatalogManager umanager = new CatalogManager(uconfig);\n\n URI result = umanager.lookupURI(\"https://example.com/delegated/sample/3.0/sample.rng\");\n assertEquals(catloc.resolve(\"sample30/fail.rng\"), result);\n }", "public void handleUri(String uriArg);", "public interface ChannelEndpointManager {\n\n /**\n\t * \n\t */\n public static final int NO_POLICY = 0;\n\n /**\n\t * \n\t */\n public static final int FAILOVER_REDUNDANCY_POLICY = 1;\n\n /**\n\t * \n\t */\n static final int LOADBALANCING_ANY_POLICY = 2;\n\n /**\n\t * \n\t */\n static final int LOADBALANCING_ONE_POLICY = 3;\n\n /**\n\t * add a reduntant binding for a service. <i>EXPERIMENTAL</i>.\n\t * \n\t * @param service\n\t * the URI of the service.\n\t * @param redundant\n\t * the URI of the redundant service.\n\t */\n public void addRedundantEndpoint(final URI service, final URI redundant);\n\n /**\n\t * remove a redundant binding from a service. <i>EXPERIMENTAL</i>.\n\t * \n\t * @param service\n\t * the URI of the service.\n\t * @param redundant\n\t * the URI of the redundant service.\n\t */\n public void removeRedundantEndpoint(final URI service, final URI redundant);\n\n /**\n\t * set a policy for making use of redundant service bindings.\n\t * <i>EXPERIMENTAL</i>.\n\t * \n\t * @param service\n\t * the URI of the service.\n\t * @param policy\n\t * the policy to be used.\n\t */\n public void setEndpointPolicy(final URI service, final int policy);\n\n /**\n\t * get the local address of the managed channel endpoint.\n\t * \n\t * @return the local URI.\n\t */\n public URI getLocalAddress();\n\n /**\n\t * transform a timestamp into the peer's local time.\n\t * \n\t * @param timestamp\n\t * the Timestamp.\n\t * @return the transformed timestamp.\n\t * @throws RemoteOSGiException\n\t * if the transformation fails.\n\t * @since 0.2\n\t */\n public Timestamp transformTimestamp(final Timestamp timestamp) throws RemoteOSGiException;\n}", "public static void main(String[] args) {\n\t\ttry {\n\t\t\tSystem.out.println(\"start Peer ...\");\n\t\t\tPeer peerServer = new Peer();\n\t\t\tSystem.out.println(\"RMI registry at port \"+ Port +\".\");\n\t\t\tLocateRegistry.createRegistry(Port); \n\t\t\tNaming.rebind(PeerUrl+\":\"+Port+\"/Peer\", peerServer); \n\t\t\tSystem.out.println(\"Bind Succussfully.\");\n\t\t\t\n\t\t\t//Thread for Peer Client to provide the functions for users.\n\t\t\tnew peerClient().start();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Peer Main Error: \" + e);\n\t\t}\n\t}", "public interface IIncomingProtocolNegotiationReceiver {\r\n\t/**\r\n\t * Notifies that a protocol negotiation request from the given party has been received and asks for permission to proceed with it. It also includes a reference to the ProtocolNegotiator that shall process the request.\r\n\t * @param party\r\n\t * @param incoming\r\n\t */\r\n public void protocolNegotiationReceived(URI party, IIncomingProtocolNegotiator incoming);\r\n\r\n}", "public ParsedURI resolve(ParsedURI relURI) {\n\t\t// This algorithm is based on the algorithm specified in chapter 5 of\n\t\t// RFC 2396: URI Generic Syntax. See http://www.ietf.org/rfc/rfc2396.txt\n\n\t\t// RFC, step 3:\n\t\tif (relURI.isAbsolute()) {\n\t\t\treturn relURI;\n\t\t}\n\n\t\t// relURI._scheme == null\n\n\t\t// RFC, step 2:\n\t\tif (relURI._authority == null && relURI._query == null && relURI._path.length() == 0) {\n\t\t\t// Reference to this URI\n\t\t\tParsedURI result = (ParsedURI) this.clone();\n\n\t\t\t// Inherit any fragment identifier from relURI\n\t\t\tresult._fragment = relURI._fragment;\n\n\t\t\treturn result;\n\t\t}\n\n\t\t// We can start combining the URIs\n\t\tString scheme, authority, path, query, fragment;\n\t\tboolean normalizeURI = false;\n\n\t\tscheme = this._scheme;\n\t\tquery = relURI._query;\n\t\tfragment = relURI._fragment;\n\n\t\t// RFC, step 4:\n\t\tif (relURI._authority != null) {\n\t\t\tauthority = relURI._authority;\n\t\t\tpath = relURI._path;\n\t\t} else {\n\t\t\tauthority = this._authority;\n\n\t\t\t// RFC, step 5:\n\t\t\tif (relURI._path.startsWith(\"/\")) {\n\t\t\t\tpath = relURI._path;\n\t\t\t} else if (relURI._path.length() == 0) {\n\t\t\t\tpath = this._path;\n\t\t\t} else {\n\t\t\t\t// RFC, step 6:\n\t\t\t\tpath = this._path;\n\n\t\t\t\tif (path == null) {\n\t\t\t\t\tpath = \"/\";\n\t\t\t\t} else {\n\t\t\t\t\tif (!path.endsWith(\"/\")) {\n\t\t\t\t\t\t// Remove the last segment of the path. Note: if\n\t\t\t\t\t\t// lastSlashIdx is -1, the path will become empty,\n\t\t\t\t\t\t// which is fixed later.\n\t\t\t\t\t\tint lastSlashIdx = path.lastIndexOf('/');\n\t\t\t\t\t\tpath = path.substring(0, lastSlashIdx + 1);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (path.length() == 0) {\n\t\t\t\t\t\t// No path means: start at root.\n\t\t\t\t\t\tpath = \"/\";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Append the path of the relative URI\n\t\t\t\tpath += relURI._path;\n\n\t\t\t\t// Path needs to be normalized.\n\t\t\t\tnormalizeURI = true;\n\t\t\t}\n\t\t}\n\n\t\tParsedURI result = new ParsedURI(scheme, authority, path, query, fragment);\n\n\t\tif (normalizeURI) {\n\t\t\tresult.normalize();\n\t\t}\n\n\t\treturn result;\n\t}", "public void beginRoutingWithNewIntent();", "private void init(URI uri)\n {\n uri.normalize(); // a VRL is a stricter implementation then an URI ! \n\n // scheme: \n String newScheme=uri.getScheme();\n\n boolean hasAuth=StringUtil.notEmpty(uri.getAuthority()); \n \n String newUserInf=uri.getUserInfo();\n String newHost=uri.getHost(); // Not: resolveLocalHostname(uri.getHost()); // resolveHostname(uri.getHost());\n int newPort=uri.getPort();\n \n // ===========\n // Hack to get path,Query and Fragment part from SchemeSpecific parth if the URI is a reference\n // URI. \n // The java.net.URI doesn't parse \"file:relativePath?query\" correctly\n // ===========\n String pathOrRef=null;\n String newQuery=null; \n String newFraq=null; \n \n if ((hasAuth==false) && (uri.getRawSchemeSpecificPart().startsWith(\"/\")==false)) \n {\n // Parse Reference URI or Relative URI which is not URL compatible: \n // hack to parse query and fragment from non URL compatible \n // URI \n try\n {\n // check: \"ref:<blah>?query#frag\"\n URI tempUri=null ;\n \n tempUri = new URI(newScheme+\":/\"+uri.getRawSchemeSpecificPart());\n String path2=tempUri.getPath(); \n // get path but skip added '/': \n // set Path but keep as Reference ! (path is reused for that) \n \n pathOrRef=path2.substring(1,path2.length()); \n newQuery=tempUri.getQuery(); \n newFraq=tempUri.getFragment(); \n }\n catch (URISyntaxException e)\n {\n \tGlobal.errorPrintStacktrace(e);\n // Reference URI: ref:<blahblahblah> without starting '/' ! \n // store as is without parsing: \n \tpathOrRef=uri.getRawSchemeSpecificPart(); \n }\n }\n else\n {\n // plain PATH URI: get Path,Query and Fragment. \n pathOrRef=uri.getPath(); \n newQuery=uri.getQuery(); \n newFraq=uri.getFragment();\n }\n \n // ================================\n // use normalized initializer\n // ================================\n init(newScheme,newUserInf,newHost,newPort,pathOrRef,newQuery,newFraq); \n }", "void addPeer(final PeerId peer, final Closure done);", "public CallPeerAdapter(CallPeer callPeer, CallPeerRenderer renderer)\n {\n this.callPeer = callPeer;\n this.renderer = renderer;\n }", "WithCreate withPeeringServiceLocation(String peeringServiceLocation);", "com.google.protobuf.ByteString\n getDelegatorAddressBytes();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Disable the inventory menu if the user has no items. Disable the pick up item menu if there are no items to pick up.
private void setUsabilityOfMenus(World world) { inventoryMenu.setDisable(world.getInventory().size() == 0); pickupItemMenu.setDisable(world.getPickupItems().size() == 0); }
[ "private void setUsabilityOfInventoryMenuItems(World world) {\n\t\tif (!roomToDrop(world)) {\n\t\t\tfor (MenuItem itemToDisable : inventoryMenu.getItems()) {\n\t\t\t\titemToDisable.setDisable(true);\n\t\t\t}\n\t\t}\n\t}", "private void disableBoughtItems() {\n for (int i = 0; i < itemButtons.size(); i++) {\n if (storeViewModel.isItemBought(i)) {\n setDisableEffect(i);\n }\n }\n }", "private void disableMenuItems() {\n\t\tcancelAction.setEnabled(true);\n\t\tif ((gtRefreshGame != null) && (!gtRefreshGame.isDisposed())) {\n\t\t\tgtRefreshGame.setEnabled(false);\n\t\t}\n\t\tif ((gtUpdateGame != null) && (!gtUpdateGame.isDisposed())) {\n\t\t\tgtUpdateGame.setEnabled(false);\n\t\t}\n\t\tif ((gtPingAllItem != null) && (!gtPingAllItem.isDisposed())) {\n\t\t\tgtPingAllItem.setEnabled(false);\t\t\t\n\t\t}\n\n\t\tgameTree.setEnabled(false);\n\t\tserverTable.setEnabled(false);\n\n\t\tstUpdateSelectedItem.setEnabled(false);\n\t\tstPingSelectedItem.setEnabled(false);\n\t\tstJoinSelectedItem.setEnabled(false);\n\t\t\n\t\tif ((stAddServerToFolder!= null) && !stAddServerToFolder.isDisposed()) {\n\t\t\tstAddServerToFolder.setEnabled(false);\n\t\t}\n\t\tif ((stRemoveFolderServers!= null) && !stRemoveFolderServers.isDisposed()) {\n\t\t\tstRemoveFolderServers.setEnabled(false);\n\t\t}\n\t\tstWatchSelected.setEnabled(false);\n\t\tstCopyAddress.setEnabled(false);\n\t\tstCopyServer.setEnabled(false);\n\n\t\trebuildMaster.setEnabled(false);\n\t\tupdateCurrent.setEnabled(false);\n\t\tpingCurrent.setEnabled(false);\n\t\tupdateSelected.setEnabled(false);\n\t\tpingSelected.setEnabled(false);\n\t\tconnectSelected.setEnabled(false);\n\t\twatchServer.setEnabled(false);\n//\t\tfindPlayer.setEnabled(false);\n\t\tconfigureGames.setEnabled(false);\n\t\tconfigurePrefs.setEnabled(false);\n\t\t\t\t\n\t\tserverUpdateSelectedItem.setEnabled(false);\n\t\tserverPingSelectedItem.setEnabled(false);\n\t\tserverWatchSelectedItem.setEnabled(false);\n\t\tserverConnectItem.setEnabled(false);\n//\t\tserverRconItem.setEnabled(false);\n//\t\tserverFindLanItem.setEnabled(false);\n//\t\tserverAddTriggerItem.setEnabled(false);\n//\t\tserverEditTriggerItem.setEnabled(false);\n\t}", "protected boolean shouldShowItemNone() {\n return false;\n }", "private void setMenuItemstate() {\n\n // get the item that has to be disabled\n MenuItem selectedMenuItem = optionsMenu.findItem(R.id.most_popular);\n switch (order_by) {\n case NetUtils.SORT_BY_POPULAR:\n selectedMenuItem = optionsMenu.findItem(R.id.most_popular);\n break;\n case NetUtils.SORT_BY_TOP_RATED:\n selectedMenuItem = optionsMenu.findItem(R.id.top_rated);\n break;\n case SHOW_FAVOURITES:\n selectedMenuItem = optionsMenu.findItem(R.id.favourites);\n break;\n }\n\n // set the item as disabled, enable the rest\n\n\n\n for(int i=0; i<optionsMenu.size(); i++)\n if (optionsMenu.getItem(i).equals(selectedMenuItem ))\n optionsMenu.getItem(i).setEnabled(false);\n else\n optionsMenu.getItem(i).setEnabled(true);\n\n }", "public void updateMenuItems() {\n\t\tfor (int i = 0; i < this.selectEnemyMenu.getItemCount(); i++) {\n\t\t\tif (this.enemies.get(i).getCurrentHealth() <= 0) {\n\t\t\t\tthis.selectEnemyMenu.getItem(i).setText(this.enemies.get(i).getName() + \": Deceased\");\n\t\t\t\tthis.selectEnemyMenu.getItem(i).setEnabled(false);\n\t\t\t} else {\n\t\t\t\tthis.selectEnemyMenu.getItem(i)\n\t\t\t\t\t\t.setText(this.enemies.get(i).getName() + \": \" + this.enemies.get(i).getCurrentHealth());\n\t\t\t}\n\t\t}\n\t}", "boolean shouldHideMenuItems();", "private void equip()\n\t{\n\t\tZuulObject item = searchInventory(object);\n\t\t\n\t\tif(item == null)\n\t\t\tSystem.out.println(\"You don't have one of those\");\n\t\telse\n\t\t{\n\t\t\tif(item instanceof Weapon)\n\t\t\t{\n\t\t\t\tif(equipped != null)\n\t\t\t\t\tinventory.add(equipped);\n\t\t\t\tequipped = item;\n\t\t\t\tinventory.remove(item);\n\t\t\t\tSystem.out.println(\"You equipped a \" + equipped);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tSystem.out.println(\"You can't equip that\");\n\t\t\t\tinventory.add(item);\n\t\t\t}\n\t\t}\n\t}", "public boolean isEquipable()\n\t{\n\t\treturn !(_item.getBodyPart() == 0 || _item instanceof L2EtcItem);\n\t}", "public boolean canEquip()\r\n\t{\r\n\t\treturn !(type == ItemSlot.UNEQUIPPABLE);\r\n\t}", "public void disableMenus() {\n mMenuEnabled = false;\n }", "public void showMyInventory() {\n\n try {\n List<String> items = tradingFacade.fetchItems().query().onlyApproved()\n .notDeleted()\n .onlyOwnedBy(this.userId)\n .heldByOwner()\n .getNames();\n if(!items.isEmpty()) controllerPresenter.displayList(items);\n else controllerPresenter.get(\"NoItemInventory\");\n } catch (IOException e) {\n errorPresenter.displayIOException();\n }\n\n }", "@Test\n\tpublic void testInventoryNoItems() {\n\t\tgame.parseUserInput(\"I\", mockRoom);\n\t\tassertEquals(\"-coffee -cream -sugar\", game.getLastCommand());\t\t// Should match the lastCommand String when the player has no items\n\t}", "@Override\n public boolean active() {\n return !Inventory.isFull();\n }", "public static void emptyInventoryListMessage() {\n System.out.println(\"You do not have any Items in your inventory:(\");\n }", "@Override\r\n\tpublic boolean canDropInventory(IBlockState state)\r\n\t{\r\n\t\treturn false;\r\n\t}", "private void noneAction() {\r\n\r\n\t\t// Executes the command that corresponds\r\n\t\tAcideMainWindow.getInstance().getConsolePanel()\r\n\t\t\t.executeCommand(item.getItemConfiguration().getCommand(), \"\");\r\n\t}", "@Override\n\tpublic boolean canDropInventory(IBlockState state)\n\t{\n\t\treturn false;\n\t}", "public boolean isSelectingWeapon() {\n return false;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds the given filter to the idAttrs edition editor.
public void addFilterToIdAttrs(ViewerFilter filter);
[ "public void addFilterToIdParams(ViewerFilter filter);", "public void addFilterToAttributes(ViewerFilter filter);", "public void addBusinessFilterToIdAttrs(ViewerFilter filter);", "public void addBusinessFilterToIdParams(ViewerFilter filter);", "public void addFilterToAnotations(ViewerFilter filter);", "public void setIdFilter(String idFilter) {\n\t\tthis.idFilter = idFilter;\n\t}", "public void addFilterToCreator(ViewerFilter filter);", "public void addFilterToReader(ViewerFilter filter);", "public void addBusinessFilterToAttributes(ViewerFilter filter);", "public void setIdFilter(Long id) {\n this.idFilter = id;\n }", "public void addFilterToPolicyEntries(ViewerFilter filter);", "void addRecipeFilter(RecipeFilter recipeFilter);", "public void addFilterToCombo(ViewerFilter filter);", "public void addNodeFilter (INodeFilter filter);", "public void addFilter(Filter<NDLStitchingDetail> filter) {\n\t\tthis.filter = filter;\n\t}", "public void addFilterToComboRO(ViewerFilter filter);", "public void addFilterToMigRelations(ViewerFilter filter);", "public void addFilterToMethodArguments(ViewerFilter filter);", "public void setIdFilter(Long idFilter) {\n\t\tthis.idFilter = idFilter;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Download Stock data every night at 10 PM
@Scheduled(cron="0 51 22 * * *") public void downloadStockData() throws IOException { System.out.println("Downloading Stock Quotes...."); DownloadData.main(null); }
[ "public void getHistoricalData(KiteConnect kiteConnect) throws KiteException, IOException {\n SimpleDateFormat formatter = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n Date from = new Date();\n Date to = new Date();\n try {\n from = formatter.parse(\"2019-12-20 09:15:00\");\n to = formatter.parse(\"2019-12-20 15:30:00\");\n }catch (ParseException e) {\n e.printStackTrace();\n }\n //for SBI alone\n HistoricalData historicalData = kiteConnect.getHistoricalData(from, to, \"779521\", \"15minute\", false, true);\n System.out.println(historicalData.dataArrayList.size());\n System.out.println(historicalData.dataArrayList.get(0).volume);\n System.out.println(historicalData.dataArrayList.get(historicalData.dataArrayList.size() - 1).volume);\n System.out.println(historicalData.dataArrayList.get(0).oi);\n }", "@Scheduled(cron=\"* 0 9-17/1 * * MON-FRI\")\n public void updateEveryHour() {\n if (marketOpen) {\n this.marketTrades = autoCreate();\n return;\n }\n\n expireTrades();\n }", "@Override\n public void launchDownload() {\n\n new NewsDownload(this,\"https://api.nytimes.com/svc/topstories/v2/home.json?api-key=1ae7b601c1c7409796be77cce450f631\",\n getContext(),true)\n .execute();\n }", "@Scheduled(cron = \"0 0 0/2 * * ?\")\n\tpublic void pullNewsFeedFromNyTimes() throws Exception {\n\t\tNyTimes nyTimes = getNewsFromNyTimes();\n\t\tlogger.info(\"Completed fetching news from Ny Times at :\" + new java.util.Date());\n\t}", "private String downloadFile(String theTicker) throws MalformedURLException, IOException\r\n {\r\n String preUrl = \"http://chart.finance.yahoo.com/table.csv?s=\" + theTicker + \"&a=3&b=12&c=1996&d=0&e=31&f=2017&g=d&ignore=.csv\";\r\n String fileLocString = \"StockFiles\\\\\" + theTicker + \".csv\";\r\n\r\n File currentFile = new File (fileLocString); // creates the file object to be used two lines down\r\n URL currentUrl = new URL (preUrl); //creates a url to use on next line\r\n FileUtils.copyURLToFile(currentUrl, currentFile); //actually downloads the file\r\n \r\n \r\n return fileLocString;\r\n }", "String getStockData(String symbol) throws Exception\n\t{\n\t\tfinal String urlHalf1 = \"https://www.alphavantage.co/query?function=TIME_SERIES_DAILY&symbol=\";\n\t\tfinal String urlHalf2 = \"&apikey=\";\n\t\tfinal String apiKey = \"FKS0EU9E4K4UQDXI\";\n\n\t\tString url = urlHalf1 + symbol + urlHalf2 + apiKey;\n\n\t\tJsonParser parser = new JsonParser();\n\n\t\tString hitUrl = url;\n\t\tString jsonData = getJsonData(hitUrl);\n\n\t\tJsonElement jsonTree = parser.parse(jsonData);\n\n\t\tString returnData = \"\";\n\n\t\tif (jsonTree.isJsonObject())\n\t\t{\n\t\t\tJsonObject jsonObject = jsonTree.getAsJsonObject();\n\n\t\t\tJsonElement timeSeries = jsonObject.get(\"Time Series (Daily)\");\n\n\t\t\tif (timeSeries.isJsonObject())\n\t\t\t{\n\t\t\t\tJsonObject timeObject = timeSeries.getAsJsonObject();\n\n\t\t\t\tDate date = new Date();\n\n\t\t\t\tCalendar calendar = new GregorianCalendar();\n\t\t\t\tcalendar.setTime(date);\n\n\t\t\t\t// Loop until we reach most recent Friday (market closes on Friday)\n\t\t\t\twhile (calendar.get(Calendar.DAY_OF_WEEK) < Calendar.FRIDAY\n\t\t\t\t\t\t|| calendar.get(Calendar.DAY_OF_WEEK) > Calendar.FRIDAY)\n\t\t\t\t{\n\t\t\t\t\tcalendar.add(Calendar.DAY_OF_MONTH, -1);\n\t\t\t\t}\n\n\t\t\t\tint year = calendar.get(Calendar.YEAR);\n\t\t\t\tint month = calendar.get(Calendar.MONTH) + 1;\n\t\t\t\tint day = calendar.get(Calendar.DAY_OF_MONTH);\n\n\t\t\t\tString dayToString = Integer.toString(day);\n\n\t\t\t\tif (dayToString.length() == 1)\n\t\t\t\t\tdayToString = \"0\" + dayToString;\n\n\t\t\t\tJsonElement currentData = timeObject.get(year + \"-\" + month + \"-\" + dayToString);\n\n\t\t\t\tif (currentData.isJsonObject())\n\t\t\t\t{\n\t\t\t\t\tJsonObject dataObject = currentData.getAsJsonObject();\n\n\t\t\t\t\tJsonElement openPrice = dataObject.get(\"1. open\");\n\t\t\t\t\tJsonElement closePrice = dataObject.get(\"4. close\");\n\t\t\t\t\tJsonElement highPrice = dataObject.get(\"2. high\");\n\t\t\t\t\tJsonElement lowPrice = dataObject.get(\"3. low\");\n\n\t\t\t\t\treturnData = year + \"-\" + month + \"-\" + dayToString + \" - \" + symbol + \": Opening price: $\"\n\t\t\t\t\t\t\t+ openPrice.getAsString() + \" / Closing price: $\" + closePrice.getAsString()\n\t\t\t\t\t\t\t+ \" / High price: $\" + highPrice.getAsString() + \" / Low price: $\" + lowPrice.getAsString();\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\treturn returnData;\n\t}", "@Scheduled(cron = \"0 0 0 * * *\") //for 30 seconds trigger -> 0,30 * * * * * for 12am fires every day -> 0 0 0 * * *\n\tpublic void cronJob() {\n\t\tList<TodayBalance> tb = balanceService.findTodaysBalance();\n\t\tList<TodayBalance> alltb = new ArrayList<TodayBalance>();\n\t\talltb.addAll(tb);\n\t\t\n\t\n\t\tCalendar cal = Calendar.getInstance();\n\t\tcal.add(Calendar.DATE, -1);\n\t\n\t\tif(!alltb.isEmpty()) {\n\t\t\tfor (TodayBalance tbal : alltb ) {\n\t\t\t \n\t\t\t\tClosingBalance c = new ClosingBalance();\n\t\t\t\tc.setCbalance(tbal.getBalance());\n\t\t\t\tc.setDate((cal.getTime()).toString());\n\t\t \n\t\t\t\tclosingRepository.save(c);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public void downloadData() {\n\t\tint start = millis();\n\t\tdthread = new DaysimDownloadThread();\n\t\tdthread.start();\n\t\tdataready = false;\n\t\twhile(!dataready) {\n\t\t\tif((millis() - start)/175 < 99) {\n\t\t\t\tLightMaskClient.setMainText(\"\\n\\n\" + \"Downloading: \" + (millis() - start)/175 + \"% completed\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tLightMaskClient.setMainText(\"Downloading: \" + 99 + \"% completed\");\n\t\t\t}\n\t\t\tdelay(100);\n\t\t}\n\t\tdthread.quit();\n\t\tLightMaskClient.setMainText(\"\\n\\n\" + \"Downloading: 100% completed\");\n\t\tToolkit.getDefaultToolkit().beep();\n\t\tdelay(1000); \n\t\tLightMaskClient.setMainText(\"Please disconnect the Daysimeter\");\n\t\tLightMaskClient.dlComplete = true;\n\t\t//setup the download for processing\n\t\tfor(int i = 0; i < EEPROM.length; i++) {\n\t\t\tEEPROM[i] = bytefile1[i] & 0xFF;\n\t\t}\n\t \n\t\tfor(int i = 0; i < header.length; i++) {\n\t\t\theader[i] = bytefile2[i] & 0xFF;\n\t\t}\n\t\t\n\t\tasciiheader = MakeList(header);\n\t\tisnew = asciiheader[2].contains(\"daysimeter\");\n\t\tisUTC = asciiheader[1].contains(\"1.3\") || asciiheader[1].contains(\"1.4\")\n\t\t\n\t\torganizeEEPROM();\n\t\tprocessData();\n\t\tsavefile();\n\t}", "public void downloadRateSheetHistory()\n\t{\n\t\tclick_button(\"Download CSV Button\", downloadCSVButton);\n\t\tfixed_wait_time(5);\n\t\t\n\t\tif(isFileDownloaded(\"rateSheetHistory.csv\"))\n\t\t\toReport.AddStepResult(\"\", \"Clicked on Download CSV icon, Verified that filtered results are downloaded\", \"PASS\");\n\t\telse\n\t\t\toReport.AddStepResult(\"\", \"Clicked on Download CSV icon, but that filtered results are not downloaded\", \"FAIL\");\n\t\t\n\t\tcsvToExcel();\n\t\t@SuppressWarnings(\"static-access\")\n\t\tint recordsCount = oExcelData.getRowCount(getTheNewestFile(oParameters.GetParameters(\"downloadFilepath\"), \"xlsx\"));\n\t\toParameters.SetParameters(\"recordsInExcel\", String.valueOf(recordsCount));\n\t\t\n\t\tdeleteFile(\"C:/CCM/Downloads/rateSheetHistory.csv\");\n\t\t\n\t\tdeleteFile(\"C:/CCM/Downloads/rateSheetHistory.xlsx\");\n\t\t\n/*\t\tFile csvFile = new File(oParameters.GetParameters(\"downloadFilepath\")+\"/rateSheetHistory.csv\");\n\t\tcsvFile.delete();\n\t\t\n\t\tFile xlsxFile = new File(oParameters.GetParameters(\"downloadFilepath\")+\"/rateSheetHistory.xlsx\");\n\t\txlsxFile.delete();*/\n\t\t\n\t\tif(oParameters.GetParameters(\"UserFilteredRecords\").equals(oParameters.GetParameters(\"recordsInExcel\")))\n\t\t\toReport.AddStepResult(\"\", \"Clicked on Download CSV icon, Verified that filtered results are displayed in excel sheet \", \"PASS\");\n\t\telse\n\t\t\toReport.AddStepResult(\"\", \"Clicked on Download CSV icon, But that filtered results are not displayed in excel sheet \", \"FAIL\");\t\t\n\t}", "long getDailyRefreshTime();", "private static synchronized StockBean refreshStockInfo(String symbol, long time)\n {\n try\n {\n URL yahoofin = new URL(\"http://finance.yahoo.com/d/quotes.csv?s=\" + symbol + \"&f=sl1d1t1c1ohgv&e=.csv\");\n URLConnection yc = yahoofin.openConnection();\n BufferedReader in = new BufferedReader(new InputStreamReader(yc.getInputStream()));\n String inputLine;\n while ((inputLine = in.readLine()) != null)\n {\n String[] yahooStockInfo = inputLine.split(\",\");\n StockBean stockInfo = new StockBean();\n stockInfo.setTicker(yahooStockInfo[0].replaceAll(\"\\\"\", \"\"));\n stockInfo.setPrice(Float.valueOf(yahooStockInfo[1]));\n stockInfo.setChange(Float.valueOf(yahooStockInfo[4]));\n stockInfo.setChartUrlSmall(\"http://ichart.finance.yahoo.com/t?s=\" + stockInfo.getTicker());\n stockInfo.setChartUrlLarge(\"http://chart.finance.yahoo.com/w?s=\" + stockInfo.getTicker());\n stockInfo.setLastUpdated(time);\n stocks.put(symbol, stockInfo);\n break;\n }\n in.close();\n }\n catch (Exception ex)\n {\n System.out.print(\"Unable to get stock quote\");\n ex.printStackTrace();\n //log.error(\"Unable to get stockinfo for: \" + symbol + ex);\n }\n return stocks.get(symbol);\n }", "protected void runEach10Minutes() {\n try {\n saveHistoryData();\n if (isEnabledScheduler()) {\n boolean action = getLightSchedule().getCurrentSchedule();\n if (action) {\n if (!currentState) switchOn();\n } else {\n if (currentState) switchOff();\n }\n }\n } catch (RemoteHomeManagerException e) {\n RemoteHomeManager.log.error(44,e);\n } catch (RemoteHomeConnectionException e) {\n RemoteHomeManager.log.error(45,e);\n }\n }", "public static void printDailyVolumeForSingleStock() throws Exception {\r\n\t\tString symbol = \"GOOG\";\r\n\t\tFile file = new File(StockConst.INTRADAY_DIRECTORY_PATH_GOOGLE + symbol + \".txt\");\r\n\t\tMultiDaysCandleList mdstockCandleList = getIntraDaystockCandleList(file);\r\n\t\tfor (int i = 0; i < mdstockCandleList.size(); i++) {\r\n\t\t\tlong volumeDay = 0;\r\n\t\t\tIntraDaystockCandleList idstockCandleList = mdstockCandleList.get(i);\r\n\t\t\tfor (int j = 0; j < idstockCandleList.size(); j++) {\r\n\t\t\t\tvolumeDay += idstockCandleList.get(j).getVolume();\r\n\t\t\t}\r\n\t\t\tSystem.out.println(idstockCandleList.getTimestamp() + \" \" + volumeDay);\r\n\t\t}\r\n\t}", "public void readPrices() {\n\t\tDate version = new Date();\n\t\tString altparty = getAltpartyid();\n\t\tboolean checkedVersion = false;\n\t\tString message = \"Interhome readPrices \" + altparty;\n\t\tLOG.debug(message);\n\t\tString fn = null;\n\t\t\n\t\tString salesoffice = getSalesOfficeCode(Currency.Code.EUR.name());\n\t\tCurrency.Code currency = Currency.Code.EUR;\n\t\t\n\t\tfinal SqlSession sqlSession = RazorServer.openSession();\n\t\ttry {\n\t\t\tfn = \"dailyprice_\" + salesoffice + \"_\" + currency.name().toLowerCase() + \".xml\";\n\n\t\t\t//check version of svn file and last price database entry\n\t\t\tnet.cbtltd.shared.Price action = new net.cbtltd.shared.Price();\n\t\t\taction.setState(net.cbtltd.shared.Price.CREATED);\n\t\t\taction.setPartyid(\"90640\");\n\t\t\taction.setAvailable(1);\n\n\t\t\tDate priceVersion = sqlSession.getMapper(PriceMapper.class).maxVersion(action);\n\t\t\tcheckedVersion = checkVersion(fn, priceVersion);\n\t\t\tif (checkedVersion) {\n\t\t\t\tJAXBContext jc = JAXBContext.newInstance(\"net.cbtltd.rest.interhome.price\");\n\t\t\t\tUnmarshaller um = jc.createUnmarshaller();\n\t\t\t\t\n\t\t\t\tPrices prices = (Prices) um.unmarshal(ftp(fn));\n\t\t\t\t\n\t\t\t\tif (prices != null && prices.getPrice() != null) {\n\t\t\t\t\tint count = prices.getPrice().size();\n\t\t\t\t\tLOG.debug(\"Total daily prices count: \" + count);\n\t\t\t\t} else {\n\t\t\t\t\tLOG.debug(\"Error, no dailyprices file\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\n\t\t\t\tint i = 0;\n\t\t\t\tfor (Price price : prices.getPrice()) {\n\t\t\t\t\tString altid = price.getCode();\n//\t\t\t\t\tif (!altid.equals(\"CH3920.126.1\") || !\"CH3920.126.1\".equalsIgnoreCase(altid)) continue;\n\t\t\t\t\tString productid = getProductId(altid);\n\t\t\t\t\t\n\t\t\t\t\tif (productid == null) {\n\t\t\t\t\t\tProduct product = sqlSession.getMapper(ProductMapper.class).altread(new NameId(altparty, altid));\n\t\t\t\t\t\tif (product == null) {\n\t\t\t\t\t\t\tLOG.error(Error.product_id.getMessage() + \" \" + price.getCode());\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tPRODUCTS.put(altid, product.getId());\n\t\t\t\t\t\tproductid = getProductId(altid);\n\t\t\t\t\t}\n\t\n//\t\t\t\t\tif (!productid.equals(\"27077\") || !String.valueOf(27077).equalsIgnoreCase(productid)) continue;\n\t\n\t\t\t\t\taction = new net.cbtltd.shared.Price();\n\t\t\t\t\taction.setPartyid(altparty);\n\t\t\t\t\taction.setEntitytype(NameId.Type.Product.name());\n\t\t\t\t\taction.setEntityid(productid);\n\t\t\t\t\taction.setCurrency(currency.name());\n\t\t\t\t\taction.setQuantity(1.0);\n\t\t\t\t\taction.setUnit(Unit.DAY);\n\t\t\t\t\taction.setName(net.cbtltd.shared.Price.RACK_RATE);\n\t\t\t\t\taction.setType(NameId.Type.Reservation.name());\n\t\t\t\t\taction.setDate(price.getStartdate().toGregorianCalendar().getTime());\n\t\t\t\t\taction.setTodate(price.getEnddate().toGregorianCalendar().getTime());\n\t\n\t\t\t\t\tnet.cbtltd.shared.Price exists = sqlSession.getMapper(PriceMapper.class).exists(action);\n\t\t\t\t\tif (exists == null) {sqlSession.getMapper(PriceMapper.class).create(action);}\n\t\t\t\t\telse {action = exists;}\n\t\n\t\t\t\t\taction.setState(net.cbtltd.shared.Price.CREATED);\n\t\t\t\t\taction.setRule(net.cbtltd.shared.Price.Rule.AnyCheckIn.name());\n\t\t\t\t\taction.setFactor(1.0);\n//\t\t\t\t\tDouble rentalPrice = price.getRentalprice().doubleValue();\n//\t\t\t\t\tDouble value = duration > 0.0 ? NameId.round(rentalPrice / quantity) : rentalPrice;\n\t\t\t\t\taction.setValue(price.getRentalprice().doubleValue());\n//\t\t\t\t\taction.setMinimum(price.getMinrentalprice().doubleValue());\n\t\t\t\t\taction.setVersion(version);\n\t\t\t\t\taction.setAvailable(1);\n\t\t\t\t\tsqlSession.getMapper(PriceMapper.class).update(action);\n\t\t\t\t\tsqlSession.getMapper(PriceMapper.class).cancelversion(action);\n\t\n\t\t\t\t\tLOG.debug(i++ + \" DailyPrice: \" + \" \" + price.getCode() + \" \" + productid + \" \" + salesoffice + \" \" + action.getValue() + \" \" + currency + \" daily\");\n\t\n//\t\t\t\t\tif (price.getFixprice().signum() != 0) {\n\t\t\t\t\t\tAdjustment adjust = setAdjustment(sqlSession, productid, 5, 999, currency.name(), action.getDate(), action.getTodate(), price, Adjustment.WEEK, \"fixprice\", version);\n\t\t\t\t\t\tDAILYPRICES.put(adjust.getID(), price.getRentalprice().doubleValue());\n\t\n\t\t\t\t\t\tLOG.debug(i++ + \" FixPrice: \" + \" \" + price.getCode() + \" \" + productid + \" \" + salesoffice + \" \" + adjust.getExtra() + \" \" + currency + \" fixprice\");\n//\t\t\t\t\t}\n\t\t\t\t\tif (price.getMidweekrentalprice().signum() != 0) {\n\t\t\t\t\t\tadjust = setAdjustment(sqlSession, productid, 1, 1, currency.name(), action.getDate(), action.getTodate(), price, (byte)0x1E, \"midweek\", version);\n\t\t\t\t\t\tadjust = setAdjustment(sqlSession, productid, 2, 2, currency.name(), action.getDate(), action.getTodate(), price, (byte)0xE, \"midweek\", version);\n\t\t\t\t\t\tadjust = setAdjustment(sqlSession, productid, 3, 3, currency.name(), action.getDate(), action.getTodate(), price, (byte)0x6, \"midweek\", version);\n\t\t\t\t\t\tadjust = setAdjustment(sqlSession, productid, 4, 4, currency.name(), action.getDate(), action.getTodate(), price, Adjustment.MONDAY, \"midweek\", version);\n\t\n\t\t\t\t\t\tLOG.debug(i++ + \" MidweekPrice: \" + \" \" + price.getCode() + \" \" + productid + \" \" + salesoffice + \" \" + adjust.getExtra() + \" \" + currency + \" midweek\");\n\t\t\t\t\t}\n\t\t\t\t\tif (price.getWeekendrentalprice().signum() != 0) {\n\t\t\t\t\t\tadjust = setAdjustment(sqlSession, productid, 1, 1, currency.name(), action.getDate(), action.getTodate(), price, Adjustment.SATURDAY, \"weekend\", version);\n\t\t\t\t\t\tadjust = setAdjustment(sqlSession, productid, 2, 2, currency.name(), action.getDate(), action.getTodate(), price, (byte)0x60, \"weekend\", version);\n\t\t\t\t\t\tadjust = setAdjustment(sqlSession, productid, 3, 3, currency.name(), action.getDate(), action.getTodate(), price, (byte)0x70, \"weekend\", version);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tLOG.debug(i++ + \" WeekendPrice: \" + \" \" + price.getCode() + \" \" + productid + \" \" + salesoffice + \" \" + adjust.getExtra() + \" \" + currency + \" weekend\");\n\t\t\t\t\t}\n//\t\t\t\t\tLOG.debug(i++ + \"DailyPrice: \" + \" \" + price.getCode() + \" \" + product.getId() + \" \" + salesoffice + \" \" + action.getValue() + \" \" + currency + \" \" + duration);\n\t\t\t\t}\n\t\t\t\tAdjustment cancelAction = new Adjustment();\n\t\t\t\tcancelAction.setCurrency(currency.name());\n\t\t\t\tcancelAction.setPartyID(altparty);\n\t\t\t\tcancelAction.setVersion(version);\n\t\t\t\t\n\t\t\t\tsqlSession.getMapper(AdjustmentMapper.class).cancelversion(cancelAction);\n\t\t\t\tsqlSession.commit();\n\t\t\t}\n\t\t}\n\t\tcatch (Throwable x) {\n\t\t\tsqlSession.rollback();\n\t\t\tLOG.error(x.getMessage());\n\t\t}\n\t\tfinally {\n\t\t\tsqlSession.close();\n\t\t\tdelete(fn);\n\t\t}\n\t\tif (checkedVersion) {\n\t\t\treadPrices(version, salesoffice, currency, 7);\n\t\t\treadPrices(version, salesoffice, currency, 14);\n\t\t\treadPrices(version, salesoffice, currency, 21);\n\t\t\treadPrices(version, salesoffice, currency, 28);\n\t\t}\n\t}", "public void backloadRecentHistoData() throws APIUnavailableException {\n\n //gets a list of the coins in the top_30 coins table\n ArrayList<TopCoins> topCoins = topCoinsMapper.getTopCoins();\n\n\n //gets the coin symbols from the top 30 coins table and backloads the histo\n //data for each coin in each table\n for (int i = 0; i < topCoins.size(); i++) {\n\n //the symbol of the coin in the current loop through the list of top coins;\n //used in the call to the CryptoCompare API to specify for which coin data\n //is requested for\n String fsym = topCoins.get(i).getSymbol();\n\n //the coin ID that corresponds to the fsym parameter;\n //assigning the id of the given coin to variable coinID in order to\n //save the historical data to DB with the id of the coin for which the data\n //is being saved\n int coinID = topCoins.get(i).getEntry_id();\n\n\n\n\n //----------------MINUTES----------------\n\n String urlMinutes = \"https://min-api.cryptocompare.com/data/histominute?fsym=\" + fsym + \"&tsym=USD\"\n + \"&limit=2000&e=CCCAGG\";\n\n //object that will contain the response from the API call\n HistoMinute histoMinute = new HistoMinute();\n try {\n //API call using Nicola's method to log call and check remaining calls\n histoMinute = (HistoMinute) cryptoCompareService.callCryptoCompareAPI(urlMinutes, histoMinute);\n\n if (histoMinute.getData().length < 1) {\n throw new APIUnavailableException();\n }\n\n } catch (Exception e) {\n throw new APIUnavailableException();\n }\n\n //holds the timestamp of the latest entry in the histo_minute table\n long lastHistominTime;\n\n //used as index in Data array in the response from the API call (the histoMinute object)\n int indexMinute = 0;\n\n //tries to retrieve timestamp of last entry in DB for the given coin;\n //if no entry exists for given coin, the catch statement executes\n try {\n lastHistominTime = backloadHistoDataMapper.getLastHistominEntry(coinID).getTime();\n\n //used to determine from which element in the Data array from the API response\n //backloading should start; this is to avoid backloading duplicate data\n for (Data meetingPoint : histoMinute.getData()) {\n\n //each time through the loop indexMinute is incremented; when a match is found between\n //the timestamp of the last entry in the DB for the given coin and a timestamp in the\n //API response for the given coin, the loop breaks; now, when indexMinute is used as the index\n //when looping through the array from the API response, the first element retrieved from\n //the API response to be backloaded into the DB will be the element at indexMinute, hence\n //it will be the element that should be right after the last entry in the DB\n indexMinute++;\n if (meetingPoint.getTime() == lastHistominTime) {\n break;\n }\n\n /*\n since only 2001 elements can be received from the API response at a time, if indexMinute\n reaches 2001, it is reset back to 0 since no entry in the DB was found that matched\n any of the elements in the response from the API call; now that it is reset back to 0,\n all the elements from the response will be backloaded since not finding a match either means\n that the method has not been run for so long that the API data has advanced too\n much in time or that simply no entries have been uploaded to the DB for that given coin;\n also, the lastHistoMinTime is assigned timestamp of first element in array\n from API response so that backloading starts from the first element in the array\n */\n if (indexMinute == 2001) {\n indexMinute = 0;\n lastHistominTime = histoMinute.getData()[0].getTime();\n break;\n }\n\n }\n\n //if no entry exists for given coin, timestamp of first element in array\n //from API response assigned to lastHistoMinTime so that backloading starts\n //from the first element in the array, thus backloading all the data received from\n //the response since no data exists for given coin\n } catch (Exception e) {\n lastHistominTime = histoMinute.getData()[0].getTime();\n }\n\n\n //variables for calculating percentage change between opening and closing prices of a given coin\n double open;\n double close;\n //% increase = Increase ÷ Original Number × 100.\n //if negative number, then this is a percentage decrease\n double percentChange;\n\n //will hold all the objects to be uploaded to DB as a batch insert\n ArrayList<HistoDataDB> histoDataDBArrayList = new ArrayList<>();\n\n //loop that will iterate as many times as there are data objects in the response,\n //assign each data object to a HistoDataDB object and add it to histoDataDBArrayList\n for (long j = lastHistominTime;\n j < histoMinute.getData()[histoMinute.getData().length - 1].getTime(); j = j + 60) {\n\n HistoDataDB histoDataDB = new HistoDataDB();\n\n// can be used to convert time in seconds from API call to specific date and time\n// histoDataDB.setTime( DateUnix.secondsToSpecificTime( histoMinute.getData()[i].getTime() ) );\n\n open = histoMinute.getData()[indexMinute].getOpen();\n close = histoMinute.getData()[indexMinute].getClose();\n percentChange = (((close - open) / open) * 100);\n\n histoDataDB.setTime(histoMinute.getData()[indexMinute].getTime());\n histoDataDB.setClose(histoMinute.getData()[indexMinute].getClose());\n histoDataDB.setHigh(histoMinute.getData()[indexMinute].getHigh());\n histoDataDB.setLow(histoMinute.getData()[indexMinute].getLow());\n histoDataDB.setOpen(histoMinute.getData()[indexMinute].getOpen());\n histoDataDB.setVolumefrom(histoMinute.getData()[indexMinute].getVolumefrom());\n histoDataDB.setVolumeto(histoMinute.getData()[indexMinute].getVolumeto());\n histoDataDB.setCoin_id(coinID);\n histoDataDB.setPercent_change(percentChange);\n\n// backloadHistoDataMapper.insertHistoMinuteIntoDB(histoDataDB);\n\n histoDataDBArrayList.add(histoDataDB);\n\n indexMinute++;\n\n }\n\n backloadHistoDataMapper.insertHistoMinuteData(histoDataDBArrayList);\n\n }\n }", "public void writeDataFile(String stock) throws FileNotFoundException {\n\n\t\tStringBuilder jsonData = new StringBuilder(\"\");\n\t\tStringBuilder priceData = new StringBuilder(\"\");\n\t\tStringBuilder volumeData = new StringBuilder(\"\");\n\t\tStringBuilder summaryData = new StringBuilder(\"\");\n\n\t\tString[] str = { \"January\", \"February\", \"March\", \"April\", \"May\",\n\t\t\t\t\"June\", \"July\", \"August\", \"September\", \"October\", \"November\",\n\t\t\t\t\"December\" };\n\n\t\tLocalDate fromDate = new LocalDate(2010, 11, 17);\n\n\t\tLocalDate toDate = new LocalDate();\n\n\t\tLinkedList<Stock> ll = FinanceQuery.getHistorical(stock, fromDate,\n\t\t\t\ttoDate, \"d\");\n\n\t\tIterator<Stock> iterator = ll.iterator();\n\n\t\tFile file = new File(\"./WebRoot/static/javascript/Vis_Files/data-\"\n\t\t\t\t+ stock + \".js\");\n\t\tfile.deleteOnExit();\n\t\tPrintWriter write = new PrintWriter(file);\n\n\t\tint i = 0;\n\n\t\twhile (iterator.hasNext()) {\n\t\t\tString jD = \"\";\n\t\t\tString pD = \"\";\n\t\t\tString vD = \"\";\n\t\t\tString sD = \"\";\n\t\t\tStock s = iterator.next();\n\n\t\t\t// will contain all the key points about the share\n\t\t\tjD += \"{date:'\" + str[s.getDate().getMonthOfYear() - 1] + \" \"\n\t\t\t\t\t+ s.getDate().getDayOfMonth() + \", \"\n\t\t\t\t\t+ s.getDate().getYear() + \"',\";\n\t\t\tjD += \"open:\" + s.getOpen() + \",\";\n\t\t\tjD += \"high:\" + s.getHigh() + \",\";\n\t\t\tjD += \"low:\" + s.getLow() + \",\";\n\t\t\tjD += \"close:\" + s.getClose() + \",\";\n\t\t\tjD += \"volume:\" + s.getVolume() + \"}\";\n\t\t\t// -----------------------------\n\t\t\t// will store the closing price of the share over the range of time\n\t\t\tpD += \"[\" + (ll.size() - 1 - i) + \",\" + s.getClose() + \"]\";\n\t\t\t// -----------------------------\n\t\t\t// will store the volume sold of the share over the range in time\n\t\t\tvD += \"[\" + (ll.size() - 1 - i) + \",\" + s.getVolume() + \"]\";\n\t\t\t// -----------------------------\n\t\t\t// summary of the data, same as price data\n\t\t\tsD += \"[\" + (ll.size() - 1 - i) + \",\" + s.getClose() + \"]\";\n\n\t\t\tif (i != 0) {\n\t\t\t\tjD += \",\";\n\t\t\t\tpD += \",\";\n\t\t\t\tvD += \",\";\n\t\t\t\tsD += \",\";\n\t\t\t}\n\n\t\t\ti++;\n\t\t\t// add to the front of the string\n\t\t\t// [so that olds dates are first and newest dates are last]\n\t\t\t// when iterating over the list - new dates are done first\n\t\t\tjsonData.insert(0, jD);\n\t\t\tpriceData.insert(0, pD);\n\t\t\tvolumeData.insert(0, vD);\n\t\t\tsummaryData.insert(0, sD);\n\t\t}\n\t\tjsonData.insert(0, \"var jsonData = [\");\n\t\tpriceData.insert(0, \"var priceData = [\");\n\t\tvolumeData.insert(0, \"var volumeData = [\");\n\t\tsummaryData.insert(0, \"var summaryData = [\");\n\n\t\twrite.println(jsonData + \"];\");\n\t\twrite.println(priceData + \"];\");\n\t\twrite.println(volumeData + \"];\");\n\t\twrite.println(summaryData + \"];\");\n\n\t\twrite.close();\n\t}", "@OnClick(R.id.bn_data_sync_download_data) void onClickDownload() {\n Toast.makeText(getApplicationContext(), \"Download is in progress...\", Toast.LENGTH_SHORT).show();\n\n // delete the current local cache before downloading new tables from server db\n deleteLocationData();\n deleteQuestionnaireData();\n deleteQuestionData();\n deleteAnswerData();\n deleteQAData();\n deleteLogicData();\n deleteQuestionRelationData();\n\n downloadLocationData();\n downloadQuestionnaireData();\n downloadQuestionData();\n downloadAnswerData();\n downloadQAData();\n downloadLogicData();\n downloadQuestionRelationData();\n\n Toast.makeText(getApplicationContext(), \"Download is done!\", Toast.LENGTH_SHORT).show();\n }", "@Scheduled(fixedRate = 120000)\n public void readRss() {\n\n List<ItemNews> itemList = new ArrayList<>();\n\n try {\n String url = \"https://www.nytimes.com/svc/collections/v1/publish/https://www.nytimes.com/section/world/rss.xml\";\n\n try (XmlReader reader = new XmlReader(new URL(url))) {\n SyndFeed feed = new SyndFeedInput().build(reader);\n for (SyndEntry entry : feed.getEntries()) {\n LocalDateTime localDateTime = entry.getPublishedDate().toInstant()\n .atZone(ZoneId.systemDefault())\n .toLocalDateTime();\n ItemNews item = new ItemNews();\n item.setTitle(entry.getTitle());\n item.setAuthor(entry.getAuthor());\n item.setLink(entry.getLink());\n item.setDescription(entry.getDescription().getValue());\n item.setDateTime(localDateTime);\n modifyItem(item);\n itemList.add(item);\n }\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n if (!itemList.isEmpty()) {\n Collections.sort(itemList , Comparator.comparing(ItemNews::getDateTime));\n saveItems(itemList);\n }\n }", "private void downloadDataFromServer() {\n if(Network.isAvailable(getActivity())) {\n PlacesDownload.downloadFromServer(getActivity());\n }else{\n mApp.getErrorManager().showError(R.string.error_action_refresh);\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
README.md exists but content is empty. Use the Edit dataset card button to edit it.
Downloads last month
8
Edit dataset card