Search Results

Search found 12194 results on 488 pages for 'reference counting'.

Page 18/488 | < Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >

  • Counting number of children in hierarchical SQL data

    - by moontear
    Hello, for a simple data structure such as so: ID parentID Text Price 1 Root 2 1 Flowers 3 1 Electro 4 2 Rose 10 5 2 Violet 5 6 4 Red Rose 12 7 3 Television 100 8 3 Radio 70 9 8 Webradio 90 For reference, the hierarchy tree looks like this: ID Text Price 1 Root |2 Flowers |-4 Rose 10 | |-6 Red Rose 12 |-5 Violet 5 |3 Electro |-7 Television 100 |-8 Radio 70 |-9 Webradio 90 I'd like to count the number of children per level. So I would get a new column "NoOfChildren" like so: ID parentID Text Price NoOfChildren 1 Root 8 2 1 Flowers 3 3 1 Electro 3 4 2 Rose 10 1 5 2 Violet 5 0 6 4 Red Rose 12 0 7 3 Television 100 0 8 3 Radio 70 1 9 8 Webradio 90 0 I read a few things about hierarchical data, but I somehow get stuck on the multiple inner joins on the parentIDs. Maybe someone could help me out here. moon

    Read the article

  • Counting number of children in hierarchical SQL data

    - by moontear
    for a simple data structure such as so: ID parentID Text Price 1 Root 2 1 Flowers 3 1 Electro 4 2 Rose 10 5 2 Violet 5 6 4 Red Rose 12 7 3 Television 100 8 3 Radio 70 9 8 Webradio 90 For reference, the hierarchy tree looks like this: ID Text Price 1 Root |2 Flowers |-4 Rose 10 | |-6 Red Rose 12 |-5 Violet 5 |3 Electro |-7 Television 100 |-8 Radio 70 |-9 Webradio 90 I'd like to count the number of children per level. So I would get a new column "NoOfChildren" like so: ID parentID Text Price NoOfChildren 1 Root 8 2 1 Flowers 3 3 1 Electro 3 4 2 Rose 10 1 5 2 Violet 5 0 6 4 Red Rose 12 0 7 3 Television 100 0 8 3 Radio 70 1 9 8 Webradio 90 0 I read a few things about hierarchical data, but I somehow get stuck on the multiple inner joins on the parentIDs. Maybe someone could help me out here. moon

    Read the article

  • Add Web Reference prompts for credentials with "Discovery Credential" dialog but won't accept valid

    - by Eden
    I'm attempting to add a web reference to my ASP.Net 3.0 project. This is a reference to the SQL Server Reporting Services web service. I have verified the service is up and running, but when I try to add the web reference in my project, I am prompted for my credentials, which I enter, and then prompted again and again and again. I have to hit cancel to stop the vicious cycle. When I do that the service definition comes up in the window, but the "Add Reference" button is disabled so I can't add the reference to my project. I have limited knowledge of SQL Reporting Services configurations. If anyone knows how to resolve this problem I'd really appreicate it.

    Read the article

  • C++0x Overload on reference, versus sole pass-by-value + std::move?

    - by dean
    It seems the main advice concerning C++0x's rvalues is to add move constructors and move operators to your classes, until compilers default-implement them. But waiting is a losing strategy if you use VC10, because automatic generation probably won't be here until VC10 SP1, or in worst case, VC11. Likely, the wait for this will be measured in years. Here lies my problem. Writing all this duplicate code is not fun. And it's unpleasant to look at. But this is a burden well received, for those classes deemed slow. Not so for the hundreds, if not thousands, of smaller classes. ::sighs:: C++0x was supposed to let me write less code, not more! And then I had a thought. Shared by many, I would guess. Why not just pass everything by value? Won't std::move + copy elision make this nearly optimal? Example 1 - Typical Pre-0x constructor OurClass::OurClass(const SomeClass& obj) : obj(obj) {} SomeClass o; OurClass(o); // single copy OurClass(std::move(o)); // single copy OurClass(SomeClass()); // single copy Cons: A wasted copy for rvalues. Example 2 - Recommended C++0x? OurClass::OurClass(const SomeClass& obj) : obj(obj) {} OurClass::OurClass(SomeClass&& obj) : obj(std::move(obj)) {} SomeClass o; OurClass(o); // single copy OurClass(std::move(o)); // zero copies, one move OurClass(SomeClass()); // zero copies, one move Pros: Presumably the fastest. Cons: Lots of code! Example 3 - Pass-by-value + std::move OurClass::OurClass(SomeClass obj) : obj(std::move(obj)) {} SomeClass o; OurClass(o); // single copy, one move OurClass(std::move(o)); // zero copies, two moves OurClass(SomeClass()); // zero copies, one move Pros: No additional code. Cons: A wasted move in cases 1 & 2. Performance will suffer greatly if SomeClass has no move constructor. What do you think? Is this correct? Is the incurred move a generally acceptable loss when compared to the benefit of code reduction?

    Read the article

  • Visual Studio 2008 resolving wrong reference

    - by e28Makaveli
    In my project file, I have the following entry: <Reference Include="Microsoft.Practices.Unity, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <HintPath>..\..\..\..\Libraries\Microsoft.Practices.Unity.dll</HintPath> </Reference> which in absolute terms translates to: C:\dev\LUT600 2.1.1\OCC600\Libraries Somehow, when I try to compile the project, Visual Studio loads a reference from a totally different path: /reference:"C:\Program Files\Microsoft Enterprise Library 4.1 - October 2008\Bin\Microsoft.Practices.Unity.dll. How it resolves to this location is a complete mystery as this DLL is not referenced anywhere in this project. I have set Specific Verion to true but it still resolves the reference from this location. Any ideas? TIA. Klaus

    Read the article

  • Problem in doing Add Web Reference (http://.../service.asmx)

    - by flopdix
    I am trying to Add a Web Reference to http//.../service.asmx file in my project. First it gives me an error: "... Unable to download following files from: http://.../service.asmx?wsdl Do you want to skip these files and continue ..." When i click 'Yes', the proxy gets created with .disco and other reference files, but does not adds .wsdl file. Other option i tried, i used http//.../service.asmx?wsdl to add web reference. In this case, i dont get any error, but the proxy gets added with .wsdl and reference files, but it does not adds .disco file. Can someone help me on why this is happening? I thought, adding web reference to .asmx should add everything under the proxy.

    Read the article

  • What is the best way to organize Java code since you can't pass by reference?

    - by Adam
    I'm learning how to code in Java after after coming from C. In C I always separated everything into individual functions to make the code easier to follow and edit. I was trying to do this in java but now since I realized that you can't use pointers, I am a bit confused as to what the best way to do this is. So for example I want to have a method that creates four alerts for me. So I pass it an alert builder that can then create the alerts. I can return them in an array, but in my code I already have the alerts individually named, and I would like to keep it that way so I wouldn't need to refer to them as alert[1], alert[2]... etc. So that means I would have to rename them, which would add additional code which would probably be longer than the code in the actual method! Am I thinking about this the right way? Is there anything I can do?

    Read the article

  • C++: Why don't I need to check if references are invalid/null?

    - by jbu
    Hi all, Reading http://www.cprogramming.com/tutorial/references.html, it says: In general, references should always be valid because you must always initialize a reference. This means that barring some bizarre circumstances (see below), you can be certain that using a reference is just like using a plain old non-reference variable. You don't need to check to make sure that a reference isn't pointing to NULL, and you won't get bitten by an uninitialized reference that you forgot to allocate memory for. My question is how do I know that the object's memory hasn't been freed/deleted AFTER you've initialized the reference. What it comes down to is that I can't take this advice on faith and I need a better explanation. Can anyone shed some light? Thanks, jbu

    Read the article

  • void foo(int &x) -> Ruby? Passing integers by reference?

    - by Earlz
    Hello, as a way to spice up my C++ programming homework, I've decided to instead of typing the C++ from the book onto my computer, instead reforming it in Ruby. Yes it's a bit silly, but I'm bored. Anyway, I'm having trouble converting this kind of function to Ruby void swap(int &a,int &b){ int c=b; b=a; a=c } What would the equivalent ruby code looking inside a function ?

    Read the article

  • C++ is there a difference between assignment inside a pass by value and pass by reference function?

    - by Rémy DAVID
    Is there a difference between foo and bar: class A { Object __o; void foo(Object& o) { __o = o; } void bar(Object o) { __o = o; } } As I understand it, foo performs no copy operation on object o when it is called, and one copy operation for assignment. Bar performs one copy operation on object o when it is called and another one for assignment. So I can more or less say that foo uses 2 times less memory than bar (if o is big enough). Is that correct ? Is it possible that the compiler optimises the bar function to perform only one copy operation on o ? i.e. makes __o pointing on the local copy of argument o instead of creating a new copy?

    Read the article

  • how to pass in a reference to a string in javascript?

    - by ijjo
    maybe a closure is my solution? not exactly sure how to pull it off though. the code is set up like so: var globalVar = ''; var globalVar2 = ''; function func() { if (condition) func2(globalVar) else func2(globalVar2) } in func2() i cache some HTML in a main container into the appropriate global variable that i pass to it. basically i have a main container that holds different pages depending on what tab they choose. for performance i want to cache the page into global vars so i need to know what tab is active to figure out which global var to assign the html to.

    Read the article

  • VS 2010 Error “Object reference not set to an instance of an object” when adding Service Reference f

    - by Andy
    I have a VS2010 (RTM) solution which contains: WCF Service project Console WCF client project Class project for DataContracts and members Class project for some simple classes I successfully added a service reference in the console client project and ran the client. I then did a long dev cycle repeatedly modifying the service then updating console service reference. I then changed the namespace and assembly names for the projects as well as the .cs using references and app.config. I of course missed some things as it would not build so I eventually removed the project references and the service reference, cleaned and built successfully. I then attempted to add the service reference again, it discovered it but threw the “Object reference not set to an instance of an object” when OK'ing. Fix in answer below...

    Read the article

  • How to reference a particular JSON in a function call.

    - by Jane Wilkie
    Hi guys! I have two javascript routines.. the first one declares some JSON and it contains a function that takes two arguments, the first argument being the json object that needs traversing and the second argument is the tab that the rendering is done in. The second routine merely passes the name of the JSON that needs traversing and tab to render in. The code is below.... <script language="JavaScript1.2" type="text/javascript"> var arr = [ {"id":"10", "class":"child-of-9", "useless":"donotneed"}, {"id":"11", "class":"child-of-10", "useless":"donotneed"}]; var arrtwo = [ {"id":"12", "class":"child-of-12", "useless":"donotneed"}, {"id":"13", "class":"child-of-13", "useless":"donotneed"}]; function render_help(json,tab){ var html=''; for(var i=0;i<json.length;i++){ var obj = json[i]; for(var key in obj){ var attrName = key; var attrValue = obj[key]; if (attrName == "id"){ html = html +'<B>'+attrValue+'</B>'+'<BR><BR>'; }else if (attrName == "class"){ html = html + attrValue + '<BR><BR>'; } } } document.getElementById(tab).innerHTML=(html); } </script> <script language="JavaScript1.2" type="text/javascript"> render_help(arr,"helptab"); </script> Various testing and strategically placed alert boxes indicate that the tab parameter is being passed and interpreted correctly. I know this because when I change .... document.getElementById(tab).innerHTML=(html); to document.getElementById(tab).innerHTML=("Howdy"); and it renders "Howdy" just fine. Putting an alert box (alert(json)) in to check the value of json yields.... [object.Object],[object.Object] The JSON object remains elusive. For the purposes of this scripting I need the JSON "arr" to be iterated over. I feel like the answer is fairly obvious so far no luck. Admittedly I am new with Javascript and I am apparently missing something. Does anyone have a clue as to what I'm overlooking here? Happy New Year to you all! Janie

    Read the article

  • How to pass a reference to a string in JavaScript?

    - by ijjo
    Maybe a closure is my solution? Not exactly sure how to pull it off though. The code is set up like so: var globalVar = ''; var globalVar2 = ''; function func() { if (condition) func2(globalVar) else func2(globalVar2) } In func2() I cache some HTML in a main container into the appropriate global variable that I pass to it. Basically I have a main container that holds different pages depending on what tab they choose. For performance I want to cache the page into global vars so I need to know what tab is active to figure out which global var to assign the HTML to.

    Read the article

  • Is it legal for a C++ reference to be NULL?

    - by BCS
    A while back I ran into a bug the looked something like this: void fn(int &i) { printf(&i == NULL ? "NULL\n" : "!NULL\n"); } int main() { int i; int *ip = NULL; fn(i); // prints !NULL fn(*ip); // prints NULL return 0; } More recently, I ran into this comment about C++ references: [References arguments make] it clear, unlike with pointers, that NULL is not a possible value. But, as show above, NULL is a possible value. So where is the error? In the language spec? (Unlikely.) Is the compiler in error for allowing that? Is that coding guide in error (or a little ambiguous)? Or am I just wandering into the minefield known as undefined behavior?

    Read the article

  • Why won't gcc compile a class declaration as a reference argument?

    - by Jorge
    This compiles fine in Visual studio, but why not in XCode? class A() {}; someMethod(A& a); someMethod(A()); //error: no matching function call in XCode only :( Is this bad form? it seems annoying to have to write the following every time: A a(); someMethod(a); //successful compile on Xcode Am i missing something? I am not very experienced so thank you for any help!

    Read the article

  • How to return a const QString reference in case of failure?

    - by moala
    Hi, consider the following code: const QString& MyClass::getID(int index) const { if (i < myArraySize && myArray[i]) { return myArray[i]->id; // id is a QString } else { return my_global_empty_qstring; // is a global empty QString } } How can I avoid to have an empty QString without changing the return type of the method? (It seems that returning an empty QString allocated on the stack is a bad idea) Thanks.

    Read the article

  • (Rails) How do I reference resources from non-restful views...?

    - by humble_coder
    Hi All, How do you ensure that your javascript includes get included properly for all files everywhere using a particular layout? Basically I have some non-restful actions that I've added. I haven't added any ROUTES for them, however, using normal text rendering works fine. It's when I start requiring different "swf" and "js" files (files which are properly placed in PUBLIC) that things get hairy. I start receiving "406 Not Acceptable" errors telling me that it's looking for the files in a subdirectory of the current controller. As it stands I'm in including the JS in "application" layout file. It works for the INDEX action, but doesn't seem to work for any of the non-restful actions. Thoughts?

    Read the article

  • program "is not up to date" execution error in wedit lcc-win32

    - by Rowhawn
    I'm attempting to compile a simple hello world program in c with lcc-win32/wedit, and i'm a little unfamiliar with windows c programming. #include int main(void){ printf("hellow\n"); return 0; } When I compile the program the console output is Wedit output window build: Tue Jun 15 09:13:17 2010 c:\lcc\lib\lcccrt0.obj .text: undefined reference to '_RtlUnwind@16' c:\lcc\lib\lcccrt0.obj .text: undefined reference to '_signal' c:\lcc\lib\lcccrt0.obj .text: undefined reference to '_raise' c:\lcc\lib\lcccrt0.obj .text: undefined reference to '_exit' asctoq.obj .text: undefined reference to '_strnicmp' defaulttrap.obj .text: undefined reference to 'imp_iob' defaulttrap.obj .text: undefined reference to '_fwrite' defaulttrap.obj .text: undefined reference to '_itoa' defaulttrap.obj .text: undefined reference to '_strcat' defaulttrap.obj .text: undefined reference to '_MessageBoxA@16' defaulttrap.obj .text: undefined reference to '_abort' powlasm.obj .text: undefined reference to '_pow' qfloat.obj .text: undefined reference to '_memset' qfloat.obj .text: undefined reference to '_strchr' qfloat.obj .text: undefined reference to '_memmove' strlcpy.obj .text: undefined reference to '_memcpy' xprintf.obj .text: undefined reference to '_localeconv' xprintf.obj .text: undefined reference to '_strtol' xprintf.obj .text: undefined reference to '_wcslen' xprintf.obj .text: undefined reference to '_wctomb' xprintf.obj .text: undefined reference to '_fputc' search Compilation + link time:0.1 sec, Return code: 60 when I attempt to execute the program within wedit i get a dialog box that says "hello.exe is not up-to-date. Rebuild?" If I click yes, nothing happens. If I click no, a dos window pops up saying "C:\lcc\projects\lcc2\hello.exe" Return code -1 Execution time 0.001 seconds Press any key to continue... This continues to happen no matter how many times i compile/rebuild. Any ideas?

    Read the article

  • Website --> Add Reference also creates files with pdb extensions

    - by SourceC
    Hello, Q1 Any assemblies stored in Bin directory will automatically be referenced by web application. We can add assembly reference via Website -- Add Reference or simply by copying dll into Bin folder. But I noticed that when we add reference via Website -- Add Reference, that additional files with .pdb extension are placed inside Bin. If these files are also needed, then why does reference still work even if we only place referenced dll into Bin, but not pdb files Q2 It appears that if you add a new item to web project, this class will automatically be added to project list and we can reference it from all pages in this project. So are all files added to project list automatically being referenced ? thanx EDIT: On your second question, you are adding a public class to a namespace so will be visible to other classes in that project and in that namespace. I don’t know much about assemblies, but I’d assume the reason why item( class ) added to the project is visible to other classes in that project is for the simple fact that in web project all classes get compiled into single assembly and for the fact that public classes contained in the same assembly are always visible to each other? much appreciated

    Read the article

  • Cross-reference of computers having virtualization technology [closed]

    - by msorens
    When considering obtaining a new computer one of my prerequisites is the ability to load Windows 8 in a virtual machine (using VirtualBox). A prerequisite for that is that the host computer have virtualization technology. I located an Intel cross reference of chips having virtualization technology but I am trying to find a "higher level" cross reference between computer models and virtualization technology availability, skipping the extra step of having to first look up what CPU chip is in a machine, then cross-referencing that on Intel's list.

    Read the article

< Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >