Tutorial by Examples

The received bytes have to be decoded with the correct character encoding to be interpreted as text: Python 3.x3.0 import urllib.request response = urllib.request.urlopen("http://stackoverflow.com/") data = response.read() encoding = response.info().get_content_charset() html = d...
From inside the interative Julia shell (also known as REPL), you can access the system's shell by typing ; right after the prompt: shell> From here on, you can type any shell comand and they will be run from inside the REPL: shell> ls Desktop Documents Pictures Templates Downloa...
The simplest way is to use brew: brew install zsh After installation, you may want to set it as your default shell by doing: sudo echo '/usr/local/bin/zsh' >> /etc/shells chsh -s /usr/local/bin/zsh If you have git, and required command line tools installed you can compile and install ...
brew install zsh sudo echo '/usr/local/bin/zsh' >> /etc/shells chsh -s /usr/local/bin/zsh
textOnCurve(text,offset,x1,y1,x2,y2,x3,y3,x4,y4) Renders text on quadratic and cubic curves. text is the text to render offset distance from start of curve to text >= 0 x1,y1 - x3,y3 points of quadratic curve or x1,y1 - x4,y4 points of cubic curve or Example usage: textOnCurve("...
Detailed instructions on getting linux-device-driver set up or installed.
Puppet is a configuration management solution. Users describe the desired state of a server or software and configuration management achieves this state. This brings following advantages: Configurations can be reproduced exactly the same every time, as many times as necessary Configurations for ...
Coments "Comments are enclosed in double quotes. BEWARE: This is NOT a string!" "They can span multiple lines." Strings 'Strings are enclosed in sigle quotes.' 'Single quotes are escaped with a single quote, like this: ''.' '''' "<--This string contains one sin...
In Smalltalk almost everything you do is sending messages to objects (referred as calling methods in other languages). There are three types of messages: Unary messages: #(1 2 3) size "This sends the #size message to the #(1 2 3) array. #size is a unary message, because it takes no argumen...
Classes and methods are usually defined in the Smalltalk IDE. Classes A class definition looks something like this in the browser: XMLTokenizer subclass: #XMLParser instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'XML-Parser' This is actually...
You can create extension methods to improve usability for nested collections like a Dictionary with a List<T> value. Consider the following extension methods: public static class DictListExtensions { public static void Add<TKey, TValue, TCollection>(this Dictionary<TKey, TColl...
This works well for single level right click context menu. All you need to do is create a registry entry under Classes Root HKEY_CLASSES_ROOT for specific extension. If you want to create a entry for all types of files choose * else choose extension like .pdf etc. var regmenu = Registry.ClassesR...
When you need multi level menus, with multiple parameters SharpShell comes to rescue. https://github.com/dwmkerr/sharpshell has umpteen number of examples and it works perfect even for single level to multi level custom context menus. Key thing is to create class with attributes [ComVisible(true)]...
Usage of loops is an excellent way to keep the code DRY and avoid repetition. Unlike in Sass, there are no built-in @for or @each directive in Less for writing loops but it can still be written using recursive mixins. A recursive mixin is nothing but a mixin which keeps calling itself. There are fo...
private final Logger logger = Logger.getLogger(getClass().getCanonicalName()); WebView webView = new WebView(); webEngine = webView.getEngine(); webEngine.setOnAlert(event -> logger.warning(() -> "JS alert: " + event.getData()));
When using a WebView to display your own custom webpage and this webpage contains Javascript, it might be necessary to establish a two-way communication between the Java program and the Javascript in the web page. This example shows how to setup such a communication. The webpage shall display an i...
Problem Cross-Site Request Forgery or CSRF can force an end user to unknowingly generate malicious requests to a web server. This attack vector can be exploited in both POST and GET requests. Let's say for example the url endpoint /delete.php?accnt=12 deletes account as passed from accnt parameter ...
The display of elements in a list or grids is a very common pattern in mobile applications. The user sees a collection of items and can scroll through them. The collection of items can be a list, a grid or another structured representations of data. The RecyclerView widget is a more advanced and fl...
Installing TeamCity server Setting up and Running Additional Build Agents
The chart consists out of HTML container and the JavaScript code that instantiates a chart in it. HTML We use a <div> element as chart container. <div id="chartdiv" style="height: 300px;"></div> JavaScript To instantiate the chart we use AmCharts.makeChar...

Page 756 of 1336