Tutorial by Examples: er

# example data DT1 = data.table(x = letters[1:2], y = 1:2, z = (1:2) > 3) Due to the way data.tables are manipulated, DT2 <- DT1 will not make a copy. That is, later modifications to the columns or other attributes of DT2 will affect DT1 as well. When you want a real copy, use DT2 = copy(...
A quick note before actually installing RabbitMQ: Ubuntu 14.04's Erlang packages have issues if you are using SSL with RabbitMQ, so you'll need to install a newer version than what the Ubuntu package maintainers provide, so use the binaries at https://www.erlang-solutions.com/resources/download.html...
Here are examples of how to use monotonic predicates instead of impure, non-monotonic constructs in your programs: dif/2 is meant to be used instead of non-monotonic constructs like (\=)/2 arithmetic constraints (CLP(FD), CLP(Q) and others) are meant to be used instead of moded arithmetic predi...
//Example 1 int[] array = { 1, 5, 2, 10, 7 }; // Select squares of all odd numbers in the array sorted in descending order IEnumerable<int> query = from x in array where x % 2 == 1 orderby x descending select x ...
To interact with WebElements in a webpage, first we need to identify the location of the element. By is the keyword available in selenium. You can locate the elements By.. By ID By Class Name By TagName By Name By Link Text By Partial Link Text By CSS Selector By XPath Using JavaScript ...
List<Integer> nums = Arrays.asList(1, 2, 3); List<String> strings = nums.stream() .map(Object::toString) .collect(Collectors.toList()); That is: Create a stream from the list Map each element using Object::toString Collect the String values into a List using Collectors...
CSS div.needle { margin: 100px; height: 150px; width: 150px; transform: rotateY(85deg) rotateZ(45deg); /* presentational */ background-image: linear-gradient(to top left, #555 0%, #555 40%, #444 50%, #333 97%); box-shadow: inset 6px 6px 22px 8px #272727; } HTML <div c...
Unlike emails, JIDs were defined with Internationalization (i18n) in mind using the Preparation, Enforcement, and Comparison of Internationalized Strings (PRECIS) framework. PRECIS (defined in RFC 7564), is a framework for comparing strings safely in a variety of contexts. For instance, imagine you...
Adding a footer is not natively possible. Luckily, we can make use of jQuery and CSS to add a footer to the slides of an ioslides presentation rendered with knitr. First of all we have to include the jQuery plugin. This is done by the line <script src="https://ajax.googleapis.com/ajax/libs...
A very basic docker-compose.yml looks like this: version: '2' services: hello_world: image: ubuntu command: [/bin/echo, 'Hello world'] This file is making it so that there's a hello_world service, that's initialized from the ubuntu:latest image and that, when it's run, it just runs...
fizzbuzz = fn (0, 0, _) -> "FizzBuzz" (0, _, _) -> "Fizz" (_, 0, _) -> "Buzz" (_, _, x) -> x end my_function = fn(n) -> fizzbuzz.(rem(n, 3), rem(n, 5), n) end
Sometimes one has to work with pages that are not using jQuery while most developers are used to have jQuery handy. In such situations one can use Chrome Developer Tools console (F12) to manually add jQuery on a loaded page by running following: var j = document.createElement('script'); j.onload ...
One interesting thing is the ability to add you own comments into Visual Studio Intellisense. So you can make your own written functions and classes self-explanatory. To do so, you must type the comment symbol three times the line above your function. Once done, Visual Studio will automatically add...
Modifiers are a way to indicate how external objects can access an object's data. Public Means any object can access this without restriction Private Means only the declaring object can access and view this Protected Means only the declaring object and any object that inherits from...
Dim flags = BindingFlags.Static Or BindingFlags.Public Or BindingFlags.Instance Dim members = GetType(String).GetMembers(flags) For Each member In members Console.WriteLine($"{member.Name}, ({member.MemberType})") Next
If you want to change the order of a character strings you can use parentheses in the pattern to group parts of the string together. These groups can in the replacement argument be addresed using consecutive numbers. The following example shows how you can reorder a vector of names of the form &quo...
Repeat something n times: >>> import itertools >>> for i in itertools.repeat('over-and-over', 3): ... print(i) over-and-over over-and-over over-and-over
Python 3.x3.2 accumulate yields a cumulative sum (or product) of numbers. >>> import itertools as it >>> import operator >>> list(it.accumulate([1,2,3,4,5])) [1, 3, 6, 10, 15] >>> list(it.accumulate([1,2,3,4,5], func=operator.mul)) [1, 2, 6, 24, 120] ...
Ionic 1.2 officially supports deployment as a website If you're not using any Cordova plugins then there is no problem (if you really wish to) to upload the contents of the www folder to your server, and woila - you'll have the same app. However, it is important to note that Ionic 1 never intended...
Creating a separate instance of the WP_Query object is easy: $query_args = array( 'post_type' => 'post', 'post_per_page' => 10 ); $my_query = new WP_Query($query_args); if( $my_query->have_posts() ): while( $my_query->have_posts...

Page 170 of 417