Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I'm attempting to use the heroku.api. because the heroku gem has been depreciated.
What I've found is a convoluted dogs breakfast.
Get the api gem, validate the key on one site, use a curl command on another site. Then call the methods..
My app is running on heroku. I suspect it knows this.. Why make me jump through hoops to us something on their system designed by them/for them.
Anyway..
Does anyone know of a tutorial on how to do something with this API? Like getting the stack I'm on (in code) or getting the number of workers/dyno's I've got running? Really anything that works... just so I can see how to get it working
OK, so first thing: the heroku gem is deprecated, but the heroku toolbelt works in a nearly identical fashion. There's no NEED to transition to direct API calls unless you were doing that programmatically in your application. If you were doing that, read on:
Use the heroku-api wrapper.
gem install heroku-api
Get your API_KEY from https://dashboard.heroku.com/account
If you want to get the stack of the app named "your-app-here"
require 'heroku-api'
heroku = Heroku::API.new(:api_key => YOUR_API_KEY)
puts heroku.get_app('your-app-here').body["stack"]
Or tell how many processes you currently have:
total_processes = heroku.get_ps('your-app-here').body.count
Scale to 2 web processes:
heroku.post_ps_scale('your-app-here', 'web', '2')
All the info you need: https://github.com/heroku/heroku.rb
Maybe I misunderstood what you are trying to do, but I did the following based on their documentation.
curl -H "Accept: application/json" -u :SECRET -X GET https://api.heroku.com/apps
https://api-docs.heroku.com/apps
This will return a json object:
[
{
"id": 000000,
"name": "example",
"create_status": "complete",
"created_at": "2011/01/01 00:00:00 -0700",
"stack": "bamboo-ree-1.8.7",
"requested_stack": null,
"repo_migrate_status": "complete",
"slug_size": 1000000,
"repo_size": 1000000,
"dynos": 1,
"workers": 0
}
]
Related
I am trying to get some basic information from the Steam Community via the steam-condenser gem and so far the Steam.new seems to work just fine with all the players information.
however when I do this (example)
player = SteamId.new("tiger")
stats = player.fetch_games
I get the following error message
Traceback (most recent call last):
1: from lib/assets/ruby/test.rb:15:in `<main>'
/home/zigs/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/steam-condenser-1.3.11/lib/steam/community/steam_id.rb:326:in `fetch_games': undefined method `[]' for nil:NilClass (NoMethodError)
A lot of the information I need seems to be connected to the fetch_games (for example the method total_playtime(id))
Not sure why this is not working. I am lost. Any help or ideas are highly appreciated! Thank you!
TLDR; it looks like this gem no longer works.
the particular module that you're having trouble with is:
def fetch_games
games_data = parse "#{base_url}/games?xml=1"
#games = {}
#recent_playtimes = {}
#total_playtimes = {}
games_data['games']['game'].each do |game_data|
app_id = game_data['appID'].to_i
#games[app_id] = SteamGame.new app_id, game_data
recent = game_data['hoursLast2Weeks'].to_f
total = (game_data['hoursOnRecord'] || '').delete(',').to_f
#recent_playtimes[app_id] = (recent * 60).to_i
#total_playtimes[app_id] = (total * 60).to_i
end
true
end
with the particular problem statement being games_data['games']['game'].each
If we were looking to get information for a particular user, it downloads an XML document about the user from a URL looking like:
http://steamcommunity.com/id/demomenz?xml=1
and this file does not seem to contain any games objects in it.
Having looked at the codebase for the steam-condenser gem; it hasn't really been updated in about 6 years. I can only assume that the XML format has been modified since this time and that the gem will no longer work.
Valve has added more privacy options to Steam Community profiles which are not reflected in the old XML APIs.
Apparently, the profile in question (tiger) has it‘s game details set to “Friends Only” or ”Private” as games are also unavailable in the browser.
The code from the released 1.x versions is no longer guaranteed to work when it comes to Steam Community. Valve deprecated the old XML APIs several years ago. Sadly, the modern Web API hasn‘t gotten much attention from Valve‘s side either. So development of Steam Condenser has mostly come to halt, too.
You might have more luck using the code from the master branch of the GitHub repository which uses Web API for most of the Community features.
You will have to register for a Steam Web API key, though: https://steamcommunity.com/dev/apikey
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
Why does
<?php
echo "HELLO WORLD 1"; // shows
error_reporting(E_ALL);
echo "HELLO WORLD 2"; // shows
print_r(mb_list_encodings()); // does not show
echo "HELLO WORLD 3"; // does not show
$result = mb_convert_encoding("apple", 'UTF-8');
echo "HELLO WORLD 4"; // does not show;
echo $result; // does not show;
// no error what so ever displayed.
?>
fail? What can make this function fail?
I have a PHP web page that runs code and halts at this line, and returns HTTP 500 error.
But I don't know why it fails. Any suggestion for where to check?
Update:
Error Log shows
PHP Fatal error: Call to undefined function mb_convert_encoding()
PHP Fatal error: Call to undefined function mb_convert_encoding()
That means mb_convert_encoding is not installed, because the MB extension is not installed on your version of PHP. How to install it depends on how you installed PHP. Mostly likely your operating system has a package manager (apt-get or such) that will allow you to install it quickly. Otherwise, see the manual.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
I need to make xml file which looks like this:
> <message xmlns="client"
> from="from_user" to="To_user"
> type="chat"><properties
> xmlns="#"http://software""><property><name>assetId</name><value
> type="string">5346879f73322e08db030000</value></property><property><name>status</name><value
> type="string">success</value></property><property><name>long</name><value
> type="double">22.3451</value></property>
> <property><name>lan</name><value type="double">3456</value></property>
> </properties></message>
I don't know how to do it. Could you help me?
Either create it in Notepad or learn XSD and generate it.
Check this
http://www.w3schools.com/xml/default.ASP
and when you are done, learn this:
http://www.w3schools.com/Schema/
you may Create it this way
NSString *str = [NSString stringWithString:#"<message xmlns=\"client\"from=\"from_user\" to=\"To_user\" type=\"chat\"><properties xmlns=\"#\"http://software\"\"><property><name>assetId</name><value type=\"string\">5346879f73322e08db030000</value></property><property><name>status</name><value type=\"string\">success</value></property><property><name>long</name><value type=\"double\">22.3451</value></property> <property><name>lan</name><value type=\"double\">3456</value></property> </properties></message>"];
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
i have stored procedure sp_1 in server_A .i am calling this SP from Server_B
the code is:exec Server_A.MyDb.dbo.SP_1 in the body of sp i have complicted logic in the final step I insert result to Table_A.
running sp take 10 minute and return 'command complete successfully' but tabe_A is Empty (must be filled).
i try to execute the body of script it work properly .and tble Fill as expect.
i do'nt know what is wrong...?
i try to execute sp_1 from Another server 'server_c' server_d it work fine.
problem is with server_B
i found the anwser the problem is with Remote Query Timeout set to 600 sec
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 months ago.
The community reviewed whether to reopen this question 3 months ago and left it closed:
Original close reason(s) were not resolved
Improve this question
How do I store data to be used for all the clients in my server? (like the messages of a chat)
The server that node.js allows you to build, is an application server, which means that state is preserved, between request, on the server side. The following snippet demonstrates this:
var sys = require('sys'),
http = require('http');
var number = 0;
http.createServer(function (req, res) {
console.log(req.method, req.url);
res.writeHead(200, {'Content-Type': 'text/html'});
res.write('<h1>Number is: ' + number + '</h1>');
res.end();
number++;
}).listen(8000);
sys.puts('Server running at http://127.0.0.1:8000/');
node-cache package is currently the best for key value store and it allows synchronous as well as async storage/retrieval/deletion of keys.
npm link
If you want more features have a look at redis-node-client
Or use a native node storage mechanism (written in node.js)
http://github.com/felixge/node-dirty