C Hash Table
- hashtable:
- hashtable.c
- hashtable.h
- hashtable_private.h
- hashtable iterator:
- hashtable_itr.c
- hashtable_itr.h
- utility files:
- hashtable_utility.h
- hashtable_utility.c
- email:
- deduce from:
- firstname.lastname @ cl.cam.ac.uk
This code is made available under the terms of the new BSD license.
If you use this code, drop me an email. It's nice to feel useful
occasionally.
I promise not to sell your email address to Nigerian spam bandits. Thanks.
Christopher Clark, January 2005.
struct hashtable *h; struct some_key *k; struct some_value *v; static unsigned int hash_from_key_fn( void *k ); static int keys_equal_fn ( void *key1, void *key2 ); h = create_hashtable(16, hash_from_key_fn, keys_equal_fn); k = (struct some_key *) malloc(sizeof(struct some_key)); v = (struct some_value *) malloc(sizeof(struct some_value)); (initialise k and v to suitable values) if (! hashtable_insert(h,k,v) ) { exit(-1); } if (NULL == (found = hashtable_search(h,k) )) { printf("not found!"); } if (NULL == (found = hashtable_remove(h,k) )) { printf("Not found\n"); } hashtable_destroy(h,1); /* second arg indicates "free(value)" */
The table will increase in size as elements are added, to keep the ratio of elements to table size below a threshold. The table is sized by selecting a prime number of appropriate magnitude, to ensure best distribution of the contents.
For improved type safety, macros have been defined and may be used to define type-safe(r) hashtable access functions, with methods specialized to take known key and value types as parameters. Example: Insert this at the start of your file:
DEFINE_HASHTABLE_INSERT(insert_some, struct some_key, struct some_value); DEFINE_HASHTABLE_SEARCH(search_some, struct some_key, struct some_value); DEFINE_HASHTABLE_REMOVE(remove_some, struct some_key, struct some_value);
This defines the functions 'insert_some', 'search_some' and 'remove_some'. These operate just like hashtable_insert etc., with the same parameters, but their function signatures have 'struct some_key *' rather than 'void *', and hence can generate compile time errors if your program is supplying incorrect data as a key (and similarly for value).
Note that the hash and key equality functions passed to create_hashtable still take 'void *' parameters instead of 'some key *'. This shouldn't be a serious issue as they're only defined and passed once, and the other functions will ensure that only valid keys are supplied to them.
The cost for this checking is increased code size and runtime overhead - if performance is important, it may be worth switching back to the unsafe methods once your program has been debugged with the safe methods.
The iterator is a simple one-way iterator over the hashtable contents, providing accessors for the the key and value at the current element.
/* Iterator constructor only returns a valid iterator if * the hashtable is not empty */ if (hashtable_count(h) > 0) { itr = hashtable_iterator(h); do { k = hashtable_iterator_key(itr); v = hashtable_iterator_value(itr); /* here (k,v) are a valid (key, value) pair */ /* We could call 'hashtable_remove(h,k)' - and this operation * 'free's k and returns v. * However, after the operation, the iterator is broken. */ } while (hashtable_iterator_advance(itr)); } free(itr);
You may find this (external) page of hash functions for strings helpful. Note that the hashtable includes a small section of code to protect against poor hash functions - it may be worthwhile removing this if you are sure you are using a good hash function.
If hashing strings, remember that strcmp
is not a boolean comparison
function directly suitable for keys_equal_fn
.
Archived copy of the original hashtable implementation, where table size is a power of two, rather than prime.
[ hashtable_powers.c ]
Christopher Clark
Updated 11th
January, 2005.


