NationStates Jolt Archive


Region Analyser

25-02-2004, 20:55
NSDemographics 1.0.0

http://www.safalra.com/software/nsdemographics/screenshot.jpg

NSDemographics 1.0.0 is now out:

http://www.safalra.com/software/nsdemographics/index.html

What is NSDemographics?

NSDemographics is a Java program that generates a range of useful data on NationStates regions. For example output see:

http://www.safalra.com/software/nsdemographics/england.html

Note that it requires the Java Runtime Environment (the actual JRE, not the browser plugin).
26-02-2004, 11:36
Holy crap....
Catholic Europe
26-02-2004, 11:45
Wow, cool! Although you did miss out 'psychotic dictatorship'.
26-02-2004, 12:08
Wow, cool! Although you did miss out 'psychotic dictatorship'.

No I didn't. It did have Free-Market Paradise misspelt, which is now fixed. As another demonstration, here are the statistics for The Rejected Realms:


The Rejected Realms Demographics
Generated by Safalra's NSDemographics.

The Rejected Realms contains 2065 nations (with a total population of 1298879 million people), of which 626 are UN members and 180 (28%) have endorsed the current delegate. The average tax rate is 45%.

Government types
Government type Frequency
Inoffensive Centrist Democracy 399
Father Knows Best State 232
Democratic Socialists 215
Iron Fist Consumerists 149
Compulsory Consumerist State 143
Left-Leaning College State 119
Capitalist Paradise 112
Corporate Police State 101
Psychotic Dictatorship 90
Corrupt Dictatorship 83
Scandinavian Liberal Paradise 62
New York Times Democracy 59
Liberal Democratic Socialists 48
Moralistic Democracy 45
Authoritarian Democracy 39
Capitalizt 33
Civil Rights Lovefest 22
Right-wing Utopia 18
Anarchy 16
Corporate Bordello 16
Libertarian Police State 15
Left-wing Utopia 14
Free Market Paradise 8
Iron Fist Socialists 8
Conservative Democracy 7
Tyranny by Majority 7
Benevolent Dictatorship 5
Mutant Dogs
26-02-2004, 12:14
WOW! You are awesome... can you teach me to be like you?
Texastambul
26-02-2004, 12:22
WOW! You are awesome... can you teach me to be like you?

:idea: always eat your veggies and never talkback to programming teachers
Catholic Europe
26-02-2004, 12:23
Ah, yes, now I see psychotic dictatorship.
Catholic Europe
26-02-2004, 12:23
Hey, could you do one for the 'middle east' region (where I reside).
Collaboration
26-02-2004, 13:20
Can you do my taxes?
The Most Glorious Hack
26-02-2004, 13:22
This is pretty neat. It would fit well in the Technical forum, too. Would you mind reposting there?

Or, if you prefer, I could move it.
Wicked Aartrijke
26-02-2004, 14:28
It looks great.
But it would be even better if you could just enter the region name and it would load automatically :P
Just a suggestion ;)
Safalra
26-02-2004, 15:41
This is pretty neat. It would fit well in the Technical forum, too. Would you mind reposting there?

Or, if you prefer, I could move it.

Moving it sounds like a good idea, as that forum has less traffic (I was worried the post would get lost in this forum - until I posted the first reply it was languishing on the third page...).

