Relative Paths Not Working in Xcode C++

There are numerous post over the net that detail how relative paths don't work in Xcode. I do have an Xcode template that I downloaded where the relative paths DO work, however I have not been...

"Fatal error: Cannot redeclare <function>"

I have a function(this is exactly how it appears, from the top of my file): <?php //dirname(getcwd()); function generate_salt() { $salt = ''; for($i = 0; $i < 19; $i++) { $salt .=...

How can I get the current plugin directory in WordPress?

I need to get the current plugin directory like: [wordpress_install_dir]/wp-content/plugins/plugin_name (If getcwd() is called from the plugin, it returns [wordpress_install_dir], the root of...

Uploadify file uploading

i am trying to use uploadify, to upload pdf or txt files, but without success. Uploadify 2.1.4 uploads just image files. I tried to just rename file extensions, tried to allow ., tried to namely...

get current working directory in Lua

What's the Lua to get the current working directory on Windows XP SP3 (or to get the directory of the currently-running Lua file)? I prefer not to use LuaFileSystem. I can't use os.execute("cd")...

How do I get IntelliJ to recognize common Python modules?

I'm using IntelliJ 10 IDEA Ultimate Edition. I've created a new file Test.py, and IntelliJ has correctly switched to Python parsing mode. (I can confirm this by typing "d", it pops up "def" as a...

strace/ltrace outputs inconsistent info

strace pwd: getcwd("/root"..., 4096) = 6 ltrace pwd: getcwd(NULL, 0) = "/root" Why the 1st parameter is NULL in ltrace? It eems...

os.path.dirname(__file__) returns empty

I want to get the path of the current directory under which a .py file is executed. For example a simple file D:\test.py with code: import os print os.getcwd() print...

OSX: GLUT window never appears

I'm trying to run ORTS on my Mac for a school project. It was ostensibly written to be cross-platform, but I don't know if it was ever properly tested on OSX. After a great deal of difficulty, I...

getcwd() returns NULL after new pointer is created

I've just started learning linux and C, please don't judge me strictly. I'm trying to find a current working directory and to open file in this directory to find a specific word. It gives correct...

PHP move_uploaded_file not working, yet no errors generated

I have a file upload page, and I have gone through the code and inserted debugging lines incrementally, line-by-line, to try to find the cause of this problem. The problem occurs somewhere in this...

How can I get the port that Mojolicious::Lite chooses?

Joel Berger posted this little program to start a web server to serve local files, and it works great: use Mojolicious::Lite; @ARGV = qw(daemon); use Cwd; app->static->paths->[0] = getcwd; any...

How to get canonicalized path (realpath) of nonexistent file in PHP?

script.php $filename = realpath(sprintf("%s/%s", getcwd(), $argv[1])); var_dump($filename); Let's try some things [/foo/bar/bof] $ php script.php ../foo.txt string(16)...

How to find a substring of a string in an array PHP

If you look at many of my questions, you will see that sometimes I don't ask the best questions or I am in such a rush that I don't see the answer that is right in front of me the whole time. If...

shell-init: error retrieving current directory: getcwd -- The usual fixes do not wor

I have a simple script: #!/bin/bash for server in $(~/.ansible/ansible_hosts) do ssh $server "hostname; readlink /opt/mydir/mylink;" done It works fine - the program returns the correct...

Why after I uploaded an image to Azure I cannot access it?

I'm developing a Universal App for Windows Phone 8.1 but I'm using a PHP Page to get recognize some patterns from an Image that I uploaded to my service. I have discovered that after I uploaded X...

Reading from text file is not working C++

I am simply want to read text from a file and don't know why code is not working. I have already put correct text file name on folder from where program is running. I must be doing something...

Can't uninstall brew postgres

I am trying to run brew uninstall postgres but I am getting these errors: I used to have postgres.app and the enterprise install too. Contents brew uninstall postgres shell-init: error retrieving...

Is there any away to get absolute path of product image/featured image in Wordpress/WooCommerce

How can i get absolute path of product Image or featured image of any post/product page? I tried to like this: $product = wc_get_product( $postid); $product->get_image('large'); //output like <img...

How to read Arabic text from PDF using Python script

I have a code written in Python that reads from PDF files and convert it to text file. The problem occurred when I tried to read Arabic text from PDF files. I know that the error is in the coding...

Resetting mysql password results: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

I keep getting the error: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) When trying to connect to MySQL via terminal. I've done both...

Python : getcwd and pwd if directory is a symbolic link give different results

If my working directory is a symbolic link, os.getcwd() and os.system("pwd") do not give the same result. I would like to use os.path.abspath(".") to get the full path of my working directory (or...

Python Notify2 Doesn't Show Images

I'm using notify2 module for showing desktop notifications in linux. This code gets latest earthquakes from the internet and shows desktop notifications. The code shows notifications perfectly...

PermissionError: [Errno 1] Operation not permitted after macOS Catalina Update

After installing macOS 10.15 Catalina I am getting the following error for simple file and directory operations in Python 3.x: "PermissionError: [Errno 1] Operation not permitted" Several...

How to set output contexts while creating a intent in dialogflow PHP?

I am trying to set output context to a particular intent via v2 create intent API. Please check my code. use Google\Cloud\Dialogflow\V2\SessionsClient; use...

Error in Jenkins Mac Catalina - cannot access parent directories: Operation not permitted

I updated my mac to catalina and i am starting to get this error. Before everything was working fine. I am trying to cd into the directory from my jenkins workspace and run my npm tests and i am...

'pod init' returns: Operation not permitted - getcwd (Errno::EPERM)

When I try perform pod init in my Xcode project directory, it returns the following: Traceback (most recent call last): 35: from /usr/local/bin/pod:23:in `<main>' 34: from...

How to split a tensorflow dataset into train, test and validation in a Python script?

On a jupyter notebook with Tensorflow-2.0.0, a train-validation-test split of 80-10-10 was performed in this way: import tensorflow_datasets as tfds from os import getcwd splits =...

Find path of python_notebook.ipynb when running it with Google Colab

I want to find the cwd where my CODE file is stored. With jupiter Lab i would do: import os cwd= os.getcwd() print (cwd) OUT: 'C:...\\Jupiter_lab_notebooks\\CODE' However,if i copy the folders...

ModuleNotFound: dateutil.parser

Here's what I'm running into: (.venv) PS C:\Users\<redacted>\onedrive\dev\python\code\kb4> py kb4.py Traceback (most recent call last): File...