The following example combines several of the techniques covered here. It puts a hyperlink in a custom formatted column which, when clicked, opens the sales order record associated with a row. The hyperlink is designed to open the record in a new window or tab when clicked, and to display a tooltip ...
JavaScript allows us to define getters and setters in the object literal syntax. Here's an example:
var date = {
year: '2017',
month: '02',
day: '27',
get date() {
// Get the date in YYYY-MM-DD format
return `${this.year}-${this.month}-${this.day}`
},
...
If you haven't already lets simply start this file of with:
class HelloWorldLeftAndMain extends LeftAndMain {
}
Configure
The first thing you should do, is define the $url_segment that will be used to access the interface, and the title ($menu_title) that will appear in the side navigation m...
The expected structure of this template can be a bit convoluted but it all boils down to this:
There are 3 sections worth noting for this guide:
.north
.center
.south
It must be wrapped entirely within an element that has the data-pjax-fragment="Content" attribute. This is...
To add user, use following command
htpasswd /etc/subversion/passwd user_name
Specify user_name with the username you wish to add in above command. It will prompt to provide password for the user.
If you are creating very first user, you need to add –c switch in above command, which will create th...
Variable declaration
@buttonColor: #FF0000;
/* Now you can use @buttonColor variable with css Functions. */
.product.into.detailed {
additional-attributes{
.lib-table-button(
background-color: @buttonColor;
);
}
}
Here function lib-tabgle-button used v...
winsound
Windows environment
import winsound
winsound.PlaySound("path_to_wav_file.wav", winsound.SND_FILENAME)
wave
Support mono/stereo
Doesn't support compression/decompression
import wave
with wave.open("path_to_wav_file.wav", "rb") as wav_file: #...
If we have a c++ project that uses a config.h configuration file with some custom paths or variables, we can generate it using CMake and a generic file config.h.in.
The config.h.in can be part of a git repository, while the generated file config.h will never be added, as it is generated from the cu...
Comparator cmp = [ compare:{ a, b -> a <=> b } ] as Comparator
def col = [ 'aa', 'aa', 'nn', '00' ]
SortedSet sorted = new TreeSet( cmp )
sorted.addAll col
assert '[00, aa, nn]' == sorted.toString()
The example reads the first line from a file. It uses an instance of BufferedReader to read data from the file. BufferedReader is a resource that must be closed after the program is finished with it:
static String readFirstLineFromFile(String path) throws IOException {
try (BufferedReader br = n...
public String getTypeOfDayWithSwitchStatement(String dayOfWeekArg) {
String typeOfDay;
switch (dayOfWeekArg) {
case "Monday":
typeOfDay = "Start of work week";
break;
case "Tuesday":
case "Wednes...
We can have three cases to analyze an algorithm:
Worst Case
Average Case
Best Case
#include <stdio.h>
// Linearly search x in arr[]. If x is present then return the index,
// otherwise return -1
int search(int arr[], int n, int x)
{
int i;
for (i=0; i<n; i...
In order to create a workspace, one should run the following in the terminal:
$ mkdir -p ~/workspace_name/src
$ cd ~/workspace_name/src
$ catkin_init_workspace
$ cd ~/workspace_name/
$ catkin_make
The previous commands creates a workspace named workspace_name. Once a workspace has been creat...
Below example shows how to change the hyperlink for "ID" and "Title(LinkTitle)" field inside the list view using CSR.
Step1 : Create a JS file and paste below code
(function () {
function registerRenderer() {
var ctxForm = {};
ctxForm.Templates = {}...
This example shows how to hide a "Date" field from the SharePoint list view using CSR.
(function () {
function RemoveFields(ctx) {
var fieldName = "Date"; // here Date is field or column name to be hide
var header = document.querySelectorAll("[d...