How to sort results from the MusicBrainz search API - search

I'm trying to retrieve track information from the MusicBrainz API, using only the artist and title as search queries:
http://musicbrainz.org/ws/2/recording/?query=artist:Coldplay+AND+recording:The+Scientist
This will return every version of the song that the artist released, including compilations, 'best of' albums and live recordings. I want to find the 'original' version, which should be the first one that was released.
Without retrieving every single result (which may not be possible in a single request) the obvious way to do this would be to have the response sorted by ascending release date, so that the first result is always the one I'm after.
The API documentation doesn't seem to mention sorting results, so is this possible?

I don't think sorting is possible.
It may not solve all problems either. Many recordings have a date as a year only. Thus, a recording with release date "1989" will be considered an earlier version than a recording with release date "1989-01-01", which in reality may or may not be the case.
Also, many releases have the same date, especially if the date is a year only, and some of these releases may be "original", while others are not. All recordings from these releases will have the same release date (e.g. "1989")
If accuracy is important, you may have to find the earliest official release which is not marked as live or compilation, and then choose a recording from this release.

It may not be the solution for you, but the following bash one-liner works for me to get the oldest year of an album:
curl -s 'http://musicbrainz.org/ws/2/release/?query=artist:%22The%20Beatles%22%20AND%20release:%22Abbey%20Road%22%20AND%20status:Official&fmt=json' | jq -r '.releases[] | .date' | sort | head -n 1 | sed 's/-.*//'
It will query and get all date fields, sort them and get the lowest. Finally it removes possible date values after the year.
For your specific question it will not be enough. But maybe this answer helps some people.
You need to have jq installed for this to work.
I am sure there are prettier solutions. But this one is good enough for me.

Related

Boost score to different fields in Lucene

I have 2 fields "title" and "body" in my document. I want to give more weightage to title field. In latest Lucene 8.6* setboost is not available for field object. I want to know the best way to do this. I read PerFieldSimilarityWrapper can be used but I didn't get how to use it and in documentation warning is present "WARNING: This API is experimental and might change in incompatible ways in the next release." So is it safe to use in product which will be supported for long time.
I too wish I understood more about why Lucene sometimes marks portions of their API as "experimental". But one thing I can tell you, which should be fairly reassuring, is that there are large portions of the API marked this way and many haven't changed much in years and years.
So for example the class you are interested in PerFieldSimilarityWrapper was marked as experimental at least as far back as Lucene 4.8. See the tag on the 4.8 version in github.
So, I don't think I'd be too concerned. Especially because if the Lucene team ever decides to change the API they won't immediately remove it. They typically mark the old API as depreciated (but still callable) for at least on major version.

searching YouTube for videos with specific range of views eg. between 9,000,000 and 11,000,000

first time posting.
I wanted to ask if anyone knows how I can search on YouTube for, let's say, music video's that have been viewed between a set number of times. Like the title says for example, between 9 and 11 million times.
One reason I want to do this is because I want to find good music that I haven't heard before. The logic I'm working on is that the Got Talent type video's that get viewed millions of times are generally viewed that many times for one of two reason. 1) they're amazing. 2) they're embarrassingly horrible.
And though I don't think a song being popular will necessarily mean I'll like it, I'm hoping this method will be successful to some degree.
Another reason is to look for trailers for independent films with a similar logic as above. Though with these movies I think I only hear about them six months to a year after they've been released because they're flying under the radar.
If I were to be able to search for movie trailers with 'x' number of views though.. for example, between 500,000 and a million, maybe I'd be able to find movies that I'll like quicker than via time passing and them getting mentioned to me by a friend.
Any help would be greatly appreciated as I've wanted to be able to perform these kind of searches for awhile now.
thanks
You will need to use YouTube API v3.
I havent written this exact request but it looks like you can list videos then filter by 'Chart' = 'mostPopular'
https://developers.google.com/youtube/v3/docs/videos/list
Perhaps a bit of background reading on the API would help too...
https://developers.google.com/youtube/v3/
First off, you would need the Youtube Data API. "v3" means nothing because it's simply the current version, like "Windows 10."
The API lets you get a video's view count, but doesn't put it in a range like 9 million to 11 million.
Youtube's own search function is pretty sophisticated. For instance,
https://www.youtube.com/results?search_query=movie+trailer&search_sort=video_view_count&filters=month. This gives all results for "movie trailer," within the last month, sorted by view count. You can customize the URL, i.e. "week" instead of month would return only trailers from the last week. Or year, etc. Essentially this is a "Videos: List: MostPopular" query, with subject filter.
I have a few Youtube API scripts, and I hardly think it's worth the hassle to do it that way when Youtube's advanced search get you 99% there. If you did, you would need to to a Search:list query for a given subject (i.e. "movie trailer"). Limited to a given time frame (i.e. last month). Then for each video ID, make a Videos:list query to get its view count. Then print all, sorted by views.

