Tutorial by Examples: ble

Bubble sorting with rules and replacements: list = {1, 4, 2, 3, 6, 7, 8, 0, 1, 2, 5, 4} list //. {fsts___, x_, y_, lsts___} :> {fsts, y, x, lsts} /; y < x (* Out[1] := {1, 4, 2, 3, 6, 7, 8, 0, 1, 2, 5, 4} Out[1] := {0, 1, 1, 2, 2, 3, 4, 4, 5, 6, 7, 8} *)
First is first, ensure that USE_TZ = True in your settings.py file. Also set a default time zone value to TIME_ZONE such as TIME_ZONE='UTC'. View a complete list of timezones here. If USE_TZ is False, TIME_ZONE will be the time zone that Django will use to store all datetimes. When USE_TZ is enable...
var foo : Int by Delegates.observable("1") { property, oldValue, newValue -> println("${property.name} was changed from $oldValue to $newValue") } foo = 2 The example prints foo was changed from 1 to 2
let imagePath = require("../../assets/list.png"); <Image style={{height: 50, width: 50}} source={imagePath} /> From external resource: <Image style={{height: 50, width: 50}} source={{uri: userData.image}} />
My laptop is having Windows 10. Here i am giving steps that you can follow to test and learn Ansible. SOME THEORY For Ansible you need a Control Machine and a host(or hosts) to run the Playbook. Control Machine should be Linux based or MacOS(windows not allowed) and need Python (2.6 or higher v...
It is a powerful and mostly used keyword in Ansible to run Playbook using Ad-Hoc commands Example: ansible-playbook demo.yml Further Reading on ansible-plabook
Sometimes we need to join multiple tables to get aggregate data in return. here is how we can achieve the same using CodeIgniter Query Builder / Active Records. public function getStudentInfo($studentid){ $query = $this->db->select("st.id, st.name, st.class, mk.maths, mk.science&quo...
To ensure that a GPU version TensorFlow process only runs on CPU: import os os.environ["CUDA_VISIBLE_DEVICES"]="-1" import tensorflow as tf For more information on the CUDA_VISIBLE_DEVICES, have a look to this answer or to the CUDA documentation.
from tensorflow.python.client import device_lib print(device_lib.list_local_devices())
Essence of searching lies in its order. Everyone wants search results to be shown in such a way that best suited results are shown on top. Relational database do not have such capability. Elasticsearch on the other hand shows results on the basis of relevancy by default. Setup Same as used in ...
Let’s Take an Example with Structure of Movie, here we have defined the structure as Codable. So, We can encode and decode it easily. struct Movie: Codable { enum MovieGenere: String, Codable { case horror, skifi, comedy, adventure, animation } var name : String v...
<table id="countryList"> <thead> <tr> <th th:text="#{country.label.name}"> Country </th> <th th:text="#{country.label.capital}"> Capital </th> <th th:text="#{country.l...
$ sqoop import --connect jdbc:mysql://10.0.0.100/hadooptest --username hadoopuser -P --table table_name --hive-import --hive-table hive_table_name
There are 2 way of enabling internal debugging in log4net: Specify the log4net.Internal.Debug option in the application's config file Enable log4net's internal debug programmatically Specify the log4net.Internal.Debug option in the application's config file This is the preferred method to en...
def versionPropsFile = file('version.properties') def versionBuild /*Setting default value for versionBuild which is the last incremented value stored in the file */ if (versionPropsFile.canRead()) { def Properties versionProps = new Properties() versionProps.load(new FileInputStream(ve...
import java.util.*; public class HashtableDemo { public static void main(String args[]) { // create and populate hash table Hashtable<Integer, String> map = new Hashtable<Integer, String>(); map.put(101,"C Language"); map.put(102, &quot...
| Name | Phone | Age | |-------+-------+-----| | Peter | 1234 | 17 | | Anna | 4321 | 25 | To add a Table in org-mode, simply surround your columns with a bar (|) | column1 | column2 | this column is wider | When you press Return from inside a column, org-mode will automatically creat...
To get a value use the .getPropertyValue() method element.style.getPropertyValue("--var") To set a value use the .setProperty() method. element.style.setProperty("--var", "NEW_VALUE")
C99 While writing // delimited comments, it is possible to make a typographical error that affects their expected operation. If one types: int x = 20; // Why did I do this??/ The / at the end was a typo but now will get interpreted into \. This is because the ??/ forms a trigraph. The ??/ tri...

Page 60 of 62