path

How to use variable as a path for find command

孤者浪人 提交于 2019-12-12 03:15:40
问题 Can someone give me a hint, how I can make the following bash script run properly: path="/path/" excludepath="! -path \"/path/to/exclude/*\" " find "$path" "$excludepath" -name *."txt" -type f When I try to run it I get: find: `! -path "/path/to/exclude/*"': No such file or directory Thank you in advance. 回答1: Your problem was the fact that "$excludepath" is a single argument, even if it contains spaces. To put several arguments, use an array of strings instead of a string: excludepath=(!

Resolving 2 Python version in Mac OSX

喜欢而已 提交于 2019-12-12 03:12:26
问题 I am running Mac OS X 10.11.5 . I have two Python versions on my machine: Python 2.7 (Inbuilt python in OSX) and Python 3.5 (Anaconda version- 4.1.1) The path is set up as shown: $PATH -bash: /Users/userNMS/anaconda/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin: No such file or directory The problem is when I am trying to install few packages like pandas, Theano etc., using anaconda. I get ERROR: Failure: ImportError (No Module found) By default the Python Path points to this one i.e

Python path in .bash_profile not respected

送分小仙女□ 提交于 2019-12-12 03:08:20
问题 Been Googling and searching here to no avail, so forgive me if this is a duplicate. Basically, I installed Python 3.4 on my machine (Mac running Yosemite 10.10.2), but when I run python in Terminal, it starts up Python2.7.whatever, which I'm assuming is the version that is often mentioned as coming pre-installed on Macs. I've checked my ~/.bash_profile using vim, and here's what it currently contains: # Setting PATH for Python 3.4 # The orginal version is saved in .bash_profile.pysave PATH="

Ways to resources in PHP

北战南征 提交于 2019-12-12 02:57:33
问题 I try to resolve my problem with resource path in Php. In file header.php I include scripts and stylesheets, but when I require_once('../templates/header.php'); in file login.php from views directory I get 404 error code on all my resources, because all files must be in subdirectory of views direcroty. How I can solve this problem? Path: /var/www/reg/templates/header.php - path to header /var/www/reg/views/login.php - path to login /var/www/reg/js/script.js - path to js /var/www/reg/css/style

Trouble accessing file in other directory using Ajax, am I specifying the path wrong?

こ雲淡風輕ζ 提交于 2019-12-12 02:54:08
问题 In WAMP I changed the root directory from C:\wamp\www to C:\wamp\www\public . I have a file named username.html it communicates through Ajax with simple.php . This works fine if simple.php is in C:\wamp\www\public but if I move it to C:\wamp\www\private nothing happens. NOTE I elected not to use jquery and am doing this with plain javascript. xmlhttp.open("GET", "simple.php?suite="+top,true);//works when simple.php is in same folder xmlhttp.open("GET", "..\private\simple.php?suite="+top,true)

Path issue while saving and displaying an image in Android

£可爱£侵袭症+ 提交于 2019-12-12 02:42:42
问题 This might be my stupidity in writing paths but here is my code and it is failing to find configured root. getUriForFile is the one causing errors. @Override public void onClick(View v) { if (v.getId() == R.id.main_activity_camera_access_button) { Log.d(TAG, "clicked"); Toast.makeText(getContext(), R.string.first_activity_toast_opening_camera, Toast.LENGTH_SHORT).show(); Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); if(intent.resolveActivity(getActivity().getPackageManager()) !

Get background-image src from div and set that as an image's src

旧城冷巷雨未停 提交于 2019-12-12 02:24:43
问题 So I'm trying to grab the background-image from a div when it is clicked and set it as the src of an img element somewhere else on the page. The issue is that I'm getting an error saying that the file is not found. I understand that this has something to do with the path that I'm assigning to the img's src, however I am unable to see what's wrong with the code. When the div in question is clicked it calls a function document.getElementById('rice-bowl').onclick=openModal; And below is the

Difference between windows and unix paths

只谈情不闲聊 提交于 2019-12-12 02:16:48
问题 My test server is windows. Live server is unix. I was using relative paths, which seemed to work identically on both. I changed to absolute paths and it seems the two are different. My problem stems from files being loaded from subdirectories. On the windows server I am using realpath() , and this seems to give me a 'root' to locate from. But unix treats this different? What is the usual method of matching unix absolute paths to windows? Problem Found : The cause was require() . It seems

Adding directory to my path through ~/.bash_profile in bash?

末鹿安然 提交于 2019-12-12 01:59:49
问题 I want to add a directory to my PATH through the ~/.bash_profile file, though I don't have a file like this in my Ubuntu. I have the following code, which will check whether people have that file or not, and if not will create one and add all the existing path directories and the one entered by the user. #!/bin/bash echo "Please enter a directory that you want to add to your PATH: " read dr if [ -f ~/.bash_profile ] then # Add the read 'dr' directory to the end of the line that starts # with

How increase a sprites speed without ending up spiraling instead of circling

☆樱花仙子☆ 提交于 2019-12-12 01:48:08
问题 Hey so i have a sprite class, and i am making it turn 360 degrees a second, while increasing speed at the same time. However I end up spiraling and not staying on the original circle formed by the continuous turning of 360 degrees per second. How can i fix this? The sprite needs to go faster and stay on the same path. here's the code: box.Accelerate(10*Window.GetFrameTime()); box.Turn(360.0*Window.GetFrameTime()); 回答1: If you want to make a sprite go in a circle, put that in the code. For