Use radio buttons when users must choose one option from a set of up to five. Use radio buttons in modals where users confirm decisions before changes take effect.
Use icon radio button groups when icons clearly communicate the options and fit under a single label.
Use radio buttons to enable conditional inputs. For options that enable one or two inputs, disable the inputs until users select the radio buttons. For options that enable more inputs, hide the inputs until users select the radio buttons. If all options in a radio button group enable conditional inputs or significantly change the workflow, consider using action buttons instead.
Don’t use radio buttons when users must choose from more than five items. Use a different selection input instead.
Don’t use radio buttons for two options that are exact opposites. Use a checkbox instead.
Don't use radio buttons when user selections significantly alter the workflow. Use action buttons instead, and place them at the beginning of the task.
Don’t use icon radio buttons when icons don't clearly communicate options. Use radio buttons with text labels to provide context.
Don’t use ungrouped icon radio buttons. Use icon radio button groups to connect the options visually.
When radio buttons are in grid columns, text labels are not required if column headings provide the necessary context. Use text labels for all other states.
Icon radio buttons can use background and border color that match status indicator types such as success or danger.
| Selected |
|
| Unselected |
|
| Hover |
|
| Disabled |
|
Radio buttons may or may not use a preceeding label to provide context for the options. Unlike text input labels, this label may use verbs or questions. If you do not include a label, provide context for the consequences of the choices in the radio button text labels.
Icon radio buttons use the FontAwesome 4.7 icon library. For a list of common icons, see the SKY UX icon dictionary. Icon radio buttons must use a
Arrange traditional radio buttons vertically to make it easy to see all options, scan their labels, and see the selected option.
Use the form classes to separate radio button groups from other form elements.
For a group of radio buttons, use the
Also for a group of radio buttons, use the
For icon radio buttons, use the


Patapaa finally speaks on how he nearly lost his life through poisoning
by Lizbeth BrownGhanaian hiplife musician Justice Kwaku Amoamo popularly known as Patapaa has finally spoken after he collapsed on stage few minutes to a show in Tarkwa.
According to the “One Corner” hitmaker, he nearly passed away because he was poisoned by a friend.
The Swedru-based musician revealed that he requested for an energy drink before going on stage but later had a serious stomach upset where he was rushed to the hospital.
Patapaa explained that he was in a critical condition but was saved by God. He also added that he worked towards Eagle Prophet’s death prophecy on his life.
“I was poisoned when I went for a show at Tarkwa where I asked for an energy drink. My vomit was as dark as a polythene bag and my stool was black and filled with blood”, Patapaa revealed.
It could be recalled that the General Overseer of God’s Crown Chapel Reindolph Oduro Gyebi popularly known as Eagle Prophet recently revealed that Patapaa would be poisoned by his very close friend.
Patapaa has however confirmed Eagle Prophet’s prophecy explaining how he nearly lost his life after his friend tried to poison him.


Toggle navigation
My Pantry
Meats
Ground Beef
ADD
Chicken
ADD
Vegetables
Carrots
ADD
Pepper
ADD
Fruits
Banana
ADD
Apple
ADD
Dairy
Milk
ADD
Eggs
ADD
Grain
Rice
ADD
Wheat
ADD


WELCOME TO EDYST LEARN CODING
Let's learn web developtment in a fun way.
What are Pocket Monsters?
Pokémon is a series of video games developed by Game Freak and published by Nintendo and The Pokémon Company as part of the Pokémon media franchise. Created by Satoshi Tajiri with assistance from Ken Sugimori,the first games released in 1996 in Japan for the Game Boy, and the main series of role-playing video games (RPGs), also referred as the "core series" by their developersLet us know some pokemon types.
Water
Water is one of the three basic elemental types along with Fire and Grass, which constitute the three starter Pokémon. This creates a simple triangle to explain the type concept easily to new players. Water is the most common type with over 100 Pokémon, which are based on a wide variety of fish and other sea-dwelling creatures.
Fire
Fire is one of the three basic elemental types along with Water and Grass, which constitute the three starter Pokémon. This creates a simple triangle to explain the type concept easily to new players. Fire types are notoriously rare in the early stages of the games so choosing the Fire variation starter is often a plus. Grass
Grass
Grass is one of the three basic elemental types along with Fire and Water, which constitute the three starter Pokémon. This creates a simple triangle to explain the type concept easily to new players.Grass is one of the weakest types statistically, with 5 defensive weaknesses and 7 types that are resistant to Grass moves.
Statistics on Pokemon Go
Statistics of weight loss
The AR game's potential for weight loss was a big part of that discussion. In the process of getting out their doors and visiting parks, players found they were losing weight almost in spite of themselves. A Reddit Pokémon Go fan won acclaim for reporting that he'd lost 65 pounds between July and December.
Statistics of app downloads
Pokémon GO is one of the most successful mobile games of all time, breaking records like fastest to earn $100 million and most-downloaded in its first month of release. To date, it has grossed almost $2 billion in revenue and been downloaded 800 million times. Although no longer the global phenomenon it was in 2016, the game remains incredibly popular.
2020 Pokémon of the Year Revealed
Greninja
Water/Dark
Greninja is the final evolution of Pokémon X and Y water-type starter Froakie. It has the ability to take on an appearance resembling its trainer. Pokedex says: Greninja creates throwing stars out of compressed water. When it spins them and throws them at high speed, these stars can split metal in two.
Lucario
Fighting, Steelr
Lucario is a bipedal, wolf-like Pokémon with blue, cream, and black fur. It is considered to be prideful and loyal to its trainer. Pokedex says: By catching the aura emanating from others, Lucario can read their thoughts and movements.
Mimikyu
Ghost, Fairy
Mimikyu caused quite a stir for its peculiar looks and sad backstory when it was originally announced for Pokémon Sun and Moon in 2016. Mimikyu is described as a Pokémon who felt so lonely that it decided to wear a rag in order to look like Pikachu, everyone’s favorite Pokémon. Pokedex says: Its actual appearance is unknown. A scholar who saw what was under its rag was overwhelmed by terror and died from the shock.
Charizard
Fly, Fire
Charizard is an orange draconic Pokémon who has a fiery temper. It is the final evolution of Charmander, one of the starter Pokémon for the original game. Pokedex says: Charizard flies around the sky in search of powerful opponents. It breathes fire of such great heat that it melts anything. However, it never turns its fiery breath on any opponent weaker than itself.
Q and A
Questions Every Pokemon Trainer Should Be Able To Answer
- What Pokemon does Pikachu evolve into?
- We're sure you know this Electric mouse Pokemon, and you know it quite well. Basic knowledge of Pikachu is essential for every trainer, but you should also be well versed in the rodent's evolutionary chain. Pikachu, mighty as it is, has an even stronger evolved form also capable of generating vast amounts of electricity. Maybe you've bumped into this species in the wild. Either way, this is a question all Pokemon trainers should be able to answer.
- Answer is Raichu
-
What's the most effective Poke Ball in the game?
- Not all Poke Balls are made equally. There's the basic model you start your journey off with, but progressive upgrades are needed if you're looking to keep up with some of the stronger wild Pokemon who emerge in later routes. If you've made your way through any Pokemon game, you've reached the point where you're presented with the most effective Poke Ball known to man. This is a one shot catch, and no button mashing at all is required.
- Answer is Master Ball
Pokemon Battles
Here's a Pokémon Go type chart to get you started on what's effective against what.
Type chart, effectiveness and weakness explained in Pokémon Go
Pokémon battles appear in most forms of Pokémon media, being the central gameplay aspect of the core series games, as well as being a constant focus of the anime.
Pokémon Go's Types are exactly the same as those in the main Pokémon games, but the effect of those type matchups is slightly different: in brief, things like effective or resisted attacks have slightly different multipliers to the main Pokémon games - although a December 2018 update brought them slightly closer in line.
| Type | Strong Against | Weak Against | Resistant To |
|---|---|---|---|
| Normal | None | Rock, Ghost, Steel | Ghost |
| Fighting | Normal, Rock, Steel, Ice, Dark | Flying, Poison, Psychic, Bug, Ghost, Fairy | Rock, Bug, Dark |
| Fighting | Normal, Rock, Steel, Ice, Dark | Flying, Poison, Psychic, Bug, Ghost, Fairy | Rock, Bug, Dark |
| Fighting | Normal, Rock, Steel, Ice, Dark | Flying, Poison, Psychic, Bug, Ghost, Fairy | Rock, Bug, Dark |
| Fighting | Normal, Rock, Steel, Ice, Dark | Flying, Poison, Psychic, Bug, Ghost, Fairy | Rock, Bug, Dark |
Pokémon Go in 2020 continues to add new features, such the arrival of the Go Battle League, Remote Raids and the trade evolution feature. There are also planned changes to PokéCoins on the way. Meanwhile, coming soon is the Johto Throwback quest.
Book your tickets now
Want to know more about Pokemon?
Pokemon Card
Greninja
Ability: Torrent
It is the final evolution of Froakie, the Water-type starter from Kalos.
Let's know about pokemon trainers
Ash
Ketchum
Champion of Orange League
Ash Ketchum, known as Satoshi in Japan, is a fictional character in the Pokémon franchise owned by Nintendo. He is the protagonist of the Pokémon anime and certain manga series as well as on various merchandise related to the franchise. In Japanese, the character is voiced by Rika Matsumoto, and Hana Takeda.
Lance
Dragon Master
"Lance is a recurring character in Pokémon. He is a user of Dragon-types being the final Elite Four member in Red, Blue and their remakes. In Pokémon Gold, Silver, Crystal and their remakes, he is the Champion.Lance has appeared in the Pokémon series games from Generation I-III. He first appeared in the original Red and Blue games, being the final member of the Elite Four, and again in Generation III's Red and Blue remakes, FireRed and LeafGreen. Lance in the Generation II games differed from the previous though, as he was Pokémon Champion by this time. "
Cynthia
Shirona
"Cynthia is a powerful Pokémon trainer and the Champion of the Sinnoh region where Professor Carolina, Cynthia's grandmother, runs the Pokémon Research Lab in Celestic Town. She enjoys visiting the Solaceon Town Ruins. Later, in Pokémon: DP Galactic Battles, she helps fight Team Galactic as well. In the anime, she has a villa in east Unova but in the Pokémon Black and White games, she borrows Caitlin's villa (from the Elite Four). "
Ipsum Lorem
Ookido Yukinari Hakase
Ookido Yukinari Hakaseamuel Oak is most notable for his vast research facility, where he cares for and studies hundreds of Pokémon, including those owned by, but not currently traveling with, Trainers from Pallet Town. He has confidence in his grandson, Gary Oak, but more often joins Ash's mother and friends in cheering on Ash in his competitions. "
Generations - Cards
First generation
(1996–1999)
The original Pokémon games are Japanese role-playing video games (RPGs) with an element of strategy, and were created by Satoshi Tajiri for the Game Boy. The Pokémon series began with the release of Pocket Monsters Red and Green for the Game Boy in Japan. When these games proved popular, an enhanced Blue version was released sometime after, and the Blue version was reprogrammed as Pokémon Red and Blue for international release. The original Green version was not released outside Japan
Second generation
(1999-2002)
The second generation of Pokémon video games began in 1999 with the Japanese release of Pokémon Gold and Silver for the Game Boy Color, with Australia and North America getting the game in October 2000 and European release date of April 2001. Like the previous generation, an enhanced version, titled Pokémon Crystal, was later released.
Third generation
(2002–2006)
Pokémon entered its third generation with the 2002 release of Pokémon Ruby and Sapphire for Game Boy Advance and continued with the Game Boy Advance remakes of Pokémon Red and Green, Pokémon FireRed and LeafGreen (Red and Green representing the original Japanese first generation games; territories outside Japan instead saw releases of Red and Blue). An enhanced remake of Pokémon Ruby and Sapphire titled Pokémon Emerald followed after.
Fourth generation
(2006-2010)
In 2006, Japan began the fourth generation of the franchise with the release of Pokémon Diamond and Pearl for Nintendo DS. The games were released in North America on April 22, 2007 and in Australia on June 21, 2007. The game was released in the UK and Europe on July 27, 2007. Other main series games in the fourth generation include Pokémon Platinum, a director's cut version of Diamond and Pearl in the same vein as Pokémon Yellow, Crystal, and Emerald.It was released for the Nintendo DS in Japan on September 13, 2008, in North America on March 22, 2009, and in Australia and Europe on May 14, 2009 and May 22, 2009
Enter your email to subscribe pokemon channel
Pokemon games
Pokémon Sleep
Pokémon Sleep is an upcoming mobile game for Android and iOS, as part of the Pokémon series.
Publisher: The Pokémon Company
Pokémon: Let's Go, Pikachu!p
Take a Pokémon™ journey to the Kanto region with your energetic partner, Pikachu!

