FAQ Database Discussion Community


WSGIScriptAlias Apache in MAC Yosemite

apache,alias,wsgi,yosemite
Hello I have configured SSL and MAMP finally I succeeded, but now I need to hold a controller server that is in wsgi, I configured the WSGIScriptAlias but the URL is not looking where I access. In the browser I can see the json to configure it to look for...

How to join to a table using aliases

sql,postgresql,join,alias
Thanks in advance for any help. I'm wondering how to join two SQL statements I have, based on the fact that I've given the columns aliases. The source table looks like this (please bear in mind that changing the layout of this table is enormously expensive due to other requirements):...

Aliasing a variable using const reference

c++,reference,const,alias,const-reference
When dealing with T instances obtained from an array or trough any other longish syntax, I often use a const T& to alias the object and make my code more readable (of course only if the lifetime of the object allows it). I've seen this elsewhere, e.g. here on Stefan...

Java Runtime.exec() doesn't honor Linux alias

java,linux,process,alias,spawn
I have a compiled third party java program which uses Runtime.exec() to spawn a process but i wanted to add additional arguments to the process when the process starts using alias, but Java Runtime.exec() doesn't seem to honor. I tried with my own program but still it doesn't see to...

When is the AS keyword optional vs required?

sql,sql-server,tsql,alias
Is there a "rule set" for when the AS keyword is optional vs required? For example, when being used for alias it is optional. It's also optional when being used to declare variables (and I believe to use CAST too). But it is not optional when creating UDFs and procedures....

Is it safe to cast between B* and D* if D contains an object of type B as its first member?

pointers,casting,alias,d
Consider the following: struct B { int x; } struct D { B b; int y; } void main() { auto b = cast(B*) new D(); writeln(b.x == b.x); auto d = cast(D*) b; writeln(b.x == d.b.x); } Is this program guaranteed to write "true" twice? I couldn't find these...

Bash: override built in command

bash,override,alias
I am trying to make a alias that overrides the cd command. This is going to execute a script before and after the "real" cd. Here is what I have so far: alias cd="echo before; cd $1; echo after" This executes the echo before and echo after command however it...

Bash: Pass alias or function as argument to program

bash,function,alias
Quite often i need to work on the newest file in a directory. Normally i do: ls -rt and then open the last file in vim or less. Now i wanted to produce an alias or function, like lastline() {ls -rt | tail -n1} # or alias lastline=$(ls -rt |...

cannot implicitly convert type error when using aliases

c#,generics,alias
I am new to learning C# and am coming from a C++ background. I am using an alias in the following manner: using CreationFunction = Func<Microsoft.Xna.Framework.Vector2, GAShooter.Entity>; then in my class I have a dictionary like so: private Dictionary<String, CreationFunction> creators; However when I try to initialize it in the...

How to find aliases in emacs

emacs,alias
I want to check if there is a default\ existing aliasing for a function (in this case:x-clipboard-yank, but the question is general). Is there an emacs function that displays active aliases I can use to figure it up? The expected behavior is like the shell alias command.

Windows CMD interpret code following alias

windows,batch-file,svn,cmd,alias
Is it possible to get windows process some code after an alias in the cmd? Basically I want to do sth. like this: doskey mysvn = D:\portableSVN\bin\svn.exe --config-dir D:\portableSVN\config mysvn up mysvn ci -m "message" This does not work, after interpreting mysvn it just stops and I get: Subcommand argument...

Delete from aliased table doesn't work (but select does)

sql-server,delete,alias
I need to delete some rows from a table which are not available in another similar table. I can correctly select the rows to be deleted using this piece of code SELECT * FROM [DB01].[forward].[forward_value] as DB01 WHERE Id_forward like 'test' and NOT EXISTS (SELECT * FROM [DB02].[db_marketdata].[forward].[forward_value] as DB02...

Bash alias doesn't work in cygwin

bash,cygwin,windows-8.1,alias
Can someone please explain to me how to set up bash aliases? I am using cygwin on windows 8. I added alias my_first_alias='git status' at the end of /.bashrc file. Typing my_first_alias into cygwin results in -bash: my_first_alias: command not found. Trying to restart cygwin, running . .bashrc doesn't help...

Added Alias to .bashrc but no results

bash,unix,alias,.bash-profile
I added an alias (alias homedir='cd /export/home/file/myNmae' ) to .bashrc in my home directory and restarted the session. When I run the alias it says homedir: command not found. Please advice....

Explanation behind C++ Quiz by Olve Maudal (alias template)

c++,templates,gcc,clang,alias
The following code is from http://www.pvv.org/~oma/PubQuiz_ACCU_Apr2014.pdf (#6, solution on page 34). The goal was to guess the output for the following. #include <iostream> template <template <typename> class> struct X { X() { std::cout << "1"; } }; template<typename > struct Y {}; template<typename T> using Z = Y<T>; template<> struct...

Why are the aliases for string and object in lowercase?

c#,alias,naming,primitive-types,complextype
Here are a list of aliases in C# (compliments of What's the difference between String and string?): object: System.Object string: System.String bool: System.Boolean byte: System.Byte sbyte: System.SByte short: System.Int16 ushort: System.UInt16 int: System.Int32 uint: System.UInt32 long: System.Int64 ulong: System.UInt64 float: System.Single double: System.Double decimal: System.Decimal char: System.Char I can see...

How to avoid quotes around table aliases in jOOQ

java,sql,alias,jooq
I have the following select-query creation: final DSLContext create = DSL.using(..., SQLDialect.POSTGRES); create .select(DSL.field("identifier"), DSL.field("name"), create.selectCount() .from(DSL.table("person")) .where(DSL.field("identifier").eq(DSL.field("personOuter.identifier"))) .asField("count")) .from(DSL.table("person").as("personOuter")) jOOQ generates the following query: select identifier, name, (select count(*) from person where identifier = personOuter.identifier) as "count" from person as "personOuter" The query should be:...

How to create an alias on two indexes with logstash?

elasticsearch,alias,logstash,logstash-grok,elastic
In the cluster that I am working on there are two main indexes, let's say indexA and indexB but these two indexes are indexed each day so normaly I have indexA-{+YYYY.MM.dd} and indexB-{+YYYY.MM.dd}. What I want is to have one alias that gathers indexA-{+YYYY.MM.dd} and indexB-{+YYYY.MM.dd} together and named alias-{+YYYY.MM.dd}....

Rails: aliasing the index action in the routes file

ruby-on-rails-4,routes,alias
I have the following route set up. I need to make the index action automatically use the pubmed_search route below. resources :users do resources :publications do collection do get :pubmed_search post :pubmed_list end end end I tried resources :users do resources :publications do collection do get 'publications', :action => :pubmed_search...

create alias for path

powershell,windows-8,alias
Is it possible in PowerShell to create alias for path? For example: I have to write all time PS PS C:\Users\Jacek>cd C:\windows\microsoft.net\framework\v4.0.30319 I will happy if I could write PS PS C:\Users\Jacek>cd dotNet4path ...

Alias to “do X then ” transparently

linux,bash,command-line,alias,io-redirection
The title sucks but I'm not sure of the correct term for what I'm trying to do, if I knew that I'd probably have found the answer by now! The problem: Due to an over-zealous port scanner (customer's network monitor) and an overly simplistic telnet daemon (busybox linux) every time...

how set unix alias with current directory works on every path

unix,path,find,cygwin,alias
i have this alias that works on "/" directory but stops working when path changes alias exesh='chmod +x $(find . -maxdepth 1 -name '*.sh')' I am a newbie with Unix so any help is welcome *I'm using cygwin, if can be this the issue * Bash, on this problem, says...

referencing mySQL query components

mysql,sql,select,alias
Is there a way to make reference to parts of a MySQL query within the same query? For example: SELECT 50000 AS starting_principle, .065*50000 AS interest, principle + interest AS principle_plus_interest The third column, principle_plus_interest in the query set gives me an error. Is there a way to code this...

SQL command not properly ended, concerning with table aliases

sql,oracle,alias
I understand that oracle does not allow AS commands for table aliases, so I've been suggested a solution like below. SELECT Temp.avgsale FROM (SELECT o.received, AVG(p.price*d.qty+d.sfee) avgsale FROM orders o, parts p, odetails d GROUP BY o.received) Temp WHERE Temp.avgsale=(SELECT MIN(Temp.avgsale) FROM Temp); However, I am getting the following error...

Composer: Require a package with custom namespace

php,composer-php,alias
I've been progressively starting to use Composer on my PHP projects, however there's something that I always questioned. For instance, let's say this is my composer.json file: { "require": { "ramsey/uuid": "~2.8" } } I'm telling composer I want the package ramsey/uuid and as expected it download and includes the...

Create a git alias to show files marked as --assume-unchanged?

git,alias
I'm trying to follow the instructions in this answer, to create an alias for a wordy git command: Edit your .gitconfig file to add this snippet: [alias] ignored = !git ls-files -v | grep "^[[:lower:]]" I have two questions: Where can I find .gitconfig on Mac OS X? How can...

Virtuoso Jena provider query alias syntax

java,alias,sparql,jena,virtuoso
I have in Java the following code, that uses the Virtuoso Jena provider API. I would like to do a query using an alias. I tried putting parenthesis but nothing worked. If I put the same query in the endpoint directly it works. query = "select ?a AS ?count where...

bash shell: Avoid alias to interpret $!

bash,shell,alias,wait
I have an alias created: alias my_rsync = "rsync -av ${PATH_EXCLUDE_DEV} ${PATH_SYS_DEV}/` ${PATH_SYS_SANDBOX}/ && wait $! && cd - &>/dev/null\" When is load this alias and watch it with the command 'type my_rsync' I see that $! is gone because it has been interpreted. Normally I do escape with backslash...

Apache Alias For External Directory And All Sub Directories

apache,.htaccess,alias
I want to add a alias for my website. So that website.com/alias will go to a folder outside of the root folder. This folder contains a different website so i want to be able to treat this alias as if it were a subdomain. AliasMatch ^/subdir1/(.*)$ /var/www/otherfolder/subdir1/$1 I was hoping...

pwd alias causing infinite loop in UNIX (bash)

bash,unix,alias,pwd
I have an alias, dir, which works fine using $(pwd) to show me the current directory I'm in: alias dir='echo -e ${color1}jarvis: ${color2}you are currently in the ${color3}$(pwd)${color2} directory, sir.${NC}' I would rather this alias be pwd, or have an identical one for pwd (so i can use dir or...

Use alias for JOIN using JOOQ's SelectQuery

sql,join,alias,jooq
I need to write query with nested select and join using JOOQ's SelectQuery: SELECT * FROM (select * from "public"."parent" order by "public"."parent"."setup_time" desc limit 10 offset 0) as "parent1" join "public"."child" on "public"."child"."parent_id" = "parent1"."id" where "public"."child"."name" = 'test' So, I've written something like this: SelectQuery<ParentRecord> subSelectQuery = context.selectQuery(PARENT);...

Using alias in cygwin doesn't recognize?

bash,google-chrome,cygwin,alias,.bash-profile
I have the following alias: alias gmail='https://gmail.com' And, I try to execute it as follows in Cygwin: cygstart chrome gmail But, it treat "gmail" literally as the web address "gmail" and not the alias https://gmail.com Question: Why is it not using the alias? ...

Apache - Serve all files in subdirectories

apache,mod-rewrite,alias,subdirectories
My server acts as a personal file share. I would like to set up a folder, _misc, which contains random files. Further, I need extra folders inside _misc to act as categories for files. What I've been trying to do these last couple nights is configure it in such a...

SQL Inner Join with Alias not working - ambigious column name

