Tutorial by Examples: o

The void generator class: public class VoidGenerator extends ChunkGenerator { @SuppressWarnings("deprecation") public byte[] generate(World w, Random rand, int x, int z) { byte[] result = new byte[32768]; //chunksized array filled with 0 - Air //Build a...
A frequent reason why your read operation may not work is because your security rules reject the operation, for example because you're not authenticated (by default a database can only be accessed by an authenticated user). You can see these security rule violations in the logcat output. But it's e...
(ns so-doc.events (:require [goog.dom :as dom] [goog.events :as events])) (defn handle-click [event] ;an event object is passed to all events (js/alert "button pressed")) (events/listen (dom/getElement "button"); This is the dom element the event comes fro...
(ns so-doc.events) (enable-console-print!) (defn click-event [] (println "Button clicked")) (defn load-event [] (println "Page loaded!") (.addEventListener (.getElementById js/document "btn") "click" click-event false)) (.addEventListener ...
$collection = Mage::getModel('catalog/product') ->getCollection() ->setPageSize(20) ->setCurPage(1);
Large scale applications often need different properties when running on different environments. we can achieve this by passing arguments to NodeJs application and using same argument in node process to load specific environment property file. Suppose we have two property files for different enviro...
Specify the kind of objects to create using a prototypical instance, and create new objects by copying this prototype. In this example demonstrates the Prototype pattern in which new Color objects are created by copying pre-existing, user-defined Colors of the same type. using System; using Syste...
Provide an interface for creating families of related or dependent objects without specifying their concrete classes. In this example demonstrates the creation of different animal worlds for a computer game using different factories. Although the animals created by the Continent factories are diffe...
while true; do echo ok done or while :; do echo ok done or until false; do echo ok done
function positive() { return 0 } function negative() { return 1 }
if true; then echo Always executed fi if false; then echo Never executed fi
Search role in Ansible Galaxy ansible-galaxy search role_name Install role from Ansible Galaxy ansible-galaxy install role_name More help ansible-galaxy --help
#include <highgui.h> //... cv::Mat img = cv::imread("img.jpg"); ...
Show how to use cv::VideoCapture. Here is the example of loading video from file: #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include "opencv2/core/core.hpp" #include <iostream> using namespace cv; VideoCapture videoSourc...
Show how to use cv::VideoWriter. #include "opencv2/highgui/highgui.hpp" #include <iostream> using namespace cv; using namespace std; int main(int argc, char* argv[]) { VideoCapture cap(0); // open the video camera no. 0 if (!cap.isOpened()) // if not success, e...
using System; using Xamarin.Forms; namespace contact_picker { public class App : Application { public App () { // The root page of your application MainPage = new MyPage(); } protected override void OnStart () ...
using System; using Xamarin.Forms; namespace contact_picker { public class ChooseContactPage : ContentPage { public ChooseContactPage () { } } }
using Android.App; using Android.OS; using Android.Content; using Android.Database; using Xamarin.Forms; namespace contact_picker.Droid { [Activity (Label = "ChooseContactActivity")] public class ChooseContactActivity : Activity { public string type_num...
using UIKit; using AddressBookUI; using Xamarin.Forms; using Xamarin.Forms.Platform.iOS; using contact_picker; using contact_picker.iOS; [assembly: ExportRenderer (typeof(ChooseContactPage), typeof(ChooseContactRenderer))] namespace contact_picker.iOS { public partial class Choose...
Sample table (say Employee) structure Column NameDatatypeIDINTF_NameSTRINGL_NameSTRINGPhoneSTRINGAddressSTRING Project all the columns Use wild card * to project all the columns. e.g. Select * from Employee Project selected columns (say ID, Name) Use name of columns in the projection list. e...

Page 696 of 1038