Located 15 miles north of Porto Belo, this is a very welcoming port and a much cheaper alternative for in-town berthing than in Porto Belo.
The Port of Itajaí is the main port of the state of Santa Catarina, and the second largest in Brazil in terms of the movement of containers. It has many beautiful beaches, extensive rural areas and stunning natural scenery.
In 2013 it was chosen as the arrival port for the Transat Jacques Vabre and the Volvo Ocean Race 2014/15 will be stopping in Itajai in April 2015.
Location: 26°54′S 48°40′W
This is an official port of Entry for Brazil.
Read Brazil Formalities for full details on clearing into and out of Brazil.
Customs, Immigration and the Port Captain are all within walking distance of the pontoon. People are friendly and willing to help. Because not many boats call here, cruisers are treated as a welcome change from everyday routine and cruisers visiting in 2014 reported the paperwork to be quick, easy and very transparent.
Last updated September 2014.
To arrive at the yacht berthing facility in Itajai, you have to follow the river for about a mile. On the port side there is a lagoon which is where a new 320 berth marina is under construction for completion in 2015.
Just beyond the lagoon on the port side is a pontoon for visiting yachts, between a jetty with a white building at the end and a large concrete jetty with a white tent on it (similar to a circus tent).
This basic pontoon is in the middle of town with power and water. Mooring is stern-to with mooring buoys.
Come 2015 and completion of the marina, it is not clear yet if the pontoon will be used for transient boats and the marina only for resident boats.
All the necessary shops are available within walking distance of the pontoon. Two large supermarkets, department stores, etc. There are three chandlers with limited stock and Brazilian price levels.
Diesel and petrol are available at gas stations. For large amounts of fuel a truck can come to the pontoon.
A WiFi system has been installed but is currently not operational.
There are good connections by bus to other places in Brazil and fairly easy to go to Blumenau or Iguacu Falls.
This port is good for repairs with an extensive boat-building and repair industry mostly catering to wooden and steel fishing boats.
Security: The Marinha do Brazil is located next to the pontoon. They monitor the pontoon with cameras. Furthermore, the pontoon is at the back of a large event centre and adjacent event grounds. These are fenced off and there is a guard 24/7. At night there is a guard who patrols this large area.
Port added September 2014.


This section is devoted to the internals of the library. First covered are all the user-accessible functions, then constants, macros and finally libnet-specific data structures.
Proceeding each function prototype is a small table listing the return values of the function, whether or not the function is reentrant (a function is considered reentrant if it may be called repeatedly, or may be called before previous invocations have completed, and each invocation is independent of all other invocations) and a brief description of the function's arguments.
5.1 Memory Management Functions
| return value upon success | 1 |
| return value upon failure | -1 |
| re-entrant | yes |
| arguments | 1 - desired packet size
2 - address of a u_char pointer |
libnet_init_packet() creates memory for a packet (it doesn't so much create memory as it requests it from the underlying operating system via malloc()). Upon success the memory is zero-filled. The function accepts two arguments, the packet size and the address of the pointer to the packet. The packet size parameter may be 0, in which case the library will attempt to guess a packet size for you. Passing in the pointer to a pointer (passing by address) is necessary as we are allocating memory locally. If we instead passed in just a pointer (passing by value) the allocated memory would be lost.
This function is a good example of interface hiding.
This function is essentially a malloc() wrapper. By using this function
the details of what's really happening are abstracted so that you, the
programmer, can worry about your task at hand.
| return value upon success | NA |
| return value upon failure | NA |
| re-entrant | yes |
| arguments | 1 - address of a u_char pointer |
libnet_destroy_packet() is the free() analog to libnet_init_packet.
It destroys the packet referenced by 'buf'. In reality, it is of
course a simple free() wrapper. It frees the heap memory and points
`buf` to NULL to dispel the dangling pointer. The function does make
the assertion that `buf` is not NULL. A pointer to a pointer is passed
to maintain interface consistency.
| return value upon success | 1 |
| return value upon failure | -1 |
| re-entrant | yes |
| arguments | 1 - pointer to an arena structure pointer
2 - number of packets 3 - packet size |
libnet_init_packet_arena() allocates and initializes a
memory pool. If you plan on building and sending several different
packets, this is a good choice. It allocates a pool of memory from
which you can grab chunks to build packets (see next_packet_from_arena()).
It takes the address to an arena structure pointer, and hints on
the possible packet size and number of packets. The last two arguments
are used to compute the size of the memory pool. As before, they
can be set to 0 and the library will attempt to choose a decent value.
The function returns -1 if the malloc fails or 1 if everything goes ok.
| return value upon success | pointer to the request packet memory |
| return value upon failure | NULL |
| re-entrant | yes |
| arguments | 1 - pointer to the arena
2 - requested packet size |
libnet_next_packet_from_arena() returns a chunk of memory
from the specified arena of the requested size and decrements the arenas
available byte counter. If the requested memory is not available
from the arena, the function returns NULL. Note that there is nothing
preventing a poorly coded application from using more memory than requested
and causing all kinds of problems. Take heed.
| return value upon success | NA |
| return value upon failure | NA |
| re-entrant | yes |
| arguments | 1 - pointer to the arena |
libnet_destroy_packet_arena() frees the memory associated
with the specified arena.
| return value upon success | pointer to the converted IP address |
| return value upon failure | NULL |
| re-entrant | no |
| arguments | 1 - network-byte ordered IP address
2 - use_name flag |
libnet_host_lookup() converts the supplied network-ordered
(big-endian) IP address into its human-readable counterpart. If the
usename flag is LIBNET_RESOLVE, the function will attempt to resolve the
IP address (possibly incurring DNS network traffic) and return a canonical
hostname, otherwise if it is LIBNET_DONT_RESOLVE (or if the lookup fails),
the function returns a dotted-decimal ASCII string. This function
is hopelessly non reentrant as it uses static data.
| return value upon success | NA |
| return value upon failure | NA |
| re-entrant | depends on architecture |
| arguments | 1 - network-byte ordered IP address
2 - use_name flag 3 - buffer to contain the converted IP address |
libnet_host_lookup_r() is the planned reentrant version
of the above function. If reentrant network resolver libraries become
available, this function will likewise be reentrant. An additional
argument of a buffer to store the converted (or resolved) IP address is
supplied by the user.
| return value upon success | network-byte ordered IP address |
| return value upon failure | -1 |
| re-entrant | yes |
| arguments | 1 - human readable IP address or FQDN
2 - use_name flag |
libnet_name_resolve() takes a NULL terminated ASCII string representation of an IP address (dots and decimals or, if the usename flag is LIBNET_RESOLVE, a canonical hostname) and converts it into a network-ordered (big-endian) unsigned long value.
| return value upon success | requested IP address |
| return value upon failure | -1 |
| re-entrant | yes |
| arguments | 1 - pointer to a link interface structure
2 - pointer to the device to query 3 - pointer to a buffer to contain a possible error message |
libnet_get_ipaddr() returns the IP address of a specified
network device. The function takes a pointer to a link layer interface
structure, a pointer to the network device name, and an empty buffer to
be used in case of error. Upon success the function returns the IP
address of the specified interface in network-byte order or 0 upon error
(and errbuf will contain a reason).
| return value upon success | pointer to the requested ethernet address |
| return value upon failure | NULL |
| re-entrant | depends on architecture |
| arguments | 1 - pointer to a link interface structure
2 - pointer to the device to query 3 - pointer to a buffer to contain a possible error message |
libnet_get_hwaddr() returns the hardware address of a
specified network device. At the time of this writing, only ethernet
is supported. The function takes a pointer to a link layer interface
structure, a pointer to the network device name, and an empty buffer to
be used in case of error. The function returns the MAC address of
the specified interface upon success or NULL upon error (and errbuf will
contain a reason).
| return value upon success | opened socket |
| return value upon failure | -1 |
| re-entrant | yes |
| arguments | 1 - protocol number of desired socket type |
libnet_open_raw_sock() opens a raw IP socket of the specified
protocol type (supported types vary from system to system, but usually
you'll want to open an IPPROTO_RAW socket). The function also sets
the IP_HDRINCL socket option. Returned is the socket file descriptor
or -1 on error. The function can fail if either of the underlying
calls to socket or setsockopt fails. Checking errno will reveal the
reason for the error.
| return value upon success | 1 |
| return value upon failure | -1 |
| re-entrant | yes |
| arguments | 1 - socket to be closed |
libnet_close_raw_sock() will close the referenced raw
socket.
| return value upon success | 1 |
| return value upon failure | -1 |
| re-entrant | no |
| arguments | 1 - pointer to a sockaddr_in structure
pointer
2 - pointer to the device to query 3 - pointer to a buffer to contain a possible error message |
libnet_select_device() will run through the list of interfaces
and select one for use (ignoring the loopback device). If the device
argument points to NULL (don't pass in a NULL pointer, the function expects
a pointer to a pointer, and C can't derefrence a NULL pointer) it will
try to fill it in with the first non-loopback device it finds, otherwise,
it will try to open the specified device. If successful, 1 is returned
(and if device was NULL, it will now contain the device name which can
be used in libnet_*link*() type calls). The function can fail for
a variety of reasons, including socket system call failures, ioctl failures,
if no interfaces are found, etc.. If such an error occurs, -1 is
returned and errbuf will contain a reason.
| return value upon success | pointer to a link interface structure |
| return value upon failure | NULL |
| re-entrant | yes |
| arguments | 1 - pointer to a device
2 - pointer to a buffer to contain a possible error message |
libnet_open_link_interface() opens a low-level packet
interface. This is required in order to be able inject link layer
frames. Supplied is a u_char pointer to the interface device name
and a u_char pointer to an error buffer. Returned is a filled-in
link_int structure or NULL on error (with the error buffer containing the
reason). The function can fail for a variety of reasons due to the
fact that it is architecture specific.
| return value upon success | 1 |
| return value upon failure | -1 |
| re-entrant | yes |
| arguments | 1 - pointer to a link interface structure |
libnet_close_link_interface() closes an opened low-level
packet interface.
| return value upon success | packet size |
| return value upon failure | -1 |
| re-entrant | yes |
| arguments | 1 - socket
2 - pointer to the packet 3 - packet size |
libnet_write_ip() writes an IP packet to the network.
 The function returns
the number of bytes written upon success or -1 on error (with errno containing
the reason).
| return value upon success | packet size |
| return value upon failure | -1 |
| re-entrant | depends on architecture |
| arguments | 1 - pointer to a link interface structure
2 - pointer to the network device 3 - pointer to the packet 4 - packet size |
libnet_write_link_layer() writes a link-layer frame to
the network. The first argument is a pointer to a filled-in libnet_link_int
structure, the next is a pointer to the network device, the third is the
raw packet and the last is the packet size. Returned is the number
of bytes written or -1 on error.
| return value upon success | 1 |
| return value upon failure | -1 |
| re-entrant | yes |
| arguments | 1 - pointer to a packet
2 - protocol number of packet type 3 - packet size |
libnet_do_checksum() calculates the checksum for a packet. The first argument is a pointer to a fully built IP packet. The second is the transport protocol of the packet and the third is the packet length (not including the IP header). The function calculates the checksum for the transport protocol and fills it in at the appropriate header location (this function should be called only after a complete packet has been built).
Note that when using raw sockets the IP checksum is always
computed by the kernel and does not need to done by the user. When
using the link layer interface the IP checksum must be explicitly computed
(in this case, the protocol would be of type IPPROTO_IP and the size would
include IP_H). The function returns 1 upon success or -1 if the protocol
is of an unsupported type. Currently supported are:
| VALUE | PROTOCOL |
| IPPROTO_TCP | TCP |
| IPPROTO_UDP | UDP |
| IPPROTO_ICMP | ICMP |
| IPPROTO_IGMP | IGMP |
| IPPROTO_IP | IP (for the link-layer api) |
| IPPROTO_OSPF | OSPF |
| IPPROTO_OSPF | OSPF_LSA |
The only way for any libnet packet construction function will return an error is if the memory which is supposed to be pre-allocated points to NULL.
libnet_build_arp(u_short hrdw, u_short prot, u_short h_len, u_short
p_len, u_short op, u_char *s_ha, u_char *s_pa, u_char *t_ha, u_char *t_pa,
const u_char *payload, int payload_len, u_char *packet_buf);
| return value upon success | 1 |
| return value upon failure | -1 |
| re-entrant | yes |
| arguments | 1 - hardware address format (ARPHRD_ETHER)
2 - protocol address format 3 - length of the hardware address 4 - length of the protocol address 5 - ARP operation type 6 - sender's hardware address 7 - sender's protocol address 8 - target's hardware address 9 - target's protocol address 10 - pointer to packet payload 11 - packet payload length 12 - pointer to pre-allocated packet memory |
libnet_build_arp() constructs an ARP (RARP) packet.
At this point in the library, the function only builds ethernet/ARP packets,
but this will be easy enough to change (whenever I get around to it).
The first nine arguments are standard ARP header arguments, with the last
three being standard libnet packet creation arguments. The ARP operation
type should be one of the following symbolic types:
| VALUE | DESCRIPTION |
| ARPOP_REQUEST | ARP request |
| ARPOP_REPLY | ARP reply |
| ARPOP_REVREQUEST | RARP request |
| ARPOP_REVREPLY | RARP reply |
| ARPOP_INVREQUEST | request to identify peer |
| ARPOP_INVREPLY | reply identifying peer |
| return value upon success | 1 |
| return value upon failure | -1 |
| re-entrant | yes |
| arguments | 1 - packet id
2 - control flags 3 - number of questions 4 - number of answer resource records 5 - number of authority resource records 6 - number of additional resource records 7 - pointer to packet payload 8 - packet payload length 9 - pointer to pre-allocated packet memory |
libnet_build_dns() constructs a DNS packet. The
static DNS fields are included as the first six arguments, but the optional
variable length fields must be included with the payload interface.
| return value upon success | 1 |
| return value upon failure | -1 |
| re-entrant | yes |
| arguments | 1 - pointer to the destination address
2 - pointer to the source address 3 - ethernet packet type 4 - pointer to packet payload 5 - packet payload size 6 - pointer to pre-allocated packet memory |
libnet_build_ethernet() constructs an ethernet packet.
The destination address and source address arguments are expected to be
arrays of unsigned character bytes. The packet type should be one
of the following:
| VALUE | PROTOCOL |
| ETHERTYPE_PUP | PUP |
| ETHERTYPE_IP | IP |
| ETHERTYPE_ARP | ARP |
| ETHERTYPE_REVARP | RARP |
| ETHERTYPE_VLAN | IEEE VLAN tagging |
| ETHERTYPE_LOOPBACK | loopback test |
| return value upon success | 1 |
| return value upon failure | -1 |
| re-entrant | yes |
| arguments | 1- packet type
2 - packet code 3 - packet id 4 - packet sequence number 5 - pointer to packet payload 6 - packet payload size 7 - pointer to pre-allocated packet memory |
libnet_build_icmp_echo() constructs an ICMP_ECHO / ICMP_ECHOREPLY
packet. The packet type should be ICMP_ECHOREPLY or ICMP_ECHO and
the code should be 0.
| return value upon success | 1 |
| return value upon failure | -1 |
| re-entrant | yes |
| arguments | 1 - packet type
2 - packet code 3 - packet id 4 - packet sequence number 5 - IP netmask 6 - pointer to packet payload 7 - packet payload length 8 - pointer to pre-allocated packet memory |
libnet_build_icmp_mask() constructs an ICMP_MASKREQ /
ICMP_MASKREPLY packet. The packet type should be either ICMP_MASKREQ
or ICMP_MASKREPLY and the code should be 0. The IP netmask argument
should be a 32-bit network-byte ordered subnet mask.
| return value upon success | 1 |
| return value upon failure | -1 |
| re-entrant | yes |
| arguments | 1 - packet type
2 - packet code 3 - original IP length 4 - original IP TOS 5 - original IP id 6 - original IP fragmentation bits 7 - original IP time to live 8 - original IP protocol 9 - original IP source address 10 - original IP destination address 11 - pointer to original IP payload 12 - original IP payload size 13 - pointer to pre-allocated packet memory |
libnet_build_icmp_unreach() constructs an ICMP_UNREACH
packet. The 3rd through the 12th arguments are used to build the
IP header of the original packet that caused the error message (the ICMP
unreachable). The packet type should be ICMP_UNREACH and the code
should be one of the following:
| VALUE | DESCSRIPTION |
| ICMP_UNREACH_NET | network is unreachable |
| ICMP_UNREACH_HOST | host is unreachable |
| ICMP_UNREACH_PROTOCOL | protocol is unreachable |
| ICMP_UNREACH_PORT | port is unreachable |
| ICMP_UNREACH_NEEDFRAG | fragmentation required but DF bit set |
| ICMP_UNREACH_SRCFAIL | source routing failed |
| ICMP_UNREACH_NET_UNKOWN | network is unknown |
| ICMP_UNREACH_HOST_PROHIB | host is prohibited |
| ICMP_UNREACH_TOSNET | IP TOS and network |
| ICMP_UNREACH_TOSHOST | IP TOS and host |
| ICMP_UNREACH_FILTER_PROHIB | prohibitive filtering |
| ICMP_UNREACH_HOST_PRECEDENCE | host precedence |
| ICMP_UNREACH_PRECEDENCE_CUTOFF | host precedence cut-off |
| return value upon success | 1 |
| return value upon failure | -1 |
| re-entrant | yes |
| arguments | 1 - packet type
2 - packet code 3 - original IP length 4 - original IP TOS 5 - original IP id 6 - original IP fragmentation bits 7 - original IP time to live 8 - original IP protocol 9 - original IP source address 10 - original IP destination address 11 - pointer to original IP payload 12 - original IP payload size 13 - pointer to pre-allocated packet memory |
libnet_build_icmp_timeexceed() constructs an ICMP_TIMEXCEED
packet. This function is identical to libnet_build_icmp_unreach with
the exception of the packet type and code. The packet type should
be either ICMP_TIMXCEED_INTRANS for packets that expired in transit (TTL
expired) or ICMP_TIMXCEED_REASS for packets that expired in the fragmentation
reassembly queue.
| return value upon success | 1 |
| return value upon failure | -1 |
| re-entrant | yes |
| arguments | 1 - packet type
2 - packet code 3 - IP address of the gateway 4 - original IP length 5 - original IP TOS 6 - original IP id 7 - original IP fragmentation bits 8 - original IP time to live 9 - original IP protocol 10 - original IP source address 11 - original IP destination address 12 - pointer to original IP payload 13 - original IP payload size 14 - pointer to pre-allocated packet memory |
libnet_build_icmp_redirect() constructs an ICMP_REDIRECT
packet. This function is similar to libnet_build_icmp_unreach, the
differences being the type and code and the addition of an argument to
hold the IP address of the gateway that should be used (hence the redirect).
The packet type should be ICMP_REDIRECT and the code should be one of the
following:
| VALUE | DESCSRIPTION |
| ICMP_UNREACH_NET | redirect for network |
| ICMP_UNREACH_HOST | redirect for host |
| ICMP_UNREACH_PROTOCOL | redirect for TOS and network |
| ICMP_UNREACH_PORT | redirect for TOS and host |
| return value upon success | 1 |
| return value upon failure | -1 |
| re-entrant | yes |
| arguments | 1 - packet type
2 - packet code 3 - packet id 4 - packet sequence number 5 - originate timestamp 6 - receive timestamp 7 - transmit timestamp 8 - pointer to packet payload 9 - packet payload size 10 - pointer to pre-allocated packet memory |
libnet_build_icmp_timestamp() constructs an ICMP_TSTAMP
/ ICMP_TSTAMPREPLY packet. The packet type should be ICMP_TSTAMP
or ICMP_TSTAMPREPLY and the code should be 0.
| return value upon success | 1 |
| return value upon failure | -1 |
| re-entrant | yes |
| arguments | 1 - packet type
2 - packet code 3 - IP address 4 - pointer to packet payload 5 - packet payload size 6 - pointer to pre-allocated packet memory |
libnet_build_igmp() constructs an IGMP packet. The
packet type should be one of the following:
| VALUE | DESCSRIPTION |
| IGMP_MEMBERSHIP_QUERY | membership query |
| IGMP_V1_MEMBERSHIP_REPORT | version 1 membership report |
| IGMP_V2_MEMBERSHIP_REPORT | version 2 membership report |
| IGMP_LEAVE_GROUP | leave-group message |
The code, which is a routing sub-message, should probably
be left to 0, unless you know what you're doing.
| return value upon success | 1 |
| return value upon failure | -1 |
| re-entrant | yes |
| arguments | 1 - packet length (not including the IP
header)
2 - type of service 3 - packet id 4 - fragmentation bits / offset 5 - time to live 6 - protocol 7 - source address 8 - destination address 9 - pointer to packet payload 10 - packet payload length 11 - pointer to pre-allocated packet memory |
libnet_build_ip() constructs the mighty IP packet.
The fragmentation field may be 0 or contain some combination of the following:
| VALUE | DESCRIPTION |
| IP_DF | don't fragment this datagram (only valid when alone) |
| IP_MF | more fragments on the way (OR'd together with an offset value) |
The IP_OFFMASK is used to retrieve the offset from the
fragmentation field. IP packets may be no larger than IP_MAXPACKET
bytes. The source and destination addresses need to be in network-byte
order. The payload interface should only be used to construct an
arbitrary or non-supported type IP datagram. To construct a TCP,
UDP, or similar type packet, use the relevant libnet_build function.
| return value upon success | 1 |
| return value upon failure | -1 |
| re-entrant | yes |
| arguments | 1 - packet length (not including the OSPF
header)
2 - packet type 3 - router ID 4 - area ID 5 - authentication type 6 - pointer to packet payload 7 - packet payload length 8 - pointer to pre-allocated packet memory |
libnet_build_ospf() builds a OSPF packet. You pass
the packet length (not including the OSPF header), the packet type, 32-bit
router ID, 32-bit area ID, the authentication type, a pointer to an optional
data payload, the payload length, and a pointer to a pre-allocated block
of memory for the packet. The payload should not be used to build
the Hello, LSA, LSU, LSR, or DBD packets as there are specific construction
functions for those packet types. The following variables are to
be used for the OSPF packet type:
| VALUE | DESCSRIPTION |
| OSPF_UMD | UMD monitoring packet |
| OSPF_HELLO | Hello packet |
| OSPF_DBD | Database description packet |
| OSPF_LSR | Link state request packet |
| OSPF_LSU | Link state update packet |
| OSPF_LSA | Link state acknowledgement packet |
The following are the possible authentication types:
| VALUE | DESCRIPTION |
| OSPF_AUTH_NULL | NULL password |
| OSPF_AUTH_SIMPLE | plaintext, 8 character password |
| OSPF_AUTH_MD5 | MD5 |
The following is the structure used for the 64 bit field when using MD5:
struct auth {
u_short ospf_auth_null;
/* NULL 16 bits */
u_char ospf_auth_keyid;
/* Key ID */
u_char ospf_auth_len;
/* Auth data len */
u_int ospf_auth_seq;
/* Sequence num */
};
| return value upon success | 1 |
| return value upon failure | -1 |
| re-entrant | yes |
| arguments | 1 - netmask for interface
2 - num of seconds since last packet was sent 3 - options 4 - priority 5 - num of seconds until router is deemed dead 6 - designated router 7 - backup router 8 - neighbor 9 - packet payload 10 - payload length 11 - pointer to pre-allocated packet memory |
libnet_build_ospf_hello() builds an OSPF Hello packet.
You pass the netmask for the interface, the number of seconds since the
last packet was sent, possible options, the router's priority (if 0, it
can't be a backup router), the time (in seconds) until a router is deemed
down, the networks designated router, the networks backup router, a neighbor,
a pointer to an optional data payload, the payload length, and a pointer
to a pre-allocated block of memory used for the packet. If there
is more than one neighbor that is to be included in the packet, just allocate
enough space for the packet buf, and pass the neighbors as the "optional
data payload."
| return value upon success | 1 |
| return value upon failure | -1 |
| re-entrant | yes |
| arguments | 1 - length
2 - options 3 - type 4 - sequence number 5 - packet payload 6 - payload length 7 - pointer to pre-allocated packet memory |
libnet_build_ospf_dbd() builds an OSPF DataBase Description
(DBD) packet. You pass the maximum length of an IP packet the interface
can use, packet options, the type of exchange occurring, a sequence number,
a pointer to an optional data payload, the payload length, and a pointer
to a pre-allocated block of memory for the packet. The following
can be used for the type variable:
| VALUE | DESCRIPTION |
| DBD_IBIT | Initialization bit |
| DBD_MBIT | More DBD packets en route |
| DBD_MSBIT | Sender is the master |
| return value upon success | 1 |
| return value upon failure | -1 |
| re-entrant | yes |
| arguments | 1 - type
2 - ID 3 - advertising router 4 - packet payload 5 - payload length 6 - pointer to pre-allocated packet memory |
libnet_build_ospf_lsr() builds an OSPF Link State Request
(LSR) packet. You pass the type of link state packet being requested, the
link state ID, the advertising router, a pointer to an optional data payload,
the payload length, and a pointer to a pre-allocated block of memory for
the packet. See the libnet_build_ospf_lsa() section for more information
regarding variables.
| return value upon success | 1 |
| return value upon failure | -1 |
| re-entrant | yes |
| arguments | 1 - number of LSA packets inside
2 - packet payload 3 - payload length 4 - pointer to pre-allocated packet memory |
libnet_build_ospf_lsu() builds an OSPF Link State Update
(LSU) packet. You pass the number of Link State Acknowledgment (LSA)
packets that will be in the packet, a pointer to an optional data payload,
the payload length, and a pointer to a pre-allocated block of memory for
the packet.
| return value upon success | 1 |
| return value upon failure | -1 |
| re-entrant | yes |
| arguments | 1 - link state age
2 - options 3 - type 4 - link state ID 5 - advertising router 6 - sequence number 7 - length not including LSA header 8 - packet payload 9 - payload length 10 - pointer to pre-allocated packet memory |
libnet_build_ospf_lsa() builds an OSPF Link State Acknowledgement
(LSA) packet. You pass the link state age, packet options, type of
LSA, the link state ID, the advertising router, the packet's sequence number,
the length of the packet (_not_ including the LSA header length), a pointer
to an optional data payload, the payload length, and a pointer to a pre-allocated
block of memory for the packet. The following variables can be used
for the type of LSA:
| VALUE | DESCRIPTION |
| LS_TYPE_RTR | Router LSA |
| LS_TYPE_NET | Network LSA |
| LS_TYPE_IP | Summary LSA (IP network) |
| LS_TYPE_ASBR | Summary LSA (ASBR) |
| LS_TYPE_ASEXT | AS-External LSA |
| return value upon success | 1 |
| return value upon failure | -1 |
| re-entrant | yes |
| arguments | 1 - flags
2 - number of links 3 - link ID 4 - info for link ID 5 - router link type 6 - TOS metrics 7 - packet payload 8 - payload length 9 - pointer to pre-allocated packet memory |
libnet_build_ospf_lsa_rtr() builds an OSPF Link State
Router packet. You pass the optional packet flags, the number of
links within that packet, the link ID (helps describe the next variable),
the info for the specified link ID, the type of router link, the number
of TOS metrics for this link, the metric (the cost of using the link),
a pointer to an optional data payload, the payload length, and a pointer
to a pre-allocated block of memory for the packet. The possible flags
(not including 0x00) are as follows:
| VALUE | DESCRIPTION |
| RTR_FLAGS_W | W bit |
| RTR_FLAGS_E | E bit |
| RTR_FLAGS_B | B bit |
The possible link ID's are as follows:
| VALUE | DESCRIPTION |
| LINK_ID_NBR_ID | Neighbors router ID |
| LINK_ID_IP_DES | IP address of router |
| LINK_ID_SUB | IP subnet number |
The possible values for the router type are as follows:
| VALUE | DESCRIPTION |
| RTR_TYPE_PTP | Point to point |
| RTR_TYPE_TRANS | Connection to a `transit network` |
| RTR_TYPE_STUB | Connection to a `stub network` |
| RTR_TYPE_VRTL | Connection to a `virtual link` |
| return value upon success | 1 |
| return value upon failure | -1 |
| re-entrant | yes |
| arguments | 1 - netmask
2 - router ID 3 - packet payload 4 - packet payload length 5 - pointer to pre-allocated packet memory |
libnet_build_ospf_lsa_net() builds an OSPF Link Sate Network
packet. You pass the interface's netmask, the router ID, a pointer
to an optional data payload, the payload length, and a pointer to a pre-allocated
block of memory for the packet.
| return value upon success | 1 |
| return value upon failure | -1 |
| re-entrant | yes |
| arguments | 1 - netmask
2 - metric 3 - TOS 4 - packet payload 5 - packet payload length 6 - pointer to pre-allocated packet memory |
libnet_build_ospf_lsa_sum() builds an OSPF Link State
Summary packet. You pass the interface's netmask, the cost of using
the link (metric), the TOS, which is passed as a unsigned integer but the
first 8 bits are the TOS and the last 24 bits are the TOS metric, a pointer
to an optional data payload, the payload length, and a pointer to a pre-allocated
block of memory for the packet.
| return value upon success | 1 |
| return value upon failure | -1 |
| re-entrant | yes |
| arguments | 1 - netmask
2 - metric 3 - forwarding address 4 - external route tag 6 - packet payload 7 - packet payload length 8 - pointer to pre-allocated packet memory |
libnet_buils_ospf_lsa_as() builds an OSPF Link State AS
External packet. You pass the interface's netmask, the cost of using the
link (metric), the forwarding address, the external route tag, a pointer
to an optional data payload, the payload length, and a pointer to a pre-allocated
block of memory for the packet. In reality, the metric only uses
the last 24 bits of the unsigned int. The first 8bits are reserved
for a possible bit to be set (the E bit, see above for more info).
The variable AS_E_BIT_ON can be used logically to set the E bit on.
| return value upon success | 1 |
| return value upon failure | -1 |
| re-entrant | yes |
| arguments | 1 - command
2 - version 3 - routing domain (or zero) 4 - address family 5 - route tag (or zero) 6 - IP address 7 - netmask (or zero) 8 - next hop IP address (or zero) 9 - metric 10 - pointer to packet payload 11 - packet payload length 12 - pointer to pre-allocated packet memory |
libnet_build_rip() constructs a RIP packet. Depending
on the version of RIP you are using, packet fields are slightly different.
The following chart highlights these differences:
| ARGUMENT | VERSION 1 | VERSION 2 |
| 1 | command | command |
| 2 | RIPVER_1 | RIPVER_2 |
| 3 | zero | routing domain |
| 4 | address family | address family |
| 5 | zero | subnet mask |
| 6 | IP address | IP address |
| 7 | zero | subnet mask |
| 8 | zero | next hop ip |
| 9 | metric | metric |
The RIP commands should be one of the following:
| VALUE | DESCRIPTION |
| RIPCMD_REQUEST | RIP request |
| RIPCMD_RESPONSE | RIP response |
| RIPCMD_TRACEON | RIP tracing on |
| RIPCMD_TRACEOFF | RIP tracing off |
| RIPCMD_POLL | RIP polling |
| RIPCMD_POLLENTRY | RIP poll entry |
| RIPCMD_MAX |
| return value upon success | 1 |
| return value upon failure | -1 |
| re-entrant | yes |
| arguments | 1 - source port
2 - destination port 3 - sequence number 4 - acknowledgement number 5 - control flags 6 - window size 7 - urgent pointer 8 - pointer to packet payload 9 - packet payload size 10 - pointer to pre-allocated packet memory |
libnet_build_tcp() constructs a TCP packet. The
control flags should be one or more of the following (OR'd together if
need be):
| VALUE | DESCSRIPTION |
| TH_URG | urgent data is present |
| TH_ACK | acknowledgement number field should be checked |
| TH_PSH | push this data to the application |
| TH_RST | reset the referenced connection |
| TH_SYN | synchronize connection sequence numbers |
| TH_FIN | sender is finished sending data |
| return value upon success | 1 |
| return value upon failure | -1 |
| re-entrant | yes |
| arguments | 1 - source port
2 - destination port 3 - pointer to packet payload 4 - packet payload size 5 - pointer to pre-allocated packet memory |
libnet_build_udp() constructs a UDP packet. Please
remember that UDP checksums are considered mandatory by the host requirements
RFC.
| return value upon success | 1 |
| return value upon failure | -1 |
| re-entrant | yes |
| arguments | 1 - pointer to a IP options structure (filled
in)
2 - options length 3 - pointer to a complete IP packet |
libnet_insert_ipo() inserts IP options into a pre-built IP packet. Supplied is a pointer to an ip options structure, the size of this options list, and a pointer the pre-built packet. The options list should be constructed as they will appear on the wire, as they are simply inserted into the packet at the appropriate location.
The function returns -1 if the options would result in
packet too large (greater then 65535 bytes), or if the packet buffer is
NULL. It is an unchecked runtime error for the user to have not allocated
enough heap memory for the IP packet plus the IP options.
| return value upon success | 1 |
| return value upon failure | -1 |
| re-entrant | yes |
| arguments | 1 - pointer to a TCP options structure
(filled in)
2 - options length 3 - pointer to a complete IP/TCP packet |
libnet_insert_tcpo() inserts TCP options into a pre-built IP/TCP packet. Supplied is a pointer to a tcp options structure, the size of this options list, and a pointer the pre-built packet. The options list should be constructed as they will appear on the wire, as they are simply inserted into the packet at the appropriate location.
The function returns -1 if the options would result in
packet too large (greater then 65535 bytes), if the packet isn't an IP/TCP
packet, if the options list if longer than 20 bytes, or if the packet buffer
is NULL. It is an unchecked runtime error for the user to have not
allocated enough heap memory for the IP/TCP packet plus the IP options.
| return value upon success | 1 |
| return value upon failure | -1 |
| re-entrant | yes |
| arguments | NA |
libnet_seed_prand() seeds the pseudo-random number generator.
The function is basically a wrapper to srandom. It makes a call to
gettimeofday to get entropy. It can return -1 if the call to gettimeofday
fails (check errno). It otherwise returns 1.
| return value upon success | 1 |
| return value upon failure | NA |
| re-entrant | yes |
| arguments | 1 - maximum size of pseudo-random number desired |
libnet_get_prand() generates a psuedo-random number.
The range of the returned number is controlled by the function's only argument:
| VALUE | DESCSRIPTION |
| LIBNET_PR2 | 0 - 1 |
| LIBNET_PR8 | 0 - 255 |
| LIBNET_PR16 | 0 - 32767 |
| LIBNET_PRu16 | 0 - 65535 |
| LIBNET_PR32 | 0 -<PHONE_NUMBER> |
| LIBNET_PRu32 | 0 -<PHONE_NUMBER> |
The function does not fail.
| return value upon success | NA |
| return value upon failure | NA |
| re-entrant | yes |
| arguments | 1 - packet to dump
2 - packet length 3 - byte swap flag 4 - previously opened stream in which to dump packet |
libnet_hex_dump() prints out a packet in hexadecimal.
It will print the packet as it appears in memory, or as it will appear
on the wire, depending on the value of the byte-swap flag. The function
prints the packet to a previously opened stream (such as stdout).
Note that on big-endian architectures such as Solaris, the packet will
appear the same in memory as it will on the wire.
| return value upon success | 1 |
| return value upon failure | -1 |
| re-entrant | yes |
| arguments | 1 - pointer to a libnet_plist_chain pointer
2 - pointer to token list |
libnet_plist_chain_new() constructs a new libnet port-list chain. A libnet port-list chain is a fast and simple way of implementing port-list ranges (useful for applications that employ a list of ports - like a port scanner). You'll see naive implementations that allocate an entire array of 65535 bytes and fill in the desired ports one by one. However, we only really need to store the beginning port and the ending port, and we can efficiently store multiple port ranges (delimited by commas) by using a linked list chain with each node holding the beginning and ending port for a particular range. For example, The port range `1-1024` would occupy one node with the beginning port being 1 and the ending port being 1024. The port range `25,110-161,6000` would result in 3 nodes being allocated. Single ports are taken as single ranges (port 25 ends up being 25-25). A port list range without a terminating port (port_num - ) is considered shorthand for (port_num - 65535).
The arguments are a pointer to libnet_plist_chain pointer (which will end up being the head of the linked list) which needs to deference an allocated libnet_plist_chain structure and pointer to the port-list (token-list) itself.
The function checks this character port list for valid tokens<PHONE_NUMBER>,- ) and returns an error if an unrecognized token is found.
Upon success the function returns 1, and head points to the newly formed port-list (and also contains the number of nodes in the list. If an error occurs (an unrecognized token is found or malloc fails) -1 is returned and head is set to NULL.
libnet_plist_chain_next_pair() should be used to extract
port list pairs.
| return value upon success | 1, 0 |
| return value upon failure | -1 |
| re-entrant | yes |
| arguments | 1 - pointer to a libnet_plist_chain pointer
2 - pointer to the beginning port (to be filled in) 3 - pointer to the ending port (to be filled in) |
libnet_plist_chain_next_pair() fetches the next pair of ports from the list. The function takes a pointer to the head of the prebuilt list and a pointer to a u_short that will contain the beginning port and a pointer to a u_short that will contain the ending port.
The function returns 1 and fills in these values if there
are nodes remaining, or if the port list chain is exhausted, it returns
0. If an error occurs (the libnet_plist_chain pointer is NULL) the
function
returns -1.
| return value upon success | 1 |
| return value upon failure | -1 |
| re-entrant | yes |
| arguments | 1 - pointer to a libnet_plist_chain pointer |
libnet_plist_chain_dump() dumps the port-list chain referenced
by the argument. The function prints the list to stdout (it's mainly
meant as a debugging tool). It returns 1 upon success or if an error
occurs (the libnet_plist_chain pointer is NULL) the function returns -1.
| return value upon success | pointer to the token list |
| return value upon failure | NULL |
| re-entrant | no |
| arguments | 1 - pointer to a libnet_plist_chain pointer |
libnet_plist_chain_dump_string() returns the port-list
chain referenced by the argument as a string. It returns the port
list string upon success or if an error occurs (the libnet_plist_chain
pointer is NULL) the function returns NULL.
| return value upon success | NA |
| return value upon failure | NA |
| re-entrant | yes |
| arguments | 1 - pointer to a libnet_plist_chain pointer |
libnet_plist_chain_free() frees the memory associated
with the libnet port list chain.
| SYMBOLIC CONSTANT | SIZE IN BYTES |
| LIBNET_ARP_H | 28 |
| LIBNET_DNS_H | 12 |
| LIBNET_ETH_H | 14 |
| LIBNET_ICMP_H (deprecated) | 4 |
| LIBNET_ICMP_ECHO_H | 8 |
| LIBNET_ICMP_MASK_H | 12 |
| LIBNET_ICMP_UNREACH_H | 8 |
| LIBNET_ICMP_TIMXCEED_H | 8 |
| LIBNET_ICMP_REDIRECT_H | 8 |
| LIBNET_ICMP_TS_H | 20 |
| LIBNET_IGMP_H | 8 |
| LIBNET_IP_H | 20 |
| LIBNET_RIP_H | 24 |
| LIBNET_TCP_H | 20 |
| LIBNET_UDP_H | 8 |
More packet memory constants:
| SYMBOLIC CONSTANT | MEANING |
| LIBNET_PACKET | enough memory for a TCP or UDP header and an IP header |
| LIBNET_OPTS | enough memory for IP or TCP options (40 bytes) |
| LIBNET_MAX_PACKET | enough memory for IP_MAXPACKET (65535 bytes) |
The following are used for psuedo random number generation,
with libnet_get_prand():
| SYMBOLIC CONSTANT | RANGE |
| LIBNET_PRAND_MAX | 65535 |
| LIBNET_PR2 | 0 - 2 |
| LIBNET_PR8 | 0 - 255 |
| LIBNET_PR16 | 0 - 32767 |
| LIBNET_PRu16 | 0 - 65535 |
| LIBNET_PR32 | 0 -<PHONE_NUMBER> |
| LIBNET_PRu32 | 0 -<PHONE_NUMBER> |
For error messaging, used in conjunction with libnet_error():
| SYMBOLIC CONSTANT | MEANING |
| LIBNET_ERR_WARNING | warning error message |
| LIBNET_ERR_CRITICAL | critical error message |
| LIBNET_ERR_FATAL | fatal error message (program will exit) |
For use with libnet_host_lookup(), libnet_host_lookup_r(),
and libnet_name_resolve():
| SYMBOLIC CONSTANT | MEANING |
| LIBNET_DONT_RESOLVE | do not resolve IP addresses into FQDNs |
| LIBNET_RESOLVE | attempt to resolve IP addresses into FQDNs |
The arena interface defines the following macros:
| MACRO | MEANING |
| LIBNET_GET_ARENA_SIZE(arena) | returns the size of the arena |
| LIBNET_GET_ARENA_REMAINING_BYTES(arena) | returns the number of bytes left in the arena |
To print the ethernet address from an ether_addr struct
use the following macro:
| MACRO | MEANING |
| LIBNET_PRINT_ETH_ADDR(e) | Prints the ethernet address of the ether_addr struct |


John Smith @johnsmith 31m
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean efficitur sit amet massa fringilla egestas. Nullam condimentum luctus turpis.
John Smith @johnsmith 31m
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean efficitur sit amet massa fringilla egestas. Nullam condimentum luctus turpis.
Vertical...
Top tile
...tiles
Bottom tile
Middle tile
With an image
Wide tile
Aligned with the right tile
Tall tile
With even more content
This username is available
This email is invalid
| Pos | Team | Pld | W | D | L | GF | GA | GD | Pts | Qualification or relegation |
|---|---|---|---|---|---|---|---|---|---|---|
| Pos | Team | Pld | W | D | L | GF | GA | GD | Pts | Qualification or relegation |
| 1 | Leicester City (C) | 38 | 23 | 12 | 3 | 68 | 36 | +32 | 81 | Qualification for the Champions League group stage |
| 2 | Arsenal | 38 | 20 | 11 | 7 | 65 | 36 | +29 | 71 | Qualification for the Champions League group stage |
| 3 | Tottenham Hotspur | 38 | 19 | 13 | 6 | 69 | 35 | +34 | 70 | Qualification for the Champions League group stage |
| 4 | Manchester City | 38 | 19 | 9 | 10 | 71 | 41 | +30 | 66 | Qualification for the Champions League play-off round |
John Smith
@johnsmith
Component
Note requires Javascript to work. Uses is-active
class to modify dropdown visibility.
Note requires Javascript to work. Uses is-active
class to modify modal visibility.


Reader NFC
On GitHub
NFC Reading Content
For the correct functioning of the reader it is required to have previously activated the NFC on the smartphone and enable the WebNFC flag in chrome://flags.
Based on the code snippets from
specification draft.
Resources
Specification Draft
MDN: Using the NFC API (covers outdated spec revision)
NFC: What Web Can Do


Goals
Business problem
The goal was to reduce fuel costs and benefit from additional payload through trim and payload optimization while simultaneously boosting airline's load controllers’ productivity. The brand new advanced weight and balance solution have to raise the client's load control to the next level by providing full automation, flexible configuration options, and powerful features.
A team of our scientists and engineers was chosen to assist with data science research & development phase. Also, Yotalabs has been working on a web/mobile interface along with the core development team. The goal was to deploy a smart solution to do cargo management in the most efficient way.
Goals Opinion
”Our solution is one of the world’s leading software solutions for the airline industry. This integrated, modular product line provides optimal support for the entire process of planning and controlling airline resources”


Class: Dtf::Command
- Inherits:
-
Object
- Object
- Dtf::Command
- Defined in:
- lib/dtf.rb
Overview
Dtf::Command contains all sub-commands availabe in the DTF master gem. All methods receive the @cmd and @cmd_opts returned by Dtf::OptionsParser.parse_cmds()
Class Method Summary (collapse)
-
+ (Object) create_user(cmd, cmd_opts)
This sub-command is used to add a User to the Test Framework system.
-
+ (Object) create_vs(cmd, cmd_opts)
This sub-command generates, adds, and associates a Verification Suite in the Testing Framework system.
-
+ (Object) delete_user(cmd, cmd_opts)
This sub-command removes a User from the Testing Framework system.
-
+ (Object) delete_vs(cmd, cmd_opts)
This sub-command removes a Verification Suite from the Testing Framework system.
-
+ (Object) process(cmd, cmd_opts)
Process both the requested command and all/any parameters.
Class Method Details
+ (Object) create_user(cmd, cmd_opts)
This sub-command is used to add a User to the Test Framework system
Required Parameters are:
--user-name [String], --full-name [String], --email-address [String]
'--user-name' is used to specify the user_name of the created User, and must be unique in the system. '--full-name' is the Real Name of the created User. '--email-address' is the email address of the created User, and must be unique in the system.
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 |
# File 'lib/dtf.rb', line 143 def self.create_user(cmd, cmd_opts) if [:user_name_given, :full_name_given, :email_address_given].all? { |sym| cmd_opts.key?(sym) } then user = User.where(user_name: cmd_opts[:user_name], full_name: cmd_opts[:full_name], email_address: cmd_opts[:email_address]).create # Check to make sure user was actually saved to the db if user.persisted? then puts "Created user \'#{cmd_opts[:user_name]}\' for \'#{cmd_opts[:full_name]}\'" else # Oops, it wasn't! Notify user and display any error message(s) $stderr.puts "ERROR: #{cmd_opts[:user_name].to_s} was NOT created! Please fix the following errors and try again:" user.errors..each do |msg| $stderr.puts "#{msg}" end # Now throw a proper error code to the system, while exiting the script abort() end else Dtf::ErrorSystem.raise_error(cmd) # This error here is thrown when not all params are provided end end |
+ (Object) create_vs(cmd, cmd_opts)
This sub-command generates, adds, and associates a Verification Suite in the Testing Framework system.
Required Parameters are:
--user-name [String], --name [String]
'--user-name' is the user_name of the User that should own this Verification Suite. '--name' is the descriptive name of the Verification Suite.
Options are:
--description [String]
This optional parameter is for providing a description of the Verification Suite's use. e.g. --description "RSpec Verification"
231 232 233 234 235 236 237 238 239 240 241 242 243 244 |
# File 'lib/dtf.rb', line 231 def self.create_vs(cmd, cmd_opts) if [:user_name_given, :name_given].all? { |sym| cmd_opts.key?(sym) } then user = User.find_by_user_name(cmd_opts[:user_name]) vs = user.verification_suites.create(name: cmd_opts[:name], description: cmd_opts[:description]) if vs.persisted? then puts "VS named \'#{cmd_opts[:name]}\' allocated to user \'#{cmd_opts[:user_name]}\'" else $stderr.puts "ERROR: Failed to save Verification Suite. Check DB logfile for errors" abort() end else Dtf::ErrorSystem.raise_error(cmd) end end |
+ (Object) delete_user(cmd, cmd_opts)
This sub-command removes a User from the Testing Framework system
Required Parameters are:
--user-name [String]
'--user-name' is the assigned user_name of the User you wish to delete.
Optional Flags are:
--delete-all|--no-delete-all
By default this command will delete all Verification Suites owned by the deleted user. The default behaviour is as if the sub-command had been invoked passing the '--delete-all' flag explicitly.
To delete the user, but keep their VS, pass the '--no-delete-all' flag. This flag will find all Verification Suites owned by the user being deleted, and reassign them to 'Library Owner' (user_name: library_owner) which is the generic in-house User shipped with DTF.
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 |
# File 'lib/dtf.rb', line 182 def self.delete_user(cmd, cmd_opts) if [:user_name_given, :delete_all].all? { |sym| cmd_opts.key?(sym) } then # NOTE: :delete_all is 'true' by default. passing '--no-delete-all' sets it to false, # and adds the :delete_all_given key to the cmd_opts hash, set to true. # This means NOT to delete all VSs associated with this user. We delete them by default. if cmd_opts[:delete_all] == false && cmd_opts[:delete_all_given] == true puts "#{cmd} called with '--no-delete-all' set! NOT deleting all owned VSs!" puts "Reassigning VSs to Library. New owner will be \'Library Owner\'" user = User.find_by_user_name(cmd_opts[:user_name]) lib_owner = User.find_by_user_name("library_owner") user.verification_suites.all.each do |vs| vs.user_id = lib_owner.id vs.save end User.delete(user) else puts "#{cmd} called with '--delete-all' set or on by default! Deleting all VSs owned by #{cmd_opts[:user_name]}" user = User.find_by_user_name(cmd_opts[:user_name]) if ! user.nil? then user.verification_suites.all.each do |vs| VerificationSuite.delete(vs) end if user.verification_suites.empty? then User.delete(user) end else $stderr.puts "ERROR: No user named \'#{cmd_opts[:user_name].to_s}\' found!" abort() end end else Dtf::ErrorSystem.raise_error(cmd) end end |
+ (Object) delete_vs(cmd, cmd_opts)
This sub-command removes a Verification Suite from the Testing Framework system
Required Parameters are:
--user-name [String], --id [Integer]
The '--user-name' parameter is the user_name of the User that owns the Verification Suite you wish to delete The '--id' parameter is the ID # of the Verification Suite you wish to delete, as provided by @vs.id
253 254 255 256 257 258 259 260 261 262 |
# File 'lib/dtf.rb', line 253 def self.delete_vs(cmd, cmd_opts) if [:user_name_given, :id_given].all? { |sym| cmd_opts.key?(sym) } then puts "#{cmd} called! Deleting #{cmd_opts[:user_name]}\'s VS with ID \'#{cmd_opts[:id]}\'" user = User.find_by_user_name(cmd_opts[:user_name]) vs = user.verification_suites.find(cmd_opts[:id]) VerificationSuite.delete(vs) else Dtf::ErrorSystem.raise_error(cmd) end end |
+ (Object) process(cmd, cmd_opts)
Process both the requested command and all/any parameters. NOTE: This method is the 'master' method. It parses @cmd for which sub-command to execute and then hands off to the appropriate method. All methods are a 1:1 match in their name. e.g 'create_user' sub-command is matched to the 'create_user' method of this class.
This method requires, and processes, 2 arguments. The first is a String, the second is a Hash. They are the 'cmd' to process and any options/parameters, stored in the 'cmd_opts' hash, of that sub-command.
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
# File 'lib/dtf.rb', line 115 def self.process(cmd, cmd_opts) case cmd when "create_user" self.create_user(cmd, cmd_opts) when "delete_user" self.delete_user(cmd, cmd_opts) when "create_vs" self.create_vs(cmd, cmd_opts) when "delete_vs" self.delete_vs(cmd, cmd_opts) else $stderr.puts "Unknown DTF sub-command: #{cmd}" abort() end end |


I like CSS
Web Development class is cool
Dogs are cool
Cats are also cool
Birds are cool
Pidgeys
are great
Humans are not cool
Link to Pie


The text editor contains a tab called "Cross Products":
This tab assumes that your cross products conform to the genus/differentia method of designating cross products. If you are using another, unrecommended method (ie creating random cross products by hand ), this panel may behave in unexpected ways.
The genus term is listed at the top. Differentia terms are listed in the "Discriminating Relations" section. Each line of this section represents a relationship to a term. The drop down box contains the relationship type, and the button immediately to the right contains the target (parent) term of this relationship.
To the right of each button that contains a term is a button marked with a blue circle. Clicking this button causes the term to be selected in the ontology editor panel. These buttons are for use while browsing, not editing. Clicking one of these buttons will usually cause a new term to be loaded into the text editor, so you will lose any pending changes to the cross product definition if one of these buttons is clicked.
Remember, this component (like all components within the text editor) affects the current sub-selection . The genus and differentia information you enter will be assigned to the current term. No new terms will be created. (To create a new term that is a cross product of two or more existing terms, create a new term first, and then build your cross product definition).
Drag the new genus term onto the button labeled "<drop a genus term>". The text on the button will change to the name of the new genus term.
To assign NO genus term, click the genus term button. The current genus term will be removed.
It is possible to create a valid cross-product with no genus term in OBO-Edit. It is not recommended.
Drop the new differentia term onto the button labelled "drag new terms here". A popup menu will appear containing a list of all available relationship types in the current ontology. Choose an option from the menu to assign a type to your new relationship.
To entirely remove a differentia term, click the garbage can button next to the term.
The cross product tab is located inside the text editor. Therefore, you must click the "Commit" button to make your changes permanent. Otherwise, they will be lost when you click a new term.
Once changes are committed, OBO-Edit will create the hidden links that record your new cross product. If the reasoner is running, OBO-Edit will try to create inferred is_a links based on your new cross-product definition.


|
Bullet Collision Detection & Physics Library
|
btVoronoiSimplexSolver is an implementation of the closest point distance algorithm from a 1-4 points simplex to the origin. More...
#include <btVoronoiSimplexSolver.h>
btVoronoiSimplexSolver is an implementation of the closest point distance algorithm from a 1-4 points simplex to the origin.
Can be used with GJK, as an alternative to Johnson distance algorithm.
Definition at line 93 of file btVoronoiSimplexSolver.h.
|
inline |
Definition at line 130 of file btVoronoiSimplexSolver.h.
| void btVoronoiSimplexSolver::addVertex | ( | const btVector3 & | w, |
| const btVector3 & | p, | ||
| const btVector3 & | q | ||
| ) |
Definition at line 69 of file btVoronoiSimplexSolver.cpp.
| void btVoronoiSimplexSolver::backup_closest | ( | btVector3 & | v | ) |
Definition at line 296 of file btVoronoiSimplexSolver.cpp.
| btVoronoiSimplexSolver::BT_DECLARE_ALIGNED_ALLOCATOR | ( | ) |
| bool btVoronoiSimplexSolver::closest | ( | btVector3 & | v | ) |
Definition at line 236 of file btVoronoiSimplexSolver.cpp.
| bool btVoronoiSimplexSolver::closestPtPointTetrahedron | ( | const btVector3 & | p, |
| const btVector3 & | a, | ||
| const btVector3 & | b, | ||
| const btVector3 & | c, | ||
| const btVector3 & | d, | ||
| btSubSimplexClosestResult & | finalResult | ||
| ) |
Definition at line 437 of file btVoronoiSimplexSolver.cpp.
| bool btVoronoiSimplexSolver::closestPtPointTriangle | ( | const btVector3 & | p, |
| const btVector3 & | a, | ||
| const btVector3 & | b, | ||
| const btVector3 & | c, | ||
| btSubSimplexClosestResult & | result | ||
| ) |
Definition at line 313 of file btVoronoiSimplexSolver.cpp.
Definition at line 306 of file btVoronoiSimplexSolver.cpp.
| bool btVoronoiSimplexSolver::emptySimplex | ( | ) | const |
Definition at line 301 of file btVoronoiSimplexSolver.cpp.
|
inline |
Definition at line 152 of file btVoronoiSimplexSolver.h.
|
inline |
Definition at line 143 of file btVoronoiSimplexSolver.h.
| int btVoronoiSimplexSolver::getSimplex | ( | btVector3 * | pBuf, |
| btVector3 * | qBuf, | ||
| btVector3 * | yBuf | ||
| ) | const |
Definition at line 257 of file btVoronoiSimplexSolver.cpp.
| bool btVoronoiSimplexSolver::inSimplex | ( | const btVector3 & | w | ) |
Definition at line 269 of file btVoronoiSimplexSolver.cpp.
| btScalar btVoronoiSimplexSolver::maxVertex | ( | ) |
Definition at line 243 of file btVoronoiSimplexSolver.cpp.
|
inline |
Definition at line 167 of file btVoronoiSimplexSolver.h.
| int btVoronoiSimplexSolver::pointOutsideOfPlane | ( | const btVector3 & | p, |
| const btVector3 & | a, | ||
| const btVector3 & | b, | ||
| const btVector3 & | c, | ||
| const btVector3 & | d | ||
| ) |
Test if point p and d lie on opposite sides of plane through abc.
Definition at line 411 of file btVoronoiSimplexSolver.cpp.
| void btVoronoiSimplexSolver::reduceVertices | ( | const btUsageBitfield & | usedVerts | ) |
Definition at line 43 of file btVoronoiSimplexSolver.cpp.
| void btVoronoiSimplexSolver::removeVertex | ( | int | index | ) |
Definition at line 34 of file btVoronoiSimplexSolver.cpp.
| void btVoronoiSimplexSolver::reset | ( | ) |
Definition at line 59 of file btVoronoiSimplexSolver.cpp.
|
inline |
Definition at line 138 of file btVoronoiSimplexSolver.h.
| bool btVoronoiSimplexSolver::updateClosestVectorAndPoints | ( | ) |
Definition at line 81 of file btVoronoiSimplexSolver.cpp.
| btSubSimplexClosestResult btVoronoiSimplexSolver::m_cachedBC |
Definition at line 117 of file btVoronoiSimplexSolver.h.
| btVector3 btVoronoiSimplexSolver::m_cachedP1 |
Definition at line 109 of file btVoronoiSimplexSolver.h.
| btVector3 btVoronoiSimplexSolver::m_cachedP2 |
Definition at line 110 of file btVoronoiSimplexSolver.h.
| btVector3 btVoronoiSimplexSolver::m_cachedV |
Definition at line 111 of file btVoronoiSimplexSolver.h.
| bool btVoronoiSimplexSolver::m_cachedValidClosest |
Definition at line 115 of file btVoronoiSimplexSolver.h.
| btScalar btVoronoiSimplexSolver::m_equalVertexThreshold |
Definition at line 114 of file btVoronoiSimplexSolver.h.
| btVector3 btVoronoiSimplexSolver::m_lastW |
Definition at line 112 of file btVoronoiSimplexSolver.h.
| bool btVoronoiSimplexSolver::m_needsUpdate |
Definition at line 119 of file btVoronoiSimplexSolver.h.
| int btVoronoiSimplexSolver::m_numVertices |
Definition at line 103 of file btVoronoiSimplexSolver.h.
| btVector3 btVoronoiSimplexSolver::m_simplexPointsP[VORONOI_SIMPLEX_MAX_VERTS] |
Definition at line 106 of file btVoronoiSimplexSolver.h.
| btVector3 btVoronoiSimplexSolver::m_simplexPointsQ[VORONOI_SIMPLEX_MAX_VERTS] |
Definition at line 107 of file btVoronoiSimplexSolver.h.
| btVector3 btVoronoiSimplexSolver::m_simplexVectorW[VORONOI_SIMPLEX_MAX_VERTS] |
Definition at line 105 of file btVoronoiSimplexSolver.h.


Connected Sounds
Send us your demos, we will reply asap!
Email
Soundcloud link
Short message(optional)
Submit


Announcements
Our T-shirts are designed to give you an original fresh look
Browse and shop easily then receive your orders as soon as possible! any palce, any time
Our products are made from high quality materials and it's environmental friendly
Enjoy one of the most recommended stores on the web with +500k ratings


| Figure 1 |
Study species. Silene acaulis is a facilitative alpine cushi ... |
| Figure 2 |
Sampling design. The black curved line represents a hiking t ... |
| Figure 3 |
Disturbance effects on Silene acaulis. (a) Disturbed sites h ... |
| Figure 4 |
Disturbance effects on Silene acaulis reproduction. Fruit de ... |
| Figure 5 |
Inside species community. Disturbance reduces inside species ... |
| Figure 6 |
Neighboring species community. Disturbance reduces neighbori ... |
| Figure 7 |
Conceptual diagram summarizing main findings. The net (i.e., ... |


Treasury bills attract record foreign investment of $713m
by https://www.dawn.com/authors/456/shahid-iqbal, Shahid IqbalKARACHI: Foreign investment in treasury bills reached a new high of $712.8 million in the first four months of this fiscal year.
The recent State Bank of Pakistan data indicates investment in government-backed securities has become attractive for foreigners. The financial sector believes that foreign investors’ growing interest in government papers reflects their confidence in the economic reforms being implemented in the country.
However, some researchers attribute this increased demand to the high yield of treasury bills. In the last auction of T-bills held on November 6, the cut-off yield for three and six-month securities were 13.28 per cent and 13.29pc, respectively.
According to them, foreign investment can’t get such a high return from any government backed almost risk free debt papers.
The treasury bills attracted $278.6m alone in the first 13 days of November but the investment was almost exclusively from two countries: the US and UK.
Highest investment from the US was $390.8m up to Nov 13 while the cumulative amount from UK amounted to $317.9m. Out of total net inflows of $712.8m, these two courtiers accounted for $708.7m.
Inflows from the United Arab Emirates during the period amounted to $19.5m while $8m came from Luxemburg.
In the first 13 days of November, investment from UK was $181.6m, US $88.7m and $8.8m from UAE.
While foreign investment boosted the morale of the equity market with the benchmark index going up, inflow of foreign investment helped the country to improve its foreign exchange reserves.
In a recent press conference, State Bank Governor Dr Reza Baqir rejected the perception that foreign investment in T-bills would fall once the interest rates go down. He said some investors might leave but they will return back when the economy achieves stability.
The recent foreign direct investment data revealed inflows falling by 3.1 per cent to $542m in the first quarter of FY20.
Published in Dawn, November 15th, 2019


"x" "1" "HAACHK,T ERDINGER,L AND BOCHE,G, MUTAGENICITY IN SALMONELLATYPHIMURIUM TA98 AND TA100 OF NITROSO AND RESPECTIVE HYDROXYLAMINE COMPOUNDS,MUTAT. RES. 491(1-2):183-193, 2001"


Work Completed by Shruti Patel
Form Validation
CheckBox using JavaScript
CheckBox using JQuery
Fahren To Cels
HTML-CSS Assignment
Form
Form2
Bootsrap
HandlebarsJS-store
AngularJS-store
AngularJS-store-using factory
AngularJS-store-using services


Introduction
What Is GridTools
The GridTools (GT) framework is a set of libraries and utilities to develop performance portable applications in which stencil operations on grids are central. The focus of the project is on regular and block-structured grids as are commonly found in the weather and climate application field. In this context, GT provides a useful level of abstraction to enhance productivity and obtain excellent performance on a wide range of computer architectures. Additionally, it addresses the challenges that arise from integration into production code, such as the expression of boundary conditions, or conditional execution. The framework is structured such that it can be called from different weather models (numerical weather and climate codes) or programming interfaces, and can target various computer architectures. This is achieved by separating the GT core library in a user facing part (frontend) and architecture specific (backend) parts. The core library also abstracts various possible data layouts and applies optimizations on stages with multiple stencils. The core library is complemented by facilities to interoperate with other languages (such as C and Fortran), to aid code development and a communication layer.
GridTools provides optimized backends for GPUs and manycore architectures. Stencils can be run efficiently on different architectures without any code change needed. Stencils can be built up by small composeable units called stages, using GridTools domain-specific language. Such a functor can be as simple as being just a copy stencil, copying data from one field to another:
struct copy_functor {
using in = in_accessor<0>;
using out = inout_accessor<1>;
using param_list = make_param_list<in, out>;
template <typename Evaluation>
GT_FUNCTION static void apply(Evaluation eval) {
eval(out()) = eval(in());
}
};
Several such stages can be composed into a Computation and be applied on each grid-point of a grid. Requiring this abstract descriptions of a stencils, the DSL allows GridTools can apply architecture-specific optimizations to the stencil computations in order to be optimal on the target hardware.
Dependencies
GridTools requires a header-only installation of Boost, a recent version of CMake and a modern compiler. The exact version requirements can be found on GitHub.
Addtionally GridTools requires the following optional dependencies. For the communication module (GCL) MPI is required. For the GPU backends a CUDA or HIP compiler is required. For the CPU backends OpenMP is required.
Using GridTools
GridTools uses CMake as its build system. CMake offers two ways of using a CMake-managed project: from an installation or using FetchContent to pull in a dependency on the fly. GridTools supports both ways.
Installing and Validating GridTools
To install GridTools (in /usr/local
)
and run the tests, use the following commands.
git clone http://github.com/GridTools/gridtools.git
cd gridtools
mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr/local ..
cmake --build --parallel 4
ctest
CMake will detect the optional dependencies and enable the available backends accordingly. During configure the available GridTools targets will be listed.
The following CMake variables are available to customize the installation of GridTools.
Set
GT_INSTALL_EXAMPLES
toON
andselect a directory for installation with
GT_INSTALL_EXAMPLES_PATH
. The examples come with a standalone CMake project and can be built separately.
Additionally, use the following CMake variables to customize building of tests.
Set
BUILD_TESTING
toOFF
to disable building any tests (fast installation without validation).Set
GT_GCL_GPU
toOFF
to disable thegcl_gpu
target (and to disable building of GPU GCL tests). This is useful, if you have CUDA in your environment, but the MPI implementation is not CUDA-aware.Set
GT_CUDA_ARCH
to the compute capability of the GPU device on which you want to run the tests.If your compiler is a CUDA-capable Clang, you can switch how CUDA code will be compiled, by setting
GT_CLANG_CUDA_MODE
to one ofAUTO
(default, prefer Clang-CUDA if available),Clang-CUDA
(compile with Clang),NVCC-CUDA
(compile with NVCC and Clang as the host compiler).
Using a GridTools Installation
Using GridTools follows standard CMake practices. If GridTools was installed to <prefix>,
provide -DCMAKE_PREFIX_PATH=<prefix>
or -DGridTools_ROOT=<prefix>
to indicate where GridTools can be found.
The CMakeLists.txt
file should then contain the following line:
find_package(GridTools VERSION ... REQUIRED)
Note
If GridTools should use CUDA with NVCC, you must call enable_language(CUDA)
before the call to find_package
.
Note
If you are compiling with Clang, set the variable GT_CLANG_CUDA_MODE
before calling find_package
, see
Installing and Validating GridTools. It is recommended to make this variable a CMake cached variable to allow users of your code
to change the mode.
Using GridTools with CMake’s FetchContent
Alternatively to a GridTools installation you can use GridTools with FetchContent. To use FetchContent add the following lines to your CMake project
include(FetchContent)
FetchContent_Declare(GridTools
URL https://github.com/GridTools/gridtools/archive/<release_tag>.tar.gz
)
FetchContent_GetProperties(GridTools)
if(NOT GridTools_POPULATED)
FetchContent_Populate(GridTools)
add_subdirectory(${gridtools_SOURCE_DIR} ${gridtools_BINARY_DIR})
endif()
where <release_tag> is the git tag of the GridTools release, e.g. v2.0.0
.
The following CMake options are available (see also Installing and Validating GridTools).
By default, all GridTools tests are disabled. To enable building of the tests, set
GT_BUILD_TESTING
toON
. If tests are enabled, their behavior can be changed as described in Installing and Validating GridTools.Use
GT_CLANG_CUDA_MODE
to select how CUDA code is compiled, see Installing and Validating GridTools.
Using GridTools
After GridTools was made available by either find_package
or FetchContent
the following targets for the
different GridTools modules are available
stencil_naive
If OpenMP is available
stencil_cpu_ifirst
stencil_cpu_kfirst
storage_cpu_ifirst
storage_cpu_kfirst
layout_transformation_cpu
boundaries_cpu
If OpenMP and MPI is available
gcl_cpu
If a CUDA runtime (or a HIP compiler) is available (no CUDA compiler required)
storage_gpu
If a CUDA compiler or a HIP compiler is available
stencil_gpu
layout_transformation_gpu
boundaries_gpu
If a CUDA compiler and MPI is available
gcl_gpu
(can be disabled by the user if the MPI implementation is not CUDA-aware)
After linking to the GridTools backend, we recommend to call the CMake function
gridtools_setup_target(<target> [CUDA_ARCH <compute_capability>])
on your target.
The function helps abstracting differences in how CUDA code is compiled
(e.g. Clang uses a different flag than NVCC for the CUDA architecture). Additionally, using this function
allows to compile the same .cpp file for both CUDA and host, without having to wrap the implementation in a
.cu file.
add_library(my_library source.cpp)
target_link_libraries(my_library PUBLIC GridTools::stencil_cuda)
gridtools_setup_target(my_library CUDA_ARCH sm_60)
AMD GPU Support
Further, GridTools can also be compiled for AMD GPUs using AMD’s HIP. To compile GridTools you need the Clang-based HIP compiler which is available with ROCm 3.5 and later.
Contributing
Contributions to the GridTools set of libraries are welcome. However, our policy is that we will be the official maintainers and providers of the GridTools code. We believe that this will provide our users with a clear reference point for support and guarantees on timely interactions. For this reason, we require that external contributions to GridTools will be accepted after their authors provide to us a signed copy of a copyright release form to ETH Zurich.


Join our mailing list
Life as a teacher
How to become a teacher
Funding your training
How to apply
Find an event near you


Controller class name should be file name and also must extends class WLT_Controller. If you want access parent methods you shoud call parent construct.
defaultController.phpController class name should be file name and also must extends class WLT_Controller. If you want access parent methods you shoud call parent construct.
defaultController.phpController class name should be file name and also must extends class WLT_Controller. If you want access parent methods you shoud call parent construct.
defaultController.php


| Package | Description |
|---|---|
| java.nio.channels |
Defines channels, which represent connections to entities that are capable of
performing I/O operations, such as files and sockets; defines selectors, for
multiplexed, non-blocking I/O operations.
|
| java.nio.file |
Defines interfaces and classes for the Java virtual machine to access files,
file attributes, and file systems.
|
| java.nio.file.attribute |
Interfaces and classes providing access to file and file system attributes.
|
| java.util.concurrent |
Utility classes commonly useful in concurrent programming.
|
| java.util.concurrent.locks |
Interfaces and classes providing a framework for locking and waiting
for conditions that is distinct from built-in synchronization and
monitors.
|
| javax.swing |
Provides a set of "lightweight"
(all-Java language) components that,
to the maximum degree possible, work the same on all platforms.
|
| Modifier and Type | Method and Description |
|---|---|
abstract boolean |
AsynchronousChannelGroup.awaitTermination(long timeout,
TimeUnit unit)
Awaits termination of the group.
|
abstract <A> void |
AsynchronousSocketChannel.read(ByteBuffer[] dsts,
int offset,
int length,
long timeout,
TimeUnit unit,
A attachment,
CompletionHandler<Long,? super A> handler)
Reads a sequence of bytes from this channel into a subsequence of the
given buffers.
|
abstract <A> void |
AsynchronousSocketChannel.read(ByteBuffer dst,
long timeout,
TimeUnit unit,
A attachment,
CompletionHandler<Integer,? super A> handler)
Reads a sequence of bytes from this channel into the given buffer.
|
abstract <A> void |
AsynchronousSocketChannel.write(ByteBuffer[] srcs,
int offset,
int length,
long timeout,
TimeUnit unit,
A attachment,
CompletionHandler<Long,? super A> handler)
Writes a sequence of bytes to this channel from a subsequence of the given
buffers.
|
abstract <A> void |
AsynchronousSocketChannel.write(ByteBuffer src,
long timeout,
TimeUnit unit,
A attachment,
CompletionHandler<Integer,? super A> handler)
Writes a sequence of bytes to this channel from the given buffer.
|
| Modifier and Type | Method and Description |
|---|---|
WatchKey |
WatchService.poll(long timeout,
TimeUnit unit)
Retrieves and removes the next watch key, waiting if necessary up to the
specified wait time if none are yet present.
|
| Modifier and Type | Method and Description |
|---|---|
static FileTime |
FileTime.from(long value,
TimeUnit unit)
Returns a
FileTime representing a value at the given unit of
granularity. |
long |
FileTime.to(TimeUnit unit)
Returns the value at the given unit of granularity.
|
| Modifier and Type | Method and Description |
|---|---|
static TimeUnit |
TimeUnit.valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static TimeUnit[] |
TimeUnit.values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
CountDownLatch.await(long timeout,
TimeUnit unit)
Causes the current thread to wait until the latch has counted down to
zero, unless the thread is interrupted,
or the specified waiting time elapses.
|
int |
CyclicBarrier.await(long timeout,
TimeUnit unit)
Waits until all parties have invoked
await on this barrier, or the specified waiting time elapses.
|
int |
Phaser.awaitAdvanceInterruptibly(int phase,
long timeout,
TimeUnit unit)
Awaits the phase of this phaser to advance from the given phase
value or the given timeout to elapse, throwing
InterruptedException if interrupted while waiting, or
returning immediately if the current phase is not equal to the
given phase value or this phaser is terminated. |
boolean |
ThreadPoolExecutor.awaitTermination(long timeout,
TimeUnit unit) |
boolean |
ExecutorService.awaitTermination(long timeout,
TimeUnit unit)
Blocks until all tasks have completed execution after a shutdown
request, or the timeout occurs, or the current thread is
interrupted, whichever happens first.
|
boolean |
ForkJoinPool.awaitTermination(long timeout,
TimeUnit unit)
Blocks until all tasks have completed execution after a shutdown
request, or the timeout occurs, or the current thread is
interrupted, whichever happens first.
|
long |
TimeUnit.convert(long sourceDuration,
TimeUnit sourceUnit)
Convert the given time duration in the given unit to this
unit.
|
V |
Exchanger.exchange(V x,
long timeout,
TimeUnit unit)
Waits for another thread to arrive at this exchange point (unless
the current thread is interrupted or
the specified waiting time elapses), and then transfers the given
object to it, receiving its object in return.
|
V |
ForkJoinTask.get(long timeout,
TimeUnit unit)
Waits if necessary for at most the given time for the computation
to complete, and then retrieves its result, if available.
|
V |
FutureTask.get(long timeout,
TimeUnit unit) |
V |
Future.get(long timeout,
TimeUnit unit)
Waits if necessary for at most the given time for the computation
to complete, and then retrieves its result, if available.
|
long |
Delayed.getDelay(TimeUnit unit)
Returns the remaining delay associated with this object, in the
given time unit.
|
long |
ThreadPoolExecutor.getKeepAliveTime(TimeUnit unit)
Returns the thread keep-alive time, which is the amount of time
that threads in excess of the core pool size may remain
idle before being terminated.
|
<T> List<Future<T>> |
ExecutorService.invokeAll(Collection<? extends Callable<T>> tasks,
long timeout,
TimeUnit unit)
Executes the given tasks, returning a list of Futures holding
their status and results
when all complete or the timeout expires, whichever happens first.
|
<T> List<Future<T>> |
AbstractExecutorService.invokeAll(Collection<? extends Callable<T>> tasks,
long timeout,
TimeUnit unit) |
<T> T |
ExecutorService.invokeAny(Collection<? extends Callable<T>> tasks,
long timeout,
TimeUnit unit)
Executes the given tasks, returning the result
of one that has completed successfully (i.e., without throwing
an exception), if any do before the given timeout elapses.
|
<T> T |
AbstractExecutorService.invokeAny(Collection<? extends Callable<T>> tasks,
long timeout,
TimeUnit unit) |
boolean |
BlockingQueue.offer(E e,
long timeout,
TimeUnit unit)
Inserts the specified element into this queue, waiting up to the
specified wait time if necessary for space to become available.
|
boolean |
ArrayBlockingQueue.offer(E e,
long timeout,
TimeUnit unit)
Inserts the specified element at the tail of this queue, waiting
up to the specified wait time for space to become available if
the queue is full.
|
boolean |
BlockingDeque.offer(E e,
long timeout,
TimeUnit unit)
Inserts the specified element into the queue represented by this deque
(in other words, at the tail of this deque), waiting up to the
specified wait time if necessary for space to become available.
|
boolean |
DelayQueue.offer(E e,
long timeout,
TimeUnit unit)
Inserts the specified element into this delay queue.
|
boolean |
LinkedTransferQueue.offer(E e,
long timeout,
TimeUnit unit)
Inserts the specified element at the tail of this queue.
|
boolean |
LinkedBlockingDeque.offer(E e,
long timeout,
TimeUnit unit) |
boolean |
SynchronousQueue.offer(E o,
long timeout,
TimeUnit unit)
Inserts the specified element into this queue, waiting if necessary
up to the specified wait time for another thread to receive it.
|
boolean |
LinkedBlockingQueue.offer(E e,
long timeout,
TimeUnit unit)
Inserts the specified element at the tail of this queue, waiting if
necessary up to the specified wait time for space to become available.
|
boolean |
PriorityBlockingQueue.offer(E e,
long timeout,
TimeUnit unit)
Inserts the specified element into this priority queue.
|
boolean |
BlockingDeque.offerFirst(E e,
long timeout,
TimeUnit unit)
Inserts the specified element at the front of this deque,
waiting up to the specified wait time if necessary for space to
become available.
|
boolean |
LinkedBlockingDeque.offerFirst(E e,
long timeout,
TimeUnit unit) |
boolean |
BlockingDeque.offerLast(E e,
long timeout,
TimeUnit unit)
Inserts the specified element at the end of this deque,
waiting up to the specified wait time if necessary for space to
become available.
|
boolean |
LinkedBlockingDeque.offerLast(E e,
long timeout,
TimeUnit unit) |
E |
BlockingQueue.poll(long timeout,
TimeUnit unit)
Retrieves and removes the head of this queue, waiting up to the
specified wait time if necessary for an element to become available.
|
E |
ArrayBlockingQueue.poll(long timeout,
TimeUnit unit) |
E |
BlockingDeque.poll(long timeout,
TimeUnit unit)
Retrieves and removes the head of the queue represented by this deque
(in other words, the first element of this deque), waiting up to the
specified wait time if necessary for an element to become available.
|
E |
DelayQueue.poll(long timeout,
TimeUnit unit)
Retrieves and removes the head of this queue, waiting if necessary
until an element with an expired delay is available on this queue,
or the specified wait time expires.
|
E |
LinkedTransferQueue.poll(long timeout,
TimeUnit unit) |
E |
LinkedBlockingDeque.poll(long timeout,
TimeUnit unit) |
Future<V> |
ExecutorCompletionService.poll(long timeout,
TimeUnit unit) |
E |
SynchronousQueue.poll(long timeout,
TimeUnit unit)
Retrieves and removes the head of this queue, waiting
if necessary up to the specified wait time, for another thread
to insert it.
|
E |
LinkedBlockingQueue.poll(long timeout,
TimeUnit unit) |
E |
PriorityBlockingQueue.poll(long timeout,
TimeUnit unit) |
Future<V> |
CompletionService.poll(long timeout,
TimeUnit unit)
Retrieves and removes the Future representing the next
completed task, waiting if necessary up to the specified wait
time if none are yet present.
|
E |
BlockingDeque.pollFirst(long timeout,
TimeUnit unit)
Retrieves and removes the first element of this deque, waiting
up to the specified wait time if necessary for an element to
become available.
|
E |
LinkedBlockingDeque.pollFirst(long timeout,
TimeUnit unit) |
E |
BlockingDeque.pollLast(long timeout,
TimeUnit unit)
Retrieves and removes the last element of this deque, waiting
up to the specified wait time if necessary for an element to
become available.
|
E |
LinkedBlockingDeque.pollLast(long timeout,
TimeUnit unit) |
<V> ScheduledFuture<V> |
ScheduledThreadPoolExecutor.schedule(Callable<V> callable,
long delay,
TimeUnit unit) |
<V> ScheduledFuture<V> |
ScheduledExecutorService.schedule(Callable<V> callable,
long delay,
TimeUnit unit)
Creates and executes a ScheduledFuture that becomes enabled after the
given delay.
|
ScheduledFuture<?> |
ScheduledThreadPoolExecutor.schedule(Runnable command,
long delay,
TimeUnit unit) |
ScheduledFuture<?> |
ScheduledExecutorService.schedule(Runnable command,
long delay,
TimeUnit unit)
Creates and executes a one-shot action that becomes enabled
after the given delay.
|
ScheduledFuture<?> |
ScheduledThreadPoolExecutor.scheduleAtFixedRate(Runnable command,
long initialDelay,
long period,
TimeUnit unit) |
ScheduledFuture<?> |
ScheduledExecutorService.scheduleAtFixedRate(Runnable command,
long initialDelay,
long period,
TimeUnit unit)
Creates and executes a periodic action that becomes enabled first
after the given initial delay, and subsequently with the given
period; that is executions will commence after
initialDelay then initialDelay+period, then
initialDelay + 2 * period, and so on.
|
ScheduledFuture<?> |
ScheduledThreadPoolExecutor.scheduleWithFixedDelay(Runnable command,
long initialDelay,
long delay,
TimeUnit unit) |
ScheduledFuture<?> |
ScheduledExecutorService.scheduleWithFixedDelay(Runnable command,
long initialDelay,
long delay,
TimeUnit unit)
Creates and executes a periodic action that becomes enabled first
after the given initial delay, and subsequently with the
given delay between the termination of one execution and the
commencement of the next.
|
void |
ThreadPoolExecutor.setKeepAliveTime(long time,
TimeUnit unit)
Sets the time limit for which threads may remain idle before
being terminated.
|
boolean |
Semaphore.tryAcquire(int permits,
long timeout,
TimeUnit unit)
Acquires the given number of permits from this semaphore, if all
become available within the given waiting time and the current
thread has not been interrupted.
|
boolean |
Semaphore.tryAcquire(long timeout,
TimeUnit unit)
Acquires a permit from this semaphore, if one becomes available
within the given waiting time and the current thread has not
been interrupted.
|
boolean |
TransferQueue.tryTransfer(E e,
long timeout,
TimeUnit unit)
Transfers the element to a consumer if it is possible to do so
before the timeout elapses.
|
boolean |
LinkedTransferQueue.tryTransfer(E e,
long timeout,
TimeUnit unit)
Transfers the element to a consumer if it is possible to do so
before the timeout elapses.
|
| Constructor and Description |
|---|
ThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
TimeUnit unit,
BlockingQueue<Runnable> workQueue)
Creates a new
ThreadPoolExecutor with the given initial
parameters and default thread factory and rejected execution handler. |
ThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
TimeUnit unit,
BlockingQueue<Runnable> workQueue,
RejectedExecutionHandler handler)
Creates a new
ThreadPoolExecutor with the given initial
parameters and default thread factory. |
ThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
TimeUnit unit,
BlockingQueue<Runnable> workQueue,
ThreadFactory threadFactory)
Creates a new
ThreadPoolExecutor with the given initial
parameters and default rejected execution handler. |
ThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
TimeUnit unit,
BlockingQueue<Runnable> workQueue,
ThreadFactory threadFactory,
RejectedExecutionHandler handler)
Creates a new
ThreadPoolExecutor with the given initial
parameters. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
Condition.await(long time,
TimeUnit unit)
Causes the current thread to wait until it is signalled or interrupted,
or the specified waiting time elapses.
|
boolean |
AbstractQueuedLongSynchronizer.ConditionObject.await(long time,
TimeUnit unit)
Implements timed condition wait.
|
boolean |
AbstractQueuedSynchronizer.ConditionObject.await(long time,
TimeUnit unit)
Implements timed condition wait.
|
boolean |
ReentrantLock.tryLock(long timeout,
TimeUnit unit)
Acquires the lock if it is not held by another thread within the given
waiting time and the current thread has not been
interrupted.
|
boolean |
ReentrantReadWriteLock.ReadLock.tryLock(long timeout,
TimeUnit unit)
Acquires the read lock if the write lock is not held by
another thread within the given waiting time and the
current thread has not been interrupted.
|
boolean |
ReentrantReadWriteLock.WriteLock.tryLock(long timeout,
TimeUnit unit)
Acquires the write lock if it is not held by another thread
within the given waiting time and the current thread has
not been interrupted.
|
boolean |
Lock.tryLock(long time,
TimeUnit unit)
Acquires the lock if it is free within the given waiting time and the
current thread has not been interrupted.
|
| Modifier and Type | Method and Description |
|---|---|
T |
SwingWorker.get(long timeout,
TimeUnit unit)
Waits if necessary for at most the given time for the computation
to complete, and then retrieves its result, if available.
|
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2015, Oracle and/or its affiliates. All rights reserved.


Jurgen Klopp met with Manchester United before joing Liverpool
by Thom MaloneJurgen Klopp had meetings with the Manchester United hierarchy before declining the opportunity to succeed David Moyes at Old Trafford.
The Sun have reported today that the German manager met three times with executive vice-chairman Ed Woodward in the wake of Moyes being sacked.
Ed Woodward believed, according to a source close to the club, that Klopp was interested and Manchester United would land one of the hottest properties in world football.
Woodward and the Red Devils were in turmoil at the time with the Moyes project having clearly failed, and Ryan Giggs in temporary charge for the last few games of the season.
The executive-vice chairman needed a big name to try to fill the void left by Ferguson after Sir Alex's anointed successor had not worked out.
Contact
An anonymous source close to the Manchester club told the Sun: "Ed thought Klopp was the right man for the job. Jurgen seemed really interested and the conversations were quite intense.
"It got to the point where there was direct contact between Ed and Dortmund's chief executive Hans-Joachim Watzke.
"Ed thought he had Klopp and that he was going to come.
"But right at the end, he changed his mind and felt he owed it to Dortmund to stay for at least one more year."
Klopp did but announced hwe was leaving in April 2015, freeing himself to joim Liverpool in that summer.
"Ed had to go back to the drawing board and appoint Louis van Gaal." said the anonymous source.
The situation will leave Manchester United fans lamenting what might have been. Van Gaal and Mourinho did land an FA Cup, League Cup and Europa League between them.
Ole Gunnar Solskjaer's side currently sit seventh in the Premier League 18 points off the top.
Meanwhile, Liverpool fans are dreaming about a first league title since 1990 as reigning European Champions.


Chanelle Hayes debuts darker locks and sleek new look as she celebrates weight loss
The 32-year-old debuted her darker locks on Instagram as she continues to slim down
by Mirror.co.ukShe is super proud after dropping two dress sizes - and it appears Chanelle Hayes quest for glamour hasn't ended there as she debuted a super sleek look on Istagram.
Showing off her extra glamorous look to her 100k Instagram follows Chanelle had added some dark brows and flattering blush nude lipstick.
Her darker locks perfectly complemented her sassy new look as she pledged to up her vitamin intake with a new pack of Feel multiviatmins.
Sharing her new haircut and colour on Instagram Chanelle wrote: "I’m staying brunette for a while but my end goal over the next few years is to go gingery-red-auburn."
Fans loved her new look, with one gushing on Instagram: "You’re one of these lucky people who suit both light and dark hair. It looks beautiful!"
Another added: "WOW........you look amazing, the hair is gorg & colour is lovely too."
The Instagram sensation recently updated her fans about her weight loss and she gushed it had given her "confidence" as well as "happiness".
Chanelle did admit she had been putting in a lot of hard work to maintain her fitness levels.
"In losing all that excess weight I have gained more confidence and happiness," she wrote.
"If I had been EXTREME with my eating choices I am sure I could be much smaller and lighter than I am now however I have been working HARDDDD at keeping (and increasing) my muscle mass.
 I want to make a point that I am choosing to take my time in order to keep my muscle."
Chanelle made a promise to herself to lose weight when Ryan Oates broke her heart in November two years ago in 2017.
Her ex walked out on her just weeks after she gave birth to her second child Frankie.
Chanelle also has a son Blakely from a previous romance with Matthew Bates.
The CBB star has struggled with her weight while she has been in the limelight as she has yo-yoed between a size 20 and a size eight.


Test Driven Development
Imagine you are building a plane, how would you know it can fly? Well, you test it. But if I’m building something as elaborate and expensive as a plane, I would be putting loads of time and resources into building something just to see it crash and burn. There has to be a way to test it before and during the building process so that we know our efforts are not wasted into creating a failure. This is where Test-Driven-Development comes into play. TDD is a method of software development that relies on tests being written before any actual programming is done. Some languages even include their own testing frameworks, like rspec for Ruby. But by writing specific tests for all foreseeable cases, we can see how it will fail and where.
The true greatness of TDD is in that it allows for a strong foundation for future code development, especially when introducing new features or just refactoring. The tests you write from the start will notify you if any changes made will break something.
Debugging also relies heavily on test driven development. By replicating the issue with tests, we can make changes accordingly until the desired conditions are met.
Some drawbacks of test driven development include missing cases. If I can’t write tests that account for each and every possible outcome, then our code is sure to break somewhere and catch us by surprise. Another issue is creating false positives. I could write a test that spits out true but doesn’t accurately reflect what our code is performing. This also brings up the necessity of making tests more than just boolean, or results of true and false. The trick is to write tests that let you know exactly what passed and tell you what didn’t pass if not. This way we can pinpoint issues and troubleshoot much more efficiently.
So, back to our example. I’m building plane and I put something together and try to fly it. Imagine the plane telling you; “Hey, I won’t fly because I don't have wings.” Well, of course our next move would be to add wings. So, we test it again. But it doesn’t fly. “Hey, I won’t fly because I don’t have an engine.” So, we add the engine. And this goes on and on until the all tests pass and the plane flys. Taking this approach really does make for some efficiently designed code and makes our job as developers much simpler.
Here is an example of a boiler plate test that I use in ruby pretty frequently:
def assert(actual, expected, message) if actual == expected puts message else raise “Assertion Failed on #{message}” end end assert( foo , bar , “flight test”)
posted Sep. 28th, 2014


--- layout: post categories: [] date: 2012-03-16T14:23:23Z status: publish tags: [] title: Happy birthday Joy layout: post url: /2012/03/16/happy-birthday-joy/ ---


{% include uipath-head.html %}
{% include uipath-header.html %} {{ content }} {% include uipath-footer.html %}


This directory has examples of the Intel TBB Flow Graph feature.
queue_node
, a buffer_node
and function_nodes
.
Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and/or other countries.
* Other names and brands may be claimed as the property of others.
© 2016, Intel Corporation