| twitter search |
containing both "twitter" and "search". This is the default operator |
| "happy hour" |
containing the exact phrase "happy hour" |
| love OR hate |
containing either "love" or "hate" (or both) |
| beer -root |
containing "beer" but not "root" |
| #haiku |
containing the hashtag "haiku" |
| from:twitterapi |
sent from the user @twitterapi |
| to:twitterapi |
sent to the user @twitterapi |
| place:opentable:2 |
about the place with OpenTable ID 2 |
| place:247f43d441defc03 |
about the place with Twitter ID 247f43d441defc03 |
| @twitterapi |
mentioning @twitterapi |
| superhero since:2011-05-09 |
containing "superhero" and sent since date "2011-05-09" (year-month-day). |
| twitterapi until:2011-05-09 |
containing "twitterapi" and sent before the date "2011-05-09". |
| movie -scary :) |
containing "movie", but not "scary", and with a positive attitude. |
| flight :( |
containing "flight" and with a negative attitude. |
| traffic ? |
containing "traffic" and asking a question. |
| hilarious filter:links |
containing "hilarious" and with a URL. |
| news source:tweet_button |
containing "news" and entered via the Tweet Button |


Preparation time
less than 30 mins
Cooking time
1 to 2 hours
Serves
Serves 6
Try this simple recipe for a juicy roast chicken flavoured with lemon and garlic.
Preheat the oven to 200C/400F/Gas 6.
For the garlic roast chicken, place the chicken into a roasting tin. Cut the lemon in half and squeeze the juice over the chicken, then rub the chicken with the rock salt.
Place the garlic, squeezed lemon halves and onion into the chicken cavity. Season the chicken all over with freshly ground black pepper and drizzle over a little olive oil.
Transfer to the oven and roast for 1¼ hours, or until the juices run clear when the chicken is pierced with a skewer and it is completely cooked through. Remove from the oven and allow to rest in a warm place for a few minutes before serving.
For the honey-glazed baby veg, heat the butter in a pan until it foams, then add the caraway seeds, thyme and vegetables. Stir well and season with salt and freshly ground black pepper.
Add the honey and bring to the boil. Reduce the heat and simmer, stirring occasionally, until all the vegetables are coated and the honey has thickened.
Just before serving, take some of the roasted garlic from inside the chicken cavity and squeeze out of its skin over the vegetables. Drizzle over the balsamic vinegar and stir well.
To serve, carve the chicken into portions and place onto serving plates with the honey-glazed baby veg.


Pat's Salmon Cookies: Sale data
Home!
Add New City Sales.
branch Name
Minimum Customer
Maximum Customer
Avarage Cookies
Save


| Transformation and the use of an autoinduction fermentor |
Escherichia coli
|
45-fold increase |
[
49]
|
| Transduction with tobacco mosaic virus |
Nicotiana benthamiana
|
Multigram quantity |
[
45]
|
| Agrobacterium vectors |
Nicotiana benthamiana
|
90% of the leaf cells and 50% of the total soluble protein |
[
50]
|
| Transduction with tobacco mosaic virus in pH 4 buffer, heating the extract to 55 °C, a bentonite MgCl
2 mixture, and chromatography.
|
Nicotiana benthamiana
|
88% ± 5% of griffithsin from the initial extract |
[
48]
|
| Particle bombardment |
Rice endosperm |
223 μg/g dry seed weight |
[
52]
|
| Use of probiotic microorganisms |
Lactobacillus rhamnosus GG and
L. rhamnosus GR-1
|
N/A |
[
51]
|
| Chloroplast transformation |
Nicotiana tabacum
|
360 μg of pure griffithsin per gram |
[
53]
|


All Selector (“*”)
Selects all elements.
Selects all elements.
Select all elements that are in the progress of an animation at the time the selector is run.
Selects elements that have the specified attribute with a value either equal to a given string or starting with that string followed by a hyphen (-).
Selects elements that have the specified attribute with a value containing a given substring.
Selects elements that have the specified attribute with a value containing a given word, delimited by spaces.
Selects elements that have the specified attribute with a value ending exactly with a given string. The comparison is case sensitive.
Selects elements that have the specified attribute with a value exactly equal to a certain value.
Select elements that either don’t have the specified attribute, or do have the specified attribute but not with a certain value.
Selects elements that have the specified attribute with a value beginning exactly with a given string.
Selects all button elements and elements of type button.
Selects all elements of type checkbox.
Matches all elements that are checked or selected.
Selects all direct child elements specified by “child” of elements specified by “parent”.
Selects all elements with the given class.
Select all elements that contain the specified text.
Selects all elements that are descendants of a given ancestor.
Selects all elements that are disabled.
Selects all elements with the given tag name.
Select all elements that have no children (including text nodes).
Selects all elements that are enabled.
Select the element at index n within the matched set.
Selects even elements, zero-indexed. See also odd.
Selects all elements of type file.
Selects all elements that are the first child of their parent.
Selects all elements that are the first among siblings of the same element name.
Selects the first matched element.
Selects element if it is currently focused.
Select all elements at an index greater than index within the matched set.
Selects elements that have the specified attribute, with any value.
Selects elements which contain at least one element that matches the specified selector.
Selects all elements that are headers, like h1, h2, h3 and so on.
Selects all elements that are hidden.
Selects a single element with the given id attribute.
Selects all elements of type image.
Selects all input, textarea, select and button elements.
Selects all elements of the specified language.
Selects all elements that are the last child of their parent.
Selects all elements that are the last among siblings of the same element name.
Selects the last matched element.
Select all elements at an index less than index within the matched set.
Matches elements that match all of the specified attribute filters.
Selects the combined results of all the specified selectors.
Selects all next elements matching “next” that are immediately preceded by a sibling “prev”.
Selects all sibling elements that follow after the “prev” element, have the same parent, and match the filtering “siblings” selector.
Selects all elements that do not match the given selector.
Selects all elements that are the nth-child of their parent.
Selects all elements that are the nth-child of their parent, counting from the last element to the first.
Selects all elements that are the nth-child of their parent, counting from the last element to the first.
Selects all elements that are the nth child of their parent in relation to siblings with the same element name.
Selects odd elements, zero-indexed. See also even.
Selects all elements that are the only child of their parent.
Selects all elements that have no siblings with the same element name.
Select all elements that have at least one child node (either an element or text).
Selects all elements of type password.
Selects all elements of type radio.
Selects all elements of type reset.
Selects the element that is the root of the document.
Selects all elements that are selected.
A selector representing selector passed to jQuery(), if any, when creating the original set.
Selects all elements of type submit.
Selects the target element indicated by the fragment identifier of the document’s URI.
Selects all elements of type text.
Selects all elements that are visible.
Add the previous set of elements on the stack to the current set, optionally filtered by a selector.
Get the children of each element in the set of matched elements, optionally filtered by a selector.
For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
Attach a handler to one or more events for all elements that match the selector, now or in the future, based on a specific set of root elements.
Reduce the set of matched elements to those that match the selector or pass the function’s test.
Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element.
Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element.
Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments.
Attach an event handler for all elements which match the current selector, now and in the future.
Get the immediately following sibling of each element in the set of matched elements. If a selector is provided, it retrieves the next sibling only if it matches that selector.
Get all following siblings of each element in the set of matched elements, optionally filtered by a selector.
Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed.
Get the parent of each element in the current set of matched elements, optionally filtered by a selector.
Get the ancestors of each element in the current set of matched elements, optionally filtered by a selector.
Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object.
Get the immediately preceding sibling of each element in the set of matched elements, optionally filtered by a selector.
Get all preceding siblings of each element in the set of matched elements, optionally filtered by a selector.
Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object.
Get the siblings of each element in the set of matched elements, optionally filtered by a selector.
Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements.
Add elements to the set of matched elements.
Insert content, specified by the parameter, after each element in the set of matched elements.
Add the previous set of elements on the stack to the current set.
Insert content, specified by the parameter, to the end of each element in the set of matched elements.
Insert every element in the set of matched elements to the end of the target.
Insert content, specified by the parameter, before each element in the set of matched elements.
Remove the set of matched elements from the DOM.
Remove event handlers previously attached using .live() from the elements.
Hide the matched elements by fading them to transparent.
Bind one or two handlers to the matched elements, to be executed when the mouse pointer enters and leaves the elements.
Get the HTML contents of the first element in the set of matched elements or set the HTML contents of every matched element.
Search for a given element from among the matched elements.
Insert every element in the set of matched elements after the target.
Insert every element in the set of matched elements before the target.
Return a collection of matched elements either found in the DOM based on passed argument(s) or created by passing an HTML string.
A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function’s arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties.
Load data from the server and place the returned HTML into the matched element.
Remove elements from the set of matched elements.
Remove an event handler.
Attach an event handler function for one or more events to the selected elements.
Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
Insert content, specified by the parameter, to the beginning of each element in the set of matched elements.
Insert every element in the set of matched elements to the beginning of the target.
Specify a function to execute when the DOM is fully loaded.
Remove the set of matched elements from the DOM.
Replace each target element with the set of matched elements.
JavaScript provides several built-in datatypes. In addition to those, this page documents virtual types like Selectors, enhanced pseudo-types like Events and all and everything you wanted to know about Functions. You should be able to try out most of the examples below by just copying them to your browser’s JavaScript Console (Chrome, Safari with Develop … Continue reading
Get the current value of the first element in the set of matched elements or set the value of every matched element.
Wrap an HTML structure around each element in the set of matched elements.
Wrap an HTML structure around all elements in the set of matched elements.
Wrap an HTML structure around the content of each element in the set of matched elements.


What is a hackathon?
A hackathon is a social coding event that brings computer programmers and other interested people together to improve upon or build a new program for a certain problem statement. Syrus is a type of Altruistic hackathon where participants work to find solutions for problems such as public transport systems, education and disaster response, security, etc.


Thus principally, to run computer autoshutdown using UPS software, is with link a batch script to perform shutdown. So, if there is a condition where the power is off, then that UPS software trigger the shutdown script to perform execution. In this example, I will use two kinds of UPS that are Prolink PRO 1200 SFCU and Eaton AVR 625.
Prolink PRO 1200 SFCU
In this example I use UPS on the computer with Windows Server 2008 R2 Operating System. The steps is explained below: Login into computer with UPS installed Install driver and UPS software. The insttaler can be download at:
http://www.power-software-download.com/viewpower/installViewPower_Windows.zip
To install the software, we just click next as well as almost installation process on Windows. After installed successfully, there will appear UPS icon on Windows system tray and there is a notification message about this system is starting. After installed, open control panel from that UPS software on browser with this address:
http://<IP_ADDRESS>:15178/ViewPower/#
Login as admin, the default password for Prolink PRO 1200 SFCU is “administrator”
Change this default password immediately on configuration menu ViewPower > Change Password
Check in to UPS Settings > Local Shutdown
Set the check box up on menu “When the UPS is running from the battery” and fill the section “Shut down the local system after” with value 6 (in minutes).
In the section “Time to wait before shutting down the local system” fill with value 5 (in minutes).
In the section “Maximum file execution time”, fill with value 1 (in minutes).
In the section “File to execute when shutting down” fill with value of path to shutdown script.
In the following example, I created script on C:\rshutdown.bat.
Then make a new file with notepad, give it name rshutdown.bat, save on disk C. The contents:
That command is being used to shutdown the computer.
Eaton AVR 625
Same as previous UPS configuration, the following setup I do with OS Windows Server 2008. The steps to setup are: Install UPS Eaton AVR software that delivered with the CD. The installation process once again is almost same as the Windows application installation, we just click next and next. After installation successful, set the UPS to run the shutdown process if a failure power source has occured. Click icon on Windows system tray, check in to menu Settings.
Fill with command line parameter where we save the batch file for shutdown. In the following example, I use file on “C:\User\edp11\Desktop\putty\shutdown.bat”
The script contents is same as previous script we write:
Testing
This step is important. The purpose is to verify setup process we have done so far. The checking process can be done with, cut off the UPS power source so it can simulate a power shutdown condition. After 5 minutes from the time the power source off, we can check if the autoshutdown process is success or not. If the computer softly turned off (warm shutdown) the the UPS software setup is success.
Shutdown another Host on the Network
In the script above, the shutdown command is used to shutdown computer that connected directly to UPS via USB data cable. In other way, for another computer with still on the same power source domain, the shutdown proccess can be applied via network with additional script and custom tools. The detail is explained below.
Windows Host Shutdown
We will shutdown the computer with Windows OS use psshutdown tools. Download the tool on:
https://download.sysinternals.com/files/PSTools.zip
Extract the psshutdown file, we only need this file to run the shutdown process. Save following file in anywhere, in this example in C:\psshutdown.exe. Then add the following file as file shutdown.bat:
In that example I use username foo and password bar and with IP <IP_ADDRESS>. Set this with our need. It is recommended to test the script with manually typing on the command prompt, to avoid notification from psshutdown application stop the shutdown process. Because, on the first time, we will asked for confirmation about end user license agreement from this application.
Linux Host Shutdown
In order to shutdown Linux based host, we use another application from putty that is plink.exe. Download from:
http://the.earth.li/~sgtatham/putty/latest/x86/putty.zip
Confirm that we can automatic login to Linux. To do this, we need to generate public and private key for Windows host where the autoshutdown trigger is run.
Click button Generate. While wait the key making process, we could moving the mouse in order to accelerate the process.
After generating process, save the public and private key. Save with easy name to find, for example for the public key we could named it key-server.pub and for the private key key-server.ppl. If the following notification appear, then click Yes, just ignore it, because weneed automatic login without passpharase which same as password.
For the next step, we need add public key that we have been created into host which want we access without password. Login in to that host with putty and user root. Then type this commands.
Change the parameter in the quotation mark (“ “) above using contents from key-server.pub public key file that exist. Then add this script in to file shutdown.bat.
Extract plink.exe file from putty package we have been downloaded and save in C:, as well as the key-server.ppk private key. Edit the IP Server above to your needs.
As well as the script to shutdown the Windows host, it is recommended to test the script with manually typing on the command prompt, to avoid notification from psshutdown application stop the shutdown process.


Getting a college qualification may be helpful. Courses are widely available and include:
- Level 1 Award in Salon Reception Duties (beauty and hairdressing)
- Level 1 Certificate in Business and Administration (office administration)
- Level 2 Certificate in Front of House Reception (hospitality and catering)
- Level 2 Diploma in Reception Operation and Services (hospitality and catering)
Entry requirements
You'll usually need:
- 2 or fewer GCSEs at grades 3 to 1 (D to G) for a level 1 course
- 2 or more GCSEs at grades 9 to 3 (A* to D) for a level 2 course


Utility class to perform operations against JGit objects.
| Type Params | Return Type | Name and description |
|---|---|---|
|
static Commit |
convertCommit(org.eclipse.jgit.revwalk.RevCommit rev) Converts a JGit commit to a Grgit commit. |
|
static Remote |
convertRemote(org.eclipse.jgit.transport.RemoteConfig rc) Converts a JGit remote to a Grgit remote. |
|
static Status |
convertStatus(org.eclipse.jgit.api.Status jgitStatus) Converts a JGit status to a Grgit status. |
|
static boolean |
isAncestorOf(Repository repo, Commit base, Commit tip) Checks if base is an ancestor of tip . |
|
static Branch |
resolveBranch(Repository repo, java.lang.String name) Resolves a Grgit branch from a name. |
|
static Branch |
resolveBranch(Repository repo, org.eclipse.jgit.lib.Ref ref) Resolves a Grgit branch from a JGit ref. |
|
static Commit |
resolveCommit(Repository repo, java.lang.String revstr) Resolves a Grgit Commit using the given revision string. |
|
static Commit |
resolveCommit(Repository repo, org.eclipse.jgit.lib.ObjectId id) Resolves a Grgit Commit using the given object. |
|
static org.eclipse.jgit.lib.ObjectId |
resolveObject(Repository repo, java.lang.String revstr) Resolves a JGit ObjectId using the given revision string. |
|
static java.util.Set<org.eclipse.jgit.lib.ObjectId> |
resolveParents(Repository repo, org.eclipse.jgit.lib.ObjectId id) Resolves the parents of an object. |
|
static org.eclipse.jgit.revwalk.RevObject |
resolveRevObject(Repository repo, java.lang.String revstr, boolean peel = false) Resolves a JGit RevObject using the given revision string. |
|
static Tag |
resolveTag(Repository repo, java.lang.String name) Resolves a Grgit tag from a name. |
|
static Tag |
resolveTag(Repository repo, org.eclipse.jgit.lib.Ref ref) Resolves a Grgit Tag from a JGit ref. |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Converts a JGit commit to a Grgit commit.
rev
- the JGit commit to convertConverts a JGit remote to a Grgit remote.
rc
- the remote config to convertConverts a JGit status to a Grgit status.
jgitStatus
- the status to convert Checks if base
is an ancestor of tip
.
repo
- the repository to look inbase
- the version that might be an ancestortip
- the tip versionResolves a Grgit branch from a name.
repo
- the Grgit repository to resolve fromname
- the name of the branch to resolveResolves a Grgit branch from a JGit ref.
repo
- the Grgit repository to resolve fromref
- the JGit ref to resolvenull
if the ref
is
null
Resolves a Grgit Commit
using the given revision string.
repo
- the Grgit repository to resolve the commit fromrevstr
- the revision string to use Resolves a Grgit Commit
using the given object.
repo
- the Grgit repository to resolve the commit fromid
- the object id of the commit to resolve Resolves a JGit ObjectId
using the given revision string.
repo
- the Grgit repository to resolve the object fromrevstr
- the revision string to useResolves the parents of an object.
repo
- the Grgit repository to resolve the parents fromid
- the object to get the parents of Resolves a JGit RevObject
using the given revision string.
repo
- the Grgit repository to resolve the object fromrevstr
- the revision string to usepeel
- whether or not to peel the resolved objectResolves a Grgit tag from a name.
repo
- the Grgit repository to resolve fromname
- the name of the tag to resolveResolves a Grgit Tag from a JGit ref.
repo
- the Grgit repository to resolve fromref
- the JGit ref to resolve


How do we do it?
We trained a ML model by providing it with thousands of examples of real and fake news. Th Model analyzes the text content of the news articles and tries to make sense of its autheticity and returns a probabilistic result.
Why is it a bit slow?
Like we said, we trained the models by using thousands of examples. Hence the size of ML model is too big. We are also creating word clouds and pie chart along with fetching related news in the background.
How accurate it is?
The ML model have been tested to give correct results 9/10 times. The accuracy score of the trained model remains between 0.68 to 0.80 for different models. Since we also provide related news articles, it's easy to identify the real news.


{% extends "layout.html" %} {% block body %}
Warning: categories cannot be changed later
* = field is required


|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.EventObject javax.management.Notification javax.management.monitor.MonitorNotification
public class MonitorNotification
Provides definitions of the notifications sent by monitor MBeans.
The notification source and a set of parameters concerning the monitor MBean's state need to be specified when creating a new object of this class. The list of notifications fired by the monitor MBeans is the following:
| Field Summary | |
|---|---|
static String |
OBSERVED_ATTRIBUTE_ERROR
Notification type denoting that the observed attribute is not contained in the observed object. |
static String |
OBSERVED_ATTRIBUTE_TYPE_ERROR
Notification type denoting that the type of the observed attribute is not correct. |
static String |
OBSERVED_OBJECT_ERROR
Notification type denoting that the observed object is not registered in the MBean server. |
static String |
RUNTIME_ERROR
Notification type denoting that a non-predefined error type has occurred when trying to get the value of the observed attribute. |
static String |
STRING_TO_COMPARE_VALUE_DIFFERED
Notification type denoting that the observed attribute has differed from the "string to compare" value. |
static String |
STRING_TO_COMPARE_VALUE_MATCHED
Notification type denoting that the observed attribute has matched the "string to compare" value. |
static String |
THRESHOLD_ERROR
Notification type denoting that the type of the thresholds, offset or modulus is not correct. |
static String |
THRESHOLD_HIGH_VALUE_EXCEEDED
Notification type denoting that the observed attribute has exceeded the threshold high value. |
static String |
THRESHOLD_LOW_VALUE_EXCEEDED
Notification type denoting that the observed attribute has exceeded the threshold low value. |
static String |
THRESHOLD_VALUE_EXCEEDED
Notification type denoting that the observed attribute has reached the threshold value. |
| Fields inherited from class javax.management.Notification |
|---|
source |
| Method Summary | |
|---|---|
Object |
getDerivedGauge()
Gets the derived gauge of this monitor notification. |
String |
getObservedAttribute()
Gets the observed attribute of this monitor notification. |
ObjectName |
getObservedObject()
Gets the observed object of this monitor notification. |
Object |
getTrigger()
Gets the threshold/string (depending on the monitor type) that triggered off this monitor notification. |
| Methods inherited from class javax.management.Notification |
|---|
getMessage, getSequenceNumber, getTimeStamp, getType, getUserData, setSequenceNumber, setSource, setTimeStamp, setUserData, toString |
| Methods inherited from class java.util.EventObject |
|---|
getSource |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String OBSERVED_OBJECT_ERROR
jmx.monitor.error.mbean
.
public static final String OBSERVED_ATTRIBUTE_ERROR
jmx.monitor.error.attribute
.
public static final String OBSERVED_ATTRIBUTE_TYPE_ERROR
jmx.monitor.error.type
.
public static final String THRESHOLD_ERROR
jmx.monitor.error.threshold
.
public static final String RUNTIME_ERROR
jmx.monitor.error.runtime
.
public static final String THRESHOLD_VALUE_EXCEEDED
jmx.monitor.counter.threshold
.
public static final String THRESHOLD_HIGH_VALUE_EXCEEDED
jmx.monitor.gauge.high
.
public static final String THRESHOLD_LOW_VALUE_EXCEEDED
jmx.monitor.gauge.low
.
public static final String STRING_TO_COMPARE_VALUE_MATCHED
jmx.monitor.string.matches
.
public static final String STRING_TO_COMPARE_VALUE_DIFFERED
jmx.monitor.string.differs
.
| Method Detail |
|---|
public ObjectName getObservedObject()
public String getObservedAttribute()
public Object getDerivedGauge()
public Object getTrigger()
|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2004, 2010 Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.


Home
Hacker Rank
Code Chef
Hacker Earth
About Us.
Login
Sign Up
Hello World
Data Types
Operators
Conditional statements
Classes and Instances
Loops
Let's Review
Array
Dictionaries and Maps
Recursion
Binary Numbers
2D Array
Inheritance
Abstract class
Scope
Linked List
Exceptions: Strings to Integers
More Exceptions
Stacks and Queues
Interfaces
Sorting
Generics
Binary Search Trees
BST Level-Oreder Transversal
More Linked Lists
Running Time And Complexity
Nested Logic
Testing
RegEx,Patterns, and Intro to Databases
Bitwise AND
Problem Statment
Objective
Task
Input Format
Constraints
Output Format
Sample Input 0
Sample Output 0
Sample Input 1
Sample Output 1
Explanation


Testwatcher
Sometimes when programming I like to leave unit tests running
repeatedly in one window while editing the code and tests in another.
The bash command watch
is useful for this, and can highlight the
differences between one invocation and the next in
inverse.
I wanted a version of watch
for use on Windows, so I whipped up a
quick Python script,
testwatcher, which produces
output very similar to watch, but is cross-platform, and features not
just inverse text, but yellow inverse text. Woo-hoo!
$ python example_test.py F.F ====================================================================== FAIL: testThat (__main__.TestWatcherTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "example_test.py", line 12, in testThat self.assertEquals(0, randint(0, 10)) AssertionError: 0 != 4 ====================================================================== FAIL: testThis (__main__.TestWatcherTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "example_test.py", line 9, in testThis self.assertEquals('one', object()) AssertionError: 'one' != d24460> ---------------------------------------------------------------------- Ran 3 tests in 0.001s FAILED (failures=2) _
Incidentally, the above test makes it very clear that Python objects in successive processes get new addresses on Linux, but interestingly on Windows the same addresses seems to get re-used for different processes.
I can't help but suspect this is a dumb script to have written - it should only be a:
while True: command
but in order to shoehorn the inverse text and colors in, it's grown to
300 lines - a hideous bloat for a minor superficial thrill. Plus the
Windows version flickers terribly - I'm currently using system('cls')
to clear the screen and then redraw it every second. I'll do some
searching for better ways to do it.
However - I've long wanted a Python interface to perform simple terminal actions like colors and animation on different platforms (the standard library 'curses' module that would otherwise do the job is simply not implemented on Windows.) So maybe it's time I used this script as an excuse to figure this out. Suggestions welcome.
Update: This idea may have now reached a viable fruition here.


0.5.0 (12/02/2020)
Seventh alpha release.
New features, fix and refactorings
- Allow using any JSON file as defaults file
- Always show the error message when built-in defaults file export fails
- Add distinct step of lookup elements also for template-based completion
- Code clean-up


Here is some text. It doesn't do anything special.
Here is more text. It has bold and emphasized content with more bold just to complicate things.


The following code is an example of how to extend the top level interface found in the academy-share.jar file.
package com.denofprogramming.controller; import com.denofprogramming.model.Registration; public interface RegistrationControllerInterface extends ControllerInterface <Registration>>{ }


Legal Mission Tracker
by Roni Akselrod
Add New Mission
File no.
Title
Description
Priority
Low
Medium
High
Very High
Assigned to
Add Mission


Key: = Must support, = QICore-defined extension, = Is-Modifier
| Field | Card. | Type and Description |
|---|---|---|
| action |
0..*
|
List<Concept>
|
| actionReason |
0..*
|
List<Concept>
|
| agent |
0..*
|
List<Agent>
|
| applies |
0..1
|
interval<DateTime>
|
| authority |
0..*
|
List<Organization>
|
| binding[x] |
0..1
|
Attachment | Composition | DocumentReference | QuestionnaireResponse
|
| domain |
0..*
|
List<Location>
|
| friendly |
0..*
|
List<Friendly>
|
| identifier |
0..1
|
Identifier
|
| issued |
0..1
|
DateTime
|
| legal |
0..*
|
List<Legal>
|
| rule |
0..*
|
List<Rule>
|
| signer |
0..*
|
List<Signer>
|
| subType |
0..*
|
List<Concept>
|
| subject |
0..*
|
List<Resource>
|
| term |
0..*
|
List<Term>
|
| topic |
0..*
|
List<Resource>
|
| type |
0..1
|
Concept
|
| valuedItem |
0..*
|
List<ValuedItem>
|
Key: = Must support, = QICore-defined extension, = Is-Modifier


Hello Today I will be explaining cache memory from scratch.After reading this post you will have clear understanding of following topics..
- What is Cache Memory
- How Cache works
- Why should you use it
- Cache types
What is Cache Memory
A Cache (Pronounced as “cash”) is a small and very fast temporary storage memory. It is designed to speed up the transfer of data and instructions. It is located inside or close to the CPU chip. It is faster than RAM and the data/instructions that are most recently or most frequently used by CPU are stored in cache.
How Cache works
The data and instructions are retrieved from RAM when CPU uses them for the first time. A copy of that data or instructions is stored in cache. The next time the CPU needs that data or instructions, it first looks in cache. If the required data is found there, it is retrieved from cache memory instead of main memory. It speeds up the working of CPU.
Why you should use it
As you have noted that function of Cache is to speed up the transfer of data from ram so that instead of accessing ram every time for next instruction the CPU looks for the data in Cache and there are very high probability that required data is already stored in cache therefor this process make the access time very less hence greater speed.
Types of Cache
A computer can have several different levels of cache memory. The level numbers refers to distance from CPU where Level 1 is the closest. All levels of cache memory are faster than RAM. The cache closest to CPU is always faster but generally costs more and stores less data then other level of cache.
Level 1 (L1) Cache::
It is also called primary or internal cache. It is built directly into the processor chip. It has small capacity from 8 Km to 128 Kb.
Level 2 (L2) Cache::
It is slower than L1 cache. Its storage capacity is more, i-e. From 64 Kb to 16 MB. The current processors contain advanced transfer cache on processor chip that is a type of L2 cache. The common size of this cache is from 512 kb to 8 Mb.
Level 3 (L3) Cache::
This cache is separate from processor chip on the motherboard. It exists on the computer that uses L2 advanced transfer cache. It is slower than L1 and L2 cache. The personal computer often has up to 8 MB of L3 cache.


Dinghy Ping
Domain: {{ domain }}
Response Code: {{ domain_response_code }}
Response Time: {{ domain_response_time_ms }}ms
Response Body:
{{ domain_response_text }}


Paris - FRANCE
<EMAIL_ADDRESS>- GitHub - LinkedIn - Stack Overflow
// Version 11.12.17
| 2016 | Engineering School | EPITA |
|---|---|---|
| 2011-2015 | Bachelor in Mathematics and Computer Science | Université René Descartes (Paris V) |
| 2011 | High school diploma - Science specialty | Lycée Galilée (Cergy) |
| Operating Systems | Mac OS, Linux (Fedora, Ubuntu), Windows |
|---|---|
| Programming Languages | Java, C, C++, PHP, HTML, CSS |
| Frameworks | Symfony2, CodeIgniter, Bootstrap |
| Office Software | Pack Office, Libre Office, MS Project, GanttProject |
| Languages | French (native language), English (TOEIC 850) |
| 2016 | Developed multiple projects in Java, C and C++ during my first year at EPITA: A parser, a shell, an abstract syntax tree, MyPhotoshop, etc. |
|---|---|
| 2015 | Creation of a website called Entr’aide in my last year at the University of Descartes : website aimed to connect people to exchange their skills. In a group of 4, we used the framework Symfony2 and the project was completed in 4 months. |
| 2014 | Animator for an online server called Nostalrius for 6 months. Founder of MID and CEESO, websites for sharing class notes for the University of Descartes and the European Center for Teaching Osteopathy respectively. Founder of the website Lemonlight for storing photos. |
| 2012 | Founder and developer of a website called failwithfairytales.fr. Programmed a game called “Ticket to ride” for a project at the University of Descartes using Java. In a group of 3 the project was completed in 3 months. |
Reliable, punctual and organized. Comfortable learning to use new technology.


@SamSykesSwears But what constitutes a stick?
What if anything wooden like spears and arrows count? Then it could be amazing.


{% if not next_date %}
| Savings |
{{famount(budget.expected_savings)}}
{% if budget.savings_goal > 0 %}/ {{famount(budget.savings_goal)}}{% endif %}
{% if budgets.adjusted_savings_goal > budget.savings_goal %}
⚠
{% endif %}
|
{% else %}
|
Budget Balance
?Theorical balance if the budget is respected (meaning if savings and all planned expenses are taken into account)
|
{{famount(budget.balance, True)}} |
{% endif %}
| Real Balance |
{{famount(budget.real_balance, True)}} |
|
Income
?Expected income is used unless month is finished or income higher than expected
|
{{famount(max(budget.expected_income, budget.income) if not next_date else budget.income)}}
{% if budget.expected_income and budget.income != budget.expected_income and next_date %}
({{famount(budget.income - budget.expected_income, True)}})
{% endif %}
|
{% if budget.expected_planned_expenses %}
|
Planned expenses
?Expected planned expenses is used for calculations. The number in brackets is the actual amount of planned expenses detected during this month
|
{{famount(budget.expected_planned_expenses)}} ({{famount(budget.planned_expenses)}})
|
{% endif %}
|
Expenses
?Does not include planned expenses
|
{{famount(budget.expenses)}} |


hours & guest policies
Casablanca serves dinner Monday through Saturday and is closed Sunday. Our hours are Monday through
Thursday from 5:30 p.m. to 9:00 p.m., Friday and Saturday from 5:00 p.m. to 9:00 p.m.
To make a reservation please call <IP_ADDRESS>, Monday through Saturday from 10:00 a.m. to 6:00 p.m.
or reserve online through OpenTable using the links below. Our Guest Services team can also be reached
via email at abc@example.com.


{% extends "layout.html" %} {% block title %}Delete Invoice {% endblock %} {% block body %}
Are you sure you want to delete this invoice?


Home
About us
Contact
Recipe Book
Halwa
Info
Time
20 Minutes
Preparation
40 Minutes
Servings
2
Ingredients
1
½ cup corn flour / corn starch
2
1½ cup water
3
1¼ cup sugar
4
1 tsp lemon juice
5
4-5 tbsp ghee / clarified butter
6
10 cashews, chopped
7
¼ tsp cardamom powder / elachi powder
8
Few drops of orange food colour / colour of your choice
9
5 almonds, chopped for garnish
Directions
Firstly, in a large mixing bowl take corn flour and water.
Mix well without forming any lumps.
Furthermore, add half cup of more water and continue to mix. keep aside.
In a large kadai / non-stick pan take sugar add water.
Pour corn flour mixture into the boiling sugar syrup.
Furthermore, stirring continuously on low-medium flame.
Once the corn flour mixture starts to boil, and starts to thicken.
Immediately add a tsp of lemon juice.
Also keep stirring till the mixture thickens completely.
Now add a tbsp full of ghee and mix continuously till all the ghee is absorbed.
Further, add another tbsp of more ghee and continue to mix till it turns glossy.
Then the mixture will start turning transparent and silky. releasing ghee from sides.
Add food colour, cardamom powder and chopped cashews.
Continue to mix till mixture will start to form a lump.
Later, transfer the mixture to a tray and level.
Also sprinkle some chopped almonds and rest for an hour.
Finally, cut to a desired shape and serve.
Go to back to recipes.


- temperatureAvgTextField - Variable in class com.smarthome.emulator.simulations.PerformanceSimulation
-
- temperatureCheckBox - Variable in class com.smarthome.emulator.simulations.PerformanceSimulation
-
- temperatureDevTextField - Variable in class com.smarthome.emulator.simulations.PerformanceSimulation
-
- temperatureMaxTextField - Variable in class com.smarthome.emulator.simulations.PerformanceSimulation
-
- temperatureMinTextField - Variable in class com.smarthome.emulator.simulations.PerformanceSimulation
-
- temperatureSeed - Variable in class com.smarthome.emulator.simulations.PerformanceSimulation
-
value generator - type "temperature" - seed
- terminate - Variable in class com.smarthome.emulator.simulations.basis.Adapter
-
Termination indicator
- terminate - Variable in class com.smarthome.emulator.simulations.basis.Scheduler
-
indicator of scheduler termination
- terminateAdapter() - Method in class com.smarthome.emulator.simulations.basis.Adapter
-
Terminates adapter's thread
- terminateScheduler() - Method in class com.smarthome.emulator.simulations.basis.Scheduler
-
Makes scheduler thread to finish
- time - Variable in class com.smarthome.emulator.simulations.basis.Response
-
time in which was response measured
- toBeSentDoc - Variable in class com.smarthome.emulator.simulations.basis.Logger
-
"to be sent log" document containing text
- toBeSentScroller - Variable in class com.smarthome.emulator.simulations.basis.Logger
-
JScrollPane
for "to be sent log" test area
- toBeSentScroller - Variable in class com.smarthome.emulator.simulations.DetailedSimulation
-
- toBeSentScroller - Variable in class com.smarthome.emulator.simulations.PerformanceSimulation
-
- toBeSentStyle - Variable in class com.smarthome.emulator.simulations.basis.Logger
-
"log text area regular text style
- toBeSentText - Variable in class com.smarthome.emulator.simulations.DetailedSimulation
-
- toBeSentText - Variable in class com.smarthome.emulator.simulations.PerformanceSimulation
-
- toBeSentTextArea - Variable in class com.smarthome.emulator.simulations.basis.Logger
-
JTextPane
for "to be sent log"
- toBeSentVerticalScrollBar - Variable in class com.smarthome.emulator.simulations.basis.Logger
-
JScrollBar
for "to be sent log"
- totalMem - Variable in class com.smarthome.emulator.simulations.DetailedSimulation
-
- totalMem - Variable in class com.smarthome.emulator.simulations.PerformanceSimulation
-
- trackResponse - Variable in class com.smarthome.emulator.simulations.basis.Logger
-
indicator of saving response time
- type - Variable in class com.smarthome.emulator.design.JNumberTextField
-
default type
- type - Variable in class com.smarthome.emulator.simulations.basis.Value
-
value type according to protocol
- types - Variable in class com.smarthome.emulator.simulations.forms.AddNewSensor
-
property file with names of predefined properties files
- typesFolder - Variable in class com.smarthome.emulator.simulations.forms.AddNewSensor
-
resource folder with predefined properties files
- typesList - Variable in class com.smarthome.emulator.simulations.forms.AddNewSensor
-
array of predefined types


Who is your match?
Please fill out your information to revel your soulmate
Age
What are you interested in?
Female
Male
Pop
RnB
Classical
Show me my soulmate!


We saw some outstanding individual performances from both the sides but in the end one team had to lose and it was the passing out batch of UGs. The team of FACULTY AND PGs WON with an over and a half to spare.
"Knowledge without application is like a book that is never read." Association of Civil Engineering organised the Site visit to the new Boys Hostel under construction.
After a dedicated work for a duration of 6 months, the complete teamwork of ACE is here! We now officially launch the website on the ocassion of new year 2018, to bring to you all the happenings of Department of Civil and Environmental Engineering.
The work of Mr. Mahipal, M.Tech student and Mr. Hasan Ahmed Faisal, B.Tech student (pass-out) on 'Cerium impregnated activated carbon composite as a filtering material for fluoride removal from groundwater' has been selected for Gandhian Young Technological Innovation (GYTI) award/appreciation 2018".
Centre for Earthquake Engineering Research (CEER), IIT Patna is going to organize a Short Course on Earthquake Resistant Design Based on Recently Revised Seismic Codes during 5th-7th April 2018. Details on the course and registration are available at following link:
https://sites.google.com/view/iitp-ceer-2018/home
Dr. Babloo Chaudhary (Ph.D., Kyushu University Japan) came to speak on the topic "Resilient Foundation Model against Earthquake and Tsunami".


Registration Number
First Name
Last Name
Telphone No.
Country
India
China
USA
Other
Email
Password
Your Feedback


Hong Kong leader refuses to give ground after poll setback
by The Associated PressHong Kong’s embattled leader Carrie Lam has refused to offer any concessions to anti-government protesters despite a local election setback.
Lam says she will accelerate dialogue and plans to set up a committee to review deep-seated social issues that contributed to grievances.
She at her weekly news conference Tuesday that the central government in Beijing didn’t blame her for poll outcome, in which pro-democracy bloc won a landslide victory with 90 per cent of seats.
She said Sunday’s election may have reflected unhappiness with the government but it also showed that many people want a stop to violence.
The Associated Press


The very same Raspberry Pi being used to develop this blog. Text editor is Spacemacs
Also my Google Voice AIY (v1) device.
Case 3D printed with my homebuilt Anet A8 using Inland brand black PLA. Using model from this thingiverse


Class: Aws::CloudFormation::Types::StackResourceDrift
| Relationships & Source Files | |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
self,
Struct
|
|
|
Instance Chain:
self,
::Aws::Structure ,
Struct
|
|
| Inherits: |
Struct
|
| Defined in: | gems/aws-sdk-cloudformation/lib/aws-sdk-cloudformation/types.rb |
Overview
Contains the drift information for a resource that has been checked
for drift. This includes actual and expected property values for
resources in which ::Aws::CloudFormation
has detected drift. Only resource
properties explicitly defined in the stack template are checked for
drift. For more information, see Detecting Unregulated Configuration
Changes to Stacks and Resources.
::Aws::Resources
that don't currently support drift detection can't be
checked. For a list of resources that support drift detection, see
Resources that ::Aws::Support
Drift Detection.
Use DetectStackResourceDrift to detect drift on individual resources, or DetectStackDrift to detect drift on all resources in a given stack that support drift detection.
Constant Summary
Instance Attribute Summary
-
#actual_properties ⇒ String
rw
A JSON structure containing the actual property values of the stack resource.
-
#expected_properties ⇒ String
rw
A JSON structure containing the expected property values of the stack resource, as defined in the stack template and any values specified as template parameters.
-
#logical_resource_id ⇒ String
rw
The logical name of the resource specified in the template.
-
#module_info ⇒ Types::ModuleInfo
rw
Contains information about the module from which the resource was created, if the resource was created from a module included in the stack template.
-
#physical_resource_id ⇒ String
rw
The name or unique identifier that corresponds to a physical instance ID of a resource supported by
::Aws::CloudFormation
. -
#physical_resource_id_context ⇒ Array<Types::PhysicalResourceIdContextKeyValuePair>
rw
Context information that enables
::Aws::CloudFormation
to uniquely identify a resource. -
#property_differences ⇒ Array<Types::PropertyDifference>
rw
A collection of the resource properties whose actual values differ from their expected values.
-
#resource_type ⇒ String
rw
The type of the resource.
-
#stack_id ⇒ String
rw
The ID of the stack.
-
#stack_resource_drift_status ⇒ String
rw
Status of the resource's actual configuration compared to its expected configuration.
-
#timestamp ⇒ Time
rw
Time at which
::Aws::CloudFormation
performed drift detection on the stack resource.
Instance Method Summary
::Aws::Structure
- Included
| #to_hash | Alias for Structure#to_h. |
Instance Attribute Details
#actual_properties ⇒ String
(rw)
A JSON structure containing the actual property values of the stack resource.
For resources whose StackResourceDriftStatus
is DELETED
, this
structure will not be present.
# File 'gems/aws-sdk-cloudformation/lib/aws-sdk-cloudformation/types.rb', line 7543
class StackResourceDrift < Struct.new( :stack_id, :logical_resource_id, :physical_resource_id, :physical_resource_id_context, :resource_type, :expected_properties, :actual_properties, :property_differences, :stack_resource_drift_status, :, :module_info) SENSITIVE = [] include Aws::Structure end
#expected_properties ⇒ String
(rw)
A JSON structure containing the expected property values of the stack resource, as defined in the stack template and any values specified as template parameters.
For resources whose StackResourceDriftStatus
is DELETED
, this
structure will not be present.
# File 'gems/aws-sdk-cloudformation/lib/aws-sdk-cloudformation/types.rb', line 7543
class StackResourceDrift < Struct.new( :stack_id, :logical_resource_id, :physical_resource_id, :physical_resource_id_context, :resource_type, :expected_properties, :actual_properties, :property_differences, :stack_resource_drift_status, :, :module_info) SENSITIVE = [] include Aws::Structure end
#logical_resource_id ⇒ String
(rw)
The logical name of the resource specified in the template.
# File 'gems/aws-sdk-cloudformation/lib/aws-sdk-cloudformation/types.rb', line 7543
class StackResourceDrift < Struct.new( :stack_id, :logical_resource_id, :physical_resource_id, :physical_resource_id_context, :resource_type, :expected_properties, :actual_properties, :property_differences, :stack_resource_drift_status, :, :module_info) SENSITIVE = [] include Aws::Structure end
#module_info ⇒ Types::ModuleInfo (rw)
Contains information about the module from which the resource was created, if the resource was created from a module included in the stack template.
# File 'gems/aws-sdk-cloudformation/lib/aws-sdk-cloudformation/types.rb', line 7543
class StackResourceDrift < Struct.new( :stack_id, :logical_resource_id, :physical_resource_id, :physical_resource_id_context, :resource_type, :expected_properties, :actual_properties, :property_differences, :stack_resource_drift_status, :, :module_info) SENSITIVE = [] include Aws::Structure end
#physical_resource_id ⇒ String
(rw)
The name or unique identifier that corresponds to a physical
instance ID of a resource supported by ::Aws::CloudFormation
.
# File 'gems/aws-sdk-cloudformation/lib/aws-sdk-cloudformation/types.rb', line 7543
class StackResourceDrift < Struct.new( :stack_id, :logical_resource_id, :physical_resource_id, :physical_resource_id_context, :resource_type, :expected_properties, :actual_properties, :property_differences, :stack_resource_drift_status, :, :module_info) SENSITIVE = [] include Aws::Structure end
#physical_resource_id_context ⇒ Array
<Types::PhysicalResourceIdContextKeyValuePair> (rw)
Context information that enables ::Aws::CloudFormation
to uniquely identify
a resource. ::Aws::CloudFormation
uses context key-value pairs in cases
where a resource's logical and physical IDs aren't enough to
uniquely identify that resource. Each context key-value pair
specifies a unique resource that contains the targeted resource.
# File 'gems/aws-sdk-cloudformation/lib/aws-sdk-cloudformation/types.rb', line 7543
class StackResourceDrift < Struct.new( :stack_id, :logical_resource_id, :physical_resource_id, :physical_resource_id_context, :resource_type, :expected_properties, :actual_properties, :property_differences, :stack_resource_drift_status, :, :module_info) SENSITIVE = [] include Aws::Structure end
#property_differences ⇒ Array
<Types::PropertyDifference> (rw)
A collection of the resource properties whose actual values differ
from their expected values. These will be present only for resources
whose StackResourceDriftStatus
is MODIFIED
.
# File 'gems/aws-sdk-cloudformation/lib/aws-sdk-cloudformation/types.rb', line 7543
class StackResourceDrift < Struct.new( :stack_id, :logical_resource_id, :physical_resource_id, :physical_resource_id_context, :resource_type, :expected_properties, :actual_properties, :property_differences, :stack_resource_drift_status, :, :module_info) SENSITIVE = [] include Aws::Structure end
#resource_type ⇒ String
(rw)
The type of the resource.
# File 'gems/aws-sdk-cloudformation/lib/aws-sdk-cloudformation/types.rb', line 7543
class StackResourceDrift < Struct.new( :stack_id, :logical_resource_id, :physical_resource_id, :physical_resource_id_context, :resource_type, :expected_properties, :actual_properties, :property_differences, :stack_resource_drift_status, :, :module_info) SENSITIVE = [] include Aws::Structure end
#stack_id ⇒ String
(rw)
The ID of the stack.
# File 'gems/aws-sdk-cloudformation/lib/aws-sdk-cloudformation/types.rb', line 7543
class StackResourceDrift < Struct.new( :stack_id, :logical_resource_id, :physical_resource_id, :physical_resource_id_context, :resource_type, :expected_properties, :actual_properties, :property_differences, :stack_resource_drift_status, :, :module_info) SENSITIVE = [] include Aws::Structure end
#stack_resource_drift_status ⇒ String
(rw)
Status of the resource's actual configuration compared to its expected configuration.
DELETED
: The resource differs from its expected template configuration because the resource has been deleted.MODIFIED
: One or more resource properties differ from their expected values (as defined in the stack template and any values specified as template parameters).IN_SYNC
: The resource's actual configuration matches its expected template configuration.NOT_CHECKED
:::Aws::CloudFormation
does not currently return this value.
# File 'gems/aws-sdk-cloudformation/lib/aws-sdk-cloudformation/types.rb', line 7543
class StackResourceDrift < Struct.new( :stack_id, :logical_resource_id, :physical_resource_id, :physical_resource_id_context, :resource_type, :expected_properties, :actual_properties, :property_differences, :stack_resource_drift_status, :, :module_info) SENSITIVE = [] include Aws::Structure end
#timestamp ⇒ Time
(rw)
Time at which ::Aws::CloudFormation
performed drift detection on the stack
resource.
# File 'gems/aws-sdk-cloudformation/lib/aws-sdk-cloudformation/types.rb', line 7543
class StackResourceDrift < Struct.new( :stack_id, :logical_resource_id, :physical_resource_id, :physical_resource_id_context, :resource_type, :expected_properties, :actual_properties, :property_differences, :stack_resource_drift_status, :, :module_info) SENSITIVE = [] include Aws::Structure end


Using protocols as composable extensions
Today we will talk about using Protocols as composable pieces for our ViewControllers. Protocols and Protocol Extensions are my second favorite Swift feature after Optionals. It helps us to create highly composable and reusable codebase without inheritance. For years we were using inheritance as a gold programming standard. But is it so good? Let’s take a look for simple BaseViewController which we used to have in every project.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import UIKit
class BaseViewController: UIViewController {
private let activityIndicator = UIActivityIndicatorView(style: .whiteLarge)
override func viewDidLoad() {
super.viewDidLoad()
view.addSubview(activityIndicator)
activityIndicator.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
activityIndicator.centerXAnchor.constraint(equalTo: view.safeAreaLayoutGuide.centerXAnchor),
activityIndicator.centerYAnchor.constraint(equalTo: view.safeAreaLayoutGuide.centerYAnchor)
])
}
func presenActivity() {
activityIndicator.startAnimating()
}
func dismissActivity() {
activityIndicator.stopAnimating()
}
func present(_ error: Error) {
let alert = UIAlertController(title: error.localizedDescription, message: nil, preferredStyle: .alert)
alert.addAction(.init(title: "Cancel", style: .cancel))
present(alert, animated: true)
}
}
It looks straightforward and usable because most of our ViewControllers need activity indicator while downloading data from the internet and error handling in case of something goes wrong during the data download. But we don’t stop with this, and we add more features to BaseViewController over a time. It starts bloating with a lot of general-purpose functions. Here we have at least two main problems:
- Our BaseViewController breaks the Single Responsibility Principle by implementing all these features in one place. Over time it will turn into Massive-View-Controller, which hard to understand and cover with tests.
- Every ViewController in our app inherit from BaseViewController to use all these features. In case of a bug in BaseViewController, we will have this bug in all ViewControllers in our app even if ViewController is not using buggy functionality from BaseViewController.
Protocols for the rescue.
Protocol Extensions feature was released with Swift 2.0 and bring real power to protocol types which announce new paradigm of programming: Protocol Oriented Programming. I recommend you to watch the talk from WWDC about Protocols and Protocol extensions.
Let’s go back to our topic. How can Protocols help us? Let’s start by declaring ActivityPresentable Protocol for presenting and dismissing an activity indicator.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
protocol ActivityPresentable {
func presentActivity()
func dismissActivity()
}
extension ActivityPresentable where Self: UIViewController {
func presentActivity() {
if let activityIndicator = findActivity() {
activityIndicator.startAnimating()
} else {
let activityIndicator = UIActivityIndicatorView(style: .whiteLarge)
activityIndicator.startAnimating()
view.addSubview(activityIndicator)
activityIndicator.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
activityIndicator.centerXAnchor.constraint(equalTo: view.safeAreaLayoutGuide.centerXAnchor),
activityIndicator.centerYAnchor.constraint(equalTo: view.safeAreaLayoutGuide.centerYAnchor)
])
}
}
func dismissActivity() {
findActivity()?.stopAnimating()
}
func findActivity() -> UIActivityIndicatorView? {
return view.subviews.compactMap { $0 as? UIActivityIndicatorView }.first
}
}
We extracted presentActivity and dismissActivity methods into the particular protocol type. We add default implementation via protocol extension for cases where Type which adopt this protocol is ViewController. It gives us the opportunity of using ViewController methods and properties in our protocol extension.
Let’s do the same for error presenting logic.
1
2
3
4
5
6
7
8
9
10
11
protocol ErrorPresentable {
func present(_ error: Error)
}
extension ErrorPresentable where Self: UIViewController {
func present(_ error: Error) {
let alert = UIAlertController(title: error.localizedDescription, message: nil, preferredStyle: .alert)
alert.addAction(.init(title: "Cancel", style: .cancel))
present(alert, animated: true)
}
}
Now we have two reusable protocol types which respect the Single Responsibility Principle. We can add them as the extension to any ViewController which need this functionality. The nice thing is that we are adding the only extension which needed in concrete ViewController and not inherits all the stuff from the BaseViewController. Here is the usage example of these protocols.
1
2
3
4
5
6
7
8
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
presentActivity()
}
}
extension ViewController: ActivityPresentable, ErrorPresentable {}
Another opportunity here is that we can easily ignore default implementation of the protocol to implement our customized ActivityIndicator for some of ViewControllers. Let’s take a look at the example.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
class CustomViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
presentActivity()
}
}
extension CustomViewController: ActivityPresentable {
func presentActivity() {
// Custom activity presenting logic
}
func dismissActivity() {
}
}
While adopting CustomViewController to ActivityPresentable protocol, we specify the custom implementation of presentActivity and dismissActivity methods.
Conclusion
As you can see, we can use protocols as simple extensions for our ViewController type. In the future posts, we will continue using protocols to build reusable parts of ViewController. We will touch associated type, and conditional conformance features to develop more generic data based extensions for ViewControllers.


