Riot LOL api static ddragon JSON - riot-games-api

I got a problem. In static LOL json I got a list of champions and everything about them. I would like to fill the {{ f[number] }} values. I have no idea how to do it, how to calculate this value or something.
You can see it there: http://ddragon.leagueoflegends.com/tool/, for example click Ahri and check spells -> 2nd spell.
for a maximum of undefined damage to a single enemy.
They haven't fill it, but I think it is possible in some way, because I got whole information about champions.
This undefined is in JSON {{ f1 }}, the are other values like that.

I'm guessing, but...
I think you'll find that the spell information is from the same data source as the in-game spell info tool tips. That undefined / {{f1}} place holder is replaced in-game by a formula based on the player's current level and or ability power or some other factor.
As this data is outside the context of the game, the need to replace this with a representation. I guess maybe they forgot to provide a scaling list of values for that particular formula, or it doesn't translate to a list like that so maybe they just left it.
It could potentially be a bug, and is worth reporting to Riot.

Related

How to rank values from asc/descending?

Struggling to find rank values from highest to lowest, please see attached example of what I'm trying to achieve.
My current custom expression is:
Sum([ViolationAmt])
I have tried this:
Sum([ViolationAmt]) over Rank([ViolationAmt])
I've played around with the rank expressions however unable to implement...would be very grateful for some help.
Spotfire Rank Example
I need to make a lot of assumptions here because I don't know anything about your data set or really what your end goal is, so please comment back and/or provide more info in your question if I am off base.
the first assumption is that each row in your dataset represents one, for simplicity, [AccountID] with a [ViolationAmt]. I'm also guessing you want to show the top N accounts with the highest violations in a table, since that's what you've shown here.
so it sounds like you are going to need two calculated columns: one for getting the total [ViolationAmt] per account, and then another to rank them.
for the first, create a column called [TotalViolationAmt] or somesuch and use:
Sum([ViolationAmt]) OVER ([AccountID])
for the second:
Rank([TotalViolationAmt])
it will be useful to read the documentation on ranking functions if you haven't already.
you could probably combine these two into a single column with something like:
Rank(Sum([ViolationAmt]) OVER ([AccountID]))
but I haven't tested this at all. again, if you put in a bit more detail about what you're trying to accomplish it will help you get a better, more detailed answer :)

How can I limit the numbers of links returned by paginate?

The current {{ $videos->links() }} returns 13 links (including prev, next and ...), this is to much for a page I'm making. Is there a way to have it return less links? I couldn't find any way by looking at the source code.
The majority of numbers relating to pagination are hard coded into the presenter. Like #AlexGuth has said in his comment you'll need to create a custom presenter so you can overload these methods and adjust the hard coded numbers.

Can Groups be used to emulate the "class" or "struct" data structures from other languages

Is there a data structure within LiveCode that can be used as a "holder" for associated data, letting me handle it collectively? I come from a Java / Javascript / C background so I am looking for a Class or Struct sort of data structure.
I've found examples of Groups, which seem to have some of this functionality, but it feels a bit like I'm bending the language to meet my needs.
As a specific example, suppose I had an image field on my screen that would randomly display an image and, when pressed, play an associated sound clip. I'd expect to create a list of "structures" that contained the path to the image and the path to the associated sound clip, and use that data to populate the image field and to decide what sound clip to play.
Would a Group be the correct structure to use in this case? Or am I approaching this in a way that isn't really fitting with the way LiveCode works?
It takes a little getting used to, but the xTalk world is much simpler and more open than any ordinary procedural language. So much of what you once had to manage is no longer required.
So when splash21 said that you could store all your image and sound references in a custom property, he was really saying that the LiveCode environment contains intrinsic, high level functionality that makes these sorts of things instantly accessible, and the only thing required of you is to call for them, and they simply work.
The only way to appreciate this is to make a few simple programs, to really see what is possible. Make your application. Everything you mentioned can be accomplished with perhaps a dozen lines of code in a single handler. I recommend that you join the LiveCode use list and forums. The community is vibrant and eager to help, frequently with full blown solutions to specific problems, but more importantly, as guides and mentors to new users
Craig Newman
Arrays in LiveCode are actually associative arrays (like hash maps). A key is associated with a value. The value might be as well an array.
Chapter 5.5.7 of the User's Guide says
Array elements may contain nested or sub-elements, making them multi-dimensional.
This type of array is ideal for processing hierarchical data structures such as trees or
XML. To access a sub-element, simply declare it using an additional set of square
brackets.
put "ABC" into myVariable["myKeyName"][“aChildElement”]
see also
How to store pictures in a stack?
Dave- I'm hoping to get a struct-like container implemented in the near future. Meanwhile you can, as splash21 mentioned, use custom properties (or better yet, custom property sets) to do what you want. This will give you a pseudo-struct for each object and you can implement the file and sound specifications into the properties. And if you use that in conjunction with a behavior object you'll end up very close to a real inheritable class formation.

How to find out what an Image is about

Is there a way to understand what an image is about? I mean, if I scann a picture, how can I tell that the picture is about a spesific object? I am thinking that if I have some shape in mind, say the shape - pattern of a spesific object that meets its requirements against the object I am searhcing for, then it must be what I am looking for. Anyway I am thinking of an algorithm to scann a picture database and figure out the pictures I am actually looking for,Is there a known way to accomplish such operation?.
If I am reading your question correctly...
This is a very daunting task even for full-fledged corporations like Google, though they are attempting to create something along these lines.
Take a look at Google Goggles for Android if you'd like to see how this sort of system behaves. You'll also notice that it requires very specific circumstances to be even slightly reliable, but the base technology is there.

Script for the USPS

I am trying to write a script that does a zip code look up at the USPS.
URL="http://zip4.usps.com/zip4/citytown_zip.jsp". The data gets submitted by POST is:
zip5=YOURZIPCODE&submit.x=3&submit.y=22&submit=Find+ZIP+Code
The part I am having a hard time finding is how these numbers get generated:
submit.x=3
submit.y=22
The above two always "submit" values for X and Y always change. I can figure out
those number get put into the string.
Any thoughts would be greatly appreciated.
Those are the coordinates for a image-button click. Their values just give the mouse position on the button when it was clicked. In this case, they are going to be meaningless, just make them both 1 or something.
"Users may view and download material from this site only for the following purposes: (a) for personal, non-commercial home use"
http://www.usps.com/homearea/docs/termsofuse.htm?from=global_footer&page=termsofuse
From the link above.
As the first answer says, that is just the USPS trying to keep anyone from building an automated script to access data through that form. They expect slightly different numbers for each request from a given IP address.
"when you can prevent someone from doing something, you can get paid to allow them to get things done"
Just put in random numbers between 1 and the max size of the image button and it will work.
And I would not bother trying to do it "legally", their legal terms make no sense:
http://techref.massmind.org/techref/ecommerce/shipAPIlegal.htm also see the "Shipping" link in the heading for that page.

Resources