Using compose with a View, ViewModel and Model is an easy way to reuse and combine different Views and ViewModels.
Given the following View and ViewModel (applies to each alternative below):
src/greeter.html
<template>
<h1>Hello, ${name}!</h1>
</template>
src/gree...
Note: at is not installed by default on most of modern distributions.
To execute a job once at some other time than now, in this example 5pm, you can use
echo "somecommand &" | at 5pm
If you want to catch the output, you can do that in the usual way:
echo "somecommand > o...
The following documentation describes both MySQLi and PDO supported pagination solution.
Go to https://github.com/rajdeeppaul/Pagination and download pagination.php file into your project directory. Let's say your directory structure looks like this:
project directory
|
|--paginati...
There are quite a number situations where one has huge amounts of data and using which he has to classify an object in to one of several known classes. Consider the following situations:
Banking: When a bank receives a request from a customer for a bankcard, the bank has to decide whether to issue...
Uses C standard format codes.
from datetime import datetime
datetime_for_string = datetime(2016,10,1,0,0)
datetime_string_format = '%b %d %Y, %H:%M:%S'
datetime.strftime(datetime_for_string,datetime_string_format)
# Oct 01 2016, 00:00:00
malloc() often calls underlying operating system functions to obtain pages of memory. But there is nothing special about the function and it can be implemented in straight C by declaring a large static array and allocating from it (there is a slight difficulty in ensuring correct alignment, in pract...
Let's say we have 8 houses. We want to setup telephone lines between these houses. The edge between the houses represent the cost of setting line between two houses.
Our task is to set up lines in such a way that all the houses are connected and the cost of setting up the whole connection is mini...
Depending on your target machine, you need to choose a supported ROS Version (or vice-versa). Although ROS installation is well documented in the ROS wiki, It might be confusing to find them. So, here's a table of the ROS Version, target platforms & architecture and the links for the appropriate...
After enabling and creating migrations there might be a need to initially fill or migrate data in your database. There are several possibilities but for simple migrations you can use the method 'Seed()' in the file Configuration created after calling enable-migrations.
The Seed() function retrieves...
class Program
{
static void Main(string[] args)
{
//Initialize a new container
WindsorContainer container = new WindsorContainer();
//Register IService with a specific implementation and supply its dependencies
container.Register(Component.For<ISer...
CASE lv_foo.
WHEN 1.
WRITE: / 'lv_foo is 1'.
WHEN 2.
WRITE: / 'lv_foo is 2'.
WHEN 3.
WRITE: / 'lv_foo is 3'.
WHEN OTHERS.
WRITE: / 'lv_foo is something else'.
ENDCASE
When run with no arguments, this program starts a TCP socket server that listens for connections to 127.0.0.1 on port 5000. The server handles each connection in a separate thread.
When run with the -c argument, this program connects to the server, reads the client list, and prints it out. The clie...
Find f(n): nth Fibonacci number. The problem is quite easy when n is relatively small. We can use simple recursion, f(n) = f(n-1) + f(n-2), or we can use dynamic programming approach to avoid the calculation of same function over and over again. But what will you do if the problem says, Given 0 <...
Calls to the Metadata API are with HTTP Get:
Using Public API Key
GET https://www.googleapis.com/analytics/v3/metadata/ga/columns?key={YOUR_API_KEY}
Using Access token from either Oauth2 or Service account authentication
GET https://www.googleapis.com/analytics/v3/metadata/ga/columns?acces...
Go through the steps:
Add 'NSAppleMusicUsageDescription' to your Info.plist for the privacy authority.
Make sure your music is available in your iPhone. It will not work in the simulator.
iOS 10.0.1
import UIKit
import AVFoundation
import MediaPlayer
class ViewController: UIViewControll...
public static Boolean ExportDB(String DATABASE_NAME , String packageName , String folderName){
//DATABASE_NAME including ".db" at the end like "mayApp.db"
String DBName = DATABASE_NAME.substring(0, DATABASE_NAME.length() - 3);
File data = Environment.getDataDir...