Tutorial by Examples

<git command = "pull" dir = "repository_path" />
<input message="Commit message" addproperty="commit-message" /> <git command="add"> <args> <arg value="." /> </args> </git> <git command="commit"> <args> ...
std::any an_object{ std::string("hello world") }; if (an_object.has_value()) { std::cout << std::any_cast<std::string>(an_object) << '\n'; } try { std::any_cast<int>(an_object); } catch(std::bad_any_cast&) { std::cout << "Wrong type...
1) Setup Node.JS Start the terminal and run the following commands to install nodeJS: curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash - sudo apt-get install nodejs If node command is unavailable sudo ln -s /usr/bin/nodejs /usr/bin/node Alternatives NodeJS instalations: curl...
18.0 By default, any function specified in a -callback directive in a behaviour module must be exported by a module that implements that behaviour. Otherwise, you'll get a compiler warning. Sometimes, you want a callback function to be optional: the behaviour would use it if present and exported,...
Suppose that we have a text and a pattern. We need to determine if the pattern exists in the text or not. For example: +-------+---+---+---+---+---+---+---+---+ | Index | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | +-------+---+---+---+---+---+---+---+---+ | Text | a | b | c | b | c | g | l | x | +-------...
To sort this table Employee by department, you would use ORDER BY Department. However, if you want a different sort order that is not alphabetical, you have to map the Department values into different values that sort correctly; this can be done with a CASE expression: NameDepartmentHasanITYusufHR...
Stacks are often used for parsing. A simple parsing task is to check whether a string of parentheses are matching. For example, the string ([]) is matching, because the outer and inner brackets form pairs. ()<>) is not matching, because the last ) has no partner. ([)] is also not matching, be...
Entity falling distance is the distance the entity have fallen without reaching a block. It can be used to calculate different damage from falling, or activating an effect after a big fall. Retrieving the falling distance float distanceFell = entity.getFallingDistance(); Setting the falling ...
Follow the below steps to install Oracle JDK from the latest tar file: Download the latest tar file from here - Current latest is Java SE Development Kit 8u112. You need sudo privilages: sudo su Create a dir for jdk install: mkdir /opt/jdk Extract downloaded tar into it: t...
You can cancel a fall damage by using the EntityDamageEvent @EventHandler public void onEntityDamage(EntityDamageEvent e) { Entity tookDamage = e.getEntity(); DamageCause cause = e.getCause(); if (cause == DamageCause.FALL){ //Damage was caused by falling, cancel it e.setCancelled(t...
If you find that no matter what you put in your URL only your default page is loading, it might be that your server does not support the PATH_INFO variable needed to serve search-engine friendly URLs. As a first step, open your application/config/config.php file and look for the URI Protocol inform...
This helper is loaded using the following code: In Controller itself(* can repeat again and again*) $this->load->helper('captcha'); In config/autoload.php (Load only once) $autoload['helper'] = array('captcha');
Takes an array of information to generate the CAPTCHA as input and creates the image to your specifications, returning an array of associative data about the image. [array] ( 'image' => IMAGE TAG 'time' => TIMESTAMP (in microtime) 'word' => CAPTCHA WORD ) The "imag...
Once loaded you can generate a captcha like this: $vals = array( 'word' => 'Random word', 'img_path' => './captcha/', 'img_url' => 'http://example.com/captcha/', 'font_path' => './path/to/fonts/texb.ttf', 'img_width' => '150', 'img_height'...
Here is an example of usage with a database. On the page where the CAPTCHA will be shown you'll have something like this: $this->load->helper('captcha'); $vals = array( 'img_path' => './captcha/', 'img_url' => 'http://example.com/captcha/' ); $cap = create_captc...
Before Java 8, there was DateFormat and SimpleDateFormat classes in the package java.text and this legacy code will be continued to be used for sometime. But, Java 8 offers a modern approach to handling Formatting and Parsing. In formatting and parsing first you pass a String object to DateTimeFor...
It's a common request to be able to handle a double-click on a row in a RadGridView. The solution proposed by Telerik (http://demos.telerik.com/silverlight/#GridView/ClickEvents ) is based around code behind: this.grid.AddHandler(GridViewCellBase.CellDoubleClickEvent, new EventHandler<RadRouted...
Packages are collections of R functions, data, and compiled code in a well-defined format. Public (and private) repositories are used to host collections of R packages. The largest collection of R packages is available from CRAN. Some of the most popular R machine learning packages are the following...
from sklearn import svm X = [[1, 2], [3, 4]] #Training Samples y = [1, 2] #Class labels model = svm.SVC() #Making a support vector classifier model model.fit(X, y) #Fitting the data clf.predict([[2, 3]]) #After fitting, new data can be classified by using predict()

Page 1030 of 1336