Questions tagged [tilde]

The ~ (tilde) can have different meanings: it can be an operator, performing a bitwise negation on a binary number - all 1 bits are set to 0 and all 0 bits are set to 1. It can also simply be the tilde character itself, as used in Windows for shortening long path names.

171 questions
18
votes
2 answers

Using tilde in script tag src attribute

In my asp.net website using MasterPage and Routing I use a tilde in the href attribute of the link tag for the stylesheet in the head section of the MasterPage. Like this: Which…
Bazzz
  • 26,427
  • 12
  • 52
  • 69
14
votes
9 answers

What is the best way to produce a tilde in LaTeX for a website?

Following the previous questions on this topic, when you produce a website in LaTeX what is the best way to produce a url that contains a tilde? \verb produces the upper tilde that does not read well, and $\sim$ does not copy/pase well (adding a…
physicsmichael
  • 4,793
  • 11
  • 35
  • 54
14
votes
2 answers

home directory expansion (~) within an argument

When I enter the following (BASH): rdesktop -r disk:bacon=~/bacon host It does not expand to rdesktop -r disk:bacon=/home/me/bacon host It seems the "disk:" part is the problem as can be seen in: $ echo bacon=~/bacon…
Yoo
  • 17,526
  • 6
  • 41
  • 47
13
votes
1 answer

Relative path in ASP.NET

Make Games with Scirra Software
Tom Gullen
  • 61,249
  • 84
  • 283
  • 456
12
votes
2 answers

Qt: Expand ~ to home-directory

Does Qt have any platform-independent functionality to accept paths like "~/myfile"? I know about wordexp, but it would be nice with a platform-independent wrapper. Edit: Thank you all for the responses. "~/myfile" was just an example. What I am…
Rasmus Faber
  • 48,631
  • 24
  • 141
  • 189
10
votes
1 answer

Unable to add files with name containing tilde, '~' followed by a number

The folder consists of files with filenames like abc~1, 123~1, a1d2~3. When I do git add --all it says, $ git add --all error: Invalid path 'abc~1.png' error: unable to add abc~1.png to index fatal: adding files failed I did a trial and error and I…
SabareeshSS
  • 1,361
  • 2
  • 11
  • 20
9
votes
1 answer

C++ paths beginning with ~

Is here any possibility to use paths beginning with "~" in c++ codes in linux? For example this code is not working correctly: #include #include using namespace std; int main () { ofstream myfile; myfile.open…
user3053231
9
votes
2 answers

Correct use of tilde operator for input arguments

Function: My MATLAB function has one output and several input arguments, most of which are optional, i.e.: output=MyFunction(arg1,arg2,opt1,opt2,...,optN) What I want to do: I'd like to give only arg1, arg2 and the last optional input argument optN…
DMueller
  • 105
  • 1
  • 7
8
votes
5 answers

How does the ~[] construction work in JavaScript?

I've come across a working JavaScript code that I can't explain. For example: +[]===0 -[]===0 ~[]===-1 ~-~[]===-2 ~-~-~-~-~[]===-5 ~-~-~-~-~[]+~[]===-6 ~+~[]===0 ~+~+~[]===-1 ~+~+~+~[]===0 Can you explain the logic of these expressions?
Denis
  • 101
  • 3
7
votes
1 answer

tilde(~) operator in R

According to the R documentation: ~ operator is used in formula to separate the right and left hand side of the formula. The right hand side is independent variable and the left hand side is dependent variable. I understand when ~ is used in lm()…
user59419
  • 893
  • 8
  • 20
7
votes
2 answers

tilde operator returning -1, -2 instead of 0, 1 respectively

I'm kind of puzzled by this. I thought the ~ operator in C++ was supposed to work differently (not so Matlab-y). Here's a minimum working example: #include using namespace std; int main(int argc, char **argv) { bool banana = true; …
castle-bravo
  • 1,389
  • 15
  • 34
7
votes
6 answers

What does the tilde (~) character do here

Possible Duplicate: What does the tilde (~) mean in C#? class ResourceWrapper { int handle = 0; public ResourceWrapper() { handle = GetWindowsResource(); } ~ResourceWrapper() //this line here { …
Tom
  • 6,601
  • 12
  • 40
  • 48
7
votes
3 answers

Echoing a tilde to a file without expanding it in Bash

I need to write an argument to a file in a Bash script, so I'm doing something like this, echo "Argument is: $1" >> file The problem is that if there's a tilde (~) in the argument I don't want it expanded to the home directory. So if the user…
gsgx
  • 12,020
  • 25
  • 98
  • 149
6
votes
1 answer

Search for ~ (tilde) in vim

How can I search for a ~ (tilde) in vim? I tried /\~ and / \~ as /~ does not work. Thanks for your help!
florianbaer
  • 170
  • 1
  • 11
5
votes
2 answers

Splitting dataframe into two and using tilde ~ as variable

I wanna do 2 similar operations with Pandas in Python 3. One with tilde and another without tilde. 1 - df = df[~(df.teste.isin(["Place"]))] 2 - df = df[(df.teste.isin(["Place"]))] I tried to declare the tilde as variable, so I could write just one…
1
2
3
11 12