Tutorial by Examples: f

import wx class MyFileDropTarget(wx.FileDropTarget): """""" def __init__(self, window): """Constructor""" wx.FileDropTarget.__init__(self) self.window = window def OnDropFiles(self, x, y, f...
By default, NuGet restores packages into the packages folder in the solution root. This folder is shared between all solution projects. In some cases it is useful to change the location of the restored packages (for instance, to share them between several solutions). Its can be achieved by creating...
Add gem 'figaro' to your Gemfile and run bundle install. Then run bundle exec figaro install; this will create config/application.yml and add it to your .gitignore file, preventing it from being added to version control. You can store your keys in application.yml in this format: SECRET_NAME: secre...
CentOS versions 2 - 5 CentOS version 7 CentOS 7 is fully based on RedHat the detail documentation, examples and system administration guides are located here:CentOS 7 full documention
Local mode In local mode, for example when running your application from an IDE, you can configure log4j as usual, i.e. by making a log4j.properties available in the classpath. An easy way in maven is to create log4j.properties in the src/main/resources folder. Here is an example: log4j.rootLogger...
In case you need different settings for your various applications, there is (as of Flink 1.2) no easy way to do that. If you use the one-yarn-cluster-per-job mode of flink (i.e. you launch your scripts with: flink run -m yarn-cluster ...), here is a workaround : create a conf directory somewhe...
Yarn does not by default aggregate logs before an application finishes, which can be problematic with streaming jobs that don't even terminate. A workaround is to use rsyslog, which is available on most linux machines. First, allow incoming udp requests by uncommenting the following lines in /etc/...
Get-User() Use Verb-Noun pattern while naming a function. Verb implies an action e.g. Get, Set, New, Read, Write and many more. See approved verbs. Noun should be singular even if it acts on multiple items. Get-User() may return one or multiple users. Use Pascal case for both Verb and Noun. ...
Sometimes you want to switch off all previously registered listeners. //Adding a normal click handler $(document).on("click",function(){ console.log("Document Clicked 1") }); //Adding another click handler $(document).on("click",function(){ console.log(&q...
$array = [1, 0, 5, 9, 3, 7, 6, 8, 4, 2]; usort($array, function (int $a, int $b): int { return $a <=> $b; }); print_r($array); Array ( [0] => 0 [1] => 1 [2] => 2 [3] => 3 [4] => 4 [5] => 5 [6] => 6 [7] => 7 [8...
<!doctype html> <html> <head> <title>Page Title</title> <meta charset="UTF-8"> <meta name="viewport" content="initial-scale=1.0"> <script src="vue.js"></script> <style> ...
<!doctype html> <html> <head> <title>Page Title</title> <meta charset="UTF-8"> <meta name="viewport" content="initial-scale=1.0"> <script src="vue.js"></script> <style> ...
The default configuration <C-b> is not the easiest to use. It'd be better to use something like ctrla. To do so, add this to tmux.conf # remap prefix from 'C-b' to 'C-a' unbind C-b set-option -g prefix C-a bind-key C-a send-prefix
If your Internet connection is provided via a proxy Maven will not be able to download jars from remote repositories - a common problem faced by companies. To solve this, Maven needs to be provided the details and credentials of the proxy by going to {Maven install location} → conf → settings.xml. ...
Renaming a variable or class is usually a tedious task, by searching for all the locations where it is used. This can be significantly speeded up by highlighting the word, pressing Alt+Shift+R and then typing the new word. Eclipse will automatically rename the word in every file where it is called. ...
The message you want to serialize and send that you can include into a file test.proto, containing package example; enum FOO { X = 17; }; message Test { required string label = 1; optional int32 type = 2 [default=77]; repeated int64 reps = 3; optional group OptionalGroup = 4 { ...
Here we give an example of ISP violation and then refactor that violation. Without talking unnecessary things let's jump into the code. ISP violation : public interface IMessage{ IList<string> ToAddress {get; set;} IList<string> BccAddresses {get; set;} string MessageBody {get; s...
MongoClient.connect('mongodb://localhost:27017/myNewDB',function (err,db) { if(err) console.log("Unable to connect DB. Error: " + err) else console.log('Connected to DB'); db.close(); }); myNewDB is DB name, if it does not exists in database then it...
In GraphQL the Schema defines the root execution queries and mutations as well as the types for your data. Schema Object Type The Person type has two fields, one is a standard Scalar type and the other represents a relationship to a list of other Person types that are 'friends'. Linking other type...
1. Model : public class ContactModel { [Required, Display(Name="Sender Name")] public string SenderName { get; set; } [Required, Display(Name = "Sender Email"), EmailAddress] public string SenderEmail { get; set; } [Required] public string Messag...

Page 417 of 457