[PS I'm going to post using my Safalra nation in future. Use of The Safalran Lands is deprecated :)]
Kryozerkia
26-02-2004, 15:50
This is nifty...
Feliz
26-02-2004, 15:52
It's a very great useful tool, you've made here. But I don't know how tu use java things... :(
Safalra
26-02-2004, 15:53
Hey, could you do one for the 'middle east' region (where I reside).

Sure, here you go:

http://www.safalra.com/temporary/middle_east.html

By the way, I'm not about to start up a service doing these for everyone (there are almost 15000 regions), so people had better start looking for someone in their region who's willing to install the Java Runtime (hey, it's *only* a 40Mb download :shock:) to run it themselves.
Safalra
26-02-2004, 16:03
WOW! You are awesome... can you teach me to be like you?

:idea: always eat your veggies and never talkback to programming teachers

Vegetables? :shock: I always argued with my computing teachers at school (one of them was pretty stupid though, I don't know how she got the job...).

If anyone really wants to be a programming god (yeah, I'm joking, I'm not *that* arrogant...) then my advice would be to find a very old computer (something like a Vic20) and learn everything about it. I got my Vic20 in 1993 (when I 10), and it only cost £10. Ah, those were the days - 4 kilobytes of memory and a processor that couldn't even manage one megahertz... *eyes glaze over* And I still use an Amiga most of the time - 10 megabytes of RAM and a 14.2 megahertz processor. 8)
Collaboration
26-02-2004, 16:18
One of my favorite online cartoons, Sabrina Online, was commissioned by Amiga to show how versatile it could be. The whole strip has always been done using Amiga, and it looks pleanty sharp.
26-02-2004, 16:56
Very cool! You'd probably get a more grateful audience if you posted this in Gameplay and/or Technical though! :D
Vonners
26-02-2004, 17:02
WOW! You are awesome... can you teach me to be like you?

:idea: always eat your veggies and never talkback to programming teachers

Vegetables? :shock: I always argued with my computing teachers at school (one of them was pretty stupid though, I don't know how she got the job...).

If anyone really wants to be a programming god (yeah, I'm joking, I'm not *that* arrogant...) then my advice would be to find a very old computer (something like a Vic20) and learn everything about it. I got my Vic20 in 1993 (when I 10), and it only cost £10. Ah, those were the days - 4 kilobytes of memory and a processor that couldn't even manage one megahertz... *eyes glaze over* And I still use an Amiga most of the time - 10 megabytes of RAM and a 14.2 megahertz processor. 8)

That is probably the most sensible thing I have ever heard anyone say about learning software engineering!
Kwangistar
26-02-2004, 17:05
Go Capitalist Paradises!
Safalra
26-02-2004, 17:44
Very cool! You'd probably get a more grateful audience if you posted this in Gameplay and/or Technical though! :D

I posted it in Gameplay a day before posting it here, but it got no replies (which is why I then posted it here).

"The Most Glorious Hack" has offered to move the thread to technical, which I said sounded llike a good idea.
Safalra
26-02-2004, 17:53
One of my favorite online cartoons, Sabrina Online, was commissioned by Amiga to show how versatile it could be. The whole strip has always been done using Amiga, and it looks pleanty sharp.

I must confess, I only started reading Sabrina Online after that slightly dodgy Chistmas (1996?) picture on Aminet (well, I was 13 at the time)...

[a few minuites later] Ah, here it is: http://wuarchive.wustl.edu/~aminet/pix/eric/SheilaXmas.lha
26-02-2004, 17:54
Very cool! You'd probably get a more grateful audience if you posted this in Gameplay and/or Technical though! :D

I posted it in Gameplay a day before posting it here, but it got no replies (which is why I then posted it here).

"The Most Glorious Hack" has offered to move the thread to technical, which I said sounded llike a good idea.

Huh. Strange. Well, perhaps tech then. :wink:
26-02-2004, 17:54
I take it you wrote the source in Linux, because when I open it in windows using notepad it is unintelligible.
26-02-2004, 18:00
Here's my region: Click (http://www.bbfree.com/shadowrp/index.php?act=Attach&type=post&id=254)
Safalra
26-02-2004, 18:09
I take it you wrote the source in Linux, because when I open it in windows using notepad it is unintelligible.

Try using Wordpad instead (Notepad doesn't like Unix-style new lines). And yes, I did write it in Linux (I used the university's computers as they have a superfast internet connection, very useful in 'testing' :wink:)
Safalra
26-02-2004, 18:10
Here's my region: Click (http://www.bbfree.com/shadowrp/index.php?act=Attach&type=post&id=254)

Glad you got it working. I'll change it so it doesn't uses plurals when talking about a single nation ('of which 1 are UN members').
The Most Glorious Hack
27-02-2004, 09:33
*shove*
imported_White Lotus Eaters
27-02-2004, 10:30
Well, I followed the link here from "Gameplay" - very cool! Unfortunately I don't think we have any programmers here in Urbanites and I'm on a Mac with a dial-up connection so ... :(

White Lotus Eaters
UN Delegate, Urbanites (http://www.nationstates.net/cgi-bin/index.cgi/target=display_region/region=urbanites) Region
Safalra
27-02-2004, 13:04
I ran it this morning on The North Pacific region. It took two hours and downloaded 8500 files from the NationStates server. By the way, the program now displays the percentages of governments in each government type:


The North Pacific Demographics
Generated by Safalra's NSDemographics.

The North Pacific contains 8063 nations (with a total population of 2054835 million people), of which 1401 are UN members and 521 (37%) have endorsed the current delegate. The average tax rate is 37%.

Government types
Government type Frequency
Inoffensive Centrist Democracy 1770 (21%)
Democratic Socialists 1233 (15%)
Father Knows Best State 615 (7%)
Capitalist Paradise 406 (5%)
Left-Leaning College State 382 (4%)
Corrupt Dictatorship 381 (4%)
Iron Fist Consumerists 379 (4%)
New York Times Democracy 375 (4%)
Compulsory Consumerist State 337 (4%)
Scandinavian Liberal Paradise 327 (4%)
Corporate Police State 278 (3%)
Psychotic Dictatorship 272 (3%)
Liberal Democratic Socialists 245 (3%)
Moralistic Democracy 197 (2%)
Authoritarian Democracy 146 (1%)
Civil Rights Lovefest 109 (1%)
Capitalizt 103 (1%)
Left-wing Utopia 95 (1%)
Right-wing Utopia 78 (0%)
Corporate Bordello 68 (0%)
Anarchy 54 (0%)
Libertarian Police State 48 (0%)
Conservative Democracy 38 (0%)
Tyranny by Majority 32 (0%)
Iron Fist Socialists 29 (0%)
Free-Market Paradise 23 (0%)
Benevolent Dictatorship 18 (0%)
Emperor Matthuis
27-02-2004, 18:48
Very Neat
Naleth
28-02-2004, 11:32
*takes the kick in the right direction*

I spent a while playing with the code today and yesterday and here's what I've accomplished so far:

- Formatiing ... how can you write code with that little white space? :P
- More Object Oriented Design - classes for Nations and Regions
- New features for Nations:
* Grab's nation's pretitle (stored as a string)
* Grab's nation's endorsement list (stored as a linked list of strings, but you can get a copy as a String array if you want)
-New features for Regions:
* Uses the XML feed instead of the actual page to get the nation list * (although it doesn't work for the really big regoins that just return "--MANY--" .. I'll probably use the algorithm you made on those ones)
* Functions to check if a nation is in the region and seperate function to get an instance of the nation out of the region.
* Function to get a list of all nations a certain nation (specified by a string) has endorsed.
* Function to get the list of all nations in the region (as an array of nations)
- Stuff lost in the transfer:
* That handy dandy stat compiler (although you could still write a new one pretty easily) and corrisponding webpage output.

So far I've just used it with a command line console window, so it doesn't have a main function or a GUI or anything.
Safalra
28-02-2004, 15:11
I spent a while playing with the code today and yesterday and here's what I've accomplished so far:

- Formatiing ... how can you write code with that little white space? :P

That's more than I usually have - if people didn't complain I'd write programs all on one line... :twisted:

- More Object Oriented Design - classes for Nations and Regions

Yeah, I've been thinking of adding that.

- New features for Nations:
* Grab's nation's pretitle (stored as a string)
* Grab's nation's endorsement list (stored as a linked list of strings, but you can get a copy as a String array if you want)

Sounds good - I wonder what the most popular @@ANIMAL@@ is...

- New features for Regions:
* Uses the XML feed instead of the actual page to get the nation list * (although it doesn't work for the really big regoins that just return "--MANY--" .. I'll probably use the algorithm you made on those ones)

Hang on, there's an XML feed and I've been doing it the long-winded way? :oops: Where is this XML feed?

So far I've just used it with a command line console window, so it doesn't have a main function or a GUI or anything.

I will add a GUI (with nice progress bars etc), but I'm a little busy at the moment (I've got to get a draft of my dissertation written in the next fortnight). I'll see how much time I can spare.
Safalra
28-02-2004, 15:49
I though I'd also make the output customisable through templates, something like:

@@REGION@@ contains @@NUMBER_OF_NATIONS@@ nations with a total population of @@REGIONAL_POPULATION@@...

...as the default output looks rather boring (though the HTML does validate). I could do a template that makes it look like an entry in the CIA World Factbook, for example.
SalusaSecondus
28-02-2004, 18:44
The code looks decent (though I'm not actually endorsing it). I would like to request a few small changes though:

When loading region pages, please take a 5 second break for every 20 pages.
When loading nation pages, please take a 1 sec break for every 20 nations.


Not entirely sure how best to do this, but http://www.codeguru.com/java/articles/523.shtml looks like it might work.

http://www.weirdozone.0catch.com/projects/nationstates/salusasecondus/salusasecondus2.jpg
SalusaSecondus
Tech Modling
PGP: 0x0604DF3E
Safalra
28-02-2004, 20:17
The code looks decent (though I'm not actually endorsing it). I would like to request a few small changes though:

When loading region pages, please take a 5 second break for every 20 pages.
When loading nation pages, please take a 1 sec break for every 20 nations.



I'll use the standard Thread.sleep() method, though of course I can't stop impatient people changing the source code to get rid of it (they'd have to be really impatient though - at the moment it takes 2 hours to get through an 8000-nation region, and the breaks would only add another 7 minutes).
Naleth
28-02-2004, 21:52
I spent a while playing with the code today and yesterday and here's what I've accomplished so far:

- Formatiing ... how can you write code with that little white space? :P

That's more than I usually have - if people didn't complain I'd write programs all on one line... :twisted:
:shock: Scarry code

- New features for Regions:
* Uses the XML feed instead of the actual page to get the nation list * (although it doesn't work for the really big regoins that just return "--MANY--" .. I'll probably use the algorithm you made on those ones)

Hang on, there's an XML feed and I've been doing it the long-winded way? :oops: Where is this XML feed?
http://www.nationstates.net/cgi-bin/regiondata.cgi/region=[region_name]
Unfortunetly, for very large regions (I think its around 125 nations), the XML feed only returns "---MANY---" for the nation list, instead of the actuall list. Regions like the feeders and some of the larger player-created regions will still have to be done page-by-page.

There is a nation xml feed, too, (nationdata.cgi/nation=[nation_name]), but it doesn't have all the information I want maine to get (most notably the endorsement list), although it does have everything your script gets.

It's listed only listed in some news article in the archive, so its no wonder you missed it...


When loading region pages, please take a 5 second break for every 20 pages.

I'm gonna assume this doesn't apply when you get the info from the XML feed. :P
Arnarchotopia
28-02-2004, 22:28
This is very cool, thanks for this!!!! We have a couple of programmers in the Urbanites so hopefully we'll be able to make some use of it soon!:)

One more thing, how hard would it be to get this imbedded in a webpage so you could just type in the regions name and it'd give you the read out for it?
Safalra
28-02-2004, 22:36
Where is this XML feed?
http://www.nationstates.net/cgi-bin/regiondata.cgi/region=[region_name]
Unfortunetly, for very large regions (I think its around 125 nations), the XML feed only returns "---MANY---" for the nation list, instead of the actuall list. Regions like the feeders and some of the larger player-created regions will still have to be done page-by-page.

It's okay with England at 228 nations. I'm guessing the limit might be 256 ("if you're going to impose an arbitrary limit, make it a power of two and no-one will ask questions...").

There is a nation xml feed, too, (nationdata.cgi/nation=[nation_name]), but it doesn't have all the information I want maine to get (most notably the endorsement list), although it does have everything your script gets.

Hmm... I think I'm going to have to learn how to access XML with Java. [sighs at the thought of having to read Sun's oh-so-easy-to-understand tutorials...] In the meantime, I think I'll do a new modular version using the old data-extraction methods.
Safalra
28-02-2004, 22:40
One more thing, how hard would it be to get this imbedded in a webpage so you could just type in the regions name and it'd give you the read out for it?

Absolutely impossible. The Java security manager doesn't allow applets to make network connections outside of the domain the applet is on.

Unless... you could use Java Server Pages rather than an applet, but I don't know how you'd deal with timeouts, as it'd take a long time to run. That's outside of my area though (I use PHP for server-side scripting).
Spoffin
29-02-2004, 00:19
This is... really impressive.

I like the find how many UN nations in the region feature (actually, I'd really like if there was a way to do that simply), and although the rest is kinda trivia, its still very interesting.

What I'd really want something like this for is endorsement analysis, cos crunching those numbers manually takes ages and is prone to absurd errors. I've been reliably informed though by people who understand this kind of thing that its not possible.

Maybe I could ask Francos what script he uses...
Safalra
29-02-2004, 13:28
I'm sure endorsement analysis is possible. What information do you want the analysis to provide (nations ranked by endorsements received/given etc.?).
Arnarchotopia
29-02-2004, 18:11
One more thing, how hard would it be to get this imbedded in a webpage so you could just type in the regions name and it'd give you the read out for it?

Absolutely impossible. The Java security manager doesn't allow applets to make network connections outside of the domain the applet is on.

Unless... you could use Java Server Pages rather than an applet, but I don't know how you'd deal with timeouts, as it'd take a long time to run. That's outside of my area though (I use PHP for server-side scripting).

Yeah I just got a similar answer from someone who did the Urbanites one for us...http://pluricanal-gnd.com/gd000314/forum/urbanites.htm

Another question would it be possible to do the same for last govenment activity? So we could have a list of nations and when they were last active plus a read given the average level of regional activity?
Safalra
29-02-2004, 20:20
Another question would it be possible to do the same for last govenment activity? So we could have a list of nations and when they were last active plus a read given the average level of regional activity?

Sure, I'll add it to my to-do list. Expect the new version of the program, tentatively named 'NSDemographics 1.0.0' to be out Any Time Now (okay, it'll probably take a week, I'm really busy with my dissertation right now). The new version will extract the following nation details (basically, everything):


pretitle
name
motto
UN category
civil rights
economy
political freedoms
location
un member
un delegate
population
income tax
national animal
currency
endorsements
most recent activity


It won't extract the primary industry, as the Mods want me to minimise server requests, and primary industry can only (easily) be extracted from the XML (whereas the endorsements list can only be extracted from the HTML)...
Safalra
29-02-2004, 22:28
It won't extract the primary industry, as the Mods want me to minimise server requests, and primary industry can only (easily) be extracted from the XML (whereas the endorsements list can only be extracted from the HTML)...

Actually, I've changed my mind. The XML file is smaller so puts less load on the server, and in general only the endorsement list of the UN delegate is required - I can add an option to download endorsements lists for all nations, if this is wanted (though detailed endorsement analysis hasn't been written into the program yet...).
Spoffin
29-02-2004, 23:43
I'm sure endorsement analysis is possible. What information do you want the analysis to provide (nations ranked by endorsements received/given etc.?).Nations ranked by endorsements they have and when they were last active.
Safalra
01-03-2004, 11:02
I'm sure endorsement analysis is possible. What information do you want the analysis to provide (nations ranked by endorsements received/given etc.?).Nations ranked by endorsements they have and when they were last active.

Okay, I can do that. It'll be off by default though, for the reasons given in my post above.
1 Infinite Loop
01-03-2004, 12:23
the site and the forums are already soo buggy and unstable do we really want something like Java attacking the site?
Java is so buggy and unstable, all it is good for is popup ads and crashing browsers.
Safalra
01-03-2004, 14:19
Java is so buggy and unstable, all it is good for is popup ads and crashing browsers.

Like many people, you seem to think that Java is only used for applets. I suggest you do some research before posting such nonsense.

(Incidentally, has anyone using the Java Plugin ever had it crash? In the days when browsers contained their own implementations of Java, they were unreliable, but those days are gone now, and besides that was the browser vendor's fault and not Java's. In fact, because of the security manager and strong type system, Java is one of the safest programming languages.)
Safalra
03-03-2004, 12:13
Files for the next version are starting to be available (as I write them...) at:

http://www.safalra.com/software/nsdemographics/index.html
Naleth
05-03-2004, 08:07
A recomendation if you haven't yet:
Instead of exiting the program when it fails to index a nation, make it retry. It's not fun to be near the end of a large region and then it fails one and you hae to start over :P
Safalra
05-03-2004, 11:27
A recomendation if you haven't yet:
Instead of exiting the program when it fails to index a nation, make it retry. It's not fun to be near the end of a large region and then it fails one and you hae to start over :P

In the new version I'm working on, there are Nation and Region classes that are serialisable. If an error occurs partway through downloading nation details, it saves the partially complete region to disk, and gives you the opportunity to continue when you next load the program.
09-03-2004, 07:10
can't get it to work on my computer
Naleth
09-03-2004, 11:08
can't get it to work on my computer
First step: do you have a Java compiler and the Java SDK? Both of these are required to use the source code...

Also, taking a look at the code Salfra has up there, you are going to need some basic knowledge of java to use it. All he has is the Nation class, which pulls down the information from the server and stores it. I'd assume eventually he'll implement this into a larger program.
(a lot more comments this time, but still no whitespace :P thank goodness for color-coded compilers)
09-03-2004, 16:15
can't get it to work on my computer
First step: do you have a Java compiler and the Java SDK? Both of these are required to use the source code...

Also, taking a look at the code Salfra has up there, you are going to need some basic knowledge of java to use it. All he has is the Nation class, which pulls down the information from the server and stores it. I'd assume eventually he'll implement this into a larger program.
(a lot more comments this time, but still no whitespace :P thank goodness for color-coded compilers)

Where do I get Java Compiler and Java SDK?
I downloaded the runtime environment.
And, I don't know anything about Java.
NuMetal
09-03-2004, 16:21
http://java.com/en/index.jsp
09-03-2004, 16:41
Found the SDK but which compiler do I need?
Arnarchotopia
09-03-2004, 18:19
Anyone know of a good guide on how to use these things?
NuMetal
09-03-2004, 19:07
Just try everything until it works :D
Naleth
10-03-2004, 00:39
JCreator (http://www.jcreator.com/download.htm) is a pretty nice Java Compiler that I use sometimes.

DrJava (http://drjava.sourceforge.net/) is another one I use, I like the comand-line interface for testing stuff out.
Safalra
11-03-2004, 16:52
After being linuxless for a few days, I'm now working on the program again. It should be ready by tomorrow (though by the time the forum accepts this message, it'll probably be today...).

I'll do some documentation too, though that'll take another few days.
UncleBob
12-03-2004, 02:53
I keep getting the message:
fatal exception occurred. program will exit.
12-03-2004, 19:02
I keep getting the message:
fatal exception occurred. program will exit.

I've just finished the new one. Try that and post again if you still get errors.
UncleBob
13-03-2004, 09:09
I keep getting the message:
fatal exception occurred. program will exit.

I've just finished the new one. Try that and post again if you still get errors.k, I opened it with JCreator but how do I get the program itself to work? Is there supposed to be a button or something?
UncleBob
13-03-2004, 09:18
I got as far the black screen where it says press any key to continue.
What do I do from here?
Naleth
13-03-2004, 10:51
Well, off the top let me say DrJava is probably the simpler program to use... Quick instructions for that incase:
1) unextract everything (assuming thats done, though)
2) open dr java, then open all the files.
3) hit the "compile all" button in the top right corner.
4) click on the "NSDemographics" and press "F2" or choose "Run Main Method" from the "tools" menu.

For JCreator:
1) Make a new project (File>New>Project>Basic Java Application)
2) name it whatever you want, make sure to set the directory path to something you'll remember.
3) Add all the files to the project by either choosing "add files" from the "project" menu, or by right clicking in the "file view" subwindow and choosing "Add>Add Existing Files"
4) Push the "Compile All" button (small window with a down arrow next to it) on the bottom of the menu bars, near the right end.
5) Push the "Execute project" button next to it (two blue gears).

