f



Is "T[N][]" (or "T[N][][M]") indirectly legal?

I'm trying out stuff with GCC 4.7 via MinGW for 32-bit Windows 8.  The stuff
I'm testing with involves array types with zero or unknown bounds (in C++11
mode).

* Playing the type combinations that give an array type with a bound of zero
work!  With multidimensional arrays, the zero-extent can be at any place.
Their "sizeof" gives zero, and I can even make (non-zero) arrays of those
arrays (also having a zero sizeof).  I didn't try indexing into an element,
of course.  The only errors I got were with array-to-pointer decay.  Using a
zero-extent anywhere (directly or indirectly) is a straight-up error, and
GCC 4.7 is buggy here by allowing them (and zero-sized objects), right?

* Declaring an array type that has any extent as unbound besides the first
flags an error on my GCC 4.7 setup.  But I can indirectly create arrays
with an unbound non-first extent via typedefs in recursive variadic class
templates.  When I glanced at the Standard, it seemed to support banning
such array declarations directly, but indirect means didn't seem banned.
Are non-first unbound extents actually permitted or not?  (If not, then
GCC 4.7 has a bug there, too.)

(I have to rearrange my project to use GCC 4.8; that's why I don't know if
4.8 changed this.)

Daryle W.


-- 
      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]

0
Daryle
9/18/2013 12:18:08 AM
comp.lang.c++.moderated 10738 articles. 1 followers. allnor (8509) is leader. Post Follow

6 Replies
439 Views

Similar Articles

[PageSpeed] 18

Am 18.09.2013 08:18, schrieb Daryle Walker:
> I'm trying out stuff with GCC 4.7 via MinGW for 32-bit Windows 8.  The stuff
> I'm testing with involves array types with zero or unknown bounds (in C++11
> mode).
>
> * Playing the type combinations that give an array type with a bound of zero
> work!

If you mean

T[]

or

T[][N]

with N > 0 this should be well-formed, yes.

> With multidimensional arrays, the zero-extent can be at any place.

If so, this compiler would be buggy. According to 8.3.4 [dcl.array] p1:

"[..] T is called the array element type; this type shall not be a [..],
an array of unknown or runtime bound, [..]."

I'm a bit astonished of your observation, because I tested several
versions of gcc and none of them allowed such a type. Maybe you should
provide a concrete code example where this happens.

> Their "sizeof" gives zero, and I can even make (non-zero) arrays of those
> arrays (also having a zero sizeof).

This would be another compiler defect, because applying sizeof to an
incomplete type is ill-formed:

"The sizeof operator shall not be applied to an expression that has [..]
incomplete type, [..], to the parenthesized name of such types, [..]"

> * Declaring an array type that has any extent as unbound besides the first
> flags an error on my GCC 4.7 setup.  But I can indirectly create arrays
> with an unbound non-first extent via typedefs in recursive variadic class
> templates.  When I glanced at the Standard, it seemed to support banning
> such array declarations directly, but indirect means didn't seem banned.
> Are non-first unbound extents actually permitted or not?  (If not, then
> GCC 4.7 has a bug there, too.)

Again, please provide a concrete, short code example.

HTH & Greetings from Bremen,

Daniel Kr�gler


-- 
      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]

0
ISO
9/18/2013 1:18:30 PM
On Wednesday, September 18, 2013 2:20:09 PM UTC-4, Daniel Kr�gler wrote:
> Am 18.09.2013 08:18, schrieb Daryle Walker:
> > I'm trying out stuff with GCC 4.7 via MinGW for 32-bit Windows 8.  The
stuff
> > I'm testing with involves array types with zero or unknown bounds (in
C++11
> > mode).
> >
> > * Playing the type combinations that give an array type with a bound of
zero
> > work!
> 
> If you mean
> 
> T[]
> 
> or
> 
> T[][N]
> 
> with N > 0 this should be well-formed, yes.

