Imagine that you need to find out how your actors are performing, but without using the Typesafe Console. (You don't actually want to use this code in production, but it is an interesting project to learn.) What we are interested is intercepting the receiveMessage
call of the ActorCell
class.
We could roll our own build of Akka, but that is not a good idea. Instead, we would like to somehow modify the bytecode of the existing Akka JARs to include our instrumentation code. It turns out that we can use aspect oriented programming to implement cross-cutting concerns in our code.
Cross-cutting concerns are pieces of code that cut accross the object hierarchy; in other words, we inject the same functionality to different levels of our class structure. In OOP, the only way to share functionality is by inheritance. I will explain the simplest case here, but the same rules apply to mixin inheritance. If I have
class A {
def foo: Int = 42
}
class B {
def bar: Int = 42
}
class AA extends A
class BB extends B
Then the only way to share the implementation of foo
is to extend A
; the only way to share the implementation of bar
is to extend B
. Suppose we now wanted to measure how many times we call foo
on all subtypes of A
and bar
, but only in subtypes of BB
. This now turns out to be rather clumsy. Even if all we do is println("Executing foo")
or println("Executing bar")
, we have a lot of duplication on our hands.
Instead, we would like to write something like this
before executing A.foo {
println("Executing foo")
}
before executing BB.bar {
println("Executing bar")
}
And have some machinery apply this to the classes that make up our system. Importantly, we would like this logic to be applied to every subtype of A
and every subtype of BB
, even if we only have their compiled forms in a JAR.
And this is exactly what AspectJ does. It allows us to define these cross-cutting concerns and to weave them into our classes. The weaving can be done at compile time, or even at class load time. In other words, the AspectJ weaver can modify the classes with our cross-cutting concerns as the JVM loads them.
The technical details now involve translating our before executing
pseudo-syntax into the syntax that AspectJ can use. We are going to be particularly lazy and use AspectJ's Java syntax.
package monitor;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import javax.management.InstanceAlreadyExistsException;
import javax.management.MBeanRegistrationException;
import javax.management.MalformedObjectNameException;
import javax.management.NotCompliantMBeanException;
@Aspect
public class MonitorAspect {
@Pointcut(
value = "execution (* akka.actor.ActorCell.receiveMessage(..))" +
"&& args(msg)",
argNames = "msg")
public void receiveMessagePointcut(Object msg) {}
@Before(value = "receiveMessagePointcut(msg)",
argNames = "jp,msg")
public void message(JoinPoint jp, Object msg) {
// log the message
System.out.println("Message " + msg);
}
}
The annotations come from the AspectJ dependencies, which, in SBT syntax are just
"org.aspectj" % "aspectjweaver" % "1.7.2",
"org.aspectj" % "aspectjrt" % "1.7.2"
Excellent. We have defined a pointcut, which you can imagine as a target in the structure of our system. In this particular case, the pointcut says on execution of the receiveMessage
method in akka.actor...ActorCell
class, with any parameters of any type (..)
, returning any type *
; as long as the argument is called msg
and inferred to be of type Object
. Without an advice though, a pointcut would be useless--just like having a method that is never called. An advice applies our logic at the point identified by the pointcut. Here, we have the message
advice, which runs on execution of the methods matched by the receiveMssagePointcut
. At the moment, it does nothing of importance.
To see this in action, we need to tell the JVM to use the AspectJ weaver. We do so by specifying the Java agent, which registers a Java Instrumentation
implementation, which performs the class file transformation. However, this transformation is costly. Imagine if we had to re-compile every class as it is loaded. To restrict the scope of the transformations, the AspectJ load-time weaver loads an XML file (boo, hiss; I know) from META-INF/aop.xml
, which includes its settings.
Now, to get it all running, all you need to do is to include the javaagent:~/path-to/aspectjweaver.jar
when we start the JVM.
Now that we have our monitor.MonitoringAspect
and META-INF/aop.xml
ready, all we need to do is to implement the logic that records the messages and prints out their per-second averages. I will leave it to the curious reader to come up with much better approach, but here is one that works; all be it in a very naive way
package monitor;
import java.util.HashMap;
import java.util.Map;
class ActorSystemMessages {
private final Map messages = new HashMap<>();
void recordMessage() {
long second = System.currentTimeMillis() / 1000;
int count = 0;
if (messages.containsKey(second)) {
count = messages.get(second);
}
messages.put(second, ++count);
}
float average() {
if (messages.isEmpty()) return 0;
int total = 0;
for (Integer i : messages.values()) {
total += i;
}
return total / messages.size();
}
}
We can now use it in our MonitorAspect
@Aspect
public class MonitorAspect {
private ActorSystemMessages asm = new ActorSystemMessages();
@Pointcut(
value = "execution (* akka.actor.ActorCell.receiveMessage(..)) " +
"&& args(msg)",
argNames = "msg")
public void receiveMessagePointcut(Object msg) {}
@Before(value = "receiveMessagePointcut(msg)", argNames = "jp,msg")
public void message(JoinPoint jp, Object msg) {
asm.recordMessage();
System.out.println("Average throughput " + asm.average());
}
}
Lets see it all run. We will make a simple actor; this time, we shall use the Actor DSL. We are not interested that much in its behaviour, but we want to see messages being sent around. So, we construct a simple App
subclass with two actors. One that sends the messages around, the second one that prints any message it receives.
import akka.actor.{ActorRef, ActorSystem}
object Main extends App {
import akka.actor.ActorDSL._
import Commands._
implicit val system = ActorSystem()
val chatter = actor(new Act {
become {
case i: Int =>
self ! (sender, i)
case (sender: ActorRef, i: Int) =>
if (i > 0)
self ! (sender, i - 1)
else
sender ! "zero"
}
})
implicit val _ = actor(new Act {
become {
case x => println(">>> " + x)
}
})
def commandLoop(): Unit = {
readLine() match {
case CountdownCommand(count) => chatter ! count.toInt
case QuitCommand => return
}
commandLoop()
}
commandLoop()
system.shutdown()
}
object Commands {
val CountdownCommand = """(\d+)""".r
val QuitCommand = "quit"
}
The chatter
actor, as you can see, receives the number of messages to be crunched. It then sends a message to itself as tuple containing the original sender and the number of messages, which will continue to decrease until we hit 0
, when we send the "zero"
String
back to the original sender.
As an interesting aside, we have the tail-recursive commandLoop()
function, which deals with the input that the users type in.
If you run the example without specifying -javaagent
JVM parameter, the aspect will not be weaved in; consequently, no bytecode will be modified and our logging will not work. Because your IDEs are different, the only reliable way is to run it in SBT. And so, execute sbt run
, enter the number of messages and see them being displayed.
Note that I'm setting the javaOptions
, fork
and connectInput
. The javaOptions
is obvious that's how I specify the -javaagent
parameter; fork
makes SBT fork the java
process so that the javaOptions
takes effect. Finally, the connectInput
parameter connects the System.in
to the console's STDIN. (We must do this because we use readLine()
in our app.)
Now, I don't like println
in the best of the times; and System.out.println
is even worse. So, the last modification is to add JMX exporter; and to expose the ActorSystemPerformance
MBean. The rather baroque JMX code is
public interface ActorSystemPerformanceMXBean {
float getMessagesPerSecond();
}
public class ActorSystemPerformanceMXBeanImpl
implements ActorSystemPerformanceMXBean{
private ActorSystemMessages messages;
ActorSystemPerformanceMXBeanImpl(ActorSystemMessages messages) {
this.messages = messages;
}
@Override
public float getMessagesPerSecond() {
return this.messages.average();
}
}
public class JMXEndpoint {
public static void start(ActorSystemMessages messages) throws ... {
MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
ObjectName name = new ObjectName("monitor:type=Performance");
ActorSystemPerformanceMXBeanImpl mbean =
new ActorSystemPerformanceMXBeanImpl(messages);
mbs.registerMBean(mbean, name);
}
}
With this in place, we can remove the System.out.println
and call the JMXEndpoint.start)
method in the aspect's constructor, giving us
@Aspect
public class MonitorAspect {
final ActorSystemMessages messages;
public MonitorAspect() throws ... {
this.messages = new ActorSystemMessages();
JMXEndpoint.start(messages);
}
@Pointcut(...)
public void receiveMessagePointcut(Object msg) {}
@Before(...)
public void message(JoinPoint jp, Object msg) {
messages.recordMessage();
}
}
Run the application using sbt run
again, connect to the JMX MBean using jconsole
and see the wonders
This article is a simple exploration of AOP (as implemented in AspectJ) and its use in Scala and Akka. The implementation is very simplistic; if you use it in production, I shall endorse you for Enterprise PHP on LinkedIn. However, it is an interesting exercise and really shows how Scala fits well into even the sligtly more esoteric Java libraries. The source code for your compiling pleasure is at https//github.com/eigengo/activator-akka-aspectj.


Pseudo-MIDI message used to arrange for a callback at a certain time.
For a list of all members of this type, see CallbackMessage Members .
System.Object
Message
CallbackMessage
This message can be scheduled with Clock.Schedule just like any other message. When its time comes and it gets "sent", it invokes the callback provided in the constructor.
The idea is that you can embed callback points into the music you've scheduled, so that (if the clock gets to that point in the music) your code has an opportunity for some additional processing.
The callback is invoked on the MidiOutputDevice's worker thread.
Namespace: Midi
Assembly: Midi (in Midi.dll)
CallbackMessage Members | Midi Namespace


