Search Results

Search found 33736 results on 1350 pages for 'project structure'.

Page 81/1350 | < Previous Page | 77 78 79 80 81 82 83 84 85 86 87 88  | Next Page >

  • Django: Serializing models in a nested data structure?

    - by Rosarch
    It's easy to serialize models in an iterable: def _toJSON(models): return serializers.serialize("json", models, ensure_ascii=False) What about when I have something more complicated: [ (Model_A_1, [Model_B_1, Model_B_2, Model_B_3]), (Model_A_2, [Model_B_3, Model_B_4, Model_B_5, Model_B_59]), (Model_A_3, [Model_B_6, Model_B_7]), ] I tried serializing each model as it was added to the structure, then serializing the whole thing with simplejson.dumps, but that causes the JSON defining each model to be escaped. Is there a better way to do this?

    Read the article

  • Java Data Structure

    - by Joe
    Hi there, I'm looking for a data structure that will act like a Queue so that I can hava First In First Out behaviour, but ideally I would also be able to see if an element exists in that Queue in constant time as you can do with a HashMap, rather than the linear time that you get with a LinkedList. I thought a LinkedHashMap might do the job, but although I could make an iterator and just take and then remove the first element of the iteration to produce a sort of poll() method, I'm wondering if there is a better way. Many thanks in advance

    Read the article

  • passing an array structure as an array

    - by Matias
    I'm having trouble passing a structure array as a parameter of a function struct Estructure{ int a; int b; }; and a funtion Begining(Estructure &s1[]) { //modifi the estructure s1 }; and the main would be something like this int main() { Estructure m[200]; Begining(m); }; is this valid?

    Read the article

  • Hello world/Console Project in Visual Studio 2008 64 bit

    - by grobartn
    So I am trying to run console 64 bit Hello World program. I have Windows 7 Enterprise x64 bit version. I have installed Visual Studio 2008 and have added all of components needed for 64 bit. I want to create simple console application. It turns out to be a problem. I have simple standard hello world project. I have created it using New Project - Empty project. I added main.cpp that contains this: #include <iostream> using namespace std; int main() { cout << "howdy\n"; } I added new configuration to the project by clicking on Config Manager and added x64 config. Compiled and it compiles. Tried running it and cmd.exe shoots up with following error: "The application has failed to start because its side-by-side configuration is in correct. Please see the application event log or use the command-line sxstrace.e xe tool for more detail. Press any key to continue . . . " Which set-up step if any I am missing. What am I doing wrong and how should I go about setting simple console hello world in 64 bit world. Thanks for any help

    Read the article

  • C++ priority queue structure used ?

    - by John Retallack
    While searching for some functions in C++ STL documentation I read that push and pop for priority queues needs constant time. "Constant (in the priority_queue). Although notice that push_heap operates in logarithmic time." My question is what kind of data structure is used to mantain a priority queue with O(1) for push and pop ?

    Read the article

  • SQL Structure of DB table with different types of columns

    - by Dmitry Dvornikov
    I have a problem with the optimization of the structure of the database. I'll try to explain it exactly. I create a project, where we can add different values??, but this values must have different types of the columns in the database (eg, int, double , varchar). What is the best way to store the different types of values ??in the database. In the project I'm using Propel 1.6. The point is availability to add value with 'int', 'varchar' and other columns types, to search the table was efficient. In total, I have two ideas. The first is to create a table of "value", which will have columns: "id ", "value_int", "value_double", "value_varchar", etc - with the corresponding column types. Depending on the type of values??, records will be saved with the value in the appropriate column (the rest will be NULL). The second solution is to create separate tables such as "value_int", "value_varchar" etc. There would be columns: "id", "value", which correspond to the relevant types of "value" (ie, such as int, varchar, etc). I must admit that I do not believe any of the above solutions, originally I was thinking about one table "value", where the column would be a "text" type - but this solution would probably be even worse. I would like to know your opinion on this topic, maybe something else would be better. Thanks in advance. EDIT: For example : We have three tables: USER: [table of users] * id * name FIELD: [table of profile fields - where the column 'type' is the type of field, eg int or varchar) * id * type * name VALUE : * id * User_id - ( FK user.id ) * Field_id - ( FK field.id ) * value So we have in each row an user in USER table, and the profile is stored in the VALUE table. Bit each profile field may have a different type (column 'type' in the FIELD table), and based on that I would want this value to add to the appropriate column of the appropriate type.

    Read the article

  • How to structure this Symfony web project?

    - by James William
    I am new to Symfony and am not sure how to best structure my web project. The solution must accommodate 3 use cases: Public access to www.mydomain.com for general use Member only access to member.mydomain.com Administrator access to admin.mydomain.com All three virtual hosts point to the Symfony /web directory Questions: Is this 3 separate applications in my Symfony project (e.g. "frontend", "backend" and "admin" or "public", "member", "admin")? Is this a good approach if there is to be some duplicate code (e.g. generating a member list would be common across all 3 applications, but presented differently)? How would I route to the various applications based on the subdomain when a user accesses *.mydomain.com? Where in Symfony should this routing logic be placed? Or, is this one application with modules for each of the above use cases? EDIT: I do not have access to httpd.conf in apache to specify a default page for virtual hosts. I can only specify a directory for each subdomain using the hostin provider's cPanel.

    Read the article

  • Database structure for versioning and multiple languages

    - by phobia
    How can I solve the issue of content existing in multiple versions and multiple languages? My current structure: Each content can only have one active version in each language, and that's how I'm curious on how to best solve. Right now I have a column of the contentversions table, which means for each change of active version I have to run a update and set active=false on all version and then a update to set active=true for the piece of content in question.

    Read the article

  • C - How to implement Set data structure?

    - by psihodelia
    Is there any tricky way to implement a set data structure (a collection of unique values) in C? All elements in a set will be of the same type and there is a huge RAM memory. As I know, for integers it can be done really fast'N'easy using value-indexed arrays. But I'd like to have a very general Set data type. And it would be nice if a set could include itself.

    Read the article

  • How should I structure my repository classes?

    - by Innogetics
    I am new to DDD. In my mini-project, I have a structure that looks like this (different from the actual names): EntryClassificationGroup EntryClassification Entry EntryType Should I have just one repository class for all these 4 entities, since they are all related? Or should I have individual repositories for each one?

    Read the article

  • Eclipse cannot find existing project in build path

    - by PNS
    Here is probably one of the idiosyncrasies of Eclipse and its handling of build paths, which cannot be fixed despite all sorts of workarounds tested so far. The issue relates to a workspace of several projects, each of which compiles into its own JAR. Dependencies among the projects are resolved by adding the relevant ones to the build path (no Maven or other external tool or plugin is used), via Project -> Properties -> Java Build Path -> Projects Among all these projects, a couple (say, com.example.p1 and com.example.p2) refuse to recognize a third (and simple) one (say, com.example.p3), while all other projects do. So, although P3 is added to the build path, all related classes from P3 are imported properly and the source code of each such class is accessible by hitting F3, Eclipse keeps complaining that The import com.example.p3 cannot be resolved and SomeClass cannot be resolved to a type where com.example.p3.SomeClass is one of the P3 classes. If instead of the P3 project I put its compiled JAR in the build path, the issue disappears. However, code in P3 changes frequently and it is a time waste to keep compiling and refreshing the workspace so that the change is picked up, not to mention that this should not happen in an IDE anyway (and it does not for the other projects using P3). Among the workarounds tried are things like: Removing and adding again P1, P2, P3 Cleaning up and recompiling everything Checking whether any other project loads the P3 JAR Putting P3 at the top of the Eclipse build path "Order and Export" list Using the "Fix project setup" suggestion of Eclipse (available when hovering the mouse over the red-underlined-error compilation line). Actually, this option offers adding to the build path either P3 or its JAR, but if P3 is added, the issue reappears. Any ideas?

    Read the article

  • Fast data structure for small sets

    - by thr
    I'm in need for a data structure that can handle small sets (10-20 strings, at most 50, of varying length) very fast. False positives is ok, but false negatives are not. The last requirement makes bloom filters seem like a good fit, but I'm not sure about their speed, any other recommendations?

    Read the article

  • Does Boost work with IntervalZero RTX 2009?

    - by cs-79
    Hi all Rtx experts, Have anyone implemented hard real-time app on IntervalZero Rtx environment using Boost libraries? I wish to use the Boost `unordered` data structures instead of solely relying on STL::Vector. Or Array/Vector is the only data structure supported by Rtx? * Off topic question: Can we use STL::String instead of char pointer for string in Rtx? Thanks.

    Read the article

  • Can the Visual Studio (2010) Command Window handle "external tools" with project/solution relative p

    - by ee
    I have been playing with the Command Window in Visual Studio (View-Other Windows-Command Window). It is great for several mouse-free scenarios. (The autocompleting file "Open" command rocks in a non-trivial solution.) That success got me thinking and experimenting: Possibility 1.1: You can use the Alias commands to create custom commands Possibility 1.2: You can use the Shell command to run arbitrary executables and specify parameters (and pipe the result to the output or command windows) Possibility 2: A previously setup external tool definition (with project-relative path variables) could be run from the command window What I am stuck on is: There doesn't appear to be a way to send parameters to an aliased command (and thus the underlying Shell call) There doesn't appear to be a way to use project/solution relative paths ($SolutionDir/$ProjectDir) on a Shell call Using absolute paths in Shell works, but is fragile and high-maintenance (one alias for each needed use case). Typically you want the command to run against a file relative to your project/solution. It seems you can't run the traditional external tools (Tools-External Tools...) in the command window Ultimately I want the external tool functionality in the command window in some way. Can anyone see a way to do this? Or am I barking up the wrong tree? So my questions: Can an "external tool" of some sort (using relative project/solution path parameters) be used in the Command Window? If yes, How? If no, what might be a suitable alternative?

    Read the article

  • Python what's the data structure for triple data

    - by Paul
    I've got a set of data that has three attributes, say A, B, and C, where A is kind of the index (i.e., A is used to look up the other two attributes.) What would be the best data structure for such data? I used two dictionaries, with A as the index of each. However, there's key errors when the query to the data doesn't match any instance of A.

    Read the article

  • What's beyond c,c++ and data structure?

    - by sagacious
    I have learnt c and c++ programming languages.i have learnt data structure too. Now i'm confused what to do next?my aim is to be a good programmer. i want to go deeper into the field of programming and making the practical applications of what i have learnt. So,the question takes the form-what to do next?Or is there any site where i can see advantage of every language with it's features? sorry,if there's any language error and thanks in advance.

    Read the article

  • C++ priority queue structure userd ?

    - by John Retallack
    While searching for some functions in C++ STL documentation I read that push and pop for priority queues needs constant time. "Constant (in the priority_queue). Although notice that push_heap operates in logarithmic time." My question is what kind of data structure is used to mantain a priority queue with O(1) for push and pop ?

    Read the article

  • Error running web project in eclipse

    - by DarkKnight
    I am a newbie to servlets. I created a dynamic web project in eclipse. I have following files in my project home.html validateServlet.java I have defined validated servlet as an action in home.html form. However when I run it, I get http status 404. Below is the hierarchy of my project Project Java Resources src com.servlets ValidateServlet.java build WebContent META-INF WEB-INF web.xml hello.html Contents of my web.xml are as follows: <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web- app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"> <display-name>Website</display-name> <servlet> <description></description> <display-name>ValidateServlet</display-name> <servlet-name>validate</servlet-name> <servlet-class>com.oracle.coen235.servlets.ValidateServlet</servlet-class> </servlet> </web-app> In my hello.html, action is specified as , What might be the issue? I guess I am not able to generate the class file for my servlet. Can anyone guide me through this problem?

    Read the article

  • Running unittest with typical test directory structure.

    - by Major Major
    The very common directory structure for even a simple Python module seems to be to separate the unit tests into their own test directory: new_project/ antigravity/ antigravity.py test/ test_antigravity.py setup.py etc. for example see this Python project howto. My question is simply What's the usual way of actually running the tests? I suspect this is obvious to everyone except me, but you can't just run python test_antigravity.py from the test directory as its import antigravity will fail as the module is not on the path. I know I could modify PYTHONPATH and other search path related tricks, but I can't believe that's the simplest way - it's fine if you're the developer but not realistic to expect your users to use if they just want to check the tests are passing. The other alternative is just to copy the test file into the other directory, but it seems a bit dumb and misses the point of having them in a separate directory to start with. So, if you had just downloaded the source to my new project how would you run the unit tests? I'd prefer an answer that would let me say to my users: "To run the unit tests do X."

    Read the article

< Previous Page | 77 78 79 80 81 82 83 84 85 86 87 88  | Next Page >