Tutorial by Examples: e

RelativePanel has been introduced in Windows 10 and is used mainly to support adaptive layouts, where the child elements of the panel are laid out differently depending on available space. RelativePanel is typically used with visual states, which are used to switch the layout configuration, adaptin...
Here's an example of a React component with a "managed" input field. Whenever the value of the input field changes, an event handler is called which updates the state of the component with the new value of the input field. The call to setState in the event handler will trigger a call to ...
ActionScript 2.0: _root.createTextField("message", 0, 5, 5, 300, 50); var tf:TextFormat = new TextFormat(); tf.color = 0xFF0000; tf.size = 32; tf.bold = true; message.setTextFormat(tf); message.text = "Hello World!"; First function creates a TextField named "mess...
Unit tests test parts of the application in isolation. usually a unit under test is a class or module. let(:gift) { create :gift } describe '#find' do subject { described_class.find(user, Time.zone.now.to_date) } it { is_expected.to eq gift } end source This kind if test is as direct ...
Request tests are end to end tests that imitate the behavior of a user. it 'allows the user to set their preferences' do check 'Ruby' click_on 'Save and Continue' expect(user.languages).to eq ['Ruby'] end source This kind of test focuses on user flows and runs through all layers of th...
get_option function is used to retrieve a value from from options table based on option name. You can use the following code to get email address of a WordPress site administrator. <?php echo get_option('admin_email'); ?> get_option() has an optional 2nd argument, which allows you to set ...
We can use the get_bloginfo function to retrieve the email address of the site administrator. <?php echo get_bloginfo('admin_email'); ?>
To create a Hello World plug-in for Eclipse, click: File ➜ New ➜ Other... Select Plug-in Project and click Next > The New Plug-in Project wizard will guide you through the options for creating a new plug-in. Enter a project name (like HelloWorld), and click Next > On the Content pag...
For a non-main packages as well as main, instead of adding flags inside the code, write benchmarks in the test package , for example: func BenchmarkHello(b *testing.B) { for i := 0; i < b.N; i++ { fmt.Sprintf("hello") } } Then run the test with the profile flag ...
once a prof file has been generated, one can access the prof file using go tools: go tool pprof cpu.prof This will enter into a command line interface for exploring the profile Common commands include: (pprof) top lists top processes in memory (pprof) peek Lists all processes, use reg...
app/controllers/myname.js app/templates/myname.hbs app/routes/myname.js app/models/myname.js Using pods, the example above would translate into this: app/myname/controller.js app/myname/template.hbs app/myname/route.js app/myname/model.js
ember generate route foo --pod installing create app/pods/foo/route.js create app/pods/foo/template.hbs installing create tests/unit/pods/foo/route-test.js
var gulp = require('gulp'); // include plug-ins var uglify = require('gulp-uglify'), concat = require('gulp-concat'); // Minified file gulp.task('packjsMin', function() { return gulp.src('node_modules/angular/*.js') .pipe(concat('script.js')) .pipe(uglify()) .p...
Printing "hello world" on several languages on Maya on the console (Script Editor). MEL On a MEL tab on the Script Editor, or the command line bar, selecting MEL: print ("hello world"); And hit play on the script editor or enter key on the command line. PYTHON On a Python...
There are a few ways to setup a local copy of your Shopify theme: Node.js ( gulp/grunt ) Ruby Theme App ( Mac only ) There might be a few other ways, but I found the ruby way the most easy to work with. In order to work locally on the Shopify theme files you will need a few things: Ruby ...
You can use docker, without using docker daemon (engine), by using cloud providers. In this example, you should have a gcloud (Google Cloud util), that connected to your account docker-machine create --driver google --google-project `your-project-name` google-machine-type f1-large fm02 This exa...
grant all privileges on schema_name.* to 'new_user_name'@'%' identified by 'newpassword'; Attention: This can be used to create new root user
rename user 'user'@'%' to 'new_name`@'%'; If you create a user by mistake, you can change his name
DROP TABLE Database.table_name
Given an m times n matrix A with n larger than m. The singular value decomposition [U,S,V] = svd(A); computes the matrices U,S,V. The matrix U consists of the left singular eigenvectors which are the eigenvectors of A*A.' while V consists of the right singular eigenvalues which are the eigenvec...

Page 911 of 1191