Choose your plant:
Normal Plant
Super Plant
Posion Plant
Start
Add soil
Add super ferdiliazer
Add Water
Add Mineral Water
Add Light
Add Solar Charge
Choose new Plant
Your Plant's Values
Soil:
0
Water:
0
Light:
0


Fresh from reading what she describes as “a web page full of corrupted incomprehensible gibberish (though this may be no bad thing)”, Pansy Cradledew writes in response to Wednesday's item entitled The Voice Of Dobson?:
“I really feel I must take you to task about your treatment of Little Severin the Mystic Badger. How could you allow a small badger to act as a stooge in a plot involving shady dealings? He may no longer be quite so small as he once was, but surely poor, impressionable youngsters—badgers especially—should be protected from ne'er-do-wells bent on extortion? I'm shocked. Surely even languishing in a forgotten corner of the Yard would have been preferable to being a pawn in La Gubbins' questionable scheme. Yours indignantly, Pansy Cradledew”
I made the mistake of showing this letter to our resident crone, who was mightily pleased at being dubbed “La Gubbins” and is now having visiting cards printed up bearing the legend La Gubbins, Doyenne of Hooting Yard. This seems pointless to me, as she never actually visits anybody, preferring to spend her time knitting, brewing pots of tea, hatching fiendish criminal schemes and puckering her thin dry lips. Once or twice I have caught her reading the Fu-Manchu novels of Sax Rohmer, and I fear she is taking that villain as the role model for her dotage.


