# Fix Wolfram demonstration project: world energy by Eugene Poberezkin?

GROUPS:
 Several years ago I stumbled on a terrific demonstration titled: World Energy: Electricity, Oil, and Gas. I developed a good lesson for my precalculus class utilizing the demonstration. My school does not have school license for mathematica, but my students can of course use the CDF player. When I tried to do the lesson this year, I found that the demonstration did not work for my students, but did for me. After a lot of chatting with Tech at Mathematica, we eventually discovered that I was running a lower version of Mathematica, that the newest version of mathematica had changed some code and that thisn demonstration needed an update. The team at mathematica said they would fix it, but a few weeks later they contacted me and said it was too more work than worth their time, and it is now left at that... so I am pretty desperate here, and know there is a low probability, but I am looking for someone who might know the creator of the demo, Eugene Poberezkin? Or thinks they could take a stab at trying to fix the demo? I have the old file to share, it is attached. I am a novice coder, it would take me forever to decipher the original code, much less fix it for the newest version of Mathematica!Thanks in advance. Matt Attachments:
1 year ago
13 Replies
 Did you try contacting Demonstrations Team via feedback button located at the bottom of Demonstrations web pages?
1 year ago
 Sam, yes I did, the final response is below (after this communication, a follow up email suggested posting here...):*Hello Matthew, Thank you for contacting Wolfram Technical Support. I just got feedback from our demonstration team. They spend some time but cannot see a quick enough way to debug. Since this demonstration is provided by an external user, we'd have to spend more time on it than it is worth. I apologize for the inconvenience.*
1 year ago
 The main issue with this looks to be the introduction of Quantity expressions in the results returned by CountryData. One quick-fix for this would be to turn off the Quantity wrapper in legacy data paclets via SetSystemOptions: SetSystemOptions["DataOptions" -> {"ReturnQuantities" -> False}]; Before evaluating the example. A more long-term solution would be to 'fix' the CountryData calls which are returning Quantities(such as CountryData[_,"Population"] by wrapping them in QuantityMagnitude: In[70]:= CountryData["France", "Population"] Out[70]= Quantity[64101308, "People"] In[71]:= QuantityMagnitude[CountryData["France", "Population"]] Out[71]= 64101308 
1 year ago
 Nick, thanks. If I add the QuantityMagnitude to all CountryData, will that fix everything? Also, I guess I need to upgrade to latest version of Mathematica to try this, I have 9.0.1, yikes
1 year ago
 If you don't have version 10, and want something that should work in both versions, you can probably do something like: CountryData[#, "Population"] /. q_Quantity :> QuantityMagnitude[q] and CountryData[#, EnergyTypes[[nrgN]] <> data] /. q_Quantity :> QuantityMagnitude[q] (which I think are the only two places that quantities are coming back) which will leave version 9 results as they are, as it only replaces the Quantity with it's magnitude if there is a quantity result.
1 year ago
 A fix has been found. This will be republished. Attachments:
1 year ago
 THANK YOU! Any idea when that will happen?
1 year ago
 Ed Pegg 1 Vote
1 year ago
 Unfortunately, the demonstration still has errors, e.g.
1 year ago
 What version of Mathematica are you running?
 In[1]:= \$Version Out[1]= "10.4.1 for Microsoft Windows (64-bit) (April 11, 2016)"