Tutorial by Examples: sin

Code <picture> <source media="(min-width: 600px)" srcset="large_image.jpg"> <source media="(min-width: 450px)" srcset="small_image.jpg"> <img src="default_image.jpg" style="width:auto;"> </picture> ...
Code function add_new_style() { add_editor_style( 'file-name-here.css' ); } add_action( 'admin_init', 'add_new_style' ); Explanation In the above code, we used add_editor_style to load the css file. We also used add_action to make sure that WordPress runs our function.
Loops are useful in Tikz. The following code draws a clock without numbers: \documentclass{article} \usepackage{ifthen} \usepackage{intcalc} \usepackage{tikz} \newcounter{num} \begin{document} \begin{tikzpicture} \makeatletter \setcounter{num}{1} \newcounter{angle} ...
With a simple for loop, all zip archives in a directory can be extracted. for (i in dir(pattern=".zip$")) unzip(i) The dir function produces a character vector of the names of the files in a directory matching the regex pattern specified by pattern. This vector is looped through w...
You can print log message in the terminal using console.log(). To do so, open a new terminal and run following command for Android: react-native log-android or following command if you are using iOS: react-native log-ios You will now start to see all the log message in this terminal
BFS can be used to find the connected components of an undirected graph. We can also find if the given graph is connected or not. Our subsequent discussion assumes we are dealing with undirected graphs.The definition of a connected graph is: A graph is connected if there is a path between every p...
It's common practice in JavaScript to pass object literals to functions: // JavaScript printOptions({responsive: true}); Unfortunately we cannot pass Dart Map objects to JavaScript in these cases. What we have to do is create a Dart object that represents the object literal and contains all of...
Note: You need to know which data referenced by getReference() first before you can completely understand this example. There are three common method to get your data from Firebase Realtime Database: addValueEventListener() addListenerForSingleValueEvent() addChildEventListener() When w...
Throwable has two direct subclasses, Exception and Error. While it's possible to create a new class that extends Throwable directly, this is inadvisable as many applications assume only Exception and Error exist. More to the point there is no practical benefit to directly subclassing Throwable, as ...
This example demonstrate how to dynamically insert data into MySQL using Python Scrapy. You do not need to edit pipelines.py file for any project. This example can be used for all your project. Just yield you_data_dictionary from your Spider and inside pipelines.py a query will be created automat...
You may want to copy files from one place to another. In this example we'll teach you. You can use the command xcopy. The syntax is xcopy c:\From C:\To Example: @echo off xcopy C:\Folder\text.txt C:\User\Username\Desktop There are also switches you can use. If you want to view them open up co...
Most examples show instantiating and holding a LazySingleton object until the owning application has terminated, even if that object is no longer needed by the application. A solution to this is to implement IDisposable and set the object instance to null as follows: public class LazySingleton : ID...
{-# LANGUAGE RecordWildCards #-} import Text.XML.Light data Package = Package { pOrderNo :: String , pOrderPos :: String , pBarcode :: String , pNumber :: String } -- | Create XML from a Package instance Node Package where node qn Package {..} = node qn [ un...
import sys from PyQt4.QtCore import * from PyQt4.QtGui import * def window(): app = QApplication(sys.argv) win = QDialog() b1 = QPushButton(win) b1.setText("Button1") b1.move(50,20) b1.clicked.connect(b1_clicked) b2 = QPushButton(win) b2.setText(&quot...
As node.js is often used to build API, proper CORS setting can be a life saver if you want to be able to request the API from different domains. In the exemple, we'll set it up for the wider configuration (authorize all request types from any domain. In your server.js after initializing express: ...
NPM If external library like jQuery is installed using NPM npm install --save jquery Add script path into your angular-cli.json "scripts": [ "../node_modules/jquery/dist/jquery.js" ] Assets Folder You can also save the library file in your assets/js directory and in...
To use jquery in your Angular 2.x components, declare a global variable on the top If using $ for jQuery declare var $: any; If using jQuery for jQuery declare var jQuery: any This will allow using $ or jQuery into your Angular 2.x component.
The Stock Items screen (IN.20.25.00) is one of the most often used data entry forms of Acumatica ERP to export data. Inventory ID is the only primary key on the Stock Items screen: To export records from a data entry form, your SOAP request must always begin with the ServiceCommands.Every[Key] co...
A single line comment starts with two hyphens (--) and extends up to the end of the line. Example : -- This process models the state register process(clock, aresetn) begin if aresetn = '0' then -- Active low, asynchronous reset state <= IDLE; elsif rising_edge(clock) then --...
Redis provides three commands to count the items within a sorted set: ZCARD, ZCOUNT, ZLEXCOUNT. The ZCARD command is the basic test for the cardinality of a set. (It is analogous to the SCARD command for sets.) . ZCARD returns the count of the members of a set. Executing the following code to add...

Page 141 of 161