Tutorial by Examples: ai

Registering a custom post type does not mean it gets added to the main RSS feed automatically.You need to use request filter to add custom post types to main RSS feed. // Add 'books' custom post types on main RSS feed function add_book_post_types_to_rss($qv) { if (isset($qv['feed']) &&amp...
Consider the following code: public async Task MethodA() { await MethodB(); // Do other work } public async Task MethodB() { await MethodC(); // Do other work } public async Task MethodC() { // Or await some other async work await Task.Delay(100); } ...
It parses the data from the %%GLOBAL_ConversionCode%% template variable, and as such this script should be inserted in order.html immediately after the %%GLOBAL_ConversionCode%% variable. This was originally intended for the Blueprint theme framework and, as such, may not work on Stencil. <scrip...
The following 3 features (that were deprecated in 1.9) are no longer available in 1.10, they are : fnRender: According to the deverloper: The old fnRender option provided a method of manipulating a cell when it was created. however, it was provided with a confusing list of options as its a...
Fibonacci numbers are used as a very common example for teaching recursion. fib 0 = 0 fib 1 = 1 fib n = fib (n-1) + fib (n-2)
public class Main extends JavaPlugin { @Override public void onEnable() { Bukkit.getPluginManager().registerEvents(this, this); } @EventHandler public void yourEvent(Event e) { //... } }
Now you can start writing your own go code with auto-completion using Atom and Gulp: package main import ( "fmt" "mypackage" ) func main() { println("4! = ", mypackage.Factorial(4)) }
Enumerating through Keys foreach ($key in $var1.Keys) { $value = $var1[$key] # or $value = $var1.$key } Enumerating through Key-Value Pairs foreach ($keyvaluepair in $var1.GetEnumerator()) { $key1 = $_.Key1 $val1 = $_.Val1 }
The code below shows how to perform asynchronous navigation when the app is in a MasterDetailPage context. public async Task NavigateMasterDetail(Page page) { if (page == null) { return; } var masterDetail = App.Current.MainPage as Mas...
ZeroR is a simple classifier. It doesn't operate per instance instead it operates on general distribution of the classes. It selects the class with the largest a priori probability. It is not a good classifier in the sense that it doesn't use any information in the candidate, but it is often used as...
In order to build a good classifier we will often need to get an idea of how the data is structered in feature space. Weka offers a visualisation module that can help. Some dimensions already seperate the classes quite well. Petal-width orders the concept quite neatly, when compared to petal-widt...
Trees can build models that work on independent features and on second order effects. So they might be good candidates for this domain. Trees are rules that are chaind together, a rule splits instances that arrive at a rule in subgroups, that pass to the rules under the rule. Tree Learners generate...
You can get your working folder by calling the method getFilesDir() on your Activity (Activity is the central class in your application that inherits from Context. See here). Reading is not different. Only your application will have access to this folder. Your activity could contain the following c...
Bullet This one particularly blew my mind. The bullet gem helps you kill all the N+1 queries, as well as unnecessarily eager loaded relations. Once you install it and start visiting various routes in development, alert boxes with warnings indicating database queries that need to be optimized will p...
The example I'm going to discuss assumes you have a Docker installation that works in your system and a basic understanding of how to work with Node.js . If you are aware of how you must work with Docker , it should be evident that Node.js framework need not be installed on your system, rather we wo...
First, you need to prepare the environment by creating the SQL Server table and the CSV file. Run the script below in SQL Server to create the SQL table either on a new database or an existing one. For this example, I used my ‘TrainingDB’ database. /* Creates table for Students.csv */ CREATE TABL...
In our example we will be creating a customized formatter for email addresses that will allow us to display obfuscated email addresses to fool those nasty spammers. The formatter will have a some configuration options that will allow us to control how the email address is obfuscated: Remove @ an...
A single entry point to your application is possible with RequireJS by using the data-main attributed within the <script> tag. <script type="text/javascript" data-main="scripts/main" src="http://requirejs.org/docs/release/2.3.2/minified/require.js"></scr...
When asking Apache Spark related questions please include following information Apache Spark version used by the client and Spark deployment if applicable. For API related questions major (1.6, 2.0, 2.1 etc.) is typically sufficient, for questions concerning possible bugs always use full version ...
The main queue is the dispatch queue in which all the UI updates take place and the code involving UI changes are placed. You need to get to the main queue in order to update UI on completion of an asynchronous process like NSURLSession There are two types of main queue calls synchronous and async...

Page 38 of 47