SharePoint, register a review without changing version number

I am using SharePoint's in-built version control as a means of identifying the current approved versions of procedures, so I get x.y as minor (draft) versions and x.0 as the major (approved) versions. This bit works fine.
Our ISO 9001 auditor has asked how we would demonstrate that quality procedures have been reviewed. There will no doubt be many instances for our company in the future where procedures are around ten to twenty years old, but have not needed changing. Unfortunately this then would give the impression that there hasn't been a review of the document.
A clumsy solution to this would simply be to keep a record of all the documents and have a review date in a spreadsheet then record when the review has been done. It would be far easier for me if SharePoint could look after this for us, however, what I don't want to do is have to check out a document to review it and then have publish as the next major version as proof that it has been reviewed.
My question is: is there a way in SharePoint's version control to record that a review of a document has been conducted but no changes made?
I hope my question is clear, but if you have specific questions please ask. Many thanks
Add another field in your document lib. Call it Reviewed and make it Yes/No type.
Edit document properties when you make a review and update the field accordingly.
Add another field, type = dateTime. When editing document properties, insert the date of the review.

How do I find out who deleted (removed) an Iteration from Rally?

I am using the Excel Add-in to look at revision history. I would like to locate the information (User, Date, Time, etc.) when an Iteration in Rally was "removed". I am able to obtain this but get too many rows.
I want to know when an Iteration is removed from a project.
I don't want to know when the Iteration value is changed on a User Story.
Right now I am getting rows relating to both situations.
Any hints?
Regards,
Jim
Unfortunately there is not a specific single place to look for this, nor a single Webservices query that you can run to provide this information. Your best bet is to find a Work Product (User Story, Defect, etc.) that was scheduled into the Iteration, and examine its Revision History. There will be an entry similar to:
ITERATION removed [Iteration 3] 2013-May-15 12:19:43 PM America/Denver Mark W
That includes Date/Time and User that performed the delete.
This likely precludes Excel being the tool of choice to do this query as it would require you to query and parse many, many Revision History entries throughout your User Stories of interest.

What is the easiest way to adjust EXIF timestamps on photos from multiple cameras in Windows Vista?

Scenario: Several people go on holiday together, armed with digital cameras, and snap away. Some people remembered to adjust their camera clocks to local time, some left them at their home time, some left them at local time of the country they were born in, and some left their cameras on factory time.
The Problem: Timestamps in the EXIF metadata of photos will not be synchronised, making it difficult to aggregate all the photos into one combined collection.
The Question: Assuming that you have discovered the deltas between all of the camera clocks, What is the simplest way to correct these timestamp differences in Windows Vista?
use exiftool. open source, written in perl, but also available as standalone .exe file. author seems to have though of everything exif related. mature code.
examples:
exiftool "-DateTimeOriginal+=5:10:2 10:48:0" DIR
exiftool -AllDates-=1 DIR
refs:
http://www.sno.phy.queensu.ca/~phil/exiftool/
http://www.sno.phy.queensu.ca/~phil/exiftool/#shift
Windows Live Photo Gallery Wave 3 Beta includes this feature. From the help:
If you change the date and time
settings for more than one photo at
the same time, each photo's time stamp
is changed by the same amount, so that
the time stamps of all the selected
photos remain in their original
chronological order.
Instructions:
Select Photos to change (you can use the search feature to limit by camera model, etc).
Right-Click and select 'Change Time Taken...'.
Select a new time and click OK.
Current download location is from LiveSide.net.
Easiest, probably a small python script that will use something like os.walk to go through all the files below a folder and then use pyexiv2 to actually read and then modify the EXIF data. A tutorial on pyexiv2 can be found here.
I'd dare to advice my software for this purpose: EXIFTimeEdit. Open-source and simple, it supports all the possible variants I could imagine:
Shifting date part (year/month/day/hour/minute) by any value
Setting date part to any value
Determining necessary shift value
Copying resulting timestamp to EXIF DateTime field and last modified property

Resources