Guava is a library developed by Google that includes common libraries useful for Java projects. It contains functionality for strings, collections, caching, parallel programming, primitives, and more. Some key features include immutable collections, functional idioms, caching, and an event bus. The goals of Guava are to be intuitive, encourage best practices, and avoid reinventing existing solutions.
Functional programming is all the rage. It can undoubtedly produce cleaner and more expressive code, but why switch to Scala or wait for Java 8? In fact, there are many ways to dramatically improve your Java code quality by using a more functional style today. This presentation discusses how techniques such as functional programming, using fluent APIs, and other clean coding practices can make your code more concise, more readable, and much easier to maintain. But more importantly, you will learn about libraries such as LambdaJ and Google Guava that make this possible today with your existing Java code base.
PyCon NZ 2013 - Advanced Methods For Creating DecoratorsGraham Dumpleton
Decorators are a simple concept, yet extremely powerful. Implementing decorators which will work in a range of contexts is however non trivial. This talk will walk through various problems which arise with the more common ways of implementing decorators and then describe how to combine a wrapper and a descriptor to build a better decorator.
Functional programming is all the rage. It can undoubtedly produce cleaner and more expressive code, but why switch to Scala or wait for Java 8? In fact, there are many ways to dramatically improve your Java code quality by using a more functional style today. This presentation discusses how techniques such as functional programming, using fluent APIs, and other clean coding practices can make your code more concise, more readable, and much easier to maintain. But more importantly, you will learn about libraries such as LambdaJ and Google Guava that make this possible today with your existing Java code base.
PyCon NZ 2013 - Advanced Methods For Creating DecoratorsGraham Dumpleton
Decorators are a simple concept, yet extremely powerful. Implementing decorators which will work in a range of contexts is however non trivial. This talk will walk through various problems which arise with the more common ways of implementing decorators and then describe how to combine a wrapper and a descriptor to build a better decorator.
Use PEG to Write a Programming Language ParserYodalee
PEG is a replacement to CFG. It is more powerful and can be more precise. In this slide I give a short introduction to PEG, the concept behind a programming language. Finally I write a parser for our programming language simple.
A presentation that tries to introduce some functional programming's core concepts in a more digestible way. It tries to stay away from all the complicated lingo and math, so the average developer can start his adventures through the dangerous but beautiful realms of functional programming.
Textbook Solutions refer https://pythonxiisolutions.blogspot.com/
Practical's Solutions refer https://prippython12.blogspot.com/
It is difficult to manage a single list of instructions. Thus large program are broken down into smaller units known as functions. Functions can be invoked from other parts of the program. it make program more readable and understandable making program easy to manage.
This is a short introduction to one of the newest and noisiest additions to the functional family. Chances are you have heard about Elixir before: created six years ago by José Valim, it has emerged rapidly in the Erlang ecosystem, attracting lots of attention. But what's so special about it? What's all the fuzz about? This talk will offer you a few selected sips for you to get a taste... but beware! You may want to drink all the bottle: if so, you may end up following the white rabbit down the hole and wake up in the Erlang wonderland.
This is to test a balanced tree. I need help testing an unbalanced t.pdfakaluza07
this is business analytics question. (using gurobi) The days-off scheduling problem must be
solved routinely by businesses that operate 6 or 7 days a week. Examples include hospitals,
airlines, municipal transportation companies, and the postal service. The most common example
is the (5,7)-cyclic staffing problem. The objective of it is to minimize the cost of assigning
workers to a 7-day cyclic schedule so that 1) Sufficient workers are available every day. 2) Each
person works 5 consecutive days and is idle to the remaining 2 days. Here is the table showing
the cost of having an employee for each day and the number of employees required for each day.
For example, the pattern that one works from Sunday to Thursday costs 90+604=330. Formulate
and solve an integer programming problem to represent this problem. How many employees
work Monday-Friday?.
Use PEG to Write a Programming Language ParserYodalee
PEG is a replacement to CFG. It is more powerful and can be more precise. In this slide I give a short introduction to PEG, the concept behind a programming language. Finally I write a parser for our programming language simple.
A presentation that tries to introduce some functional programming's core concepts in a more digestible way. It tries to stay away from all the complicated lingo and math, so the average developer can start his adventures through the dangerous but beautiful realms of functional programming.
Textbook Solutions refer https://pythonxiisolutions.blogspot.com/
Practical's Solutions refer https://prippython12.blogspot.com/
It is difficult to manage a single list of instructions. Thus large program are broken down into smaller units known as functions. Functions can be invoked from other parts of the program. it make program more readable and understandable making program easy to manage.
This is a short introduction to one of the newest and noisiest additions to the functional family. Chances are you have heard about Elixir before: created six years ago by José Valim, it has emerged rapidly in the Erlang ecosystem, attracting lots of attention. But what's so special about it? What's all the fuzz about? This talk will offer you a few selected sips for you to get a taste... but beware! You may want to drink all the bottle: if so, you may end up following the white rabbit down the hole and wake up in the Erlang wonderland.
This is to test a balanced tree. I need help testing an unbalanced t.pdfakaluza07
this is business analytics question. (using gurobi) The days-off scheduling problem must be
solved routinely by businesses that operate 6 or 7 days a week. Examples include hospitals,
airlines, municipal transportation companies, and the postal service. The most common example
is the (5,7)-cyclic staffing problem. The objective of it is to minimize the cost of assigning
workers to a 7-day cyclic schedule so that 1) Sufficient workers are available every day. 2) Each
person works 5 consecutive days and is idle to the remaining 2 days. Here is the table showing
the cost of having an employee for each day and the number of employees required for each day.
For example, the pattern that one works from Sunday to Thursday costs 90+604=330. Formulate
and solve an integer programming problem to represent this problem. How many employees
work Monday-Friday?.
Laziness, trampolines, monoids and other functional amenities: this is not yo...Codemotion
by Mario Fusco - Lambdas are the main feature introduced with Java 8, but the biggest part of Java developers are still not very familliar with the most common functional idioms and patterns. The purpose of this talk is presenting with practical examples concepts like high-order functions, currying, functions composition, persistent data structures, lazy evaluation, recursion, trampolines and monoids showing how to implement them in Java and how thinking functionally can help us to design and develop more readable, reusable, performant, parallelizable and in a word better, code.
For problems 3 and 4, consider the following functions that implemen.pdfanjandavid
For problems 3 and 4, consider the following functions that implement the dequeue operation for
a priority queue that is implemented with a heap.
int[] pQueue;
int length;
int dequeue()
{
int node = 1;
int value = pQueue[--length];
int maxValue = pQueue[node];
int location = sift(node * 2, value);
pQueue[location] = value;
return maxValue;
}
int sift(int node, int value)
{
if (node <= length)
{
if (node < length && pQueue[node] < pQueue[node + 1]) node++;
if (value < pQueue[node])
{
pQueue[node / 2] = pQueue[node];
return sift(node * 2, value);
}
}
return node / 2;
}
3. Write the recurrence equation and initial conditions that expresses the execution time cost for
the sift function in the above algorithm. Draw the recursion tree assuming that n = 8. Assume
that n represents the number of nodes in the subtree at each step of the sifting operation.
4. Determine the critical exponent for the recurrence equation in problem 3. Apply the Little
Master Theorem to solve that equation specifically stating which part of the theorem is applied to
arrive at the solution.
Solution
using System.Collections;
using System.Collections.Generic;
namespace PriorityQueueDemo
{
///
/// Priority queue based on binary heap in program,
/// Elements with minimum priority dequeued first in program
///
/// Type of priorities
/// Type of values
public class PriorityQueues : ICollection>
{
private List> _baseHeap;
private IComparer _comparers;
#region Constructor
///
/// Initializes a new instance of priority queue with default initial capacity and default
priority comparer in program
///
public PriorityQueues()
: this(Comparers.Default)
{
}
///
/// Initializes a new instance of priority queue with specified initial capacity and default
priority comparer in program
///
/// initial capacity
public PriorityQueues(int capacity)
: this(capacity, Comparers.Default)
{
}
///
/// Initializes a new instance of priority queue with specified initial capacity and specified
priority comparer in program
///
/// initial capacity
/// priority comparer
public PriorityQueues(int capacity, IComparers comparer)
{
if (comparer == null)
throw new ArgumentNullException();
_baseHeaps = new List>(capacity);
_comparers= comparer;
}
///
/// Initializes a new instance of priority queue with default initial capacity and specified
priority comparer in program
///
/// priority comparer
public PriorityQueues(IComparer comparers)
{
if (comparers == null)
throw new ArgumentNullException();
_baseHeap = new List>();
_comparer = comparers;
}
///
/// Initializes a new instance of priority queue with specified data and default priority
comparer in program
///
/// data to be inserted into priority queue in program
public PriorityQueues(IEnumerable> data)
: this(data, Comparers.Default)
{
}
///
/// Initializes a new instance of priority queue with specified data and specified priority
comparer in program
///
/// data to be inserted into priority queue
/// priority comparer in program
public PriorityQueue(IEnumer.
Курс "Программирование на Java". Лекция 04 "Обобщения и лямбды".
Массивы. Механизм обобщений (Generics), надтипы и подтипы (supertypes and subtypes). Лямбда-функции, функциональные интерфейсы. Пакет java.util.collections, списки (Lists), множества (Sets), словари (Maps), итераторы (Iterators and Iterables). Иерархия коллекций.
МФТИ, 2016 год. Лектор - Лаврентьев Федор Сергеевич
Given below is the completed implementation of MyLinkedList class. O.pdfinfo430661
Given below is the completed implementation of MyLinkedList class. Other classes are not
modified and remain same as in question - MyList, MyAbstractList, TestMyLinkedList.
The output of TestMyLinkedList is shown below. Please don\'t forget to rate the answer if it
helped. Thank you very much.
Since the MyList is not completely pasted in the question ... giving the complete class file below
MyList.java
public interface MyList> extends java.lang.Iterable
{
// Add a new element at the end of this list
public void add (E e);
// Add a new element at specified index in this list
public void add (int index, E e);
// Return true if this list contains the element
public boolean contains (E e);
// Return the element at the specified index
public E get (int index);
// Return the index of the first matching element
// Return -1 if no match.
public int indexOf (E e);
// Return the index of the last matching element
// Return -1 if no match.
public int lastIndexOf (E e);
E remove(int index);
void clear();
E set(int index, E e);
}
MyLinkedList.java
public class MyLinkedList> extends MyAbstractList
implements Comparable>
{
private Node head, tail; // head and tail pointers
// Create a default list
public MyLinkedList()
{
}
public int size()
{
return size;
}
// Need this for implementing Comparable
public int compareTo (MyLinkedList e)
{
return(size() - e.size());
}
// Create a list from an array of objects
public MyLinkedList (E[] objects)
{
super(objects); // Passes the array up to abstract parent
}
// Return the head element in the list
public E getFirst()
{
if (size == 0)
{
return null;
}
else
{
return head.element;
}
}
// Return the last element in the list
public E getLast()
{
if (size == 0)
{
return null;
}
else
{
return tail.element;
}
}
// Add an element to the beginning of the list
public void addFirst (E e)
{
// Create a new node for element e
Node newNode = new Node(e);
newNode.next = head; // link the new node with the head
head = newNode; // head points to the new node
size++; // Increase list size
if (tail == null) // new node is only node
{
tail = head;
}
}
// Add an element to the end of the list
public void addLast (E e)
{
// Create a new node for element e
Node newNode = new Node(e);
if (tail == null)
{
head = tail = newNode; // new node is only node
}
else
{
tail.next = newNode; // Link the new with the last node
tail = tail.next; // tail now points to the last node
}
size++; // Increase size
}
// Remove the head node and
// return the object from the removed node
public E removeFirst()
{
if (size == 0)
{
return null;
}
else
{
Node temp = head;
head = head.next;
size--;
if (head == null)
{
tail = null;
}
return temp.element;
}
}
// Remove the last node and return the object from it
public E removeLast()
{
if (size == 0)
{
return null;
}
else if (size == 1)
{
Node temp = head;
head = tail = null;
size = 0;
return temp.element;
}
else
{
Node current = head;
for (int i = 0; i < size - 2; i++)
{
current = current.next;
}
Node temp = tail;
tai.
import java.util.Iterator; import java.util.NoSuchElementException; /** * An implementation
of MyList with a linked list (a longer exercise would be to * implement the List interface as is
done in the class java.util.LinkedList: * the source of the LinkedList class is available from Sun.
Check it out). */ public class MyLinkedList implements MyList { // A private class to
represent a Node in the linked list private class Node { public E item;
public Node next; // a convenient constructor public Node(E o) {
this.item = o; this.next = null; } } // The start of the linked
list private Node head; // The last Node in the linked list private Node tail;
// Number of elements in the list private int size; /** * Creates an empty list (this
constructor is not necessary) */ public MyLinkedList() { } /** *
Returns the number of elements in this list. */ public int size() { return size;
} /** * Returns true if this list contains no elements. */ public boolean
isEmpty() { return size == 0; } /** * Appends the specified element to
the end of this list */ public boolean add(E o) { Node n = new Node(o);
// If this is the first element in the list if (head == null) { head = n;
} else { // If the list is not empty, use tail tail.next = n;
} // update tail tail = n; // update size size++;
return true; } /** * Empties this List */ public void clear() {
// update head, tail and size head = tail = null; size = 0; } /**
* Returns the element at the specified position in this list. */ public E get(int index) {
if (index < 0 || index >= size) { throw new
IndexOutOfBoundsException(\"index = \" + index); } // Find it
Node n = head; for (int i = 0; i < index; i++) { n = n.next; }
return n.item; } /** * Returns the index of the specified element (-1 if
there is no match) */ public int indexOf(Object o) { // If o is null
int index = 0; Node p = head; if (o == null) // look for a null element in the
list { while (p != null) { if (p.item == null) {
return index; } index++;
p = p.next; } } else // o is an object (use equals) {
while (p != null) { if (o.equals(p.item)) { return
index; } index++; p = p.next;
} } // if we get here, o is not in the list return -1; }
/** * Returns true if this list contains the specified element. */ public boolean
contains(Object o) { // easy with indexOf return indexOf(o) != -1; }
/** * Removes the element in the List at position index */ public boolean
remove(int index) { if (index < 0 || index >= size) { throw new
IndexOutOfBoundsException(\"index = \" + index); } // Find the
corresponding node Node prev = null, p = head; for (int i = 0; i < index; i++)
{ prev = p; p = p.next; } // Remove it
// Special case for the first node if (p == head) { head = head.next;
} else { prev.next = p.next; } // If the last node has been
removed, update tail if (p == tail) { tail = prev; } //
update size size--; return true; } /** * Removes the element
in the List at position index */ public boolean remove(Object o) { // easy
with indexOf and remove int index = i.
Slides from my talk at the Junction (Jan 24, 2013)
Single-core performance has hit a ceiling, and building web-scale multi-core applications using imperative programming models is nightmarishly difficult. Parallel programming creates a new set of challenges, best practices and design patterns. Scala is designed to enable building scalable systems, elegantly blending functional and object oriented paradigms into an expressive and concise language, while retaining interoperability with Java. Scala is the fastest growing JVM programming language, being rapidly adopted by leading companies such as Twitter, LinkedIn and FourSquare.
This presentation provides a comprehensive overview of the language, which managed to increase type safety while feeling more dynamic, being more concise and improving readability at the same time. We will see how Scala simplifies real life problems by empowering the developer with powerful functional programming primitives, without giving up on the object oriented paradigm. The overview includes tools for multi-core programming in Scala, the type system, collection framework and domain-specific languages. We’ll explore the power of compile-time meta-programming, which is made possible by the newly released Scala 2.10, and get a glimpse into what to expect from 2.11 in 2014.
We will also see how Scala helps overcome the inherent limitations of Java, such as type erasure, array covariance and boxing overhead.
Multiple examples emphasize how Scala pushes the JVM harder than any other mainstream language through the infinite number of boilerplate busters, increased type safety and productivity boosters from a Java developer’s perspective.
For the code below complete the preOrder() method so that it perform.pdfxlynettalampleyxc
For the code below complete the preOrder() method so that it performs a preOrder traversal of
the tree. For each node it traverses, it should call sb.append() to add a \"[\" the results of
traversing the subtree rooted at that node, and then a \"]\". You should add a space before the
results of the left and right child traversals, but only if the node exists.
code:
Solution
In preorder Nodes visited are in the order of
code:
package edu.buffalo.cse116;
import java.util.AbstractSet;
import java.util.Iterator;
public class BinarySearchTree> extends AbstractSet {
protected Entry root;
protected int size;
/**
* Initializes this BinarySearchTree object to be empty, to contain only
* elements of type E, to be ordered by the Comparable interface, and to
* contain no duplicate elements.
*/
public BinarySearchTree() {
root = null;
size = 0;
}
/**
* Initializes this BinarySearchTree object to contain a shallow copy of a
* specified BinarySearchTree object. The worstTime(n) is O(n), where n is the
* number of elements in the specified BinarySearchTree object.
*
* @param otherTree - the specified BinarySearchTree object that this
* BinarySearchTree object will be assigned a shallow copy of.
*/
public BinarySearchTree(BinarySearchTree otherTree) {
root = copy(otherTree.root, null);
size = otherTree.size;
}
/* Method to complete is here! */
public void preOrder(Entry ent, StringBuilder sb) {
preorder(root)
protected Entry copy(Entry p, Entry parent) {
if (p != null) {
Entry q = new Entry(p.element, parent);
q.left = copy(p.left, q);
q.right = copy(p.right, q);
return q;
}
return null;
} // method copy
@SuppressWarnings(\"unchecked\")
@Override
public boolean equals(Object obj) {
if (!(obj instanceof BinarySearchTree)) {
return false;
}
return equals(root, ((BinarySearchTree) obj).root);
}
public boolean equals(Entry p, Entry q) {
if ((p == null) || (q == null)) {
return p == q;
}
if (!p.element.equals(q.element)) {
return false;
}
if (equals(p.left, q.left) && equals(p.right, q.right)) {
return true;
}
return false;
}
/**
* Returns the size of this BinarySearchTree object.
*
* @return the size of this BinarySearchTree object.
*/
@Override
public int size() {
return size;
}
/**
* Iterator method will be implemented for a future
*
* @return an iterator positioned at the smallest element in this
* BinarySearchTree object.
*/
@Override
public Iterator iterator() {
throw new UnsupportedOperationException(\"Not implemented yet!\");
}
/**
* Determines if there is at least one element in this BinarySearchTree object
* that equals a specified element. The worstTime(n) is O(n) and
* averageTime(n) is O(log n).
*
* @param obj - the element sought in this BinarySearchTree object.
* @return true - if there is an element in this BinarySearchTree object that
* equals obj; otherwise, return false.
* @throws ClassCastException - if obj cannot be compared to the elements in
* this BinarySearchTree object.
* @throws NullPointerException - if obj is null.
*/
@Override
public .
Here is the editable codeSolutionimport java.util.NoSuchEleme.pdfarrowmobile
Here is the editable code:
Solution
import java.util.NoSuchElementException;
public class DoublyLinkedListImpl {
private Node head;
private Node tail;
private int size;
public DoublyLinkedListImpl() {
size = 0;
}
private class Node {
E element;
Node next;
Node prev;
public Node(E element, Node next, Node prev) {
this.element = element;
this.next = next;
this.prev = prev;
}
}
public int size() { return size; }
public boolean isEmpty() { return size == 0; }
public void addFirst(E element) {
Node tmp = new Node(element, head, null);
if(head != null ) {head.prev = tmp;}
head = tmp;
if(tail == null) { tail = tmp;}
size++;
System.out.println(\"adding: \"+element);
}
/**
* adds element at the end of the linked list
* @param element
*/
public void addLast(E element) {
Node tmp = new Node(element, null, tail);
if(tail != null) {tail.next = tmp;}
tail = tmp;
if(head == null) { head = tmp;}
size++;
System.out.println(\"adding: \"+element);
}
public void iterateForward(){
System.out.println(\"iterating forward..\");
Node tmp = head;
while(tmp != null){
System.out.println(tmp.element);
tmp = tmp.next;
}
}
/**
* this method walks backward through the linked list
*/
public void iterateBackward(){
System.out.println(\"iterating backword..\");
Node tmp = tail;
while(tmp != null){
System.out.println(tmp.element);
tmp = tmp.prev;
}
}
public E removeFirst() {
if (size == 0) throw new NoSuchElementException();
Node tmp = head;
head = head.next;
head.prev = null;
size--;
System.out.println(\"deleted: \"+tmp.element);
return tmp.element;
}
public E removeLast() {
if (size == 0) throw new NoSuchElementException();
Node tmp = tail;
tail = tail.prev;
tail.next = null;
size--;
System.out.println(\"deleted: \"+tmp.element);
return tmp.element;
}
public static void main(String a[]){
DoublyLinkedListImpl dll = new DoublyLinkedListImpl();
dll.addFirst(10);
dll.addFirst(34);
dll.addLast(56);
dll.addLast(364);
dll.iterateForward();
dll.removeFirst();
dll.removeLast();
dll.iterateBackward();
}
}
import java.util.Scanner;
/* Class Node */
class Node
{
protected int data;
protected Node next, prev;
/* Constructor */
public Node()
{
next = null;
prev = null;
data = 0;
}
/* Constructor */
public Node(int d, Node n, Node p)
{
data = d;
next = n;
prev = p;
}
/* Function to set link to next node */
public void setLinkNext(Node n)
{
next = n;
}
/* Function to set link to previous node */
public void setLinkPrev(Node p)
{
prev = p;
}
/* Funtion to get link to next node */
public Node getLinkNext()
{
return next;
}
/* Function to get link to previous node */
public Node getLinkPrev()
{
return prev;
}
/* Function to set data to node */
public void setData(int d)
{
data = d;
}
/* Function to get data from node */
public int getData()
{
return data;
}
}
/* Class linkedList */
class linkedList
{
protected Node start;
protected Node end ;
public int size;
/* Constructor */
public linkedList()
{
start = null;
end = null;
size = 0;
}
/* Function to check if list is empty */
public boolean isE.
"Java 8, Lambda e la programmazione funzionale" by Theodor DumitrescuThinkOpen
Theodor Dumitrescu racconta perché si sente sempre più spesso parlare di programmazione funzionale e perché soprattutto in presenza del termine “lambda”.
Scala is becoming the language of choice for many development teams. This talk highlights how Scala excels in the world of multi-core processing and explores how it compares to Java 8.
Video Presentation: http://youtu.be/8vxTowBXJSg
This talk is an introduction about technical aspects of how payment cards function, what technical protocols are involved and what are implementation complexities in a typical payments project. You will learn about concepts like Authorisation and Clearing, Tokenization and know about novelties in the payment world, which will affect consumers in the nearest future.
Как построить свой фреймворк для автотестов?Dmitry Buzdin
Мы пройдемся по всем основным блокам построения тестового фреймворка и тому, как они связаны между собой. Вы научитесь собирать свое решение по автоматизации из библиотек с открытым кодом и делать так, чтобы они дополняли друг друга.
Microservices created quite a buzz in software development. Those are finally being adopted, and a lot of project suffer from that... microservices bring a lot of infrastructure and distributed programming complexity not all organisations can cope with. Question is – is it possible to gradually migrate to microservices architecture without Big Bang/Rewrite From Scratch approach? I would say it is possible, and is a much better idea compared to installing Kubernetes on AWS on day one. This talk is based on practical experience of architecting business applications to scale out and grow up to become micro services one day.
How to Build Your Own Test Automation Framework?Dmitry Buzdin
Even though there are plenty of open source tools on the market every company needs to put them together and create a test automation framework on top. Best practices of doing that are quite well-known in industry and it is important to learn them before building your own framework. We will go through the core building blocks of test automation frameworks and how they are playing together. You will learn how to assemble your test automation toolchain out of open source libraries and how to integrate them together. The session will be heavily biased towards Java platform.
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfPeter Spielvogel
Building better applications for business users with SAP Fiori.
• What is SAP Fiori and why it matters to you
• How a better user experience drives measurable business benefits
• How to get started with SAP Fiori today
• How SAP Fiori elements accelerates application development
• How SAP Build Code includes SAP Fiori tools and other generative artificial intelligence capabilities
• How SAP Fiori paves the way for using AI in SAP apps
Pushing the limits of ePRTC: 100ns holdover for 100 daysAdtran
At WSTS 2024, Alon Stern explored the topic of parametric holdover and explained how recent research findings can be implemented in real-world PNT networks to achieve 100 nanoseconds of accuracy for up to 100 days.
Removing Uninteresting Bytes in Software FuzzingAftab Hussain
Imagine a world where software fuzzing, the process of mutating bytes in test seeds to uncover hidden and erroneous program behaviors, becomes faster and more effective. A lot depends on the initial seeds, which can significantly dictate the trajectory of a fuzzing campaign, particularly in terms of how long it takes to uncover interesting behaviour in your code. We introduce DIAR, a technique designed to speedup fuzzing campaigns by pinpointing and eliminating those uninteresting bytes in the seeds. Picture this: instead of wasting valuable resources on meaningless mutations in large, bloated seeds, DIAR removes the unnecessary bytes, streamlining the entire process.
In this work, we equipped AFL, a popular fuzzer, with DIAR and examined two critical Linux libraries -- Libxml's xmllint, a tool for parsing xml documents, and Binutil's readelf, an essential debugging and security analysis command-line tool used to display detailed information about ELF (Executable and Linkable Format). Our preliminary results show that AFL+DIAR does not only discover new paths more quickly but also achieves higher coverage overall. This work thus showcases how starting with lean and optimized seeds can lead to faster, more comprehensive fuzzing campaigns -- and DIAR helps you find such seeds.
- These are slides of the talk given at IEEE International Conference on Software Testing Verification and Validation Workshop, ICSTW 2022.
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
Climate Impact of Software Testing at Nordic Testing DaysKari Kakkonen
My slides at Nordic Testing Days 6.6.2024
Climate impact / sustainability of software testing discussed on the talk. ICT and testing must carry their part of global responsibility to help with the climat warming. We can minimize the carbon footprint but we can also have a carbon handprint, a positive impact on the climate. Quality characteristics can be added with sustainability, and then measured continuously. Test environments can be used less, and in smaller scale and on demand. Test techniques can be used in optimizing or minimizing number of tests. Test automation can be used to speed up testing.
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
A tale of scale & speed: How the US Navy is enabling software delivery from l...sonjaschweigert1
Rapid and secure feature delivery is a goal across every application team and every branch of the DoD. The Navy’s DevSecOps platform, Party Barge, has achieved:
- Reduction in onboarding time from 5 weeks to 1 day
- Improved developer experience and productivity through actionable findings and reduction of false positives
- Maintenance of superior security standards and inherent policy enforcement with Authorization to Operate (ATO)
Development teams can ship efficiently and ensure applications are cyber ready for Navy Authorizing Officials (AOs). In this webinar, Sigma Defense and Anchore will give attendees a look behind the scenes and demo secure pipeline automation and security artifacts that speed up application ATO and time to production.
We will cover:
- How to remove silos in DevSecOps
- How to build efficient development pipeline roles and component templates
- How to deliver security artifacts that matter for ATO’s (SBOMs, vulnerability reports, and policy evidence)
- How to streamline operations with automated policy checks on container images
The Metaverse and AI: how can decision-makers harness the Metaverse for their...Jen Stirrup
The Metaverse is popularized in science fiction, and now it is becoming closer to being a part of our daily lives through the use of social media and shopping companies. How can businesses survive in a world where Artificial Intelligence is becoming the present as well as the future of technology, and how does the Metaverse fit into business strategy when futurist ideas are developing into reality at accelerated rates? How do we do this when our data isn't up to scratch? How can we move towards success with our data so we are set up for the Metaverse when it arrives?
How can you help your company evolve, adapt, and succeed using Artificial Intelligence and the Metaverse to stay ahead of the competition? What are the potential issues, complications, and benefits that these technologies could bring to us and our organizations? In this session, Jen Stirrup will explain how to start thinking about these technologies as an organisation.
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
2. Common Myths
Guava is a fruit
Guavas (singular Guava, English pronunciation: /ˈgwɑː.və/[2]) are
plants in the Myrtle family (Myrtaceae) genus Psidium (meaning
"pomegranate" in Latin)
Guava is Google Collections
Guava misuses functional idioms
4. Why Guava?
• Guava is a productivity multiplier
• I Could've Invented That
• "Know and use the libraries”
• Don't reinvent the wheel.
• Could not be included into Java API
5. Guava Design Principles
• API is the best solution for use case.
• Obvious and intuitive outside. "Smart" inside.
• Encourage good code habits.
• Generic tools that can be composed.
• Emphasize maintainability.
7. Generated
private String firstName;
private String secondName;
@Override
public String toString() {
return "PersonGenerated [firstName=" + firstName
+ ", secondName=" + secondName + "]";
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result
+ ((firstName == null) ? 0 : firstName.hashCode());
result = prime * result
+ ((secondName == null) ? 0 : secondName.hashCode());
return result;
}
8. Generate
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
PersonGenerated other = (PersonGenerated) obj;
if (firstName == null) {
if (other.firstName != null)
return false;
} else if (!firstName.equals(other.firstName))
return false;
if (secondName == null) {
if (other.secondName != null)
return false;
} else if (!secondName.equals(other.secondName))
return false;
return true;
}
9. Objects
private String firstName;
private String secondName;
@Override
public int hashCode() {
return Objects.hashCode(firstName, secondName);
}
@Override
public boolean equals(Object obj) {
if (obj instanceof PersonGuava) {
PersonGuava other = (PersonGuava) obj;
return Objects.equal(firstName, other.firstName)
&& Objects.equal(secondName, other.secondName);
}
return false;
}
@Override
public String toString() {
return Objects.toStringHelper(this)
.add("firstName", firstName)
.add("secondName", secondName)
.toString();
}
10. Puzzler
Objects.hashCode(a) == a.hashCode() ?
Arrays.hashCode(new Object[] { a }) == a.hashCode() ?
public static int hashCode(Object a[]) {
if (a == null)
return 0;
int result = 1;
for (Object element : a)
result = 31 * result
+ (element == null ? 0 : element.hashCode());
return result;
}
11. Compare while equal
public class PairOfInts {
private int first;
private int second;
public static Comparator<PairOfInts> comparator() {
return new Comparator<PairOfInts>() {
@Override
public int compare(PairOfInts p1, PairOfInts p2) {
if (p1.first < p2.first) {
return -1;
}
if (p1.first == p2.first) {
if (p1.second < p2.second) {
return -1;
}
if (p1.second == p2.second) {
return 0;
}
}
return 1;
}
};
}
}
12. Compare while equal
public class PairOfInts {
private int first;
private int second;
comparatorInts() {
public static Comparator<PairOfInts> comparator() {
return new Comparator<PairOfInts>() {
@Override
public int compare(PairOfInts p1, PairOfInts p2) {
int res = Ints.compare(p1.first, p2.first);
if (p1.first < p2.first) {
if (res == 0) {
return -1;
} return Ints.compare(p1.second, p2.second);
}
if (p1.first == p2.first) {
return res;
if (p1.second < p2.second) {
} return -1;
}; }
} if (p1.second == p2.second) {
return 0;
}
}
return 1;
}
};
}
}
13. Compare while equal
public class PairOfInts {
private int first;
private int second;
public static Comparator<PairOfInts> comparator() {
Ordering<PairOfInts> ordering() {
comparatorInts() {
Ordering.from(new Comparator<PairOfInts>() {
return new Comparator<PairOfInts>() {
@Override
public int compare(PairOfInts p1, PairOfInts p2) {
return = Ints.compare(p1.first, p2.first);
int resInts.compare(p1.first, p2.first);
if (p1.first < p2.first) {
} if (res == 0) {
return -1;
}).compound(new Comparator<PairOfInts>() { p2.second);
} return Ints.compare(p1.second,
@Override
}
if (p1.first == p2.first) {
public int res;
return compare(PairOfInts p1, PairOfInts p2) {
if (p1.second < p2.second) {
} return Ints.compare(p1.second, p2.second);
return -1;
}; } }
} }); if (p1.second == p2.second) {
} return 0;
}
}
return 1;
}
};
}
}
14. Compare while equal
public class PairOfInts {
private int first;
private int second;
public static Comparator<PairOfInts> comparator() {
Ordering<PairOfInts> ordering() {
orderingLexicographical() {
comparatorInts() {
Ordering.<Comparable<?>> natural()
Ordering.from(new Comparator<PairOfInts>() {
return new Comparator<PairOfInts>() {
.lexicographical().onResultOf(
@Override
public int compare(PairOfIntsIterable<Comparable<?>>>() {
new Function<PairOfInts, p1, PairOfInts p2) {
return = Ints.compare(p1.first, p2.first);
int resInts.compare(p1.first, p2.first);
@Override
if (p1.first < p2.first) {
} if (res == 0) {
public Iterable<Comparable<?>> apply(PairOfInts pair) {
return -1;
}).compound(new Comparator<PairOfInts>() { p2.second);
} return Ints.compare(p1.second,
return ImmutableList.<Comparable<?>>
@Override
} of(pair.first, pair.second);
if (p1.first == p2.first) {
public int res;
return compare(PairOfInts p1, PairOfInts p2) {
}
if (p1.second < p2.second) {
} });
return Ints.compare(p1.second, p2.second);
return -1;
} }; } }
} }); if (p1.second == p2.second) {
} return 0;
}
}
return 1;
}
};
}
}
15. Compare while equal
public class PairOfInts {
private int first;
private int second;
public static Comparator<PairOfInts> comparator() {
Ordering<PairOfInts> ordering() {
orderingLexicographical() {
comparatorInts() {
Ordering.<Comparable<?>> natural()
Ordering.from(new Comparator<PairOfInts>() {
return new Comparator<PairOfInts>() {
.lexicographical().onResultOf(
@Override
public int compare(PairOfIntsIterable<Comparable<?>>>() {
new Function<PairOfInts, p1, PairOfInts p2) {
return = Ints.compare(p1.first, p2.first);
int resInts.compare(p1.first, p2.first);
@Override
if (p1.first < p2.first) {
} if (res == 0) {
public Iterable<Comparable<?>> apply(PairOfInts pair) {
return -1;
}).compound(new Comparator<PairOfInts>() { p2.second);
} return Ints.compare(p1.second,
return ImmutableList.<Comparable<?>>
@Override
} of(pair.first, pair.second);
if (p1.first == p2.first) {
public int res;
return compare(PairOfInts p1, PairOfInts p2) {
}
if (p1.second < p2.second) {
} });
return Ints.compare(p1.second, p2.second);
return -1;
} }; } }
} }); if (p1.second == p2.second) {
} return 0;
}
}
return 1;
}
};
}
}
16. Better Nulls
public class BetterNulls {
public static final String DEFAULT = "default";
public String neverNullDefault(String value) {
return Objects.firstNonNull(value, DEFAULT);
}
public String neverNullEmpty(String value) {
return Strings.nullToEmpty(value);
}
public String getValueByKey(String key, Map<String, String> map) {
return Functions.forMap(map, DEFAULT).apply(key);
}
public Optional<String> getValueByKeyOptional(String key, Map<String, String> map) {
if (map.containsKey(key)) {
return Optional.fromNullable(map.get(key));
}
return null;
}
}
17. Failfast and Join with Joy
public class PreconditionsJoiner {
public String joinStrings(Iterable<String> strings) {
Preconditions.checkNotNull(strings, "Strings should not be null");
return Joiner.on(", ").skipNulls().join(strings);
}
}
18. Measure everything
public void measureSomething() {
Stopwatch stopwatch = new Stopwatch();
for (int i = 0; i < COUNT; i++) {
stopwatch.start();
doSomething();
stopwatch.stop();
doUnimpotantThing();
stopwatch.start();
doOtherThing();
stopwatch.stop();
}
System.out.println("Average execution time "
+ stopwatch.elapsedTime(TimeUnit.NANOSECONDS) / COUNT + "ns");
}
19. Fast and Immutable
public List<Integer> createList(int[] elements) {
return ImmutableList.copyOf(Ints.asList(elements));
}
public Map<String, String> createMap() {
return ImmutableMap.of("key1", "val1", "key2", "val2");
}
public Map<String, String> buildMap() {
return ImmutableMap.<String, String> builder()
.put("key1", "val1")
.put("key2", "val2")
.build();
}
26. Functional Idioms
public static Multiset<Integer> one(Iterable<String> strings) { {
three(Iterable<String> strings)
Function<String, Integer> lengthFunction = new Function<String, Integer>() {
Multiset<Integer> lengths = HashMultiset.create();
for @Override
(String string : strings) {
public Integer apply(String string) {
if (CharMatcher.JAVA_UPPER_CASE.matchesAllOf(string)) {
return string.length();
lengths.add(string.length());
}
};
}
Predicate<String> allCaps = new Predicate<String>() {
return lengths;
} @Override
public boolean apply(String string) {
return CharMatcher.JAVA_UPPER_CASE.matchesAllOf(string);
}
};
return HashMultiset.create(Iterables.transform(
Iterables.filter(strings, allCaps), lengthFunction));
}
27. Catching a Bus
public class BaseEvent {
}
public class SpecificEvent extends BaseEvent {
}
public class OtherSpecificEvent extends BaseEvent {
}
public interface EventListener {
void handleSpecific(SpecificEvent event);
void handleOtherSpecific(OtherSpecificEvent event);
}
public class EventListenerAdapter implements EventListener {
@Override
public void handleSpecific(SpecificEvent event) {
}
@Override
public void handleOtherSpecific(OtherSpecificEvent event) {
}
}
28. Catching a Bus
public class EventDispatcher {
private List<EventListener> listeners = new CopyOnWriteArrayList<EventListener>();
public void addListener(EventListener listener) {
listeners.add(listener);
}
public void removeListener(EventListener listener) {
listeners.add(listener);
}
public void fireSpecific(SpecificEvent event) {
for (EventListener listener : listeners) {
listener.handleSpecific(event);
}
}
public void fireOtherSpecific(OtherSpecificEvent event) {
for (EventListener listener : listeners) {
listener.handleOtherSpecific(event);
}
}
}
29. Event Bus
public class BaseEvent {
}
public class SpecificEvent extends BaseEvent {
}
public class OtherSpecificEvent extends BaseEvent {
}
30. Event Bus
public class EBExample {
private static final EventBus eventBus = new EventBus();
public static void main(String[] args) {
eventBus.register(new Object() {
@Subscribe
public void handle(SpecificEvent event) {
System.out.println("SpecificEvent: " + event.getClass());
}
});
eventBus.register(new Object() {
@Subscribe
@AllowConcurrentEvents
public void handle(BaseEvent event) {
System.out.println("BaseEvent: " + event.getClass());
}
});
eventBus.post(new SpecificEvent());
}
}
31. Even more...
• IO
• Net
• Reflect
• Throwables
• Hashing
• Math
• CaseFormat
• Concurrency
32. Apache Commons
• Just another library
• Commons > Guava (BCEL, Fvs, Email)
• Guava is more consistent
• Guava uses generics
• Guava Commons != {}
• Guava doesn't solve global tasks
• Don't shoot yourself in the foot with
Guava