Python 3 allows you to define function arguments which can only be assigned by keyword, even without default values. This is done by using star * to consume additional positional parameters without setting the keyword parameters. All arguments after the * are keyword-only (i.e. non-positional) arg...
Sometimes a column should show different content than just the toString value of the cell item. In this case the TableCells created by the cellFactory of the TableColumn is customized to change the layout based on the item.
Important Note: TableView only creates the TableCells that are shown in the...
A common task is to convert all columns of a data.frame to character class for ease of manipulation, such as in the cases of sending data.frames to a RDBMS or merging data.frames containing factors where levels may differ between input data.frames.
The best time to do this is when the data is read ...
Metaclass syntax
Python 2.x2.7
class MyClass(object):
__metaclass__ = SomeMetaclass
Python 3.x3.0
class MyClass(metaclass=SomeMetaclass):
pass
Python 2 and 3 compatibility with six
import six
class MyClass(six.with_metaclass(SomeMetaclass)):
pass
Ubuntu
On recent Ubuntu versions, you can install an up-to-date version of CouchDB with sudo apt-get install couchdb. For older versions, such as Ubuntu 14.04, you should run:
sudo add-apt-repository ppa:couchdb/stable -y
sudo apt-get update
sudo apt-get install couchdb -y
Fedora
To install ...
A do construct is a looping construct which has a number of iterations governed by a loop control
integer i
do i=1, 5
print *, i
end do
print *, i
In the form above, the loop variable i passes through the loop 5 times, taking the values 1 to 5 in turn. After the construct has completed th...
<!--- Define collection --->
<cfset attributes = {
"name": "Sales",
"type": "text",
"value": "Connection"
}>
<!---
cfloop tag with attribute collection can be used to
loop through the elements of a struc...
<cfscript>
/*define collection*/
attributes = {
"name": "Sales",
"type": "text",
"value": "Connection"
};
for(attribute in attributes){
/* attribute variable will contain the key name of each key value ...
For example, if you are sending an email to a customer after starting a task, it's best to immediately redirect the user to the next page while queuing the email to be sent in the background. This will speed up the load time for the next page, since sending an email can sometimes take several second...
Each of Laravel's queue drivers are configured from the config/queue.php file. A queue driver is the handler for managing how to run a queued job, identifying whether the jobs succeeded or failed, and trying the job again if configured to do so.
Out of the box, Laravel supports the following queue ...
SQL Server Reporting Services can typically be installed with SQL Server installation media. An installation of SQL Server will be required, either locally or on a server.
Starting with SQL Server 2008 R2, SSRS has the option to integrate with SharePoint instead of running a separate website.
Simple Dual Port RAM with separate addresses and clocks for read/write operations.
module simple_ram_dual_clock #(
parameter DATA_WIDTH=8, //width of data bus
parameter ADDR_WIDTH=8 //width of addresses buses
)(
input [DATA_WIDTH-1:0] data, //da...
Through the use of event types you can easily reduce code bloat that often occurs when defining events for many objects on stage by filtering events in 1 function rather than defining many event handling functions.
Imagine we have 10 objects on stage named object1, object2 ... object10
You could d...
Sometimes it's a good idea to further secure your publishes by requiring a user login. Here is how you achieve this via Meteor.
import { Recipes } from '../imports/api/recipes.js';
import { Meteor } from 'meteor/meteor';
Meteor.publish('recipes', function() {
if(this.userId) {
return Re...
ulong literals are defined by using the suffix UL, ul, Ul, uL, LU, lu, Lu, or lU, or by using an integral values within the range of ulong:
ulong ul = 5UL;