Search Results

Search found 16547 results on 662 pages for 'physical design'.

Page 166/662 | < Previous Page | 162 163 164 165 166 167 168 169 170 171 172 173  | Next Page >

  • erlang design of a card game [closed]

    - by user601836
    I would like to discuss with you a possible implementation for a card game in erlang. The only full example I found online is OpenPoker. I would like to create one myself, so here is the implementation I have in mind: A gen_server to represent a deck: when started creates a deck of cards (shuffled). And stores it in its state. provides an handle_call (draw_card) A gen_server to represent the chat room. Stores in its state the registered name of a player process (e.g. player1, player2, luke etc etc). Exports handle_cast to join the chat (executed by default when somebody joins successfully the game) and one to broadcast a chat message to all users by calling an handle_cast on the gen_server representing a player. a gen_fsm to represent a game instance. Has two states (wait_join, and turn). Exports join/1 to join the game, play_card/2 and send_msg/2. One parameter is the pid of the player process. a gen_server to represent the player. Exports only start_link/1 where the parameter is the name to use to register the process (inside the init I call join method of gen_fsm). Has different handle_calls (e.g. get_hand, draw_card) and handle_casts (e.g. play_card, deliver_msg, and send_msg) A gen_server to represent the main process. Exports (join_game/1 which calls player:start_link/1, send_msg/2 to call player's send_msg, play_card/3 to call player's play_card). What do you think of this architecture? Thanks in advance

    Read the article

  • .net layered design: return error code to forms indicating which controls have an error

    - by David Casillas
    Let's say I have a simple application. It tries to add a new entry to a database grabing the info from the user. The information is a tipical MasterDetail objetc like an invoice. The Invoice object used to collect the data has some simple atributes (Id, Date, etc...) and a List of InvoiceDetail, consisting of some simple atributes (invoiceId, productId, quantity, etc...) A form in the UI Layer collects the data from the user, creates an instance of Invoice and sends it to the Bussiness Layer. The Bussines layer sends the data to a Validation Module. If any error in the input is detected it has to return some kind of error code. The Bussiness Layer has to send the error code back to the Form to let the user correct the worng information. I want the application to display some kind of warning (a different background color for example) in every form control with an error. ¿What's a good aproach to I manage the errors to be able to inform the form which controls are wrong? ¿Can I create an error object?¿Use delegates?. I'm using VB.net but don't think this is relevant to the solution of the problem. P.D: Please suggest me some tags to this post.

    Read the article

  • Datalist itemcommand design?

    - by Surya sasidhar
    hi, in my application i am using datalist to display the images, i put properties of repeatcolumn=4 and reapeatdirection=horizontal. It is displaying good when there r more than or 4 images if there r only one or two or three images the gap between images r too long. if i have only one image the image displayed in datalist in the middle of the datalist. how can i solve this problem. i think you people understand my problem this is my datalist source code... datalist width="100%" <ItemTemplate > <table width="100%" > <tr> <td > <asp:ImageButton ID="imgeFrien" runat ="Server" Width="110px" Height ="100px" CommandName ="Image" CommandArgument ='<%# Eval("userid") %>' ImageUrl ='<%# "~/Userimages/"+ Eval("myimage") %>' /> </td> </tr> <tr> <td > <asp:Label ID="lblFrieNam" runat ="Server" Font-Names ="verdana" Text ='<%# Eval("username") %>'></asp:Label> </td> </tr> </table> </ItemTemplate> </asp:DataList>

    Read the article

  • Flex 4 app with mate design question

    - by chchrist
    Hi all, I have a view with a DropDownList component and a DataGroup component. The dropdownlist has to be updated from a remote php object and on change to call another remote object service in order to update the datagroup's provider. So I am thinks to dispatch an event from my view and the in my EventMap to call the service and inject the result to the drop down. When the dropdown changes I'll dispatch another event and in the EventMap I'll call another service and I'll inject the result to the datagroup. Is there another more sophisticated way? Thanks in advance

    Read the article

  • Modular GWT design concerns

    - by GlGuru
    Hi, I have a couple of questions regarding a modular GWT based application framework. I have some ideas about them but being new to the field of web development I feel they are far from ideal. I'd appreciate a few comments and suggestions in this regard. Here are my questions: I am developing a framework which will allow third parties to embed GWT applications into our website and do some communication with them using simple iFrame postMessage. All these third party modules are going to use our SDK which is also GWT based. The problem arises that even though all the modules will be using the same codebase there is going to be a massive overheard in the amount of duplicate Javascript code (i.e. our common SDK code base which is quite large) being downloaded on the client's machine. This is highly redundant and problematic, not only due to the sheer size of duplicate code but, also due to the fact that subsequent updates of the SDK would require the modules to be recompiled which is going to create a DLL hell kind of scenario in the long run. What is the best way of doing this kind of thing? Is there a way where I can have some static GWT code (i.e. the SDK) and the dynamic GWT module refers to it (even if lies on a different domain) and it all work happily? The other part of the problem lies in providing robust scripting front end to the SDK. At first it appears to be trivial since Javascript itself is a scripting language. However, I do not know how to load and call a piece of pure Javascript code at runtime? I am willing to put restrictions on the target Javascript (i.e. having a function main and unique namespace or something). Furthermore the Javascript will come as a string from a database and not as a full URL. If its doable in Javascript how does one get this right in GWT i.e. forcing the compiler to emit a certain function in the generated Javascript? This I believe can be lesser of a problem by having a stub Javascript with all the right requirements which just loads up a GWT generated Javascript. Is any of this possible at all? I generally hate to be this verbose but I hope to find a quick solution to the problem as its holding up my progress. I'd highly appreciate any comments, suggestions and experiences.

    Read the article

  • ubuntu dmidecode is not functioning properly

    - by Alaa Alomari
    dmidecode is giving irrelevant and conflicted results. it shows that i have two slots while the correct is 8 (the board is Tyan S5350.) uname -a Linux synd01 3.0.0-16-server #29-Ubuntu SMP Tue Feb 14 13:08:12 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux root@synd01:/home/badmin# dmidecode -t 16 dmidecode 2.9 SMBIOS 2.33 present. Handle 0x0011, DMI type 16, 15 bytes Physical Memory Array Location: System Board Or Motherboard Use: System Memory Error Correction Type: None Maximum Capacity: 4 GB Error Information Handle: Not Provided Number Of Devices: 2 while root@synd01:/home/badmin# dmidecode -t 17 | grep Size Size: No Module Installed Size: No Module Installed Size: 1024 MB Size: 1024 MB Size: No Module Installed Size: No Module Installed Size: 1024 MB Size: 1024 MB also lshw shows: *-memory description: System Memory physical id: 11 slot: System board or motherboard size: 4GiB *-bank:0 description: DIMM DDR Synchronous 166 MHz (6.0 ns) [empty] physical id: 0 slot: J3B1 clock: 166MHz (6.0ns) *-bank:1 description: DIMM DDR Synchronous 166 MHz (6.0 ns) [empty] physical id: 1 slot: J3B3 clock: 166MHz (6.0ns) *-bank:2 description: DIMM DDR Synchronous 166 MHz (6.0 ns) physical id: 2 slot: J2B2 size: 1GiB width: 64 bits clock: 166MHz (6.0ns) *-bank:3 description: DIMM DDR Synchronous 166 MHz (6.0 ns) physical id: 3 slot: J2B4 size: 1GiB width: 64 bits clock: 166MHz (6.0ns) *-bank:4 description: DIMM DDR Synchronous 166 MHz (6.0 ns) [empty] physical id: 4 slot: J3B2 clock: 166MHz (6.0ns) *-bank:5 description: DIMM DDR Synchronous 166 MHz (6.0 ns) [empty] physical id: 5 slot: J2B1 clock: 166MHz (6.0ns) *-bank:6 description: DIMM DDR Synchronous 166 MHz (6.0 ns) physical id: 6 slot: J2B3 size: 1GiB width: 64 bits clock: 166MHz (6.0ns) *-bank:7 description: DIMM DDR Synchronous 166 MHz (6.0 ns) physical id: 7 slot: J1B1 size: 1GiB width: 64 bits clock: 166MHz (6.0ns) what might cause this conflict and how can i fix it? Thanks

    Read the article

  • Pre-Compiled Header Design Question

    - by ML
    Hi All, I have code that uses a pre-compiled header. (previously done by someone else) In it, they are including several .h files. If I have classes that use common .h files that are not currently in the existing pre-compiled header, would tossing them in there be of any real benefit? Maybe compilation speed, but I was thinking it would clean up the classes/headers a bit too? What are do's and don't with pre-compiled headers?

    Read the article

  • A view model mvvm design issue

    - by Chen Kinnrot
    the best way to explain is with example so: this is the model public class Person { public int age; public string name; } this is the view model public class PersonVM { } my question is: should the vm expose the person to the datga template or encapsulate the model properties with his own properties?

    Read the article

  • Enable debugging in Design mode in VS

    - by Dan Tao
    Is there any way to enable debugging from within the Windows Forms Designer in Visual Studio (any version, up to and including 2010)? What I mean is, say I have some custom user control, and this control has certain validation that it performs when I set a particular property. I'd like to be able to set a breakpoint somewhere within that code, and step through it to see what happens when I set the property from the designer.

    Read the article

  • Hbase schema design -- to make sorting easy?

    - by chen
    I have 1M words in my dictionary. Whenever a user issue a query on my website, I will see if the query contains the words in my dictionary and increment the counter corresponding to them individually. Here is the example, say if a user type in "Obama is a president" and "Obama" and "president" are in my dictionary, then I should increment the counter by 1 for "Obama" and "president". And from time to time, I want to see the top 100 words (most queried words). If I use Hbase to store the counter, what schema should I use? -- I have not come up an efficient one yet. If I use word in my dictionary as row key, and "counter" as column key, then updating counter(increment) is very efficient. But it's very hard to sort and return the top 100. Anyone can give a good advice? Thanks.

    Read the article

  • C++ threaded class design from non-threaded class

    - by macs
    I'm working on a library doing audio encoding/decoding. The encoder shall be able to use multiple cores (i.e. multiple threads, using boost library), if available. What i have right now is a class that performs all encoding-relevant operations. The next step i want to take is to make that class threaded. So i'm wondering how to do this. I thought about writing a thread-class, creating n threads for n cores and then calling the encoder with the appropriate arguments. But maybe this is an overkill and there is no need for another class, so i'm going to make use of the "user interface" for thread-creation. I hope there are any suggestions.

    Read the article

  • DB design abbreviations

    - by CChriss
    I know PK means primary key and FK means foreign key, but what do "rK" (in section 3) and "PF" (in sections 3, 4, 6, 7, and 8) mean on this page? http://www.databaseanswers.org/tutorial4_data_modelling/index.htm And what does "FF" mean (in the Customer_Addresses table) on this page? -I'm new so it would only let me put in one hyperlink, so copy/paste this to go to the page I'm asking about: databaseanswers.org/tutorial4_db_schema/tutorial_slide_7.htm Thanks. Edit: also, I understand the concepts of primary keys and foreign keys, but what are these other ones used for?

    Read the article

  • JavaEE: Question about design

    - by Harry Pham
    I have a JSF page that will create a new Comment. I have the managed bean of that page to be RequestScoped managed bean. @ManagedBean(name="PostComment") @RequestScoped public class PostComment { private Comment comment = null; @ManagedProperty(value="#{A}") private A a; //A is a ViewScoped Bean @ManagedProperty(value="#{B}") private B b; //B is a ViewScoped Bean @PostConstruct public void init(){ comment = new Comment(); } // setters and getters for comment and all the managed property variable public void postComment(String location){ //persist the new comment ... if(location.equals("A")){ //update the comment list on page A }else if(location.equals("B")){ //update the comment list on page B } } } As you can see from the code above, 2 ViewScoped bean A and B will both use method postComment(), and getter getComment() from bean PostComment. The problem I am having right now is that, if I am on A, constructor of A will load, but it will also load constructor of bean B. This make my page load twice as slow. What would be the best way to solve this problem?

    Read the article

  • Reflect and Load code at design time in Visual Studio

    - by Stacey
    I have an XML file that lists a series of items, and the items are often referenced by their name in code. Is there any way to use reflection within Visual Studio to make this list 'accessible' sort of like intellisence? I've seen it done before - and I'm pretty sure it's ridiculously difficult, but I figure it can't hurt to at least ask.

    Read the article

  • Java interface design

    - by Nayn
    Hi, I had an interface initially as below. public interface testMe { public Set<String> doSomething(); } public class A implements testMe { public Set<String> doSomething() { return // Set<String> } } I had similar classes implementing testMe. Now I have to add one more class which returns Set<Some Object> public class X implements testMe() { public Set<Some OBject> doSomething() { } } How could i add this mehtod in the interface without breaking existing classes? Thanks Nayn

    Read the article

  • JPA entity design / cannot delete entity

    - by timaschew
    I though its simple what I want, but I cannot find any solution for my problem. I'm using playframework 1.2.3 and it's using Hibernate as JPA. So I think playframework has nothing to do with the problem. I have some classes (I omit the nonrelevant fields) public class User { ... } public class Task { public DataContainer dataContainer; } public class DataContainer { public Session session; public User user; } public class Session { ... } So I have association from Task to DataContainer and from DataContainer to Sesssion and the DataContainer belongs to a User. The DataContainers can have always the same User, but the Session have to be different for each instance. And the DataContainer of a Task have also to be different in each instance. A DataContainer can have a Sesesion or not (it's optinal). I use only unidirectional assoc. It should be sufficient. In other words: Every Task must has one DataContainer. Every DataContainer must has one/the same User and can have one Session. To create a DB schema I use JPA annotations: @Entity public class User extends Model { ... } @Entity public class Task extends Model { @OneToOne(optional = false, cascade = CascadeType.ALL) public DataContainer dataContainer; } @Entity public class DataContainer extends Model { @OneToOne(optional = true, cascade = CascadeType.ALL) public Session session; @ManyToOne(optional = false, cascade = CascadeType.ALL) public User user; } @Entity public class Session extends Model { ... } BTW: Model is a play class and provides the primary id as long type. When I create some for each entity a object and 'connect them', I mean the associations, it works fine. But when I try to delete a Session, I get a constraint violation exception, because a DataContainer still refers to the Session I want to delete. I want that the Session (field) of the DataContainer will be set to null respectively the foreign key (session_id) should be unset in the database. This will be okay, because its optional. I don't know, I think I have multiple problems. Am I using the right annotation @OneToOne ? I found on the internet some additional annotation and attributes: @JoinColumn and a mappedBy attribute for the inverse relationship. But I don't have it, because its not bidirectional. Or is a bidirectional assoc. essentially? Another try was to use @OnDelete(action = OnDeleteAction.CASCADE) the the contraint changed from NO ACTIONs when update or delete to: ADD CONSTRAINT fk4745c17e6a46a56 FOREIGN KEY (session_id) REFERENCES annotation_session (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE CASCADE; But in this case, when I delete a session, the DataContainer and User is deleted. That's wrong for me. EDIT: I'm using postgresql 9, the jdbc stuff is included in play, my only db config is db=postgres://app:app@localhost:5432/app

    Read the article

  • how to design two inputs in or/And logic for email form with validation

    - by Raj Nimbalkar
    my purpose is user enter only email or mobile number.i have the partial success in that.code notify user in OR logic but....IF user entered the incorrect mobile & email @same time then user must be notified for dat. var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/; var emailaddressVal = $("#UserEmail").val(); ////email & mobile input cheak if(emailaddressVal == '' && $("#mobile").val() == '') { $("#UserEmail").after('<p><span class="error">Please enter your email address.</span></p>') $("#mobile").after('<p><span class="error">Please enter your Mobile number.</span></p>') hasError = true; } //////validating currect email else if(!emailReg.test(emailaddressVal)) { $("#UserEmail").after('<p><span class="error">Enter a valid email address.</span></p>') hasError = true; } //////Mobile number else if( $("#mobile").val()) { $("#mobile").after('<p><span class="error">Enter currect Mobile number.</span></p>') hasError = true; }

    Read the article

  • Design: How to declare a specialized memory handler class

    - by Michael Dorgan
    On an embedded type system, I have created a Small Object Allocator that piggy backs on top of a standard memory allocation system. This allocator is a Boost::simple_segregated_storage< class and it does exactly what I need - O(1) alloc/dealloc time on small objects at the cost of a touch of internal fragmentation. My question is how best to declare it. Right now, it's scope static declared in our mem code module, which is probably fine, but it feels a bit exposed there and is also now linked to that module forever. Normally, I declare it as a monostate or a singleton, but this uses the dynamic memory allocator (where this is located.) Furthermore, our dynamic memory allocator is being initialized and used before static object initialization occurs on our system (as again, the memory manager is pretty much the most fundamental component of an engine.) To get around this catch 22, I added an extra 'if the small memory allocator exists' to see if the small object allocator exists yet. That if that now must be run on every small object allocation. In the scheme of things, this is nearly negligable, but it still bothers me. So the question is, is there a better way to declare this portion of the memory manager that helps decouple it from the memory module and perhaps not costing that extra isinitialized() if statement? If this method uses dynamic memory, please explain how to get around lack of initialization of the small object portion of the manager.

    Read the article

  • Design considerations for a multi-language web application

    - by gAMBOOKa
    I was asked by an interviewer today how I would implement Arabic as a second language into a PHP web application. I talked about choosing a unicode encoding for the database and the front-end, and designing RTL friendly user interface modules. And he didn't seem too happy with the answer. I don't really know anything about multi-lingual systems, how would you have answered that question?

    Read the article

  • Unsure how to design JavaScript / jQuery functionality which uses XML to create HTML objects

    - by Jack Roscoe
    Hi, I'm using JavScript and jQuery to read an XML document and subsequently use the information from the XML to create HTML objects. The main 'C' nodes in the XML document all have a type attribute, and depending on the type I want to run a function which will create a new html object using the other attributes assigned to that particular 'C' node node. Currently, I have a for loop which extracts each 'C' node from the XML and also it's attributes (e.g. width, height, x, y). Also inside the for loop, I have an if statement which checks the 'type' attribute of the current 'C' node being processed, and depending on the type it will run a different function which will then create a new HTML object with the attributes which have been drawn from the XML. The problem is that there may be more than one 'C' node of the same type, so for example when I'm creating the function that will run when a 'C' node of 'type=1' is detected, I cannot use the 'var p = document.createElement('p')' because if a 'C' node of the same type comes up later in the loop it will clash and override that element with that variable that has just been created. I'm not really sure how to approach this? Here is my entire script. If you need me to elaborate on any parts please ask, I'm sure it's not written in the nicest possible way: var arrayIds = new Array(); $(document).ready(function(){ $.ajax({ type: "GET", url: "question.xml", dataType: "xml", success: function(xml) { $(xml).find("C").each(function(){ arrayIds.push($(this).attr('ID')); }); var svgTag = document.createElement('SVG'); // Create question type objects function ctyp3(x,y,width,height,baC) { alert('test'); var r = document.createElement('rect'); r.x = x; r.y = y; r.width = width; r.height = height; r.fillcolor = baC; svgTag.appendChild(r); } // Extract question data from XML var questions = []; for (j=0; j<arrayIds.length; j++) { $(xml).find("C[ID='" + arrayIds[j] + "']").each(function(){ // pass values questions[j] = { typ: $(this).attr('typ'), width: $(this).find("I").attr('wid'), height: $(this).find("I").attr('hei'), x: $(this).find("I").attr('x'), y: $(this).find("I").attr('x'), baC: $(this).find("I").attr('baC'), boC: $(this).find("I").attr('boC'), boW: $(this).find("I").attr('boW') } alert($(this).attr('typ')); if ($(this).attr('typ') == '3') { ctyp3(x,y,width,height,baC); // alert('pass'); } else { // Add here // alert('fail'); } }); } } }); });

    Read the article

  • Looking for examples of good IDEs to analyze for Form/Report design

    - by Paul Sasik
    I am working on a basic form/report designer. Some of the features i'm looking to implement are: Single or multiple selection of objects Alignment of objects (when several are selected) Same-sizing of objects (when several are selected) Moving/dragging of selected object(s) Selected object resizing in eight directions (using object grips) For features and look-and-feel I've analyzed and used a mixture of ideas from: MS Visual Studio 200x (most useful so far) Visio Crystal Reports My question is: Have I overlooked some other IDEs that provide these kinds of features that are better and user-friendlier examples of what to do than others i've looked at? (They don't have to be Microsoft products. That's just what i have ready access to.)

    Read the article

  • How do I design this link table?

    - by Soo
    Ok SO, I have a user table and want to define groups of users together. The best solution I have for this is to create three database tables as follows: UserTable user_id user_name UserGroupLink group_id member_id GroupInfo group_id group_name This method keeps the member and group information separate. This is just my way of thinking. Is there a better way to do this? Also, what is a good naming convention for tables that link two other tables?

    Read the article

< Previous Page | 162 163 164 165 166 167 168 169 170 171 172 173  | Next Page >