Tag Archives: variables

Flask not reading environment variables with supervisor, gunicorn and nginx

Questions: I’m trying to deploy a flask app to my Cent OS server but I think it can’t read the environment variables that are being set by supervisor. Here’s my supervisor conf for the flask app [program:philms] environment=PHILMS_SECRET=”supersecretkey”,PHILMS_API_SECRET=”shmickles” command = gunicorn philms.app:create_app\(\) -b 0.0.0.0:5000 directory = /sites/philms user = wilson I’ve tried setting the variables… Read More »

Nginx server variables

Questions: I’ve tried to find an example of the issue I’m facing but failed so far, so apologies if it’s already been answered. Within an nginx config (could include lua, i’ve tried both), I want to be able to access a variable across multiple locations within the same server. That said, I want to be… Read More »

The brute force method using VBA for solving an equation with nine unknown variables

Questions: This equation: a+(13*b/c)+d+(12*e)-f+(g*h/i)=87 appears when trying to solve the maths puzzle for Vietnamese eight-year-olds that recently became viral all over the Internet. In mathematics, such an equation is called an underdetermined system. Of course it has more than one solution and the brute force method seems to be the easiest way to find all… Read More »

When should I declare variables in a PHP class?

Questions: I’m new to the OOP paradigm, so there’s probably a simple explanation for this question… Do you always need to declare public object-wide variables in a class? For example: <?php class TestClass { var $declaredVar; function __construct() { $this->declaredVar = “I am a declared variable.”; $this->undeclaredVar = “I wasn’t declared, but I still work.”;… Read More »

Using static variables instead of Application state in ASP.NET

Questions: I plane to use static variables instead of Application state in ASP.NET and am wondering if this is correct approach: [Global.asax.cs] … public class Global : System.Web.HttpApplication { void Application_Start(object sender, EventArgs e) { // Code that runs on application startup } … private static Dictionary<string, object> cacheItems = new Dictionary<string, object>(); private static… Read More »

How to get system environment variables into PHP while running CLI & Apache2Handler?

Questions: My system is Ubuntu and I have set my environment variables in /etc/environment. If I’m running PHP script using CLI – environment variables from /etc/environment are recognized. But, if I go to execute PHP script thru http://domain/test.php (that is apache2handler) exactly the same script prints out NULL, meaning environment variables from /etc/environment are not… Read More »