MySQL's character sets and collations are often considered as a mystery, and many users either completely disregard them and keep with the defaults, or set everything to UTF8.
This post will attempt to shed some light on the mystery, and provide with some best practices for use with text columns with regard to character sets.
Character Sets
A thorough discussion of how the character sets have evolved through history is beyond the scope of this post. While the Unicode standard is gaining recognition, the "older" character sets are still around. Understanding the difference between Unicode and local character sets is crucial.
Consider, for example, MySQL's latin1
character set. In this character set there are 256 different characters, represented by one byte. The first 128 characters map to ASCII, the standard "ABCabc012 dot comma" set, of which most of this post is composed. The latter 128 characters in latin1
are composed of West European specific characters, such as À, ë, õ, Ñ.
A Name VARCHAR(60) CHARSET latin1
column can describe names with West European characters. But it cannot describe Russian or Hebrew names. To represent a name in Hebrew, you'd need the hebrew
charset (ISO 8859-8), in which the first 128 characters are, as always, mapped to ASCII, and the latter 128 characters describe the Hebrew alphabet and punctuation marks, such as ש,ל,מ,ה. The Cyrillic, Arabic and Turkish charsets follow in a similar manner.
Assume now I'm building a world wide web application, such as a popular social network. I would like to store the first names of my users, in every possible language. None of the above character sets support all languages. I therefore turn to Unicode. In particular, MySQL supports utf8
, a Unicode encoding scheme, which is commonly used due to its economic storage requirements.
In Unicode there is a dedicated number for each letter in the known languages, in ancient languages, and some imaginary or otherwise non existing languages, such as Klingon (yes, I know there are people who actually speak Klingon), may yet find their way into the standard.
UTF8 (or utf8), a Unicode encoding scheme, states the following: for ASCII characters, such as 'a', '6', '$', only one byte of storage is required. For Hebrew, Cyrillic or Turkish characters, 2 bytes are required. For Japanese, Chinese - more (MySQL supports up to 3 bytes per character). Again, the exact details of the implementation are beyond the scope of this post, and are well described here and here.
What's important to me is that I can define Name VARCHAR(30) CHARSET utf8
for my columns, and Voila! Any name can be represented in my database.
So why not define everything as utf8 and get done with it?
Well, it just so happens that Unicode comes with a price. See, for example, the following column definition:
CountryCode CHAR(3) CHARSET utf8
We are asking for a column with 3 characters exactly. The required storage for this column will be such that any 3-letter name must fit in. This means (3 characters) times (3 bytes per character) = 9 bytes of storage. So CHAR
and utf8
together may be less than ideal. VARCHAR
behaves better: it only requires as many bytes per character as described above. So the text "abc" will only require 3 bytes (plus VARCHAR
's leading 1 or 2 bytes).
Why don't we drop the 'CHAR' altogether, then, and use only 'VARCHAR'?
Because some values are simply better represented with CHAR
: consider a "password" column, encoded with MD5. The MD5()
function returns a 32 characters long text. It's always 32 characters, and, moreover, it's always in ASCII. The best data type and character set definition would be password CHAR(32) CHARSET ascii
. We thus ensure exactly 32 bytes are allocated to this column. A VARCHAR
will acquire an additional byte or two, depending on its defined length, which will indicate the length of the text.
And why would I care about collations?
Collations deal with text comparison. We observed that the default character set in MySQL is latin1
. The default collation is latin1_swedish_ci
. In this collation the following holds true: 'ABC' = 'abc'
.
Wait. What?
Look at the "ci" in latin1_swedish_ci
. It stands for "case insensitive". Collations which end with "cs" or "bin" are case sensitive. The utf8
character set comes with utf8_general_ci
collation. This can make sense. Let's review our web application table (I'm using plain text passwords here, bare with me for this example):
CREATE TABLE my_users ( name VARCHAR(30) CHARSET utf8 COLLATE utf8_general_ci, plainPassword VARCHAR(16) CHARSET ASCII, UNIQUE KEY (name) ); INSERT INTO my_users (name, password) VALUES ('David', 'mypass');
It holds true that the name 'David' equals 'david'. If I were to SELECT * FROM my_users WHERE name='david'
, I would find the desired row. The unique key will also guarantee that no daVID user can be added.
But David certainly wouldn't want users to login with the password 'MYPASS'. So we refine our table:
CREATE TABLE my_users ( name VARCHAR(30) CHARSET utf8 COLLATE utf8_general_ci, plainPassword VARCHAR(16) CHARSET ascii COLLATE ascii_bin, UNIQUE KEY (name) );
The ascii_bin
collation is a case sensitive collation for ascii
. The following will not find anything:
SELECT * FROM my_users WHERE name='david' AND plainPassword='MYPASS';
Holding a plain text password in your database is not a best practice, but apparently it's common.
Collations also deal with text ordering. For any two strings, the collation determines which is larger, or if they are equal. Probably the most common situation you see collations in action is when you ORDER BY a text column.
Also keep in mind
- When you check for length of strings, do you use the
LENGTH()
function, as inSELECT LENGTH(Name) FROM City
? You probably wish to replace this withCHAR_LENGTH()
.LENGTH()
returns the number of bytes required for the text storage.CHAR_LENGTH()
returns the number of characters in the text, and is usually what you are looking for. It may hold true that for a string s,LENGTH(s)=12
andCHAR_LENGTH(s)=8
. Watch out for these glitches. - You can converts texts between character sets with
CONVERT
. For example:CONVERT(s USING utf8)
- Stored routines should not be overlooked. If your stored routine accepts a text argument, or if your stored function returns one, make sure the character sets are properly defined. If not, then your utf8 text may be converted to latin1 during the call to your stored routine. This also applies to local parameters within the stored routines.
- An
ALTER TABLE <some table> CONVERT TO <some charset>
will change the character set not only for the table itself, but also for all existing textual columns.
See the following post: Useful database analysis queries with INFORMATION_SCHEMA for queries which diagnose your databases character sets.
comments powered by Disqus


future clients
The project aims to create a recommender for new potential customers. Using the database of companies mainly in northern Brazil. Working with Unsupervised learn, it was possible to create a good model.
You can acess the API here.
and acess the repository.
Python, Unsupervised-Learn, Heroku, GitHub, Streamlit


Windows Update Standalone Installer
Another method to use to copy to our secure location is using Windows Update Standalone Installer (wusa.exe). Wusa.exe when executed runs as a high integrity process as its set to auto-elevate in its manifest. For auto-elevation the Windows executable must be signed, located in a secure directory such as C:\Windows\System32 and must specify the autoElevate property in their manifest. (You can use BinText to view an .exe manifest and search for <autoElevate> tag)
We use wusa.exe to extract a CAB file (cabinet archive file) to our secure location
wusa c:\users\user1\desktop\poc.tmp /extract:c:\windows\system32\sysprep
Here in the example our cab file is called poc.tmp but we can call it whatever we like. Windows comes with the makecab.exe tool so we can even create our cab file
makecab c:\users\user1\desktop\CRYPTBASE.dll c:\users\user1\desktop\poc.tmp


Parallelization for HIR
Loop Parallelization
Overview
LoopAnalysis
Nested loops
Framework for parallel execution
Explanation using examples
Example of parallelization
Usage
Designate candidates
Generation of C program
Generation of machine code
Generation of execution module
Coarse Grain Parallelization
Overview
Design Concept
Data Structures
Scheduler
Constraints
Usage
Options
References
→ top


Javascript execution
The attacker could redirect to a javascript URI. This only works in the case of DOM-based Open Redirect. It would not work in server-side open redirects, for example in the case of a manipulated HTTP location header. Because of this attack vector, DOM open redirect is a XSS flaw.
Example: https://example.com/#javascript:alert(document.cookie)


Below is a link to this months newsletter
Click the link to view it or right click the link and choose
save target as to download it to your computer
JULY NEWSLETTER.
Enjoy the newsletter and thank you for your patience!
Questions or comments? Email them to<EMAIL_ADDRESS>|


Menu
About
News
Donate
Volunteer
Contact
Admin Login
Username:
Looks good!
Please enter your address.
Password:
Looks good!
Please enter your address.
Login


Courses are merely a suggestion based on provided information. The final decision falls on your shoulders.
Ruby/Rails
C#/.NET
PHP/Drupal
JAVA/Android
You don't seem to be leaning towards any one subject. This indicates at least a three way tie. Might I suggest taking the intoductory course to get a feel for the direction you would like to go.
It seems that the best match for you would be
According to the information you gave me, either or would be good tracks to take.


Filter Links
Filter using regular expression syntax.
Regexp:
Matching links:
Something went horribly wrong :(
Copy URLs
Copy HTML


Test Whether Certain CSS Properties and Values are Supported
CSS is a fault-tolerant language, designed to ignore parsing errors rather than stop the parser when they are encountered. Knowledge of how parsing errors work is an important tool in the progressive enhancement toolbox as it allows us to author for the future without sacrificing older browsers.
Browsers that encounter this rule set will see the selector first and recognize
it as a simple type selector. They will then move inside and begin parsing the
declarations. All browsers will understand the background-color
value “red”, but modern browsers that understand RGBa
colors will apply a background color of green at 50% opacity as declared
in “rgba(34, 132, 39, 0.5)”.
This is a pretty simple example of how to use parsing errors to deliver two different experiences to browsers with different capabilities. Let’s take it up one level higher.
In this example, we have two rule sets. The first uses the simple type selector again, and any browser that implements CSS will be able to apply the red backgrouns color.
The second rule set uses a more complicated attribute selector. Older browsers (think IE6 and earlier) were created before this selector was introduced, so they have no idea what to do with it. Per the CSS spec, these browsers ignore the entire rule set, meaning only more modern browsers will get the green color.
It’s worth noting that with compound selectors (the ones separated by commas) the selectors are not evaluated independently, so if any one of those selectors is not understood, the entire rule set is thrown out.
CSS blocks provide a higher level of filterabilty by letting us isolate a collection of rule sets to specific browsers. In this example, all browsers get a background of red, but media query-aware browsers will apply a background of green or a linear gradient (if the browser supports it).
@supports
for Granular ControlThe @supports
block lets us feature detect before applying certain style
rules. Let’s look at a simple example:
This example is pretty similar to the earlier @media
block filter,
but @supports
allows you to specify what property and value (or
value type) you need the browser to support before it decends into the block and
attempts to parse the rule sets within.
The feature detection in this example is for a linear gradient (the shortest one
I could think of, to save some bits). Browsers that don’t understand @supports
will ignore the block and apply the red color. Browsers that understand @supports
but don’t implement linear gradients using this syntax would also ignore the
block and apply the red color. But browsers that do understand
@supports
and implement linear gradients will decend into
the the block and apply the green linear gradient background.


graph
dfs
graph algo
]
Leetcode 1192. Critical Connections in a Network
Problem statement
https://leetcode.com/problems/critical-connections-in-a-network/
Solution
In my opinion it is very difficult problem if you are not familiar with graph theory. What is actually asked here is to find all so-called bridges in given graph, here you can see detailed explanation of the very classical algorithm: https://cp-algorithms.com/graph/bridge-searching.html
Here I give some details about the code, using the link I provided. The key observation about the bridge is:
Let us be at node
when we use dfs. Then if we have edge (node, child)
, such that from child
or any of its descendants we do not have back edge (edge which leads to already visited node) to node
or to some of its ancestors, it means that (node, child)
is bridge. Indeed, this condition means that there is only one path from node
to child
.
- We use
dfs
with some extra steps to solve this problem. Each time we rundfs(node, par)
, wherenode
is current node we are in andpar
is parent of this node. In the beginningpar
is equal to-1
means, that we do not have any parent. - We keep global
self.timer
variable: is time of visit of one or another node. - We keep
tin[node]
array, the time when we visitnode
. - Also we keep
fup[node]
array, which will be defined as follow: it is minimum amongtin[node]
: time of visit ofnode
and all times of visit for so-called back edges andfup[child]
for all children ofnode
. By our definition,fup[node]
is the smallest time among all descendants ofnode
.
Then it can be shown that (node, child)
is bridge if and only if fup[child] > tin[node]
.
Complexity
Time complexity is just O(E + V)
to traverse all graph with dfs and some extra-steps. Space complexity is O(E + V)
as well to create graph
and keep used, tin, fup
arrays.
Code
class Solution:
def criticalConnections(self, n, connections):
used, tin, fup = [0]*n, [-1]*n, [-1]*n
self.timer, ans = 0, []
graph = defaultdict(list)
def dfs(node, par = -1):
used[node] = 1
tin[node] = fup[node] = self.timer + 1
self.timer += 1
for child in graph[node]:
if child == par: continue
if used[child] == 1:
fup[node] = min(fup[node], tin[child])
else:
dfs(child, node)
fup[node] = min(fup[node], fup[child])
if fup[child] > tin[node]: ans.append([node, child])
for i, j in connections:
graph[i].append(j)
graph[j].append(i)
for i in range(n):
if not used[i]: dfs(i)
return ans