To actually use the program is pretty simple. After you execute it, it'll pop up a window asking "What region do you want to analyze?" then when you tell it, it'll ask you if you want to pull the full endorsement lists or just some. It has some status bars (very nice looking, but maybe you could add the name of the nation whos info is being downloaded to the list, just for curiosities sake), and when it's done it'll ask you for a DIRECTORY to save the info to. It has to be given the name of an existing directory, it won't make a new one (I made this mistake two or three times before I got it right). It'll create two html dos in the directory (at least it will when you pull the full endorsement lists) - [regionname].html, which contains quite a few interesting facts about the region, and [regionname]_un.html, which contains the endorsement counts of all UN nations in the region (any chance you can add the lists, too? I did some coding to get the list out while I was playing around with the source). Open those to see the information about the region.
Safalra
13-03-2004, 14:45
I'll do some proper documentation by 21st March. It'll explain everything in great detail, but will be SDK-oriented (who needs a fancy IDE?). In the mean time, there's a thread in the England region forum explaining how to use it to one of our members (he's a Windows user though, but presumably Linux users already know how to use a command line).
Safalra
28-03-2004, 11:37
The documentation is now on the site (it was a week ago, but I couldn't get on these forums to say so...).
28-03-2004, 16:47
Yea! GNU public licence!
28-03-2004, 16:54
How do I run it?
Naleth
28-03-2004, 19:36
Look at my last couple posts for how to run it from the source. Not sure how to from the .class files :?
Safalra
19-04-2004, 11:56
A few people have e-mailed me saying they're getting NullPointerExceptions. I'm not sure what's causing this but I think the program doesn't always handle timeouts correctly. I'll try to find out what's happening.
DarkSith Mars Colony
19-04-2004, 13:39
TAG.

It seems useful.
Safalra
20-04-2004, 15:25
Ah-ha. The region control XML page has been removed. I'm going to have to rewrite part of the program, and it'll no longer be able to produce a list of banned nations or tell you whether the delegate can access region control. Damn you, Max Barry! :x

To a Mod: I don't suppose you could chnage ownership of the first message in this thread, as my The Safalran Lands nation is now dead?
Myrth
20-04-2004, 15:55
Ah-ha. The region control XML page has been removed. I'm going to have to rewrite part of the program, and it'll no longer be able to produce a list of banned nations or tell you whether the delegate can access region control. Damn you, Max Barry! :x

To a Mod: I don't suppose you could chnage ownership of the first message in this thread, as my The Safalran Lands nation is now dead?

It won't let me do that because PHPBB doesn't allow guests to post with the same username as a member.

You do know you can have your original nation resurrected, yes? Your postcount will be reset to 0 and all posts before it died will be marked as ex-nation posts still.
Naleth
21-04-2004, 03:59
You do know you can have your original nation resurrected, yes? Your postcount will be reset to 0 and all posts before it died will be marked as ex-nation posts still.
I think he didn't want the nation anymore (since he officially depricated it .. somewhere, possibly in this thread .. anyway I saw it somewhere).
Safalra
21-04-2004, 13:17
To a Mod: I don't suppose you could chnage ownership of the first message in this thread, as my The Safalran Lands nation is now dead?

It won't let me do that because PHPBB doesn't allow guests to post with the same username as a member.

You do know you can have your original nation resurrected, yes? Your postcount will be reset to 0 and all posts before it died will be marked as ex-nation posts still.

So I still wouldn't be able to edit my old posts? No point having it resurrected then...

I suppose it doesn't really matter, the links will still point to the newest version of the program, even if the post is out of date.
Safalra
03-05-2004, 14:27
It's all fixed now for version 1.1.0, and working nicely. Sorry it took so long to get rid of that pesky NullPointerException, but I had a dissertation to write...
Spoffin
03-05-2004, 16:12
ARGH!!! HOW DO I WORK THIS THING??!!

*quietly*
I don't understand
The Angry Junkies
03-05-2004, 16:19
Using a program to work nationstates is ridiculous. I created my Psychotic Dictatorship all by myself, and I'm proud of it. If clicking five boxes and creating a name is beyond you, I'm sure theres some Sesame Street on for you.
Spoffin
03-05-2004, 16:41
Using a program to work nationstates is ridiculous. I created my Psychotic Dictatorship all by myself, and I'm proud of it. If clicking five boxes and creating a name is beyond you, I'm sure theres some Sesame Street on for you. :roll: You're not aware what this program does then, clearly
The Angry Junkies
03-05-2004, 16:43
Using a program to work nationstates is ridiculous. I created my Psychotic Dictatorship all by myself, and I'm proud of it. If clicking five boxes and creating a name is beyond you, I'm sure theres some Sesame Street on for you. :roll: You're not aware what this program does then, clearly
clearly.
Spoffin
03-05-2004, 16:52
Using a program to work nationstates is ridiculous. I created my Psychotic Dictatorship all by myself, and I'm proud of it. If clicking five boxes and creating a name is beyond you, I'm sure theres some Sesame Street on for you. :roll: You're not aware what this program does then, clearly
clearly.It analyses regions. It gives info about the spread of the different types of nation in the region. It gives an average tax rate and average civil rights, economy and political freedoms throughout the region. It shows in one glance how many endorsements people in the region have. It is a work of genius, and I would trade my NationStates Portal in for it, if I COULD JUST FIGURE OUT HOW TO GET THE DAMN THING TO WORK!!
The Angry Junkies
03-05-2004, 16:54
Using a program to work nationstates is ridiculous. I created my Psychotic Dictatorship all by myself, and I'm proud of it. If clicking five boxes and creating a name is beyond you, I'm sure theres some Sesame Street on for you. :roll: You're not aware what this program does then, clearly
clearly.It analyses regions. It gives info about the spread of the different types of nation in the region. It gives an average tax rate and average civil rights, economy and political freedoms throughout the region. It shows in one glance how many endorsements people in the region have. It is a work of genius, and I would trade my NationStates Portal in for it, if I COULD JUST FIGURE OUT HOW TO GET THE DAMN THING TO WORK!!
did you try using your eyes?
Spoffin
03-05-2004, 17:01
Using a program to work nationstates is ridiculous. I created my Psychotic Dictatorship all by myself, and I'm proud of it. If clicking five boxes and creating a name is beyond you, I'm sure theres some Sesame Street on for you. :roll: You're not aware what this program does then, clearly
clearly.It analyses regions. It gives info about the spread of the different types of nation in the region. It gives an average tax rate and average civil rights, economy and political freedoms throughout the region. It shows in one glance how many endorsements people in the region have. It is a work of genius, and I would trade my NationStates Portal in for it, if I COULD JUST FIGURE OUT HOW TO GET THE DAMN THING TO WORK!!
did you try using your eyes?No, I smelt it and got discouraged.
The Angry Junkies
03-05-2004, 17:08
Using a program to work nationstates is ridiculous. I created my Psychotic Dictatorship all by myself, and I'm proud of it. If clicking five boxes and creating a name is beyond you, I'm sure theres some Sesame Street on for you. :roll: You're not aware what this program does then, clearly
clearly.It analyses regions. It gives info about the spread of the different types of nation in the region. It gives an average tax rate and average civil rights, economy and political freedoms throughout the region. It shows in one glance how many endorsements people in the region have. It is a work of genius, and I would trade my NationStates Portal in for it, if I COULD JUST FIGURE OUT HOW TO GET THE DAMN THING TO WORK!!
did you try using your eyes?No, I smelt it and got discouraged.
smell is closest connected to memory, you must be onto something
Sirocco
03-05-2004, 17:19
I tried to make it work on my computer, but the instructions were gobbledygook to me. :(
Safalra
03-05-2004, 17:37
It is a work of genius,

Thanks. :D

and I would trade my NationStates Portal in for it, if I COULD JUST FIGURE OUT HOW TO GET THE DAMN THING TO WORK!!

Did you read the user documentation?

http://www.safalra.com/software/nsdemographics/documentation.html

Tell me where you're having problems.
imported_Blackbird
04-05-2004, 04:38
Sweetness. It works now! Or at least, I'm running it now and it got past the part where it was bad before!
imported_Blackbird
04-05-2004, 04:56
It still doesn't work.


I tried the region "England". Once everything is done dling, it asks me (Mac OS X.3 btw) where to save. I save it as "Test" or any other name and it says my output could not be saved.
Attitude 910
04-05-2004, 05:58
How long does it normally take to analyze a region if you have 56.6 kbs dial up internet?
Safalra
04-05-2004, 10:21
It still doesn't work.

I tried the region "England". Once everything is done dling, it asks me (Mac OS X.3 btw) where to save. I save it as "Test" or any other name and it says my output could not be saved.

It does say in the documentation that you have to select a *directory* in which to save it. You can create a new directory with the buttons at the top of the requestor (well, I guess that's where they'll be - I haven't used MacOS recently), but don't type one in the file name box. It'll then create files in the directory called england.html and england_un.html.
Safalra
04-05-2004, 10:34
How long does it normally take to analyze a region if you have 56.6 kbs dial up internet?

It's proportional to the size of the region obviously, but it'll probably take ages (I haven't run on my dialup connection, just on the university's broadband connection). Who are you planning to invade now? :wink:
Naleth
04-05-2004, 11:09
How long does it normally take to analyze a region if you have 56.6 kbs dial up internet?
Approx. the same amount of time it would take you to load all the XML feeds and the Del's spotlight ... since that's what it does.
Spoffin
04-05-2004, 17:06
It is a work of genius,

Thanks. :D

and I would trade my NationStates Portal in for it, if I COULD JUST FIGURE OUT HOW TO GET THE DAMN THING TO WORK!!

Did you read the user documentation?

http://www.safalra.com/software/nsdemographics/documentation.html

Tell me where you're having problems.Well my basic problem is I don't know anything about computers.

I downloaded your thing. I downloaded (I think) the Java thing you suggested. I can get to the MSDOS thing, but I don't know what to type there. I opened the Java thing I downloaded, but there are no instructions or anything for it, and I don't know what its supposed to do and I don't know what it would look like even if I was doing it right.

Other than that, I'm fine.
Safalra
04-05-2004, 20:00
Okay Spoffin, I'm not sure if you've actually installed Java, so in the MSDOS thing, type

set classpath

press enter, and tell me what it says (it'll probably say 'Environment variable classpath not defined' if you haven't installed Java). Also in the MSDOS thing, type

path

press enter, and tell me if it contains the word 'java' anywhere in the response (it'll say something like PATH=C:\WIN\system32;C:\WIN and so on).
Spoffin
04-05-2004, 20:31
Okay Spoffin, I'm not sure if you've actually installed Java, so in the MSDOS thing, type

set classpath

press enter, and tell me what it says (it'll probably say 'Environment variable classpath not defined' if you haven't installed Java). Also in the MSDOS thing, type

path

press enter, and tell me if it contains the word 'java' anywhere in the response (it'll say something like PATH=C:\WIN\system32;C:\WIN and so on).'Environment variable classpath not defined'

It doesn't say Java anywhere in the response.
Safalra
05-05-2004, 12:18
Okay Spoffin, you'll need to install Java first. Sun have changed their download page, so I'm not sure you've downloaded the right thing. So go to:

http://java.sun.com/j2se/1.4.2/download.html

Click on the link "Download J2SE SDK" halfway down the page. Accept the licence agreement (reading it first if you're paranoid). Then you want the link called:

"Windows Offline Installation, Multi-language (j2sdk-1_4_2_04-windows-i586-p.exe, 49.36 MB)"

Once that's downloaded it double click on the file and it should be easy to install - post again if it asks you any questions you don't know that answer to (I can't remember what it asks - it's been ages since I've installed Java).
Attitude 910
05-05-2004, 15:59
How long does it normally take to analyze a region if you have 56.6 kbs dial up internet?

It's proportional to the size of the region obviously, but it'll probably take ages (I haven't run on my dialup connection, just on the university's broadband connection). Who are you planning to invade now? :wink:


Thanks,

And If only you saw my large list of targets to invade. :twisted:
imported_Blackbird
05-05-2004, 23:26
It still doesn't work.

I tried the region "England". Once everything is done dling, it asks me (Mac OS X.3 btw) where to save. I save it as "Test" or any other name and it says my output could not be saved.

It does say in the documentation that you have to select a *directory* in which to save it. You can create a new directory with the buttons at the top of the requestor (well, I guess that's where they'll be - I haven't used MacOS recently), but don't type one in the file name box. It'll then create files in the directory called england.html and england_un.html.

It still doesn't work. If I leave the text in the name of the file, it won't save it. I create a folder, and select it. With nothing in the file name box, the "save" button, remains grayed out.
Naleth
06-05-2004, 07:37
Some screenies that'll probably be helpful:

http://members.cox.net/img-host/NSDemo_1.1.0_Tut/01.jpg

The command prompt screen. It's case sensitive, it'll give you a big ol' exception if you don't type it right.

http://members.cox.net/img-host/NSDemo_1.1.0_Tut/05.jpg

The final save screen. You have to select a pre-existing folder to save in, otherwise it's an error. Also, make sure you have the whole folder path typed in the text box.

(Sorry I can't put a pic-warning somewhere visible for this)
Unfree People
06-05-2004, 21:09
I finally got around to trying this and dang, it's cool. ...when it works. I got it to do two regions (one with 77 nations and one with 10) just fine and I have the lovely .html files to prove it, but when I tried to run it a second time to analyze "East Pacific", it died on me.

It says:

[code:1:fc4f20a9b4]C:\newfolder>java safalra.nsdemographics.NSDemographics
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 10
at safalra.nsdemographics.Nation.searchArray<Nation.java:1138>
at safalra.nsdemographics.Nation.<init><Nation.java:1083>
at safalra.nsdemographics.Region.downloadNationDetails<Region.java:278>
at safalra.nsdemographics.NSDemographics.main<NSDemographics.java:138>[/code:1:fc4f20a9b4]

This means less than nothing to me as I don't know a thing about Java... *shrugs helplessly*
Goobergunchia
07-05-2004, 00:22
Too lazy to look at the specific code right now, but an ArrayIndexOutOfBoundsException means that the program's trying to read an item in an array that's beyond the boundaries of an array (arrays in Java cannot be expanded or contracted once created).
Safalra
07-05-2004, 11:37
This means I've spelt something wrong and the searchArray procedure runs off the end of the array (or Max has changed the NationStates code again). Once I've tracked down the error this time, I'll alter that procedure so that it outputs what it was searching for, making it easier to correct the program in future.

The fact the the error-causing index was ten means that the problem was in the PRIORITY_VALUE array.
Safalra
07-05-2004, 14:29
The problem occurs when the government 'has no policy direction whatsoever'. I'm not sure what the best way to handle this is - probably to introduce a category called NO_PRIORITY and tell the output program to ignore this case.
Naleth
07-05-2004, 21:14
Also, if you don't already, make sure there is a similar system in place to handle nations with no major industry.
imported_Blackbird
08-05-2004, 03:08
Safalra...

Any suggestions on us poor mac people (UNIX might I add) who for some reason, the program prompts us to give a name to the directory in order to save the directory?
Rotovia
08-05-2004, 03:16
Meh.
Naleth
08-05-2004, 10:34
Safalra...

Any suggestions on us poor mac people (UNIX might I add) who for some reason, the program prompts us to give a name to the directory in order to save the directory?
Is it somehow different on the mac from the screenshot I posted above?
Safalra
09-05-2004, 16:17
Okay, for the next version (which I'll do after I've handed in my dissertation in the coming days):

1) Handling of nations with no policy direction
2) Handling of nations with no major industry
3) A better directory requestor that people can understand
imported_Blackbird
11-05-2004, 06:29
Yes, the mac screen shot is different.

It pops up a file save screen and asks to input a name, as if you are saving a file. Obviously, entering anything gets an error, but not entering anything can't be done either, b/c the program treats it like a file and you can't save a file with no title.
Safalra
22-05-2004, 16:23
I'll fix the problems when 1) we've moved to jolt and 2) my finals are over. Sorry to keep you waiting.
imported_Blackbird
22-05-2004, 19:16
Quite alright. I've lived over a year and a half without, and I'll wait another for it if needed.
Promise of Joshua
29-05-2004, 01:52
bump for ease of later finding
The Peoples of Abraham
16-06-2004, 16:41
TAG excellent program. I was able to run it on my region with no problem. Can't wait for the update
Andolai
19-06-2004, 08:41
Good...I so want the current stats on Ille de France.

Oh, and I am in utter awe *Sacrifices ten comely lasses of virtue true*
Unstoppable Cartoons
19-06-2004, 10:06
Andolai, see the ille de france forum