No, I mean things like I said in the Subject line:

    T[N][]
    T[N][][][M]

The compiler (rightfully) prevents these when I use these lexical forms.
But
can I create them indirectly via typedefs?  (Make a type-alias to an array
with unspecified-bound, then use that as the element type for another array
type-alias.)  I haven't tried this, but I'm extrapolating from the
"successful"
trials with using 0 as an extent.

> > With multidimensional arrays, the zero-extent can be at any place.
> 
> If so, this compiler would be buggy. According to 8.3.4 [dcl.array] p1:
> 
> "[..] T is called the array element type; this type shall not be a [..],
> an array of unknown or runtime bound, [..]."

Are you using a C++14 draft?  I'm looking at the C++11 Standard, and it bans
the following as array element types: reference types, (cv-) void, function
types, and abstract class types.  It doesn't not mention incomplete types in
general at all nor are arrays of unknown-bound listed.  If C++14 clarifies
this, I'll be content with that since I'm aiming my code for C++17.

Paragraph 3 of that section, in C++11, says only the first extent can be of
unknown bound, but it also talks about several "array of" declarations being
adjacent.  They won't be lexically adjacent if I use stupid typedef tricks,
so
does the Standard just ban them just lexically or indirectly too?

> I'm a bit astonished of your observation, because I tested several
> versions of gcc and none of them allowed such a type. Maybe you should
> provide a concrete code example where this happens.
> 
> > Their "sizeof" gives zero, and I can even make (non-zero) arrays of
those
> > arrays (also having a zero sizeof).
> 
> This would be another compiler defect, because applying sizeof to an
> incomplete type is ill-formed:
> 
> "The sizeof operator shall not be applied to an expression that has [..]
> incomplete type, [..], to the parenthesized name of such types, [..]"
> 
> > * Declaring an array type that has any extent as unbound besides the
first
> > flags an error on my GCC 4.7 setup.  But I can indirectly create arrays
> > with an unbound non-first extent via typedefs in recursive variadic
class
> > templates.  When I glanced at the Standard, it seemed to support banning
> > such array declarations directly, but indirect means didn't seem banned.
> > Are non-first unbound extents actually permitted or not?  (If not, then
> > GCC 4.7 has a bug there, too.)
> 
> Again, please provide a concrete, short code example.

    // From memory, not tested (I've changed stuff a lot.)
    template < typename T, unsigned ...N > struct MyArray;

    template < typename T > struct MyArray {
        using value_type = T;  // can these combined? or only with
"typedef"?
        using data_type = T;

        data_type  data_;
    };

    template < typename T, unsigned N0, unsigned ...M >
    struct MyArray<T, N0, M...> {
        using value_type = T;
        using element_type = typename MyArray<T, M...>::data_type;
        using data_type = element_type[N0];

        data_type  data_;
    };

    // These are all approved, and their "sizeof"s are 0.
    MyArray<0>     e1, e2[6];
    MyArray<3, 0>  e3;

Daryle W.


-- 
      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]

0
Daryle
9/20/2013 7:06:08 AM
Am 20.09.2013 15:06, schrieb Daryle Walker:
> On Wednesday, September 18, 2013 2:20:09 PM UTC-4, Daniel Kr�gler wrote:
> No, I mean things like I said in the Subject line:
>
>      T[N][]
>      T[N][][][M]
>
> The compiler (rightfully) prevents these when I use these lexical forms.
> But can I create them indirectly via typedefs?

No, you cannot, because those are excluded from valid types, see my
previous quote referring to 8.3.4 [dcl.array] p1. This was already clear
in C++03, where we find a similar constraint in above mentioned paragraph:

"When several �array of� specifications are adjacent, a multidimensional
array is created; the constant expressions that specify the bounds of
the arrays can be omitted only for the first member of the sequence."

>(Make a type-alias to an array
> with unspecified-bound, then use that as the element type for another array
> type-alias.)  I haven't tried this, but I'm extrapolating from the
> "successful" trials with using 0 as an extent.

Please be more precise what you mean by that. In both C++03 and C++11 an
array dimension can only be a positive value or it can be omitted
(unbound) in a type declaration. A zero value is not valid (Some buggy
compilers still accept that though).

>>> With multidimensional arrays, the zero-extent can be at any place.
>>
>> If so, this compiler would be buggy. According to 8.3.4 [dcl.array] p1:
>>
>> "[..] T is called the array element type; this type shall not be a [..],
>> an array of unknown or runtime bound, [..]."
>
> Are you using a C++14 draft?

I quoted wording from a recent draft but that was already true in C++03
and in C++11. The wording was slightly different, because of a CWG issue
improving the state of another issue with arrays,

http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#619

plus by other wording changes due to introduction of "arrays of runtime
bounds", but even in C++03 it was clear, which dimension could be
omitted and which not (see above quote). Note that CWG 619 nor the
introduction of arrays of runtime bounds have actually changed the state
of affairs in this discussion.

> I'm looking at the C++11 Standard, and it bans
> the following as array element types: reference types, (cv-) void, function
> types, and abstract class types.  It doesn't not mention incomplete types in
> general at all nor are arrays of unknown-bound listed.  If C++14 clarifies
> this, I'll be content with that since I'm aiming my code for C++17.

No, this hasn't anything to do with C++14. In C++11, for example, the
relevant part in the standard is 8.3.4 [dcl.array] p3:

"When several �array of� specifications are adjacent, a multidimensional
array is created; only the first of the constant expressions that
specify the bounds of the arrays may be omitted."

> Paragraph 3 of that section, in C++11, says only the first extent can be of
> unknown bound, but it also talks about several "array of" declarations being
> adjacent.  They won't be lexically adjacent if I use stupid typedef tricks,
> so does the Standard just ban them just lexically or indirectly too?

Can you please provide a concrete example that would allow this? IMO the
meaning of "first" is unambiguous in this context.

>> This would be another compiler defect, because applying sizeof to an
>> incomplete type is ill-formed:
>>
>> "The sizeof operator shall not be applied to an expression that has [..]
>> incomplete type, [..], to the parenthesized name of such types, [..]"
>>
>>> * Declaring an array type that has any extent as unbound besides the
> first
>>> flags an error on my GCC 4.7 setup.  But I can indirectly create arrays
>>> with an unbound non-first extent via typedefs in recursive variadic
> class
>>> templates.  When I glanced at the Standard, it seemed to support banning
>>> such array declarations directly, but indirect means didn't seem banned.

I do not understand what you mean by direct or indirect means in this
contact. The standard clearly says that such types are not allowed, it
doesn't distinguish direct or indirect ways to form them.

>>> Are non-first unbound extents actually permitted or not?  (If not, then
>>> GCC 4.7 has a bug there, too.)
>>
>> Again, please provide a concrete, short code example.
>
>      // From memory, not tested (I've changed stuff a lot.)
>      template < typename T, unsigned ...N > struct MyArray;
>
>      template < typename T > struct MyArray {
>          using value_type = T;  // can these combined? or only with
> "typedef"?
>          using data_type = T;
>
>          data_type  data_;
>      };
>
>      template < typename T, unsigned N0, unsigned ...M >
>      struct MyArray<T, N0, M...> {
>          using value_type = T;
>          using element_type = typename MyArray<T, M...>::data_type;
>          using data_type = element_type[N0];
>
>          data_type  data_;
>      };
>
>      // These are all approved, and their "sizeof"s are 0.
>      MyArray<0>     e1, e2[6];
>      MyArray<3, 0>  e3;

This code cannot be well-formed in any reasonable way, please provide a
fixed version. Here is my attempt to fix your code, but it does not lead
to arrays of invalid bounds.

    template <typename T, unsigned ...N > struct MyArray;

    template <typename T >
    struct MyArray<T, 0>
    {
        using value_type = T;
        using data_type = T;
        data_type  data_;
    };

    template <typename T, unsigned N0, unsigned ...M>
    struct MyArray<T, N0, M...> {
        using value_type = T;
        using element_type = typename MyArray<T, M...>::data_type;
        using data_type = element_type[N0];

        data_type  data_;
    };

    MyArray<int, 0>     e1, e2[6];
    MyArray<int, 3, 0>  e3;

I'm getting sizeof values of 4, 24, and 12 for e1, e2, and e3.

HTH & Greetings from Bremen,

Daniel Kr�gler


-- 
      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]

0
windows
9/22/2013 7:24:25 PM
On 23/09/2013 02:24, Daniel Kr�gler wrote:
> Am 20.09.2013 15:06, schrieb Daryle Walker:
>> On Wednesday, September 18, 2013 2:20:09 PM UTC-4, Daniel Kr�gler wrote:
>> No, I mean things like I said in the Subject line:
>>
>>      T[N][]
>>      T[N][][][M]
>>
>> The compiler (rightfully) prevents these when I use these lexical forms.
>> But can I create them indirectly via typedefs?
>
> No, you cannot, because those are excluded from valid types, see my
> previous quote referring to 8.3.4 [dcl.array] p1. This was already clear
> in C++03, where we find a similar constraint in above mentioned paragraph:
>
> "When several �array of� specifications are adjacent, a multidimensional
> array is created; the constant expressions that specify the bounds of
> the arrays can be omitted only for the first member of the sequence."


Daniel has given you the technical answers based on the Standard, but 
perhaps it would help if I explain the reasons for those restrictions 
and why, in a statically bound (i.e. uses a compiler+linker to produce a 
stand alone executable) there is not a way to do it differently and 
retain the fundamental efficiencies of arrays.

Raw arrays (which is what we are dealing with here) were designed in C 
for maximum efficiency both of speed and space. No extra meta-data about 
an array object is stored so that an array of any number of dimensions 
uses only storage for the values. The speed aspect is also provided 
because the running code does not have to look up any meta-data and 
simply trusts the programmer to get it right. Array data is stored as a 
single contiguous block.

In order to support dynamically sized arrays (using malloc in C or new 
in C++) means that access to data is basically through calculating 
addresses (whose values might be stored in pointers for dynamic arrays). 
When we pass information about arrays as arguments to a functions 
parameters we do so either explicitly or implicitly by passing a pointer.

The compiler needs to know how to set up the calculation of the next 
element of an array from the address of the current one. To do that it 
needs to know how the size of the current object so that it can compute 
where the next object ill start.

In a multi-dimensioned array it can always work out the step from a 
single element to the next because it knows the size of the element from 
the elements type. However to calculate the start of the next 'row' it 
needs to know how many elements make up a row. To calculate where the 
next 'page' starts it needs to know how many rows make up a page, etc.

This is why we can sometimes omit the first dimension, the compiler can 
work out the size of an element from the type of an element, but it 
needs to know more to work out other dimensions.

It is worth noting that there is no mechanism for directly creating a 
multi-dimensioned dynamic array. All dynamic arrays have a single 
dimension and to work with multiple dimensions dynamically the 
programmer has to do much more (working with arrays of pointers etc.)

All this is implicit in a statically typed language such as C++ and can 
be quite strange to someone coming from a dynamically typed language 
such as Python or Ruby.

By the way, despite some claims in the past, Java (also statically 
typed) has pointers, they are just not directly available for 
computation by the programmer.

Hope this helps (and others will refine and correct my errors etc.)
Francis






-- 
      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]

0
Francis
9/23/2013 10:20:31 AM
On Sunday, September 22, 2013 8:30:03 PM UTC-4, Daniel Kr�gler wrote:

