Tutorial by Examples: sin

This is an example of a basic GUI with two buttons that change a value stored in the GUI's handles structure. function gui_passing_data() % A basic GUI with two buttons to show a simple use of the 'handles' % structure in GUI building % Create a new figure. f = figure(); ...
Replace firebase values with your app api values: import firebase from 'firebase'; componentWillMount() { firebase.initializeApp({ apiKey: "yourAPIKey", authDomain: "authDomainNAme", databaseURL: "yourDomainBaseURL", projectId: "yourProjectID", ...
When performing data science tasks, it’s common to want to use data found on the internet. You’ll usually be able to access this data via an Application Programming Interface(API) or in other formats. However, there are times when the data you want can only be accessed as part of a web page. In case...
Starting from react-native version 0.38, a Jest setup is included by default when running react-native init. The following configuration should be automatically added to your package.json file: "scripts": { "start": "node node_modules/react-native/local-cli/cli.js ...
A simple OGL 4.0 GLSL shader program that shows that shows how to add details with tessellation shader to the geometry. The program is executed with a python script. To run the script, PyOpenGL and NumPy must be installed. The basic mesh in this example is an icosahedron that consists of 20 triang...
For better performance it's important to avoid using of array (lambda) function in JSX. As explained at https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-bind.md : A bind call or arrow function in a JSX prop will create a brand new function on every single render. Th...
Gpars offers intuitive ways to handle tasks concurrently import groovyx.gpars.* GParsPool.withPool { def result = dataList.collectParallel { processItem(it) } }
When using cURL for some queries to the Docker API, it might be a bit tricky to pass some complex structures. Let's say, getting a list of images allows using filters as a query parameter, which have to be a JSON representation of map[string][]string (about the maps in Go you can find more here). H...
REReplaceCallback('YOUR REGEX GOES HERE','AND YOUR STRING HERE',function(groups) { //now you can access the 'groups' array containing all the captured groups return result; //return whatever you've processed inside });
Get year from date <p> Year: <span th:text="${#dates.year(today)}">2017</span> </p> Get month <p> Month number: <span th:text="${#dates.month(today)}">8</span> Month: <span th:text="${#dates.monthName(today)}"&...
You can use list variable to form <select> elements <select th:field="*{countries}"> <option th:each="country: ${countries}" th:value="${country.id}" th:text="#{${'selected.label.' + country.name}}"/> <...
Large chunks of code can also be "commented out" using the preprocessor directives #if 0 and #endif. This is useful when the code contains multi-line comments that otherwise would not nest. #if 0 /* Starts the "comment", anything from here on is removed by preprocessor */ /*...
Developers often need to design web sites that allow users to upload a CSV file. Usually there is no reason to save the actual CSV file since the data will processed and/or stored in a database once uploaded. However, many if not most, PYTHON methods of parsing CSV data requires the data to be rea...
In your method or any lifecycle hook that changes the array item at particuar index new Vue({ el: '#app', data:{ myArr : ['apple', 'orange', 'banana', 'grapes'] }, methods:{ changeArrayItem: function(){ //this will not work //myArr[2] ...
You can perform the same change instead of using Vue.$set by using the Array prototype's splice() new Vue({ el: '#app', data:{ myArr : ['apple', 'orange', 'banana', 'grapes'] }, methods:{ changeArrayItem: function(){ //this will not work ...
Drupal console brings scaffolding to the Drupal ecosystem and makes it easy to generate a content entity. In most instances you will find it easier to work with a custom entity within a custom module. Step 1 : Generate a module vendor/bin/drupal generate:module Follow the prompts and create yo...
This is shortest, easiest and most commonly used method. Unfortunately, it has one major limitation - cannot be used on searches with more than 4000 results (rows). // Assume that 'N/search' module is included as 'search' var s = search.create({ type : search.Type.TRANSACTIO...
In order to use getRange for handling the large number of results, we will have to consider the following: getRange has 2 parameters: start and end. Always positive, always (start < end) start is the inclusive index of the first result to return end is the exclusive index of the last result...
PagedData is an object, returned by the Search.runPaged(options) method. It works exactly as the UI searches do. PagedData object contains 2 important properties, that you can see on the right side of results header in search results page in Netsuite UI: count (the total number of the results) p...
For really huge search results, you can use dedicated Map/Reduce script. It is much more inconvenient, but sometimes unavoidable. And sometimes could be very handy. The trick here is, that in Get Input Data stage, you can provide to the NS engine not the actual data (i.e. script result), but just t...

Page 157 of 161