Sci. animal production emissions Anim. welfare animals dairy cows feed climate change mitigation pigs potential broiler Animal cattle systems Climate high milk Dairy increase feeding gas genetic greenhouse health increased reduce use However, chickens environmental effects fed USA Welfare example, food global including rbST strategies {border-style livestock methane Change Effects efficiency management productivity px;} #ffffff;} Feed United Vet. carbon changes growth meat review GHG associated diets energy greater number produced Appl. Genetic breeding intensive manure mastitis sows ./jds.S-()- bovine produce production, weight ... FAO Food Mitigation beef behavior compared diet dietary feedlot impact impacts improve lower options reducing Agric. Behav. Poult. Proceedings protein using yield breeds collab: cow growing negative products reduced selection studies ./S-()- Assessment Environ. European International Report animals. developing different highly housing improved increasing land metabolic pasture poultry problems ractopamine rumen study systems, total traits used Feeding Group Health Italy Livestock M.C. New P.M. Press Technol. approaches birds body countries disease disorders improving include lameness large pig problem proportion rate reduction research severe sheep soil somatotropin substantial ./S Cambridge Contribution NY, R.J. Rome, University Wallingford, agriculture approximately demand farm future given important incidence local mortality needed nutrition pork px; quality regions risk {font-family %–% Breeding Cattle Effect IPCC Intergovernmental Panel Proc. Production Res. Smith States Steinfeld Working York, access approach attention behaviour breeders clinical confinement consumption countries, daily effect factors farming font-size foot grain herd industrialized lead leg level low million nutritional productive resources stress treatment ulcers unit van water (accessed (p. ./-()- ./jas.- A.N. Agriculture Am. Available Burton C.J. Can. Fifth Gerber Hocking J.D. J.L. J.N. Livest. M.S. S.J. Science Waghorn Welf. animals, assessment balance behavioral better cause commercial conditions conversion correlation developed digestive double; finishing footprint gastric heart heat hormone improvements increases individual just lactation legumes litter meet online: overall parameters piglets practices production. recombinant requirements restriction ruminant size slatted slaughter survival transport usually waste welfare. βAAs Acad. Animals August CAB Cambridge, Environmental G.C. Given Impact Improved J.P. M.J. Natl. Poultry SCAHAW Selection Society States, Strategies achieved addition behavior, benefits best bone border-color border-width broilers calves chicken chronic common considered contribute current day death decrease diseases drug efficient emission emissions, enteric especially estimated estimates expansion facilities feed, fermentation forages form function gain generally grazing health, hydrochloride intake, issues kept key lack lesions life performance policy possible prevent problems. product productivity, proposed provided ruminal selected sequestration small social solid; solutions strategy suffer supply sustainability times treated {font-style {font-weight -eq. ./pnas. ./vr... A.L. A.M. Africa Association B.T. Bovine Brazil Brazilian Broom C.A. CVMA Change. Clin. Conference D.D. D.J. D.M. Ecosyst. F.M. Garnett Global Greenhouse Holsteins Hristov III Impacts J.A. J.M. J.R. K.S. Kestin L.E. M.A. Marchant-Forde Meunier-Salaun Mitloehner Nutr. P.J. Pig Pigs Policy Prod. Productivity R.G. Rec. Richert S.C. S.M. Scientific Simm Summary Swine Systems T.C. T.G. Use Volume Wall West White World’s abnormal accompanied account acidosis adapted administered affecting agricultural alternative analysis application avoid avoiding birth bold calls case caused change, changing concerns concrete confined consume costs courier; discussed discussion domestic early efficiency, em; expected fat fertility fiber floors forage gait genetically group grow housed hunger husbandry imported industry initial intensification intensity kilogram lactations largely leads levels limb live main major milk, monogastrics movement multiple natural nearly needs nutrient operations output parent population processing producing pt;} rapid rapidly reduces reproductive required ruminants shown source species state time, tons trend type unintended vitro walking warming way welfare, work world years


*Click on a part listed on the left to get a short description and photos.
*The parts listed are not all of the parts available to put into a computer, many more can be added but most of these listed are essentialls.
CPU
CPU Cooler
Motherboard
RAM
Storage
Video Card
Case
Power Supply
Description
Photos
CPU
Stands for Central Processing Unit.
This is the brains of the computer where most many computations take place.
AMD and Intel are the two most popular CPU manufacturers.
The CPU is positioned within the CPU Slot on your Motherboard.
CPU Cooler
This one is quite self explanatory.
The CPU cooler sits on top of the CPU generally and draws heat away from it.
Generally uses a heat sink and fans.
You can also purchase water coolers that are a bit more pricy.
Motherboard
The motherboard is often one of the largest parts of a computer system.
It is a circuit board that many components are placed on to become connected.
There are multiple sizes of motherboards to fit in different case sizes.
RAM
Stands for Random Access Memory.
RAM is what temporarily stores data which a CPU then processes.
The more RAM you have the more information you can work with at the same time.
Storage
There are two main types of storage nowadays, SSD's and HDD's.
These are both places where you can store photos, videos, or games.
SSD's are more recent and much faster than HDD's.
HDD's are also relatively cheap to buy now.
Video Card
A video card or graphics card (GPU) is an expansion card that connects to your motherboard that allows you to send graphical information to a display device.
The two big graphics card brands are Nvidia and AMD and a good video card is
essential if you want to do any serious gaming or graphically intensive tasks.
Case
A computer's case is the chassis that all other items are mounted within.
There are different form factors of a computer case which all vary in size.
Many computer cases come with fans built in and sometimes a power supply.
Power Supply
The power supply unit (PSU) often sits in the bottom of the computer case with the purpose of powering the computer.
A PSU connects to the motherboard, often the GPU, and other items within the case
that need power to function such as case fan's.


| Death and Decay
| all
| 8
|
| 30 seconds
| 1 rune
| no
| 30 yards
| shadow damage to all enemies within ??? yards of target location, 10 second duration
|
| Death Coil
| all
| 8
|
|
| 40 runic power
| ???
| 30 yards
| shadow damage to 1 enemy or healing to 1 friendly undead
|
| Death Grip
| all
| 8
|
| 25 seconds
|
| ???
| 30 yards
| pulls 1 enemy to your location
|
| Death Strike
| all
| 8
|
|
| 45 runic power
| ???
| melee
|
- physical damage to 1 enemy
- heals you for 25% of all damage taken within last 5 seconds, minimum 7% of max health
|
| Mind Freeze
| all
| 8
|
| 15 seconds
|
| ???
| 15 yards
|
- counters spellcast of 1 enemy
- prevents spells from that school for 3 seconds
|
| Rune Strike
| all
| 8
|
|
| 1 Rune
| ???
| melee
|
- physical damage to 1 enemy
- cannot be blocked, dodged, or parried
|
| Veteran of the Third War
| all
| 8
|
|
|
|
|
|
- passive ability
- +10% stamina
|
| Anti-Magic Shell
| all
| 9
|
| 60 seconds
|
| no
|
|
- shields you, absorbing magic damage and preventing application of harmful magical effects
- absorbing damage generates runic power
|
| Death Gate
| all
| 10
| 4 seconds
| 60 seconds
|
|
|
|
- teleports you to the Ebon Hold
- casting it again returns you to your departure point
|
| Festering Strike
| unholy
| 10
|
|
| 2 runes
| ???
| melee
|
- physical damage to 1 enemy
- applies 2-3 Festering Wounds, burst on death or when hit by Scourge Strike, shadow damage dealt to 1 enemy, +3 runic power
- replaces Rune Strike
|
| Heart Strike
| blood
| 10
|
|
| 1 rune
| ???
| melee
|
- physical damage to up to 2 enemies, -20% enemy movement speed for 8 seconds
- replaces Rune Strike
|
| Howling Blast
| frost
| 10
|
|
| 1 rune
| ???
| ???
|
- frost damage to 1 enemy, reduced frost damage to all other enemies within 10 yards
- applies Frost Fever, frost damage over 24 seconds, chance of +5 runic power each time damage is dealt
- replaces Rune Strike
|
| Mastery: Blood Shield
| blood
| 10
|
|
|
|
|
|
- passive ability
- portion of Death Strike healing is applied to you as an absoption shield
- +8% attack power
|
| Mastery: Dreadblade
| unholy
| 10
|
|
|
|
|
|
- passive ability
- increased minion and shadow damage
|
| Mastery: Frozen Heart
| frost
| 10
|
|
|
|
|
|
- passive ability
- frost ability damage is increased
|
| Might of the Frozen Wastes
| frost
| 10
|
|
|
|
|
|
- passive ability
- Obliterate and Frost Strike also strike with your off-hand weapon when dual-wielding
|
| Frost Strike
| frost
| 11
|
|
| 25 runic power
| ???
| melee
| frost damage to 1 enemy
|
| Marrowrend
| blood
| 11
|
|
| 2 runes
| ???
| melee
|
- physical damage to 1 enemy
- +3 Bone Shield charges
- charges give extra armor, charge lost when hit by melee attacks, up to 30 second duration
|
| Scourge Strike
| unholy
| 11
|
|
| 1 rune
| ???
| melee
|
- physical and shadow damage to 1 enemy
- burst 1 Festering Wound
|
| Raise Dead
| all
| 12
|
| 120 seconds
|
| ???
| 30 yards
| raises a ghoul to fight for you, 60 second duration, max 1
|
| Chains of Ice
| all
| 13
|
|
| 1 Rune
| ???
| 30 yards
| -70% movement speed of 1 enemy for 8 seconds
|
| Dark Command
| all
| 14
|
| 8 seconds
|
| ???
| 30 yards
| taunt 1 enemy to attack you
|
| Obliterate
| frost
| 14
|
|
| 2 runes
| ???
| melee
| physical damage to 1 enemy
|
| Blood Boil
| blood
| 17
|
| 7.5 seconds
|
| ???
| 10 yards
|
- shadow damage to all enemies within 10 yards
- applies Blood Plague, which drains health from the enemy, 24 second duration
|
| Outbreak
| unholy
| 17
|
|
| 1 rune
| ???
| 30 yards
|
- shadow damage to 1 enemy
- applies Virulent Plague to all enemies near your target, shadow damage over 27 seconds, erupts when target dies dealing shadow damage to all nearby enemies
|
| Crimson Scourge
| blood
| 18
|
|
|
|
|
|
- passive ability
- your auto attacks on target with Blood Plague can reset Death and Decay cooldown and make it free
|
| Dark Succor (frost)
| frost
| 18
|
|
|
|
|
|
- passive ability
- Death Strike is free and heals for 10% more for 20 seconds after killing an enemy that yields experience or honor
|
| Dark Succor (unholy)
| unholy
| 18
|
|
|
|
|
|
- passive ability
- Death Strike is free and heals for 10% more for 20 seconds after killing an enemy that yields experience or honor
|
| Apocalypse
| unholy
| 19
|
| 90 seconds
|
| ???
| melee
|
- shadow damage to 1 enemy
- burst up to 4 Festering Wounds, summon a ghoul for each wound burst for 15 seconds
|
| Remorseless Winter
| frost
| 19
|
| 20 seconds
| 1 rune
| ???
| 8 yards
|
- frost damage and -20% movement speed of all enemies within 8 yards
|
| Rune Tap
| blood
| 19
|
| 25 seconds
| 1 rune
| ???
|
| -20% damage taken for 4 seconds
|


