Search Results

Search found 11197 results on 448 pages for 'related'.

Page 58/448 | < Previous Page | 54 55 56 57 58 59 60 61 62 63 64 65  | Next Page >

  • Get a queryset of objects through an intermediary model

    - by skyl
    I want get all of the Geom objects that are related to a certain content_object (see the function I'm trying to build at the bottom, get_geoms_for_obj() class Geom(models.Model): ... class GeomRelation(models.Model): ''' For tagging many objects to a Geom object and vice-versa''' geom = models.ForeignKey(Geom) content_type = models.ForeignKey(ContentType) object_id = models.PositiveIntegerField() content_object = generic.GenericForeignKey() def get_geoms_for_object(obj): ''' takes an object and gets the geoms that are related ''' ct = ContentType.objects.get_for_model(obj) id = obj.id grs = GeomRelation.objects.filter( content_type=ct, object_id=id ) # how with django orm magic can I build the queryset instead of list # like below to get all of the Geom objects for a given content_object geoms = [] for gr in grs: geoms.append(gr.geom) return set(geoms) # A set makes it so that I have no redundant entries but I want the # queryset ordering too .. need to make it a queryset for so many reasons...

    Read the article

  • How to set different colors to the bars in stacked bar chart in ireport ?

    - by Purushotham
    Hi, I need to set a unique color to each bar in the stacked bar chart. Whatever the color I see in one bar it shouldn't be repeated in any other bar or any other stack. For example: I have 5 bars in the report. Each bar has 3 different stacks. I want to apply a red related colors to the first bar and its stacks. Second bar should have blue related colors. etc.. It is showed in the attached image. The image shows a very basic requirement what we want. Just created using a normal ms paint. Stacked Bar MS Paint Image

    Read the article

  • Can I find out if the java program was launched using java or javaw

    - by saugata
    This is related to an earlier question by a different user How to detect that code is running inside eclipse IDE I noticed that eclipse always launches programs with javaw rather than java. (This does not imply a program launched with javaw was launched from eclipse). I can find the arguments passed using RuntimeMXBean RuntimemxBean = ManagementFactory.getRuntimeMXBean(); List<String> lst=RuntimemxBean.getInputArguments(); for(int i=0;i<lst.size();i++) System.out.println(lst.get(i)); But this does not tell me whether it was launched using java or javaw. Is there any way to find it out? Another related question is why does eclipse use javaw to launch programs?

    Read the article

  • Looking for a free tool to visualize object relationships for C#

    - by vfilby
    Here is my ideal solution: a free tool that reads a .csporj or .sln and generates a pretty picture that shows all the objects and how they are related. By relationships, I don't mean inheritance but rather dependency. For example, if we have a Car object and Car has a member variable Wheel, I would like that Car depends on Wheel to be visualized in the graph. I know visual studio can do inheritance graphs, but that is only half of what I am looking for. Is what I am looking for possible? Are there any tools that do something similar? Related question for java: http://stackoverflow.com/questions/1824261/are-there-any-tools-to-visualize-the-objects-being-used-in-a-program

    Read the article

  • What coding standards do you follow?

    - by Mark Szymanski
    I was just curious what coding standards people followed. I for one use the following: Brackets ALWAYS go on the next line. For instance: int main() { //Blah... } I never use code folding. (Yes my IDE's do support it (Xcode and Eclipse). Put related functions/methods single-spaced, otherwise double space. Here is an example: int foo = 0; printf("%d",foo); those are related while these are not: printf("Hello, World!"); return(0); I don't put else statements on the same line as the closing bracket for the preceding if statement. Most of the time in Java if a program needs multiple try catch statements I will just put the whole thing in one try catch.

    Read the article

  • virtual function call from base class

    - by Gal Goldman
    Say we have: Class Base { virtual void f(){g();}; virtual void g(){//Do some Base related code;} }; Class Derived : public Base { virtual void f(){Base::f();}; virtual void g(){//Do some Derived related code}; }; int main() { Base *pBase = new Derived; pBase-f(); return 0; } Which g() will be called from Base::f()? Base::g() or Derived::g()? Thanks...

    Read the article

  • Swing Timer in Conjunction with Possible Long-running Background Task

    - by javacavaj
    I need to perform a task repeatedly that affects both GUI-related and non GUI-related objects. One caveat is that no action should performed if the previous task had not completed when the next timer event is fired. My initial thoughts are to use a SwingTimer in conjunction with a javax.swing.SwingWorker object. The general setup would look like this. class { timer = new Timer(speed, this); timer.start(); public void actionPerformed(ActionEvent e) { SwingWorker worker = new SwingWorker() { @Override public ImageIcon[] doInBackground() { // potential long running task } @Override public void done() { // update GUI on event dispatch thread when complete } } } Some potential issues I see with this approach are: 1) Multiple SwingWorkers will be active if a worker has not completed before the next ActionEvent is fired by the timer. 2) A SwingWorker is only designed to be executed once, so holding a reference to the worker and reusing (is not?) a viable option. Is there a better way to achieve this?

    Read the article

  • Unusual Subversion Folders Appeared After Update

    - by Mark Lansdown
    Hello Everyone, I have been using Subversion for about 2 years to manage a large C# project. On a recent Subversion update, a number of new folders were added to my source code folder: \conf \db \locks \hooks 35+ files were also added during the update, all appearing under the 4 new folders. I haven't changed any client (I use TortoiseSVN) or server software related to Subversion, so I'm puzzled why these folders and files were suddenly introduced. It also seems strange that files seemingly related to the internal workings of Subversion are now part of my source code repository. Can anyone shed some light on why this happened? Thanks in advance, Mark

    Read the article

  • iPhone - making the crash information more specific

    - by Digital Robot
    I have an app that is crashing at some point. Even with NSZombieEnabled turned on, the only thing I see is this message on the console: : * -[CFRunLoopTimer release]: message sent to deallocated instance 0x4cb34e0 but as the app is crashed, there's no way to know what object is this and the thread overview is not helping that much. #0 0x34a80466 in objc_msgSend #1 0x357e53c8 in CFRelease #2 0x357f3976 in __CFTypeCollectionRelease #3 0x3580c0b6 in __CFSetReleaseValue #4 0x357e6a5c in __CFBasicHashDrain #5 0x357e6900 in __CFSetDeallocate #6 0x357e54b6 in _CFRelease #7 0x357e53dc in CFRelease #8 0x3580c098 in -[__NSCFSet release] #9 0x3570f3be in -[_NSFaultingMutableSet dealloc] #10 0x3570f260 in -[_NSFaultingMutableSet release] #11 0x35702480 in -[NSManagedObject(_NSInternalMethods) _clearRawPropertiesWithHint:] #12 0x357022a8 in -[NSFaultHandler turnObject:intoFaultWithContext:] #13 0x35703dc0 in -[NSManagedObject dealloc] #14 0x356eab34 in -[_PFManagedObjectReferenceQueue _processReferenceQueue:] #15 0x357127d6 in _performRunLoopAction #16 0x3580ac58 in __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ #17 0x3580aacc in __CFRunLoopDoObservers #18 0x358020ca in __CFRunLoopRun #19 0x35801c86 in CFRunLoopRunSpecific #20 0x35801b8e in CFRunLoopRunInMode #21 0x320c84aa in GSEventRunModal #22 0x320c8556 in GSEventRun #23 0x341dc328 in -[UIApplication _run] #24 0x341d9e92 in UIApplicationMain #25 0x00002e02 in main at main.m:14 it appears to be something related to core data, but knowing that doesn't help that much, because the app is all core data based and it crashes when I am not doing anything related to core data. is there a way to make the debugger more specific? thanks

    Read the article

  • Is there a buffer size attached to stdout?

    - by jameswelle
    I am trying to find some information on data limits related to stdout on Windows. I can't seem to find the information on MSDN. Is there a limit to how much data can be written to stdout? If so, what happens if the limit is reached? Is the data lost? If stdout is redirected (for example, by launching the process from .Net and using the ProcessStartInfo.RedirectStandardOutput property), does that have any effect on how much data can be written? As I read from the stdout stream in the calling process, does that affect the limitations? Are these limits related in any way to named pipes?

    Read the article

  • Validating an Autocomplete field in Django

    - by anonymous coward
    I have models similar to the following: class Band(models.Model): name = models.CharField(unique=True) class Event(models.Model): name = models.CharField(max_length=50, unique=True) bands = models.ManyToManyField(Band) and essentially I want to use the validation capability offered by a ModelForm that already exists for Event, but I do not want to show the default Multi-Select list (for 'bands') on the page, because the potential length of the related models is extremely long. I have the following form defined: class AddEventForm(ModelForm): class Meta: model = Event fields = ('name', ) Which does what is expected for the Model, but of course, validation could care less about the 'bands' field. I've got it working enough to add bands correctly, but there's no correct validation, and it will simply drop bad band IDs. What should I do so that I can ensure that at least one (correct) band ID has been sent along with my form? For how I'm sending the band-IDs with auto-complete, see this related question: http://stackoverflow.com/questions/1528059/

    Read the article

  • What information do you capture your software crashes in the field?

    - by Russ
    I am working on rewriting my unexpected error handling process, and I would like to ask the community: What information do you capture both automatic, and manually, when software you have written crashes? Right now, I capture a few items, some of which are: Automatic: Name of app that crashed Version of app that crashed Stack trace Operating System version RAM used by the application Number of processors Screen shot: (Only on non-public applications) User name and contact information (from Active Directory) Manual: What context is the user in (i.e.: what company, tech support call number, RA number, etc...) When did the user expect to happen? (Typical response: "Not to crash”) Steps to reproduce. What other bits of information do you capture that helps you discover the true cause of an applications problem, especially given that most users simply mash the keyboard when asked to tell you what happened. For the record I’m using C#, WPF and .NET version 4, but I don’t necessarily want to limit myself to those. Related: http://stackoverflow.com/questions/1226671/what-to-collect-information-when-software-crashes Related: http://stackoverflow.com/questions/701596/what-should-be-included-in-the-state-of-the-art-error-and-exception-handling-stra

    Read the article

  • Is a many-to-many relationship with extra fields the right tool for my job?

    - by whichhand
    Previously had a go at asking a more specific version of this question, but had trouble articulating what my question was. On reflection that made me doubt if my chosen solution was correct for the problem, so this time I will explain the problem and ask if a) I am on the right track and b) if there is a way around my current brick wall. I am currently building a web interface to enable an existing database to be interrogated by (a small number of) users. Sticking with the analogy from the docs, I have models that look something like this: class Musician(models.Model): first_name = models.CharField(max_length=50) last_name = models.CharField(max_length=50) dob = models.DateField() class Album(models.Model): artist = models.ForeignKey(Musician) name = models.CharField(max_length=100) class Instrument(models.Model): artist = models.ForeignKey(Musician) name = models.CharField(max_length=100) Where I have one central table (Musician) and several tables of associated data that are related by either ForeignKey or OneToOneFields. Users interact with the database by creating filtering criteria to select a subset of Musicians based on data the data on the main or related tables. Likewise, the users can then select what piece of data is used to rank results that are presented to them. The results are then viewed initially as a 2 dimensional table with a single row per Musician with selected data fields (or aggregates) in each column. To give you some idea of scale, the database has ~5,000 Musicians with around 20 fields of related data. Up to here is fine and I have a working implementation. However, it is important that I have the ability for a given user to upload there own annotation data sets (more than one) and then filter and order on these in the same way they can with the existing data. The way I had tried to do this was to add the models: class UserDataSets(models.Model): user = models.ForeignKey(User) name = models.CharField(max_length=100) description = models.CharField(max_length=64) results = models.ManyToManyField(Musician, through='UserData') class UserData(models.Model): artist = models.ForeignKey(Musician) dataset = models.ForeignKey(UserDataSets) score = models.IntegerField() class Meta: unique_together = (("artist", "dataset"),) I have a simple upload mechanism enabling users to upload a data set file that consists of 1 to 1 relationship between a Musician and their "score". Within a given user dataset each artist will be unique, but different datasets are independent from each other and will often contain entries for the same musician. This worked fine for displaying the data, starting from a given artist I can do something like this: artist = Musician.objects.get(pk=1) dataset = UserDataSets.objects.get(pk=5) print artist.userdata_set.get(dataset=dataset.pk) However, this approach fell over when I came to implement the filtering and ordering of query set of musicians based on the data contained in a single user data set. For example, I could easily order the query set based on all of the data in the UserData table like this: artists = Musician.objects.all().order_by(userdata__score) But that does not help me order by the results of a given single user dataset. Likewise I need to be able to filter the query set based on the "scores" from different user data sets (eg find all musicians with a score 5 in dataset1 and < 2 in dataset2). Is there a way of doing this, or am I going about the whole thing wrong?

    Read the article

  • What information do you capture when your software crashes in the field?

    - by Russ
    I am working on rewriting my unexpected error handling process, and I would like to ask the community: What information do you capture both automatic, and manually, when software you have written crashes? Right now, I capture a few items, some of which are: Automatic: Name of app that crashed Version of app that crashed Stack trace Operating System version RAM used by the application Number of processors Screen shot: (Only on non-public applications) User name and contact information (from Active Directory) Manual: What context is the user in (i.e.: what company, tech support call number, RA number, etc...) When did the user expect to happen? (Typical response: "Not to crash”) Steps to reproduce. What other bits of information do you capture that helps you discover the true cause of an applications problem, especially given that most users simply mash the keyboard when asked to tell you what happened. For the record I’m using C#, WPF and .NET version 4, but I don’t necessarily want to limit myself to those. Related: http://stackoverflow.com/questions/1226671/what-to-collect-information-when-software-crashes Related: http://stackoverflow.com/questions/701596/what-should-be-included-in-the-state-of-the-art-error-and-exception-handling-stra

    Read the article

  • MySQL foreign key constraints, cascade delete

    - by Cudos
    Hello. I want to use foreign keys to keep the integrity and avoid orphans (I already use innoDB). How do I make a SQL statment that DELETE ON CASCADE? Secondly, that using DELETE ON CASCADE. E.g. if I delete a category then it would delete products related to that category even though there are other categories related to those products. The pivot table "categories_products" creates a many-to-many relationship between the two other tables. categories - id (INT) - name (VARCHAR 255) products - id - name - price categories_products - categories_id - products_id

    Read the article

  • Drupal Navigation Conundrum

    - by Vecta
    I'm attempting to set up navigation withing a Drupal site and am having a bit of trouble. I'm trying to have a series of pages that each have a set number of sub-pages. These pages will need to link to one another. All pages will contain similar content. For instance: Page 1 will have sub-pages a, b, c, d, e, and f all with content related to the topic of page 1 Page 2 will have sub-pages a, b, c, d, e, and f with content related to the topic of page 2 I'd like these links to appear in a horizontal nav bar on each page. Is it possible to accomplish this using the book module? I've also read some information about the taxonomy menu module that sounds promising, but I'm not really sure how that would work. What route should I look into? Thanks for any input!

    Read the article

  • Grammatically correct double-noun identifiers, plural versions

    - by Michal Czardybon
    Consider compounds of two nouns, which in natural English would most often appear in the form "noun of noun", e.g. "direction of light", "output of a filter". When programming we usually write "LightDirection" and "FilterOutput". Now, I have a problem with plural nouns. There are two cases: 1) singular of plural e.g. "union of (two) sets", "intersection of (two) segments" Which is correct, SetUnion and SegmentIntersection or SetsUnion and SegmentsIntersection? 2) plural of plural There are two subcases: (a) Many elements, each having many related elements, e.g. "outputs of filters" (b) Many elements, each having single related element, e.g. "directions of vectors" Shell I use FilterOutputs and VectorDirections or FiltersOutputs and VectorsDirections? I suspect correct is the first version (FilterOutupts, VectorDirections), but I think it may lead to ambiguities, e.g. FilterOutputs - many outputs of a single filter or many outputs of many filters? LineSegmentProjections - projections of many segments or many projections of a single segment?

    Read the article

  • SRAM Cell Diagram - Can someone explain this a bit more clearly? ( From COMP1917 @ UNSW: Lecture 2 o

    - by Kristina
    I've begun watching a series of first year lectures from the University of New South Wales (UNSW) in Australia, and I'm a bit perplexed by the instructors explanation of how an SRAM gate works. I realize this isn't exactly "programming-related" but since it comes from a series of lectures relating to computing and programming, I thought StackOverflow may be able to help (reddit failed me entirely). In this lecture beginning at around 32:12, Richard (the lecturer) tries to explain how a "latch gate" works within SRAM. Although his students seem to keep up, I feel I'm missing something crucial which is preventing the concept from really "clicking" in my brain. For convenience, I've added the image from the video below: Thanks in advance for any help you can provide, but if this question doesn't fit your view of "programming-related" could you please provide an alternate forum for this in a comment when you cast your close vote? Thanks!

    Read the article

  • Testing on blackberry device - adding and removing app multiple times

    - by Kai
    It would be useful for many people to know how to completely remove an application from your device when testing. I have downloaded my app many times now, and likewise have deleted it many times. The problem is when deleting the app, it does not remove things like the persistent object related to my app, or the images downloaded through the app. So, when I download the next build, I have no idea if something broke that is related to building the persistent object or fetching the images since those elements already exist from the last build. I don't know if this is a cache thing. I don't know if this is expected and I have to use some utility to wipe this data after deleting the app. I can't really find much info through basic web searches. Any information would be appreciated. Blackberry Bold 9000. 4.6 OS. tested with both SD card and no SD card.

    Read the article

  • Disabling security warning caused by BaseIntermediateOutputPath?

    - by Chris R. Donnelly
    Hi all, Our team overrides BaseIntermediateOutputPath (and other related properties) in our Visual Studio projects in order to have build artifacts go outside the main tree. However, this causes an annoying warning dialog to appear when you open a project for the first time in a new location (which happens on new machines, when you check out a branch to a new location, have to delete corrupted .suo/.user files, etc.). Is there any way to disable the warning? FYI, we are using Visual Studio 2008, and we have encountered this warning on Windows XP as well as Windows 7, so it is not UAC-related.

    Read the article

  • [JS] How to manipulate a PHP Array in javascript?

    - by rasouza
    I have an Array in PHP which contains data from database. And it prints out also as a table in the same page which has an AJAX delete function. Trying to explain better The array contains debt sums related to many people, it is the application's main function. In the same page, there is a table containing every debt record related to the array, which can be deleted or edited using AJAX. I have coded the part of deleting the record and removing the TR entry, but it's not enough: I'd like to change also the debt sum using AJAX which is an PHP Array. What I have I have the JS function which removes the TR when the delete button is clicked // TR Fading when deleted $('.delete') .click(function() { $.ajax({ type: 'GET', url: 'history/delete/id/'+$(this).attr('id') }); $(this).parent().parent().fadeOut(); return false; }); and I have the PHP array (image)

    Read the article

  • Need to get to the foreign keys of an entity marked as "Deleted" for auditing

    - by Abhijeet Patel
    I'm using v1 of EF(.NET 3.5 SP1). I'm subscribing to the SavingChanges event of the ObjectContext wherein I audit deletes for a particular entity type. I need to get to the foreign keys of the entity being deleted i.e EntityKeys of the related entities (RelatedEnds) but the EntityKeys of the related entities are nulls. Is there any way to get to the foreign keys of an entity which has been marked for deletion? Does EF null out the EntityKeys of all RelatedEnds for an entity which has been marked for deletion? If so, is there a way I can get hold of the foreign keys?

    Read the article

  • Want to make object transparent

    - by Himadri
    I am working with directx. I am displaying two objects on my window. They are intersecting each other. I find the intersecting object. My problem is- I want two original objects to be transparent and the resulting intersected part to be opaque, so that the intersected part can be seen clearly. I found some question related to transparency but they are related to transparency of window. But I want the object to be transparent.

    Read the article

  • problem adding a where clause to a T-sql LEFT OUTER JOIN query

    - by Nickson
    SELECT TOP (100) PERCENT dbo.EmployeeInfo.id, MIN(dbo.EmployeeInfo.EmpNo) AS EmpNo, SUM(dbo.LeaveApplications.DaysAuthorised) AS DaysTaken FROM dbo.EmployeeInfo LEFT OUTER JOIN dbo.LeaveApplications ON dbo.EmployeeInfo.id = dbo.LeaveApplications.EmployeeID WHERE (YEAR(dbo.LeaveApplications.ApplicationDate) = YEAR(GETDATE())) GROUP BY dbo.EmployeeInfo.id, dbo.EmployeeMaster.EmpNo ORDER BY DaysTaken DESC The basic functionality i want is to retrieve all records in table dbo.EmployeeInfo irrespective of whether a corresponding record exists in table dbo.LeaveApplications. If a row in EmployeeInfo has no related row in LeaveApplications, i want to return its SUM(dbo.LeaveApplications.DaysAuthorised) AS DaysTaken column as NULL or may be even put a 0. With the above query, if i remove the where condition, am able to achieve what i want, but problem is i also want to return related rows from LeaveApplication only if ApplicationDate is in the current year. Now with the where condition added, am only able to get rows from EmployeeInfo only if they have corresponding rows in LeaveApplications yet i just wanted rows all in EmployeeInfo

    Read the article

< Previous Page | 54 55 56 57 58 59 60 61 62 63 64 65  | Next Page >