alias

Make alias to document.getElementById in Javascript

How can I alias the function "document.getElementById" I've seen it done using $ Thanks ...

Is Ruby's length method a symbol? Why is :length sometimes the same as length?

I came across the following while reading about how easy it is to redefine methods in Ruby: class Array alias :old_length :length def length old_length / 2 end end puts [1, 2, 3].length Sure, it's a bad idea, but it makes the point. But it bothered me that we switch between :length and length and :old_length and old_length s...

Java reports alias (symlink) as size 0 on Mac OSX. How do I get the true file size?

File file = new File("path to file alias foo"); where "path to file alias foo" is an alias reports file size to be 0 instead of the actual file size. I found a workaround to test for aliases: public boolean isLink() { try { if (file.getAbsolutePath().equals(file.getCanonicalPath())) { return false; ...

meaning of tilde in linux bash (not home directory)

Hi all, First off, I know that ~/ is the home directory. CDing to ~ or ~/ takes me to the home directory. However, cd ~X takes me to a special place, where X seems to be anything. In bash, if I hit "cd ~" and hit tab, it shows a bunch of possible ~X options like ~mail and ~postgres and ~ssh. Going to those folders and doing a pwd sh...

Is aliasing methods frowned upon?

I'm developing an online store, and the customer needs the ability to delete an order and have its products automatically restocked (e.g., for test orders). Here's my first try at implementing this: class Order < ActiveRecord::Base def destroy_and_restock restock_products destroy end protected def restock_products ...

JavaScript function aliasing doesn't seem to work

I was just reading this question and wanted to try the alias method rather than the function-wrapper method, but I couldn't seem to get it to work in either Firefox 3 or 3.5beta4, or Google Chrome, both in their debug windows and in a test web page. Firebug: >>> window.myAlias = document.getElementById function() >>> myAlias('item1') >...

Is alias_method_chain synonymous with alias_method?

If these two methods are simply synonyms, why do people go to the trouble of writing the additional characters "_chain"? ...

Linux: Possible to extend and Alias?

A simple example: Let's say I have one alias being sourced somewhere as: alias ls 'ls -o' I'd like to have a second alias add on to this: alias ls 'ls -a' So that when I execute it, I'm really getting: ls -o -a Is this possible? Of course in the above example, the second overwrites the first. Why would I want this? The first...

Unable to get aliases work in .gitconfig

Github has the following recommendation for ~/.gitconfig [alias] # Is this [-] only a comment in .gitconfig? gb = git branch gba = git branch -a gc = git commit -v gd = git diff | mate gl = git pull gp = git push gst = git status The above commands worked in my old Git. However, they do not work now for some unknown reas...

PHP: remove array element by element pointer (alias)

Is it possible to remove an array element by a pointer? Multidimensional array: $list = array( 1=>array( 2=>array('entry 1'), 3=>array('entry 2') ), 4=>'entry 3', 5=>array( 6=>array('entry 4') ) ); Reference array: $refs = array( 1=>&$list[1], 2=>&$list[1][2], 3=>&$li...

How does os.path map to posixpath.pyc and not os/path.py?

What is the underlying mechanism in Python that handles such "aliases"? >>> import os.path >>> os.path.__file__ '/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/posixpath.pyc' ...

Alias parameters in SSIS

I am using an OLE DB command in SSIS for which the SQL command looks like this: UPDATE DBO.CLIENT SET TimeZoneID = ?, DaylightSavingTime = ?, ModifiedBy = ?, MicrosPropertyID = ?, IsOffline = ?, GlobalReporting_MaskPatronNumberType = ?, GlobalReporting_PatronNumberReadableCharacters = ?, GlobalReporting_M...

Possible to alias .NET namespaces in app.config?

ASP.NET has a feature that allows you to declare implicitly used namespaces in the web.config. <configuration> <system.web> <pages> <namespaces> <add namespace="System.Web.Mvc"/> </namespaces> </pages> </system.web> </configuration> I'm curious to know if configuration for other .net environments (like winforms, consol...

How to create a domain alias (mapping)

I am looking to map a xxxxx.com to aaaaa.com. They would be hosted on the same server. I just would xxxxx.com to be an alias for aaaaa.com. So if you want to login at aaaaa.com/login.php you can just as easily do it via xxxxx.com/login.php (having xxxxx.com showing in the address bar). Is this possible and if so how? Thank you very muc...

add a server alias to the domain's VHOST?

I have a VPS. I hosted a domain ipointing to a sub directory of the www folder. The domain works fine till the home page. The moment I start going to other pages its shows my servers [orginalname]/[subdirectory name] . I think I need to add a server alias to the domain's VHOST. Can anyone tell me how to do that?? ...

Alias and namespace conflict in Visual Studio Designer

I have a namespace conflict between two referenced assemblies: i.e., I'm referencing Foo.A.Foo and Foo.Bar, so when I say I want Foo.Bar.Control, VS is trying to find Foo.A.Foo.Bar.Control I can twiddle the Designer.cs code by adding new global:Foo.Bar.Control(), but as soon as I change anything, VS switches back. I know there's somet...

Right join a table twice to a second table with each alias inner joined to to a third table's two aliases

Maybe I'm going about it the wrong way. Here is what I'm trying to do and my problem. I have 3 tables. assets (a computer, network device, etc) ports (a port on the computer, network device, etc) port_connections (has a port_id_a and port_id_b field and links each port and therefor each asset together) It's really just a way to track v...

How can I auto-generate unique fake names for users?

We would like to give each of users an alias so that we can refer to them in discussions while protecting their identity. These aliases should be unique. The easy way would be to simply use a SERIAL column, but ints aren't memorable. We would like to use real people names so that we can remember the aliases. The other easy way would be...

How to embed bash script directly inside a git alias

Can I embed the following bash shell code: for name in $(git diff --name-only $1); do git difftool $1 $name & done directly into the creation of a git alias: git config --global alias.diffall ***my-bash-code-here*** This leads on from my previous question/answer on SO, where I put the code into a .sh file and then aliased to the f...

mod_alias AliasMatch Regex - matching everything in a folder except two patterns?

I'd like to use AliasMatch to create an alias for everything within a folder, except for two (or more) specific regex patterns. For instance the following AliasMatch creates an alias for everything in the 'content' folder: AliasMatch /content(.*) /home/username/public_html/$1 But there are two regex patterns that I don't want the abo...