Project 04: Shadow Casting
Tushar T
Reference image.
Shadows using Point and Spotlight.
Soft Shadows using d/sum(r) computations to calculate cos(theta).
Shadows using an Area light with 4x sampling.


By: Team Drag&Drop
Since: Jan 2020
- 1. Introduction
- 2. Setting up
- 3. Commonly Used Symbols
- 4. Design
- 5. Implementation
- 6. Documentation
- 7. Testing
- 8. Dev Ops
- Appendix A: Product Scope
- Appendix B: User Stories
- Appendix C: Use Cases
- Appendix D: Non Functional Requirements
- Appendix E: Glossary
- Appendix F: Instructions for Manual Testing
- Appendix G: Effort
1. Introduction
Study Buddy is a task-management tool made for students who want to be able to track and manage their tasks in one place.
Study Buddy uses various visualization tools such as pie charts and calendars, provides useful functionality such as archive, Due Soon task list etc to make task management simple and convenient.
In particular, Study Buddy is a Command Line Interface (CLI) application that also provides some Graphical User Interface (GUI). This means that users are expected to interact with the Study Buddy mainly through the command line, but each command executed will evoke a visual response as well.
The purpose of this guide is to help potential developers get up to speed on the Study Buddy code base and functionality. We hope that this document will ease the process of further enhancing and developing Study Buddy.
2. Setting up
Refer to the guide here.
3. Commonly Used Symbols
|
Note
|
This symbol indicates something you should take note of. |
|
Tip
|
This symbol indicates a tip that you could use. |
|
Caution
|
This symbol indicates an aspect that should be used with caution. |
|
Important
|
This symbol indicates something to which we want to draw your attention. |
4. Design
4.1. Architecture
The Architecture Diagram given above explains the high-level design of the App. Given below is a quick overview of each component.
|
Tip
|
The .puml files used to create diagrams in this document can be found in the diagrams folder.
Refer to the Using PlantUML guide to learn how to create and edit diagrams.
|
-
At app launch: Initializes the components in the correct sequence, and connects them up with each other.
-
At shut down: Shuts down the components and invokes cleanup method where necessary.
Commons
represents a collection of classes used by multiple other components.
The following class plays an important role at the architecture level:
-
LogsCenter
: Used by many classes to write log messages to the App’s log file.
The rest of the App consists of four components.
Each of the four components
-
Defines its API in an
interface
with the same name as the Component. -
Exposes its functionality using a
{Component Name}Manager
class.
For example, the Logic
component (see the class diagram given below) defines it’s API in the Logic.java
interface and exposes its functionality using the LogicManager.java
class.
How the architecture components interact with each other
The Sequence Diagram below shows how the components interact with each other for the scenario where the user issues the command delete 1
.
delete 1
commandThe sections below give more details of each component.
4.2. UI component
API : Ui.java
The UI
consists of a MainWindow
which is made up by different components such as StatusBarFooter
, FeedbackDisplayBox
,
CommandBox
as well as variants Panels
and Cards
. All these components, including the MainWindow
, inherit from the abstract UiPart
class.
The UI
component uses JavaFx UI framework.
The layout of these UI parts are defined in matching .fxml
files that are in the src/main/resources/view
folder.
For example, the layout of the MainWindow
is specified in MainWindow.fxml
- The
UI
component -
-
Interacts with user in an interactive process with the help of
Logic
component.-
CommandBox
collects the user keyboard input. -
Logic
parses user input in each interaction and executes the command subsequently if the interaction ends without any exception. -
FeedbackDisplayBox
responses system information to user, such as error message and command execution result.-
When invalid input received, proper message will respond via
FeedbackDisplayBox
. The interaction of the command will not be terminated, user can continue with the process with valid input.
-
-
-
Listens for changes to Model data so that the UI can be updated simultaneously.
-
All Cards components and
CalenderPanel
,ModuleListPanel
,ProductivityPanel
andTaskSummaryPanel
will listen to the changes to Model data.
-
-
|
Note
|
The command execution will only terminate in two scenarios: 1. When the command is successfully executed. 2. When the user enter quit and kbd:[enter] to exit the execution.
|
4.3. Logic component
API :
Logic.java
-
The
InteractiveCommandPrompt
inUi
uses the parsers to parse the user command. -
This results in a
Command
object which is executed by theLogicManager
. -
The command execution can affect the
Model
(e.g. adding or editing a task). -
The result of the command execution is encapsulated as a
CommandResult
object which is passed back to theUi
. -
In addition, the
CommandResult
object can also instruct theUi
to perform certain actions, such as displaying a help message to the user.
4.4. Model component
API : Model.java
The Model
,
-
stores a
UserPref
object that represents the user’s preferences. -
stores the Study Buddy data.
-
exposes an unmodifiable
ObservableList<Task>
that can be 'observed' e.g. the UI can be bound to this list so that the UI automatically updates when the data in the list change. -
does not depend on any of the other three components.
4.5. Storage component
API : Storage.java
The Storage
component,
-
can save
UserPref
objects in json format and read it back. -
can save the Study Buddy data in json format and read it back.
-
saves all tasks, due soon tasks, archived task, modules and stats.
4.6. Common classes
Classes used by multiple components are in the draganddrop.studybuddy.commons
package.
5. Implementation
This section describes some noteworthy details on how certain features are implemented.
5.1. Interactive Command Process Feature
5.1.1. Implementation
-
Feature introduction
The Interactive Command Process Feature allows user to execute his/her command in an interactive way.
-
Implementation detail
This feature applies on all commands provided by Study Buddy and is implemented using:
-
The
CommandBox
fromUI
component to collect user input and init an associate interactivePrompt -
The
InteractivePrompt
fromLogic
component to parse user input step by step and generate meaningful response message accordingly. It also produces an executableCommand
from each successful interaction to perform the user’s desired action.-
Different types of
InteractivePrompt
such asAddTaskInteractivePrompt
are provided to handel interactions with different purpose.Figure 8. Object diagram when user add task using interactive command process -
Allow user to quit from each step of an interaction using
quit
(case insensitive) key word. Here is an example of user quiting from add task interactive command process.Figure 9. Activity diagram when user quite from add task interactive command process
-
-
5.1.2. Example Usage Scenario
Given below is an example usage scenario and how the interactive command process mechanism behaves at each step.
Step 1. The user launches the application for the first time and skips the user guid.
By following the hint from UI
(i.e. when CommandBox
is idle, it should display "Please enter your command here…"),
he can try some random input and hit enter to get the list of available commands.
Step 2. The user picks a command from the list and type it in the CommandBox
. The guide information of the next step will
display in FeedbackDisplayBox
after user press enter.
|
Note
|
For some commands there is only one interaction involved, such as help and list . In such a case
the application will execute the command right after user press enter.
|
Step 3. The user made a typo mistake in the data and time filed when adding a task record.
Proper massage with the error type and the correct format of the data and time will be displayed in the
FeedbackDisplayBox
. User can follow the instruction to continue the interaction.
Step 4. The user is performing an interaction to edit a task, but realized he/she
chose a wrong task from the list, he/she can use quit
to exit
the process without making any changes to the task.
5.1.3. Design Considerations
Aspect: How to react to an invalid input
-
Alternative 1 (current choice): provides relevant error message and stays at current interaction step.
-
If the next input is
-
Invalid: provides the relevant error message and continue waiting for another input.
-
Valid: start next interaction step.
-
quit
: quite from the command process.
-
-
Pros: Save the data from previous stages, especially in add task interaction, thus user no need to repeatedly enter the same information. Also the clear instruction provided by error message makes the interaction more straightforward.
-
Cons: The interaction can only be stopped when user successfully complete the process or use
quit
to exit half-way.
-
-
Alternative 2: Quite from current step with proper error message.
-
Pros: Quit the interaction immediately, which allows user to start with a new interaction. It will be useful when user want to quit from a particular process but forgets the exit command (i.e.
quit
). -
Cons: User has to restart the entire interaction process when the he/she enter invalid command.
-
5.2. Due Soon Tasks Feature
5.2.1. Implementation
The Due Soon Tasks feature allows users to view the tasks that have deadlines within the next week.
This feature is implemented using a panel on the main window with a list of tasks Due Soon that is updated with every command that may affect Due Soon task list (such as add, delete or archive).
Some situations that trigger due soon feature are:
-
When user enters a task:
-
What it does:
-
When a task that is added to the main list, is due within the next week, it is automatically added to the list of due soon tasks.
-
The list is automatically sorted to be in increasing order of deadlines.
-
The time left for the deadline is also added.
Figure 10. Activity Diagram for Add to Due Soon list
-
-
Details:
-
The add command when entered by the user, triggers the creation of an object of the InteractivePrompt class (in this case AddTaskInteractivePrompt).
-
In the AddTaskInteractivePrompt class, the data entered by user is parsed.
-
If there are no errors, the AddTaskCommand object is created which triggers the addTask() function in Model.
-
This function in turns calls addTask() function in Study Buddy.
-
This function calls the isDueSoon() function in Task to confirm if the task belong to the due soon list.
-
If it does, it is added to due soon list and main list, and the due soon list is sorted. Else, it is simply added to the main list.
Figure 11. Sequence Diagram for Add to Due Soon listCautionThe lifeline for every member should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline reaches the end of diagram.
-
-
-
When user deletes a task:
-
What it does:
-
When a task that is deleted from the main list occurs in the due soon list as well, it is automatically deleted.
Figure 12. Activity Diagram for Delete from Due Soon list
-
-
Details:
-
The delete command when entered by the user, triggers the creation of an object of the InteractivePrompt class (in this case DeleteTaskInteractivePrompt).
-
In the DeleteTaskInteractivePrompt class, the data entered by user is parsed.
-
If there are no errors, the DeleteTaskCommand object is created which triggers the deleteTask() function in Model.
-
This function in turns calls removeTask() function in Study Buddy.
-
removeTask() calls the updateDeleteDueSoon() function in StudyBuddy which checks if the task exists in the due soon list.
-
If it does, it is deleted from the due soon list and main list. Else, it is simply deleted from the main list.
Figure 13. Sequence Diagram for Delete from Due Soon listCautionThe lifeline for every member should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline reaches the end of diagram.
-
-
-
When user refreshes due soon list:
-
What it does:
-
Refreshes the list of due soon tasks and status tags. This command is useful for a situation where due soon list is not up to date due to a drastic change in time.
Figure 14. Activity diagram for refresh
-
-
Details:
-
The refresh command when entered by the user, triggers the creation of an object of the InteractivePrompt class (in this case RefreshTaskInteractivePrompt).
-
In the RefreshTaskInteractivePrompt class, the data entered by user is parsed.
-
If there are no errors, the RefreshCommand object is created which clears the due soon list and then, iterates through the main list and calls addDueSoonTask() in Model, for any tasks that are due soon.
Figure 15. Sequence diagram for refreshCautionThe lifeline for every member should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline reaches the end of diagram.
-
-
-
When the application launches:
-
What it does:
-
It loads the due soon tasks into a panel by filtering tasks that are due soon from the main list.
-
This is necessary, because old list of due soon tasks may not be up-to-date.
-
-
Details:
-
The addTask() function in StudyBuddy class already checks if task is due soon and adds to due soon list (as mentioned above).
-
While all tasks are being added to their respective lists in JsonSerializableStudyBuddy class, the due soon list gets automatically updated.
-
-
|
Note
|
Other commands like edit, archive etc also trigger due soon feature in a similar manner. |
|
Note
|
Calculation of time left for deadline and check for if task is due soon can be found in the Task class. |
5.2.2. Example Usage Scenario
Given below is an example usage scenario and how the Due Soon list mechanism behaves at each step.
Step 1. The user launches the application for the first time.
The list of tasks Due Soon will be initialized and displayed with the initial study buddy state. Initialization is done by filtering tasks that are Due Soon from the general list of tasks.
Step 2. The user executes add
command to add a task.
The add
command execution checks if this task belongs in the Due Soon tasks list (i.e it is due in 7 days). If it does, the task is added to both lists, else it is only added to the main list.
Step 3. The user executes delete
command to delete a task.
The delete
command execution also checks if this task exists in the Due Soon task list. If it does, task is deleted from both lists, else it is only deleted from the main list.
Step 4. The user executes refresh
command to refresh the due soon task list.
The refresh
command execution will traverse the main list and check if there are any inconsistencies. For example, if there has been a change in time and a task is missing from the due soon task list, it will be added.
It will also update the time left.
|
Note
|
If there are no such inconsistencies, the refresh command will not make any changes to the Due Soon task list. |
5.2.3. Design Considerations
Aspect: How refresh
command works
-
Alternative 1 (current choice): Clear and reload the due soon task list.
-
Pros: Less prone to errors since the entire list is "refreshed".
-
Cons: More operation intensive.
-
-
Alternative 2: Does not clear and reload the due soon task list.
-
Pros: Fewer operations need to be performed.
-
Cons: May have be more prone to errors because list is not completely "refreshed". Some parts of it are the same.
-
5.3. Task Summary Feature
5.3.1. Implementation
-
Feature introduction
The task summary feature automatically summarizes the collected data into different charts. It also allows the user to click on a chart to find the relevant tasks. The UI of the feature is in the
Statistics
Page. -
Implementation detail
This feature is implemented using
JavaFx
charts such asPieChart
,AreaChart
andStackedBarChart
, as well as aTask List Panel
.The
Task List Panel
is used to show the relevant task records when the user clicks oncharts
. -
Table of Charts & DataBind & OnClick Action
TipTo improve the readability, only the tasks due or start within the next 60 days will be counted into Area Chart
.Chart Type Data Used OnClick Action PieChart
Compare the number of tasks in different statuses.
TaskStatus
,TaskCount
Display all tasks with the selected status.
AreaChar
Summarize the task deadlines or start dates for different modules.
ModuleCode
,Deadline/Start date
,
TaskCount
Click on area:
Display tasks under the selected module.
Click on data point:
Display tasks under the selected module and will due or start the chosen date.StackedBar Chart
Compare the weight of different types of tasks in each module.
ModuleCode
,TaskType
,WeightSum
Display tasks under the selected module and type.
Figure 16. Sequence diagram for task summary UI update when data change -
OnChangeListener
The feature listens to the change of
Model’s
UnArchived Task Records
,Archived Task Records
andModule Records
.Once a change is captured, the charts will automatically re-render to show the latest statistics.
Currently, commands as
add
edit
delete
sort
find
archive
done
list
clear
etc. can trigger the refresh of the charts.Figure 17. Sequence diagram for task summary UI update when data changeNoteIt is possible that the labels of charts can overlap together. This is an unfixed bug regarding the JDK which is caused by JavaFX chart off-sync. To get more information, you may refer to here. When this issue happens, you can use any command that can trigger chart updating to refresh.
5.3.2. Example Usage Scenario
Given below is an example usage scenario and how the task summary mechanism behaves at each step.
Step 1. The user launches the application for the first time, the statistics will perform on top of the sample records,
and the result will be visualized into different charts organized in the Tab Panel
. After the user clicks Statistics
from the top menu bar, the Tab Panel
and the Task List Panel
will display.
Step 2. The user navigates to the Statistics
Page for the first time. The Tab Panel
should
display the Pie Chart
and the Task List Panel
is empty with a title: "Click on Chart to View Related Tasks".
Indeed, this is how the Statistics
Page looks like every time the user navigates back from another Page.
Step 3. The user clicks on Pie Chart
's Pending
portion. All tasks in Pending
status should display in Task List Panel
.
Meanwhile, the title of the Panel will change to "PENDING: # Tasks" (# stands for the number of Pending
tasks).
Step 4. The user clicks on Area Chart
's CS2101
area. All tasks under CS2101
should display in Task List Panel
.
Meanwhile, the title of the Panel will change to "Tasks under CS2101".
Step 5. The user executes add
command at Statistics
Page,
the charts should update automatically.
Step 6. The user executes done
command at another page, and navigate back to Statistics
Page
the charts should show the latest statistics.
5.3.3. Design Considerations
Aspect: Will this feature contribute value to CLI user
- Consideration
-
Task Summary feature involves mouse clicking event when user retrieving relevant tasks.
- Explanation
-
The Task Summary Feature provides tow main services:
-
The automatic statistics of the user input (i.e. the tasks and modules information).
-
The relevant records retrieving.
The retrieving service is built on top of the statistics result. Meanwhile, the statistics is auto-generated along the way the user managing their records using keyboard input.
Therefore, this feature can make a fast typist be more productive, especially when Study Buddy supports the CLI. -
Aspect: How to update charts
-
Alternative 1 (current choice): Use
onChangeListener
to monitor the data update and re-render the UI simultaneously.-
Pros: More user-friendly, no need to ask user to manually update.
-
Cons: Might encounter JavaFX chart off-sync bug, and results in label overlapping. But user can always use another command which can trigger data updating to walk around this problem.
-
-
Alternative 2: Trigger the UI rendering by asking the user to re-launch the application or navigate away and back to the page.
-
Pros: Safe from the JavaFX chart off-sync bug.
-
Cons: Force user to close or navigate around the application every time he/she wants to check the updated charts.
-
5.4. Calendar feature
5.4.1. Implementation
The calendar feature displays a calendar for users.
The feature is implemented by overriding the task list display panel on the main window with calendar box. The calendar currently supports following features:
-
Displays the name of all tasks on that day in the calendar grid.
-
Access calendars in previous or next month using the buttons on top.
-
Displays more information about tasks for the day on the Due Soon panel after clicking on a grid.
-
Fast forward to a specific year/month using CLI.
When a calender is requested, a CalendarPanel object is constructed, the object diagram below shows the structure of a CalendarPanel. We will be using the date 01/04/2020
as an example.
5.4.2. Example usage scenarios
Using mouse click
Clicking on the show calendar menu item under the calendar menu will enable this feature. Upon requesting for the calendar to be shown:
-
The calendar box object will be constructed
-
The calendar loops through every day of the month while searching for tasks due on that day
-
The task name is added to the calendar grid
Using CLI
As of Study Buddy v1.4, a new feature has been added that allows users to navigate the calendar using CLI.
-
The user enters 'calendar' into the command box.
-
The user enters the selected date into the command box.
-
Calendar will be generated the same way as a mouse click, however, it will use the selected date as parameters.
Below is an activity diagram describing the events that will happen:
5.4.3. Design considerations
-
It is more efficient to cache the calendar rather than to generate a new one, however, we do not expect the user to have too many tasks and therefore it should not slow down the application.
5.5. Archive feature
Archive stores selected task away into a separate task list, this command is used when the user has completed a task but still wants to keep track of it.
5.5.1. Implementation
Archive uses both the old delete and a new archive command. Upon executing the archive command, it will call the model to delete the task and archive it elsewhere.
The archived task list is stored within Model as a seperate list.
|
Note
|
The index for archived tasks are not used for any commands other than unarchive .
|
Sequence diagram:
|
Caution
|
The lifeline for every member should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline reaches the end of diagram. |
5.6. Productivity feature
5.6.1. Implementation
The productivity feature displays insights related to the user’s productivity over the past day, week and more on the Productivity panel. The Productivity page is integrated with the main page as a side panel.
The Productivity page is further composed of 3 tabs:
-
Daily Productivity Tab
-
Weekly Productivity Tab
-
Productivity Points Tab
The Productivity page can be viewed by clicking on the Productivity menu item, which directs the user to the Daily Productivity Tab. The Productivity page can also be viewed by clicking on the Productivity Points shown on the top right of the application window. This directs the user to the Productivity Points Tab.
The productivity feature is facilitated by the Statistics
class, which allows
StudyBuddy to keep track of relevant usage statistics of the user.
Statistics
is further composed of classes that keep track of specific statistics:
-
CompletionStats
keeps track of the number of tasks completed by the user each day and each week -
OverdueStats
keeps track of the number of tasks that went overdue each day and each week. -
ScoreStats
keeps track of the user’s Productivity Points and rank each day -
GeneralStats
keeps track of the user’s goal, streak, and other statistics not covered by the other statistics classes
The user can gain or lose Productivity Points in StudyBuddy when certain actions or events are completed. These include:
-
Adding a task: +1
-
Completing a task: +10
-
Completing your daily goal: +(points equivalent to daily goal)
-
Using advanced features; +1
-
Letting a task go Overdue: -1
Each usage statistic is updated accordingly when the respective user action or event
has concluded. These statistics are then rendered on the ProductivityPanel
.
The chart visualizations are implemented using ProgressIndicator
, BarChart
and AreaChart
.
When the statistics are updated, the task list’s event listener and classes implementing
GoalObserver
will be informed of the changes. ProductivityPanel
re-renders the
displayed information when either of these are updated.
The data displayed will be automatically updated upon calling any of the following commands:
-
add
-
done
-
delete
-
refresh
-
goal
5.6.2. Example Use Scenario
Given below is an example usage scenario and how the Productivity feature behaves at each step.
Step 1: The user launches the application.
Step 2: The Productivity feature displays the user’s Productivity Points on the top right of the screen.
Step 3: The user clicks the Productivity Menu button
Step 4: The Daily Productivity Tab is displayed to the user
Step 5: The user completes a task using done
Step 6: The daily number of tasks is added and Productivity Points is increased.
If the daily goal has been reached, the user’s streak is incremented.
Here is an activity diagram of the aforementioned steps:
Extension: Suppose the user sees the Productivity Points and clicks it Step 3: The user clicks the Productivity Points on the top right of the screen Step 4: The Productivity Points Tab is displayed to the user
From here, the user can continue to manage tasks as per Step 5 and 6 above, or navigate to other Productivity tabs.
Clicking the Productivity menu item
image
5.6.3. Design Considerations
Aspect: How to re-render Productivity Panel when statistics are updated
Alternative 1: re-render only the values that have been updated
-
Pros: maximizes loading speed and minimizes lag for the user
-
Cons: increases complexity for codebase, higher chance of bugs occuring
Alternative 2: always re-render the whole Productivity Panel
-
Pros: easy to implement
-
Cons: may result in slower loading speed and more lag for the user
Alternative 3 (current choice): re-render only the values that have been updated if it does not result in increased code complexity
-
Pros: improves loading speed and decreases lag for the user, while keeping the codebase readable and easy to reason with.
-
Cons: may result in slower loading speed. However, based on testing, this trade-off does not result in any measurable delay.
5.7. Modules
The modules
feature enables users to be able to group and view their tasks according to various modules or subjects.
Each module is assigned with a unique module code & a name.
By default, all task created with the add
command will be be assigned to module code OO0000O
.
5.7.1. Implementation
Modules are created with create mods
Command and the program will request for a module name and module code. There are no restrictions on module name as long as it is not an empty entry.
Module codes however, require at least an alphabetical prefix, a number, and a postfix(optional).
Correct moduleCodes:
A0A
CS11X
AA1234
Incorrect moduleCodes:
123456
CAT
555T
5.7.2. Sequence diagram for creating modules
This is a sequence of how a module is created using the create mods
feature. Take note that all interactions go through the CommandBox
first in the UI, but it will be omitted from this diagram for simplicity.
5.8. Logging
We are using java.util.logging
package for logging.
The LogsCenter
class is used to manage the logging levels and logging destinations.
-
The logging level can be controlled using the
logLevel
setting in the configuration file (See Section 5.9, “Configuration”) -
The
Logger
for a class can be obtained usingLogsCenter.getLogger(Class)
which will log messages according to the specified logging level -
Currently log messages are output through:
Console
and to a.log
file.
Logging Levels
-
SEVERE
: Critical problem detected which may possibly cause the termination of the application -
WARNING
: Can continue, but with caution -
INFO
: Information showing the noteworthy actions by the App -
FINE
: Details that is not usually noteworthy but may be useful in debugging e.g. print the actual list instead of just its size
5.9. Configuration
Certain properties of the application can be controlled (e.g user prefs file location, logging level) through the configuration file (default: config.json
).
5.10. [Proposed] Data encryption
Since Study Buddy is an offline application, there is no threat of being attacked via a network channel. However, in case the computer has a shared owner, a password feature can be implemented in the future for privacy purposes.
5.10.1. Implementation
The goal is to encrypt taskList3.json
, while still allowing the owner to access his/her tasks using his password.
We will be using AES (Advanced Encryption Scheme) for encryption, and a slow hashing algorithm to derive a key from the user’s password. The slow hashing algorithm is to prevent brute force attacks.
Decryption
-
User enters a password.
-
If the password is correct, the same key should be hashed and taskList.json can be decrypted.
-
If the password is incorrect, user will be allowed to try again.
We leave it to the user’s own jurisdiction to create a strong password.
6. Documentation
Refer to the guide here.
7. Testing
Refer to the guide here.
8. Dev Ops
Refer to the guide here.
Appendix A: Product Scope
Target user profile:
-
has a need to manage a significant number of tasks for various modules
-
appreciates visualization tools to aid in task management
-
prefers desktop apps over mobile apps
-
can type fast
-
prefers typing over mouse input
Value proposition: manages tasks faster than a typical mouse/GUI driven app
Appendix B: User Stories
Priorities: High (must have) - * * *
, Medium (nice to have) - * *
, Low (unlikely to have) - *
| Priority | As a … | I want to … | So that I can… |
|---|---|---|---|
|
new user |
see usage instructions |
refer to instructions when I forget how to use the App |
|
user |
view a list of my tasks |
know what I have Pending |
|
user |
add a new task |
view all my tasks in one place |
|
user |
delete a task |
remove entries that I no longer need |
|
user |
mark a task as completed |
update my list of Pending tasks |
|
user |
find a task by keyword |
locate details of a task without having to go through the entire list |
|
user with task deadline extended |
edit the particular task |
update my task accordingly |
|
user with many deadlines |
sort tasks in order of deadlines |
organise my list by priority |
|
user |
archive tasks |
separate the tasks that are not applicable right now |
|
user |
view renamed tasks |
easily filter out any renamed data in my list |
|
user |
filter all pending tasks |
view all my Pending tasks in one place |
|
user who likes organization |
view all my tasks that are Due Soon |
know what to focus on in the next week |
|
user who makes typos |
be able to edit a task I have added |
correct any typos I have made |
|
user who is forgetful |
have an interactive command prompt |
not have to remember long commands |
|
user who is starting a new semester |
clear all my tasks |
start adding on to an empty list |
|
user who takes many modules |
add my modules |
view my modules |
|
user who has many tasks |
check the summary of their current status |
better plan my time |
|
user who has many tasks |
check the summary of their current status |
better plan my time |
|
user who finds it hard to keep track of all my deadlines |
have a calendar |
easily find tasks due on a day |
Appendix C: Use Cases
(For all use cases below, the System is Study Buddy
and the Actor is the statistics
, unless specified otherwise)
Use case: List task
MSS
-
User is on the
All tasks
orproductivity
tab. -
User requests to list tasks
-
Study Buddy shows a list of unarchived tasks
Use case ends.
Use case: Delete task
MSS
-
Refer to List task use case
-
User requests to delete a specific task in the list
-
Study Buddy asks for the index
-
User provides index
-
Study Buddy deletes the task
Use case ends.
Extensions
-
2a. The list is empty.
Use case ends.
-
3a. The given index is invalid.
-
3a1. Study Buddy shows an error message.
Use case resumes at step 2.
-
Use case: Filter tasks
MSS
-
User requests to filter tasks
-
Study Buddy shows two options for filter
-
User requests to filter by status
-
Study Buddy provides options to filter by status
-
User provides input
-
Study Buddy shows filtered task list
Use case ends.
Extensions
-
3a. The given index is invalid.
-
3a1. Study Buddy shows an error message.
Use case resumes at step 2.
-
-
3a. User chooses to filter by type instead.
-
4a. Study Buddy provides options to filter by type
Use case resumes at step 5.
-
Use case: View renamed
MSS
-
User requests to view renamed tasks
-
Study Buddy shows a list of renamed tasks
Use case ends.
Extensions
-
2a. The list is empty.
Use case ends.
-
3a. There are no duplicate tasks
Use case ends.
Use case: Refresh
MSS
-
User notices Due Soon list needs to be updates
-
User requests to refresh
-
Study Buddy refreshes the Due Soon list and status tags
Use case ends.
Extensions
-
2a. The list is empty.
Use case ends.
-
3a. There is nothing to refresh
Use case ends.
Appendix D: Non Functional Requirements
-
Should work on any mainstream OS as long as it has Java
11
or above installed. -
Should be able to hold a good number of tasks without a noticeable sluggishness in performance for typical usage.
-
A user with above average typing speed for regular English text (i.e. not code, not system admin commands) should be able to accomplish most of the tasks faster using commands than using the mouse.
Appendix E: Glossary
- Mainstream OS
-
Windows, Linux, Unix, OS-X
- GUI
-
Graphical User Interface i.e a user interface that allows users to interact using graphical icons rather than text-based user interfaces
- Index
-
The index of a task refers to the sequence number of a task in the dashboard
Appendix F: Instructions for Manual Testing
Given below are instructions to test the app manually.
|
Note
|
These instructions only provide a starting point for testers to work on; testers are expected to do more exploratory testing. |
F.1. Launch and Shutdown
-
Initial launch
-
Download the jar file and copy into an empty folder
-
Double-click the jar file
Expected: Shows the GUI with a set of sample tasks. The window size may not be optimum.
-
-
Saving window preferences
-
Resize the window to an optimum size. Move the window to a different location. Close the window.
-
Re-launch the app by double-clicking the jar file.
Expected: The most recent window size and location is retained.
-
F.2. Deleting a task
-
Deleting a task while all tasks are listed
-
Prerequisites: List all tasks using the
list
command. Multiple tasks in the list. -
Test case:
delete [Enter]
+1
Expected: First task is deleted from the list. Successful deletion indication in the status message. -
Test case:
delete [Enter]
+0
Expected: No task is deleted. Error details shown in the status message. -
Other incorrect delete commands to try:
delete x
(where x is anything)
-
F.3. Saving data
-
Dealing with missing/corrupted data files
-
Prerequisites: Delete the "tasklist.json" file from data folder.
-
Test case: Launch the application
Expected: The application indicates that the data file needed is missing and creates one. c -
Prerequisites: Modify the "tasklist.json" file to show some incorrect data.
-
Test case: Launch the application
Expected: The application indicates that the data file is corrupted. Application launches successfully but has no data.
-
Appendix G: Effort
Interactive prompt
-
AB3 requires users to input a whole line of text at once, which is unintuitive and prone to typos by the user. Furthermore, AB3 uses tags like “\p” to break the user’s input up for parsing. This means that users will not be able to use these strings for any of their inputs.
-
Study buddy fixes that issue by introducing an interactive prompt for every command. This required a lot effort as there had to be an interactive prompt for every command.
Refactoring
-
AB3 uses the
Person
class which had 5 fields. Study buddy has 12 fields, every one of them is used in a major feature.


