By default, a new class module is a Private class, so it is only available for instantiation and use within the VBProject in which it is defined. You can declare, instantiate and use the class anywhere in the same project:
'Class List has Instancing set to Private
'In any other module in the SAME ...
Group by is often used with join statement. Let's assume we have two tables. The first one is the table of students:
IdFull NameAge1Matt Jones202Frank Blue213Anthony Angel18
Second table is the table of subject each student can take:
Subject_IdSubject1Maths2P.E.3Physics
And because one student c...
An object can only be deallocated by delete if it was allocated by new and is not an array. If the argument to delete was not returned by new or is an array, the behavior is undefined.
An object can only be deallocated by delete[] if it was allocated by new and is an array. If the argument to delet...
USE AdventureWorks2012;
GO
CREATE FULLTEXT CATALOG production_catalog;
GO
CREATE FULLTEXT INDEX ON Production.ProductReview
(
ReviewerName
Language 1033,
EmailAddress
Language 1033,
Comments
Language 1033
)
KEY INDEX PK_ProductR...
Given items as (value, weight) we need to place them in a knapsack (container) of a capacity k. Note! We can break items to maximize value!
Example input:
values[] = [1, 4, 5, 2, 10]
weights[] = [3, 2, 1, 2, 4]
k = 8
Expected output:
maximumValueOfItemsInK = 20;
Algorithm:
1) Sort values...
Enable utf8 pragma
In order to enable utf8 pragma in one-liner, perl interpreter should be called with -Mutf8 option:
perl -Mutf8 -E 'my $人 = "human"; say $人'
Unicode handling with -C switch
The -C command line flag lets you control Unicode features. It can be followed by a list of o...
The utf8 pragma indicates that the source code will be interpreted as UTF-8. Of course, this will only work if your text editor is also saving the source as UTF-8 encoded.
Now, string literals can contain arbitrary Unicode characters; identifiers can also contain Unicode but only word-like characte...
The coordinate systems of Matplotlib come very handy when trying to annotate the plots you make. Sometimes you would like to position text relatively to your data, like when trying to label a specific point. Other times you would maybe like to add a text on top of the figure. This can easily be achi...
Group Concat is used in MySQL to get concatenated values of expressions with more than one result per column. Meaning, there are many rows to be selected back for one column such as Name(1):Score(*)
NameScoreAdamA+AdamA-AdamBAdamC+BillD-JohnA-
SELECT Name, GROUP_CONCAT(Score ORDER BY Score desc SE...
Vital to using character sets is to tell the MySQL-server what encoding the client's bytes are. Here is one way:
SET NAMES utf8mb4;
Each language (PHP, Python, Java, ...) has its own way the it usually preferable to SET NAMES.
For example: SET NAMES utf8mb4, together with a column declared CH...
There are dozens of character sets with hundreds of collations. (A given collation belongs to only one character set.) See the output of SHOW COLLATION;.
There are usually only 4 CHARACTER SETs that matter:
ascii -- basic 7-bit codes.
latin1 -- ascii, plus most characters needed for Western Eur...
Use git revert to revert existing commits, especially when those commits have been pushed to a remote repository. It records some new commits to reverse the effect of some earlier commits, which you can push safely without rewriting history.
Don't use git push --force unless you wish to bring down ...
You can limit the number of rows to be returned by using the maxrows attribute.
<cfquery datasource="Entertainment" maxrows="50">
select *
from Movies
</cfquery>
You cam amend the time of a commit using
git commit --amend --date="Thu Jul 28 11:30 2016 -0400"
or even
git commit --amend --date="now"
If you make a commit as the wrong author, you can change it, and then amend
git config user.name "Full Name"
git config user.email "[email protected]"
git commit --amend --reset-author
Function scope is the special scope for labels. This is due to their unusual property. A label is visible through the entire function it is defined and one can jump (using instruction gotolabel) to it from any point in the same function. While not useful, the following example illustrate the point:
...
Android Studio's Live templates can offer quite a few shortcuts for quick logging.
To use Live templates, all you need to do is to start typing the template name, and hit TAB or enter to insert the statement.
Examples:
logi → turns into → android.util.Log.i(TAG, "$METHOD_NAME$: $content$&q...
It is sometimes required for a process to concurrently write and read the same "data".
The ReadWriteLock interface, and its ReentrantReadWriteLock implementation allows for an access pattern that can be described as follow :
There can be any number of concurrent readers of the data. If...