Bounded type parameters allow you to set restrictions on generic type arguments:
class SomeClass {
}
class Demo<T extends SomeClass> {
}
But a type parameter can only bind to a single class type.
An interface type can be bound to a type that already had a binding. This is achieve...
When a Java virtual machine starts, it needs to know how big to make the Heap, and the default size for thread stacks. These can be specified using command-line options on the java command. For versions of Java prior to Java 8, you can also specify the size of the PermGen region of the Heap.
Note...
Task that return a value has return type of Task< TResult > where TResult is the type of value that needs to be returned. You can query the outcome of a Task by its Result property.
Task<int> t = Task.Run(() =>
{
int sum = 0;
for(int i = 0; i < 500; i++)
...
EventNetworks returned by compile must be actuated before reactimated events have an effect.
main = do
(inputHandler, inputFire) <- newAddHandler
eventNetwork <- compile $ do
inputEvent <- fromAddHandler inputHandler
let inputEventReaction = fmap putStrLn inp...
// filename is a string with the full path
// true is to append
using (System.IO.StreamWriter file = new System.IO.StreamWriter(filename, true))
{
// Can write either a string or char array
await file.WriteAsync(text);
}
Information about the database connections
SELECT
a.mon$attachment_id as Attachment_ID,
a.mon$server_pid as Server_PID,
case a.mon$state
when 1 then 'active'
when 0 then 'idle'
end as State,
a.mon$attachment_name as Database_Name,
...
Darken
#demo {
@refcolor: #f0b9b8;
background: @refcolor;
border: 1px solid darken(@refcolor, 25%);
}
The above code makes use of the darken() function to set the border color as a shade that is 25% darker than the reference color (which is also the background color).
Less compiler ca...
Get-SPFeature -Site https://mysharepointsite/sites/test
Get-SPFeature can also be run on web scope (-Web <WebUrl>), farm scope (-Farm) and web application scope (-WebApplication <WebAppUrl>).
Get all orphaned features on a site collection
Another usage of Get-SPFeature can be to find ...
Partial classes provide a clean way to separate core logic of your scripts from platform specific methods.
Partial classes and methods are marked with the keyword partial. This signals the compiler to leave the class "open" and look in other files for the rest of the implementation.
// E...
Import the class, which contains the method to be tested.
Perform the operation with dummy data.
Now compare the result of operation with expected result.
- (void)testReverseString{
NSString *originalString = @"hi_my_name_is_siddharth";
NSString *reversedString = [self.someObject ...
This example demonstrates how you can respond to a button click by performing some work on a worker thread and then update the user interface to indicate completion
void MyButton_OnClick(object sender, EventArgs args)
{
Task.Run(() => // Schedule work using the thread pool
{
...
ImageSource result = new BitmapImage(new Uri("ms-appx:///Assets/Windows_10_Hero.png"));
Use result to set the Source property of an Image control either though a Binding or code-behind
In class-based programming, the factory method pattern is a creational pattern that uses factory methods to deal with the problem of creating objects without having to specify the exact class of the object that will be created. Wikipedia reference
protocol SenderProtocol
{
func send(packa...