Tutorial by Examples: amp

Sometimes we have requirement of parsing pages, but doing so requires you to be an authorised user. Here is an example which shows you how to do in oracle sign in. import sys import requests import json from bs4 import BeautifulSoup def mprint(x): sys.stdout.write(x) print re...
Theme.xml app/design/frontend/Magento/mytheme/theme.xml <theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd"> <title>My theme</title> <!-- your theme's name --> ...
angular.component("SampleComponent", { bindings: { title: '@', movies: '<', reservation: "=", processReservation: "&" } }); Here we have all binding elements. @ indicates that we need a very basic binding, from the parent scope ...
CREATE TABLE [dbo].[ProcessLog]( [LogId] [int] IDENTITY(1,1) NOT NULL, [LogType] [varchar](20) NULL, [StartTime] [datetime] NULL, [EndTime] [datetime] NULL, [RunMinutes] AS (datediff(minute,coalesce([StartTime],getdate()),coalesce([EndTime],getdate()))) This gives run difference in minutes ...
MSBuild evaluates PropertyGroup, Choose and ItemGroup elements that are directly under the Project element before those that are in Target elements. Directly under the Project element, PropertyGroup and Choose elements are evaluated in the order in which they appear, and then ItemGroup elements a...
content-model.xml : .... <constraints> <constraint name="my:aConstraintList" type="x.y.z.project.model.constraint.AConstraintList"> </constraint> .... <property name="my:aValue"> <title>My Value</title> <typ...
Static initialization is suitable for most situations. When your application must delay the instantiation, use a non-default constructor or perform other tasks before the instantiation, and work in a multithreaded environment, you need a different solution. Cases do exist, however, in which you cann...
Angular 2 has two kinds of custom validators. Synchronous validators as in the first example that will run directly on the client and asynchronous validators (the second example) that you can use to call a remote service to do the validation for you. In this example the validator should call the ser...
using System; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { var foo = new ClassWithDependency(); foo.DoSomething(); var bar = new InjectedDependency(); foo.Dependency = bar; ...
using System; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { var dep = new DefaultDependency(); var foo = new ClassWithDependency(dep); foo.DoSomething(); var bar = new Injected...
WordPress shortcodes were introduced in 2.5 Here is come example of shortcode [button] to use shortcode direct into theme you have to use do_shortcode() <?php echo do_shortcode('[button]'); ?> To customize the button, we could simply add something like: [button type="twitter&qu...
The Gson library provides Gson.class which handles all conversion between Java and JSON objects. An instance of this class can be created by invoking default constructor. You usually would like to have one Gson instance for the most part of operations in your program. Gson gson = new Gson(); Fir...
Q_OBJECT macro appears in private section of a class. Q_OBJECT requires the class to be subclass of QObject. This macro is necessary for the class to declare its signals/slots and to use Qt meta-object system. If Meta Object Compiler (MOC) finds class with Q_OBJECT, it processes it and generates C+...
When mapping many-to-many relationships in JPA, configuration for the table used for the joining foreign-keys can be provided using the @JoinTable annotation: @Entity public class EntityA { @Id @Column(name="id") private long id; [...] @ManyToMany @JoinTable(name=...
Using Android Studio 2.2 and higher Native Development Kit (NDK) you can use to compile C and C++ code. You can use NDK by manually downloading NDK and build it or through CMake . Here I will give process flow for manually install NDK and an example code, Based on your System OS you can download ...
By default, the full indexed document is returned as part of all searches. This is referred to as the source (_source field in the search hits). If we don’t want the entire source document returned, we have the ability to request only a few fields from within source to be returned, or we can set _so...
Docs file (Input File) Mary had a little lamb its fleece was white as snow and everywhere that Mary went the lamb was sure to go. Hive Query CREATE TABLE FILES (line STRING); LOAD DATA INPATH 'docs' OVERWRITE INTO TABLE FILES; CREATE TABLE word_counts AS SELECT word, count(1) AS count F...
AWK is string manipulation language, used largely in UNIX systems. The idea behind AWK was to create a versatile language to use when working on files, which wasn't too complex to understand. AWK has some other variants, but the main concept is the same, just with additional features. These other v...
import tkinter as tk root = tk.Tk() rbvar = StringVar() rbvar.set(" ") rb1 = tk.Radiobutton(root, text="Option 1", variable=rbvar, value='a', indicatoron=0) rb1.pack() rb2 = tk.Radiobutton(root, text="Option 2", variable=rbvar, value='b', indicatoron=0) rb2...
<ul class="list-group"> <li class="list-group-item">Cras justo odio</li> <li class="list-group-item">Dapibus ac facilisis in</li> <li class="list-group-item">Morbi leo risus</li> <li class="list-gro...

Page 21 of 46