You can access the real data type of interface with Type Assertion.
interfaceVariable.(DataType)
Example of struct MyType which implement interface Subber:
package main
import (
"fmt"
)
type Subber interface {
Sub(a, b int) int
}
type MyType struct {
Msg stri...
Having culture-specific URLs can be beneficial in terms of SEO.
E.g. English version of the following page:
http://www.mydomain.com/insurance
Would translate into:
http://www.mydomain.nl/verzekering
Instead of:
http://www.mydomain.nl/nl-nl/insurance
There are more approaches of achievin...
class Functor f where
fmap :: (a -> b) -> f a -> f b
One way of looking at it is that fmap lifts a function of values into a function of values in a context f.
A correct instance of Functor should satisfy the functor laws, though these are not enforced by the compiler:
fmap id = i...
Steps to create "Hello, World!" application in Oracle Application Express:
Log in to your workspace.
Click Application Builder. Application Builder page opens.
Click Create. Page with 4 application types appears. Page contains short help text about each application type.
Click Deskto...
This is a simple RMI example with five Java classes and two packages, server and client.
Server Package
PersonListInterface.java
public interface PersonListInterface extends Remote
{
/**
* This interface is used by both client and server
* @return List of Persons
* @throws...
Lists as arguments are just another variable:
def func(myList):
for item in myList:
print(item)
and can be passed in the function call itself:
func([1,2,3,5,7])
1
2
3
5
7
Or as a variable:
aList = ['a','b','c','d']
func(aList)
a
b
c
d
In addition to libraries defined in EcmaScript language specification and EcmaScript internationalization API specification, d8 also implements the following functions and objects.
print(args...): function. Print to stdout.
printErr(args...): function. Print to stderr.
write(args...): function....
If class A is in relationship with class B and class B has property with the same name and type as the primary key of A, then EF automatically assumes that property is foreign key.
public class Department
{
public int DepartmentId { set; get; }
public string Name { set; get; }
publi...
As we all are aware that PHP writes session data into a file at server side. When a request is made to php script which starts the session via session_start(), PHP locks this session file resulting to block/wait other incoming requests for same session_id to complete, because of which the other requ...
One day I had a conversation with a friend of mine who uses Laravel PHP framework in his job. When I told him that Django has its own all-included HTML CRUD system, for interacting with the database, called Django admin, his eyes popped off! He told me: "It took me months to build an Admin inte...
An example on how to compose the reader, writer, and state
monad using monad transformers. The source code can be found in this repository
We want to implement a counter, that increments its value by a given
constant.
We start by defining some types, and functions:
newtype Counter = MkCounter {...
As an example you want to disable pagination in your default index action and get all results in index.
How can you do that?
It's simple. You should override the index action in your controller like this:
public function actions() {
$actions = parent::actions();
unset($actions['index'])...
Build the APK
First of all we need to build the APK.
ionic build --release android
Generate private Key
Then we will create a keystore to sign the APK.
keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
Change my-release-key with ...
You can call the CEE3DLY service in 24- 31- or 64- bit mode to delay a task to the nearest second. It is CICS save and will only delay the thread.
An example:
IDENTIFICATION DIVISION.
PROGRAM-ID. SLEEPYTM.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
...
Objects like numbers, lists, dictionaries,nested structures and class instance objects live in your computer’s memory and are lost as soon as the script ends.
pickle stores data persistently in separate file.
pickled representation of an object is always a bytes object in all cases so one must ope...