--- layout: post title: "Adding REST links as a cross-cutting concern" description: "Use a piece of middleware to enrich a Data Transfer Object. An ASP.NET Core example." date: 2020-08-24 6:47 UTC tags: [ASP.NET Web API, ASP.NET MVC, REST] --- {% include JB/setup %}
{{ page.description }}
When developing true REST APIs, you should use hypermedia controls (i.e. links) to guide clients to the resources they need. I've always felt that the code that generates these links tends to make otherwise readable Controller methods unreadable.
I'm currently experimenting with generating links as a cross-cutting concern. So far, I like it very much.
The code shown here is part of the sample code base that accompanies my book Code That Fits in Your Head.
Consider an online restaurant reservation system. When you make a GET
request against the home resource (which is the only published URL for the API), you should receive a representation like this:
{ "links": [ { "rel": "urn:reservations", "href": "http://localhost:53568/reservations" }, { "rel": "urn:year", "href": "http://localhost:53568/calendar/2020" }, { "rel": "urn:month", "href": "http://localhost:53568/calendar/2020/8" }, { "rel": "urn:day", "href": "http://localhost:53568/calendar/2020/8/13" } ] }
As you can tell, my example just runs on my local development machine, but I'm sure that you can see past that. There's three calendar links that clients can use to GET
the restaurant's calendar for the current day, month, or year. Clients can use these resources to present a user with a date picker or a similar user interface so that it's possible to pick a date for a reservation.
When a client wants to make a reservation, it can use the URL identified by the rel
(relationship type) "urn:reservations"
to make a POST
request.
I first wrote the code that generates these links directly in the Controller class that serves the home resource. It looked like this:
public IActionResult Get() { var links = new List<LinkDto>(); links.Add(Url.LinkToReservations()); if (enableCalendar) { var now = DateTime.Now; links.Add(Url.LinkToYear(now.Year)); links.Add(Url.LinkToMonth(now.Year, now.Month)); links.Add(Url.LinkToDay(now.Year, now.Month, now.Day)); } return Ok(new HomeDto { Links = links.ToArray() }); }
That doesn't look too bad, but 90% of the code is exclusively concerned with generating links. (enableCalendar
, by the way, is a feature flag.) That seems acceptable in this special case, because there's really nothing else the home resource has to do. For other resources, the Controller code might contain some composition code as well, and then all the link code starts to look like noise that makes it harder to understand the actual purpose of the Controller method. You'll see an example of a non-trivial Controller method later in this article.
It seemed to me that enriching a Data Transfer Object (DTO) with links ought to be a cross-cutting concern.
In ASP.NET Core, you can implement cross-cutting concerns with a type of middleware called IAsyncActionFilter. I added one called LinksFilter
:
internal class LinksFilter : IAsyncActionFilter { private readonly bool enableCalendar; public IUrlHelperFactory UrlHelperFactory { get; } public LinksFilter( IUrlHelperFactory urlHelperFactory, CalendarFlag calendarFlag) { UrlHelperFactory = urlHelperFactory; enableCalendar = calendarFlag.Enabled; } public async Task OnActionExecutionAsync( ActionExecutingContext context, ActionExecutionDelegate next) { var ctxAfter = await next().ConfigureAwait(false); if (!(ctxAfter.Result is OkObjectResult ok)) return; var url = UrlHelperFactory.GetUrlHelper(ctxAfter); switch (ok.Value) { case HomeDto homeDto: AddLinks(homeDto, url); break; case CalendarDto calendarDto: AddLinks(calendarDto, url); break; default: break; } } // ...
There's only one method to implement. If you want to run some code after the Controllers have had their chance, you invoke the next
delegate to get the resulting context. It should contain the response to be returned. If Result
isn't an OkObjectResult
there's no content to enrich with links, so the method just returns.
Otherwise, it switches on the type of the ok.Value
and passes the DTO to an appropriate helper method. Here's the AddLinks
overload for HomeDto
:
private void AddLinks(HomeDto dto, IUrlHelper url) { if (enableCalendar) { var now = DateTime.Now; dto.Links = new[] { url.LinkToReservations(), url.LinkToYear(now.Year), url.LinkToMonth(now.Year, now.Month), url.LinkToDay(now.Year, now.Month, now.Day) }; } else { dto.Links = new[] { url.LinkToReservations() }; } }
You can probably recognise the implemented behaviour from before, where it was implemented in the Get
method. That method now looks like this:
public ActionResult Get() { return new OkObjectResult(new HomeDto()); }
That's clearly much simpler, but you probably think that little has been achieved. After all, doesn't this just move some code from one place to another?
Yes, that's the case in this particular example, but I wanted to start with an example that was so simple that it highlights how to move the code to a filter. Consider, then, the following example.
The online reservation system enables clients to navigate its calendar to look up dates and time slots. A representation might look like this:
{ "links": [ { "rel": "previous", "href": "http://localhost:53568/calendar/2020/8/12" }, { "rel": "next", "href": "http://localhost:53568/calendar/2020/8/14" } ], "year": 2020, "month": 8, "day": 13, "days": [ { "links": [ { "rel": "urn:year", "href": "http://localhost:53568/calendar/2020" }, { "rel": "urn:month", "href": "http://localhost:53568/calendar/2020/8" }, { "rel": "urn:day", "href": "http://localhost:53568/calendar/2020/8/13" } ], "date": "2020-08-13", "entries": [ { "time": "18:00:00", "maximumPartySize": 10 }, { "time": "18:15:00", "maximumPartySize": 10 }, { "time": "18:30:00", "maximumPartySize": 10 }, { "time": "18:45:00", "maximumPartySize": 10 }, { "time": "19:00:00", "maximumPartySize": 10 }, { "time": "19:15:00", "maximumPartySize": 10 }, { "time": "19:30:00", "maximumPartySize": 10 }, { "time": "19:45:00", "maximumPartySize": 10 }, { "time": "20:00:00", "maximumPartySize": 10 }, { "time": "20:15:00", "maximumPartySize": 10 }, { "time": "20:30:00", "maximumPartySize": 10 }, { "time": "20:45:00", "maximumPartySize": 10 }, { "time": "21:00:00", "maximumPartySize": 10 } ] } ] }
This is a JSON representation of the calendar for August 13, 2020. The data it contains is the identification of the date, as well as a series of entries
that lists the largest reservation the restaurant can accept for each time slot.
Apart from the data, the representation also contains links. There's a general collection of links that currently holds only next
and previous
. In addition to that, each day has its own array of links. In the above example, only a single day is represented, so the days
array contains only a single object. For a month calendar (navigatable via the urn:month
link), there'd be between 28 and 31 days
, each with its own links
array.
Generating all these links is a complex undertaking all by itself, so separation of concerns is a boon.
As you can see in the above LinksFilter
, it branches on the type of value wrapped in an OkObjectResult
. If the type is CalendarDto
, it calls the appropriate AddLinks
overload:
private static void AddLinks(CalendarDto dto, IUrlHelper url) { var period = dto.ToPeriod(); var previous = period.Accept(new PreviousPeriodVisitor()); var next = period.Accept(new NextPeriodVisitor()); dto.Links = new[] { url.LinkToPeriod(previous, "previous"), url.LinkToPeriod(next, "next") }; if (dto.Days is { }) foreach (var day in dto.Days) AddLinks(day, url); }
It both generates the previous
and next
links on the dto
, as well as the links for each day. While I'm not going to bore you with more of that code, you can tell, I hope, that the AddLinks
method calls other helper methods and classes. The point is that link generation involves more than just a few lines of code.
You already saw that in the first example (related to HomeDto
). The question is whether there's still some significant code left in the Controller class?
The CalendarController
class defines three overloads of Get
- one for a single day, one for a month, and one for an entire year. Each of them looks like this:
public async Task<ActionResult> Get(int year, int month) { var period = Period.Month(year, month); var days = await MakeDays(period).ConfigureAwait(false); return new OkObjectResult( new CalendarDto { Year = year, Month = month, Days = days }); }
It doesn't look as though much is going on, but at least you can see that it returns a CalendarDto
object.
While the method looks simple, it's not. Significant work happens in the MakeDays
helper method:
private async Task<DayDto[]> MakeDays(IPeriod period) { var firstTick = period.Accept(new FirstTickVisitor()); var lastTick = period.Accept(new LastTickVisitor()); var reservations = await Repository .ReadReservations(firstTick, lastTick).ConfigureAwait(false); var days = period.Accept(new DaysVisitor()) .Select(d => MakeDay(d, reservations)) .ToArray(); return days; }
After having read relevant reservations
from the database, it applies complex business logic to allocate them and thereby being able to report on remaining capacity for each time slot.
Not having to worry about link generation while doing all that work seems like a benefit.
You must tell the ASP.NET Core framework about any filters that you add. You can do that in the Startup
class' ConfigureServices
method:
public void ConfigureServices(IServiceCollection services) { services.AddControllers(opts => opts.Filters.Add<LinksFilter>()); // ...
When registered, the filter executes for each HTTP request. When the object represents a 200 OK
result, the filter populates the DTOs with links.
By treating RESTful link generation as a cross-cutting concern, you can separate if from the logic of generating the data structure that represents the resource. That's not the only way to do it. You could also write a simple function that populates DTOs, and call it directly from each Controller action.
What I like about using a filter is that I don't have to remember to do that. Once the filter is registered, it'll populate all the DTOs it knows about, regardless of which Controller generated them.
Comments
Thanks for your good and insightful posts.
Separation of REST concerns from MVC controller's concerns is a great idea, But in my opinion this solution has two problems:
Distance between related REST implementations #
When implementing REST by MVC pattern often REST archetypes are the reasons for a MVC Controller class to be created. As long as the MVC Controller class describes the archetype, And links of a resource is a part of the response when implementing hypermedia controls, having the archetype and its related links in the place where the resource described is a big advantage in easiness and readability of the design. pulling out link implementations and putting them in separate classes causes higher readability and uniformity of the code abstranction levels in the action method at the expense of making a distance between related REST implementation.
Implementation scalability #
There is a switch statement on the ActionExecutingContext's result in the LinksFilter to decide what links must be represented to the client in the response.The DTOs thre are the results of the clients's requests for URIs. If this solution generalised for every resources the API must represent there will be several cases for the switch statement to handle. Beside that every resources may have different implemetations for generating their links. Putting all this in one place leads the LinksFilter to be coupled with too many helper classes and this coupling process never stops.
Solution #
LinkDescriptor and LinkSubscriber for resources links definition
Letting the MVC controller classes have their resource's links definitions but not in action methods.
Registering resources links by convention
Add dependencies and execute procedures for adding links to responses
And Last letting the LinksFilter to dynamicaly add resources links by utilizing ExpandoObject
If absoulute URI in href field is prefered, IUriHelper can be injected in LinksFilter to create URI paths.
Mark, thanks for figuring out the tricky parts so we don't have to. :-)
I did not see a link to a repo with the completed code from this article, and a cursory look around your Github profile didn't give away any obvious clues. Is the example code in the article part of a repo we can clone? If so, could you please provide a link?
Jes, it's part of a larger project that I'm currently working on. Eventually, I hope to publish it, but it's not yet in a state where I wish to do that.
Did I leave out essential details that makes it hard to reproduce the idea?
No, your presentation was fine. Looking forward to see the completed project!
Mehdi, thank you for writing. It's true that the
LinksFilter
implementation code contains aswitch
statement, and that this is one of multiple possible designs. I do believe that this is a trade-off rather than a problem per se.That
switch
statement is an implementation detail of the filter, and something I might decide to change in the future. I did choose that implementation, though, because I it was the simplest design that came to my mind. As presented, theswitch
statement just calls some private helper methods (all calledAddLinks
), but if one wanted that code close to the rest of the Controller code, one could just move those helper methods to the relevant Controller classes.While you wouldn't need to resort to Reflection to do that, it's true that this would leave that
switch
statement as a central place where developers would have to go if they add a new resource. It's true that your proposed solution addresses that problem, but doesn't it just shift the burden somewhere else? Now, developers will have to know that they ought to add aRegisterLinks
method with a specific signature to their Controller classes. This replaces a design with compile-time checking with something that may fail at run time. How is that an improvement?I think that I understand your other point about the distance of code, but it assumes a particular notion of REST that I find parochial. Most (.NET) developers I've met design REST APIs in a code-centric (if not a database-centric) way. They tend to conflate representations with resources and translate both to Controller classes.
The idea behind Representational State Transfer, however, is to decouple state from representation. Resources have state, but can have multiple representations. Vice versa, many resources may share the same representation. In the code base I used for this article, not only do I have three overloaded
Get
methods onCalendarController
that produceCalendarDto
representations, I also have aScheduleController
class that does the same.Granted, not all REST API code bases are designed like this. I admit that what actually motivated me to do things like this was to avoid having to inherit from
ControllerBase
. Moving all the code that relies heavily on the ASP.NET infrastructure keeps the Controller classes lighter, and thus easier to test. I should probably write an article about that...


Alternative Medicine
Description: Several participants mentioned in their focus group that they used sources of alternative medicine (especially drinking herbs) as a form of health and selfcare.
Comments:
- 'Not relying on an herbal-based medication system or alternative medicine.'
- 'They use herbs, pain killers and children's hypothermia drugs are always available at home.'
- 'Drink herbs all the time.'
- 'Drink herbs constantly.'
- 'And when they have a simple illness or health condition, they resort to painkillers or alternative natural treatments.'
Full Data link


I am experienced in leveraging agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collaborative thinking to further the overall value proposition.
Got my first project DesignatedHitter on which I was solely in charge of backend development with proper guidance from senior developers. Continued to maintain codebases on other projects (see below). Started working as a sole backend developer on LicenseSpring and got another project of my own: Bosch Smart Kiosk. Also learned alot about baseball.
Developed, upgraded and maintained codebases for web applications which include: LicenseSpring, NextUser, Ascalia, kWiki, doXray. Worked as part of a 20-plus-member team. Learned modern practices from some of the best in the business.
GPA: 4.06
GPA: 3.54
Software licensing platform for SaaS, ISVs and indie developers.
Revolutionizing youth baseball, one player at a time.
Smart retail solution provides interactive shopping experience to consumers.
Ascalia simplifies control and management of IoT systems.
Crafting gorgeous technical docs, knowledge bases, user guides, FAQs, and so much more.
Deep learning solution seamlessly integrates with custom workflows to replace manual repeatable work.
Tailor made global cargo tracking platform.
Serves you right.
Watches what you are watching.
IP camera detection and recognition with discord notifications.
 In the winter, I am either an avid snowboarder or curled up somewhere warm with a good book. During the warmer months here in Croatia, I enjoy visiting the seaside and relaxing.
When forced indoors, I am most comfortable playing video games, tinkering with technology or binge watching television shows, I love spending time with my family, and I spend a large amount of my free time exploring the latest technology advancements in the back-end web development world.


×
Title:
URL:
Content:
Contact/Stakeholder:
Assigned to
Senior Web Content Producer
Web Content Producer
Executive Communications
Mobile Team
Development Team
Done!
Start Date:
End Date:
Repeat:
never
weekly
monthly (day of month)
monthly on the nth weekday
yearly
times.
×
Title:
URL:
Content:
Contact/Stakeholder:
Assigned to
Senior Web Content Producer
Web Content Producer
Executive Communications
Mobile Team
Development Team
Done!
Start Date:
End Date:
Repeat:
never
weekly
monthly (day of month)
monthly on the nth weekday
yearly
times.


Scenery Accessibility Examples: Slider
Press tab to select the slider, use the right and left arrow keys to move.


General COVID Statistics
-
Case Density Rating:
-
Infection Rate Rating:
-
Positive Test Ratio Rating:
Nearby Charities (General)
Hospital Response to COVID
-
Contact Tracer Capacity Rating:
-
ICU Capacity Rating:
-
ICU Headroom Rating:
Estimated COVID Hospital Beds
Estimated Contact Tracers
Nearby Charities (Hospital)
Government Response to COVID
- Bar Restrictions:
- Gathering Restrictions:
- Non-Essential Businesses:
- Reopen Status:
- Stay at Home Requirement:
- Restaurant Restrictions:
Nearby Charities (Gov't/Small Business)


A lot of new coins and Decentralized Autonomous Apps or Dapps are being made on the Ethereum ERC 20 tokens. It allows you to get your profits directly on the basis of the contract with the coin holders based on Ethereum contracts.
Many new coins or dapps don’t have their exclusive wallet for us to access the balances, especially during the early stages. This new API named TokenBalance allows you to access your ERC 20 balance with ease. You just have to put in the Ethereum address and the contract address and you are good to go! There is also a drop down list of all the contracts currently in the ERC 20 bracket. You can chose among the Monacos, Polybiuses and others.
TokenBalance.com makes life a little simplier by letting you check your crypto balances even if the coin creators havn't made a wallet/client yet.
We are always connected to a forever updating Ethereum geth server, we'll be able to fetch transactions that happened moments ago.
All requests on the API must go to HTTPS, it will not be routeable any other way. Our geth server's are not public, but our API is free to use everytime!
Use the API on your website or inside of your application to create a real "wallet" feel. The API is super fast, reliable for your next application.
Token Balance has an increadible easy API for ethereum contract tokens and I recommend you try to implement it in your next application.
Many people don't know the true power behind the Ethereum blockchain, you might have other crypto currencies in your wallet that you didn't even know about.
Mainnet - https://api.tokenbalance.com/token/$CONTRACT/$ETH_ADDRESS Ropsten Testnet - https://test.tokenbalance.com/token/$CONTRACT/$ETH_ADDRESS
CONTRACT=0x89205a3a3b2a69de6dbf7f01ed13b2108b2c43e7 ETH_ADDRESS=0x198ef1ec325a96cc354c7266a038be8b5c558f67 curl https://api.tokenbalance.com/token/$CONTRACT/$ETH_ADDRESS
{ "name": "Golem Network Token", "wallet": "0xda0aed568d9a2dbdcbafc1576fedc633d28eee9a", "symbol": "GNT", "balance": 7.998173814269688, "eth_balance": 0.9912952230000018, "decimals": 18, "block": 3461147 }
Easy right!? The 'balance' is already formated for you with the decimal provided. I find this to be an easy method to get my balance for my alt cryptocurrencies. Most of the developers havn't even created a stable wallet yet! I've seen many people using geth full time to check their balance, little much in my book. Use the API and be free.
CONTRACT=0x89205a3a3b2a69de6dbf7f01ed13b2108b2c43e7 ETH_ADDRESS=0x198ef1ec325a96cc354c7266a038be8b5c558f67 curl https://api.tokenbalance.com/balance/$CONTRACT/$ETH_ADDRESS
5401731.0867782926098
This is perfect for applications that just want to show the ERC20 token balance in plain text. No JSON parsing needed!


Roman Numerals |
Look at the symbols below. They both stand for the same number.  Roman numerals are written using some capital letters of the English alphabet.
Color the box with the correct roman numeral for each number.


This SRFI is currently in final status. Here is an explanation of each status that a SRFI can hold. To provide input on this SRFI, please send email to<EMAIL_ADDRESS>. To subscribe to the list, follow these instructions. You can access previous messages via the mailing list archive.
List queues are mutable ordered collections that can contain any Scheme object. Each list queue is based on an ordinary Scheme list containing the elements of the list queue by maintaining pointers to the first and last pairs of the list. It's cheap to add or remove elements from the front of the list or to add elements to the back, but not to remove elements from the back. List queues are disjoint from other types of Scheme objects.
No issues at present.
The list queues described in this SRFI are objects of a disjoint type that provide an ordered sequence of arbitrary Scheme objects. Like lists, they provide sequential access to their elements; unlike lists, they normally should not share storage with other list queues, unless special precautions have been taken.
Technically, a queue is an object that makes it efficient to remove elements from the front and to add elements to the back. List queues also make it efficient to add elements to the front, but removing elements from the back is inefficient. Therefore, because these objects do not provide the normal behavioral guarantees of deques, they are not referred to as deques. True deques will be provided in a future SRFI.
Historically, objects of this form were called "tconc structures" (where "tconc" is short for "tail concatenate"), and Lispers have tended to roll their own using pairs. This version uses a record to hold the first-pair and last-pair pointers rather than a pair, but uses pairs and the empty list internally.
Because the representation of list queues as lists is exposed by the implementation, it's not necessary to provide a comprehensive API for list queues. Instead, SRFI 1 and other list APIs can serve the same purpose, using the conversion procedures to convert between list queues and lists fairly cheaply. Consequently, the API provided here over and above the bare necessities of queueing and dequeueing elements is roughly analogous to the R7RS-small API for lists. It also subsumes the Chicken and SLIB APIs.
(make-list-queue list [ last ])
Returns a newly allocated list queue containing the elements of list in order. The result shares storage with list. If the last argument is not provided, this operation is O(n) where n is the length of list.
However, if last is provided, make-list-queue
returns a newly allocated list queue containing the elements of the list whose first pair is first and whose last pair is last. It is an error if the pairs do not belong to the same list. Alternatively, both first and last can be the empty list. In either case, the operation is O(1).
Note: To apply a non-destructive list procedure to a list queue and return a new list queue, use (make-list-queue (proc (list-queue-list list-queue))).
(list-queue element ...)
Returns a newly allocated list queue containing the elements. This operation is O(n) where n is the number of elements.
(list-queue-copy list-queue)
Returns a newly allocated list queue containing the elements of list-queue. This operation is O(n) where n is the length of list-queue
(list-queue-unfold stop? mapper successor seed [ queue ])
Performs the following algorithm:
If the result of applying the predicate stop? to seed is true, return queue. Otherwise, apply the procedure mapper to seed, returning a value which is added to the front of queue. Then get a new seed by applying the procedure successor to seed, and repeat this algorithm.
If queue is omitted, a newly allocated list queue is used.
(list-queue-unfold-right stop? mapper successor seed [ queue ])
Performs the following algorithm:
If the result of applying the predicate stop? to seed is true, return the list queue. Otherwise, apply the procedure mapper to seed, returning a value which is added to the back of the list queue. Then get a new seed by applying the procedure successor to seed, and repeat this algorithm.
If queue is omitted, a newly allocated list queue is used.
(list-queue? obj)
Returns #t if obj is a list queue, and #f otherwise. This operation is O(1).
(list-queue-empty? list-queue)
Returns #t if list-queue has no elements, and #f otherwise. This operation is O(1).
(list-queue-front list-queue)
Returns the first element of list-queue. If the list queue is empty, it is an error. This operation is O(1).
(list-queue-back list-queue)
Returns the last element of list-queue. If the list queue is empty, it is an error. This operation is O(1).
(list-queue-list list-queue)
Returns the list that contains the members of list-queue in order. The result shares storage with list-queue. This operation is O(1).
(list-queue-first-last list-queue)
Returns two values, the first and last pairs of the list that contains the members of list-queue in order. If list-queue is empty, returns two empty lists. The results share storage with list-queue. This operation is O(1).
(list-queue-add-front! list-queue element)
Adds element to the beginning of list-queue. Returns an unspecified value. This operation is O(1).
(list-queue-add-back! list-queue element)
Adds element to the end of list-queue. Returns an unspecified value. This operation is O(1).
(list-queue-remove-front! list-queue)
Removes the first element of list-queue and returns it. If the list queue is empty, it is an error. This operation is O(1).
(list-queue-remove-back! list-queue)
Removes the last element of list-queue and returns it. If the list queue is empty, it is an error. This operation is O(n) where n is the length of list-queue, because queues do not not have backward links.
(list-queue-remove-all! list-queue)
Removes all the elements of list-queue and returns them in order as a list. This operation is O(1).
(list-queue-set-list! list-queue list [ last ])
Replaces the list associated with list-queue with list, effectively discarding all the elements of list-queue in favor of those in list. Returns an unspecified value. This operation is O(n) where n is the length of list. If last is provided, it is treated in the same way as in make-list-queue
, and the operation is O(1).
Note: To apply a destructive list procedure to a list queue, use (list-queue-set-list! (proc (list-queue-list list-queue))).
(list-queue-append list-queue ...)
Returns a list queue which contains all the elements in front-to-back order from all the list-queues in front-to-back order. The result does not share storage with any of the arguments. This operation is O(n) in the total number of elements in all queues.
(list-queue-append! list-queue ...)
Returns a list queue which contains all the elements in front-to-back order from all the list-queues in front-to-back order. It is an error to assume anything about the contents of the list-queues after the procedure returns. This operation is O(n) in the total number of queues, not elements. It is not part of the R7RS-small list API, but is included here for efficiency when pure functional append is not required.
(list-queue-concatenate list-of-list-queues)
Returns a list queue which contains all the elements in front-to-back order from all the list queues which are members of list-of-list-queues in front-to-back order. The result does not share storage with any of the arguments. This operation is O(n) in the total number of elements in all queues. It is not part of the R7RS-small list API, but is included here to make appending a large number of queues possible in Schemes that limit the number of arguments to apply.
(list-queue-map proc list-queue)
Applies proc to each element of list-queue in unspecified order and returns a newly allocated list queue containing the results. This operation is O(n) where n is the length of list-queue.
(list-queue-map! proc list-queue)
Applies proc to each element of list-queue in front-to-back order and modifies list-queue to contain the results. This operation is O(n) in the length of list-queue. It is not part of the R7RS-small list API, but is included here to make transformation of a list queue by mutation more efficient.
(list-queue-for-each proc list-queue)
Applies proc to each element of list-queue in front-to-back order, discarding the returned values. Returns an unspecified value. This operation is O(n) where n is the length of list-queue.
The sample implementation places the identifiers defined above into the list-queue
library.
The sample implementation contains the following files:
list-queues-impl.scm
– implementation of queueslist-queues.sld
– an R7RS library named (list-queue)
list-queues.scm
– a Chicken librarylist-queues-test.scm
– tests using the Chicken test eggPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


Below is a javascript generated list of all current html elements for study and styling (except deprecated or <style>. [contenteditable] has been set for all elements, so you can edit them too. Content parsed from W3schools. Styling normalization provided by TypePlate.


Total # of uranium:
Temperature of uranium:
Initial # of neutrons:
Temperature of neutrons:
Absorb Scatter Fission
Total cross-section size:
Min
Max
On
Off


A NodeItem represents a node with all of its data. It also has a interface to start/stop/restart nodes.
Sends a signal to top or restart the node.
| Parameters: | action (RemoteAction) – action to be executed |
|---|
Returns the detailed data of the NodeItem.
| Returns: | str |
|---|
Returns items for the plot.
| Returns: | str[] |
|---|
The ItemFilterProxy which is a QSortFilterProxyModel helps to filter the data going to the view so the user only sees what he wants to see (which he can modified by telling the view).
Tells by analysing the given row if it should be shown or not. This behaviour can be modified via setFilterRegExp method so that e.g. only the entries of a specific host can be shown.
| Parameters: |
|
|---|---|
| Returns: | bool |
Defines the sorting of behaviour when comparing two entries of model item by telling how to compare these.
| Parameters: |
|
|---|---|
| Returns: | bool |
Set true if connections should be shown
| Parameters: | show_connections (bool) – true if connections should be shown |
|---|
Set true if hosts should be shown
| Parameters: | show_hosts (bool) – true if hosts should be shown |
|---|
Set true if nodes should be shown
| Parameters: | show_nodes (bool) – true if nodes should be shown |
|---|
Set true if topics should be shown
| Parameters: | show_topics (bool) – true if topics should be shown |
|---|
This thread should buffer the incoming data and regularly update the model and hence also the model.
The RootItem represents the parent of the ROSModel
Returns the detailed data of the NodeItem.
| Returns: | str |
|---|
Returns items for the plot.
| Returns: | str[] |
|---|
Returns the units of the items for the plot.
:returns str[]
A TopicItem represents a specific topic which contains many connections and has attributes like the number of sent messages.
Not senseful, throws an exception.
| Parameters: | action (RemoteAction) – action to be executed |
|---|
Returns the detailed data of the TopicItem.
| Returns: | str |
|---|
Returns items for the plot.
| Returns: | str[] |
|---|
Provides a unified interface to access the items of the model. INTERNAL: WARNING! Whenever the key-values at the beginning are not set right, the oddest things may occur!
Append a child to the list of childs.
| Parameters: | child (AbstractItem) – the child item |
|---|
Appends data to the data of the AbstractItem.
| Parameters: | data (dict) – the data to append in key value form |
|---|
Appends data to the data of the AbstractItem.
| Parameters: | data (dict) – the data to append in key value form |
|---|
Appends data to the rate_data of the AbstractItem.
| Parameters: | data (dict) – the data to append in key value from |
|---|
Returns the number of children from the AbstractItem.
| Returns: | int |
|---|
Returns the number of columns.
| Returns: | int |
|---|
Deletes all items which are older than time.
| Parameters: | time (rospy.Time) – the upper bound |
|---|
Executes a action on the current item like stop or restart. Calls to this method should be redirected to the remote host on executed there.
| Parameters: | acion – the action which should be executed |
|---|
Returns the child at the position row.
| Parameters: | row (int) – the index of the row |
|---|---|
| Returns: | AbstractItem |
Returns a list with all children.
| Returns: | list |
|---|
Returns detailed description of current state as html text.
| Returns: | str |
|---|
Returns all items which are older than time.
| Parameters: |
|
|---|---|
| Returns: | dict of lists |
Returns all items which are younger than time.
| Parameters: | time (rospy.Time) – the lower bound in seconds |
|---|---|
| Returns: | dict of lists |
Returns the latest dict of the data_list or the item of the dict with the given key.
| Parameters: | kwargs (str) – the keys to the dict |
|---|---|
| Returns: | dict or the item |
Returns the seuid of the Abstractitem.
| Returns: | str |
|---|
Returns the state of the AbstractItem.
| Returns: | str |
|---|
Returns the parent of this or None if there is no parent.
| Returns: | AbstractItem |
|---|
Returns the index of the Item.
| Returns: | int |
|---|
Appends data to the rated_data of the AbstractItem.
| Parameters: |
|
|---|
A HostItem represents a host with all its data.
Sends a signal to stop or restart a host.
| Parameters: | action (RemoteAction) – action to be executed |
|---|
Returns the detailed data of the HostItem.
| Returns: | str |
|---|
Returns items for the plot.
| Returns: | str[] |
|---|
The LogFilterProxy will especially be used to filter the complete log e.g. by a specific node. This function is needed in the SelectionWidget where of course only the log of the current selection should be shown.
| Parameters: |
|
|---|---|
| Returns: | bool |
Used to tell the filter by which item should filter. If the AbstractItem is None all log entries should be shown.
| Parameters: | item (AbstractItem) – the item by which the filter should filter |
|---|
Defines the sorting of behaviour when comparing two entries of model item by telling how to compare these.
| Parameters: |
|
|---|---|
| Returns: | bool |
Helper-Class which allow ROSModel to be a Singleton
Enables automated updates of the view, it represents the data as a QtModel
Adds a log entry to the log_model.
| Parameters: |
|
|---|
Returns the amount of columns in the model.
| Parameters: | parent (QModelIndex) – the parent |
|---|---|
| Returns: | int |
Returns the data of an item at the given index.
| Parameters: |
|
|---|
Returns the flags of the item at the given index (like Qt::ItemIsEnabled).
| Parameters: | index (QModelIndex) – the index of the item |
|---|---|
| Returns: | ItemFlags |
Returns an item according to the given seuid.
| Parameters: | seuid (str) – the seuid of the wanted item |
|---|---|
| Returns: | AbstractItem |
Returns the log_model.
| Returns: | QStandardItemModel |
|---|
Return the info needed for the OverviewWidget as a dict.
| Parameters: | time (rospy.Time) – the lower bound from the intervall |
|---|---|
| Returns: | dict of values |
Returns the overview-data for the overview-widget.
| Returns: | str |
|---|
returns the root item of the ROSModel.
| Returns: | AbstractItem |
|---|
Returns the headerData at the given section.
| Parameters: |
|
|---|---|
| Returns: | QVariant |
Returns the index of an item at the given column/row.
| Parameters: |
|
|---|---|
| Returns: | QModelIndex |
Returns the QModelIndex of the parent from the child item speci
ed via its index.
param index: the index of the child type index: QModelIndex returns: QModelIndex
Returns the amount of rows in the model.
| Parameters: | parent (QModelIndex) – the parent |
|---|---|
| Returns: | int |
Updates the model by using the items of the list. The items will be of the message types.
| Parameters: |
|
|---|
Would probably already work. The todos should be fixed earlier or later.
Makes it possible to change the font size of the Gui-Plugin content.
Manupulates the background-color of a cell in the model.
| Parameters: |
|
|---|
Defines how the items of the model will be painted in the view. Can be used to draw e.g. bigger or smaller fonts.
| Parameters: |
|
|---|
Increases the displayed font-size.
Decreases the displayed font-size.
Manupulates the size of a cell in the model.
| Parameters: |
|
|---|---|
| Returns: | QSize |
A ConnectionItem reresents the connection between a publisher and a subscriber and the topic they are publishing / listening on
Not senseful
| Parameters: | action (RemoteAction) – action to be executed |
|---|
Returns the detailed data of the ConnectionItem.
| Returns: | str |
|---|
Returns items for the plot.
| Returns: | str[] |
|---|


jQuery Mobile Examples
jQuery Mobile Pages
A basic mobile web page
Multiple pages
Dialog box
jQuery Mobile Transitions
Fade effect
Flip effect
Flow effect
Pop effect
Slide effect
Slidefade effect
Slideup effect
Slidedown effect
Turn effect
No transition effect
Reversed effect
jQuery Mobile Buttons
Create a button
Inline buttons
Grouped buttons
Back buttons
Change the button color
Buttons with or without rounded corners
Small or regular size buttons
Buttons with or without shadows
jQuery Mobile Button Icons
Add icons to buttons
Add more icons (icons introduced in version 1.4)
Positioning icons
Display only the icon
Remove the circle (disc)
Change the icon color
jQuery Mobile Popups
Create a basic popup
Add padding and margin to the popup
Close the popup with a right close button
Close the popup with a left close button
Undismissible Popup
Positioning popups
Transitioning popups
Popup Arrows
Popup dialogs
Popup photos
jQuery Mobile Toolbars
Create a header and a footer
Add buttons in header
Add a button to the left side in the header
Add a button to the right side in the header
Footer with buttons
Footer with center aligned buttons
Footer with horizontally grouped buttons
Inline position - header and footer inline with page content
Fixed position - header and footer will remain positioned at top and bottom of the page
Fullscreen position - header and footer remains positioned at the top and bottom, but also over the page content
jQuery Mobile Navigation Bars
Create a navigation bar
Icons in navigation buttons
Navigation bars in content
Navigation bars in footer
Add the selected (pressed down) look for buttons in navigation bars
Add the selected (pressed down) look persistently
Positioning icons: top alignment
Positioning icons: right alignment
Positioning icons: bottom alignment
Positioning icons: left alignment
A demonstration of 10 buttons in a navigation bar
jQuery Mobile Panels
Create a basic panel
A panel with a close button
Change the panel display
Right position a panel
Fixed panel position
jQuery Mobile Collapsibles
Create a collapsible block of content
Expand the content when the page loads
Nested collapsible blocks
Collapsible sets (accordion)
Remove rounded corners on collapsibles
Make collapsibles smaller
Change the icon of collapsibles
Change the icon position of collapsibles
jQuery Mobile Tables
Create a reflow table
Create a column toggle table
Change the toggle table button text
Add shadows to the table
Add a bottom border to all table rows
Add a background-color to all table rows
jQuery Mobile Grids
Two-column layout
Three-column layout
Four-column layout
Five-column layout
Customize grids
Multiple rows inside columns
jQuery Mobile Lists
Create list views
List views with rounded corners
List dividers
Autodividers
Create read-only lists
Insert panels to the list items
Change default link icon for list items
Add icons to list items
Add thumbnails to list items
Add HTML elements to fill the list items with information
Create lists with split buttons
Make the list items more functional
Create count bubbles
Popup lists
Collapsible lists
Collapsible popup lists
Full width collapsible lists
Create a calendar
jQuery Mobile Filters
Create a search field for lists
Change the text inside the search field
Custom filter
Filter collapsible lists
Filter tables
Filter a <div> element
jQuery Mobile Forms
Text inputs
Adding an icon in input buttons
Adding a "clear" button in inputs
Text area
Search input
Radio buttons
Checkboxes
Group radio buttons and checkboxes horizontally
Field containers with radio buttons and checkboxes
Pre-select radio button/checkbox
Place the form inside a popup
Prevent jQuery Mobile to automatically style tappable elements
Create a select menu
Create select menus with dividers (optgroup)
Custom select menus
Select multiple options in the select menu
Group selection menus
Group selection menus horizontally
Minify selection menus
Pre-select an option
Popup selections
Collapsible forms
Change the default select icon
Change the icon position
Create a slider control
Show the value on the slider button
Make the value popup on the screen as the user slide
Highlight the track up to the slider value
Range slider (dual)
Create a flip toggle switch
Change the text on the flip switch
Pre-select a flip switch
Style the flip switch
jQuery Mobile Themes
Theme "a"
Theme "b"
Theming header and footer
Theming dialogs
Theming buttons
Theming icons
Theming popups
Theming buttons in header and footer
Theming navigation bars
Theming panels
Theming collapsible button and content
Theming lists
Theming split buttons
Theming collapsible lists
Theming forms
Theming collapsible forms
Customize themes
jQuery Mobile Events
Tap event
Taphold event
Swipe event
Swipeleft event
Swiperight event
Scrollstart event
Scrollstop event
Orientationchange event - Alert orientation
Orientationchange event - Set different styles for portrait and landscape
Page initialization events
Page load events
Page transition events


public class PointOfInterest extends Identifiable
| Constructor and Description |
|---|
PointOfInterest(Address address,
java.lang.String name,
int radius,
java.util.Set<EventType> notifyForEventTypes,
java.util.Set<NotificationMedium.NotificationMediumType> notificationMedia,
boolean active)
create a new point of interest
|
PointOfInterest(java.util.UUID identifier,
Address address,
java.lang.String name,
int radius,
java.util.Set<EventType> notifyForEventTypes,
java.util.Set<NotificationMedium.NotificationMediumType> notificationMedia,
boolean active)
create a new point of interest.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addToNotificationMedia(NotificationMedium.NotificationMediumType notificationMedium)
add a notification medium to this poi
|
void |
addToNotifyForEventTypes(EventType eventType)
add a new event type for which the user should be notified
|
Address |
getAddress() |
java.lang.String |
getName() |
java.util.Set<NotificationMedium.NotificationMediumType> |
getNotificationMedia() |
java.util.Set<EventType> |
getNotifyForEventTypes() |
int |
getRadius() |
boolean |
isActive() |
void |
removeFromNotificationMedia(NotificationMedium.NotificationMediumType notificationMedium)
remove a notification medium from this poi
|
void |
removeFromNotifyFromEventTypes(EventType eventType)
remove an event type
|
void |
setActive(boolean active) |
void |
setName(java.lang.String name) |
void |
setRadius(int radius) |
java.lang.String |
toString() |
void |
transferProperties(PointOfInterest other)
Makes a deepcopy of properties from another PointOfInterest.
|
equals, getIdentifier, hashCode
public PointOfInterest(java.util.UUID identifier, Address address, java.lang.String name, int radius, java.util.Set<EventType> notifyForEventTypes, java.util.Set<NotificationMedium.NotificationMediumType> notificationMedia, boolean active) throws ValidationException
identifier
- address
- The address of the location.name
- The name given to this particular point of interest by the user. If a user decides to create a point
of interest for his home address he could name it "best place ever".radius
- The radius around the address wherein the user wants to be notified of events. ex. A user may want to
receive notifications of events in a radius of 1km of his home addressnotifyForEventTypes
- notificationMedia
- Notifications relevant to the point of interest will only be sent to the a user's
notification medium if the type of that medium is in the set notificationMedia. ex. If a
user wants notifications of the point of interest of his work address sent to his/her email
address then the set notificationMedia should contain the type EMAIL.active
- True if the user wants to receive notifications for this point of interest, else this should be false.ValidationException
public PointOfInterest(Address address, java.lang.String name, int radius, java.util.Set<EventType> notifyForEventTypes, java.util.Set<NotificationMedium.NotificationMediumType> notificationMedia, boolean active) throws ValidationException
address
- name
- radius
- notifyForEventTypes
- notificationMedia
- active
- ValidationException
public Address getAddress()
public java.lang.String getName()
public void setName(java.lang.String name) throws ValidationException
name
- The name to be set.ValidationException
public int getRadius()
public void setRadius(int radius) throws ValidationException
radius
- The radius to be set.ValidationException
public java.util.Set<EventType> getNotifyForEventTypes()
public void addToNotifyForEventTypes(EventType eventType) throws ValidationException
eventType
- ValidationException
public void removeFromNotifyFromEventTypes(EventType eventType) throws ValidationException
eventType
- ValidationException
public java.util.Set<NotificationMedium.NotificationMediumType> getNotificationMedia()
public void addToNotificationMedia(NotificationMedium.NotificationMediumType notificationMedium) throws ValidationException
notificationMedium
- ValidationException
public void removeFromNotificationMedia(NotificationMedium.NotificationMediumType notificationMedium) throws ValidationException
notificationMedium
- ValidationException
public boolean isActive()
public void setActive(boolean active)
active
- The boolean that marks this point of interest as active or inactive.public void transferProperties(PointOfInterest other)
other:
- the poi from which to make a deepcopy of the underlining properties.public java.lang.String toString()
toString
in class Identifiable


{% extends "layout.html" %} {% block body %}
As a RafuHitch partner, you get to enjoy exclusive access to special deals from the popular Yagufar and Amazoom!
100 Points per Ticket at Shaw Theatres
100 points for $10 coupon for Amazoom
100 points for free car wash at shell


#{include 'Application/top_head.html'/}
#{include 'Application/top_nav.html'/}
#{data-table-init tableName:'list-all', defaultSize:'50', , sortSpec:'[]' /}
#{include 'Commands/commandsnav.html'/}
#{include 'tags/refresh.html'/}
Commands Defined in Config
#{table-declare tableName:'list-all' /}
| No. |
Type |
httpMethod |
Protocol |
Port |
HttpHeader |
UrlPostfix |
Request Content Template |
MaxConcurrency |
ExtractFrom |
ExtractTo |
#{list items:commands, as:'obj'}
| ${obj_index} |
${obj.agentCommandType}
|
|
${obj.requestProtocol} |
${obj.requestPort} |
${obj.httpHeaderType}
|
${obj.requestUrlPostfix} |
${obj.requestContentTemplate} |
${obj.maxConcurrency} |
${obj.responseExtractIndexStart} |
${obj.responseExtractIndexEnd} |
#{/list}
* MaxConcurrency value 0 or negative: will use the default value of 1500 (defined as MAX_CONCURRENT_SEND_SIZE in application.conf).
#{include 'Application/footer.html'/}


Registration Form
{{rc.error}}
Sign up
Name
First Name is required
Your email
Email is required
Your Phone No
+91
Mobile Number is required
Your password
Password is required
Please confirm your password
Password doesn't match
Register
Already a member ?
Go and log in


Bangalore,India
Email<EMAIL_ADDRESS>+91<PHONE_NUMBER>
Don't have an account?
By clicking Register, I agree to your terms


Photoshop
Illustrator
Photography
HTML & CSS
Javascript & jQuery
NodeJS & ExpressJS
Organization isn't everyone's strong suit and when it comes to keeping track of the day and your appointments, you've probably wondered if there was an app for that as well. The Day Planner is an app that allows the everyday user to keep track of their day from 9am - 5pm. Color-coded so that you know when an appointment is upcoming, passed, or currently happening.


|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object uchicago.src.sim.gui.AbstractGraphLayout uchicago.src.sim.gui.LayoutWithDisplay uchicago.src.sim.gui.KamadaGraphLayout
public class KamadaGraphLayout
Positions network nodes according to the Kamada-Kawai algorithm. The Kamada-Kawai graph layout class attempts to position nodes on the space so that the geometric (Euclidean) distance between them is as close as possible to the graph-theoretic (path) distance between them. the x and y coordinates of the nodes will be modified by the layout.
The KamadaGraphLayout implements the ActionListener interface to
interrupt the layout. This breaks out of the algorithm
implementation as soon as possible, but will rescale the display if
appropriate. You can have the KamadaGraphLayout listener for RePast
toolbar button presses by including something like the following
code inside your model class.
This will cause the KamadaGraphLayout graphLayout to interrupt its layout
whenever stop, pause, or exit is pressed.
graphLayout = new KamadaGraphLayout(...);
Controller c = (Controller)getController();
c.addStopListener(graphLayout);
c.addPauseListener(graphLayout);
c.addExitListener(graphLayout);
Note The KamadaGraphLayout is quite slow. It is not meant as a "true" visualization tool, but rather is intended only to provide the modeler with "sense" of the network. Real analysis and visualization should be done in a tool like Pajek.
| Field Summary |
|---|
| Fields inherited from class uchicago.src.sim.gui.LayoutWithDisplay |
|---|
display, isEventThread |
| Fields inherited from class uchicago.src.sim.gui.AbstractGraphLayout |
|---|
height, nodeList, update, width |
| Constructor Summary | |
|---|---|
KamadaGraphLayout(int width,
int height)
Creates a KamadaGraphLayout with specified width and height. |
|
KamadaGraphLayout(java.util.List nodes,
int width,
int height)
Creates a KamadaGraphLayout with specified width and height, and list of nodes. setDisplay must be called before calling updateLayout(). |
|
KamadaGraphLayout(java.util.List nodes,
int width,
int height,
DisplaySurface surface,
int updateEveryN)
If the KamadaGraphLayout is passed a display, and a value for updateEveryN, it will call the display's updateDisplay() method on every Nth pass during the layout to provide visual feedback. |
| Method Summary | |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent evt)
Implements the ActionListener interface. |
void |
circleLayout()
Positions nodes on layout in a circle for repeatability. |
void |
setAnimateTransitions(boolean animateTrans)
Sets whether the completed layout (and each component as it is finished) will smoothly transition to its new location. |
void |
setCircleLayout(boolean eachTime)
Sets whether circleLayout will be called to arrange nodes before starting each layout. |
void |
setMaxPasses(int passes)
Sets the maximum number of passes the inner loop of the KK algorithm will execute. |
void |
setMinEpsilon(double energy)
Sets the minimum "spring" energy which the layout attempts to achieve. |
void |
setPad(int p)
Sets the number of pixels to shrink the effective window by. |
void |
setRescaleLayout(boolean rescale)
Sets whether the completed layout will be resized to exactly fill the display window. |
void |
setSpringConst(double spring)
Sets the "springiness" of the imaginary springs connecting the nodes. |
void |
setUpdateEveryN(int updateEveryN)
Sets how frequently the layout will be redrawn during algorithm convergence. |
void |
updateLayout()
Positions the nodes on the layout according to the results of numerous iterations of the Kamada-Kawai spring-embedding algorithm. |
| Methods inherited from class uchicago.src.sim.gui.LayoutWithDisplay |
|---|
setDisplay, updateDisplay |
| Methods inherited from class uchicago.src.sim.gui.AbstractGraphLayout |
|---|
appendToList, appendToList, getHeight, getNodeList, getUpdate, getWidth, setList, setUpdate |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public KamadaGraphLayout(int width, int height)
width
- the width (in pixels) of the displaySurfaceheight
- the height (in pixels) of the DisplaySurfacepublic KamadaGraphLayout(java.util.List nodes, int width, int height)
nodes
- the list nodes to layout with this KamadaGraphLayoutwidth
- the width (in pixels) of the DisplaySurfaceheight
- the height (in pixels) of the DisplaySurfacepublic KamadaGraphLayout(java.util.List nodes, int width, int height, DisplaySurface surface, int updateEveryN)
nodes
- the network to layout.width
- the width (pixels) of the display surfaceheight
- the height (pixels) of the display surfacesurface
- the displaysurface to updateupdateEveryN
- determines if/ when layout is redrawn during
algorithm| Method Detail |
|---|
public void setPad(int p)
p
- the number of pixels to inset bypublic void setUpdateEveryN(int updateEveryN)
updateEveryN
- the N for determining wether to update on the
Nth passpublic void setMinEpsilon(double energy)
energy
- the value for the minimum epsilonpublic void setSpringConst(double spring)
spring
- the value for the spring constant in the algorithmpublic void setMaxPasses(int passes)
passes
- the maximum number of time the inner loop will
execute.public void setCircleLayout(boolean eachTime)
eachTime
- true = always call circleLayoutpublic void setRescaleLayout(boolean rescale)
rescale
- whether to rescale the layoutpublic void setAnimateTransitions(boolean animateTrans)
animateTrans
- whether to animate transitions between layoutspublic void circleLayout()
public void updateLayout()
Note: In the current implementation the layout may not always converge! however, the maxPasses parameter can be set lower to interrupt cycling layouts. Also has not been tested/ implemented on weighted graphs. The Kamada-Kawai algorithm was not intended to run on disconnected graphs (graphs with multiple components. The kludgy solution implemented here is to run the algorithm independently on each of the components (of size > 1). This is somewhat unsatisfactory as the components will often overlap.
The KK algorithm is relatively slow, especially on the first round. However, it often discovers layouts of regularly structured graphs which are "better" and more repeatable than the Fruchmen-Reingold technique. Implementation of the numerics of the Newton-Raphson method follows Shawn Lorae Stutzman, Auburn University, 12/12/96 http://mathcs.mta.ca/research/rosebrugh/gdct/javasource.htm
Kamada, Tomihisa and Satoru Kawai (1989) "An Algorithm for Drawing Undirected Graphs" Information Processing Letters 31:7-15
updateLayout
in interface GraphLayout
updateLayout
in class AbstractGraphLayout
public void actionPerformed(java.awt.event.ActionEvent evt)
actionPerformed
in interface java.awt.event.ActionListener
actionPerformed
in class AbstractGraphLayout
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


Follow these steps & you shouldn't have any
problem pre-leasing
at the small, clean & quiet community
of Windmill Townhomes & Duplexes.
For available floor plans, check out the
Floor Plans tab.
- Choose 3 floor plans of the 14 choices from either the
Floor Plans tab or the brochures. If any
of the floor plans you have chosen are not available by the date
requested, we will notify you at least 30 days before the expected
move in date.
- Call the office to make an appointment to meet at the office
to view one of the floor plans. (It's very important to leave a
detailed message on the answer machine.)
- While in the office, ask to fill out a Rental Application &
pay your Application Fee & Deposit ($175.00 per-person.)
- Turn in your Lease Contract Guaranty Application
(co-signer form) within 7 days of turning in your Deposit & Rental
Application.
- Three days after the co-signers forms are turned in, call to
verify if your applications are approved.
- If the applications are approved, call the office within 30
days of your move-in date to receive your new address & floor
plan style.
- Within 30 days of your move-in date, call the office to
make an appointment to sign your Rental Lease. Allow at least 30
minutes for this process.
- Enjoy your stay with us at Windmill Townhomes &
Duplexes!


Q) What is Emotional Intelligence?
the capacity to be aware of, control, and express one's emotions, and to handle interpersonal relationships judiciously and empathetically.
Q)How is it different to IQ?
IQ, or intelligence quotient, is a number derived from a standardized intelligence test. On the original IQ tests, scores were calculated by dividing the individual's mental age by his or her chronological age and then multiplying that number by 100.
EQ, on the other hand, is a measure of a person's level of emotional intelligence. This refers to a person's ability to perceive, control, evaluate, and express emotions.
Q) Why is it important?
Plays a huge part in interpersonal relationships which highly affects work life and career.
Emotional Intelligence, and our ability to draw on it as a reserve helps us in so many ways: from assisting in looking after our physical and mental health
and well-being, through to our ability to inspire and lead. It’s there in our ability to manage effective relationships and our armour and shield when it comes to conflict resolution. It is, in so many ways, the driver of success.


Choose Volume
Play Music
Volume:
0
Music gracefully provided by
http://www.bensound.com/royalty-free-music


Crossroads of Twilight
Maps:
Caemlyn
Prologue: Glimmers of the Pattern
Time to Be Gone
Two Captains
A Fan of Colors
The Tale of a Doll
The Forging of a Hammer
The Scent of a Dream
Blacksmith’s Puzzle
Whirlpools of Color
Traps
A Blazing Beacon
Talk of Debts
A Bargain
High Seats
What Wise Ones Know
Gathering Darkness
The Subject of Negotiations
Secrets
A Chat with Siuan
Surprises
In the Night
A Mark
One Answer
Ornaments
A Strengthening Storm
When to Wear Jewels
In So Habor
What Must Be Done
A Cluster of Rosebuds
Something Flickers
What the Oath Rod Can Do
Epilogue: An Answer
Glossary
Book 10 of The Wheel of Time
Robert Jordan
Index of Books


require-sri-for in Content-Security-Policy
explaination
This demo page is to help you understand require-sri-for in Content-Security-Policy.
You can put this in HTTP response header when providing HTML file. Or, equivalently, you can use this feature by adding the following line in your HTML file:
<meta http-equiv="Content-Security-Policy" content="require-sri-for script style">
Current page uses meta tag to add Content-Security-Policy support. It uses require-sri-for script, style, which enables validation check for both stylesheets and scripts. Besides this, following are all available options for require-sri-for:
- require-sri-for script, style to enable validation for all stylesheets and scripts on page
- require-sri-for script to enable only validation for scripts on page
- require-sri-for style to enable only validation for stylesheets on page
You should be able to use querystring to control whether SRI is provided in resources.
- integrity=all to set integrity for both script and stylesheet
- integrity=script to set integrity for only script
- intergity=style to set integrity for only stylesheet
Most of the browsers doesn't support this feature at the moment, including Chrome, Firefox and Safari. For Chrome, you should be able to enable this experimental feature by visiting chrome://flags/#enable-experimental-web-platform-features.
When supported, Content-Security-Policy with require-sri-for set should force the browser to refuse loading any resources without SRI. This should help enhance the security by forcing all static and dynamic imported resources to use SRI on website. Also, it's a good way to test locally and check if there is any missing SRI.
Status of resources loading
- Style failed to load
- Style loaded successfully
- Script failed to load


TABLE OF CONTENTS
A. GS1 Related B. GS2 Related POLITY 1. Carry oxygen cylinders on all trains: SC to Railways INTERNATIONAL AFFAIRS/BILATERAL RELATIONS 1. In bluntest ever remarks, US talks up India to counter China 2. India seeks flexible LNG deals, IEA says it’s happening 3. India, European Union restart talks on civil nuclear agreement HEALTH ISSUES 1. 7 deadly pesticides world has banned used in India C. GS3 Related ECONOMY 1. Outstanding credit grows 14.6% in 1 year; non-food loans fall to 13.6% ENVIRONMENTAL SCIENCE AND ECOLOGY 1. 'Govts slept over alert on illegal cotton seeds' 2. Fiji to sell world's first climate-change 'green' bonds D. GS4 Related E. Prelims Fact F. UPSC Prelims Practice Questions G. UPSC Mains Practice Questions
Nothing here for Today!!!
1. Carry oxygen cylinders on all trains: SC to Railways
In news:
- The Supreme Court has made it mandatory for the railways to keep oxygen cylinders in all trains to ensure that the life-saving gas could be provided to travellers suffering from respiratory problems in case of emergency.
- The Supreme Court also directed the railways to take assistance of doctors from AIIMS to explore ways to put in place a system in moving trains to provide medical treatment to travellers if they take ill.
- The court passed the order on an appeal filed by the Centre challenging the Rajasthan high court’s order directing the railways to provide a team of one medical officer, one nurse and one attendant in all long-distance trains to cater to the medical needs of passengers.
Category: INTERNATIONAL AFFAIRS/BILATERAL RELATIONS
1. In bluntest ever remarks, US talks up India to counter China
Highlights of Secretary of State Rex Tillerson address to the Washington think-tank:
- United States and India are “two bookends of stability on either side of the globe,”
- Trump administration bluntly proposed that Washington and New Delhi work together in the Indo-Pacific region to counter the disruptive force that China has become.
- Trump’s America sought to woo New Delhi to counter Beijing’s growing assertiveness in the region and beyond.
- “The United States seeks constructive relations with China. But we won’t shrink from China’s challenges to the rules-based order, or where China subverts the sovereignty of neighboring countries, and disadvantages the US and our friends”.
- In this period of uncertainty and angst, India needs a reliable partner on the world stage. U.S wants to make clear: with our shared values and vision for global stability, peace and prosperity, the United States is that partner.”
- China’s provocative actions in the South China Sea directly challenge the international law and norms that the United States and India both stand for.
- Beacons of the Indo-Pacific:
- The world’s center of gravity is shifting to the heart of the Indo-Pacific. The United States and India – with our shared goals of peace, security, freedom of navigation, and a free and open architecture – must serve as the eastern and western beacons of the Indo-Pacific.
- We need to collaborate with India to ensure that the Indo-Pacific is increasingly a place of peace, stability, and growing prosperity – so that it does not become a region of disorder, conflict and predatory economics.
- Warning to China’s client:
- Tillerson also issued a blunt warning to China’s client state Pakistan, saying “states that use terror as an instrument of policy will only see their international reputation and standing diminish” and “it is the obligation, not choice, of every civilized nation to combat the scourge of terrorism” and the United States and India are leading that regional effort together.
2. India seeks flexible LNG deals, IEA says it’s happening
In news:
- International Energy Agency notes: Liquid gas contracts are shedding their rigidity and becoming more flexible as regional systems gradually merge into an interlinked global market in an oversupplied situation.
- Key points:
- Flexible contract regime will help optimise cost of supplies and allow countries such as India to rapidly develop a gas-driven economy as part of strategy to reduce carbon footprint.
- Till now liquid gas trade has been confined to regional contracts with rigid terms, often biased in favour of the seller and offering little legroom for buyers. This is changing in the wake of fall in gas prices in tune with drop in oil prices and rise of the US fracking industry.
- The renegotiations have made gas more affordable for India and will result in huge savings to the economy.
Basic Information:
International Energy Agency
- The International Energy Agency (IEA) is a Paris-based autonomous intergovernmental organization established in the framework of the Organisation for Economic Co-operation and Development (OECD) in 1974 in the wake of the 1973 oil crisis.
- The IEA was initially dedicated to responding to physical disruptions in the supply of oil, as well as serving as an information source on statistics about the international oil market and other energy sectors.
- The IEA acts as a policy adviser to its member states, but also works with non-member countries, especially China, India, and Russia.
- The Agency’s mandate has broadened to focus on the “3Es” of effectual energy policy: energy security, economic development, and environmental protection. The latter has focused on mitigating climate change. The IEA has a broad role in promoting alternate energy sources (including renewable energy), rational energy policies, and multinational energy technology co-operation.
What is ‘Fracking’
- Fracking is a term used for hydraulic fracturing, which is the process of creating fractures in rocks and rock formations by injecting specialized fluid into cracks to force them to open further. The larger fissures allow more oil and gas to flow out of the formations and into the wellbore, from where they can be easily extracted.
- Fracking has resulted in many oil and gas wells attaining a state of economic viability due to the level of extraction that can be reached, and has allowed drilling firms access to previously difficult-to-reach sources of oil and gas.
3. India, European Union restart talks on civil nuclear agreement
In news:
- India and European Union have restarted negotiations on a civil nuclear agreement that was virtually stalled after being signed way back in 2009.
- European Union experts from Brussels held discussions with officials from department of atomic energy last week in Mumbai.
- Moving beyond their stalled free trade agreement: With Europol beginning a working relationship with India’s NIA to tackle terrorism and track terror groups that might target either side, there is a greater emphasis on security, counter-terrorism and foreign policy between India and EU, indicating the two are moving beyond their stalled free trade agreement.
- India-EU civil nuclear agreement: focuses on nuclear safety and “non-power technologies in the areas of water, health care and medicine, environment, etc.”
- New interest in cooperating on maritime security: EU has asked India to escort World Food Program (WFP) ships through the Indian Ocean as they travel to African states with food aid, recognising India’s capacities and intentions of being a security provider in the Indian Ocean.
1. 7 deadly pesticides world has banned used in India
Context:
- Recent deaths of farmers due to pesticide poisoning in Yavatmal and other districts of Maharashtra have opened up a debate over the rationale of using all such pesticides in India which are either banned or restricted elsewhere in the world due to their high toxicity
In News:
- The Delhi-based Centre for Science and Environment has come out with a list of seven extremely or highly hazardous pesticides which continue to be used in India despite these being banned in many countries.
- The think tank questioned the central committee, headed by IARI scientist Anupam Verma, which had in 2015 reviewed the use of these pesticides but preferred not to ban them immediately.
- Seven hazardous pesticides are on the list of 18 Class-I (classified as extremely/highly hazardous), which accounted for nearly 30% of the total pesticide use in India in 2015-16.
- Though the central committee had reviewed use of 66 pesticides and recommended ban on 13 of them from 2018 and phasing out of six others by 2020, allowing the use of others in the list till the next review is something which bothers researchers and farm experts.
- Referring to international code of conduct on pesticide management, the CSE flagged a provision which says all pesticides whose handling and application require the use of personal protective equipment that is uncomfortable, expensive or not readily available should be avoided, especially in the case of small-scale users and farm workers in hot climates.
- The think-tank said that the pesticides such as Monocrotophos, Oxydemetonmethyl, Acephate and Profenophos were believed to be responsible for the deaths and illness in Maharashtra.
- Pesticides like Monocrotophos and Oxydemeton-methyl are considered Class-I pesticides by the World Health Organisation (WHO). Class-I pesticides can be are banned in several countries.
1. Outstanding credit grows 14.6% in 1 year; non-food loans fall to 13.6%
Context:
- Outstanding credit loans, bonds and commercial papers (CPs) grew 14.6 per cent year-on-year (y-o-y) between September 30, 2016 and September 30, 2017.
- But in the same period last year the growth had been lower at 13.8 per cent.
The growth in other areas:
- The growth in non-food credit in the fortnight to September 29, 2017, was slightly lower at 13.6 per cent y-o-y.
- The net corporate bonds outstanding as at the end of September, was also up by 18 per cent as per latest data released by the Securities and Exchange Board of India (Sebi).
- Data from RBI showed that the net outstanding on commercial papers stood has also increased from last year.
Why is there growth in outstanding credit ?
- With banks increasingly participating in the bond markets, the share of bonds in total credit is rising.
- Higher-rated corporates have in recent days chosen to borrow from the markets rather than from banks as the former route has turned out to be cheaper.
- Bankers and sector analysts have in recent days made a case for measuring credit growth in terms of outstandings on loans as well as bonds as better-rated corporates are borrowing increasingly from the money markets.
- Between June 2016 and June 2017, around Rs 40,000 crore had moved from the bank’s loan book to the markets.
- A large portion of it about 70 per cent of it is in the CPs, or commercial papers. These commercial papers swing between the loan book and the markets, depending on the price, availability, etc.
Category: ENVIRONMENTAL SCIENCE AND ECOLOGY
1. ‘Govts slept over alert on illegal cotton seeds’
Context:
- US giant Monsanto, which sells genetically modified seeds in India, had informed the Centre about the illegal sale and cultivation of herbicide tolerant (HT) variety cotton in 2008.
- Centre failed to take any actions to prevent the same.
In news:
- In a letter dated 2008, Monsanto had said that HT cotton was being “grown without the statutory approval of GEAC. The farmers were being offered cotton seeds with HT trait at a premium without valid documents and safety assessment which may impact the produce”.
- Key Fact:
- Currently, HT cotton is grown in about 8.5 lakh hectares in four major cotton-growing states of the country – Gujarat, Andhra Pradesh, Madhya Pradesh and Maharashtra. HT cotton packets did a business of Rs 472 crore this season.
- Today, desperate farmers, looking for lower input costs, are willing to pay Rs1200-1,500 per packet for HT seeds, when the price for Bt cotton at Rs 800 per packet.
2. Fiji to sell world’s first climate-change ‘green’ bonds
In news:
- Fiji will issue a $50 million “green” bond to help combat the effects of global climate change, the first developing country to do so.
- Usability of the fund raised:
- The bond will be the first to earmark the cash raised to address the issue, according to the World Bank.
- The country will also use some of the proceeds to reduce its carbon dioxide emissions.
- Key Fact:
- The Pacific Island nation is seen as particularly vulnerable to climate change, with some of its 300 low-lying islands susceptible to rising seas.
- Poland and France have also issued sovereign green bonds to raise funds for renewable power, subsidize energy-efficient buildings, tree planting and other environmental projects.
- The global “green” bond market is expected to reach $134.9 billion in 2017, according to the World Bank.
Nothing here for Today!!!
|
Nothing here for Today!!! |
F. Practice Questions for UPSC Prelims Exam
Question 1. Recently, which particular country issued the “green bond” to combat
the effects of global climate change?
[A] Japan [B] China [C] India [D] Fiji
See
Question 2. Consider the following statements?
- International Energy Agency is an organization that comes under U.N. body.
- India is a member of International Energy Agency.
Choose the correct options
[A] 1 only [B] 2 only [C] Both 1 and 2 [D] Neither 1 nor 2
See
Question 3. Mundaka Upanishad, the Mandukya Upanishad and the Prashna
Upanishad are associated with which of the following Vedas?
[A] Atharva-Veda [B] Rig-Veda [C] Sama-Veda [D] Yajur-Veda
See
Question 4. Bank Rate is defined as the rate at which:
[A] RBI lends short term loans to commercial banks [B] A commercial bank can lend to its customers [C] RBI lends long term loans to commercial banks [D] The commercial banks are able to borrow overnight funds from RBI
See
Question 5. Consider the following statements about National Bureau of Animal
Genetic Resources (NBAGR):
- It works for the conservation and utilization of livestock and poultry genetic resources.
- It designs methodologies for ex situ and in situ conservation of farm animals.
Which of the above statements is/are correct?
[A] 1 only [B] 2 only [C] Both 1 and 2 [D] Neither 1 nor 2
See
G. UPSC Mains Practice Questions
GS Paper II
- Examine the functioning of Judicial Review in the Indian Political system.
GS Paper IV
- You are a young, aspiring and sincere employee in a Government office working as an assistant, to the
director of your department. Since you’ve joined recently, you need to learn and progress. Luckily your
superior is very kind and ready to train you for your job. He is a very intelligent and well-informed
person having knowledge of various departments. In short, you respect your boss and are looking forward
to learn a lot from him.
Since you’ve good tuning with the boss, he started depending on you. One day due to ill health he invited you at his place for finishing some urgent work.  You waited for a while. After entering, boss greeted you and explained the work. But you were constantly disturbed by the crying of a woman. At last, you inquired with the boss but his answer did not satisfy you. Next day, you were compelled to inquire further in the office and found out that his behavior is very bad at home with his wife. He also beat up his wife.
His wife is not well educated and is a simple woman in comparison to her husband. You see that though your boss is a nice person in the office, he is engaged in domestic violence at home. In such a situation, you are left with the following options. Analyze each option with its consequences.
I. Just ignore thinking about it because it is their personal matter.
II. Report the case to the appropriate authority.
III. Your own innovative approach towards the situation. (250 words)
Also, check previous Daily News Analysis
“Proper Current Affairs preparation is the key to success in the UPSC- Civil Services Examination. We have now launched a comprehensive ‘Current Affairs Webinar’. Limited seats available. Click here to Know More.”
Enroll for India’s Largest All-India Test Series


{% extends "layout.html" %} {% block title %}
You aren't quite done, though. Read through your listing, edit the description, add some flair, and publish it!
Before you publish it, you should at least edit your description.
Each of these people has permission to edit your mod listing and publish updates.


Primary
Secondary
Success
Info
Warning
Danger
Large Button
Large Button
Small Button
Small Button
Small Button
Small Button
Dropdown Menu
Home
Bootstrap
jQuery
jQuery UI
PHP
Home
MENU
MENU 2
MENU1
menu1.1
menu1.2
SETTINGS
CONTACT
Product ID
Product Name
Product Quality
Product Quantity
1
Wheat
Good
200 Bags
2
Rice
Good
250 Bags
3
Sugar
Good
200 Bags
3
Sugar
Good
200 Bags
3
Sugar
Good
200 Bags
<EMAIL_ADDRESS>Confirm identity


--- layout: archive title: Zulip Chat Archive permalink: /stream/113488-general/topic/vscode.20input.20completions.20for.20markdown.html ---
I love the way that Lean does unicode completions so much that I copied the vscode-lean project and made it also work for markdown. Could markdown unicode completions be added as a feature to the vscode-lean extension? Or is it better being a separate extension? Happy to submit a PR doing this.
Seems like @Gabriel Ebner is the one to ask about this.
I'd prefer to keep it all in one extension if possible. Ideally you could enable the unicode completions for specific file types and also specific files (via a command). I'm happy about a PR for this feature. That said, I'm on vacation until October.
{% endraw %}Last updated: Apr 24 2020 at 19:02 UTC


Did You Know:
India already has about 340 Million Digital (Internet) Users.
Goal'inaire wants to leveraging maximum opportunity, and create great awareness about the required Vertical – Reach is high!
Why Goaldinaire Stepped in to Digital:
India still has a potential of 1 Billion Non - Digital (Internet) Users. Goal’dinaire’s vision is to take Digital World across globe and leverage it to the maximum.