Module: graph
¶
|
Simple example of how to use the MCP and MCP_Geometric classes. |
|
Find the shortest path through an n-d array from one side to another. |
|
A class for finding the minimum cost path through a given n-d costs array. |
|
Connect source points using the distance-weighted minimum cost function. |
|
Find minimum cost paths through an N-d costs array. |
|
Find distance-weighted minimum cost paths through an n-d costs array. |
route_through_array¶
-
skimage.graph.
route_through_array
(array, start, end, fully_connected=True, geometric=True)[source]¶ Simple example of how to use the MCP and MCP_Geometric classes.
See the MCP and MCP_Geometric class documentation for explanation of the path-finding algorithm.
- Parameters
- arrayndarray
Array of costs.
- startiterable
n-d index into
array
defining the starting point- enditerable
n-d index into
array
defining the end point- fully_connectedbool (optional)
If True, diagonal moves are permitted, if False, only axial moves.
- geometricbool (optional)
If True, the MCP_Geometric class is used to calculate costs, if False, the MCP base class is used. See the class documentation for an explanation of the differences between MCP and MCP_Geometric.
- Returns
- pathlist
List of n-d index tuples defining the path from start to end.
- costfloat
Cost of the path. If geometric is False, the cost of the path is the sum of the values of
array
along the path. If geometric is True, a finer computation is made (see the documentation of the MCP_Geometric class).
See also
Examples
>>> import numpy as np >>> from skimage.graph import route_through_array >>> >>> image = np.array([[1, 3], [10, 12]]) >>> image array([[ 1, 3], [10, 12]]) >>> # Forbid diagonal steps >>> route_through_array(image, [0, 0], [1, 1], fully_connected=False) ([(0, 0), (0, 1), (1, 1)], 9.5) >>> # Now allow diagonal steps: the path goes directly from start to end >>> route_through_array(image, [0, 0], [1, 1]) ([(0, 0), (1, 1)], 9.19238815542512) >>> # Cost is the sum of array values along the path (16 = 1 + 3 + 12) >>> route_through_array(image, [0, 0], [1, 1], fully_connected=False, ... geometric=False) ([(0, 0), (0, 1), (1, 1)], 16.0) >>> # Larger array where we display the path that is selected >>> image = np.arange((36)).reshape((6, 6)) >>> image array([[ 0, 1, 2, 3, 4, 5], [ 6, 7, 8, 9, 10, 11], [12, 13, 14, 15, 16, 17], [18, 19, 20, 21, 22, 23], [24, 25, 26, 27, 28, 29], [30, 31, 32, 33, 34, 35]]) >>> # Find the path with lowest cost >>> indices, weight = route_through_array(image, (0, 0), (5, 5)) >>> indices = np.array(indices).T >>> path = np.zeros_like(image) >>> path[indices[0], indices[1]] = 1 >>> path array([[1, 1, 1, 1, 1, 0], [0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 1]])
shortest_path¶
-
skimage.graph.
shortest_path
(arr, reach=1, axis=-1, output_indexlist=False)[source]¶ Find the shortest path through an n-d array from one side to another.
- Parameters
- arrndarray of float64
- reachint, optional
By default (
reach = 1
), the shortest path can only move one row up or down for every step it moves forward (i.e., the path gradient is limited to 1). reach defines the number of elements that can be skipped along each non-axis dimension at each step.- axisint, optional
The axis along which the path must always move forward (default -1)
- output_indexlist: bool, optional
See return value p for explanation.
- Returns
- piterable of int
For each step along axis, the coordinate of the shortest path. If output_indexlist is True, then the path is returned as a list of n-d tuples that index into arr. If False, then the path is returned as an array listing the coordinates of the path along the non-axis dimensions for each step along the axis dimension. That is, p.shape == (arr.shape[axis], arr.ndim-1) except that p is squeezed before returning so if arr.ndim == 2, then p.shape == (arr.shape[axis],)
- costfloat
Cost of path. This is the absolute sum of all the differences along the path.
MCP
¶
-
class
skimage.graph.
MCP
(costs, offsets=None, fully_connected=True, sampling=None)¶ Bases:
object
A class for finding the minimum cost path through a given n-d costs array.
Given an n-d costs array, this class can be used to find the minimum-cost path through that array from any set of points to any other set of points. Basic usage is to initialize the class and call find_costs() with a one or more starting indices (and an optional list of end indices). After that, call traceback() one or more times to find the path from any given end-position to the closest starting index. New paths through the same costs array can be found by calling find_costs() repeatedly.
The cost of a path is calculated simply as the sum of the values of the costs array at each point on the path. The class MCP_Geometric, on the other hand, accounts for the fact that diagonal vs. axial moves are of different lengths, and weights the path cost accordingly.
Array elements with infinite or negative costs will simply be ignored, as will paths whose cumulative cost overflows to infinite.
- Parameters
- costsndarray
- offsetsiterable, optional
A list of offset tuples: each offset specifies a valid move from a given n-d position. If not provided, offsets corresponding to a singly- or fully-connected n-d neighborhood will be constructed with make_offsets(), using the fully_connected parameter value.
- fully_connectedbool, optional
If no offsets are provided, this determines the connectivity of the generated neighborhood. If true, the path may go along diagonals between elements of the costs array; otherwise only axial moves are permitted.
- samplingtuple, optional
For each dimension, specifies the distance between two cells/voxels. If not given or None, the distance is assumed unit.
- Attributes
- offsetsndarray
Equivalent to the offsets provided to the constructor, or if none were so provided, the offsets created for the requested n-d neighborhood. These are useful for interpreting the
traceback
array returned by the find_costs() method.
-
__init__
(costs, offsets=None, fully_connected=True, sampling=None)¶ See class documentation.
-
find_costs
()¶ Find the minimum-cost path from the given starting points.
This method finds the minimum-cost path to the specified ending indices from any one of the specified starting indices. If no end positions are given, then the minimum-cost path to every position in the costs array will be found.
- Parameters
- startsiterable
A list of n-d starting indices (where n is the dimension of the costs array). The minimum cost path to the closest/cheapest starting point will be found.
- endsiterable, optional
A list of n-d ending indices.
- find_all_endsbool, optional
If ‘True’ (default), the minimum-cost-path to every specified end-position will be found; otherwise the algorithm will stop when a a path is found to any end-position. (If no ends were specified, then this parameter has no effect.)
- Returns
- cumulative_costsndarray
Same shape as the costs array; this array records the minimum cost path from the nearest/cheapest starting index to each index considered. (If ends were specified, not all elements in the array will necessarily be considered: positions not evaluated will have a cumulative cost of inf. If find_all_ends is ‘False’, only one of the specified end-positions will have a finite cumulative cost.)
- tracebackndarray
Same shape as the costs array; this array contains the offset to any given index from its predecessor index. The offset indices index into the offsets attribute, which is a array of n-d offsets. In the 2-d case, if offsets[traceback[x, y]] is (-1, -1), that means that the predecessor of [x, y] in the minimum cost path to some start position is [x+1, y+1]. Note that if the offset_index is -1, then the given index was not considered.
-
goal_reached
()¶ int goal_reached(int index, float cumcost) This method is called each iteration after popping an index from the heap, before examining the neighbours.
This method can be overloaded to modify the behavior of the MCP algorithm. An example might be to stop the algorithm when a certain cumulative cost is reached, or when the front is a certain distance away from the seed point.
This method should return 1 if the algorithm should not check the current point’s neighbours and 2 if the algorithm is now done.
-
traceback
(end)¶ Trace a minimum cost path through the pre-calculated traceback array.
This convenience function reconstructs the the minimum cost path to a given end position from one of the starting indices provided to find_costs(), which must have been called previously. This function can be called as many times as desired after find_costs() has been run.
- Parameters
- enditerable
An n-d index into the costs array.
- Returns
- tracebacklist of n-d tuples
A list of indices into the costs array, starting with one of the start positions passed to find_costs(), and ending with the given end index. These indices specify the minimum-cost path from any given start index to the end index. (The total cost of that path can be read out from the cumulative_costs array returned by find_costs().)
MCP_Connect
¶
-
class
skimage.graph.
MCP_Connect
(costs, offsets=None, fully_connected=True)¶ Bases:
skimage.graph._mcp.MCP
Connect source points using the distance-weighted minimum cost function.
A front is grown from each seed point simultaneously, while the origin of the front is tracked as well. When two fronts meet, create_connection() is called. This method must be overloaded to deal with the found edges in a way that is appropriate for the application.
-
__init__
(self, /, *args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
create_connection
()¶ create_connection id1, id2, pos1, pos2, cost1, cost2)
Overload this method to keep track of the connections that are found during MCP processing. Note that a connection with the same ids can be found multiple times (but with different positions and costs).
At the time that this method is called, both points are “frozen” and will not be visited again by the MCP algorithm.
- Parameters
- id1int
The seed point id where the first neighbor originated from.
- id2int
The seed point id where the second neighbor originated from.
- pos1tuple
The index of of the first neighbour in the connection.
- pos2tuple
The index of of the second neighbour in the connection.
- cost1float
The cumulative cost at pos1.
- cost2float
The cumulative costs at pos2.
-
MCP_Flexible
¶
-
class
skimage.graph.
MCP_Flexible
(costs, offsets=None, fully_connected=True)¶ Bases:
skimage.graph._mcp.MCP
Find minimum cost paths through an N-d costs array.
See the documentation for MCP for full details. This class differs from MCP in that several methods can be overloaded (from pure Python) to modify the behavior of the algorithm and/or create custom algorithms based on MCP. Note that goal_reached can also be overloaded in the MCP class.
-
__init__
(costs, offsets=None, fully_connected=True, sampling=None)¶ See class documentation.
-
examine_neighbor
()¶ This method is called once for every pair of neighboring nodes, as soon as both nodes are frozen.
This method can be overloaded to obtain information about neightboring nodes, and/or to modify the behavior of the MCP algorithm. One example is the MCP_Connect class, which checks for meeting fronts using this hook.
-
travel_cost
()¶ This method calculates the travel cost for going from the current node to the next. The default implementation returns new_cost. Overload this method to adapt the behaviour of the algorithm.
-
update_node
()¶ This method is called when a node is updated, right after new_index is pushed onto the heap and the traceback map is updated.
This method can be overloaded to keep track of other arrays that are used by a specific implementation of the algorithm. For instance the MCP_Connect class uses it to update an id map.
-
MCP_Geometric
¶
-
class
skimage.graph.
MCP_Geometric
(costs, offsets=None, fully_connected=True)¶ Bases:
skimage.graph._mcp.MCP
Find distance-weighted minimum cost paths through an n-d costs array.
See the documentation for MCP for full details. This class differs from MCP in that the cost of a path is not simply the sum of the costs along that path.
This class instead assumes that the costs array contains at each position the “cost” of a unit distance of travel through that position. For example, a move (in 2-d) from (1, 1) to (1, 2) is assumed to originate in the center of the pixel (1, 1) and terminate in the center of (1, 2). The entire move is of distance 1, half through (1, 1) and half through (1, 2); thus the cost of that move is (1/2)*costs[1,1] + (1/2)*costs[1,2].
On the other hand, a move from (1, 1) to (2, 2) is along the diagonal and is sqrt(2) in length. Half of this move is within the pixel (1, 1) and the other half in (2, 2), so the cost of this move is calculated as (sqrt(2)/2)*costs[1,1] + (sqrt(2)/2)*costs[2,2].
These calculations don’t make a lot of sense with offsets of magnitude greater than 1. Use the sampling argument in order to deal with anisotropic data.
-
__init__
(costs, offsets=None, fully_connected=True, sampling=None)¶ See class documentation.
-