Sign In
Sign Up
Sign In
Sign Up
Add Event
Search Events
Add Event
Search Events
Add a Center
Search Centers
Add a Center
Search Centers
SignIn/SignUp
arrow_drop_down
Events
arrow_drop_down
Centers
arrow_drop_down
Guest
event
Event Manager
menu
SignIn/SignUp
arrow_drop_down
Events
arrow_drop_down
Centers
arrow_drop_down
Guest
Sign In
Haven't Signed Up?
Click Here to Sign Up


created 04/17/98; revised: 01/03/99, 10/28/99, 01/22/00, 07/20/02, 05/25/03
The for
statement is
a convenient way to program counting loops,
although
it can be used to build all of the three types of loops.
Anything it does could also be done with the fundamental control
statements you already know.
But the for
statement often says just what you want in a
compact, easily understood format.


Antenna Monitoring
This file contains prototype definitions for the antenna diagnosis APIs.
IPC interfaces binding
All the functions of this API are provided by the modemService.
Here's a code sample binding to modem services:
bindings: { clientExe.clientComponent.le_antenna -> modemService.le_antenna }
Cellular or Diversity antenna
Diagnostics principle
This functionality allows to detect or not the presence of an antenna or to detect a defective antenna.
Antenna diagnosis is based on the following principle :
A very small D.C. current goes through the coaxial cable to the antenna. A resistive bridge is realized to provide different voltages depending on the antenna state.
It is mandatory to use a specific antenna. The antenna used have to be built with a resistor between radiating element and ground.
The states to diagnose are listed here:
- Antenna in open circuit: there is no antenna but RF open circuit
- Antenna in close circuit: presence of antenna
- Antenna in short circuit: with or without antenna, short circuit for RF path.
Thresholds
Configurable thresholds are compared to the ADC (Analog to Digital Converter) reading from the antenna diagnostic voltage to determine in which state the RF (Radio Frequency) is.
Two thresholds are set to decide the state:
short limit open limit ---- short circuit ----|---- close circuit ----|---- open circuit ---- unknown state | presence of antenna | no antenna
A short event is reported for the Cellular or Diversity antenna if the ADC value is lower than the corresponding short limit. An open event is reported for the Cellular or Diversity antenna if the ADC value is higher than the corresponding open limit.
- Note
- The open threshold is always HIGHER than the short threshold.
GNSS antenna
- Warning
- Ensure to check the supported antenna diagnosis for your specific platform.
Diagnostics principle
This functionality allows to detect or not the presence of an antenna or to detect a defective antenna.
The antenna diagnosis is based on the measurement of the current consumption for a GNSS active antenna. Moreover a current hardware protection circuitry is able to protect the power supply of that active antenna.
The states to diagnose are listed here:
- Antenna in short circuit: with or without antenna, short circuit for RF path.
- Antenna in open circuit: there is no antenna but RF open circuit.
- Antenna in close circuit: presence of antenna.
- Antenna in over current : with or without antenna, short circuit for RF path and current hardware protection circuitry has tripped.
Thresholds
Configurable thresholds are compared to the ADC (Analog to Digital Converter) reading from the antenna diagnostic hardware design measuring the current to determine in which state the antenna is.
The following status are reported for the GNSS antenna if the ADC value is:
- SHORT_CIRCUIT: ADC value > short limit, but over current HW not tripped.
- CLOSE_CIRCUIT: short limit >= ADC value >= open limit.
- OPEN_CIRCUIT: ADC value < open limit.
- OVER_CURRENT: antenna is shorted and current HW protection circuitry has tripped.
- Note
- The open threshold is always LOWER than the short threshold.
Antenna diagnostic ADC selection
- Warning
- Ensure to check the supported antenna diagnosis for your specific platform.
By default, the antenna diagnostics use an internal ADC for reading the voltage from the integrated antenna diagnosis circuit if any.
An antenna design that makes use of an external antenna diagnosis circuit can still take advantage of the antenna monitoring service. Using the function le_antenna_SetExternalAdc(), the module can be instructed to monitor one of the external ADC’s to read the voltage from an external antenna diagnosis circuit rather than the internal ADC. Moreover, the le_antenna_GetExternalAdc() function reads the external ADC used to monitor the requested antenna.
API description
le_antenna_Request() API allows the application to monitor the requested antenna.
le_antenna_GetType() API retrieves the antenna type from an antenna reference.
le_antenna_SetShortLimit() API sets the ADC value used to detect a short circuit.
le_antenna_GetShortLimit() API gets the ADC value used to detect a short circuit.
le_antenna_SetOpenLimit() API sets the ADC value used to detect an open circuit.
le_antenna_GetOpenLimit() API gets the ADC value used to detect an open circuit.
le_antenna_AddStatusEventHandler() API adds a handler to be notified when the requested antenna status changed.
le_antenna_RemoveStatusEventHandler() removes the antenna status handler.
le_antenna_GetStatus() API gets the current antenna status.
le_antenna_SetExternalAdc() API sets the external ADC used to monitor the requested antenna.
le_antenna_GetExternalAdc() API gets the external ADC used to monitor the requested antenna.
Copyright (C) Sierra Wireless Inc. Use of this work is subject to license.


