C.I.A.s are intended as a simple way of getting attributes from whatever is calling the targeted method. There is really only 1 way to use them and there are only 3 attributes.
Example:
//This is the "calling method": the method that is calling the target method
public void doProcess()
...
namespace HelloWorld;
interface
type
App = class
public
class method Main(args: array of String);
end;
implementation
class method App.Main(args: array of String);
begin
Console.WriteLine('Hello World');
end;
end.
using System.ComponentModel.DataAnnotations;
public class Post
{
public int Id { get; set; }
[StringLength(100)]
public string Title { get; set;}
[StringLength(300)]
public string Abstract { get; set; }
public string Description { get; set; }
}
Def...
Example showing how to create Guis using functions instead of labels.
Gui, Add, Button, gCtrlEvent vButton1, Button 1
Gui, Add, Button, gCtrlEvent vButton2, Button 2
Gui, Add, Button, gGoButton, Go Button
Gui, Add, Edit, vEditField, Example text
Gui, Show,, Functions instead of labels
CtrlEv...
In Haskell, all functions are considered curried: that is, all functions in Haskell take just one argument.
Let's take the function div:
div :: Int -> Int -> Int
If we call this function with 6 and 2 we unsurprisingly get 3:
Prelude> div 6 2
3
However, this doesn't quite behave in...
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
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...
Caffe can run on multiple cores. One way is to enable multithreading with Caffe to use OpenBLAS instead of the default ATLAS. To do so, you can follow these three steps:
sudo apt-get install -y libopenblas-dev
Before compiling Caffe, edit Makefile.config, replace BLAS := atlas by BLAS := open
A...
What's between \Q and \E is treated as normal characters
#!/usr/bin/perl
my $str = "hello.it's.me";
my @test = (
"hello.it's.me",
"hello/it's!me",
);
sub ismatched($) { $_[0] ? "MATCHED!" : "DID NOT MATCH!" }
my @match = (
...
Because the WHERE clause is evaluated before GROUP BY, you cannot use WHERE to pare down results of the grouping (typically an aggregate function, such as COUNT(*)). To meet this need, the HAVING clause can be used.
For example, using the following data:
DECLARE @orders TABLE(OrderID INT, Name NVA...
It can be difficult to test functions with poor asymptotic complexity using quickcheck as the random inputs are not usually size bounded. By adding an upper bound on the size of the input we can still test these expensive functions.
import Data.List(permutations)
import Test.QuickCheck
longRunn...
For an instance, if the html source code of an html view or element is wrapped by an iframe like this:
<iframe src="../images/eightball.gif" name="imgboxName" id="imgboxId">
<p>iframes example</p>
<a href="../images/redball.gif" t...
We can create a Map from a list of tuples like this:
Map.fromList [("Alex", 31), ("Bob", 22)]
A Map can also be constructed with a single value:
> Map.singleton "Alex" 31
fromList [("Alex",31)]
There is also the empty function.
empty :: Map k a
...
This time we are going to declare a class decorator that will add some metadata to a class when we applied to it:
function addMetadata(target: any) {
// Add some metadata
target.__customMetadata = {
someKey: "someValue"
};
// Return target
ret...