c#,sql-server,inner-join,alias
I'm having some trouble with a SQL statement. I searched around but I can't find the reason for that since the syntax looks correct. I compared it to other examples and don't know where the error comes from. The codesnippet with the statement: datTable = new DataTable(); SqlDataAdapter sqlDatAdapter =...

Alias command with parameters as arguments

bash,terminal,command,alias,.bash-profile
I have created a alias function move-jar(){ mv ~/Downloads/$1 ~/Documents/$1 } but when i do move-jar sample.jar it doesn't work and displays an error usage: mv [-f | -i | -n] [-v] source target mv [-f | -i | -n] [-v] source ... directory what is the issue in the...

Laravel DB Join with asterisk and alias select

sql,laravel,join,alias,asterisk
I am trying to get following query on Laravel : select TABLE1.* , TABLE1.COLB AS AAA from TABLE1 left join TABLE2 on TABLE2.COLA = TABLE1.COLB This is the Laravel DB Query code : DB::table('TABLE1') ->leftJoin('TABLE2','TABLE2.COLA', '=', 'TABLE1.COLB') ->select('TABLE1.* , TABLE1.COLB AS AAA') ->get(); But it doesn't work and I get...

MySQL inner join alias issue

mysql,join,alias
I am trying to write an sql join but I'm getting a not unique error: SELECT matches.match_id, teamsh.team_name AS "homeTeam", teamsh.team_id AS "homeID", teamsa.team_name AS "awayTeam", teamsa.team_id AS "awayID", competition.NAME, competition.competition_id, teamsh.stadium, matches.date, teamsh.name_short AS "homeTeamShort", teamsa.name_short AS "awayTeamShort", teamsh.pysioid AS "pysioIDh", teamsa.pysioid AS "pysioIDa" FROM matches, teams teamsh, teams...

Can a forwarding reference be aliased with an alias template?

