NationStates Jolt Archive


A new way to find regions?

Clonetopia
10-12-2003, 22:52
Currently regions are shown alphabetically. I think it would be good if we could see them in size order and/or creation date order.

Is this possible? (I don't mean a real-time search, I mean like a daily update)
Phoebos
10-12-2003, 22:59
Creation date is probably a no, as I've seen nothing to indicate that it's stored. Size (assume you mean number of nations) doesn't seem too far fetched an idea, however. I assume it's updated in realtime when nations leave/enter, so getting a list by size should just be a simple modification of the SQL query that generates the list. Alternatively, such a query could be added to the update cycle, and it could just dump a list as of the last update, though that would seem more complicated than doing it in realtime.

Assuming the sort by name is done in RT, and isn't another list, this really shouldn't be any more complex (assuming NS works in the way I'm thinking it does).

I like it... Salusa? Any comment on this?
Myrth
10-12-2003, 23:01
I asked this a while ago, and apparently it's not possible/easy to do because of the way the data is stored.
Emperor Matthuis
10-12-2003, 23:01
i like the idea!!!
10-12-2003, 23:47
i believe there is currently another region listing being made that contains only regions containing 35+ nations..... instead of showing the vast majority
SalusaSecondus
11-12-2003, 02:31
SQL query . . . (assuming NS works in the way I'm thinking it does).

It clearly does not work the way you think. We use a flat file system, making this quite difficult to do on the fly.

Queries? We don't need no stinkin' queries!

http://www.weirdozone.0catch.com/projects/nationstates/salusasecondus/salusasecondus2.jpg
SalusaSecondus
Tech Modling
PGP: 0x0604DF3E
Phoebos
11-12-2003, 02:51
Completely flat file? Seriously?

How'd you avoid getting mass repetition for things such as world factbook entries and banlists? Stick it in the first record and then ignore those fields for all subsequent ones?

:shock: Seriously, I'm flabberghasted. Although I can understand why this is therefore no way near as easy as it would have been.
SalusaSecondus
11-12-2003, 02:53
No, we have two (main) tables. One of regions, and one of nations. There is little to no unnecessary duplication.
Phoebos
11-12-2003, 03:02
We use a flat file system

Well, if you have more than one table it's not flat file, is it? :P Honestly, shocking me like that for no reason. It's just not nice.

So I would assume therefore that the number of nations for a given region is calculated on the fly by the datafeed and by the regional pages, rather than whenever a nation enters/leaves, as I had assumed?
SalusaSecondus
11-12-2003, 03:13
No. Our database is relational (though crudely sometimes) allowing us to keep track of things such as number of nations, etc. This we update whenever a nation joins or leaves a region.
Phoebos
11-12-2003, 03:26
So, to return to the original point, after that brief but interesting detour into the world of NS data-structure, why isn't it easy to do this? Surely you could simply execute something along the lines of

[code:1:8747cba9a0]
SELECT region_name, size
FROM tblRegions
ORDER BY size, region_name;
[/code:1:8747cba9a0]

and you'd get a lovely list of regions ordered by size. What's the fatal flaw I'm making here? Unless you tell me it's not an SQL based DB.

Apologies if I'm being a nuisance with all these questions. I'm an inquisitive type of chap, and it's generally my wont to ask until I'm told to shut up. So if I start getting annoying, please do so. :D
SalusaSecondus
11-12-2003, 08:31
No problem, but I repeat "Queries? We don't need no stinkin' queries!"

The DB is not SQL based and does not support SQL, thus, any query would have to examine each record individually. To the best of my knowledge there exists only one SQL DB of the data in the world, and that would be my own personal copy which I use for my more powerful data analysis (but is not attached to the server at all, and cannot be).
Phoebos
11-12-2003, 14:19
OK. Answer accepted (finally)
11-12-2003, 14:21
As far as my limited knowledge of this subject goes, I think queries would slow down the server even more :cry:

<----------------- Not a Moderator, just wanna help out.
CorinThe
The getting help section! (http://www.nationstates.net/cgi-bin/index.cgi/page=help) (for all your gaming problems)http://69.57.141.218/333/102/emo/xmastongue.gif
Pacific freedom force (http://s2.invisionfree.com/The_Pacific/)
http://home.t-online.de/home/kleinerFrosch/Weihnachten/nn-weihnachten-dorf.gif
All Cat Lovers
11-12-2003, 14:34
wow that is alot of "stuff" you have decorated with
11-12-2003, 14:42
wow that is alot of "stuff" you have decorated with

I am in the Cristmas mood 8)

<----------------- Not a Moderator, just wanna help out.
CorinThe
The getting help section! (http://www.nationstates.net/cgi-bin/index.cgi/page=help) (for all your gaming problems)http://69.57.141.218/333/102/emo/xmastongue.gif
Pacific freedom force (http://s2.invisionfree.com/The_Pacific/)
http://home.t-online.de/home/kleinerFrosch/Weihnachten/nn-weihnachten-dorf.gif
[violet]
11-12-2003, 15:12
In retrospect, it would have been much smarter to code this game to use a database. But it was meant to be a quirky little site that probably no-one would visit. Who woulda known?
DNS
11-12-2003, 15:33
]In retrospect, it would have been much smarter to code this game to use a database. But it was meant to be a quirky little site that probably no-one would visit. Who woulda known?

Well... you could always put up an out-of-order sticky for a week, turn of everyone related to the site email accounts, and recode the game. Granted, some people will be... annoyed. But if the game runs smoother, it'll be for the best.

Though if you could leave the forums up while your doing it, it would be appreciated.
Myrth
11-12-2003, 16:35
]In retrospect, it would have been much smarter to code this game to use a database. But it was meant to be a quirky little site that probably no-one would visit. Who woulda known?

Well... you could always put up an out-of-order sticky for a week, turn of everyone related to the site email accounts, and recode the game. Granted, some people will be... annoyed. But if the game runs smoother, it'll be for the best.

Though if you could leave the forums up while your doing it, it would be appreciated.

It took several months for NS1 to be completely finished... and that was by a professional software company.