Function for Google Feeds API to skip entries? - rss

Is there a way to call the Google Feed API so that it skips X number of entries in a feed?
To explain the context:
I'd like to load additional entries on demand from a particular feed. So a user can click a "Load more" type button, and an ajax function fires to retrieve additional entries. Just to put some numbers on the scenario, lets say I load 10 entries by default, and want to load an additional 10 each time a user clicks on a "load more" button.
With the historical entries / numEntries API functions, I can essentially solve my problem by retrieving 10 + ( number of entries already loaded ), and only output the last 10. But this is pretty ugly, because every time a user loads another 10 entries, they have to load ALL the previous entries as well, so the load gets larger everytime they load more entries. Seems pretty inefficient!
Inspecting the API docs at Google, I couldn't find any reference to a "skip entries", or "start from X entry" type of API method / variable, so I could make my ajax call nice and lean, and just get 10 entries, starting from ( number of entries already loaded).
Anybody have any experience / suggestions for me?

I think you'll have to load all items first, but only display 10 at first. If they click "show more" you then show them the next 10 (you'll have to keep an internal pointer of your position in the list of items). So essentially, you aren't "loading" 10 more, you're "showing" 10 more.

Related

D365FO Tile count on workspace doesn't work

Situation is next one:
I created several tiles. Every tile need to show count of records.
Tile "Expired Active Contracts" always shows zero.
There is created simple query with data source table Contract. Ranges are added (ContractStatus; Value: 2) and (ValidTo; Value: (LessThanDate(0)) )
When it's clicked on tile, it opens valid form with valid record, where contracts status is active (2) and ValidTo are any date before today's date, but count doesn't working.
Tried to recreate, tried several things but definitely nothing. ValidTo field is date field.
Some time ago I had a mistake very similar to yours in my dev environment, this steps help me to fix the error.
1 - Clear Usages Data.
2 - SysAdmin/Setup/Data cache/Tile data cache configuration. Select
the tiles which are running into this issue and then delete the
selected tiles.
3- In VS rebuilt and Synchronized the Solution.
4 - Finally refresh the Application browser.
Another thing is that a while ago there was a problem for tiles refresh
Issue 243278 Workspace tile does not update correctly when reusing the
same name
https://fix.lcs.dynamics.com/Issue/Details?bugId=243278&dbType=3&qc=68b6dc6804c9cea218daa102968c7acfcdfe6a990e80e0b5ec66b920a680fceb
I hope you find it useful

Spotfire Bookmarks issue

I have a dxp file published to Library (Server) having 5 dashboards.
All my filters are created using Document Properties for users to interact
with.
I did the below scenario:
Selected certain values from the Properties so that data gets filtered
in reports.
Did the same in all 5 pages
Created a bookmark
Went ahead and made some more changes to the report. Selected another
set of values/changed the time frame
Did the same ini all 5 pages
Created a bookmark.
Now when I close the Analysis and reopen it, the latest bookmark gets
applied to it by default. (I do not know if this is a feature).
When I click on the older bookmark, only first 2 pages reflect filter
values properly. Rest reflect the New one.
When I re-did this, the last 3 were showing properly. First 2 had proper
time range as well, but the product filters were wrong.
Does anything special need to be done for bookmarks?
Regards,
Subro
The latest book marks are getting applied by default because it's the state where you last saved the dxp. You can click on the first book mark, save the dxp, and this will be what the users see when they open it on a Web Player.
Additionally, You can allow the users to return to the last "view" of the analysis / where they left off if you change this setting:
Edit > Document Properties > Library (tab) > "Remember personalized view for each Web Player user"
It's hard to diagnosis the problem with the filters without seeing the dxp... but i suspect it is because of step 4, "Went ahead and made some more changes to the report". Depending on what you did, this would cause errors. Bookmarks aren't a snapshot of the memory...

Pagination in application which use firebase.com as database

Front end application will use firebase.com as database.
Application should work like blog:
Admin add / remove posts.
There are "home" page which show several articles per page with "Next" and "Prev" buttons and page which show single article.
Also I need deep linking.
I.e. when user enter URL http://mysite.com/page/2/ I need that application show last articles from 10 to 20, when user enter URL http://mysite.com/page/20/ application show last articles from 200 to 210. Usual pagination.
Main question - is it possible to achieve this if use firebase.com.
I read docs at firebase.com, I read posts here. "offset()" and "count()" will be in the future, use priority, in order to know count of items and not load all of them use additional counter.
Based on this I suppose this:
ADD POST action:
get value of posts counter
set priority for new post data equals to value of posts counter
increase value of posts counter
DELETE POST action
get value of priority for post data
query posts data which have value of priority more than priority for post data which will be deleted and decrease their value
decrease value for posts counter
GET POSTS FROM x TO y
postsRef.startAt(null, x).endAt(null, y).on(... and so on)
Thing which I not like in this way are actions for DELETE POST. Because index of posts will be from 0 to infinity and post with less priority is considered as post which was created earlier so if I have 100000000 posts and if I need to delete 1st post then I need to load data for 99999999 next posts and update their priority (index).
Is there any another way?
Thanks in advance, Konstantin
As you mentioned, offset() will be coming, which makes your job easier.
In the meantime, rather than using startAt and endAt in combination, you could use startAt and limit in combination to ensure you always get N results. That way, deleted items will be skipped. You then need to check the last id of each page before moving to the next to find the proper id to start on.

how to reduce web page size with many select controls

I'm working on an asp.net application that allows the user to update data for a series of days. The data is presented as a table:
Date - Active - Active Promotion
04/11/11 - yes - listbox with 360 entries
05/11/11- yes - listbox with 360 entries
06/11/11 - yes - listbox with 360 entries
...
04/02/12 - yes - listbox with 360 entries
Now, the table can have from 90-700 rows (eg allow entry for 90-700 days) and the select box has 360 entries (12,000 characters). So, for a 3 month display, I get the page size of 90 * 12,000 = 1MB and this increases to 8.4MB for a 2 year display.
I can see that the problem is the many repeated listbox . I have thought of the following approaches, perhaps people can suggest improvements or refinements:
Have each listbox populate itself when clicked (reduces initial page size but user may have to wait for drop down to populate)
Have one 'real' listbox and many 'fake' listbox . when the user clicks on a 'fake' listbox the 'real' listbox is then displayed, the selected value is then stored in a hidden field
get the client to cleanup the data so there aren't 300+ options in each box
If the options are the same for every listbox, I would definitely suggest auto-populate with javascript on clicking. I've used this solution before for exactly the same reason, and there is no perceptible delay in popping up the select list, and the original page loads way faster.
Also Firefox used to have a bug when handling lots of large select elements, and the javascript populate when necessary solution also sidestepped that.
I would go with something like the second option. What you can also do is to populate the first one initially, and then copy the contents to others using JavaScript.
But otherwise - seems you got some usability problems to solve, who's gonna use such monster forms!? :)
I would limit input to one month at a time and store it in memory until ready to complete the transaction back to the DB. I would also review choice of control for this, that is, instead of a listbox think of something more intuitive; possibly a calendar with text boxes - you could use tabs and move from one month to the next.

Auto-Incrementation in InfoPath 2010 Form

I have a form in which I am attaching a workflow to. The form has a number that will be auto-generated. For example the first number will be 1, the next time the form is opened the number should be 2, so on and so forth. The issue I am having is: in the Default Value under the Text Box Properties I have the Value as: count(mynumber QuoteNumber) +1. When the form is generated the first and only number is 2 the number begins at 2 and never increases. Can someone help me with this or explain what I may be doing wrong? Thank You. I'm not using visual studio.
Rachel: I have fought with this problem since InfoPath 2007. Here is how I do it.
Since you say you are attaching a workflow, I assume you are using the from in SharePoint.
1 - create your form library in SharePoint
2 - use InfoPath to design the form. When you publish the form to SP, make sure you promote AT LEAST the ID field you want to auto-inc. (I usually promote every field in my forms, 'cause I like to use them like SP lists.)
3 - In SP, create one new form and manually set the ID field to the starting number for your form series.
4 - return to InfoPath designer and re-open your form template.
5 - create a new data source to receive data from your SP form library and specify your form library as the source, and the ID field as a data element. Name the data source something like “ID Lookup”.
6 - open the properties of the field you want to auto-inc on your form and, in the default value box, select function, then choose the MAX function.
And add “+1” after the function to increment by 1.
Now, double-click in the field are of the Max function. You will see a dialog showing your form fields. Notice the drop-down at the top of the dialog – here you can choose the data source (notice I named mine “sales Contracts” in this example). If you select the data source you created in step 5, you will see a dialog showing you a couple of data branches.
Expand the ‘dataFields’ branch until you see the field you want to auto-inc. Click on this.
Your formula dialog will look something like:
max(ID_X0020) + 1
With your field name instead of the 'ID' in the Max function – the function will now return the Maximum value of the field IN THE FORM LIBRARY, plus 1.
Save the form in InfoPath and try previewing it. You will probably get a security warning – your InfoPath form is grabbing data from your SharePoint library on the fly. You may even get asked to re-enter your password (I usually do). When the new, blank form is displayed in InfoPath preview, you should see you ID field filled in with a value one greater that the number in that field of your SP library.
There is one huge Gothca with this method - if users re-open a completed form to edit it, the formula will probably try to replace the ID number. If your users don't edit the forms after they are submitted, the this will work for you.
Hope this makes sense.
You aren't doing anything wrong - you just have to change how you think about "forms" a bit. Remember a form is just like a word document template. Suppose you save a word document on your hard drive with a blank spot to fill in your name. Later you open the template, type your name, and save a copy as V1.doc. When you go back and open the template again - your name is not there because it was saved in V1.doc. Everytime you open the template you start again from scratch.
Infopath forms that you design and that the user fills out are templates (.xsn files). When the user fills it out and saves it they are really saving a copy which is only data (.xml files). The .xsn template doesn't change when users interact with it.
So to answer your question - there is no way directly in InfoPath to cleanly keep track of an auto incrementing ID. You will need to tap into some code (webservice, sharepoint, etc) to do that. You could also consider making the ID a GUID (which infopath does support) but it won't be auto incrementing and it won't look "clean" if it has to be displayed/used by real people.

Resources