get big amount of data from flutter firebase - database

i am working on a social media application and i want to show the user posts of other followed user , i have an idea to put the link of all the posts of other user together and use them in a futurebuild statement, but the problem is if we have more than 1000 posts for example , it could take a while to retrieve all the data and then show it to the user,(note : i am useing pageView builder the display each post alone), my question is , how can we make the program to display about 10 posts and then in the background it could still work on the other posts , so the user dont have to wait untill all posts are retrieved. thank your for your attention !!

Related

How to Inserting multiple rows using sveltekit and supabase

Hey can someone help me understand how the logic for something like this would be.
Lets say im having an event and someone can register for it.
When they click sign up.
They can select the ticket and choose how many people they want to sign up via input:select.
If theĆ½ select 2, then 2 forms should appear.
How do i then send the data and store in multiple rows to supabase for the 2 registered attendees?

How to retrieve all children from Firebase Database

I'm trying to learn how to use Firebase by creating a simple social media application.
https://i.stack.imgur.com/wfeyw.png (Here is how my database is laid out)
I was able to add data to the database but I'm having trouble understanding how to retrieve data. I want to be able to retrieve all the posts from a certain user and then display each one as an item in a list.
let Posts = firebase.database().ref('Posts').child(userId);
So far thats my query and here is the code I'm using to add the posts to the database. Could someone also tell me what is the term for the Id that is being generated for each post?
firebase.database().ref('/Posts').child(userId).push({
Text: post,
Score: 0
});

Cakephp - Load a view from another view in a different controller

I've been trying for the past 2 days, how to embed a view from a different controller.
I have two tables (hotels, hotelQuotes), related to each other. The hotels table is linked with a hasmany to the hotelQuotes table, and hotelQuotes with a belongsTo hotels table. Both are linked and working, they both show their related content with no problem.
The hotelQuotes it's pretty much a form, where users fill it out, and then it sends an Email with what the user filled out. Everything is working fine up to this point.
What I want is, when I show the information about the hotel, is to also show that form, I dont want the user to go to another page to fill out the form. So I pretty much want to embed the view of hotelQuotes/Add to the hotel/view.
I doing that using elements, as recommended last night in #cakephp IRC channel, and also here in StackOverFlow at: Embedding view in another view with CakePHP
The problem is that when I do that, the association between the two models gets broken. I mean, the users fill out the form, but I have nowhere to know where that form is coming from, what hotel is referring to. It just doesn't show that piece of vital information for me.
I've been reading about passing variables when using elements at: http://book.cakephp.org/2.0/en/views.html#passing-variables-into-an-element but I don't know how to pass a variable to a form select box. I am using CakePHP 2.5.2.
I hope I explain myself clear here, any input it would be appreciated. See picture below for more info:
http://i.stack.imgur.com/wcG64.jpg
Edit> I just realized that the form is not even submitting when I using elements. Why would that be?
Ok, I just figured out.
The form wasn't even submitting when calling it from elements. So I just passed the action myself like so:
echo $this->Form->create('Hotelquote', array(
'action' => 'add'
));
And now is working.

Manipulating Soundcloud Stream with Chrome Extension Content Script

I am writing a Chrome extension using AngularJS to add functionality to the Soundcloud stream page. I want to allow the user to create groups of artists so that they may only see a stream with tracks/shares/playlists from that group of artists.
For example, I follow 500 artists, but I want to quickly see a stream from my favorite 10 artists or from the artists I follow that are on the same label.
I am looking for advice on how I could go about making this as seamless as possible. As of right now, my approach involves getting the tracks with the Soundcloud API and using angular's ng-repeat to display the tracks in a view injected into where the stream normally goes. I realized using the Soundcloud widget was too slow and can't be customized to resemble the native stream items, so I copy/pasted the HTML that an actual stream item uses, but obviously the waveform/comment canvas and button functionality don't work.
What are my options as far as how I can approach this? Am I going to need to write my own players that look like the native Soundcloud ones? Any suggestions would be greatly appreciated.
You should use the SoundCloud API which is very well documented.
If you have already the id's of the tracks / artist, you just have to request the url
GET
http://api.soundcloud.com/tracks/ID_OF_TRACK.json?client_id=YOUR_CLIENT_ID
to get all the informations you need about this track, like the waveform_url, and for the comments you was talking about :
GET
http://api.soundcloud.com/tracks/ID_OF_TRACK/comments.json?client_id=YOUR_CLIENT_ID
To reproduce the behaviour of the comments :
POST http://api.soundcloud.com/tracks/ID_OF_TRACK/comments.json?client_id=YOUR_CLIENT_ID
(with a body param which represents the text and a timestamp in ms since the beginnin of the song, note that you must be connected)
If you don't have the id of the track, you could also use the resolve which give you all the info about a ressource if you have only the URL :
GET
http://api.soundcloud.com/resolve.json?url=https://soundcloud.com/poldoore/pete-rock-c-l-smooth-they&client_id=YOUR_CLIENT_ID

pagination in view page with cakephp2

I am developing a simple web-mail client using cakephp2.
For the mailbox list display I am successfully implemented pagination with Paginator helper
Now when I click a particular item in the mailbox list page will show
the message details. In the message display page I also want to show navigation
e.g 3 of 23 << | >>
Is it possible to do this with Paginatir helper?
Awaiting your valuable suggestion.
Regards.
Paginator documentation does not provide information which I have asked for,
But fortunately after a vast reading of Retrieving Your Data section of Model in
cakephp2.0 documentation I have got my ANSWER.
I have almost done with find(neighbors)
Get Your Neigbor
Now I have to set the record number for the current record...then it will be completed.
Thanks for responding..

Resources