Advertisement
by Topid » Wed Oct 19, 2016 11:16 pm
by Ever-Wandering Souls » Thu Oct 20, 2016 8:28 pm
Topid wrote:Boo! I feel like there's quite a few more of us that would like to use endorsements than a break down on cause of death percentages and such!
Is there a way we could get a version that was bigger that would include more shards?
The Alicorns (Equestria) wrote:Let them stay, no need to badmouth them...From our view a bunch of nations just came in, seized the delegate position, and changed a few superficial things...we play NationStates differently...there's really no reason for us to be butthurt.
http://www.nationstates.net/page=rmb/postid=8944227
http://www.nationstates.net/page=rmb/postid=8951258
Reploid Productions wrote:Raiders are endlessly creative
by Topid » Thu Oct 20, 2016 9:21 pm
by Ever-Wandering Souls » Thu Oct 20, 2016 9:25 pm
Topid wrote:Yeah I don't know how to do all that. I know how to use Excel really really well, but none of that fancy coding to make API requests.
That's why I like the data dump because I can import it to Excel and use filters to show only what I need.
The Alicorns (Equestria) wrote:Let them stay, no need to badmouth them...From our view a bunch of nations just came in, seized the delegate position, and changed a few superficial things...we play NationStates differently...there's really no reason for us to be butthurt.
http://www.nationstates.net/page=rmb/postid=8944227
http://www.nationstates.net/page=rmb/postid=8951258
Reploid Productions wrote:Raiders are endlessly creative
by Topid » Thu Oct 20, 2016 10:40 pm
Ever-Wandering Souls wrote:Topid wrote:Yeah I don't know how to do all that. I know how to use Excel really really well, but none of that fancy coding to make API requests.
That's why I like the data dump because I can import it to Excel and use filters to show only what I need.
Fair, I'm not great with much of it either, but you can manually use shards like that for spot data. And if you want to do a bit more, getting an excel sheet to populate with data from shards is on the more basic end of stuff to learn.
by Imperium Anglorum » Fri Oct 21, 2016 7:49 am
Topid wrote:I've never needed to make Excel work less fast before.
by Topid » Fri Oct 21, 2016 8:31 am
by Eluvatar » Fri Oct 21, 2016 9:08 am
Topid wrote:Imperium Anglorum wrote:When has anyone ever need Excel to work less fast?
When your formula pulls info from the API so you don't want it to make 300 calls all at once when you paste nation names into the input column.
Not the most well-versed on the API rules but I'm assuming 300 cells updating in Excel counts as 300 API calls and doesn't need to happen in less than a second.
Pulling info for 300 cells (or more) from the data dump doesn't affect the API though, that's why I thought I'd ask if it was doable.
by Topid » Fri Oct 21, 2016 10:07 am
Eluvatar wrote:Topid wrote:When your formula pulls info from the API so you don't want it to make 300 calls all at once when you paste nation names into the input column.
Not the most well-versed on the API rules but I'm assuming 300 cells updating in Excel counts as 300 API calls and doesn't need to happen in less than a second.
Pulling info for 300 cells (or more) from the data dump doesn't affect the API though, that's why I thought I'd ask if it was doable.
If you want simple, this might work best.
by Ever-Wandering Souls » Fri Oct 21, 2016 10:54 am
Topid wrote:
I'm actually backing into endorsements given to track and recognize good tarters. The sheet I built last night started with a list of WAs in #REGION which I pull from the data dump in a seperate tab. Then received the endorsement shard for each from the API, then filtered it so I ended up with a list for each I can work with in Excel. So far I've built it to count how many times each nation's name is in the entire list of endorsements which gives me how many nations they have endorsed (less any that weren't WAs or in #REGION at last update).
I've also already built it so that it checks if certain nations have endorsed each nation (this could be Delegate, Vice-Delegate, or any position that is supposed to tart) and outputs hyperlinks to the nations that the officer hasn't endorsed.
I'm looking into having it do more, but those are the core things I want it to do. As of now, it can all work just fine except that I am manually auto-filling the formula that pulls in the endorsement shard down one cell at a time so it doesn't do them all at once and block my access to the API. That's not really convient though, even if it is workable.
The Alicorns (Equestria) wrote:Let them stay, no need to badmouth them...From our view a bunch of nations just came in, seized the delegate position, and changed a few superficial things...we play NationStates differently...there's really no reason for us to be butthurt.
http://www.nationstates.net/page=rmb/postid=8944227
http://www.nationstates.net/page=rmb/postid=8951258
Reploid Productions wrote:Raiders are endlessly creative
by Topid » Fri Oct 21, 2016 11:18 am
Ever-Wandering Souls wrote:Topid wrote:I'm actually backing into endorsements given to track and recognize good tarters. The sheet I built last night started with a list of WAs in #REGION which I pull from the data dump in a seperate tab. Then received the endorsement shard for each from the API, then filtered it so I ended up with a list for each I can work with in Excel. So far I've built it to count how many times each nation's name is in the entire list of endorsements which gives me how many nations they have endorsed (less any that weren't WAs or in #REGION at last update).
I've also already built it so that it checks if certain nations have endorsed each nation (this could be Delegate, Vice-Delegate, or any position that is supposed to tart) and outputs hyperlinks to the nations that the officer hasn't endorsed.
I'm looking into having it do more, but those are the core things I want it to do. As of now, it can all work just fine except that I am manually auto-filling the formula that pulls in the endorsement shard down one cell at a time so it doesn't do them all at once and block my access to the API. That's not really convient though, even if it is workable.
This may be silly, but - can you paste it into 50 cells, wait thirty seconds, and repeat? Rate limit is technically 50calls/30seconds, and if the formula is the same....
Still have to do it manually, but a easier than one at a time.
by Ever-Wandering Souls » Fri Oct 21, 2016 11:35 am
Topid wrote:Ever-Wandering Souls wrote:
This may be silly, but - can you paste it into 50 cells, wait thirty seconds, and repeat? Rate limit is technically 50calls/30seconds, and if the formula is the same....
Still have to do it manually, but a easier than one at a time.
Oh really? Yeah that's doable. I've always heard them say 1 call per .6 seconds.
The Alicorns (Equestria) wrote:Let them stay, no need to badmouth them...From our view a bunch of nations just came in, seized the delegate position, and changed a few superficial things...we play NationStates differently...there's really no reason for us to be butthurt.
http://www.nationstates.net/page=rmb/postid=8944227
http://www.nationstates.net/page=rmb/postid=8951258
Reploid Productions wrote:Raiders are endlessly creative
by Agadar » Sat Oct 22, 2016 12:15 pm
by The Irinixian Protectorate » Sun Oct 23, 2016 10:48 am
by Roavin » Sun Oct 23, 2016 5:50 pm
Agadar wrote:I'm having trouble loading the data from the nations dump XML file into a hierarchy of maps and collections in Java. It seems to take forever. If anyone has any tips for me that they feel like sharing, then that would be swell.
Using JAXB, it still takes quite long to parse the nations dump file, but not nearly as long as when using my own code that doesn't rely on external libraries. However, JAXB demands I feed it custom classes to parse the dump file to, which I no longer want because that makes maintaining my Java API wrapper a nightmare as I have to update those custom classes every time the NS API is updated.
by Agadar » Sun Oct 23, 2016 6:21 pm
Roavin wrote:Agadar wrote:I'm having trouble loading the data from the nations dump XML file into a hierarchy of maps and collections in Java. It seems to take forever. If anyone has any tips for me that they feel like sharing, then that would be swell.
Using JAXB, it still takes quite long to parse the nations dump file, but not nearly as long as when using my own code that doesn't rely on external libraries. However, JAXB demands I feed it custom classes to parse the dump file to, which I no longer want because that makes maintaining my Java API wrapper a nightmare as I have to update those custom classes every time the NS API is updated.
Not sure what options are available in Java, but you want to use a different kind of XML Parser. For example, in PHP you can use DOMDocument, which reads an entire XML file and builds a full representation in memory. For the giant nation dump files, that will obviously take a long time. Alternatively, you can use XMLReader, which does not build a full representation in memory but rather is just a tool to step through all the elements in an XML file. That will, obviously, be much faster.
There's surely such a XML parser available in Java too.
by Eluvatar » Sun Oct 23, 2016 7:18 pm
The Irinixian Protectorate wrote:Can I make a request that the Happenings data have a <Nation> and/or <NationID> element added so that the data retrived from a happenings request can be easily sorted via xml tags. Also, this would remove the need for developers to parse the @@nation name@@ out of the text data of the item when it's received, since that would no longer be necessary.
Thanks,
Irinix, Supreme Queen of Irinixia
by Agadar » Sun Oct 23, 2016 7:22 pm
Eluvatar wrote:Don't return a map, return an iterator.
by Eluvatar » Mon Oct 24, 2016 7:47 am
by Agadar » Fri Oct 28, 2016 8:12 am
Eluvatar wrote:I was suggesting that parseNationsDump() should not return some object implementing Map<NationData> but some object implementing Iterator<NationData>.
Looking more closely at what you're doing, however, I'm surprised that your XMLStreamReader can construct a single map as quickly as you say. How long is it taking, exactly?
There's nothing inherently friendlier about dump["Agadar"]["ANIMAL"] than dump["NATIONS.NATION#Agadar.ANIMAL"]. Certainly it'd be easy enough to make a wrapper that converts the first into the second. What I'd ask is what the performance of doing the necessary fetches from your larger map is.
In my experience, any method of actually parsing the xml dumps is going to be painfully slow, but stream parsing is orders of magnitude faster than parsing into a full tree. (The fastest solution I've found is using grep | sed or rg --replace.)
by Eluvatar » Fri Oct 28, 2016 11:17 am
by Greater Tern » Sat Oct 29, 2016 7:22 am
by Greater Tern » Sun Nov 06, 2016 12:05 pm
Greater Tern wrote:Bug report: for the current SC resolution, the "REPEALS_COUNCILD" field isn't being returned. It should return "207" -- pointing to the SC resolution being repealed.
by HMS Unicorn » Sun Nov 06, 2016 12:42 pm
Advertisement
Users browsing this forum: Knights of LUSITANIA, La Xinga, Micro Gettysburg, Montandi-Cisalpina, Pauriun, Pygania, Sicias, The Endless Eventide, The Micro Union
Advertisement