Developer: Niantic
Designers
Junichi Masuda
Japanese video game designer
"Junichi Masuda is a Japanese video game composer, director, designer, producer, singer, and programmer best known for his work in the Pokémon franchise. He is a member of the Game Freak board of directors, and has been employed at the company since 1989 when he founded it along Satoshi Tajiri and Ken Sugimori "
Shigeki Morimoto
Game Designer
"Shigeki Morimoto is a game designer and programmer currently working at Game Freak. He has been involved in nearly every main series Pokémon game, since Pokémon Red and Blue Versions where he was a programmer, and the creator of the battle system and the Pokémon "Mew". "
Ken Sugimorio
Japanese video game designer
"Ken Sugimori is a Japanese video game designer, illustrator, manga artist, and director. He is most famous as the character designer and art director for the Pokémon franchise. Sugimori is also credited with the art direction for other titles, including Pulseman "
Logos
Pokémon is short for the original Japanese title of Pocket Monsters. Created by. Satoshi Tajiri


Class DominanceAnalysis
- java.lang.Object
-
- com.ensoftcorp.open.commons.codemap.PrioritizedCodemapStage
-
- com.ensoftcorp.open.commons.algorithms.DominanceAnalysis
-
public class DominanceAnalysis extends PrioritizedCodemapStage
Primary interface for computing dominance relationships. This also acts as a code map stage to pre-compute dominance relationships for control flow graphs.- Author:
- Ben Holland
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DOMINANCE_FRONTIER_EDGE
Used to tag the edges from a node that identify the node's dominance frontier.static java.lang.String
DOMINATOR_TREE_EDGE
The immediate dominator or idom of a node n is the unique node that strictly dominates n but does not strictly dominate any other node that strictly dominates n.static java.lang.String
IDENTIFIER
The unique identifier for the PDG codemap stagestatic java.lang.String
POST_DOMINANCE_FRONTIER_EDGE
Used to tag the edges from a node that identify the node's post-dominance frontier.static java.lang.String
POST_DOMINATOR_TREE_EDGE
Used to tag the edges from a node that post-dominate a node.
-
Constructor Summary
Constructors Constructor Description DominanceAnalysis()
-
Method Summary
Modifier and Type Method Description static com.ensoftcorp.atlas.core.db.graph.Graph
computeDominance(UniqueEntryExitGraph ucfg)
Returns a graph of all dominance relationship edgesstatic com.ensoftcorp.atlas.core.db.graph.Graph
computeDominanceFrontier(UniqueEntryExitGraph ucfg)
Returns the dominance frontierstatic com.ensoftcorp.atlas.core.db.graph.Graph
computeDominanceTree(UniqueEntryExitGraph ucfg)
Returns the immediate dominance treestatic com.ensoftcorp.atlas.core.db.graph.Graph
computePostDominanceFrontier(UniqueEntryExitGraph ucfg)
Returns the post-dominance frontierstatic com.ensoftcorp.atlas.core.db.graph.Graph
computePostDominanceTree(UniqueEntryExitGraph ucfg)
Returns the post dominance graphstatic SandboxGraph
computeSandboxedDominance(Sandbox sandbox, UniqueEntryExitGraph ucfg)
Returns a graph of all dominance relationship edgesstatic SandboxGraph
computeSandboxedDominanceFrontier(Sandbox sandbox, UniqueEntryExitGraph ucfg)
Returns the dominance frontier (each edge represents a frontier node for a given from node)static SandboxGraph
computeSandboxedDominatorTree(Sandbox sandbox, UniqueEntryExitGraph ucfg)
Returns the immediate dominator treestatic SandboxGraph
computeSandboxedPostDominanceFrontier(Sandbox sandbox, UniqueEntryExitGraph ucfg)
Returns the post-dominance frontier (each edge represents a frontier node for a given from node)static SandboxGraph
computeSandboxedPostDominatorTree(Sandbox sandbox, UniqueEntryExitGraph ucfg)
Returns the post dominator treejava.lang.String[]
getCodemapStageDependencies()
Returns a set of prioritized codemap stage identifier strings that should perform indexing before this prioritized codemap stage Note: this should represent a conservative set of the worst case dependencies.java.lang.String
getDisplayName()
Returns the display name of the codemap stagestatic com.ensoftcorp.atlas.core.query.Q
getDominanceFrontierEdges()
static com.ensoftcorp.atlas.core.query.Q
getDominatorTreeEdges()
java.lang.String
getIdentifier()
A unique string that serves as the identity of this PrioritizedCodemapStagestatic com.ensoftcorp.atlas.core.query.Q
getPostDominanceFrontierEdges()
static com.ensoftcorp.atlas.core.query.Q
getPostDominatorTreeEdges()
boolean
performIndexing(org.eclipse.core.runtime.IProgressMonitor monitor)
The codemap stage indexing task to be performed.-
Methods inherited from class com.ensoftcorp.open.commons.codemap.PrioritizedCodemapStage
equals, hashCode, toString
-
-
-
-
Field Detail
-
IDENTIFIER
public static final java.lang.String IDENTIFIER
The unique identifier for the PDG codemap stage- See Also:
- Constant Field Values
-
DOMINATOR_TREE_EDGE
public static final java.lang.String DOMINATOR_TREE_EDGE
The immediate dominator or idom of a node n is the unique node that strictly dominates n but does not strictly dominate any other node that strictly dominates n. Every node, except the entry node, has an immediate dominator. Because the immediate dominator is unique, it is a tree. The start node is the root of the tree.- See Also:
- Constant Field Values
-
POST_DOMINATOR_TREE_EDGE
public static final java.lang.String POST_DOMINATOR_TREE_EDGE
Used to tag the edges from a node that post-dominate a node. Wikipedia: Analogous to the definition of dominance above, a node z is said to post-dominate a node n if all paths to the exit node of the graph starting at n must go through z. Similarly, the immediate post-dominator of a node n is the postdominator of n that doesn't strictly postdominate any other strict postdominators of n.- See Also:
- Constant Field Values
-
DOMINANCE_FRONTIER_EDGE
public static final java.lang.String DOMINANCE_FRONTIER_EDGE
Used to tag the edges from a node that identify the node's dominance frontier. Wikipedia: The dominance frontier of a node d is the set of all nodes n such that d dominates an immediate predecessor of n, but d does not strictly dominate n. It is the set of nodes where d's dominance stops.- See Also:
- Constant Field Values
-
POST_DOMINANCE_FRONTIER_EDGE
public static final java.lang.String POST_DOMINANCE_FRONTIER_EDGE
Used to tag the edges from a node that identify the node's post-dominance frontier. Wikipedia: The dominance frontier of a node d is the set of all nodes n such that d dominates an immediate predecessor of n, but d does not strictly dominate n. It is the set of nodes where d's dominance stops. Note that analogous to the definition of dominance above, a node z is said to post-dominate a node n if all paths to the exit node of the graph starting at n must go through z. Similarly, the immediate post-dominator of a node n is the postdominator of n that doesn't strictly postdominate any other strict postdominators of n.- See Also:
- Constant Field Values
-
-
Method Detail
-
getDominatorTreeEdges
public static com.ensoftcorp.atlas.core.query.Q getDominatorTreeEdges()
-
getPostDominatorTreeEdges
public static com.ensoftcorp.atlas.core.query.Q getPostDominatorTreeEdges()
-
getDominanceFrontierEdges
public static com.ensoftcorp.atlas.core.query.Q getDominanceFrontierEdges()
-
getPostDominanceFrontierEdges
public static com.ensoftcorp.atlas.core.query.Q getPostDominanceFrontierEdges()
-
getDisplayName
public java.lang.String getDisplayName()
Description copied from class:PrioritizedCodemapStage
Returns the display name of the codemap stage- Specified by:
getDisplayName
in classPrioritizedCodemapStage
- Returns:
-
getIdentifier
public java.lang.String getIdentifier()
Description copied from class:PrioritizedCodemapStage
A unique string that serves as the identity of this PrioritizedCodemapStage- Specified by:
getIdentifier
in classPrioritizedCodemapStage
- Returns:
-
getCodemapStageDependencies
public java.lang.String[] getCodemapStageDependencies()
Description copied from class:PrioritizedCodemapStage
Returns a set of prioritized codemap stage identifier strings that should perform indexing before this prioritized codemap stage Note: this should represent a conservative set of the worst case dependencies. That is, if it is possible that under some configuration of the toolbox that the toolbox could depend on a prioritized codemap stage, then it should be listed here. Note: mutual dependencies are not supported!- Specified by:
getCodemapStageDependencies
in classPrioritizedCodemapStage
- Returns:
-
performIndexing
public boolean performIndexing(org.eclipse.core.runtime.IProgressMonitor monitor)
Description copied from class:PrioritizedCodemapStage
The codemap stage indexing task to be performed.- Specified by:
performIndexing
in classPrioritizedCodemapStage
- Returns:
- Returns true if the codemap stage was actually run.
-
computeSandboxedDominatorTree
public static SandboxGraph computeSandboxedDominatorTree(Sandbox sandbox, UniqueEntryExitGraph ucfg)
Returns the immediate dominator tree- Parameters:
ucfg
-- Returns:
-
computeSandboxedPostDominatorTree
public static SandboxGraph computeSandboxedPostDominatorTree(Sandbox sandbox, UniqueEntryExitGraph ucfg)
Returns the post dominator tree- Parameters:
ucfg
-- Returns:
-
computeSandboxedDominanceFrontier
public static SandboxGraph computeSandboxedDominanceFrontier(Sandbox sandbox, UniqueEntryExitGraph ucfg)
Returns the dominance frontier (each edge represents a frontier node for a given from node)- Parameters:
ucfg
-- Returns:
-
computeSandboxedPostDominanceFrontier
public static SandboxGraph computeSandboxedPostDominanceFrontier(Sandbox sandbox, UniqueEntryExitGraph ucfg)
Returns the post-dominance frontier (each edge represents a frontier node for a given from node)- Parameters:
ucfg
-- Returns:
-
computeSandboxedDominance
public static SandboxGraph computeSandboxedDominance(Sandbox sandbox, UniqueEntryExitGraph ucfg)
Returns a graph of all dominance relationship edges- Parameters:
ucfg
-- Returns:
-
computeDominanceTree
public static com.ensoftcorp.atlas.core.db.graph.Graph computeDominanceTree(UniqueEntryExitGraph ucfg)
Returns the immediate dominance tree- Parameters:
ucfg
-- Returns:
-
computeDominanceFrontier
public static com.ensoftcorp.atlas.core.db.graph.Graph computeDominanceFrontier(UniqueEntryExitGraph ucfg)
Returns the dominance frontier- Parameters:
ucfg
-- Returns:
-
computePostDominanceTree
public static com.ensoftcorp.atlas.core.db.graph.Graph computePostDominanceTree(UniqueEntryExitGraph ucfg)
Returns the post dominance graph- Parameters:
ucfg
-- Returns:
-
computePostDominanceFrontier
public static com.ensoftcorp.atlas.core.db.graph.Graph computePostDominanceFrontier(UniqueEntryExitGraph ucfg)
Returns the post-dominance frontier- Parameters:
ucfg
-- Returns:
-
computeDominance
public static com.ensoftcorp.atlas.core.db.graph.Graph computeDominance(UniqueEntryExitGraph ucfg)
Returns a graph of all dominance relationship edges- Parameters:
ucfg
-- Returns:
-
-


Somewhat unusually, this blog post is future-looking: it mostly
focuses on things that don’t yet exist. Its purpose is to lay out the
background for community discussion about possible changes to the core
API for AbstractArray
s, and serves as background reading and
reference material for a more focused “julep” (a julia enhancement
proposal). Here, often I’ll use the shorthand “array” to mean
AbstractArray
, and use Array
if I explicitly mean julia’s concrete
Array
type.
As the reader is likely aware, in julia it’s possible to write
algorithms for which one or more inputs are only assumed to be
AbstractArray
s. This is “generic” code, meaning it should work
(i.e., produce a correct result) on any specific concrete array type.
In an ideal world—which julia approaches rather well in many
cases—generality of code should not have a negative impact on its
performance: a generic implementation should be approximately as fast
as one restricted to specific array type(s). This implies that
generic algorithms should be written using lower-level operations that
give good performance across a wide variety of array types.
Providing efficient low-level operations is a different kind of design challenge than one experiences with programming languages that “vectorize” everything. When successful, it promotes much greater reuse of code, because efficient, generic low-level parts allow you to write a wide variety of efficient, generic higher-level functions.
Naturally, as the diversity of array types grows, the more careful we have to be about our abstractions for these low-level operations.
In discussing general operations on arrays, it’s useful to have a diverse collection of concrete arrays in mind.
In core julia, some types we support fairly well are:
Array
: the prototype for all arrays
Range
s: a good example of what I often consider a “computed”
array, where essentially none of the values are stored in
memory. Since there is no storage, these are immutable containers:
you can’t set values in individual slots.
BitArray
s: arrays that can only store 0 or 1 (false
or true
),
and for which the internal storage is packed so that each entry
requires only one bit.
SubArray
s: the problems this type introduced, and the resolution
we adopted, probably serves as the best model for the
generalizations considered here. Therefore, this case is discussed
in greater detail below.
Another important class of array types in Base are sparse arrays:
SparseMatrixCSC
and SparseVector
, as well as other sparse
representations like Diagonal
, Bidiagonal
, and Tridiagonal
.
These are good examples of array types where access patterns deserve
careful thought. Notably, despite many commonalities in “strategy”
among the 5 or so sparse parametrizations we have, implementations of
core algorithms (e.g., matrix multiplication) are specialized for each
sparse-like type—in other words, these mimic the “high level
vectorized functions” strategy common to other languages. What we lack
is a “sparse iteration API” that lets you write the main algorithms of
sparse linear algebra efficiently in a generic way. Our current model
is probably fine for SparseLike*Dense
operations, but gets to be
harder to manage if you want to efficiently compute, e.g., Bidiagonal*SparseMatrixCSC
: the number of possible combinations you have to
support grows rapidly with more sparse types, and thus represents a
powerful incentive for developing efficient, generic low-level
operations.
Outside of Base, there are some other mind-stretching examples of arrays, including:
DataFrames
: indexing arrays with symbols rather than
integers. Other related types include NamedArrays
, AxisArrays
.
Interpolations
: indexing arrays with non-integer floating-point
numbers
DistributedArrays
: another great example of a case in which you
need to think through access patterns carefully
For arrays of fixed dimension, one can write algorithms that index
arrays as A[i,j,k,...]
(good examples can be found in our linear
algebra code, where everything is a vector or matrix). For algorithms
that have to support arbitrary dimensionality, for a long time our
fallback was linear indexing, A[i]
for integer i
. However, in
general SubArrays cannot be efficiently accessed by a linear index
because it results in call(s) to div
, and div
is slow. This is a
CPU problem, not a Julia-specific problem. The slowness of div
is
still true despite the recent addition of
infrastructure to make
it much faster—now one can make it merely “really bad” rather than
“Terrible, Horrible, No Good, and Very
Bad”.
The way we (largely) resolved this problem was to make it possible to
do cartesian indexing, A[i,j,k,...]
, for arrays of arbitrary
dimensionality (the CartesianIndex
type). To leverage this in
practical code, we also had to extend our iterators with the for I in
eachindex(A)
construct. This allows one to select an iterator that
optimizes the efficiency of access to elements of A
. In generic
algorithms, the performance gains were not small, sometimes on the
scale of ten- to fifty-fold. These types were described in a
previous blog post.
To my knowledge, this approach has given Julia one of the most
flexible yet efficient “array view” types in any programming language.
Many languages base views on array strides, meaning situations in
which the memory offset is regular along each dimension. Among other
things, this requires that the underlying array is dense. In
contrast, in Julia we can easily handle non-strided arrays (e.g.,
sampling at [1,3,17,428,...]
along one dimension, or creating a view
of a SparseMatrixCSC
). We can also handle arrays for which there is
no underlying storage (e.g., Range
s). Being able to do this with a
common infrastructure is part of what makes different optimized array
types useful in generic programming.
It’s also worth pointing out some problems:
Most importantly, it requires that one adopt a slightly different programming style. Despite being well into another release cycle, this transition is still not complete, even in Base.
For algorithms that involve two or more arrays, there’s a
possibility that their “best” iterators will be of different
types. In principle, this is a big problem. Consider matrix-vector
multiplication, A[i,j]*v[j]
, where j
needs to be in-sync for
both A
and v
, yet you’d also like all of these accesses to be
maximally-efficient. In practice, right now this isn’t a burning
problem: even if our arrays don’t all have efficient linear
indexing, to my knowledge all of our (dense) array types have
efficient cartesian indexing. Since indexing by N
integers (where
N
is equal to the dimensionality of the array) is always
performant, this serves as a reliable default for generic code.
(It’s worth noting that this isn’t true for sparse arrays, and the
lack of a corresponding generic solution is probably the main reason
we lack a generic API for writing sparse algorithms.)
Unfortunately, I suspect that if we want to add support for certain new operations or types (specific examples below), it will force us to set the latter problem on fire.
Some possible new AbstractArray
types pose novel challenges.
These are the front-and-center motivation for this post. These are
motivated by a desire to ensure that reshape(A, dims)
always returns
a “view” of A
rather than allocating a copy of A
. (Much of the
urgency of this julep goes away if we decide to abandon this goal, in
which case for consistency we should always return a copy of A
.)
It’s worth noting that besides an explicit reshape
, we have some
mechanisms for reshaping that currently cause a copy to be created,
notably A[:]
or A[:, :]
applied to a 3D array.
Similar to SubArrays
, the main challenge for ReshapedArrays
is
getting good performance. If A
is a 3D array, and you reshape it to
a 2D array B
, then B[i,j]
must be expanded to A[k,l,m]
. The
problem is that computing the correct k,l,m
might result in a call
to div
. So ReshapedArrays violate a crutch of our current ecosystem,
in that indexing with N
integers might not be the fastest way to
access elements of B
. From a performance perspective, this problem
is substantial (see #15449, about five- to ten-fold).
In simple cases, there’s an easy way to circumvent this performance
problem: define a new iterator type that (internally) iterates over
the parent A
’s indexes directly. In other words, create an iterator
so that B[I]
immediately expands to A[I']
, and so that the latter
has “ideal” performance.
Unfortunately, this strategy runs into a lot of trouble when you need
to keep two arrays in sync: if you want to adopt this strategy, you
simply can’t write B[i,j]*v[j]
for matrix-vector multiplication
anymore. A potential way around this problem is to define a new class
of iterators that operate on specific dimensions of an array (#15459),
writing B[ii,jj]*v[j]
. jj
(whatever that is) and j
need to be
in-sync, but they don’t necessarily need to both be integers. Using
this kind of strategy, matrix-vector multiplication
for j = 1:size(B, 2)
vj = v[j]
for i = 1:size(B, 1)
dest[i] += B[i,j] * vj
end
end
might be written in a more performant manner like this:
for (jj, vj) in zip(eachindex(B, Dimension{2}), v)
for (i, ii) in zip(eachindex(dest), eachindex(B, (:, jj)))
dest[i] += B[ii,jj]*vj
end
end
It’s not too hard to figure out what eachindex(B, Dimension{2})
and
eachindex(B, (:, jj))
should do: ii
, for example, could be a
CartesianInnerIndex
(a type that does not yet exist) that for a
particular column of B
iterates from A[3,7,4]
to A[5,8,4]
, where
the d
th index component wraps around at size(A, d)
. The
big performance advantage of this strategy is that you only have to
compute a div
to set the bounds of the iterator on each column; the
inner loop doesn’t require a div
on each element access. No doubt,
given suitable definition of jj
one could be even more clever and
avoid calculating div
altogether. To the author, this strategy
seems promising as a way to resolve the majority of the performance
concerns about ReshapedArrays—only if you needed “random access”
would you require slow (integer-based) operations.
However, a big problem is that compared to the “naive” implementation, this is rather ugly.
Julia’s Array
type stores its entries in column-major order, meaning
that A[i,j]
and A[i+1,j]
are in adjacent memory locations. For
certain applications—or for interfacing with certain external code
bases—it might be convenient to support row-major arrays, where
instead A[i,j]
and A[i,j+1]
are in adjacent memory locations. More
fundamentally, this is partially related to one of the most
commented-on issues in all of julia’s development history, known as
“taking transposes seriously” aka #4774. There have been at least two
attempts at implementation, #6837 and the mb/transpose
branch, and
for the latter a summary of benefits and challenges was posted.
One of the biggest challenges mentioned was the huge explosion of
methods that one would need to support. Can generic code come to the
rescue here? There are two related concerns. The first is linear
indexing: oftentimes this is conflated with “storage order,” i.e.,
given two linear indexes i
and j
for the same array, the offset in
memory is proportional to i-j
. For row-major arrays, this
notion is not viable, because otherwise a loop
function copy!(dest, src)
for i = 1:length(src)
dest[i] = src[i] # trouble if `i` means "memory offset"
end
dest
end
would end up taking a transpose if src
and dest
don’t use the same
storage order. Consequently, a linear index has to be defined in
terms of the corresponding cartesian (full-dimensionality) index.
This isn’t much of a real problem, because it’s one we know how to
solve: use ind2sub
(which is slow) when you have to, but for
efficiency make row major arrays belong to the category (LinearSlow
)
of arrays that defaults to iteration with cartesian indexes. Doing so
will ensure that if one uses generic constructs like eachindex(src)
rather than 1:length(src)
, then the loop above can be fast.
The far more challenging problem concerns cache-efficiency: it’s much slower to access elements of an array in anything other than storage-order. Some reasonably fast ways to write matrix-vector multiplication are
for j = 1:size(B, 2)
vj = v[j]
for i = 1:size(B, 1)
dest[i] += B[i,j] * vj
end
end
for a column-major matrix B
, and
for i = 1:size(B, 1)
for j = 1:size(B, 2)
dest[i] += B[i,j] * v[j]
end
end
for a row-major matrix. (One can do even better than this by using a scalar temporary accumulator, but let’s not worry about that here.) The key point to note is that the order of the loops has been switched.
One could generalize this by defining a RowMajorRange
iterator
that’s a lot like our CartesianRange
iterator, but traverses the
array in row-major order. eachindex
claims to return an “efficient
iterator,” and without a doubt the RowMajorRange
is a (much) more
efficient iterator than a CartesianRange
iterator for row-major
arrays. So let’s imagine that eachindex
does what it says, and
returns a RowMajorRange
iterator. Using this strategy, the two
algorithms above can be combined into a single generic implementation:
for I in eachindex(B)
dest[I[1]] += B[I]*v[I[2]]
end
Yay! Score one for efficient generic implementations.
But our triumph is short-lived. Let’s return to the example of
copy!
above, and realize that dest
and src
might be two
different array types, and therefore might be most-efficiently indexed
with different iterator types. We’re tempted to write this as
function copy!(dest, src)
for (idest, isrc) in zip(eachindex(dest), eachindex(src))
dest[idest] = src[isrc]
end
dest
end
Up until we introduced our RowMajorRange
return-type for
eachindex
, this implementation would have been fine. But we just
broke it, because now this will incorrectly take a transpose in
certain situations.
In other words, without careful design the goals of “maximally-efficient iteration” and “keeping accesses in-sync” are in conflict.
Julia’s arrays are indexed starting at 1, whereas some other languages start numbering at 0. If you take comments on various blog posts at face value, there are vast armies of programmers out there eagerly poised to adopt julia, but who won’t even try it because of this difference in indexing. Since recruiting those armies will lead to world domination, this is clearly a problem of the utmost urgency.
More seriously, there are algorithms which simplify if you can index
outside of the range from 1:size(A,d)
. In my own lab’s internal
code, we’ve long been using a CenterIndexedArray
type, in which such
arrays (all of which have odd sizes) are indexed over the range -n:n
and for which 0 refers to the “center” element. One package which
generalizes this notion is OffsetArrays
. Unfortunately, in practice
both of these array types produce segfaults (due to built-in
assumptions about when @inbounds
is appropriate) for many of julia’s
core functions; over time my lab has had to write implementations
specialized for CenterIndexedArrays
for quite a few julia functions.
OffsetArrays
illustrates another conceptual challenge, which can
easily be demonstrated by copy!
. When dest
is a 1-dimensional
OffsetArray
and src
is a standard Vector
, what should copy!
do? In particular, where does src[1]
go? Does it go in the first
element of dest
, or does it get stored in dest[1]
(which may not
be the first element).
Such examples force us to think a little more deeply about what an
array really is. There seem to be two potential conceptions. One is
that arrays are lists, and multidimensional arrays are
lists-of-lists-of-lists-of… In such a world view, the right thing
to do is to put src[1]
into the first slot of dest
, because 1 is
just a synonym for first
. However, this world view doesn’t really
endow any kind of “meaning” to the index-tuple of an array, and in
that sense doesn’t even include the distinction conveyed by an
OffsetArray
. In other words, in this world an OffsetArray
is
simply nonsensical, and shouldn’t exist.
If instead one thinks OffsetArray
s should exist, this essentially
forces one to adopt a different world view: arrays are effectively
associative containers, where each index-tuple is the “key” by which
one retrieves a value. With this mode of thinking, src[1]
should be
stored in dest[1]
.
These examples suggest a formalization of AbstractArray
:
AbstractArray
s are specialized associative containers, in that the
allowable “keys” may be restricted by more than just their julia
type. Specifically, the allowable keys must be representable as a
cartesian product of one-dimensional lists of values. The allowed
keys may depend not just on the array type but also the specific
array (e.g., its size). Attempted access by keys that cannot be
converted to one of the allowed keys, for that specific array,
result in BoundsError
s.
For any given array, one must be able to generate a
finite-dimensional parametrization of the full domain of valid keys
from the array itself. This might only require knowledge of the
array size, or the keys might depend on some internal storage (think
DataFrames
and OffsetArrays
). In some cases, just the array
type might be sufficient (e.g., FixedSizeArrays
). By this
definition, note that a Dict{ASCII5,Int}
, where ASCII5
is a type
that means an ASCII string with 5 characters, would qualify as a
5-dimensional (sparse) array, but that a Dict{ASCIIString,Int}
would not (because there is no length limit to an ASCIIString
, and
hence no finite dimensionality).
An array may be indexed by more than one key type (i.e., keys may have multiple parametrizations). Different key parametrizations are equivalent when they refer to the same element of a given array. Linear indexes and cartesian indexes are simple examples of interconvertable representations, but specialized iterators can produce other key types as well.
Arrays may support multiple iterators that produce non-equivalent
key sequences. In other words, a row-major matrix may support both
CartesianRange
and RowMajorRange
iterators that access elements
in different orders.
Resolving these conflicting demands is not easy. One approach might be to decree that some of these array types simply can’t be supported with generic code. It is possible that this is the right strategy. Alternatively, one can attept to devise an array API that handles all of these types (and hopefully more).
In GitHub issue #15648, we are discussing APIs that may resolve these challenges. Readers are encouraged to contribute to this discussion.


|
Hello,
|
|
Thank you for shopping with Pepper, We are sending you this mail so that you can confirm the order of the following Products :
|
| Product_1 |
Price_product_1 |
| Product_2 |
Price_product_2 |
| Please Follow this link so that you can confirm your order : softbankrobotics.com/confirm/481fJY84heh55 |
| Order Number # 122-10846-22051 |
| Thank you for shopping at Pepper Store ! |
|


FlushPreferenceBuffer()
Syntax
FlushPreferenceBuffer()Description
Ensures that all preferences changes are written to disk.
Parameters
None.
Return value
Nonzero if the preferences has been successfully written the disk. If an error occurred (ie: disk full, disk error), it will return zero.
See Also
CreatePreferences(), OpenPreferences()
Supported OS
All


Declaration :
Directly inherited by : DataManager
Artifact : IDataManager
Stereotype: interface
All public operations : register , setLowPowerMode


'use strict';
var _ = require('underscore');
module.exports = function () {
/**
* A ML.File is a local representation of a file that is saved to the ML cloud.
* @param {String} name The file's name.
* @param {Array} data The data for the file, as either:
* 1. an Object like { base64: "..." } with a base64-encoded String.
* 2. an Object url.
* @class
*/
ML.File = function (name, data) {
this._name = name;
this._source = new ML.Promise(function (resolve) {
resolve(data);
})
};
_.extend(ML.File.prototype, /** @lends ML.File.prototype */ {
/**
* Gets the name of the file. Before save is called, this is the filename
* given by the user. After save is called, that name gets prefixed with a
* unique identifier.
* @returns {String}
*/
name: function () {
return this._name;
},
/**
* Gets the url of the file. It is only available after you save the file or
* after you get the file from a ML.Object.
* @return {String}
*/
url: function () {
return this._url ? 'https://' + this._url.replace('https://', ''): '';
},
/**
* Saves the file to the ML cloud.
* @return {Promise} Promise that is resolved when the save finishes.
*/
save: function () {
var self = this;
return this._source.then(function (source) {
return ML._request('files', self._name, null, 'PUT', source).then(function (res) {
self._name = res.name;
self._url = res.url;
return self;
});
});
},
/**
* Destroy the file from the ML cloud.
* @return {Promise} Promise that is resolved when the destroy finishes.
*/
destroy: function () {
return ML._request('files', null, null, 'DELETE', null, {'X-LAS-Fid': this._name});
}
});
};


21
1 A declaration about the desert by the sea.
Like stormwinds sweeping through the Negev it comes
passing through from the wilderness, from a terrible land.
2 A distressing vision has been given to me:
the treacherous man deals treacherously, and the destroyer destroys.
Go up and attack, Elam; besiege, Media;
I will stop all her groaning.
3 Therefore my loins are filled with pain;
pains like the pains of a woman in labor have taken hold of me;
I am bowed down by what I heard; I am disturbed by what I saw.
4 My heart pounds; shuddering overcomes me;
the night that I desired has been turned into trembling for me.
5 They prepare the table, they spread rugs and eat and drink;
arise, princes, anoint your shields with oil.
6 For this is what the Lord said to me,
"Go, post a watchman; he must report what he sees.
7 When he sees a chariot, horsemen in pairs,
riders on donkeys, riders on camels,
then he must pay attention and be very alert."
8 The watcher cries out,
"Lord, on the watchtower I stand all day, every day,
and at my post I stand all night long."
9 Here comes a charioteer with a troop of men, horsemen in pairs.
He calls out, "Babylon has fallen, fallen,
and all the carved figures of its gods are broken to the ground."
10 My threshed and winnowed ones, children of my threshing floor!
What I have heard from Yahweh of hosts,
the God of Israel, I have declared to you.
11 A declaration about Dumah.
One calls to me from Seir, "Watchman, what is left of the night? Watchman, what is left of the night?"
12 The watchman said, "The morning comes, and also the night: if you will ask, ask, and then come back again."
13 A declaration about Arabia.
In the wilderness of Arabia you spend the night, you caravans of Dedanites.
14 Bring water for the thirsty;
inhabitants of the land of Tema, meet the fugitives with bread.
15 For they have fled from the sword, from the drawn sword,
from the bent bow, and from the weight of war.
16 For this is what the Lord said to me, "Within a year, as a laborer hired for a year would see it, all the glory of Kedar will end.
17 Only a few of the archers, the warriors of Kedar will remain," for Yahweh, the God of Israel, has spoken.


NMS (NetMedia Solutions) Development Family, DrLouie, LouieRd: CROSS-BROWSER, CROSS-PLATFORM, WEB-BASED APPLICATIONS, WEB DESIGN, WEB DEVELOPMENT, SEARCH ENGINE OPTIMIZATION, AJAX, DHTML, DOM, CSS, CSS2, CSS3, HTML, JAVASCRIPT, PERL, PHP, MYSQL, MSSQL, XML |
NMS (NetMedia Solutions) Development Family, DrLouie, LouieRd: CROSS-BROWSER, CROSS-PLATFORM, WEB-BASED APPLICATIONS, WEB DESIGN, WEB DEVELOPMENT, SEARCH ENGINE OPTIMIZATION, AJAX, DHTML, DOM, CSS, CSS2, CSS3, HTML, JAVASCRIPT, PERL, PHP, MYSQL, MSSQL, XML |


[gecode-users] getting all solutions + interrupting gecode
Mikael Zayenz Lagerkvist
zayenz at gmail.com
Fri Dec 5 14:12:10 CET 2008
Hi,
For the first question, one thing you must remember is to delete the
original instance of the problem also. An easy way to write a loop
that goes through all solutions is for example:
MyProblem *root = new MyProblem();
DFS<MyProblem> dfs(root);
delete root;
while (MyProblem *sol = dfs.next()) {
// do something...
delete sol;
}
As for question 2, t is probably not a valid Space most of the time
when you might call the signal handler (the code is between deletion
of the Space and having a new solution computed). A cleaner interface
would be to write your own stop-object that stops the search when some
variable is set due to the signal handler having been called.
Cheers,
Mikael
On Fri, Dec 5, 2008 at 1:11 PM, Marco Correia <marco.v.correia at gmail.com> wrote:
> hi!
>
> Q1:
>
> I have a problem for which I want to get all solutions. I have departed from
> one of the examples, but now I'm subclassing from the object Space directly.
> I have the feeling I'm not doing things right:
>
> class MyProblem : public Space
> { /* ... */}
>
> int
> main(int argc, char* argv[])
> {
> MyProblem* t = new MyProblem(args);
> d = new DFS<MyProblem>(t);
> while (t != NULL)
> {
> //t = d->next(); // with only this, it does not seem to release memory
> TestLinear* n = d->next();
> delete t; // hum....
> t = n;
> }
> return 0;
> }
>
> Q2:
>
> I'm registering a signal before the 'new MyProblem' line, to make gecode quit
> when I press Ctrl+C and show me the search statistics:
>
> signal(SIGINT, atExit);
>
> In the function atExit I use the methods from t and d (which I make global
> variables) to get the statistics. The last line of this function is a system
> call to exit(0).
>
> It seems to work sometimes, but other times it just crashes on the exit(0).
> Obviously I'm forgeting something, so I guess the solution to this is simple.
> Otherwise I can provide more details.
>
>
> Thanks!
> Marco
>
> --
> Marco Correia <mvc at netcabo.pt>
>
> _______________________________________________
> Gecode users mailing list
> users at gecode.org
> https://www.gecode.org/mailman/listinfo/gecode-users
>
--
Mikael Zayenz Lagerkvist, http://www.ict.kth.se/~zayenz/
More information about the gecode-users
mailing list


prelabel_script.py
To be able to quickly label a few random generated melodies without running the whole network, we create a script in a new file prelabel_script.py
.
We will store th labeled melodies in our CSV and therefore can use it once the network is started to pre-train our evaluation network.
First import all the packages.
import random
import csv
from music_generator import *
Let’s again simply define a few variable to set how we want to listen to the melodies e.g. key, scale, bpm. Additional we need the genome size and the file we want to store our labeled data in.
num_steps = 1
pauses = True
key = 'C'
scale= 'major'
root = 4
bpm = 128
GENOME_SIZE = NUM_BARS * NUM_NOTES * BITS_PER_NOTE
LABELED_FILE = "data.csv"
We need to start the pyo server.
s = Server().boot()
Now we’re able to generate a random genome, convert it to melody we can play, rate it and store this label.
for _ in range(10):
genome = random.choices([0,1],k = GENOME_SIZE)
events = genome_to_events(genome, NUM_BARS, NUM_NOTES, num_steps, pauses, key, scale, root, bpm)
for e in events:
e.play()
s.start()
rating = input("Rating (0-5)")
for e in events:
e.stop()
s.stop()
with open(LABELED_FILE, 'a') as myFile:
writer = csv.writer(myFile)
writer.writerow((tuple(genome),int(rating)))


Ever get tired of looking up function signatures in a PDF file? If yes, this is the place for you
This page is under construction, so expect stuff to be added during the coming weeks!


Trim and discard ends from cucumbers. Cut each cucumber crosswise into three equal lengths. Place pieces in large zipper-lock bag and seal bag. Using small skillet or rolling pin, firmly but gently smash cucumbers until flattened and split lengthwise into 3 to 4 spears each. Tear spears into rough 1- to 1 1/2-inch pieces and transfer to colander set in large bowl. Toss cucumbers with salt and let stand for at least 15 minutes or up to 30 minutes.
While cucumbers sit, whisk vinegar and garlic together in small bowl; let stand for at least 5 minutes or up to 15 minutes.
Whisk soy sauce, oil, and sugar into vinegar mixture until sugar has dissolved. Transfer cucumbers to medium bowl and discard any extracted liquid. Add dressing and sesame seeds to cucumbers and toss to combine. Serve immediately.


ARKEON ENERGY
You will use this to log in.
Your password must be 8-20 characters long, contain letters and numbers, and must not contain spaces, special characters, or emoji.
Street address only (no city/state/zip)
FOR THE LATEST NEWS & UPDATES


Preparation time
less than 30 mins
Cooking time
30 mins to 1 hour
Serves
Serves 4
Dietary
Matt Tebbutt takes inspiration from Goan street food with a spiced coating for deep-fried cauliflower florets, served with cucumber, cashew and yoghurt dip and flatbreads.
For the deep-fried cauliflower, fill a deep-fat fryer or a large, deep, heavy-bottomed pan two-thirds full with the oil. Heat to 180C (a cube of bread should turn brown in one minute when dropped in.) CAUTION: Hot oil can be dangerous. Do not leave unattended.
Heat a large saucepan of salted boiling water and blanch the cauliflower for 2–3 minutes. Drain well and set aside.
Place the flours into a large bowl and add the chilli paste, chopped curry leaves and garam masala. Mix then add enough cold water to make a smooth batter consistency.
Dip the blanched cauliflower into the batter and deep-fry for 2 minutes or until golden-brown. Set aside to drain on kitchen roll and keep warm until ready to serve. (Keep the deep-fat fryer warm to fry the garnish at the last minute.)
For the salad, in a dry frying pan over a medium heat, toast the cumin, mustard seeds, green chilli and nuts for 2–3 minutes, taking care not to burn them.
Put the grated cucumber into a clean tea towel and squeeze out the water. Place the cucumber into a bowl with the yoghurt and mix in the roasted spices and nuts.
For the flatbreads, mix the flour and salt in a large bowl. Add the oil and mix again. Gradually add enough water to form a dough then knead until smooth. Divide into 8 balls. On a floured surface, roll them out into round flatbreads.
In a dry frying pan over a medium heat, cook each flatbread for 2–3 minutes on both sides or until cooked through.
Just before serving, deep-fry the curry leaves and sliced green chillies.
To serve, place the fried cauliflower onto a serving plate and top with the salad. Serve the flatbreads on the side.


JavaScript is disabled on your browser.
Skip navigation links
Package
Class
Tree
Deprecated
Index
Help
Prev
Next
Frames
No Frames
All Classes
A
B
C
D
G
O
R
S
A
addItem(BBjString, BBjNumber)
- Method in class
BBjMultiListButtonWidget
Uses the addItem function to add an item with the given text to the list
addItem(BBjString, BBjNumber, BBjString)
- Method in class
BBjMultiListButtonWidget
Uses the addItem function to add an item with the given text and the image from the link to the list
addItem(BBjString, BBjNumber, BBjImage)
- Method in class
BBjMultiListButtonWidget
Adds an item with the given text and image to the list
B
BBjMultiListButtonWidget
- Class in
<Unnamed>
A mutli-select combo box widget
BBjMultiListButtonWidget(BBjWindow, BBjInt, BBjInt, BBjInt, BBjInt, BBjInt)
- Constructor for class
BBjMultiListButtonWidget
The constructor that creates the widget on wnd!
BBjMultiListButtonWidgetSelChangeEvent
- Class in
<Unnamed>
BBjMultiListButtonWidgetSelChangeEvent()
- Constructor for class
BBjMultiListButtonWidgetSelChangeEvent
C
Control!
- Variable in class
BBjMultiListButtonWidgetSelChangeEvent
D
doClose(BBjEvent)
- Method in class
BBjMultiListButtonWidget
Closes the list
doOpen(BBjEvent)
- Method in class
BBjMultiListButtonWidget
Opens the list
doOpenClose(BBjEvent)
- Method in class
BBjMultiListButtonWidget
Opens or closes the list depending on the state of f_open
G
getControlType()
- Method in class
BBjMultiListButtonWidget
returns the unique control type
gridLostFocus(BBjEvent)
- Method in class
BBjMultiListButtonWidget
gridMouseDown(BBjGridMouseDownEvent)
- Method in class
BBjMultiListButtonWidget
Sets the events in case of the MouseDownEvent
gridSelectRow(BBjGridSelectRowEvent)
- Method in class
BBjMultiListButtonWidget
O
ON_LBEX_SELCHANGE()
- Method in class
BBjMultiListButtonWidget
R
redraw(Boolean)
- Method in class
BBjMultiListButtonWidget
S
Selected!
- Variable in class
BBjMultiListButtonWidgetSelChangeEvent
SelectedString$
- Variable in class
BBjMultiListButtonWidgetSelChangeEvent
setFont(BBjFont)
- Method in class
BBjMultiListButtonWidget
Sets the font of all display pieces on screen
setOpenHeight(BBjNumber)
- Method in class
BBjMultiListButtonWidget
Sets the height of the dropdown grid
setSelectedIndices(BBjVector)
- Method in class
BBjMultiListButtonWidget
Specifies the vector of the items to be selected.
setShowImageColumn(BBjNumber)
- Method in class
BBjMultiListButtonWidget
setText(String)
- Method in class
BBjMultiListButtonWidget
Sets a text snippet to be used instead of simply listing the selected items in the edit area when closed example: "{1} of {2} items selected..."
A
B
C
D
G
O
R
S
Skip navigation links
Package
Class
Tree
Deprecated
Index
Help
Prev
Next
Frames
No Frames
All Classes


Website usability test of Dog Gone Seattle
Dog Gone Seattle is a non-profit dog rescue, adoption and fostering organization. Their site is meant to inform visitors of the their mission, take donations and introduce people to the pups that can be adopted. Their site is built on Wordpress and I give them credit for A. even creating such a noble organization with a great cause and B. for even attempting to put a website together. There are several criteria I will be using to critique the usability of this site, including:
- Navigation: is it effective?
- Breadcrumbs: do I know where I am?
- Homepage: is there a visual hierarchy of information?
- Tag lines: Are they working?
Usability Review
Navigation: is it effective?
The navigation on this site is flawed. The first issue I noticed was the font contrast on the nav links. If the links are the signs that point the user to where they need to go they need to be bold or at least stand out in some way - if this site were a physical store, the signage would be awkward and confusing.
The main navigation on this site also confused me because some of the top level links are clickable, whereas some only had pages linked to the nested links within the top level. It would make more sense if the top level links, for instance: ABOUT, ADOPT, HELP, and CONTACT were each their own directory pages with further links to the nested content. However, this is only really the case for the about page, the other two top level links with dropdowns didn't do anything when I clicked them and only pushed me to a new page when I clicked the dropdown links in the nav - it feels unorganized to have a nav menu that doesn't function in a consistent manner.
“Navigation isn’t just a feature of a Web site; it is the Web site, in the same way that the building, the shelves, and the cash registers are Sears. Without it, There's no there there. The Moral? Web navigation better be good. – Steve Krug
Breadcrumbs: do I know where I am?
For the most part I knew where I was on this site, however I was confused by the breadcrumbs that were put there to help orient the user. For instance when I navigated in the "about" dropdown to "our rescue" the breadcrumb at the top right of the page lists "home > our rescue." I was confused by this because I clicked the nested link inside of "about." Logically I think it would be appropriate to list the breadcrumb as "home > about > our rescue."
I was also very confused as to my location when I visited the "events" page within the about dropdown and the breadcrumb read "home." If properly set up this should have read, "home > about > events"
Another orientation issue I had with this site was that the url for the site was listed in the footer. Why? It left me wondering if the site I was currently on wasn't the actual site for the organization – this is disorienting and confusing and needs to be taken off of the site.
Homepage: is there a visual hierarchy of information?
"The Home page has to give an overview of what the site has to offer—both content (“What can I find here?”) and features (“What can I do here?”)—and how it’s all organized."" – Steve Krug
The visual hierarchy of this site could be improved, especially on the homepage where the real estate is metaphorically expensive. All of the important information and links are there but they are packed into the hero slider. As a user I don’t want to have to sit there and wait until the slider image and link that I want to use appears during the course of the animation. I think the information in the slider would be more useful if each section (volunteer, adopt, foster, donate) were uniquely designed and placed on the homepage in a hierarchical layout in order of importance.
Tag line: is it working?
I thought one thing that was working well on this site was the tagline below the logo. "Rescue, Respect, Repeat." I think it sums up this organization well, it's catchy, uses alliteration and is on every single page, being a great example of an element of persistent navigation.


We aggregate services!
- target seamless methodologies
- enable strategic users
- optimize ubiquitous supply-chains
- embrace real-time functionalities
- morph real-time bandwidth
- mesh robust channels
- optimize mission-critical technologies
- evolve ubiquitous relationships
- redefine cross-media architectures
- reintermediate world-class eyeballs
- expedite turn-key deliverables
- innovate mission-critical e-tailers
- streamline intuitive e-markets
- deliver visionary niches


--- layout: post title: "Endomorphism as an invariant functor" description: "An article (also) for object-oriented programmers." date: 2022-08-08 4:43 UTC tags: [Software Design] image: "/content/binary/invariant-map-diagram.png" image_alt: "Arrow diagram showing the mapping from an endomorphism in a to an endomorphism in b." --- {% include JB/setup %}
{{ page.description }}
This article is part of a series of articles about invariant functors. An invariant functor is a functor that is neither covariant nor contravariant. See the series introduction for more details.
An endomorphism is a function where the return type is the same as the input type.
In Haskell we denote an endomorphism as a -> a
, in F# we have to add an apostrophe: 'a -> 'a
, while in C# such a function corresponds to the delegate Func<T, T>
or, alternatively, to a method that has the same return type as input type.
In Haskell you can treat an endomorphism like a monoid by wrapping it in a container called Endo: Endo a
. In C#, we might model it as an interface called IEndomorphism<T>
.
That looks enough like a functor that you might wonder if it is one, but it turns out that it's neither co- nor contravariant. You can deduce this with positional variance analysis (which I've learned from Thinking with Types). In short, this is because T
appears as both input and output - it's neither co- nor contravariant, but rather invariant.
Consider an IEndomorphism<T>
interface in C#:
public interface IEndomorphism<T> { T Run(T x); }
I've borrowed this interface from the article From State tennis to endomorphism. In that article I explain that I only introduce this interface for educational reasons. I don't expect you to use something like this in production code bases. On the other hand, everything that applies to IEndomorphism<T>
also applies to 'naked' functions, as you'll see later in the article.
As outlined in the introduction, you can make a container an invariant functor by implementing a non-standard version of Select
:
public static IEndomorphism<B> Select<A, B>( this IEndomorphism<A> endomorphism, Func<A, B> aToB, Func<B, A> bToA) { return new SelectEndomorphism<A, B>(endomorphism, aToB, bToA); } private class SelectEndomorphism<A, B> : IEndomorphism<B> { private readonly IEndomorphism<A> endomorphism; private readonly Func<A, B> aToB; private readonly Func<B, A> bToA; public SelectEndomorphism( IEndomorphism<A> endomorphism, Func<A, B> aToB, Func<B, A> bToA) { this.endomorphism = endomorphism; this.aToB = aToB; this.bToA = bToA; } public B Run(B x) { return aToB(endomorphism.Run(bToA(x))); } }
Since the Select
method has to return an IEndomorphism<B>
implementation, one option is to use a private, nested class. Most of this is ceremony required because it's working with interfaces. The interesting part is the nested class' Run
implementation.
In order to translate an IEndomorphism<A>
to an IEndomorphism<B>
, the Run
method first uses bToA
to translate x
to an A
value. Once it has the A
value, it can Run
the endomorphism
, which returns another A
value. Finally, the method can use aToB
to convert the returned A
value to a B
value that it can return.
Here's a simple example. Imagine that you have an endomorphism like this one:
public sealed class Incrementer : IEndomorphism<BigInteger> { public BigInteger Run(BigInteger x) { return x + 1; } }
This one simply increments a BigInteger value. Since BigInteger
is isomorphic to a byte array, it's possible to transform this BigInteger
endomorphism to a byte array endomorphism:
[Theory] [InlineData(new byte[0], new byte[] { 1 })] [InlineData(new byte[] { 1 }, new byte[] { 2 })] [InlineData(new byte[] { 255, 0 }, new byte[] { 0, 1 })] public void InvariantSelection(byte[] bs, byte[] expected) { IEndomorphism<BigInteger> source = new Incrementer(); IEndomorphism<byte[]> destination = source.Select(bi => bi.ToByteArray(), arr => new BigInteger(arr)); Assert.Equal(expected, destination.Run(bs)); }
You can convert a BigInteger
to a byte array with the ToByteArray
method, and convert such a byte array back to a BigInteger
using one of its constructor overloads. Since this is possible, the example test can convert this IEndomorphism<BigInteger>
to an IEndomorphism<byte[]>
and later Run
it.
You don't need an interface in order to turn an endomorphism into an invariant functor. An endomorphism is just a function that has the same input and output type. In C# such a function has the type Func<T, T>
, while in F# it's written 'a -> 'a
.
You could write an F# module that defines an invmap
function, which would be equivalent to the above Select
method:
module Endo = // ('a -> 'b) -> ('b -> 'a) -> ('a -> 'a) -> ('b -> 'b) let invmap (f : 'a -> 'b) (g : 'b -> 'a) (h : 'a -> 'a) = g >> h >> f
Since this function doesn't have to deal with the ceremony of interfaces, the implementation is simple function composition: For any input, first apply it to the g
function, then apply the output to the h
function, and again apply the output of that function to the f
function.
Here's the same example as above:
let increment (bi : BigInteger) = bi + BigInteger.One // byte [] -> byte [] let bArrInc = Endo.invmap (fun (bi : BigInteger) -> bi.ToByteArray ()) BigInteger increment
Here's a simple sanity check of the bArrInc
function executed in F# Interactive:
> let bArr = bArrInc [| 255uy; 255uy; 0uy |];; val bArr : byte [] = [|0uy; 0uy; 1uy|]
If you are wondering about that particular output value, I'll refer you to the BigInteger documentation.
The F# implementation of invmap
(g >> h >> f
) makes it apparent that an endomorphism is an invariant functor via function composition. In F#, though, that fact almost disappears in all the type declaration ceremony. In the Haskell instance from the invariant package it's even clearer:
instance Invariant Endo where invmap f g (Endo h) = Endo (f . h . g)
Perhaps a diagram is helpful:
If you have a function h
from the type a
to a
and you need a function b -> b
, you can produce it by putting g
in front of h
, and f
after. That's also what the above C# implementation does. In F#, you can express such a composition as g >> h >> f
, which seems natural to most westerners, since it goes from left to right. In Haskell, most expressions are instead expressed from right to left, so it becomes: f . h . g
. In any case, the result is the desired function that takes a b
value as input and returns a b
value as output. That composed function is indicated by a dashed arrow in the above diagram.
Contrary to my usual habit, I'm going to prove that both invariant functor laws hold for this implementation. I'll use equational reasoning with the notation that Bartosz Milewski uses. Here's the proof that the invmap
instance obeys the identity law:
invmap id id (Endo h) = { definition of invmap } Endo (id . h . id) = { eta expansion } Endo (\x -> (id . h . id) x) = { defintion of composition (.) } Endo (\x -> id (h (id x))) = { defintion of id } Endo (\x -> h x) = { eta reduction } Endo h = { definition of id } id (Endo h)
While I'm not going to comment further on that, I can show you what the identity law looks like in C#:
[Theory] [InlineData(0)] [InlineData(1)] [InlineData(9)] public void IdentityLaw(long l) { IEndomorphism<BigInteger> e = new Incrementer(); IEndomorphism<BigInteger> actual = e.Select(x => x, x => x); Assert.Equal(e.Run(l), actual.Run(l)); }
In C#, you typically write the identity function (id
in F# and Haskell) as the lambda expression x => x
, since the identity function isn't 'built in' for C# like it is for F# and Haskell. (You can define it yourself, but it's not as idiomatic.)
As with the identity law, I'll start by suggesting a proof for the composition law for the Haskell instance:
invmap f2 f2' $ invmap f1 f1' (Endo h) = { definition of invmap } invmap f2 f2' $ Endo (f1 . h . f1') = { defintion of ($) } invmap f2 f2' (Endo (f1 . h . f1')) = { definition of invmap } Endo (f2 . (f1 . h . f1') . f2') = { associativity of composition (.) } Endo ((f2 . f1) . h . (f1' . f2')) = { definition of invmap } invmap (f2 . f1) (f1' . f2') (Endo h)
As above, a C# example may also help. First, assume that you have some endomorphism like this:
public sealed class SecondIncrementer : IEndomorphism<TimeSpan> { public TimeSpan Run(TimeSpan x) { return x + TimeSpan.FromSeconds(1); } }
A test then demonstrates the composition law in action:
[Theory] [InlineData(-3)] [InlineData(0)] [InlineData(11)] public void CompositionLaw(long x) { IEndomorphism<TimeSpan> i = new SecondIncrementer(); Func<TimeSpan, long> f1 = ts => ts.Ticks; Func<long, TimeSpan> f1p = l => new TimeSpan(l); Func<long, IntPtr> f2 = l => new IntPtr(l); Func<IntPtr, long> f2p = ip => ip.ToInt64(); IEndomorphism<IntPtr> left = i.Select(f1, f1p).Select(f2, f2p); IEndomorphism<IntPtr> right = i.Select(ts => f2(f1(ts)), ip => f1p(f2p(ip))); Assert.Equal(left.Run(new IntPtr(x)), right.Run(new IntPtr(x))); }
Don't try to make any sense of this. As outlined in the introductory article, in order to use an invariant functor, you're going to need an isomorphism. In order to demonstrate the composition law, you need three types that are isomorphic. Since you can convert back and forth between TimeSpan
and IntPtr
via long
, this requirement is formally fulfilled. It doesn't make any sense to add a second to a value and then turn it into a function that changes a pointer. It sounds more like a security problem waiting to happen... Don't try this at home, kids.
Since an endomorphism can be modelled as a 'generic type', it may look like a candidate for a functor or contravariant functor, but alas, neither is possible. The best we can get (apart from a monoid instance) is an invariant functor.
The invariant functor instance for an endomorphism turns out to be simple function composition. That's not how all invariant functors, work, though.


Ok,well on my server i play the "bad guy" and need a caster...Sorc is outta the question...and has to have skill focus Sc and ESF Sc..other than that you got free rein... Any help is appreciated
Any particular reason you want BG? It really gets nothing for a Wizard, save the full plate pre-reqs.
If you want an evil class, I'd suggest 38 Wizard, 1 Bard, 1 PM, with auto-still 3. Granted, it'd be hard to level, as it doesn't get a skill dump till level 39. Also, it would have to take Armor Prof: Heavy as an epic feat. But it gets 2 more AC than a 38/1 Bard/1 Ftr.
Edited By mantis3 on 01/07/08 05:45
Hmm... Mantis I know you from SR ... Well..could you add bard and a skill dump at 40 since i could still max out Sc,Conc,lore, and a bunch of other skills with my high Int.. to make it more lenient*SP* for you guys you can try SD or any other combo.Wiz is a must and would like bard Thanks ( I know I'm a pain )
You'd have Bard at 39 for skill dumps.


#!/bin/sh
#Obtain a list of ciphers available on a machine
#And attempt to decrypt them with a key
#IF YOU HAVE THE CORRECT KEY
#it will tell you which cipher was used to encrypt it
#
#-pass can also be a file:/<file>
#
ciphers=`openssl list-cipher-commands`
key="INSERT ENCRYPTION KEY"
enc_file="INSERT FILE"
for i in $ciphers; do
openssl enc -d -${i} -in $enc_file -k $key > /dev/null 2>&1
if [[ $? -eq 0 ]]; then
echo "Cipher is $i: openssl enc -d -${i} -in $enc_file -k $key -out foo"
exit
fi
done


| About Dailyrotten |
|
Feedback
If you like this page, hate it, or would like to suggest changes,
<EMAIL_ADDRESS>is listening. This page
is experimental and somewhat different from what we usually offer, so please
do send your feedback.
Adding Stories
If you are a rotten newshound and you would like to suggest a story,
visit our submit page to
send us the URL. Stories that are accepted will have your name credited.
Posting Comments
In order to post comments to stories, you will have to
create an account.
Accounts will generally be validated within 24 hours, and of
course will be disabled if there is abuse.
Viewership
On the first full day this page went live, 100,000 people visited this Rotten
News page. Of course that was the day after the WTC attacks, so that number is
somewhat distorted. Right now this page gets between 50,000 and 75,000 people
every day.
Linking
We encourage everyone to link to this page; if you like it, others probably
will as well.
Other Rotten
Rotten
Gaping Maw
Celebrity Morgue
Mugshots
Rotten Store
Rate My Poo
Rate My Kitten
Rate My Finger
Penny Postcards
Phallic
Boners
Home
Make Dailyrotten your start page
|
|
|
September 01, 2002
Britney into lesbian porno
South Africa Sun Times | Submitted by: Macki
If enough women wish for the same thing, it comes to pass:
"Exhausted pop princess Britney Spears loves watching lesbian pornographic
videos and is a good friend of one of the stars, say friends... A friend
confided: "Britney isn't the goody-two-shoes everybody thinks she is.
|
|
Read article...
|
|
Satanists not protected by first amendment
Lexington Herald-Leader | Submitted by: ian m.
"Inmates at Green River Correctional Complex, a medium-security prison in
Central City, have been allowed since earlier this summer to hold weekly
satanic services as part of the official religious services calendar...
The state suspended the services after the Herald-Leader inquired about the
issue this week... "We've looked at the satanic bible ... and are convinced
that what it advocates would put our prisons at risk, safety-wise. One of
their tenets is revenge: if somebody hurts you, hurt them back."
|
|
Read article...
|
|
Railway buff killed with ear to the tracks
Mainichi Daily News | Submitted by: Kreepy Monster
If you truly love your hobby, be prepared to die for it:
"A teen-age railway buff was fatally hit by a train while he was crouching
on the tracks listening for approaching trains, police said Sunday."
|
|
Read article...
|
|
Paedophilia rocking French literary world
Guardian | Submitted by: ian m.
 ["Rose Bonbon" author, Nicolas] Jones-Gorlin has defended
his novel, which recounts in explicit detail the paedophile activities of a
thirtysomething travelling salesman with a series of girls aged between seven
and 10... The second novel, "Il Entrerait dans la Légende" ("He will enter
into legend") by Louis Skorecki, risks causing even more of an uproar. In
2,323 horrifying scenes, including several dozen murders, it tells the story
of a sadistic serial killer 'propelled into crime by his absolute love of
women and little girls'."
|
|
Read article...
|
|
Man killed throwing rocks out a moving van
Seattle Post-Intelligencer | Submitted by: JON BLAST
"A 23-year-old man, who was riding in a van and opening the slide door to
throw rocks at mailboxes and cars, fell out of the van and died. John E.
Reynolds died of head injuries at the scene early Thursday morning, said
Sgt. Craig Randall of the Clark County Sheriff's Office."
|
|
Read article...
|
|
Six year old pervert
Independent Online | Submitted by: Incubus
"A six-year-old boy has been suspended from an elementary school in Ohio after
he rushed to the French window at his home to signal the approaching school bus
to wait for him -neglecting to put some clothes on first in his
excitement."
|
|
Read article...
|
|
Forced slavery OK in the US again
Parascope | Submitted by: NashvilleCityKitty
It's a great scam for the Prison system.
And they'll be making a lot more than license plates and road signs:
"One product of Oregon's inmate factories are uniforms for McDonald's.
Tennessee inmates stitch together jeans for Kmart and JC Penney, as
well as $80 wooden rocking ponies for Eddie Bauer. Mattresses and furniture
are perennial favorites in prison factories, and Ohio inmates even
produced car parts for Honda, until the United Auto Workers intervened.
Prisoners have been employed doing data entry, assembling computer
circuit boards and even taking credit card ticket orders for TWA...
So why do they do it? In California, prisoners who refuse to work are
moved to discliplinary housing and lose canteen priveleges, as well as
"good time" credit that slices hard time off their sentences.
|
|
Read article...
|
|
Man claims alien heritage
Chicago Sun-Times | Submitted by: heptapod
"David Teran [Suspiciously close to "Terran"], on trial for murder in the
death of a onetime Proviso East High School basketball star, calmly confessed
that he gunned down a stranger in an Addison parking lot because he believed
the killing would release an "alien enzyme" in his body, allowing him to
board a spaceship coming to pluck him off Earth, his ex-wife testified Friday.
She said her former husband didn't want her to come with them because she
was a lower life form."
|
|
Read article...
|
|
Rice flour not good birth control
International Herald Tribune | Submitted by: Rufus T. Firefly
"They knocked down the door. Inside, scattered across the floors of four
concrete rooms, investigators found evidence of China's lucrative and deadly
trade in counterfeit pharmaceuticals: antibiotics made of talcum powder, birth
control pills filled with rice flour; all useless but indistinguishable from
the real thing... An estimated 192,000 people died last year in China because
of fake drugs."
|
|
Read article...
|
|
|
|
|


Elon Musk Gets $2 Billion Richer After Tesla’s Surprise Earnings Report
Tesla said in its third-quarter report last week that it had earnings of $1.86 per share on an adjusted basis, far exceeding analysts’ expectations and sending its stock soaring.
Elon Musk has apparently added $2 billion to his net worth after the electric car maker Tesla posted surprise profits.
The 48-year-old Tesla CEO and co-founder owns about 22 percent of the company’s outstanding stock. Tesla’s shares rose by 24 percent in the week after it reported third-quarter adjusted earnings per share of $1.86 and $312 million in profit – after losing a total of $1.1 billion in the previous two quarters.
Wall Street analysts had projected a loss of 46 cents per share, so Tesla’s stock price skyrocketed, meaning that Musk’s net worth grew by nearly $2 billion to $22.9 billion.
He is now ranked the 21st richest person in the world, according to the Forbes 400 list, right between chocolate tycoon John Mars and hedge fund manager Jim Simons.
Musk — currently on a break from Twitter — also owns an estimated $12.5 billion stake in the rocket company SpaceX.