Using one md-datepicker to select a range - angular-material2

Can you select multiple days in a single Angular Material2 md-datepicker?
I want to select a period, e.g. from today until 28 of the month, all without using 2 datepickers, one for the beginning and one for the end of the period.
Is this possible?

Currently the md-datepicker in Angular Material2 does not support ranges, though the team has indicated that they plan on adding support for this feature in the future. There is also an open issue requesting this feature.

Related

Superset Chart Builds Not Including Configured Filters

I just started with Superset a week ago and this is my first post.
Using Docker for latest code of the master Superset build.
I'm frustrated that as I configure queries that have multiple variables when I save the chart with no query errors shown and the queries listed in the Filters options -- the resultant chart is not dispaying the queries themselves.
I tried Cases first but the SQL editor kept generating errors, so I watched how Superset by default built Filters and then created queries with Custom SQL that satisfied Superset.
Here is a Partial chart query that includes filter queries producing table columns My intention is to create a stacked bar chart with no time increments , just total number of matching table records --
GROUP BY collection_id,
altersgruppe,
story_ID,
art_interview,
story_collector,
form_interview,
stichwort,
geschlecht,
story_ort
ORDER BY `COUNT(collection_id)` DESC
LIMIT 1000) AS virtual_table
WHERE ((altersgruppe LIKE %’Baby-Boomer%’
OR altersgruppe LIKE ‘%Gen X%’
AND altersgruppe LIKE ‘%Gen Y%’
OR altersgruppe LIKE ‘%Gen Z%’)
AND (art_interview LIKE '%digital%'
OR art_interview LIKE '%persönlich%')
AND (form_interview LIKE '%Einzelinterview%'
OR form_interview LIKE '%Gruppeninterview%')
AND (stichwort LIKE '%Bestes Erlebnis%'
OR stichwort LIKE '%Schlechtestes Erlebnis%'
OR stichwort LIKE '%Überraschung%')
AND (geschlecht LIKE '%männlich%' OR geschlecht LIKE '%weiblich%' OR geschlecht LIKE '%divers%'))
LIMIT 10;
Yesterday I saw a reference to adding these filter displays manually in the code.
But I decided I'd better check in here first.
I'm using one table in a mysql environment and can provide more data when asked.
It is my hope that some users recognize some of the most likely issues with missing filters and can give me directions to investigate.
Otherwise I can post my total chart query and other settings that might help me get a solution.

Firestore Update document in-place vs remove and insert

I’m trying to determine which of the following has the better performance for updating a document in Firestore/NoSQL in general.
Suppose that there is a sub-collection:
friends:
- doc_id_sjfn
• last_name=Wang
• last_talked=10sec ago
• actual_user_id=wang1997
- doc_id_wokm
• last=Liu
• last_talked=12min ago
• actual_user_id=liu98
and the client attaches a listener to the sub-collection and displays the sub-collection in real-time on a list view.
Suppose that we want to change Wang’s last_talked to 15 sec ago with app engine over google cloud.
When updating the list, is the performance better when
A: delete document doc_id_sjfn and insert document with doc_id_sjfn_v2 as ID
B: update field ‘last_talked’ of document doc_id_sjfn to 15 seconds ago
Since there are warnings against updating a document in-place for more than once per second, would approach A have better performance in terms of how long it takes for the change to be reflected on the list displayed on the client device? Under what condition is this faster? (If fields are indexed vs not indexed) (if the list view contains every element under the collection vs a subset of all elements under the collection using “where”)
Thanks!
(The example was edited; there are definitely better ways of implementing this use case, but the example is here to help me express the idea of using document as a view and needing constant refresh)
The rule of once per second is for specific documents. From the looks of the data it doesn't look like data that will update more than once per... year?
I wouldn't worry about the once per second with the data set presented and just update in place. You'll introduce a headache trying to reconcile old and new documents, e.g. you have v1, how do you know there isn't a v2?

Advanced search in laravel

I am trying to implementing a search in my application, specifically it checks a table in my database against certain parameters specified by the user.
For example if my user wants to return a list of records created with the last 7 days. Then he types last 7 days or last seven days in the search bar.
My issue now is being able to change string like this into a valid date that can be used in a where when checking my database.
The number can also be random as in the user can simply type last 2 days or last two days or last 100 days or last hundred days, inputs like week 25 and last month should also be allowed.
Instead of creating multiple drop downs and input boxes to allow the user to select form the front end i would like to do something much simpler like this.
My question now is that is there a feature or a package in laravel that already takes care of this?
If there isn't how would i go about doing something like that??
I think what you need to look up is "NLP" or "Natural Language Processing". There are many libraries and API's within the field that can help you out so that you don't reinvent the wheel (so to speak).
Here is a package in Laravel: Laravel Aylien Wrapper or nlp-tools, but there are many others for PHP in general.
Just do a quick search or look around at Mashape to find some examples.

Conditional formatting with data validations

In Google Spreadsheets I have a column of various dates (these are employee's start dates). I want the cells to be highlighted when today's day is within a week of these employee start dates.
I have already been playing with =(B4-TODAY())>7 but this seems to highlight all the past dates.
If this is not possible, just being able to highlight this month's dates is fine (which is easy to do in Excel but can't seem to figure out in Google Spreadsheets).
Then, once this has been done, I have another column with a drop box selection with DONE, and, PENDING.
I would like to conditionally format it so that when DONE is clicked, the highlighted start dates in this month (or 7 days before the day) are highlighted in a different colour.
So it can easily be seen that in 1 week employees are coming, and when done is clicked, we can see their administrative stuff has been dealt with.
Please try =B1="DONE" for the alternative colour and for the +/-7 days:
=and(A1<today()+7,A1>today()-7)
in that order.
=and(…) is used in one of the formulae because the relevant condition is for a bounded range. When I enter =today() in Google Spreadsheets and change that cell’s format to Number I see 41,845.00. Since one week either side makes up the ‘band’ to which attention is to be drawn the relevant values for CF are everything from and including 41,838 to 41,852.
But for display purposes I switch to one day either side, rather than one week, and leave off 41840 throughout, so today becomes represented by 5, and the reduced range of interest therefore 4 to 6 (both inclusive). Of all the possibilities, any value up to and including 3, and 7 or greater, is to be ignored for CF:
The range of interest is everything less than 7 (green) that is also more than 3 (blue):
For “that is also” Google prefers and. In case of any remaining uncertainty creating your own example with a week either side of 41845 etc may help.

RSS functioning problem

I need to create an RSS feed for our information system, which is written in PHP.
I had no problems with the RSS 2.0 specification, nor with the creation of RSS feed generator. Items for the feed are to be fetched from a large table containing lots of records, so it will take a lot of time to get all the necessary information from this table. Therefore, it is necessary to implement the following scheme:
To show 5 latest items to new
subscribers.
For the existing subscribers – to
show only those items which have
been added since their last view of
the feed.
I have no problems with the first condition: I can simply use the LIMIT clause
to limit the number of fetched rows. Something like this:
$items = function_select(“SELECT * FROM some_table ORDER BY date DESC LIMIT 5);
But this creates the following problem: Suppose there are real feed subscribers who have already read the items from 1 up to 10. After they've been away for some period of time new items have been created; say, 10 new items.
During their next check-in we want them to see all the new 10 items, but not all at once. They will see only the last 5 ones (from 16 up to 20), but not all 10 of them. The items from 11 up to 15 will be omitted.
I suppose that in order to succeed in solving this problem there should be a kind of a flag to be sent to feed. For example: pubDate of the lasted fetched item. Twitter's feed uses something similar. However, that link is hand-made. How could it be done another way?
Please let me know if you have any ideas. If you have any example ready (no matter in what language) just share a link with me. I would appreciate it greatly.
Thank you in advance.
Standard RSS feeds don't render different content to different users. They simply always provide the most recent few items (often 10), and rely on the RSS reader to poll them often enough that they don't miss any updates. Unless you have a particularly compelling reason not to do this, this is the simplest and most effective mechanism.

Resources