SoundCloud API: Ordering by hotness with the "created_at" filter doesn't work - soundcloud

I am trying to determine the hottest tracks in the range of May 1 2012 to May 10 2012.
Unfortunately, the following query returns an empty set of tracks:
http://api.soundcloud.com/tracks?limit=20&order=hotness&created_at[from]=2012-05-01&created_at[to]=2012-05-10&consumer_key=
It is however clear that there exist tracks created in that range of time because the same query works when the order parameter is omitted:
http://api.soundcloud.com/tracks?limit=20&created_at[from]=2012-05-01&created_at[to]=2012-05-10&consumer_key=
I was hoping for the hotness algorithm to work across any range of time.
The other strange thing I found is that when a query parameter is specified along side the hotness and created_at parameters, results are returned:
http://api.soundcloud.com/tracks?limit=20&order=hotness&created_at[from]=2012-05-01&created_at[to]=2012-05-10&q=a&consumer_key=
Unfortunately it looks like the results are not sorted by hotness (though I think they may have been at some point in the past).
Any tips on how to get a list of tracks sorted by hotness within a specific time range?

The hotness parameter has been deprecated as of April 16th, 2013. As an alternative, you can rank tracks based on the number of plays (playback_count), downloads (download_count), favorites (favoritings_count), comments (comment_count), likes (likes_count), or reposts (reposts_count) on a track object.

Related

MS Access use DATE() in a calculated field

I am using Microsoft Access 2016. I am trying to find out how many years exist from the current year until a future year. I have a column that is end_date. I am trying to create a calculated field that is essentially YEAR(end_date) - YEAR(current_year). I tried to use YEAR(DATE()) but DATE() is not allowed to be used in a calculated field apparently.
Is there no way to do a calculation like this?
Nope. Calculated fields are cached and static, so are NEVER allowed to contain ANY information that will change over time, due to system settings, or anything else that is not directly entered in that row.
However, you should not be using calculated fields anyway. See http://allenbrowne.com/casu-14.html, among many posts advocating for not using calculated fields.
Instead, use queries to do calculations. That way, you won't have any trouble using the current date, and won't have to deal with the possible errors and portability issues calculated fields come with.
I changed my thinking to calculate this in a form. It does not seem good practice to have a field in a DB that changes everyday.
In a form, you can use this expression as controlsource for a textbox:
=DateDiff("yyyy",Date(),[EndDate])
However, that return the difference in calendar years. To find the count of full years, use a function like AgeSimple and this expression:
=AgeSimple([EndDate])

How to get all missing days between two dates

I will try to explain the problem on an abstract level first:
I have X amount of data as input, which is always going to have a field DATE. Before, the dates that came as input (after some process) where put in a table as output. Now, I am asked to put both the input dates and any date between the minimun date received and one year from that moment. If there was originally no input for some day between this two dates, all fields must come with 0, or equivalent.
Example. I have two inputs. One with '18/03/2017' and other with '18/03/2018'. I now need to create output data for all the missing dates between '18/03/2017' and '18/04/2017'. So, output '19/03/2017' with every field to 0, and the same for the 20th and 21st and so on.
I know to do this programmatically, but on powercenter I do not. I've been told to do the following (which I have done, but I would like to know of a better method):
Get the minimun date, day0. Then, with an aggregator, create 365 fields, each has that "day0"+1, day0+2, and so on, to create an artificial year.
After that we do several transformations like sorting the dates, union between them, to get the data ready for a joiner. The idea of the joiner is to do an Full Outer Join between the original data, and the data that is going to have all fields to 0 and that we got from the previous aggregator.
Then a router picks with one of its groups the data that had actual dates (and fields without nulls) and other group where all fields are null, and then said fields are given a 0 to finally be written to a table.
I am wondering how can this be achieved by, for starters, removing the need to add 365 days to a date. If I were to do this same process for 10 years intead of one, the task gets ridicolous really quick.
I was wondering about an XOR type of operation, or some other function that would cut the number of steps that need to be done for what I (maybe wrongly) feel is a simple task. Currently I now need 5 steps just to know which dates are missing between two dates, a minimun and one year from that point.
I have tried to be as clear as posible but if I failed at any point please let me know!
Im not sure what the aggregator is supposed to do?
The same with the 'full outer' join? A normal join on a constant port is fine :) c
Can you calculate the needed number of 'dublicates' before the 'joiner'? In that case a lookup configured to return 'all rows' and a less-than-or-equal predicate can help make the mapping much more readable.
In any case You will need a helper table (or file) with a sequence of numbers between 1 and the number of potential dublicates (or more)
I use our time-dimension in the warehouse, which have one row per day from 1753-01-01 and 200000 next days, and a primary integer column with values from 1 and up ...
You've identified you know how to do this programmatically and to be fair this problem is more suited to that sort of solution... but that doesn't exclude powercenter by any means, just feed the 2 dates into a java transformation, apply some code to produce all dates between them and for a record to be output for each. Java transformation is ideal for record generation
You've identified you know how to do this programmatically and to be fair this problem is more suited to that sort of solution... but that doesn't exclude powercenter by any means, just feed the 2 dates into a java transformation, apply some code to produce all dates between them and for a record to be output for each. Java transformation is ideal for record generation
Ok... so you could override your source qualifier to achieve this in the selection query itself (am giving Oracle based example as its what I'm used to and I'm assuming your data in is from a table). I looked up the connect syntax here
SQL to generate a list of numbers from 1 to 100
SELECT (MIN(tablea.DATEFIELD) + levquery.n - 1) AS Port1 FROM tablea, (SELECT LEVEL n FROM DUAL CONNECT BY LEVEL <= 365) as levquery
(Check if the query works for you - haven't access to pc to test it at the minute)

Titan: fetch sorted result

Take the scenario of SO,
when we click Questions button it shows all question regardless of tag,
when we click a tag it only shows question asked to that particular tag.
Second is ok, I will just go to that particular Tag vertex and fetch the sorted data based on attached edge.
How will i implement the first scenario in sorted order.? I will have java question, html question, c++ question vertex... so and so. How will I fetch all these in sorted order? What will be the query?
Obviously, you are trying to avoid iterating/sorting all vertices to find recent questions. One way might be to build some sort of date structure into your schema like:
year --> month --> day --> question
If you have a sufficient number of "questions" in your you use case you might consider breaking time down further to hours, minutes, etc (or a higher level of aggregation....maybe you just need year and month). Index the edges between the year, month, day, and question using a reverse sort order of the time, so that you can just do:
g.V('year','2014').out.out.out[0..<10]
which would return the first 10 most recent questions. Note that Gremlin nicely compiles this to a vertex query to take advantage of your index:
gremlin> g.V.has('year','2014').out.out.out[0..<10].toString()
==>[GremlinStartPipe, GraphQueryPipe(has,vertex), IdentityPipe, VertexQueryPipe(out,[],vertex), VertexQueryPipe(out,[],vertex), VertexQueryPipe(out,[],range:[0,9],vertex), IdentityPipe]

get number of updates since a timestamps in facebook

Can we get the number of updates since a particular timestamps using graph APIS? Number of updates might be number of new New feed or Messages.
depending on which api you are calling
When searching for public posts or posts on the user's News Feed, you
can page over the results by using the since, until and limit
parameters. since and until both accept a unix timestamp. When paging
back in time, you should use until in conjunction with limit where
until is the unixtime value of the created_time field in the last
object returned by your previous query. When paging forward in time
you should set since to be the unixtime value of the created_time
field in the first object returned by your previous query. Please
note, you can only search about 1 to 2 weeks back in the News Feed.
/me/feed?since=2+hours+ago&until=now "using strtotime in php"

Get the last date of non-empty value using MDX

Do you know how to get the last non-empty value using mdx query.. then after that.. i want to count how many null values are next to it up to the last date. My main purpose for this is to count how many days a customer has no transaction..
i have to make a report in ssrs (using adventure works cube) that counts how many days a customer has no transaction..
thanks..
Use this article to obtain set of non empty dates.
To obtain count you can:
Use member properties (day of year or something more suitable in
this case) and just subtract one value from another.
You can find
last date with non empty value, previous one using LAG(1), include
them to the next construction {prev.date:last.date} and use COUNT
for set
Recently I follow this article, It really helps me.
The most important part is to understand scope usage.
Even If you don't have an Enterprise Edition, you can use it.