How long until a song shows up on the Musicbrainz XML/JSON service? - musicbrainz

I just added a release that wasn't on musicbrainz before:
http://musicbrainz.org/release-group/8f6f6155-20dd-4960-9381-47805e6b50f5
Here's my query for that song that's returning 0 results:
http://musicbrainz.org/ws/2/recording/?query=recording:%22When%22%20AND%20artist:%22Life+On+Planet+9%22%20AND%20dur:[268473%20TO%20293473]%20AND%20number:6%20AND%20release:%22Bittersweet
%22&limit=1&fmt=json
and the actual song:
http://musicbrainz.org/recording/78c84a0c-8b79-46ff-af4d-653ce52540ca

It turns out that while the changes to the database show up instantly, the indexing for search for the XML service takes at least a day, maybe less than that.
Either way, the results showed up the next day.

Related

Getting a sum from Parse with Parse Cloud Code (for iOS app)

I'm new to Parse Cloud Code and am struggling with a seemingly simple task.
I'm working on a small iOS game where the users can choose from a list of characters to play -- imagine mario or luigi. In addition to tracking user scores in the game, I'm tracking total points for each character in Parse, so I can display a "mario" total and a "luigi" total (from all users.)
There could be multiple users playing at once (I hope), so I don't have Parse saving to just one mario and one luigi counter. Instead, each user gets a running count of their own mario and luigi scores.
So how do I pull the total marioPoints and total luigiPoints?
Parse doesn't have SQL-styled querying, so I've been looking at Parse Cloud Code and their "average stars" example (https://parse.com/docs/cloudcode/guide#cloud-code) looked kind of close at first glance:
But I can't get it sorted. And even if I could, it's limited to 1,000 responses, which wouldn't be enough. (I'm optimistic.)
Thanks!
Your best option is to keep a running total when any individual user update is saved. Do that using a save hook and the increment( attr, amount ) function.

How to display bunch of data in tableview

In my app I have 800 000 data in server which I have to display to user. User can also search from those data. I really got confused what to do here now. How to achieve this functionality.? I am trying to load first 50 data to table and then at top part there is search bar from that user can search data but user can search by writing approximate word also (i.e if user wrote "bcd" then it will return all data having "bcd" combination). Can anyone suggest me something that will help me to get out of this situation.
You have to do pagination here without it you can't get that much data if you do that then your application will be crash. Fetch some data from the server like 30 or 40 and when you reach at 30 request for next 30 data. Then you can meet the application need.
You need to use pagination in your application .without pagination if you got 8 lakhs data in one shot then your application might be crash.
every time send request to server like"abc"
server get first 10 data from result and return those data.
now for second request server will return 11 to 20 records from resultant data
I am developer with SIMpalm. i would like to suggest you below answer.
why can't you take two array on for displaying in table view other contain all results ,when you search then search result in the Array which contains all results.and add them to the array which shown in the table.
You will have to use pagination, I don't see any other way you can do this without eating up lot of memory or the elegant way and worst case sporadic crash.
You can do the pagination in the browse and the search both. To avoid delay's for user you can preload data. e.g. for pages of 200 records, when user reaches to 150 you start fetching data for next page.
Also if your local/web server is taking more than min to load. you have serious problem on the server, That needs to be fixed. No user will wait for min to reload or get the new data.
I am not expert on the servers/networking but it should not take more than 10-15 secs.
Think about search logic as very similar to the browsing all data.
Search/Browse both needs paging
Browse returns all the data in pages
Search returns specific data in pages
Search/Browse proloads data after user reaches certain point

iOS CMStepCounter & CMMotionActivityManager

I am using CMStepCounter and CMMotionActivityManager.
What I would like to do is work out my total walking time throughout the day, and from this, my average speed.
However, looking at the data in CMMotionActivityManager, it is clear than a number of steps throughout the day are actually logged during periods that are of 'unknown activity' and not walking or running. This does make sense, as you need to do a handful of steps for iOS to know you are walking. However, these add up over the course of any given day.
Querying CMMotionActivity, it is possible to get the timestamp of every event. However, whilst it is clear to me that every step must be timestamped in CMStepCounter, I can only see a method to return the total number of steps between two points in time. What would be great is if I could return an array of every step with its time stamp, and if so, how?
Many thanks.
With the current Core Motion API, you can't get an array of every step with its time stamp directly.
But you can use queryActivityStartingFromDate:toDate:toQueue:withHandler: to get an array of CMMotionActivity objects. Then use the time stamps to calculate the number of steps by calling queryStepCountStartingFrom:to:toQueue:withHandler:.
I don't think the M7 processor stores every step with its own time stamp. If you pass 1 as stepCounts to the method startStepCountingUpdatesToQueue:updateOn:withHandler:, you'll notice the handler is not executed on every step. Like the document says: The handler block is executed on a best effort basis each time the step count threshold is exceeded.

The last ten JIRAs I have worked on

Is there anyway to find the last 10 JIRAs I have worked on - irrespective of time period? By worked on, I mean any thing I have updated. Thanks.
You could query the activity stream.
For example here are my last (up to) 10 issues on jira.atlassian.com in ATOM format:
https://jira.atlassian.com/activity?provider=jira&maxResults=10&streams=user+IS+david#davidsimpson.me
If you want authenticated, try appending parameters &os_username=a.n.other&os_password=abc123 (or similar) to the URL.
Incidentally, an activity stream similar to this is present in your JIRA profile, e.g. https://jira.atlassian.com/secure/ViewProfile.jspa?name=david%40davidsimpson.me

How does YouTube calculate the number of views for a video?

I have made an internal movie site in .Net.
I play the movie trailers using jw player. Now I want to know how to calculate the number of views for a video?
Is it possible through code?
PLease help.
NBL I dont have any database. I add the videos through an xml and the code reads the xml.
A simple approach is to tally the number of pageloads for the page that contains the video, rather than the number of times the video itself is played. First, create a table in your database that contains these fields:
DateTime date // date of pageloads -- we'll get to this in a minute
int videoID // Unique Identifier for the video loaded
int count // Number of pageloads
When I tally pageloads, I do them by day so I can compile statistics over time. Of course, you can use a different granularity depending on your particular needs.
Additionally, I don't particularly like writing to the database with each pageload, so I have a class I've written that caches the hits, then writes them after every hundred hits or so.
In this class, I also retain each user's IP address. This allows me to ferret out duplicate pageloads. A subsequent task, which I'm working through in my own hitcounter, is to triage humans, legitimate spiders and unwelcome bots.
Not sure exactly what you need.. but you can handle the play command (button or loading... however your videos are played), and attach that to a counter that you save in your database.
We would need a lot more (code set, video codec and such) before giving more.
You can also create a separate table with these columns :
VideoId
IP adress
And add a row each times an user watch a video...
Then you will calculate unique watch and not duplicate
(Instead of ip adress you can store userId if your users are registered)
The database would have a table for videos, including a Hits column.
When you request the page from the server, the server would execute a stored procedure that adds +1 to the 'Hits' column.
If you are embedding videos on your page, it's worth being aware of YouTube's policy on the question of autoplaying those videos, in relation to the official viewcount. If in the player you set autoplay = true, or equivalent, then the YouTube view count doesn't increase. This is to counter spammy viewcount auto-augmentation pages. The user has to click on the play button, and watch all, or at least most, of the video to count as a view.

Resources