Is this login system secure
Is this login system secure ? if ($_POST[$submit]){$user = $_POST[$user];$pass = $_POST[$pass];if ($user && $pass){ //if user and pass is enterered require("vars.php"); //require MySQL...
View ArticleAnswer by luke for Dump All Python Interpreter Errors into a Log?
Just redirect stderr.python script.py 2> /var/log/python.log
View ArticleAnswer by luke for Pipe an input to C++ cin from Bash
g++ main.cpp compiles it, the compiled program is then called 'a.out' (g++'s default output name). But why are you getting the output of the compiler?I think what you want to do is something like...
View Article"Free heap block modified after it was freed" when modifying string after malloc
I am currently working on a project that includes some file I/O.Due to it being cross platform I needed to account for different path separators and hence decided to create the following function to...
View ArticleAnswer by luke for How can I load a Python flask app into a gtk webview (Webkit)
I've ended up finding a solution to this myself (but open to better ones).The first thing, loading a page, was pretty easy. Flask provides a way to test apps which mainly just sets up all the things...
View ArticleHow can I load a Python flask app into a gtk webview (Webkit)
I am currently working on an application that requires math expressions to be rendered (from latex) and needs to have some sort of native gui (even if it just uses gtk, then renders html in webkit).I...
View ArticleAnswer by luke for Python cross platform hidden file
You could do something like this:import osimport ctypesFILE_ATTRIBUTE_HIDDEN = 0x02def write_hidden(file_name, data):""" Cross platform hidden file writer.""" # For *nix add a '.' prefix. prefix = '.'...
View ArticleHow can I optimise this C++?
I am trying to practice C++ by doing some old Google Code Jam problems. A relatively simple one I found is to reverse the words in a string. It can be found here...
View ArticleAnswer by luke for Java - Find shortest path between 2 points in a distance...
Like SplinterReality said: There's no reason not to use Dijkstra's algorithm here.The code below I nicked from here and modified it to solve the example in the question.import...
View ArticleReact Component Style Encapsulation
I am trying to encapsulate styles for an embedded component. The component must prevent sites from easily overriding the styling without a script. The Shadow Dom was chosen to be used similar to Web...
View ArticleMacOS `subprocess` raising: FileNotFoundError: /usr/sbin/sysctl [duplicate]
I've suddenly started getting an error on all versions of Python on MacOS reporting the following when using subprocess:FileNotFoundError: [Errno 2] No such file or directory: '/usr/sbin/sysctl -n...
View Article