Search Results

Search found 55882 results on 2236 pages for 'instruction set'.

Page 4/2236 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Adjacency List Tree Using Recursive WITH (Postgres 8.4) instead of Nested Set

    - by Koobz
    I'm looking for a Django tree library and doing my best to avoid Nested Sets (they're a nightmare to maintain). The cons of the adjacency list model have always been an inability to fetch descendants without resorting to multiple queries. The WITH clause in Postgres seems like a solid solution to this problem. Has anyone seen any performance reports regarding WITH vs. Nested Set? I assume the Nested set will still be faster but as long as they're in the same complexity class, I could swallow a 2x performance discrepancy. Django-Treebeard interests me. Does anyone know if they've implemented the WITH clause when running under Postgres? Has anyone here made the switch away from Nested Sets in light of the WITH clause?

    Read the article

  • How to SET ARITHABORT ON for connections in Linq To SQL

    - by Laurence
    By default, the SQL connection option ARITHABORT is OFF for OLEDB connections, which I assume Linq To SQL is using. However I need it to be ON. The reason is that my DB contains some indexed views, and any insert/update/delete operations against tables that are part of an indexed view fail if the connection does not have ARITHABORT ON. Even selects against the indexed view itself fail if the WITH(NOEXPAND) hint is used (which you have to use in SQL Standard Edition to get the performance benefit of the indexed view). Is there somewhere in the data context I can specify I want this option ON? Or somewhere in code I can do it?? I have managed a clumsy workaround, but I don't like it .... I have to create a stored procedure for every select/insert/update/delete operation, and in this proc first run SET ARITHABORT ON, then exec another proc which contains the actual select/insert/update/delete. In other words the first proc is just a wrapper for the second. It doesn't work to just put SET ARITHABORT ON above the select/insert/update/delete code.

    Read the article

  • Java creation of new set too slow

    - by Mgccl
    I have this program where it have some recursive function similar to this: lambda(HashSet<Integer> s){ for(int i=0;i<w;i++){ HashSet<Integer> p = (HashSet) s.clone(); p.addAll(get_next_set()); lambda(p); } } What I'm doing is union every set with the set s. And run lambda on each one of the union. I run a profiler and found the c.clone() operation took 100% of the time of my code. Are there any way to speed this up considerably?

    Read the article

  • Nested Set - for CMS with two versions (edit / publish) mode

    - by Rick
    Hi! I'm looking for a solution (PHP/Symfony/Doctrine) for the following problem. I'm creating a table called 'pages'. This table is a nested set. I also want to create a table called 'pages_published' which has ofcourse also a nested set. Once i create a record in table 'pages' at some point i want to publish this to the 'pages_published)-table. How do make sure the sort order and the level in the structure keeps ok. Is there some standard solution for my approach?

    Read the article

  • How to SET tiggers 0 in MySQL?

    - by Grijesh Chauhan
    In my MySQL database I have some Triggers ON DELETE and ON INSERT. Some time I need to switched-off my some Triggers, And I have to DROP e.g. DROP TRIGGER IF EXISTS hostgroup_before_insert // and reinstall. Is there any shortcut to SET triggers hostgroup_before_insert = 0 like we have for foreign keys mysql> SELECT version(); +-------------------------+ | version() | +-------------------------+ | 5.1.61-0ubuntu0.10.10.1 | +-------------------------+ 1 row in set (0.00 sec) I am new learner and I could not find regarding this on web.

    Read the article

  • Windows Task Scheduler fails on EventData instruction

    - by Pete
    The Scheduled Task fails on the Event Data instruction in this XML: <ValueQueries> <Value name="eventChannel">Event/System/Channel</Value> <Value name="eventRecordID">Event/System/EventRecordID</Value> <Value name="eventData">Event/EventData/Data</Value> </ValueQueries> The other 2 fields can be passed as arguments and the EventData syntax matches other websites, so I don't know why it's failing. This is the Event Viewer XML: <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event"> <System> <Provider Name="Aptify.ExceptionManagerPublishedException" /> <EventID Qualifiers="0">0</EventID> <Level>2</Level> <Task>0</Task> <Keywords>0x80000000000000</Keywords> <TimeCreated SystemTime="2013-11-07T19:39:14.000000000Z" /> <EventRecordID>97555</EventRecordID> <Channel>Application</Channel> <Computer>[Computer Name]</Computer> <Security /> </System> <EventData> <Data>General Information ********************************************* Additional Info: ExceptionManager.MachineName: [Computer Name] ExceptionManager.TimeStamp: 11/7/2013 12:39:14 PM ExceptionManager.FullName: AptifyExceptionManagement, Version=4.0.0.0, Culture=neutral, PublicKeyToken=[key] ExceptionManager.AppDomainName: Aptify Shell.exe ExceptionManager.ThreadIdentity: ExceptionManager.WindowsIdentity: ACA_DOMAIN\pbassett 1) Exception Information ********************************************* Exception Type: Aptify.Framework.BusinessLogic.GenericEntity.AptifyGenericEntityValidationException Entity: Tasks ErrorString: Task Type "Make Contact" is not active. MachineName: [machine] CreatedDateTime: 11/7/2013 12:39:14 PM AppDomainName: Aptify Shell.exe ThreadIdentityName: WindowsIdentityName: [identity] Severity: 0 ErrorNumber: 0 Message: Task Type "Make Contact" is not active. Data: System.Collections.ListDictionaryInternal TargetSite: Boolean Save(Boolean, System.String ByRef, Sys tem.String) HelpLink: NULL Source: AptifyGenericEntity StackTrace Information ********************************************* at Aptify.Framework.BusinessLogic.GenericEntity.AptifyGenericEntity.Save(Boolean AllowGUI, String& ErrorString, String TransactionID)</Data> </EventData> </Event>

    Read the article

  • Why doesn't the F# Set implement ISet<T>?

    - by Sean Devlin
    The .NET Framework is adding an ISet<T> interface with the 4.0 release. In the same release, F# is being added as a first-class language. F# provides an immutable Set<'T> class. It would seem logical to me that the immutable set provided would implement the ISet<T> interface, but it doesn't. Does anyone know why? My guess is that they didn't want to implement an interface intended to be mutable, but I don't think this explanation holds up. After all, their Map<'Key, 'Value> class implements IDictionary, which is mutable. And there are examples elsewhere in the framework of classes implementing interfaces that are only partially appropriate. My other thought is that ISet<T> is new, so maybe they didn't get around to it. But that seems kind of thin. Does the fact that ISet<T> is generic (v. IDictionary, which is not) have anything to do with it? Any thoughts on the matter would be appreciated.

    Read the article

  • Should xml represent a set or a list?

    - by sixtyfootersdude
    I always think of xml like a set data structure. Ie: <class> <person>john</person> <person>sarah</person> </class> Is equivalent to: <class> <person>sarah</person> <person>john</person> </class> Question One: Are these two things logicly equivalant? Are you allowed to make things like this in xml? <methodCall> <param>happy</param> <param>sad</param> </methodCall> Or do you need to do it like this: <methodCall> <param arg="1">happy</param> <param arg="2">sad</param> </methodCall> Question Two: Are these two things logically equivalent? Question Three: Is xml usually treated like a set or a list?

    Read the article

  • NHibernate MySQL Mapping Set Column Type

    - by LnDCobra
    In my MySQL database, I have the following column type. Field | Type | Null | ---------------------------------- Column_priv | set('Select','Insert','Update','References') | No | And I cannot figure out what to map this to. Can anyone tell me how I can map this to something?

    Read the article

  • determine if intersection of a set with conjunction of two other sets is empty

    - by koen
    For any three given sets A, B and C: is there a way to determine (programmatically) whether there is an element of A that is part of the conjunction of B and C? example: A: all numbers greater than 3 B: all numbers lesser than 7 C: all numbers that equal 5 In this case there is an element in set A, being the number 5, that fits. I'm implementing this as specifications, so this numerical range is just an example. A, B, C could be anything.

    Read the article

  • Java - easily convert array to set

    - by Peter
    Hey, I'd like to convert an array to a set in Java. There are some obvious ways of doing this (i.e. with a loop) but I would like something a bit neater, something like: java.util.Arrays.asList(Object[] a); Any ideas? Cheers, Pete

    Read the article

  • how to set the name of the node using userobjects

    - by apoorva
    How to set the node text.Here is the code am using public TreeCreation(final ArrayList houseList){ Apartment= new DefaultMutableTreeNode("Apartment"); for(int i=0;i by passing the userObject the name of the object is being displayed on the node ,how do i change the code to display h.HouseName when am using userObjects node.getUserObject(hs.HouseName);

    Read the article

  • Data Structures for hashMap, List and Set

    - by harigm
    Can any one please guide me to look in depth about the Data Structures used and how is it implemented in the List, Set and Maps of Util Collection page. In Interviews most of the questions will be on the Algorithms, but I never saw anywhere the implementation details, Can any one please share the information.

    Read the article

  • Generate set/get methods for a c++ class

    - by Narek
    Is there any tool that generates set and get methods for a class. Just I create classes very frequently and would like to have a tool which for each class-member wil generate following functions: Member_Type getMemberName() const; void setMemberName(const Member_Type & val);

    Read the article

  • Pseudo code for instruction description

    - by Claus
    Hi, I am just trying to fiddle around what is the best and shortest way to describe two simple instructions with C-like pseudo code. The extract instruction is defined as follows: extract rd, rs, imm This instruction extracts the appropriate byte from the 32-bit source register rs and right justifies it in the destination register. The byte is specified by imm and thus can take the values 0 (for the least-significant byte) and 3 (for the most-significant byte). rd = 0x0; // zero-extend result, ie to make sure bits 31 to 8 are set to zero in the result rd = (rs && (0xff << imm)) >> imm; // this extracts the approriate byte and stores it in rd The insert instruction can be regarded as the inverse operation and it takes a right justified byte from the source register rs and deposits it in the appropriate byte of the destination register rd; again, this byte is determined by the value of imm tmp = 0x0 XOR (rs << imm)) // shift the byte to the appropriate byte determined by imm rd = (rd && (0x00 << imm)) // set appropriate byte to zero in rd rd = rd XOR tmp // XOR the byte into the destination register This looks all a bit horrible, so I wonder if there is a little bit a more elegant way to describe this bahaviour in C-like style ;) Many thanks, Claus

    Read the article

  • Groovy and XML: Not able to insert processing instruction

    - by rhellem
    Scenario Need to update some attributes in an existing XML-file. The file contains a XSL processing instruction, so when the XML is parsed and updated I need to add the instruction before writing it to a file again. Problem is - whatever I do - I'm not able to insert the processing instruction Based on the Java-example found at rgagnon.com I have created the code below Example code ## import groovy.xml.* def xml = '''|<something> | <Settings> | </Settings> |</something>'''.stripMargin() def document = DOMBuilder.parse( new StringReader( xml ) ) def pi = document.createProcessingInstruction('xml-stylesheet', 'type="text/xsl" href="Bp8DefaultView.xsl"'); document.insertBefore(pi, document.documentElement) println document.documentElement Creates output <?xml version="1.0" encoding="UTF-8"?> <something> <Settings> </Settings> </something> What I want <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="Bp8DefaultView.xsl"?> <something> <Settings> </Settings> </something>

    Read the article

  • How to expose a Delphi set type via Soap

    - by Wouter van Nifterick
    I'm currently creating soap wrappers for some Delphi functions so that we can easily use them from PHP, C# and Delphi. I wonder what's the best way to expose sets. type TCountry = (countryUnknown,countryNL,countryD,countryB,countryS,countryFIN,countryF,countryE,countryP,countryPl,countryL); TCountrySet = set of TCountry; function GetValidCountrySet(const LicensePlate:string; const PossibleCountriesSet:TCountrySet):TCountrySet; I'm currently wrapping it like this for the soap server: type TCountryArray = array of TCountry; function TVehicleInfo.GetValidCountrySet(const LicensePlate:string; const PossibleCountriesSet:TCountryArray):TCountryArray; It works, but I need to write a lot of useless and ugly code to convert sets--arrays and arrays--sets. Is there an easier, more elegant, or more generic way to do this?

    Read the article

  • alternative to check, whether a value is in a set

    - by stanleyxu2005
    Hi All, I have the following code. It looks ugly, if the value equals to one of the following value then do something. var Value: Word; begin Value := 30000; if (Value = 30000) or (Value = 40000) or (Value = 1) then do_something; end; I want to refactor the code as follows: var Value: Word; begin Value := 30000; if (Value in [1, 30000, 40000]) then // Does not work do_something; end; However, the refactored code does not work. I assume that a valid set in Delphi accepts only elements with type byte. If there any good alternative to refactor my original code (besides using case)?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >