This macro gives the output of a given line as the first argument of the next line function call. For e.g.
(rename-keys (assoc {:a 1} :b 1) {:b :new-b}))
Can't understand anything, right? Lets try again, with ->
(-> {:a 1}
(assoc :b 1) ;;(assoc map key val)
(rena...
Below code represents an example of Opt-Out approach using Serializable and NonSerialized attributes.
/// <summary>
/// Represents a student.
/// </summary>
[Serializable]
public class Student
{
/// <summary>
/// Gets or sets student number.
/// </summary>...
This will be our example data frame:
df = pd.DataFrame({"color": ['red', 'blue', 'red', 'blue']},
index=[True, False, True, False])
color
True red
False blue
True red
False blue
Accessing with .loc
df.loc[True]
color
True red
True red
...
This will be our example data frame:
color name size
0 red rose big
1 blue violet big
2 red tulip small
3 blue harebell small
Using the magic __getitem__ or [] accessor. Giving it a list of True and False of the same length as the dataframe will give you:
...
This will be our example data frame:
color name size
0 red rose big
1 blue violet small
2 red tulip small
3 blue harebell small
Accessing a single column from a data frame, we can use a simple comparison == to compare every element in the column to the given...
This will be our example data frame:
color size
name
rose red big
violet blue small
tulip red small
harebell blue small
We can create a mask based on the index values, just like on a column value.
rose_mask = df.index == 'rose'
df[rose_mask...
Let's consider this example, that outputs the squares of the numbers 3, 5, and 7:
let nums = [3, 5, 7]
let squares = nums.map(function (n) {
return n * n
})
console.log(squares)
Run in RunKit
The function passed to .map can also be written as arrow function by removing the function keywor...
This is a minimal tsconfig to get you up and running.
{
"include": [
"src/*"
],
"compilerOptions": {
"target": "es5",
"jsx": "react",
"allowSyntheticDefaultImports": tr...
This example will demonstrate how to get started with Firebase in your web apps with JavaScript.
We are going to add a text child in our Firebase Database and display it in realtime on our web app.
Lets get started.
Go to the Firebase Console - https://console.firebase.google.com and create a...
Opening a browser with to() method.
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
class navigateWithTo{
public static void main(String[] args) {
WebDriver driver = new FirefoxDriver();
driver.navigate().to("http://www.example.com...
Sample Data
XML Document
First, let's define a sample XML document named "books.xml" in our current directory:
<?xml version="1.0" encoding="UTF-8"?>
<books>
<book>
<title>Of Mice And Men</title>
<author>Joh...
This is an enumeration for const creation. Go compiler starts iota from 0 and increments by one for each following constant. The value is determined at compile time rather than run time. Because of this we can't apply iota to expressions which are evaluated at run time.
Program to use iota in cons...
Each .NET Core component (SDK, Host and Shared Framework) is versioned independently.
You can find the version for each of them separately.
SDK
You can use the --version option to dotnet to see the SDK
version. For example:
$ ~/dotnet-1.1.1/dotnet --version
1.0.0-preview2-1-003176
dotne...
It's possible to have multiple .NET Core SDKs and Runtimes
available on disk. You can select the versions for each separately.
To select the version of the SDK to use, use global.json.
To select the version of the shared framework to use, target the specified framwork in the .csproj file (or proj...