Search Results

Search found 6605 results on 265 pages for 'complex networks'.

Page 180/265 | < Previous Page | 176 177 178 179 180 181 182 183 184 185 186 187  | Next Page >

  • How to access java collection, just like the table in the database, having indexes and LINQ-like que

    - by Shaman
    This task occurs from time to time in my projects. I need to handle a collection of some complex elements, having different attributes, such as login, password_hash, role, etc. And, I need to be able to query that collection, just like I query a table in the database, having only partial data. For example: get all users, with role "user". Or check, if there's a user with login "root" and role "superuser". Removing items, based on same data is also needed. The first attempt I've tried is to use Google collections, Apache collections, and lambdaj. All of them have very similar preicate mechanism, but with a great disadvantage: it is based on iteration, one by one, over the collection of items, which is not good, for often used collections, containing big amounts of data. Could you please suggest me some solution? Thanks.

    Read the article

  • How to get a dynamic attribute name in cfloop over query in ColdFusion

    - by Kip
    I'm inside a cfloop over a query. I want to get an attribute, but I won't know what that attribute will be until runtime. Using #qryResult[MyAttr]# fails with the error "Complex object types cannot be converted to simple values." What is the syntax for doing this? Here is a simplified example: <cfquery datasource="TestSource" name="qryResult"> SELECT * FROM MyTable </cfquery> <cfloop query="qryResult"> <cfset MyAttr="autoid" /> <cfoutput> Test 1: #qryResult.autoid# <br/> <!--- succeeds ---> Test 2: #qryResult[MyAttr]# <br/> <!--- fails ---> </cfoutput> </cfloop>

    Read the article

  • Is there a way to use a dictionary or xml in the Application Settings?

    - by Shimmy
    I have to store a complex type in the application settings. I thought that storing it as XML would work best. The problem is I don't know how store XML. I prefer to store it as a managed XML rather than using just a string of raw XML having to parse it on each access. I managed to set the Type column of the setting to XDocument, but I was unable to set its value. Is there a way to use XDocument or XML in application settings? Update I found a way, simply by editing the .settings file with the xml editor. I changed it to a custom serializable dictionary, but I get the following error when I try to access the setting-property (I set it to a serialized representation of the default value). The property 'Setting' could not be created from it's default value. Error message: There is an error in XML document (1, 41). Any ideas will be appreciated.

    Read the article

  • Is there a way to use XDocument in the Application Settings?

    - by Shimmy
    I have to store a complex type in the application settings. I thought that storing it as XML would work best. The problem is I don't know how store XML. I prefer to store it as a managed XML rather than using just a string of raw XML having to parse it on each access. I managed to set the Type column of the setting to XDocument, but I was unable to set its value. Is there a way to use XDocument or XML in application settings?

    Read the article

  • Combining the value of GetLastError and a custom error message

    - by Jessica
    I have a function that returns a different DWORD value for each case there is an error. So I have the following defines: #define ERR_NO_DB_CONNECTION 0x90000 #define ERR_DB_NOT_OPEN 0x90001 #define ERR_DB_LOCKED 0x90002 #define ERR_DB_CONN_LOST 0x90003 Now, I return those values when an error occurs. I need to also return the value of GetLastError in the same return. No, I can't read it later. I tried combining it different ways, eg: return ERR_DB_NOT_OPEN + GetLastError(); and then extract the error by subtracting the value of ERR_DB_NOT_OPEN but since I need to use this in functions where there can be several return values it can get quite complex to do that. Is there any way to achieve this? I mean, combine the value + GetLastError and extract them later? Code is appreciated. Thanks Jess.

    Read the article

  • Show me some cool python list comprehensions

    - by christangrant
    One of the major strengths of python and a few other (functional) programming languages are the list comprehension. They allow programmers to write complex expressions in 1 line. They may be confusing at first but if one gets used to the syntax, it is much better than nested complicated for loops. With that said, please share with me some of the coolest uses of list comprehensions. (By cool, I just mean useful) It could be for some programming contest, or a production system. For example: To do the transpose of a matrix mat >>> mat = [ ... [1, 2, 3], ... [4, 5, 6], ... [7, 8, 9], ... ] >>> [[row[i] for row in mat] for i in [0, 1, 2]] [[1, 4, 7], [2, 5, 8], [3, 6, 9]] Please include a description of the expression and where it was used (if possible).

    Read the article

  • Dropdown binding and postbacks - ASP.NET

    - by DotnetDude
    I have a rather complex page. The ASPX page loads a user control which in turn loads a child User control. Parent Control protected override void OnInit(EventArgs e) { //Loads child control } In the child user control, I use custom control that inherits from System.Web.UI.HtmlControls.HtmlSelect ASCX: <cust:CustDropDownList id="ctlDdl" runat="server"/> ASCX.CS protected void Page_Load(object sender, EventArgs e) { //Binds CtlDdl here } When the user clicks on the Save button, the controls get user controls get dynamically reloaded, but Iose the value the user has selected in the dropdown. I run into the chicken and egg problem here. I think I need to bind the ctlDdl only on if its not a postback, but that results in the dropdown not getting populated. If I bind it everytime, then i lose user's selection EDIT: Can someone respond to my comment to Jonathan's answer? Thanks

    Read the article

  • Drupal, Views.. how to display views list + complete node, interactively ?

    - by Patrick
    hi, I'm using Views in Drupal to show node teasers. I would like now to show the complete node on the left side of my page, nearby the Views, and update it when the user click on a different teaser (better using AJAX). what's the best method to implement it. I was considering to use a lightbox, but it a bit complex (a lot of complications... such as parsing the content with javascript again.. etc). See screenshot: http://dl.dropbox.com/u/72686/viewsAndNode.png Thanks

    Read the article

  • What is a valid and reasonable alternative to a massive storage approach?

    - by Backo
    I am using Ruby on Rails 3.2.2 and MySQL. After my previous question on "how to handle massive storage of records in database for user authorization purposes", since related answers (on how to solve the issue or how to accomplish to that I am looking for) aren't sufficiently detailed or require to much resources (at least for me), I would like to know what are valid and reasonable alternatives to that approach. In few words, this question could be phrase as: how to handle "complex" (at level of SQL querying) user authorizations when you have to fetch "authorized" records? That is, for example, how to retrieve records when you would use code like the following (the following code would be used mostly in index controller actions): Article.readable_by_user(@current_user) # => Returns all articles readable by the current user.

    Read the article

  • SQL SELECT multiple INNER JOINs

    - by Noam Smadja
    The SELECT statement includes a reserved word or an argument name that is misspelled or missing, or the punctuation is incorrect its Access database.. i have a Library table, where Autnm Topic Size Cover Lang are foreign Keys each record is actually a book which has its properties such as author and stuff. i am not quite sure i am even using the correct JOIN.. quite new with "complex" SQL :) SELECT Library.Bknm_Hebrew, Library.Bknm_English, Library.Bknm_Russian, Library.Note, Library.ISBN, Library.Pages, Library.PUSD, Author.ID AS [AuthorID], Author.Author_hebrew AS [AuthorHebrew], Author.Author_English AS [AuthorEnglish], Author.Author_Russian AS [AuthorRussian], Topic.ID AS [TopicID], Topic.Topic_Hebrew AS [TopicHebrew], Topic.Topic_English AS [TopicEnglish], Topic.Topic_Russian AS [TopicRussian], Size.Size AS [Size], Cover.ID AS [TopicID], Cover.Cvrtyp_Hebrew AS [CoverHebrew], Cover.Cvrtyp_English AS [TopicEnglish], Cover.Cvrtyp_Russian AS [CoverRussian], Lang.ID AS [LangID], Lang.Lang_Hebrew AS [LangHebrew], Lang.Lang_English AS [LangEnglish], FROM Library INNER JOIN Author ON Library.Autnm = Author.ID INNER JOIN Topic ON Library.Topic = Topic.ID INNER JOIN Size ON Library.Size = Size.ID INNER JOIN Cover ON Library.Cover = Cover.ID INNER JOIN Lang ON Library.Lang = Lang.ID Thx in advance

    Read the article

  • What features do you expect from a Java (Rich) Client Framework?

    - by Peter Walser
    I'm intending to design (and provide a reference implementation for) a new Swing Rich Client Framework. My job and personal experience covers many project-specific Swing client frameworks as well as the Eclipse RCP, and every one of them had some original and clever concepts, but also drawbacks and rigid realizations. My plan is to incorporate the best of those concepts and features into a new framework whose core is very open and extendable. For my must-have-features list, I'm counting on your input and hope you can share some concept pearls & diamonds you've encountered in other frameworks, or features you always wanted to have or have in a better way. The framework is intended for very simple to very complex and sophisticated projects for clients that need full i18n for richt clients that execute some or all of the non-presentation logic on the server to be very lightweight to be easy to learn and use Thanks in advance for sharing your insights :)

    Read the article

  • How to get balanced diagrams from graphviz?

    - by user360872
    Is there a setting in graphviz to generate balanced diagrams like this: When diagram is more complex like below - it isn't balanced like that above (4 is below **). Code to generate second diagram: graph { n1 [label="+"]; n1 -- n2; n2 [label="/"]; n2 -- n3; n3 [label="*"]; n3 -- n4; n4 [label="1"]; n3 -- n5; n5 [label="2"]; n2 -- n6; n6 [label="3"]; n1 -- n7; n7 [label="**"]; n7 -- n8; n8 [label="4"]; n7 -- n9; n9 [label="5"]; }

    Read the article

  • Why are there two implementations of std::sort (with and without a comparator) rather than one implementation with a default template parameter?

    - by PolyVox
    In my code I'm adopting a design strategy which is similar to some standard library algorithms in that the exact behavior can be customized by a function object. The simplest example is std::sort, where a function object can control how the comparison is made between objects. I notice that the Visual C++ provides two implementations of std::sort, which naturally involves code duplication. I would have imagined that it was instead possible to have only one implementation, and provide a default comparator (using operator< ) as a default template parameter. What is the rational behind two separate versions? Would my suggestion make the interface more complex in some way? Or result in confusing error messages when the object does not provide operator Thanks, David

    Read the article

  • Storing an arbitrary R object onto HDD?

    - by Harokitty
    I understand that we can export data matrices to csv or xlsx files. What about complex objects like lm? For example, in my work I might have a list of length 1000, each with a single lm() object. Each time I load R I have to wait a long time to populate the 1000 length list with these lm objects with a for loop or a lapply. I would rather just save the list somewhere on my HDD at the end of a session and open it at the start of the next session.

    Read the article

  • MySQL Returns wrong values on SELECT statement

    - by Andrew K
    All, I'm wondering if this is a MySQL bug, but since I've seen others playing with larger numbers than this, I'm thinking I'm doing something wrong here. Here is my table structure for the table I'm querying: mysql describe ipspace6\G ************* 1. row ************* Field: id Type: decimal(39,0) unsigned Null: NO Key: Default: NULL Extra: ************* 2. row ************* Field: addr Type: decimal(39,0) unsigned Null: NO Key: PRI Default: 0 Extra: ************* 3. row ************* Field: netmask Type: decimal(39,0) unsigned Null: NO Key: Default: 0 Extra: ************* 4. row ************* Field: subnet Type: int(4) Null: NO Key: Default: NULL Extra: Now, I run a simple SELECT statement against the "id" column: mysql SELECT id FROM ipspace6 WHERE id='50552019118453823914642686339427860480'; +----------------------------------------+ | id | +----------------------------------------+ | 50552019118453823730175245602332344320 | | 50552019118453823730175245602332344320 | | 50552019118453823914642686339427860480 | | 50552019118453823914642686339427860480 | +----------------------------------------+ ...What the heck is going on here? Two of these results are valid, and two definitely are not. It's not like I'm doing some super-complex nested query or anything, this is simple stuff, and it's driving me insane. Help, anyone?

    Read the article

  • Is it safe to use a subversion feature branch after reintegrate-merged to trunk?

    - by ripper234
    Must a feature branch be deleted after it's merged (reintegrated) back to trunk? I prefer to constantly merge changes back and forth from my feature branch - I believe this keeps the conflicts to a minimum. Yet I understand that once you use the reintegrate merge to trunk, a feature branch should be deleted. Is it so? Why? What can I do to circumvent this? Update I'm asking about technical problems that come from the tool, not "methodology concerns". I intend to keep working on the feature branch after the merge. Update the top answer indeed specifies a rather complex procedure (merge, delete & rebranch). Is there an easy way to accomplish this in TortoiseSVN? Shouldn't there be?

    Read the article

  • How to read changed values with native query during one transaction? (Spring and JPA)

    - by knarf1983
    We have container transaction with Spring and JPA (Hibernate). I need to make an update on a table to "flag" some rows via native statements. Then we insert some rows via EntityManager from JPATemplate to this table. After that, we need to calculate changes in the table via native statement (with Oracle's union and minus, complex groups...) I see that changes from step 1 and 2 are not commited and thats why the statement from 3 fails. I already tried with transaction propagation REQUIRES_NEW, EntityManager.flush... Didn't work. 1) update SOMETABLE acolumn = somevalue (native) 2) persist some values into SOMETABLE (via entity manager) 3) select values from SOMETABLE Is there a possibility to read the changes from step 1 and 2 in step 3?

    Read the article

  • Adding behaviour to a set of classes

    - by devoured elysium
    I have defined an Event class: Event and all the following classes inherit from Event: SportEventType1 SportEventType2 SportEventType3 SportEventType4 Right now I will only have SportEvents but I don't know if in the future I'll want some other kind of events that doesn't even have anything to do with Sports. Later, I will want to draw some graphics with info taken from Events, and the drawing logic can be a bit complex. But, for the moment, I think I shouldn't think of how the drawing will be done and I believe that maybe it'd be better if that drawing part was not put as an integral part of the Event/SportEventX class chain. I am looking for solutions for this problem. I know I could just make Event have an instance variable(attribute, for the java crowds) pointing to something as an IDrawInterface, but that would make the Event class "assume" it will be later used for drawing. I would like to make the Event class oblivious to this if possible. Thanks!

    Read the article

  • Optimality of Binary Search

    - by templatetypedef
    Hello all- This may be a silly question, but does anyone know of a proof that binary search is asymptotically optimal? That is, if we are given a sorted list of elements where the only permitted operation on those objects is a comparison, how do you prove that the search can't be done in o(lg n)? (That's little-o of lg n, by the way.) Note that I'm restricting this to elements where the only operation permitted operation is a comparison, since there are well-known algorithms that can beat O(lg n) on expectation if you're allowed to do more complex operations on the data (see, for example, interpolation search). Thanks so much! This has really been bugging me since it seems like it should be simple but has managed to resist all my best efforts. :-)

    Read the article

  • Python+suds : xsd_base64Binary type ?

    - by n1r3
    Hi, I'm trying to attach some files to a Jira using the Soap API. I have python 2.6 and SOAPpy isn't working any more, so, I'm using suds. Everything is fine except for the attachements ... I don't know how to rewrite this piece of code : http://confluence.atlassian.com/display/JIRA/Creating+a+SOAP+Client?focusedCommentId=180943#comment-180943 Any clue ? I don't know how to deal with complex type like this one : <complexType name="ArrayOf_xsd_base64Binary"> <complexContent> <restriction base="soapenc:Array"> <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:byte[][]"/> </restriction> </complexContent> </complexType> thanks a lot n.

    Read the article

  • Is there any way to print the actual query that mysqli->execute() makes?

    - by 0plus1
    I have a complex query that gets executed like this: if ($stmt = $dbi->prepare($pt_query)) { $stmt->bind_param('ssssssssi', $snome,$scognome,$ssocieta,$svia,$slocalita,$sprovincia,$scap,$stelefono,$sfax,$uid); $stmt->execute(); echo $dbi->error; $stmt->close(); } else { printf("Error -> %s\n", $dbi->error); } This thing is failing without any error, it simply doesn't update the database. Since there is a ton of data that gets treated before this thing I would like to know if there is any way to show the actual query that mysqli is executing in order to understand where the problem is. Thank you.

    Read the article

  • Status corresponding to Minimum value

    - by Lijo
    Hi Team, I am using SQL Server 2005. I have a table as given below. There can be multiple cancellations for each FundingID. I want to select the FundingCancellationReason corrersponding to minimum date for each funding. I wrote a query as follows. It is an SQL error 1) Could you please help me to avoid the SQL Error? 2) Is there any better logic to achieve the same? CREATE TABLE #FundingCancellation( [FundingCancellationID] INT IDENTITY(1,1) NOT NULL, [FundingID] INT , FundingCancellationDt SMALLDATETIME , FundingCancellationReason VARCHAR(50) ) SELECT FundingID, MIN(FundingCancellationDt), ( SELECT FundingCancellationReason FROM #FundingCancellation FC2 WHERE FC1.FundingID = FC2.FundingID AND FC2.FundingCancellationDt = MIN(FundingCancellationDt) ) [Reason Corresponding Minimum Date] FROM #FundingCancellation FC1 GROUP BY FundingID -- An aggregate may not appear in the WHERE clause unless it is in a subquery contained in a HAVING clause or a select list, and the column being aggregated is an outer reference. I have seen the similar approach working in a somewhat complex query. So I believe tehre will be a way to correct my query Thanks Lijo

    Read the article

  • Disposing a Bitmap through its Finalizer

    - by devoured elysium
    I have a complex program in which I have to first create, then use wrappers around bitmaps and send them across a lot of different classes. The problem in the end is deciding which classes should dispose the bitmaps. Most of the time the end classes don't know if they can indeed dispose the bitmap as the same bitmap can be used in several places. Also, I can't just copy the bitmaps because this is a kind of resource intensive algorithm and doing it would be dead slow. I looked up on reflector for Image/Bitmap's implementations and they seem to use the Dispose Pattern. So, even if I don't call Dispose(), the CLR will eventually call it some other time. Is it too bad if I just let the bitmaps be as they are, and let the finalizer take care of them?

    Read the article

  • Dropdown list with a "Select All" option

    - by shawnboy
    I have three dropdown boxes, Region, District, and City. I want my District dropdown to have a "Select All" option so the user can get all Cities in the Region, else just display the City based on the selected District. My query looks like this: IF @district =-2 THEN (SELECT DISTINCT city FROM myTable WHERE RIGHT(Region, 3) = ?) ORDER BY city) ELSE (select DISTINCT city FROM myTable WHERE District = ?) Order by city I'm using vb.net/sql I couldn't find any complex case scenarios in my search either. Any sugguestions would be appreciated!

    Read the article

  • How do I determine darker or lighter color variant of a given color?

    - by Nidonocu
    Given a source color of any hue by the system or user, I'd like a simple algorithm I can use to work out a lighter or darker variants of the selected color. Similar to effects used on Windows Live Messenger for styling the user interface. Language is C# with .net 3.5. Responding to comment: Color format is (Alpha)RGB. With values as bytes or floats. Marking answer: For the context of my use (a few simple UI effects), the answer I'm marking as accepted is actually the most simple for this context. However, I've given up votes to the more complex and accurate answers too. Anyone doing more advanced color operations and finding this thread in future should definitely check those out. Thanks SO. :)

    Read the article

< Previous Page | 176 177 178 179 180 181 182 183 184 185 186 187  | Next Page >