> I do not understand what you mean by direct or indirect means in this
> contact. The standard clearly says that such types are not allowed, it
> doesn't distinguish direct or indirect ways to form them.

Where the Standard talks about adjacent array specifications, there are two
possible meanings:

1. The specifications are lexically adjacent: "using Z = int[][N]"
2. The specifications are logically adjacent: "using X = int[]; using Y = X[M]"

I wasn't sure of which meaning.  But you state that "adjacent" is logical; that
making an array of an array of unknown bound indirectly via composing type
aliases isn't allowed.

I found a C++14 draft, and it solves the problem unambiguously.  It explicitly
states that an array of unknown bound cannot be used as an array element type.

Daryle W.


-- 
      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
0
Daryle
9/30/2013 2:17:27 AM
{ Please limit your text to fit within 80 columns, preferably around 70,
  so that readers don't have to scroll horizontally to read each line.
  This article has been reformatted manually by the moderator. -mod }

On Monday, September 23, 2013 11:30:03 AM UTC-4, Francis Glassborow wrote:

> It is worth noting that there is no mechanism for directly creating a 
> multi-dimensioned dynamic array. All dynamic arrays have a single 
> dimension and to work with multiple dimensions dynamically the 
> programmer has to do much more (working with arrays of pointers etc.)

I'm working on that.  Making an adaptor class like queue, stack,
or priority_queue.  It takes a container like vector, deque, or
array.  It only does multi-coordinate access, no size-altering
methods.  If you're not using something like array, you have to
set your vector/deque to the final size as you give it to a
constructor.  (It uses begin and advance, so something like deque
works, even if the elements aren't contiguous in memory.)

If you look at the computations of the offset for turning a
one-dimensional array to a row-major or column-major two-dimensional
array, you can generalize the calculations to the inner-product of the
input indexes and the strides for each extent.  So the adaptor can work
with row-major, column-major, and scrambled-major.  But making
sub-arrays is forfeited.  (It's not efficient nor contiguous for
anything besides row-major, anyway.  It only works for built-in arrays
because those are really nested linear arrays.)

Daryle W.


-- 
      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
0
Daryle
9/30/2013 2:20:41 AM
Reply:

Similar Artilces:

[Q] How to escape "\a" "\b" "\c" "\f" "\n" "\r" "\t" "\v" in the string output?
Hi, there. Belows are some example strings which stand for M$ Windows directory path. How can I escape the special meanings like "\a", "\n", "\r" in these M$ Windows directory name strings? C:\amail\dir1\nbar C:\bmail\dir2\tbar C:\cmail\dir3\afoo C:\fmail\dir4\vfoo C:\nmail\dir5\fbar C:\rmail\dir6\abar C:\tmail\dir7\vfoo C:\vmail\dir8\cfoo Thanks in advance. In article <1161145522.072002.20370@m7g2000cwm.googlegroups.com>, "yh" <y.hosang@gmail.com> wrote: > Hi, there. > > Belows are some example strings which stand for M$ Wi...

""""""""""""""""""""""ADD ME""""""""""""""""""""
Hi , Hope you are doing great. Please let me take this opportunity to introduce myself, Iam Karthik working with BhanInfo Inc, a NY based company. We have consultants on our bench on various technologies, my request is to add me to your distribution list and kindly do send me the requirements. i have the below list available 1. Mainframe 2. Java 3.. Financial Analyst 4. Data Architect If there is any vendor ship agreement which has to be signed then I would like to take an opportunity to represent my company and expect your cooperation... We look forward to build a ve...

Gsub!("\n","\n")
Hi all, I'm not sure why but I assumed gsub! would allow me to replace \n with line feeds or \r for carriage returns. How do I gsub! and replace everything with a nonvisible character like newline? I was using this results.gsub!("\n","\n") but obviously that does not work :( also tried results.gsub!("\n",10.chr). No go. Kinda of frustrating for something so simple. I guess I could always do some recursion. Thanks. -- Posted via http://www.ruby-forum.com/. On Jan 19, 2009, at 7:19 PM, Simon Tan wrote: > Hi all, I'm not sure why but I assumed gsub...

"""""""""ADD ME""""""""""
Hi , Hope you are doing great. Please let me take this opportunity to introduce myself, Iam Karthik working with BhanInfoi Inc, a NY based company. We have consultants on our bench on various technologies, my request is to add me to your distribution list and kindly do send me the requirements. i have the below list available 1. Mainframe 2. Java 3.. Financial Analyst 4. Data Architect If there is any vendor ship agreement which has to be signed then I would like to take an opportunity to represent my company and expect your cooperation... ...

How to alias "n1" to "n 1" and "n2" to "n 2" and so on (with style)
I have the following bash function: function ..() { counter=0 case "$1" in [0-9][0-9] ) while [ $counter -lt $1 ] do cd .. counter=$(($counter+1)) done ;; * ) echo "staying where I am, give me a number (<99) next time :)" ;; esac } The allows me to move up, say 4 levels, using ".. 4" Now, typing the space annoys me so I define the following aliases: alias ..='.. 1' alias ..2='.. 2' alias ..3='.. 3' alias ..4='.. 4' alias ..5='.. 5' Not very elegant I con...

Urgent Requirement in """""""""""""NEW YORK""""""""""""""""
Hello Partners, Please find the requirement below. Please send the updated resume along with rate and contact no. REQ#1: Title : Java Developer ( Rating Project) Duration : 6 months Rate : open Location : NY strong java, WebLogic 9.2, Web Services, Oracle REQ#2: Title : Java Developer Duration : 4 months Rate : open Location : NY Strong java, SQL REQ#3: Title : VB.Net Consultant Location : NY Duration : 4 months Rate : open Primarily looking at someone who has Excel, VB.net a...

"or" and "and"
Hi, I'm just getting to discover ruby, but I find it very nice programming language. I just still don't understand how the "or" and "and" in ruby... I was playing with ruby and for example made a def to print Stem and Leaf plot (for those who didn't have a statistics course or slept on it, e.g. http://cnx.org/content/m10157/latest/) Here is the Beta version of it: class Array def n ; self.size ; end def stem_and_leaf(st = 1) # if st != (2 or 5 or 10) then ; st = 1 ; end k = Hash.new(0) self.each {|x| k[x.to_f] += 1 } k = k.sort{|a, b| a[0].to_f <=&g...

"out" and "in out"
Hi i found the following explaination: In Ada, "in" parameters are similar to C++ const parameters. They are effectively read-only within the scope of the called subprogram. Ada "in out" parameters have a reliable initial value (that passed in from the calling subprogram) and may be modified within the scope of the called procedure. Ada "out" parameters have no reliable initial value, but are expected to be assigned a value within the called procedure. What does "have no reliable initial value" mean when considering the "out" parameter? By c...

"/a" is not "/a" ?
Hi everybody, while testing a module today I stumbled on something that I can work around but I don't quite understand. >>> a = "a" >>> b = "a" >>> a == b True >>> a is b True >>> c = "/a" >>> d = "/a" >>> c == d True # all good so far >>> c is d False # eeeeek! Why c and d point to two different objects with an identical string content rather than the same object? Manu Emanuele D'Arrigo wrote: >>>> c = "/a" >>>&...

"If then; if then;" and "If then; if;"
I have a raw data set which is a hierarchical file: H 321 s. main st P Mary E 21 F P william m 23 M P Susan K 3 F H 324 S. Main St I use the folowing code to read the data to creat one observation per detail(P) record including hearder record(H): data test; infile 'C:\Documents and Settings\retain.txt'; retain Address; input type $1. @; if type='H' then input @3 Address $12.; if type='P' then input @3 Name $10. @13 Age 3. @16 Gender $1.; run; but the output is not what I want: 1 321 s. main H 2 321 s. main P Mary E 21 F 3 321 s...

n%/t" Tons Of Fun n%/t"
This site has one of the best game rooms online for fun! Visit the arcade room for excitement at http://www.gabbyinc.net!Also has plenty of free games to enjoy! So pass it on... Z?i"L ...

about "++" and "--"
why this program snippet display "8,7,7,8,-7,-8" the program is: main() { int i=8; printf("%d\n%d\n%d\n%d\n%d\n%d\n",++i,--i,i++,i--,-i++,-i--); } > why this program snippet display "8,7,7,8,-7,-8" Ask your compiler-vendor because this result is IMHO implementation-defined. Check this out: http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.15 http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.16 Regards, Irina Marudina fxc123@gmail.com wrote: > why this program snippet display "8,7,7,8,-7,-8&q...

why "::", not "."
Why does the method of modules use a dot, and the constants a double colon? e.g. Math::PI and Math.cos -- Posted via http://www.ruby-forum.com/. On Oct 26, 2010, at 01:48 , Oleg Igor wrote: > Why does the method of modules use a dot, and the constants a double > colon? > e.g. > Math::PI and Math.cos For the same reason why inner-classes/modules use double colon, because = they're constants and that's how you look up via constant namespace. Math::PI and ActiveRecord::Base are the same type of lookup... it is = just that Base is a module and PI is a float....

"my" and "our"
Hi, while testing a program, I erroneously declared the same variable twice within a block, the first time with "my", the second time with "our": { my $fz = 'VTX_Link'; .... ( around 200 lines of code, all in the same block) our $fz = 'VTX_Linkset'; ... } So the initial contents of the $fz declared with "my" is lost, because "our" creates a lexical alias for the global $fz, thus overwriting the previous "my" declaration. It was my error, no question. But I wonder why Perl doesn't mention this - even with "use s...

Urgent Requirement for """""""""""""""INFORMATICA DEVELOPER"""""""""""""
Hello Partners, How are you ? Please find the requirements below. Title: Database/ETL Developer Duration: 6 months Location: NY Exp: 7+ Locals preferred Database/ETL requirements (Mandatory) Candidate must have worked with financial instruments, preferably Mutual Funds but, Equities are also ok. PL/SQL - packages, Stored procs, Functions, Aggregate functions, Pipelined Functions Informatica 8.6 - especially complex mappings, complex maplets, complex workflows, transformations Oracle 10g/11g Unix/Linux shell scripting ...

Urgent need """""""""""INFORMATICA DEVELOPER"""""""""""""
Hello Partners, How are you ? Please find the requirements below. Title: Database/ETL Developer Duration: 6 months Location: NY Exp: 7+ Locals preferred Database/ETL requirements (Mandatory) Candidate must have worked with financial instruments, preferably Mutual Funds but, Equities are also ok. PL/SQL - packages, Stored procs, Functions, Aggregate functions, Pipelined Functions Informatica 8.6 - especially complex mappings, complex maplets, complex workflows, transformations Oracle 10g/11g Unix/Linux shell scripting Database/ETL requirements (Optional) Data warehousing experience Threading and job concepts in 10g/11g Cost based Optimizer concepts in 10g/11g Must : Experience with XML files and partitioning concepts in Oracle, Collections, Material Views Note : No phone calls please. : send Resumes to karthik@bhaninfo.com Thanks & Regards Karthik BhanInfo karthik@bhaninfo.com ...

[why are trailing '\n's missing in "$x"]: x="$(printf "hi\n\n")"; printf "$x"
Ex ~ $ printf "hi\n\n"|cat -A hi$ $ ~ $ x="$(printf "hi\n\n")" ~ $ printf "$x"|cat -A hi~ $ Why are the trailing '\n's not in "$x"? Is there any way to stop this, w/o using a tempfile? -- thanks! On 12/29/2013 11:34 PM, Name withheld by request wrote: > x="$(printf "hi\n\n")" x="$(printf "%s" "hi\n\n")" Best regards, Cyrus In article <bibnk6Ftcm6U1@mid.individual.net>, Cyrus Kriticos <cyrus.kriticos@googlemail.com> wrote: >...

Should template type deduction try "T &" and "const T &" if "T" fails
GCC gives an error when compiling this: #include <stdio.h> class S { private: S(const S &s); public: S(void) { } }; void print(const S &i) { printf("made it\n"); } template <typename T> void call_print(T t) { print(t); } int main(void) { S s; print(s); call_print(s); return(0); } Seems like, when the instantiation of call_print fails when S is deduced for type parameter T, the compiler could then retry with "S &" for T and then "const S &" for T. Does the Standard prohibit/allow re...

["a", "b", "c", "d"] to "a, b, c, d"?
I want to process each element of an array, but the last element should be handled special. Here is an example: def p_ary(ary) str = "" ary.each do |elem| str << elem << ", " end str.chomp!(", ") str end so p_ary(["a", "f", "x", "test"]) produces "a, f, x, test". The code works, but isn't there an easier and more general way for this behaviour? martinus On Tue, 06 Apr 2004 04:23:22 -0700, Martin wrote: > I want to process each element of an array, but the last ele...

Does it need a ";" at the very after of "if" and "for"
write code like: int main(void) { int a=10; if(a<20) {} } Compiler ok on dev-cpp . don't we have to add a ";" after if statement? marsarden said: > write code like: > > int main(void) > { > int a=10; > if(a<20) > {} > } > > Compiler ok on dev-cpp . don't we have to add a ";" after if > statement? The syntax for 'if' is: if(expression) statement There is no semicolon after the ) but before the statement. The statement is either a normal statement (which can be empty), ending in a semicolon:- if(expr) ...

A problem about "[ ]" "( )" "="
I want to read several images saved in a director,and give them to I1,I2 ,I3....,using the following codes: filelist=dir(['c:\MATLAB701\work\...\*.jpg']); for i=1 :length(filelist) I=imread(fullfile('c:\MATLAB701\work\...',filelist(i).name)); end; but failed. Then I used I(i)=imread... ,still failed. How could I do? "John" <mailofww@126.com> wrote in message news:ef19e12.-1@webx.raydaftYaTP... >I want to read several images saved in a director,and give them to > I1,I2 ,I3....,using the following codes: > filelist=dir(['c:\MATLAB701\work\.....

"In" "Out" and "Trash"
I just bought a new computer and I re-installed Eudora Light on my new computer. But when I open Eudora, the "In", "Out" and "Trash" links are not on the left side of the screen the way they were on my old computer. How can I get these links back on the left side of the screen? Thank you. On 25 Mar 2007 09:49:22 -0700, "abx" <abfunex@yahoo.com> wrote: >I just bought a new computer and I re-installed Eudora Light on my new >computer. But when I open Eudora, the "In", "Out" and "Trash" links >are ...

email-display: "N", "D", " ": yeah; but "O"? How to MARK "O"?
My question: Subject: email-display: "N", "D", " ": yeah; but "O"? How to MARK "O"? Today is the first time ever that I've seen this "O"-mark. What is it? Here's the version I use: > mutt -v Mutt 1.5.10i (2005-08-11) Copyright (C) 1996-2002 Michael R. Elkins and others. Thanks! David David Combs schrieb: > My question: > Subject: email-display: "N", "D", " ": yeah; but "O"? How to MARK > "O"? > > Today is the firs...

n"t =?Big5?B?ue+n3KSjtLqu8A==?= n"t
��ܤ�����>>>>�b�a�u�@�W�[���J www.cashcome.net �b���Gsohoman *W3 ...

Web resources about - Is "T[N][]" (or "T[N][][M]") indirectly legal? - comp.lang.c++.moderated

Resources last updated: 2/22/2016 2:05:53 PM