Tutorial by Examples: c

You can use any name for the function. function custom_postype(){ register_post_type('cus_post',array( 'labels'=>array( 'name'=>'khaiyam'// Use any name you want to show in menu for your users ), 'public'=>true,// **Must required ...
Sometimes, we have to take input from users which should contain only alpha numeric characters. For example, lets say a Username system which allow only letters and numbers, Then this can be done with the following Regular Expression ^[a-zA-Z0-9]+$ ^ is restrict the start [a-zA-Z0-9]+ is th...
To call the QML classes in C++, you need to set the objectName property. In your Qml: import QtQuick.Controls 2.0 Button { objectName: "buttonTest" } Then, in your C++, you can get the object with QObject.FindChild<QObject*>(QString) Like that: QQmlApplicationEngine e...
Minimal example based on PHP manual example found here: http://php.net/manual/en/sockets.examples.php Create a websocket script that listens to Port 5000 Use putty, terminal to run telnet 127.0.0.1 5000 (localhost). This script replies with the message you sent (as a ping-back) <?php set_ti...
Like iOS where you use @IBOutlet and @IBAction, here you could use them too. Let's say we have a button which when clicked changes the label's text to something else. To get started: Add a WKInterfaceLabel and a WKInterfaceLabel to the InterfaceController. Ctrl-Drag from the WKInterfaceL...
Many watchOS apps (like Workout, Weather, Music, etc) have a main WKInterfaceTable or a set of buttons which are hooked up to another controller, similar to the navigation on iOS. This is called hierarchical view structure. To connect a button, Ctrl-Drag from the button to a controller, and select ...
Using the previous example of calculating the factorial of an integer, put in the hash table all values of factorial calculated inside the recursion, that do not appear in the table. As in the article about memoization, we declare a function f that accepts a function parameter fact and a integer pa...
Consider a company where every employee who is a manager, manages 1 or more employees, and every employee has only 1 manager. This results in two tables: EMPLOYEES EMP_IDFIRST_NAMELAST_NAMEMGR_IDE01JohnnyAppleseedM02E02ErinMacklemoreM01E03ColbyPaperworkM03E04RonSonswanM01 MANAGERS MGR_IDFIRST_N...
If you need to execute a repeating sequence of the same action with different parameters, use the ‘Parameterized Controller’ 3rd party plugin from JMeter-Plugins project. You need to install this plugin first by following installation procedure. Let’s assume that we want to parameterize the login ...
Consider next example: public interface A { default void foo() { System.out.println("A.foo"); } } public interface B { default void foo() { System.out.println("B.foo"); } } Here are two interfaces declaring default method foo with the same signature. If you wi...
package main import ( "fmt" "time" log "github.com/Sirupsen/logrus" mgo "gopkg.in/mgo.v2" "gopkg.in/mgo.v2/bson" ) var mongoConn *mgo.Session type MongoDB_Conn struct { Host string `json:"Host"` ...
here is a sample web.config in order to have both http and https support. <?xml version="1.0" encoding="utf-8"?> <configuration> <appSettings> <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" /> </a...
public class RecyclerTouchListener implements RecyclerView.OnItemTouchListener { private GestureDetector gestureDetector; private RecyclerTouchListener.ClickListener clickListener; public RecyclerTouchListener(Context context, final RecyclerView recyclerView, final RecyclerTouchL...
Within the Schema Builder, use the Schema facade with any connection. Run the connection() method to specify which connection to use: Schema::connection('mysql2')->create('some_table', function($table) { $table->increments('id'): });
When applied on a map, returns a new map with new or updated key val pairs. It can be used to add new information in existing map. (def userData {:name "Bob" :userID 2 :country "US"}) (assoc userData :age 27) ;; { :name "Bob" :userID 2 :country "US&qu...
function exampleCloseIncident(id, status){ var parameters = {}; var incidentresolution = {}; incidentresolution["[email protected]"] = "/incidents(" + id + ")"; incidentresolution["@odata.type"] = "Microsoft.Dynamics.CRM.incidentre...
This function tells whether a given time lies within a a given time interval. (require '[clj-time.core :as t]) (def date1 (t/date-time 2016 11 5)) (def date2 (t/date-time 2016 12 5)) (def test-date1 (t/date-time 2016 12 20)) (def test-date2 (t/date-time 2016 11 15)) (t/within? (t/interva...
Data can be extracted from a blastdb using blastdbcmd which should be included in a blast installation. You can specify from the options below as part of -outfmt what metadata to include and in what order. From the man page: -outfmt <String> Output format, where the available format sp...
public class ExpandBarDynamicContentExample { private final Display display; private final Shell shell; public ExpandBarDynamicContentExample() { display = new Display(); shell = new Shell(display); shell.setLayout(new FillLayout()); // Create...
/** * Add meta box to post types. * * @since 1.0.0 */ function myplugin_add_meta_box() { // Set up the default post types/ $types = array( 'post', ); // Optional filter for adding the meta box to more types. Uncomment to use. // $types = apply_filters( 'mypl...

Page 747 of 826