I am a seasoned commercially aware technology leader. I have lead teams in senior positions in development, product and design. I'm passionate about all areas of technology and try to get my hands dirty as often as I can.
Outside of work I have represented England in three World Indoor Lacrosse Championships and have over 20+ years in playing and developing mens lacrosse. I also love travel, skiing, reading, writing and trying to tempt people into having fun.


|
||||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See:
Description
| Interface Summary | |
|---|---|
| MetricsCollector | The metrics collector interface |
| MetricsInfo | Interface to provide immutable meta info for metrics |
| MetricsPlugin | The plugin interface for the metrics framework |
| MetricsRecord | An immutable snapshot of metrics with a timestamp |
| MetricsSink | The metrics sink interface. |
| MetricsSource | The metrics source interface |
| MetricsSystemMXBean | The JMX interface to the metrics system |
| MetricsVisitor | A visitor interface for metrics |
| Class Summary | |
|---|---|
| AbstractMetric | The immutable metric |
| MetricsFilter | The metrics filter interface |
| MetricsRecordBuilder | The metrics record builder interface |
| MetricsSystem | The metrics system interface |
| MetricsTag | Immutable tag for metrics (for grouping on host/queue/username etc.) |
| Exception Summary | |
|---|---|
| MetricsException | A general metrics exception wrapper |
This package provides a framework for metrics instrumentation and publication.
The framework provides a variety of ways to implement metrics
instrumentation easily via the simple
MetricsSource
interface
or the even simpler and more concise and declarative metrics annotations.
The consumers of metrics just need to implement the simple
MetricsSink
interface. Producers
register the metrics sources with a metrics system, while consumers
register the sinks. A default metrics system is provided to marshal
metrics from sources to sinks based on (per source/sink) configuration
options. All the metrics are also published and queryable via the
standard JMX MBean interface. This document targets the framework users.
Framework developers could also consult the
design
document for architecture and implementation notes.
org.apache.hadoop.metrics2.annotation
org.apache.hadoop.metrics2.impl
org.apache.hadoop.metrics2.lib
Gauge
*|
Counter
*|
Stat
] and
MetricsRegistry
.
org.apache.hadoop.metrics2.filter
GlobFilter
and
RegexFilter
.
org.apache.hadoop.metrics2.source
JvmMetrics
.
org.apache.hadoop.metrics2.sink
FileSink
.
org.apache.hadoop.metrics2.util
MetricsCache
.
| Using annotations | Using MetricsSource interface |
|---|---|
@Metrics(context="MyContext") class MyStat { @Metric("My metric description") public int getMyMetric() { return 42; } } |
class MyStat implements MetricsSource { @Override public void getMetrics(MetricsCollector collector, boolean all) { collector.addRecord("MyStat") .setContext("MyContext") .addGauge(info("MyMetric", "My metric description"), 42); } } |
In this example we introduced the following:
Metrics
annotation is
used to indicate that the class is a metrics source.
Metric
annotation
identifies a particular metric, which in this case, is the
result of the method call getMyMetric of the "gauge" (default) type,
which means it can vary in both directions, compared with a "counter"
type, which can only increase or stay the same. The name of the metric
is "MyMetric" (inferred from getMyMetric method name by default.) The 42
here is the value of the metric which can be substituted with any valid
java expressions.
Note, the MetricsSource
interface is
more verbose but more flexible,
allowing generated metrics names and multiple records. In fact, the
annotation interface is implemented with the MetricsSource interface
internally.
public class MySink implements MetricsSink { public void putMetrics(MetricsRecord record) { System.out.print(record); } public void init(SubsetConfiguration conf) {} public void flush() {} }
In this example there are three additional concepts:
In order to make use our MyMetrics
and MySink
,
they need to be hooked up to a metrics system. In this case (and most
cases), the DefaultMetricsSystem
would suffice.
DefaultMetricsSystem.initialize("test"); // called once per application DefaultMetricsSystem.register(new MyStat());
Sinks are usually specified in a configuration file, say, "hadoop-metrics2-test.properties", as:
test.sink.mysink0.class=com.example.hadoop.metrics.MySink
The configuration syntax is:
[prefix].[source|sink|jmx|].[instance].[option]
In the previous example, test
is the prefix and
mysink0
is an instance name.
DefaultMetricsSystem
would try to load
hadoop-metrics2-[prefix].properties
first, and if not found,
try the default hadoop-metrics2.properties
in the class path.
Note, the [instance]
is an arbitrary name to uniquely
identify a particular sink instance. The asterisk (*
) can be
used to specify default options.
Consult the metrics instrumentation in jvm, rpc, hdfs and mapred, etc. for more examples.
One of the features of the default metrics system is metrics filtering configuration by source, context, record/tags and metrics. The least expensive way to filter out metrics would be at the source level, e.g., filtering out source named "MyMetrics". The most expensive way would be per metric filtering.
Here are some examples:
test.sink.file0.class=org.apache.hadoop.metrics2.sink.FileSink test.sink.file0.context=foo
In this example, we configured one sink instance that would
accept metrics from context foo
only.
.source.filter.class=org.apache.hadoop.metrics2.filter.GlobFilter test.*.source.filter.include=foo test.*.source.filter.exclude=bar
In this example, we specify a source filter that includes source
foo
and excludes bar
. When only include
patterns are specified, the filter operates in the white listing mode,
where only matched sources are included. Likewise, when only exclude
patterns are specified, only matched sources are excluded. Sources that
are not matched in either patterns are included as well when both patterns
are present. Note, the include patterns have precedence over the exclude
patterns.
Similarly, you can specify the record.filter
and
metric.filter
options, which operate at record and metric
level, respectively. Filters can be combined to optimize
the filtering efficiency.
@Metrics(about="My metrics description", context="MyContext") class MyMetrics extends MyInstrumentation { @Metric("My gauge description") MutableGaugeInt gauge0; @Metric("My counter description") MutableCounterLong counter0; @Metric("My rate description") MutableRate rate0; @Override public void setGauge0(int value) { gauge0.set(value); } @Override public void incrCounter0() { counter0.incr(); } @Override public void addRate0(long elapsed) { rate0.add(elapsed); } }Note, in this example we introduced the following:
snapshot
. The MutableRate
in particular, provides a way to measure latency and throughput of an
operation. In this particular case, it produces a long counter
"Rate0NumOps" and double gauge "Rate0AvgTime" when snapshotted.
Users of the previous metrics system would notice the lack of
context
prefix in the configuration examples. The new
metrics system decouples the concept for context (for grouping) with the
implementation where a particular context object does the updating and
publishing of metrics, which causes problems when you want to have a
single context to be consumed by multiple backends. You would also have to
configure an implementation instance per context, even if you have a
backend that can handle multiple contexts (file, gangalia etc.):
| Before | After |
|---|---|
context1.class=org.hadoop.metrics.file.FileContext context2.class=org.hadoop.metrics.file.FileContext ... contextn.class=org.hadoop.metrics.file.FileContext |
myprefix.sink.file.class=org.hadoop.metrics2.sink.FileSink |
In the new metrics system, you can simulate the previous behavior by using the context option in the sink options like the following:
| Before | After |
|---|---|
context0.class=org.hadoop.metrics.file.FileContext context0.fileName=context0.out context1.class=org.hadoop.metrics.file.FileContext context1.fileName=context1.out ... contextn.class=org.hadoop.metrics.file.FileContext contextn.fileName=contextn.out |
myprefix.sink.*.class=org.apache.hadoop.metrics2.sink.FileSink myprefix.sink.file0.context=context0 myprefix.sink.file0.filename=context1.out myprefix.sink.file1.context=context1 myprefix.sink.file1.filename=context1.out ... myprefix.sink.filen.context=contextn myprefix.sink.filen.filename=contextn.out |
to send metrics of a particular context to a particular backend. Note,
myprefix
is an arbitrary prefix for configuration groupings,
typically they are the name of a particular process
(namenode
, jobtracker
, etc.)
|
||||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |


