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 5 years ago.
Improve this question
I'm wondering if the ./ in paths are really needed since,
./myfile.jpg
myfile.jpg
If both targets the current folder. Why are ./ sometimes used and sometimes it isn't used? Are there advantages or bugs it fixed when uploaded to a root server vs sub-domains or other reasons?
./ means the current working directory. You can just reference the file directly by name, without it.
. = This location
.. = Up a directory
It means that ./foo.html is just foo.html. And it is optional, but it may have relevance if a script generated the path (relevance to the script that is, not how the reference works). You can omit it by the way. It’s useful only for clarity. There is no functional difference between it being there and not being there.
You can use the following list as quick reference:
/ = Root directory
. = This location
.. = Up a directory
./ = Current directory
../ = Parent of current directory
../../ = Two directories backwards
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this question
For example, I have an index.html for the project.
I'd like that whenever I build the project, it's automatically copied to the public project. Is there a built-in way to achieve this?
There is a built-in hook to copy (and potentially modify) a HTML file.
In can be configured in your build config via
:build-hooks
[(shadow.html/copy-file "src/html/index.html" "public/index.html")]
All paths are relative to the project root. This only copies that specified file, nothing else. You could write your own hook to copy more or just use a separate command to copy the files manually.
I typically just put all the files in their "final" place from the start and just have a public/js folder or so that is git-ignored that I can delete and will be recreated when I build my CLJS. That way there is no need to copy anything to begin with. ;)
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 years ago.
Improve this question
Is it possible to change the template that hg log uses by default? I would like to derive a such template that would look like the default but would use mailmap function to show commit author instead of the original recorded author.
Yes, you can do that via the [alias] section in an applicable .hgrc file. So if you know how to create an appropriate template, it's easy (I don't know what mailmap output looks like, so this here is just an example how to tackle it in .hgrc):
[alias]
log = log --template="{date|isodate} {author}\n\t{desc|tabindent}\n\n"
The main issue would be where to get the committer info from - a property mercurial doesn't record by default (that is author and committer are the same). Probably there do exist extensions which allow that distinction - do you happen to use one?
Additionally: I would recommend to NOT overwrite a default command output, but to define a new command like
[alias]
mlog = (whatever you need here)
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 5 years ago.
Improve this question
I have a script in bash in linux that is supposed to import data from csv into mysql database.
I need to make this script as generic as possible so I need to control it using config files that will specify which data goes to which table, etc. so that I don't change the script in the future when I need to make modifications to the tables for example.
How can I start and how can I do it ? as I am completely new to this topic.
When you are completely new, first try make it running without the generic approach. Perhaps you can already set the dynamic fields (that you want to move to a config file later) using variables.
You will have to rewrite the code few times when you are learning scripting and notice where you need common functions or config files.
Once you have a running prototype, copy the solution to a new directory and go on from there. One way would be writing all dynamic variables in config files:
field1="value1"
field2="value2 with spaces, that is why I use quotes"
field3="3"
field4=""
In the main script you can read the config file with source yourfile.cfg.
Perhaps you know which set of variables you want when you start your script.
Then you can use a parameter for it:
#!/bin/bash
if [ $# -eq 0 ]; then
echo "No parameter given, using default"
source default.cfg
else
source $1.cfg
fi
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 8 years ago.
Improve this question
I want to make my adobe air application that uses some data like (xml, png, ...) works only if the CD ROM exist ! means after installation the user must put the CD and run the app from the icon on desktop ! is it possible with flash/as3 ? thank you
you can do a little trick, at the launch of the app you can search for a file on that cdrom and show an alert if you don't find it. Here a simple way of getting all drives of the user computer:
var list:Array = File.getRootDirectories();
the list array contain File objects relative of all drives in the computer, afeter that you can search for a file inside the root of the drive or somewhere else.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 8 years ago.
Improve this question
So, I have an install of Wordpress on my server, with WP default .htaccess rewrite rules, however, I have a directory that with a whole application on it, running off of a database that I need users to be able to access. My problem is that whenever I go to the directory, Wordpress reads it as being in the Wordpress database. How would I correct that?
Thanks!
Jesse
You might find this useful... .htaccess & Wordpress: Exclude folder from RewriteRule
You need to exclude the folder from WordPress' Rewrite rules so WordPress doesn't intercept the folder. That linked answer should help.