Questions tagged [symbolic-references]
22 questions
24
votes
3 answers
What's the recommended usage of a Git symbolic reference?
The following shell code correctly creates a chain of symbolic references
git symbolic-ref "first" "refs/heads/master"
git symbolic-ref "second" "first"
git symbolic-ref "nested/third" "second"
git symbolic-ref "refs/heads/fourth"…

nulltoken
- 64,429
- 20
- 138
- 130
18
votes
2 answers
Symbolic references in Java
In these days I have been playing with Java reflection and .class format. I'm currently studying ldc instruction.
In JVM Specification I found term I don't understand: symbolic reference, and I have the following questions.
What does it…

user35443
- 6,309
- 12
- 52
- 75
18
votes
3 answers
How can I use a variable as a variable name in Perl?
I need to achieve the following in perl
printmsg(@val1, $msg1) if @val1;
printmsg(@val2, $msg2) if @val2;
printmsg(@val3, $msg3) if @val3;
printmsg(@val4, $msg4) if @val4;
printmsg(@val5, $msg5) if @val5;
printmsg(@val6, $msg6) if @val6;
So i wrote…
user187859
9
votes
2 answers
Print symbolic name for HEAD
I am looking for a Git command that will print the symbolic name for HEAD. I
was using this command
$ git name-rev --name-only HEAD
master
$ git checkout HEAD~2
$ git name-rev --name-only HEAD
master~2
However I noticed that it does not work on a…

Zombo
- 1
- 62
- 391
- 407
9
votes
3 answers
Why does Perl evaluate code in ${...} during string interpolation?
Why does the following snippet work at all? And what evil might be possible using this? But seriously, is there any reason, the code in ${} gets evaluated at all and then used as scalar reference?
use strict;
no strict 'refs';
our $message = "Hello…

willert
- 962
- 9
- 12
7
votes
1 answer
Alternate syntax on introspecting modules/classes/etc
I'm rewriting a framework from Perl5 to Perl6 for my work purposes. At some place I need to collect information from other modules/classes by executing a public sub they might provide; or they may not. So, it necessary to find out if the sub is…

Vadim Belman
- 1,210
- 6
- 15
7
votes
6 answers
How can I create a Perl variable name based on a string?
In Perl, is it possible to create a global variable based on a string?
E.g., if I had a function like:
sub create_glob_var {
my ($glob_var_str) = @_;
# something like this ( but not a hash access).
our ${$glob_var_str};
};
and I called…

Ross Rogers
- 23,523
- 27
- 108
- 164
5
votes
1 answer
Where the resolved reference(that means direct memory address against symbolic reference) stored in JVM after resolution?
I've studied about JVM(especially JDK 8 version) and while studying about class linking, I've not figured out where a direct memory address that was determined from symbolic reference in resolution.
There are several kinds of resolutions, such as…

eminentstar
- 55
- 4
2
votes
2 answers
Symbolic declaration of variables in Matlab
I would like to write my variables as operations between other variables.
For instance if I put a = c + b then value that a keeps inside is the numeric result of the operation of a sum between c and b.
If c = 4 and b = 2 then, the value that a…

Peterstone
- 7,119
- 14
- 41
- 49
2
votes
1 answer
Implementing functions that include name and symbol
I need to define in Sage some functions with attributes that define
the name of the function
its mathematical/physical symbol
the definition of the function
(and those in combination)
and methods that return
those attributes in LaTeX format
both…
2
votes
2 answers
Can I access an ObjC constant by string name at runtime?
I know that Objective-C allows me to refer to selectors by name using @selector(@"name") How can I access the following constant by name at runtime? In other words, I would pass @"CONST_KEY" somewhere and get @"key" back.
const NSString* CONST_KEY =…

Alex Stone
- 46,408
- 55
- 231
- 407
1
vote
1 answer
php symbolic link for images
I have images which change often as part of a website and iphone app. Imagine that it is a user image and they can change their picture often (although it is for much more than that). I need to have the image change name when the content changes so…

hackartist
- 5,172
- 4
- 33
- 48
1
vote
3 answers
In Perl, can refer to an array using its name?
I'm new to Perl and I understand you can call functions by name, like this:
&$functionName();. However, I'd like to use an array by name. Is this possible?
Long code:
sub print_species_names {
my $species = shift(@_);
my @cats =…

Adam S
- 8,945
- 17
- 67
- 103
1
vote
1 answer
Sympy: How to get simplified commutators using the second quantization module?
So I want to use the fact that [b,bd]=1, where [] is the commutator, to get some commutators of more complicated expressions using sympy instead of doing it by hand, but instead, I get huge expressions that contain the commutator but it is not…

Gerardo Suarez
- 37
- 5
1
vote
1 answer
Git: What's the path separator used in the content of the .git\HEAD in Git repositories on Windows?
The title says it all, but for example, if the HEAD of a Git repository points to ref/heads/master on any well-used Git implementation for Windows, which of the following is the content of the file .git/HEAD ... oops, .git\HEAD:
ref:…

gksato
- 368
- 1
- 10