Toggle navigation
Menu
Simple Library Automation
List Books
List Authors
Rest Api List Books
Rest Api List Authors
Add Book
Add Author
Book Lists
Id
ISBN
Book Name
Publish Year
Publisher
Status
Action
Edit
Delete


Snyder Shares Photo of Gal Gadot Seeing Young Darkseid for the First Time
by Narayan LiuZack Snyder has slowly revealed much of his original vision for 2017's Justice League over the last year, excitedly describing how Darkseid was supposed to make his debut in the DCEU. Unfortunately, plans changed after the director was forced to exit during production due to a family tragedy. He was replaced with director Joss Whedon who brought with him a multitude of changes to Justice League.
Snyder recently posted a new image on Vero, featuring Gal Gadot in the middle of an ADR session, in front of a screen bearing the image of an early CGI render of Darkseid. Snyder accompanied the image with the caption, "That time in January 2017 when Diana came face to face with Uxas for the first time," once again referring to the classic comic book supervillain by his birth name.
Click the button below to start this article in quick view.
In the theatrical release of Justice League, there is a flashback sequence in which Steppenwolf and his horde invades Earth. It's narrated by Diana as she explains the film's villain to Bruce Wayne. It is uncertain whether or not Snyder's photo captures work on that sequence or if the image and its caption implies that Wonder Woman was actually supposed to confront the New God at one point.
This image was released soon after calls for Warner Bros. to release the "Snyder Cut" gained new prominence, following expressed support from some of the film's stars, including Gal Gadot, Ben Affleck, Jason Mamoa and Ray Porter, the latter of which portrayed Darkseid in unreleased footage. Warner Bros. and DC have stated that there are currently no plans to release the cut.
https://schema.orgBreadcrumbListListItem1Homehttps://www.cbr.com/ListItem2Movieshttps://www.cbr.com/category/movies/ListItem3Movie Newshttps://www.cbr.com/category/movies/news-movies/ListItem4Snyder Shares Photo of Gal Gadot Seeing Young Darkseid for the First Timehttps://www.cbr.com/snyder-shares-photo-of-gal-gadot-seeing-young-darkseid/