c++,templates,alias,c++14,forwarding-reference
This is a continuation of my previous question: Can an identity alias template be a forwarding reference? It seems that the following code works in both Clang 3.7.0 (demo) and GCC 6.0.0 (demo): template <class T> using forwarding_reference = T&&; template <class T> void foo(forwarding_reference<T>) {} int main() { int...

Are generic type aliases possible in TypeScript?

generics,typescript,alias
TypeScript 1.4 introduced type aliases. The examples show how to use aliases like type MyGreeter = Greeter<string> but is it possible to have generic aliases? The following examples do not work: type GenericAlias<T> = OriginalType<T> type GenericAlias = OriginalType<T> Is it at all possible to alias generic types without typecasting...

Trying to make a permanent Alias - UNIX

linux,bash,unix,alias
I am trying to make a permanent alias (alias homedir='cd /export/home/Files/myName') in unix. I am trying to add the command in the ~/.bashrc file, but I cannot find the file in my $HOME directory. The only bash file is see is .bash_history, Please help. I even did a ls -a...

SQL Join Views - Duplicate Field

sql-server,tsql,join,view,alias
I am trying to join two views, I have tried to alias the cAuditNumber field under StkSalesUpdated view to AuditNumber1, but I still get the following message: Msg 4506, Level 16, State 1, Procedure KFF_Sales_Data_Updated, Line 3 Column names in each view or function must be unique. Column name 'cAuditNumber'...

Formal argument names for magrittr aliases

r,alias,plyr,pipeline,magrittr
I was wondering if anybody knew or could help me find the formal argument names for all of the magrittr alias functions. For example, I know that the argument for 'set_colnames' is 'value'. df <- data.frame(1:3, 4:6, 7:9) %>% set_colnames(value = c('a', 'b', 'c') Normally, I just pass the arguments...

SQL aliasing with multiple tables

sql,sql-server,tsql,alias
I'm looking to select all fields from my Report, Player, and Fixture tables where the FixtureID from the Report table matches @FixtureID (selected from a combobox). However, I'm having trouble getting the aliasing to work correctly- I've tried to alias the Player table in the same way as Report and...

Can PHP resolve a Mac alias?

php,osx,alias
I am running MAMP and using PHP to read the names of all the files in a given folder. I would like to create an alias for certain images in another folder, and have PHP resolve these to their actual path. I know how to create symlinks that will work...

defining grunt aliases with option values defined

javascript,node.js,gruntjs,alias
Does Grunt allow to define custom aliases just like npm or bash does? In grunt docs it says, that one can define a sequence on tasks (which might be just a single item). So in my opinion it should be called chaining rather than aliasing. What I'm looking for is...

Tmux breaks zsh aliases

bash,shell,alias,zsh
I have a file .aliases that I point to in my .zshrc file DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" if [ -f $DIR"/.aliases" ]; then . $DIR"/.aliases" fi This code is the same in my .bashrc file (in the process of switching over to zsh). The aliases...

Understanding Alias Templates

c++,templates,alias,enable-if,c++1z
I asked a question that has several references to the code: template <typename...> using void_t = void; I believe I have a generally misunderstand alias templates: Why wouldn't you just evaluate whatever template parameter you're passing into an alias template in an enable_if_t or conditional_t statement? Is the code above...

mysql: getting getting tuple of an alias which has maximum column value

mysql,sql,max,alias
What I want to do is this: select AlbumId from ( select Album.AlbumId, Sum(Track.UnitPrice) as Total from Album inner join Track on Album.AlbumId = Track.AlbumId group by Album.AlbumId ) tpt where Total = (select max(Total) from tpt); but am getting: Table 'db.tpt' doesn't exist -which probably makes sense. However, I...

How do I set up a bash alias for a common working folder?

bash,function,alias
I want to set up a bash alias or function (let's call it "myfolder") to a common working directory (let's call it ~/some/deep/working/folder) and I want to be able to call it like this: cd myfolder/bob to access the child folder "bob". If I use alias myfolder='~/some/deep/working/folder', I can use...

Bash alias to script generating shebang text

bash,alias,shebang
How to create an alias to short code snippet that generates shebang (#!/bin/bash) text? I'm looking for something like: alias createConfiger='echo -e "#!/bin/bash\necho configvalue" > printConfig.sh' ...

tcsh shell and variable argument alias

alias,tcsh
I use tcsh shell and I cannot change to another shell. I'm trying to create an alias to quickly cd into my project. My home directory looks like: /home/projects/proj1 /home/projects/proj2 ... /home/stuff/stuff1 If i am working in stuff 1 directory and want to quickly navigate to my projects, i created...

How to create nested SELECT COUNT with alias in Postgres

sql,postgresql,count,nested,alias
i'm writing the following SQL query for my Postgres database: SELECT( (SELECT count(*) as A FROM merchant WHERE nome LIKE 'A%'), (SELECT count(*) as B FROM merchant WHERE nome LIKE 'B%'), (SELECT count(*) as C FROM merchant WHERE nome LIKE 'C%'), (SELECT count(*) as D FROM merchant WHERE nome LIKE...

How to define two aliases for one command in one statement

osx,bash,unix,alias
I know how to configure aliases in bash, but is there a way to map an alias for with two possible shortcuts in one statement? Here is the two line version alias "gac"="git add . && git commit -am " alias "gitac"="git add . && git commit -am " I...

Bash expansion error defining function with pandoc

osx,bash,alias,variable-expansion
I'm using the advice here to setup an alias to convert markdown to man style output using the command, alias mdless="pandoc -s -f markdown -t man \!* | groff -T utf8 -man | less" I keep getting the error: pandoc: !*: openFile: does not exist (No such file or directory)...

Alias text in HTML or CSS?

html,css,text,fonts,alias
I want to alias the text in HTML or CSS. Or, I am sure it can be done with javascript (and maybe vbscript or tcl). In a similar question a user posted these codes: font-smooth: auto | never | always | | length | initial | inherit -webkit-font-smoothing : none...

How to change the value with a select in SQL?

sql,sql-server,select,alias
I need to have an other value instead of FULL and NONE but I must do it in the select. SELECT Calendar_Month,Series,Cnt FROM T_Cust_Eom_n where TYP='REB' and Series='FULL' or TYP='REB' and Series='NONE' order by Series desc,Calendar_Month Can I do this with an as anyhow?...

How to write an ipython alias which executes in python instead of shell?

python,macros,ipython,alias,ipython-magic
We can define an alias in ipython with the %alias magic function, like this: >>> d NameError: name 'd' is not defined >>> %alias d date >>> d Fri May 15 00:12:20 AEST 2015 This escapes to the shell command date when you type d into ipython. But I want...

Correct syntax for bash function as alias in .bashrc

linux,bash,shell,scripting,alias
I have just read the following instruction in a bash scripting tutorial: Let's try one. Open .bashrc with your text editor again and replace the alias for "today" with the following: today() { echo -n "Today's date is: " date +"%A, %B %-d, %Y" } The line I am supposed...

Can an identity alias template be a forwarding reference?

c++,templates,alias,c++14,forwarding-reference
Consider the following snippet below: template <class T> using identity = T; template <class T> void foo(identity<T>&&) {} int main() { int i{}; foo(i); } i is an lvalue, hence if foo declares a forwarding reference parameter, it should compile. However, if identity<T>&& is turned to be int&&, it should...

Adding alias to bashrc to run multiple commands and pass a variable?

bash,shell,command-line,alias
Not good at creating aliases but I have several commands to run and I want to do them all at once. $ activator $ clean $ compile $ run 9002 I would like to combine all of these commands into a single command like: $ activate 9002 Normally I think...

Qt5: How to replace numeric values of a column of a SQL table view with text aliases?

sql,qt,table,view,alias
I am using Qt5. I managed to connect to a sql database and using QtCreator I have now a QTableView that is nicely populated using "SELECT * ..." from a test table I previously defined with MS SQL Manager... Only one thing I would like to change: ...One column named...

PowerShell function ValueFromPipelineByPropertyName not using alias parameter name

function,powershell,parameters,alias
Trying to create a function that takes objects on the pipeline using the alias property. I'm not sure where this is going wrong. Example of the process: function Get-Name { Param ( [Parameter(ValueFromPipelineByPropertyName=$true)] [alias("givenname")] [System.String] $FirstName, [Parameter(ValueFromPipelineByPropertyName=$true)] [alias("sn")] [System.String] $LastName ) write-host "firstName = $FirstName / $($FirstName.GetType().FullName)" Write-host "LastName =...

Where in the Standard does it say that a member alias-declaration can be used as if it was a static member?

c++,alias,language-lawyer,c++14
Consider the following snippet: #include <iostream> struct A { int i; using Int = int; }; int main() { std::cout << sizeof(A::Int) << '\n'; } It compiles and executes normally in clang and GCC. I know this looks obvious, but I couldn't find anything in the Standard (C++14) supporting the...

SQLite dynamic aliases

sql,sqlite,alias
I'd like to define a dynamic alias on sqlite (in order to have the most generic SQL query I could). I have two tables t1 & t2 t1 structure: id|url|type t2 structure: id|us|es|fr|de|nl My request is as follows: SELECT t1.*,us as name FROM t1 INNER JOIN t2 ON (t1.id =...

golang function alias on method receiver

go,alias
I can create method alias for an usual method: func method1() { fmt.Println("method1") } var Method1 = method1 But cannot do the same for a method receiver: type Person struct { Name string } func (p *Person) methodReciver() { fmt.Println("method reciver") } var MethodReciver = methodReciver In this case I...

Outlook 2010 VBA code to show alias of recipient

email,outlook,alias,outlook-vba
My company assigns each employee an ID which is stored as their 'alias' in Outlook. We use this ID often, and I am looking for an easy way to see it. Right now I enter the recipient name in a new email, double click the name, click on more options,...