Tutorial by Examples: com

To illustrate this, here is a function that has 3 different "wrong" behaviors the parameter is completely stupid: we use a user-defined expression the parameter has a typo: we use Oracle standard NO_DATA_FOUND error another, but not handled case Feel free to adapt it to your standa...
ng build –prod Above given command with extra option like –prod would generate the production build project bundle. Once the above command gets executed in the root directory of your project would appear a directory called dist. In which all the production build bundle of your project appears in ...
lsvirtualenv : List all of the environments. cdvirtualenv : Navigate into the directory of the currently activated virtual environment, so you can browse its site-packages, for example. cdsitepackages : Like the above, but directly into site-packages directory. lssitepackages : Shows contents of ...
The window.postMessage() method together with its relative event handler window.onmessage can be safely used to enable cross-origin communication. The postMessage() method of the target window can be called to send a message to another window, which will be able to intercept it with its onmessage e...
To execute a Redis command using Jedis, you make method calls against the Jedis object you created from the pool. Jedis exposes Redis commands as method calls, some example are: - String get(String key) - Long geoadd(String key, double longitude, double latitude, String member) - List<String...
If you have a lot of commands, you shouldn't put them all in the main class. Make a new class and have it implement CommandExecutor Add the following to the class: @Override public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { } In your...
We can create dynamic component and get the instances of component into an array and finally rendered it on template. For example, we can can consider two widget component, ChartWidget and PatientWidget which extended the class WidgetComponent that I wanted to add in the container. ChartWidget.ts ...
Add the hyperloop gem to your rails (4.0 - 5.1) Gemfile bundle install Add the hyperloop manifest to the application.js file: // app/assets/javascripts/application.js ... //= hyperloop-loader Create your react components, and place them in the hyperloop/components directory # app/hyperl...
class Hello < Hyperloop::Component # params (= react props) are declared using the param macro param :guest render do "Hello there #{params.guest}" end end # to "mount" Hello with guest = "Matz" say Hello(guest: 'Matz') # params can be giv...
Let's say we want to console.log each time the component mounts: hocLogger.js export default function hocLogger(Component) { return class extends React.Component { componentDidMount() { console.log('Hey, we are mounted!'); } render() { return <Component {...this....
Let's say we have a component that should only be displayed if the user is logged in. So we create a HOC that checks for the authentication on each render(): AuthenticatedComponent.js import React from "react"; export function requireAuthentication(Component) { return class Auth...
if len(sys.argv) != 4: # The script name needs to be accounted for as well. raise RuntimeError("expected 3 command line arguments") f = open(sys.argv[1], 'rb') # Use first command line argument. start_line = int(sys.argv[2]) # All arguments come as strings, so need to ...
$man <command> Displays the on-line manual pages for the command $clear Clears the terminal screen $pwd Returns the working directory name $echo <string> Writes the string to the standard output $printf <string> Format and print the string Example: print $PATH ...
It's relatively easy to parse the command line by hand if you aren't looking for anything too complex: # Naive error checking abort('Usage: ' + $0 + ' site id ...') unless ARGV.length >= 2 # First item (site) is mandatory site = ARGV.shift ARGV.each do | id | # Do something interestin...
Note that OTP>=19 required (if you want to upgrade it using release_handler). Go to director and use rebar or rebar3. Pouriya@Jahanbakhsh ~ $ cd director rebar Pouriya@Jahanbakhsh ~/director $ rebar compile ==> director_test (compile) Compiled src/director.erl Pouriya@Jahanbakhsh ~/di...
Compress-Archive -Path C:\Documents\* -CompressionLevel Optimal -DestinationPath C:\Archives\Documents.zip This command: Compresses all files in C:\Documents Uses Optimal compression Save the resulting archive in C:\Archives\Documents.zip -DestinationPath will add .zipif not present. -Li...
Compress-Archive -Path C:\Documents\* -Update -DestinationPath C:\Archives\Documents.zip this will add or replace all files Documents.zip with the new ones from C:\Documents
This sample used to common function for all type object serialization and deserialization. using System.Runtime.Serialization.Formatters.Binary; using System.Xml.Serialization; namespace Framework { public static class IGUtilities { public static string Serialization(this T obj) ...
In the new Angular framework, Components are the main building blocks that compose the user interface. So one of the first steps that helps an AngularJS app to be migrated to the new Angular is to refactor it into a more component-oriented structure. Components were also introduced in the old Angu...
Lets assume that we have a complex api, with many generic views and some generic viewsets. We want to enable PageNumberPagination to every view, except one (either generic view or viewset, does not make a difference) for which we want a customized case of LimitOffsetPagination. To achieve that we n...

Page 59 of 65