Search Results

Search found 8776 results on 352 pages for 'boolean logic'.

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

  • Database Table of Boolean Values

    - by guazz
    What's the best method of storing a large number of booleans in a database table? Should I create a column for each boolean value or is there a more optimal method? Employee Table IsHardWorking IsEfficient IsCrazy IsOverworked IsUnderpaid ...etc.

    Read the article

  • SQL for sorting boolean column as true, null, false

    - by petehern
    My table has three boolean fields: f1, f2, f3. If I do SELECT * FROM table ORDER BY f1, f2, f3 the records will be sorted by these fields in the order false, true, null. I wish to order them with null in between true and false: the correct order should be true, null, false. I am using PostgreSQL.

    Read the article

  • MVC: Why put the business logic in the model? What happens when I've multiple types of storage?

    - by Steffen Winkler
    I always thought that the business logic has to be in the controller and that the controller, since it is the 'middle' part, stays static and that the model/view have to be capsuled via interfaces, that way you could change the business logic without affecting anything else, program multiple Models (one for each database/type of storage) and a dozens of views (for different platforms for example). Now I read in this question that you should always put the business logic into the model and that the controller is deeply connected with the view. To me, that doesn't really make sense and implies that each time I want to have the means of supporting another database/type of storage I've to rewrite my whole model including the business logic. And if I want another view, I've to rewrite both the view and the controller. May someone explain why that is or if I went wrong somewhere? Currently, that whole thing doesn't really make sense to me.

    Read the article

  • In retrospect, has it been a good idea to use three-valued logic for SQL NULL comparisons?

    - by Heinzi
    In SQL, NULL means "unknown value". Thus, every comparison with NULL yields NULL (unknown) rather than TRUE or FALSE. From a conceptional point of view, this three-valued logic makes sense. From a practical point of view, every learner of SQL has, one time or another, made the classic WHERE myField = NULL mistake or learned the hard way that NOT IN does not do what one would expect when NULL values are present. It is my impression (please correct me if I am wrong) that the cases where this three-valued logic helps (e.g. WHERE myField IS NOT NULL AND myField <> 2 can be shortened to WHERE myField <> 2) are rare and, in those cases, people tend to use the longer version anyway for clarity, just like you would add a comment when using a clever, non-obvious hack. Is there some obvious advantage that I am missing? Or is there a general consensus among the development community that this has been a mistake?

    Read the article

  • passive view and display logic

    - by genesys
    Hi! In MVC and MVP and similar patterns there's often the approach of the "passive view" which is as stupid as possible. This should facilitate unit testing and create a clearer separation of view and model. I know that those patterns come in very different flavours and especially the understanding of MVP seems to differ from article to article. Therefore my question is not "how do i implement this pattern correctly". I want to improve view and model separation and go for better testability of the application. Therefore i'd like to go for a passive view. But my question is, where would you put logic that is clearly only view related? like a textviewer should scroll the text when the scrollbar is moved. would you put the logic for this into the Presenter? Let's say the textviewer has some extended functionality. like setting markings on textpassages. The logic for this makes clearly sense to be put into the Presenter. However, if it is mixed with all the 'direct' logic of the view (like scrolling the text) the Presenter could become very big, which is also not really a nice design. So my question is where to put display related logic of a passive view and what functionallity to mix in the Presenter. Thanks!

    Read the article

  • How do I improve my logic in general and programming in particular?

    - by Dinesh Venkata
    I'm good with understanding technology and implementing it. At least that is what I feel. But it seems that when I come across experienced programmers they point out that my logic is weak. I feel that I would need some time with real programming to improve it. But nobody is ready to give that time to me. I'm just about starting my carer and it often feels disheartening to hear this. I want know how can I improve my logic and also does this sort of thing happens to others too?

    Read the article

  • Implement the business logic in an app server with spring

    - by HenryOS
    Hi everybody, i have a doub... Is posible implement the business logic in an App Server remote using pojos instead of either EJB or Servlets???. The main idea is apply a model of 3 layers where the clients may be both web browsers and desktop applications, and they share the business logic in an App Server. Sorry for my english... im from Argentina and my english is poor. Thank you to everybody and i hope that anybody can help me soon. Regards! this would be the architecture browser----- Web Server --------|App Server(Business Logic common)|-------|RDBMS common| desktop App(Swing for example)-|App Server(Business Logic common)|-------|RDBMS common|

    Read the article

  • Boolean Expression Evaluation in Java

    - by Trilok
    Hey everyone, Is there a relatively simpler (when compared with writing a parser) way to evaluate boolean expressions in Java? I do not want to use the JEP library. I have a String expression something like: (x 4 || x < 8 && p 6) [ I will replace the variables with values. Is there a way by which I can evaluate this expression? The problem is, this can be any level deep. So, writing a parser would be really complex. Thanks

    Read the article

  • Crystal Reports Formula Workshop boolean condition to string

    - by Jay
    Hello, I'm currently trying to create a report using Crystal Reports that comes with Visual Studio 2008. I would like to include a field of type boolean on my report that shows a string rather than true or false. The string should contain either contain a € or a % sign. How would I go about doing this in the Formula Workshop? I've tried things like e.g. if {tblAankoopDetails.SoortKorting} = true then "€" else "%" However this never seems to work and results in warnings such as "The formula result must be a number". This should be fairly simple but this is my first go at using Crystal Reports. Help would be much appreciated. Jay

    Read the article

  • Equivalence of boolean expressions

    - by Iulian Serbanoiu
    Hello, I have a problem that consist in comparing boolean expressions ( OR is +, AND is * ). To be more precise here is an example: I have the following expression: "A+B+C" and I want to compare it with "B+A+C". Comparing it like string is not a solution - it will tell me that the expressions don't match which is of course false. Any ideas on how to compare those expressions? Any ideas about how can I tackle this problem? I accept any kind of suggestions but (as a note) the final code in my application will be written in C++ (C accepted of course). An normal expression could contain also parenthesis: (A * B * C) + D or A+B*(C+D)+X*Y Thanks in advance, Iulian

    Read the article

  • Strange behaviour of switch case with boolean value

    - by Nikhil Agrawal
    My question is not about how to solve this error(I already solved it) but why is this error with boolean value. My function is private string NumberToString(int number, bool flag) { string str; switch(flag) { case true: str = number.ToString("00"); break; case false: str = number.ToString("0000"); break; } return str; } Error is Use of unassigned local variable 'str'. Bool can only take true or false. So it will populate str in either case. Then why this error? Moreover this error is gone if along with true and false case I add a default case, but still what can a bool hold apart from true and false? Why this strange behaviour with bool variable?

    Read the article

  • In Python, are there builtin functions for elementwise map of boolean operators over tuples of lists

    - by bshanks
    For example, if you have n lists of bools of the same length, then elementwise boolean AND should return another list of that length that has True in those positions where all the input lists have True, and False everywhere else. It's pretty easy to write, i just would prefer to use a builtin if one exists (for the sake of standardization/readability). Here's an implementation of elementwise AND: def eAnd(*args): return [all(tuple) for tuple in zip(*args)] example usage: >>> eAnd([True, False, True, False, True], [True, True, False, False, True], [True, True, False, False, True]) [True, False, False, False, True] thx

    Read the article

  • In Python, are there builtin functions for elementwise boolean operators over boolean lists?

    - by bshanks
    For example, if you have n lists of bools of the same length, then elementwise boolean AND should return another list of that length that has True in those positions where all the input lists have True, and False everywhere else. It's pretty easy to write, i just would prefer to use a builtin if one exists (for the sake of standardization/readability). Here's an implementation of elementwise AND: def eAnd(*args): return [all(tuple) for tuple in zip(*args)] example usage: >>> eAnd([True, False, True, False, True], [True, True, False, False, True], [True, True, False, False, True]) [True, False, False, False, True] thx

    Read the article

  • Magento and unsetting a custom boolean attribute

    - by Spongeboy
    Hi, I've added an attribute to a customer address entity. Attribute setup code is as follows- 'entity_type_id'=>$customer_address_type_id, 'attribute_code'=>'signature_required', 'backend_type'=>'int', 'frontend_input'=>'boolean', 'frontend_label' => 'Signature required', 'is_global' => '1', 'is_visible' => '1', 'is_required' => '0', 'is_user_defined' => '0', I have then - added attribute to model\entity\setup.php added a HTML field on the edit form I am now getting the attribute saved to the database when the checkbox is checked. However, it is not being unset when checkbox is unchecked (I'm guessing due to checkbox input not being 'post'-ed if unchecked. What is the best way to uncheck this? Should I add a default value of 0? Or unset/delete the attribute before save in the controller? Should I add get/set methods to the model?

    Read the article

  • Crystal Reports Formula Workshop boolean condition to string

    - by Jay
    I'm currently trying to create a report using Crystal Reports that comes with Visual Studio 2008. I would like to include a field of type boolean on my report that shows a string rather than true or false. The string should contain either contain a € or a % sign. How would I go about doing this in the Formula Workshop? I've tried things like e.g. if {tblAankoopDetails.SoortKorting} = true then "€" else "%" However this never seems to work and results in warnings such as "The formula result must be a number". This should be fairly simple but this is my first go at using Crystal Reports. Help would be much appreciated. Jay

    Read the article

  • In-memory data structure that supports boolean querying

    - by sanity
    I need to store data in memory where I map one or more key strings to an object, as follows: "green", "blue" -> object1 "red", "yellow" -> object2 I need to be able to efficiently receive a list of objects, where the strings match some boolean criteria, such as: ("red" OR "green") AND NOT "blue" I'm working in Java, so the ideal solution would be an off-the-shelf Java library. I am, however, willing to implement something from scratch if necessary. Anyone have any ideas? I'd rather avoid the overhead of an in-memory database if possible, I'm hoping for something comparable in speed to a HashMap (or at least the same order of magnitude).

    Read the article

  • Default boolean value in a array of record - Delphi

    - by James
    Hi, I am helping out my company with some old delphi 7 code. There is a record declared at the start that is used throughout to store all the data we want outputted. type TOutput_Type = record result: String; resultoffset: String; selected: boolean; resultcategory: integer; end; and then an array of this is declared Output: array of TOutput_Type; The length is set at the start to a large value, as actual length is unknown. This array is used all over the place, but unfortunately the value selected is not always set when used. My problem is I am adding in a summary of the data, but because selected is not set, delphi seems to give it a random true or false status. Is there a way of setting all instances of selected as true at the start? Seems like a simple enough thing to do, but I'm not a delphi programmer so am unsure if its possible? I know I can go through and add in selected := true every time a new record is made, but I'd like to do it cleanly at the start if possible.... Thanks in advance

    Read the article

  • Excel Matching problem with logic expression

    - by abelenky
    I have a block of data that represents the steps in a process and the possible errors: ProcessStep Status FeesPaid OK FormRecvd OK RoleAssigned OK CheckedIn Not Checked In. ReadyToStart Not Ready for Start I want to find the first Status that is not "OK". I have attempted this: =Match("<>""OK""", StatusRange, 0) which is supposed to return the index of the first element in the range that is NOT-EQUAL (<) to "OK" But this doesn't work, instead returning #N/A. I expect it to return 4 (index #4, in a 1-based index, representing that CheckedIn is the first non-OK element) Any ideas how to do this?

    Read the article

  • Ubuntu Preseed set Norwegian Keyboard?

    - by Vangelis Tasoulas
    It's been a couple of days now that I am trying to make a fully automated unattended installation. I managed to make it work with Ubuntu/Cobbler and a preseed file, but I cannot set the correct keyboard layout which is Norwegian in this case. I am doing the tests on a virtual machine and when I am going with a normal manual installation (no preseed) everything is working fine. When I am using the preseed file, I always end up with an "English (US)" keyboard no matter the many different options I have tried. I can change it manually with the "dpkg-reconfigure keyboard-configuration" command, but that's not the case. It should be handled automatically using the preseed file. I am using DEBCONF_DEBUG=5 when the grub is loading, and as I see in "/var/log/installer/syslog" file after the installation has finished, the preseeding commands are accepted. Can anyone help on this? The preseed file I am using is following: d-i debian-installer/country string NO d-i debian-installer/language string en_US:en d-i debian-installer/locale string en_US.UTF-8 d-i console-setup/ask_detect boolean false d-i keyboard-configuration/layout select Norwegian d-i keyboard-configuration/variant select Norwegian d-i keyboard-configuration/modelcode string pc105 d-i keyboard-configuration/layoutcode string no d-i keyboard-configuration/xkb-keymap select no d-i netcfg/choose_interface select auto d-i netcfg/get_hostname string myhostname d-i netcfg/get_domain string simula.no d-i hw-detect/load_firmware boolean true d-i mirror/country string manual d-i mirror/http/hostname string ftp.uninett.no d-i mirror/http/directory string /ubuntu d-i mirror/http/proxy string http://10.0.1.253:3142/ d-i mirror/codename string precise d-i mirror/suite string precise d-i clock-setup/utc boolean true d-i time/zone string Europe/Oslo d-i clock-setup/ntp boolean true d-i clock-setup/ntp-server string 10.0.1.254 d-i partman-auto/method string lvm partman-auto-lvm partman-auto-lvm/new_vg_name string vg0 d-i partman-auto/purge_lvm_from_device boolean true d-i partman-lvm/device_remove_lvm boolean true d-i partman-md/device_remove_md boolean true d-i partman-lvm/confirm boolean true d-i partman-lvm/confirm_nooverwrite boolean true d-i partman-auto-lvm/guided_size string max d-i partman-auto/choose_recipe select 30atomic d-i partman/default_filesystem string ext4 d-i partman-partitioning/confirm_write_new_label boolean true d-i partman/choose_partition select finish d-i partman/confirm boolean true d-i partman/confirm_nooverwrite boolean true d-i partman/mount_style select uuid d-i passwd/root-login boolean false d-i passwd/make-user boolean true d-i passwd/user-fullname string vangelis d-i passwd/username string vangelis d-i passwd/user-password-crypted password $6$asdafdsdfasdfasdf d-i passwd/user-uid string d-i user-setup/allow-password-weak boolean false d-i passwd/user-default-groups string adm cdrom dialout lpadmin plugdev sambashare d-i user-setup/encrypt-home boolean false d-i apt-setup/restricted boolean true d-i apt-setup/universe boolean true d-i apt-setup/backports boolean true d-i apt-setup/services-select multiselect security d-i apt-setup/security_host string security.ubuntu.com d-i apt-setup/security_path string /ubuntu tasksel tasksel/first multiselect Basic Ubuntu server, OpenSSH server d-i pkgsel/include string build-essential htop vim nmap ntp d-i pkgsel/upgrade select safe-upgrade d-i pkgsel/update-policy select none d-i pkgsel/updatedb boolean true d-i grub-installer/only_debian boolean true d-i grub-installer/with_other_os boolean true d-i finish-install/keep-consoles boolean false d-i finish-install/reboot_in_progress note d-i cdrom-detect/eject boolean true d-i debian-installer/exit/halt boolean false d-i debian-installer/exit/poweroff boolean false

    Read the article

  • Data Structures for Logic Games / Deduction Rules / Sufficient Set of Clues?

    - by taserian
    I've been cogitating about developing a logic game similar to Einstein's Puzzle , which would have different sets of clues for every new game replay. What data structures would you use to handle the different entities (pets, colors of houses, nationalities, etc.), deduction rules, etc. to guarantee that the clues you provide point to a unique solution? I'm having a hard time thinking about how to get the deduction rules to play along with the possible clues; any insight would be appreciated.

    Read the article

  • What's the most useful piece of logic you use? [closed]

    - by nomaderWhat
    Just tapping away and automatically made use of that one logic algorithm I always use, which you'll probably guess is: (not A) OR (not B) = not (A AND B) Curious if this is the case for just about everyone else, and more curious if there is a different algorithm that other programmers make use of that is just as if not more useful to them. Really hoping for the latter, cause the one above is well... so boring.

    Read the article

  • Does business logic belong in the service layer?

    - by antony.trupe
    I've got a set of classes, namely, a data transfer object, a service implementation object, and a data access object. I currently have business logic in the service implementation object; it uses the dao to get data to populate the dto that is shipped back to the client/gui code. The issue is that I can't create a lightweight junit test of the service implementtion object(it's a servlet); I think the business logic should be elsewhere, but the only thing I can think of is putting business logic in the dao or in yet another layer that goes between the dao and the service implementation. Are there other options, or am I thinking about this the wrong way? It's a GWT/App Engine project.

    Read the article

  • Separation of logic from presentation: HTTP variable names?

    - by Allan Jardine
    Hello all, This could probably be considered an academic question, rather than a real world one - but throwing it out to see if anyone has any great ideas! We all know that keeping the business logic of an application separate from the presentation is a good idea (I'm looking at web-apps atm), but there needs to be an understanding between the business logic for what HTTP variables to expect (and then process) and the variable names which are sent by the presentation layer. Is this simply a matter of telling the designer what variable names to use in a template? The template doesn't need to know what the variable names are (unless using them for JS/CSS selectors), so why should they be 'hardcoded' in there. Or should the business logic put the names into variables to be printed out? Another layer of complexity for the templates? Does anyone have any experience of this, or thoughts on how to deal with it? Thanks, Allan

    Read the article

  • Documenting logic in javadoc

    - by smayers81
    I have a question about where to document logic in javadocs. For example, I have the following method signature in an interface: public int getTotalAssociationsAsParent(Long id, Long type); The method returns associations where the given ID is the parent and the association is of type 'type'. ID is required, but if type passed in is NULL, then I will return ALL associations where the ID is the parent. My question is where should this type of logic be documented? I hesitate putting it in the javadoc of the interface because that sort of constrains all implementing classes to adhere to that logic. Maybe in the future, I'll have an Impl class that throws an IllegalArgumentException if type is NULL. However, if I put it in non-javadoc in the Impl class, then consumers of this method won't know how the method behaves with a NULL type.

    Read the article

  • DataView boolean cell

    - by Nilbert
    How would I add a cell to a DataView that was toggleable between True and False like the dataview in the Microsoft Visual C# properties window? I can only find a way to add a text box type cell to it, but I need to add a toggleable one, and also a dropdown list type. Thanks for any help.

    Read the article

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