Questions tagged [alias]

An alias is an alternative name. In computer science, the most common contexts are command aliases in shells, column aliases in databases, or variable references in languages like C++.

For bash aliases use the tag.

4406 questions
31
votes
1 answer

Namespace aliasing in F#?

I have a name clashing problem while opening some .Net assemblies in my F# code using open System.IO The only option I found and use now is to provide the full names of types for conflicting types, but this is a little bit boring. Is there any…
Alexander Galkin
  • 12,086
  • 12
  • 63
  • 115
31
votes
11 answers

Fixing 403 Forbidden on alias directory with Apache

I am trying to setup an alias to point to some directory on my filesystem not in DocumentRoot. Now I get a 403 Forbidden response. These are the steps taken: 1. edit http.conf, adding: Alias /example…
sjking
  • 845
  • 1
  • 10
  • 11
31
votes
1 answer

sublime symlink disappeared after upgrading to El Capitan

I have just upgraded to OS X El Capitan and subl . command stopped working with the zsh: command not found: subl error message. I have run the following command as suggested in other posts: sudo ln -s /Applications/Sublime\…
Anvar Turobov
  • 449
  • 1
  • 5
  • 13
31
votes
3 answers

Why use class aliases?

Why would we use the class_alias function? For example: Class Test { public function __construct(){ echo "Class initialized"; } } class_alias("Test", "AnotherName"); $instance = new AnotherName(); # equivalent to $instance = new…
Daryl Gill
  • 5,464
  • 9
  • 36
  • 69
31
votes
4 answers

DELETE FROM `table` AS `alias` ... WHERE `alias`.`column` ... why syntax error?

I tried this with MySQL: DELETE FROM `contact_hostcommands_relation` AS `ContactHostCommand` WHERE (`ContactHostCommand`.`chr_id` = 999999) LIMIT 1 And I get this: #1064 - You have an error in your SQL syntax; check the manual that corresponds to…
Aalex Gabi
  • 1,525
  • 1
  • 18
  • 32
30
votes
4 answers

How to create Sql Synonym or "Alias" for Database Name?

I'm using ms sql 2008 and trying to create a database name that references another database. For example 'Dev', 'Test', 'Demo' would be database names that i could reference from my multiple config files, but each name would point to another…
Kevin McKinley
  • 599
  • 1
  • 5
  • 13
30
votes
2 answers

Can I create an alias of a type in Golang?

I'm struggling with my learning of Go. I found this neat implementation of a Set in go: gopkg.in/fatih/set.v0, but I'd prefer naming my sets with a more explicit name that set.Set, doing something like: type View set.Set In essence, I want my View…
Adrien Luxey
  • 552
  • 1
  • 6
  • 16
29
votes
3 answers

Why do backslashes prevent alias expansion?

In the first part of my question I will provide some background info as a service to the community. The second part contains the actual question. Part I Assume I've created the following alias: alias ls='ls -r' I know how to temporarily unalias…
Alexandros Gezerlis
  • 2,221
  • 16
  • 21
29
votes
6 answers

How can I make an alias to a non-function member attribute in a Python class?

I'm in the midst of writing a Python library API and I often run into the scenario where my users want multiple different names for the same functions and variables. If I have a Python class with the function foo() and I want to make an alias to it…
Brent Writes Code
  • 19,075
  • 7
  • 52
  • 56
28
votes
3 answers

How do I remove or replace a built in alias in powershell?

Powershell includes a built-in alias diff for the Compare-Object cmdlet. This is really annoying for me, as I'm used to using the Unix diff command. Is there a way to remove the built in diff alias, or otherwise override it? I've tried: del…
Paul Moore
  • 6,569
  • 6
  • 40
  • 47
28
votes
6 answers

.profile not working from terminal in mac

I had a .profile file that I was reading and using aliases from in my terminal, but at some point the aliases stopped working for no clear reason (other commands were still working). Thinking to make a quick fix, I deleted (rm) and recreated my…
user2950933
  • 281
  • 1
  • 3
  • 4
27
votes
4 answers

Creating permanent executable aliases

I have MySQL installed (MAMP, Mac OS X) but need to call it by the full path each time I access it from the shell. I created an alias: alias mysql='/Applications/MAMP/Library/Bin/mysql, but this only lasts as long as my terminal/Bash session. …
Yarin
  • 173,523
  • 149
  • 402
  • 512
27
votes
6 answers

How to alias a built-in type in C#?

So in C++, I'm used to being able to do: typedef int PeerId; This allows me to make a type more self-documenting, but additionally also allows me to make PeerId represent a different type at any time without changing all of the code. I could even…
void.pointer
  • 24,859
  • 31
  • 132
  • 243
27
votes
3 answers

How to use PowerShell alias cd a spec directory?

On Linux alias cdt='cd /usr/a' make a alias that when I type cdt I change the workpath to /use/a On PowerShell Set-Alias cdt "cd F://a" It seems not work
mingchaoyan
  • 8,096
  • 3
  • 23
  • 31
27
votes
5 answers

Why doesn't Oracle SQL allow us to use column aliases in GROUP BY clauses?

This is a situation I'm generally facing while writing SQL queries. I think that writing the whole column (e.g. long case expressions, sum functions with long parameters) instead of aliases in GROUP BY expressions makes the query longer and less…
Mehper C. Palavuzlar
  • 10,089
  • 23
  • 56
  • 69