A chrome extension is seperated into a maximum of 4 parts:
the background page
the popup page
one or more content scripts
the options page
Each part, since they are innately separate, require individual debugging.
Keep in mind that these pages are separate, meaning that variables are not d...
This is an example on how to control PHP error logging in a virtual host site for development and debugging.
Assumptions
The PHP module has been installed.
Development environment is not for production.
<VirtualHost *:80>
ServerName example.com
DocumentRoot /var/www/domains/e...
string is defined as alias string = immutable(char)[];: so need to use dup to make a mutable char array, before it can be reversed:
import std.stdio;
import std.string;
int main() {
string x = "Hello world!";
char[] x_rev = x.dup.reverse;
writeln(x_rev); // !dlr...
<C-^> will switch to and from the previous edited file. On most keyboards <C-^> is CTRL-6.
3<C-^> will switch to buffer number 3. This is very quick, but only if you know the buffer number.
You can see the buffer numbers from :ls or from a plugin such as MiniBufExplorer.
An observable is created from the TextChanged event of the TextBox. Also any input is only selected if it's different from the last input and if there was no input within 0.5 seconds.
The output in this example is sent to the console.
Observable
.FromEventPattern(textBoxInput, "TextChan...
The Notification API specifications support 2 events that can be fired by a Notification.
The click event.
This event will run when you click on the notification body (excluding the closing X and the Notifications configuration button).
Example:
notification.onclick = function(event) {
...
You can setup your client browser to listen in incoming server events using the EventSource object. You will need to supply the constructor a string of the path to the server' API enpoint the will subscribe the client to the server events.
Example:
var eventSource = new EventSource("api/my-ev...
An event stream to the server can be closed using the EventSource.close() method
var eventSource = new EventSource("api/my-events");
// do things ...
eventSource.close(); // you will not receive anymore events from this object
The .close() method does nothing is the stream is already...
Suppose that we have the following text file: jekyll_hyde.txt
How do we convert it to a PDF that looks like this:
Note the blue border that is added to the titles, and the page number at the bottom of each page. In iText 5, these elements are added using page events:
class MyPageEvents extends ...
Suppose that you have the following text file: jekyll_hyde.txt
How do we convert it to a PDF that looks like this:
Note the page numbers at the bottom of each page. These are added using an IEventHandler implementation:
protected class Footer implements IEventHandler {
@Override
pub...
Suppose that you have the following text file: jekyll_hyde.txt
How do we convert it to a PDF that looks like this:
Note that this is very similar to what we had before, but the border of the titles now has rounded corners. We created a custom ParagraphRenderer to achieve this, and we created a T...
To prevent memory leaks, one should not forget to close an input stream or an output stream whose job is done. This is usually done with a try-catch-finally statement without the catch part:
void writeNullBytesToAFile(int count, String filename) throws IOException {
FileOutputStream out = null...
You can bind event listeners to the EventSource object to listen to different events channels using the .addEventListener method.
EventSource.addEventListener(name: String, callback: Function, [options])
name: The name related to the name of the channel the server is emitting events to.
callb...
Save aps.cer to a folder
Open "Keychain access" and export the key that is under that certificate to a .p12 file (call it key.p12). To do that right click on it and choose Export. Save it to the same folder as step 1. On export you will be prompted for a password. Make something u...
SELECT DISTINCT
o.name AS Object_Name,o.type_desc
FROM sys.sql_modules m
INNER JOIN sys.objects o ON m.object_id=o.object_id
WHERE m.definition Like '%myField%'
ORDER BY 2,1
Will find mentions of myField in SProcs, Views, etc.
The quickest way to get started with Watson services is to use the Watson Developer Cloud SDKs. The following GitHub repositories contain installation instructions and basic usage examples:
Android
iOS
Java
Node.js
Python
Unity
For example, here's how to make an AlchemyLanguage API call w...
For example you want to use surfaceView in ng2-nativescript.
As we don't have surfaceView in nativescript we should use placeholder.
first we should import the requirements:
import {Component} from "@angular/core";
import placeholder = require("ui/placeholder");
let applicat...