getPrototypeOf()
Summary
The getPrototypeOf() trap
"returns the prototype (i.e. the value of the
internal [[Prototype]]
property) of the specified
object."
Examples
In JavaScript, it's very common to have a constructor function with
methods defined on the prototype property of the function:
function Rectangle(width, height) {
this.width = width;
this.height = height;
}
Rectangle.prototype.getArea = function() {
return this.width * this.height;
};
var r = new Rectangle(3, 4);
r.getArea(); // returns 12
The prototype of r
in this case is Rectangle.prototype.
Reflect.getPrototypeOf(r) === Rectangle.prototype;
// returns true
The getArea()
method is available to the r
object because it inherits from
Rectangle.prototype
.
Usage in es7-membrane
I do not recommend disabling the getPrototypeOf() trap, because
prototypes are central to the normal operation of JavaScript.
Currently, it throws an exception when disabled.
Coming soon
When the getPrototypeOf() trap is disabled, it will return null to indicate there is no prototype available.
Reflect.getPrototypeOf()
by
Mozilla Contributors
is licensed under
CC-BY-SA 2.5
.
setPrototypeOf()
Summary
The setPrototypeOf() trap
"sets the prototype (i.e., the internal
[[Prototype]]
property) of a specified object to
another object or to null."
Examples
In JavaScript, it's very common to have a constructor function with
methods defined on the prototype property of the function:
function Rectangle(width, height) {
this.width = width;
this.height = height;
}
Rectangle.prototype.getArea = function() {
return this.width * this.height;
};
var r = new Rectangle(3, 4);
r.getArea(); // returns 12
The prototype of r
in this case is Rectangle.prototype.
The getArea()
method is available to the r
object because it inherits from Rectangle.prototype
.
Setting the prototype means altering all the inherited
properties of the object you're inspecting:
function Rectangle(width, height) {
this.width = width;
this.height = height;
}
Rectangle.prototype.getArea = function() {
return this.width * this.height;
};
var r = new Rectangle(3, 4);
const newProto = {
getPerimeter: function() {
return (this.width + this.height) * 2;
}
};
Reflect.setPrototypeOf(r, newProto);
r.getPerimeter(); // returns 14;
try {
r.getArea(); // throws TypeError: r.getArea is not a function
}
catch (e) {
// do nothing
}
Reflect.setPrototypeOf(newProto, Rectangle.prototype);
r.getArea(); // returns 12
Usage in es7-membrane
I strongly recommend disabling the setPrototypeOf() trap, because
anyone who sets a prototype on your objects effectively owns all the
inherited properties of your objects. For this reason, the
setPrototypeOf() trap is not checked by default.
Reflect.setPrototypeOf()
by
Mozilla Contributors
is licensed under
CC-BY-SA 2.5
.


1. What was the first graphical web browser?
2. What is the interconnected network of computer networks that spans the globe?
3. The World Wide Web was invented by?
4. What does HTTP stand for?
5. Who is responsible for coordinating the assignment of internet domain names, IP numbers, protocol parameters and protocol port numbers?
6. The extranet is?
7. Who is responsible for the development of recommendations and prototype technologies related to the web?
8. What should you ask yourself when determining whether the information on a web page is reliable?
9. Two or more computers connected for the purpose of communicating or sharing resources are considered?
10. A network is made up of:
11. An intranet:
12. A client workstation computer:
13. What is a LAN?
14. What are examples of a protocol?
15. What does a file transfer protocol do?
16. Transmission Control Protocol:
17. Each device has a unique:
18. What does a uniform resource identfier do?
19. What is a URL?
20. What is a domain name?
21. What is the top level domain name of www.google.com?
22. What is an example of a markup language?
23. Who administers the top level domain name?
24. What is a subdomain?
25. What is an example of a second level domain name?
Question 1: The correct answer is the Mosaic.
Question 2: The correct answer is The Internet.
Question 3: The correct answer is Time Berners Lee.
Question 4: The correct answer is Hypertext Transfer Protocol.
Question 5: The correct answer is ICANN.
Question 6: The correct answer is A private network.
Question 7: The correct answer is W3C.
Question 8: The correct answer is How recent is the information?.
Question 9: The correct answer is A network.
Question 10: The correct answer is A server computer and a client workstation computer.
Question 11: The correct answer is the All of the above.
Question 12: The correct answer is Is a work station used by individuals such as a personal computer on a desk.
Question 13: The correct answer is Local Area Network.
Question 14: The correct answer is All of the above.
Question 15: The correct answer is Moves files from one computer to the next.
Question 16: The correct answer is All of the above.
Question 17: The correct answer is IP Address.
Question 18: The correct answer is Identifies a resource on the internet.
Question 19: The correct answer is Uniform Resource Locator.
Question 20: The correct answer is google.com.
Question21: The correct answer is .com.
Question 22: The correct answer is All of the above.
Question 23: The correct answer is ICANN.
Question 24: The correct answer is A separate website located at the same domain.
Question 25: The correct answer is google.
You answered them all right!


Developer Student Clubs (DSC) are community groups for students from any academic background in their undergraduate or graduate term. By joining a DSC, students build their professional and personal network, get access to Google developer resources, and work together to build solutions for local problems in a peer-to-peer learning environment. DSC is a Google Developers program for university students, designed to help them build their mobile and web development skills and knowledge. It is open to any student, ranging from novice developers who are just starting, to advanced developers who want to further their skills. It is intended to be a space for students to learn and collaborate as they solve mobile and web development problems. Developer Student Clubs (DSC) are community groups for students from any academic background in their undergraduate or graduate term. By joining a DSC, students build their professional and personal network, get access to Google developer resources, and work together to build solutions for local problems in a peer-to-peer learning environment.
Consistency is about building small empowering habits and rituals that you partake in every single day that keep you focused on your highest priorities and goals.
 When you are matched with someone who never gives up, it is near impossible to beat them.
“What good is an idea if it remains an idea? Try. Experiment. Iterate. Fail. Try again. Change the world. There’s a way to do it better—find it.” – Simon Sinek
Following is the list of Future Plans of DSC, IIIT Nagpur. What you get by achieving your goals is not as important as what you become by achieving your goals.