--- layout: archive title: Zulip Chat Archive permalink: /stream/113488-general/topic/find.20data.20necessary.20for.20instances.html ---
Is there an easy way to find which fields should be provided when defining an instance?
For example making an instance of a ring requires you to fill in a lot of data from different classes and manually going through each class in the hierarchy and finding the names of the respective data is quite some work
One method is a hole command, as seen briefly in Mario's coding session yesterday:
variable α : Type example : ring α := {! !}
In VSCode, click on the lightbulb and choose "generate a skeleton for the structure."
(You'll need the right import, probably mathlib's tactic.interactive
, I don't remember.)
If I type
example (R : Type) : ring R := { }
then (in VS Code) in the "problems" window (which I sometimes need to create by "pulling up" near the bottom of VS Code) then I see 15 problems, one for each field I need to create. Does this help?
Alternatively, you can just write an empty structure {} and look at the error messages. (What Kevin said.)
Within the { }
Lean is expecting me to write add := blah
etc, and I get a problem for each missing field.
Rob's import is correct -- I just tried it.
Thanks! Is there also a generate skeleton for emacs?
Yes, move the cursor inside the {! !}
and press C-c SPC
Not having much succes with the C-c SPC. What should I enter when asked for a hole command?
If you press tab, one of the options should be "Instance Stub — Generate a skeleton for the structure under construction."
It requires importing the mathlib module that Rob mentioned
{% endraw %}Last updated: Apr 24 2020 at 19:02 UTC


--- layout: archive title: Zulip Chat Archive permalink: /stream/113489-new-members/topic/.60where.60.20clause.20in.20Lean.3F.html ---
I want to define local helper functions; I can use let
for this, but it doesn't allow recursive definitions. what's the best way to do this? I can of course define separate functions, but then they end up having more arguments than they would if they were local... thanks for the help!
there is this where, for mutual inductive types
https://leanprover.github.io/theorem_proving_in_lean/inductive_types.html#mutual-and-nested-inductive-types
thanks for the pointer, matt! this will do, but I don't like it as much because:
No, you can't do this in lean 3, except via hackery
You have to define an auxiliary function if you have a nested recursion
if you search for _aux
in mathlib you will find plenty of examples
Mutual inductive types aren't the same
here's some hackery:
def reverse {α} (l : list α) : list α := let aux : list α → list α := match l with | [], r := r | (a::l), r := by exact _match l (a::r) end in aux [] #eval reverse [1,2,3]
why not use the recursor instead?
thanks for the definitive answer, Mario! I actually need the auxiliary function to be able to call the main one, so I thought the mutual inductive types would fit; I'll experiment with this, since let
didn't seem to cut it for me
Kenny, do you have a link for documentation on those?
Last updated: Apr 24 2020 at 19:02 UTC


Create new offer
Welcome<EMAIL_ADDRESS>|
Logout
Nike Pegasus
Buy it for $72,90
Adidas Falcon
Buy it for $132,00
Under Armour HOVR
Buy it for $149,99
Reebok Nano-9
Buy it for $92,29
Asics Gel-Quantum
Buy it for $140,00


I am a researcher with over a decade of experience in computational biology. I specialise in understanding biological processes by employing computer simulations and analysis of large volumes of data. During my university days I studied ecology and computational methods of physics. My experience covers also handling of large data sets of biological information (RNA / DNA sequences, annotated genes, epidemiological surveillance information) and statistical analysis of data. I also co-developed a model the spread of influenza in France during seasonal epidemics. I code in Python and C++.
After a brief brush with IT industry, I work on data-driven epidemiological models at the University of Warsaw.
If you want to contact me, go and FIND_ME. This web page is a bit of a lavish résumé.


Seamless link between North-east, Thailand to boost trade: Modi in Bangkok
OCI card holders can enrol for NPS; 1,000 youth from Asean nations to get post-doctoral seats in IITs
by BS Web TeamReaching out to the Indian diaspora at an event organised for the purpose in Bangkok, Prime Minister Narendra Modi said plans were on the cards to establish seamless connectivity between North-East India and Thailand.
He said that such a move would provide a fillip to both, India's Act East Policy, and Thailand's Act West Policy, and boost trade between the two nations, while enhancing the development of the entire region. As part of this initiative, the Prime Minister dwelt on the development of a 'Buddhist Circuit' that would connect Buddhist places of importance.
Modi also spoke about making the OCI (Overseas Citizenship Of India) card more flexible and stated that one of the first steps towards this end was to permit OCI card holders to enrol for the National Pension Scheme (NPS).
The Prime Minister added that 1,000 youth from Asean nations would be able to pursye post-doctoral fellowships at the Indian Institutes of Technology (IITs).
Modi had earlier dwelt on the issue of terror and militancy and had asserted that the impact of Scrapping 370 was felt across the world. He also said that due to changes in teh past five years, the people of India had given his government a bigger mandate in teh 2019 Lok Sabha elections.


Ping-Pong
About Ping Pong
Created by:
Elvis Mosoti
GitHub username/URL:
Mosoti17
Test for
Java script
Let's play!
Rules:
Ping pong will count your number from 1 with the following exceptions:
Numbers divisible by 3 become "ping"
Numbers divisible by 5 become "pong"
Numbers divisible by 3 and 5 become "pingpong"
Enter your Number here:
Ping Pong


This is the documentation and acceptance tests for a html publisher. The purpose with the html publisher os to allow a text written in html include source code that is properly formatted for html. Source code may be Java, xml, html, xhtml and so on. This document will act both as documentation of the tool and as an acceptance test document. It will contain the specific includes that should be handled properly as well as being used for the transformation.
A key feature is that the html should be formatted so no unnecessary line breaks are included in the transformed result. This is needed so Wordpress doesn't break a paragraph written in html just because a pretty code formatter did that.
Html comments should be respected in the sense that no transformation should be done inside of a comment. The comment should just be passed through the transformer without any changes in its formatting. An example may look like this:
Lists should be treated as paragraphs in the sense that any line breaks should not be included. Very long list items should be transformed so that they have there start tag and end tag on the same line. An example may look like:
The most important feature is including files. The include is defined with an include tag at the beginning of a row in the tml document. It should not be part of any tag, except the html and possible the body tag. The result should be a pre tag with the file properly transformed. The transformation should only be done for characters that has a special meaning in html. A typical example is '>' in xml that has to be transformed.
The different includes that are supported are these:
Simple file include:
<include-source-code root="./acceptance-test" file="./src/test/java/se/somath/publisher/AcceptanceTest.java"/>
And the result is:
./src/test/java/se/somath/publisher/AcceptanceTest.java
package se.somath.publisher; import org.apache.commons.io.FileUtils; import org.apache.commons.io.LineIterator; import org.junit.Test; import java.io.*; import java.util.Collection; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertThat; public class AcceptanceTest { @Test public void shouldVerifyThatProcessedFileIsEqualToExpected() throws IOException { String targetFileName = getActualFileName(); String expectedFileName = getExpectedFileName(); assertFileContentLineForLine(expectedFileName, targetFileName); } private String getActualFileName() { Collection<File> htmlFiles = getAllHtmlFiles(); String wantedFileName = "target/index.html"; return findFile(htmlFiles, wantedFileName); } private String getExpectedFileName() { Collection<File> htmlFiles = getAllHtmlFiles(); String wantedFileName = "resources/expected-index.html"; return findFile(htmlFiles, wantedFileName); } private void assertFileContentLineForLine(String expectedFile, String actualFile) throws FileNotFoundException { Reader actualReader = new FileReader(actualFile); Reader expectedReader = new FileReader(expectedFile); LineIterator actualIterator = new LineIterator(actualReader); LineIterator expectedIterator = new LineIterator(expectedReader); assertEachLine(actualFile, actualIterator, expectedIterator); assertFalse("The actual and target files has different length", expectedIterator.hasNext()); } private Collection<File> getAllHtmlFiles() { File currentDir = new File("."); String[] extensions = {"html"}; boolean recursive = true; return FileUtils.listFiles(currentDir, extensions, recursive); } private String findFile(Collection<File> htmlFiles, String wantedFileName) { for (File candidateFile : htmlFiles) { if (candidateFile.getAbsolutePath().endsWith(wantedFileName)) { return candidateFile.getAbsolutePath(); } } return "file not found"; } private void assertEachLine(String actualFile, LineIterator actualIterator, LineIterator expectedIterator) { int lineNumber = 0; while (actualIterator.hasNext()) { lineNumber++; String errorMessage = "\nsource file: " + actualFile + " \nline number: " + lineNumber; String actual = actualIterator.nextLine().trim(); String expected = expectedIterator.nextLine().trim(); assertThat(errorMessage, actual, is(expected)); } } }
Including a method from a file is done like this:
<include-source-code root="./acceptance-test" file="src/test/java/se/somath/publisher/AcceptanceTest.java" method="public void shouldVerifyThatProcessedFileIsEqualToExpected()" displayFileName="false"/>And the result is:
@Test public void shouldVerifyThatProcessedFileIsEqualToExpected() throws IOException { String targetFileName = getActualFileName(); String expectedFileName = getExpectedFileName(); assertFileContentLineForLine(expectedFileName, targetFileName); }
You can include a file tree like this:
<include-file-tree root="./acceptance-test"/>
And the result is:
acceptance-test |-- pom.xml `-- src |-- main | `-- resources | `-- index.html `-- test |-- java | `-- se | `-- somath | `-- publisher | `-- AcceptanceTest.java `-- resources `-- expected-index.html
You can include a file tree with only directories like this:
<include-file-tree root="./acceptance-test" only-dirs="true"/>
And the result is:
acceptance-test `-- src |-- main | `-- resources `-- test |-- java | `-- se | `-- somath | `-- publisher `-- resources
Pre and code tags should not be transformed at all, they should be treated as pass through without any alterations at all.