Search Results

Search found 5157 results on 207 pages for 'logic gates'.

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

  • How do I parse boolean logic?

    - by d03boy
    I need to write a boolean logic parser which will translate the boolean logic language to a SQL WHERE clause. The order of the operands will always be in the correct order (with value on the right). Here is a relatively simple example. There could be nested parentheses and the use of NOT operators, etc. (CACOUNT=01 OR CACOUNT=02 OR CACOUNT=03 OR CACOUNT=05 OR CACOUNT=07 OR CACOUNT=09 OR CACOUNT=12 OR CACOUNT=13 OR CACOUNT=18) AND Q4=1 AND NAME=TIMOTHY Here is what the WHERE clause would resemble. WHERE ( EXISTS ( SELECT 1 FROM MyVerticalTable b WHERE b.Key=a.Key AND b.Key='CACOUNT' AND b.Value='01' ) )

    Read the article

  • What logic operator to use, as3?

    - by VideoDnd
    What operator or expression can I use that will fire on every number, including zero? I want a logic operator that will fire with ever number it receives. My animations pause at zero. This skips on zero if (numberThing> 0); This skips on 9 if (numberThing>> 0); This jitters 'fires quickly and goes back on count' if (numberThing== 0); EXPLANATION I'm catching split string values in a logic function, and feeding them to a series of IF, ELSE IF statements. I'm using this with a timer, so I can measure the discrepency. CODE • I GET VALUES FROM TIMER • STRING GOES TO TEXTFIELD 'substr' • NUMBER TRIGGERS TWEENS 'parseInt' • Goes to series of IF and ELSE IF statements

    Read the article

  • Programming knowledge vs. programming logic

    - by Shirish11
    Is there any difference between the two topics? I have seen companies asking for Good Programming knowledge some Good Programming logic. I believe that Programming knowledge is related to knowledge about the language in consideration and Programming logic is problem solving logic using programming (in general). Please correct me if I am wrong. Also what is more important. Edit: Do selection of components for application, designing interfaces validating user inputs fall under programming knowledge or Programming logic? Does programming logic simply imply problem solving, or is there anything else which it should comprise of?

    Read the article

  • Struts logic:iterate input field

    - by camilos
    I currently have the following code and the data is displayed fine. <logic:iterate name="myList" id="product" indexId="iteration" type="com.mycompany.MyBean"> <tr> <td> <bean:write name="product" property="weight"/> </td> <td> <bean:write name="product" property="sku"/> </td> <td> <bean:write name="product" property="quantity"/> </td> </tr> </logic:iterate> But now I need to make the "quantity" part modifiable. The user should be able to update that field, press submit and when its sent to the server, "myList" should automatically update with the new quantities. I've tried searching for help on this but all I keep finding is examples on how to display data only, not modify it. Any help would be appreciated.

    Read the article

  • Is XML a good logic to load data??

    - by Mat
    Hi stack, i'm working on an app that loads some data from xml file from internet. Is this a good way to develop iPhone apps??...I think xml is more light than SQlite database... Basically my logic is: 1 - Parsing Xml file from internet to retrive the data 2 - Load data on device Security?..other stuff??.. Thanks Mat

    Read the article

  • how to refactor tricky logic involving consecutive sets?

    - by keruilin
    The rule at work here is that users can be awarded badges for a streak of 10, 20, and 30. If the user has a streak over 30, such as 40 or 50, then the logic must be that it only awards a 10-streak badge for 40 and a 20-streak badge for 50, and so on. def check_win_streak(streak) badge = 10 while badge < badge::MAX_STREAK_BADGE_SIZE do # MAX_STREAK_BADGE_SIZE = 30 if streak < badge then break end if (streak % badge == 0) then award_streak_badge(badge) end badge += 10 end end

    Read the article

  • web service for business logic or data access layer

    - by luiscarlosch
    This post http://www.theserverside.net/tt/articles/showarticle.tss?id=Top5WSMistakes encourages me to create the web service for business logic layer but many people use it in the data access layer. I want to create a project where i want to access the same data repository from a desktop application, website and a cell phone. What would you recommend me? Is there any case it may be a good idea implement web services to both layers? thanks.

    Read the article

  • logic question about factorials

    - by Syom
    I have a problem and can't solve it alone. My teacher gives me one logic task today, and i'm sure you can help me. How can I count the number of zeroes at the end of factorial(41). (on paper) I understand that it has nothing to do with programing, but I'm sure programers can help me. Thanks in advance.

    Read the article

  • What is the relationship between the business logic layer and the data access layer?

    - by Matt Fenwick
    I'm working on an MVC-ish app (I'm not very experienced with MVC, hence the "-ish"). My model and data access layer are hard to test because they're very tightly coupled, so I'm trying to uncouple them. What is the nature of the relationship between them? Should just the model know about the DAL? Should just the DAL know about the model? Or should both the model and the DAL be listeners of the other? In my specific case, it's: a web application the model is client-side (javascript) the data is accessed from the back-end using Ajax persistence/back-end is currently PHP/MySQL, but may have to switch to Python/GoogleDataStore on the GAE

    Read the article

  • Is the separation of program logic and presentation layer going too far?

    - by Timwi
    In a Drupal programming guide, I noticed this sentence: The theme hook receives the total number of votes and the number of votes for just that item, but the template wants to display a percentage. That kind of work shouldn't be done in a template; instead, the math is performed here. The math necessary to calculate a percentage from a total and a number is (number/total)*100. Is this application of two basic arithmetic operators within a presentation layer already too much? Is the maintenance of the entire system severely compromised by this amount of mathematics? The WPF (Windows Presentation Framework) and its UI mark-up language, XAML, seem to go to similar extremes. If you try to so much as add two numbers in the View (the presentation layer), you have committed a cardinal sin. Consequently, XAML has no operators for any arithmetic whatsoever. Is this ultra-strict separation really the holy grail of programming? What are the significant gains to be had from taking the separation to such extremes?

    Read the article

  • Logic behind crawling an webpages like that of Screaming Frog? [on hold]

    - by sree
    I would like to know what is the parameters to be considered while developing a crawler like that of Screaming Frog. Am looking forward for information on do's and dont's of webpage crawling. What are the problems the crawler may infuse on the webpages like loadtime (maybe?) or anything that effects webpage during crawling. What are the rules the crawler needs to follow etc. Basically anything info that makes the crawler look good and accurate. Just point me in a right direction to achieve it.. Hope my requirement is clear this time.. :)

    Read the article

  • Tool to write linear temporal logic from UML 2.0 sequence diagram

    - by user326180
    i am working on checking model consistency of software. to do this i need to write linear temporal logic for UML 2.0 sequence diagram. if any body have any other tool for the same please response as soon as possible. I will be very obliged to you. i have found charmy tool have plugin for the same. Does anybody have source code for charmy tool(CHecking ARchitectural Model consistencY). It is not available on their website. Thanks in advance.

    Read the article

  • What's wrong with my logic here?

    - by stu
    In java they say don't concatenate Strings, instead you should make a stringbuffer and keep adding to that and then when you're all done, use toString() to get a String object out of it. Here's what I don't get. They say do this for performance reasons, because concatenating strings makes lots of temporary objects. But if the goal was performance, then you'd use a language like C/C++ or assembly. The argument for using java is that it is a lot cheaper to buy a faster processor than it is to pay a senior programmer to write fast efficient code. So on the one hand, you're supposed let the hardware take care of the inefficiencies, but on the other hand, you're supposed to use stringbuffers to make java more efficient. While I see that you can do both, use java and stringbuffers, my question is where is the flaw in the logic that you either use a faster chip or you spent extra time writing more efficient software.

    Read the article

  • High level programming logic, design, pattern

    - by Muhammad Shahzad
    I have been doing programming from last 7 years, getting better and better, but still i think that am lacking something. I have been doing work in JOOMLA, MAGENTO, WP, Custom PHP, Opencart, laravel, codeignitor. Sometimes i need to design logic for a huge database application, in the applications we need nesting loops and queries, although i follow OOPS standards, ORM etc, still i feel i need more robust coding designs. I need to know how can i improve these things, so that code remain neat, efficient and faster. Also how big webapps like facebook twitter tests there code speed? How high level programmers choose design patterns. If you can help me find something useful with examples?

    Read the article

  • C# logic order and compiler behavior

    - by Terrapin
    In C#, (and feel free to answer for other languages), what order does the runtime evaluate a logic statement? Example: DataTable myDt = new DataTable(); if (myDt != null && myDt.Rows.Count > 0) { //do some stuff with myDt } Which statement does the runtime evaluate first - myDt != null or: myDt.Rows.Count > 0 ? Is there a time when the compiler would ever evaluate the statement backwards? Perhaps when an "OR" operator is involved?

    Read the article

  • What is more interesting or powerful: Curry/Mercury/Lambda-Prolog/your suggestion.

    - by Bubba88
    Hi! I would like to ask you about what formal system could be more interesting to implement from scratch/reverse engineer. I've looked through some existing and rather open (open in the sense of free/open-source) projects of logical/declarative programming systems. I've decided to make up something similar in my free time, or at least to catch the general idea of implementation. It would be great if some of these systems would provide most of the expressive power and conciseness of modern academic investigations in logic and it's relation with computational models. What would you recommend to study at least at the conceptual level? For example, Lambda-Prolog is interesting particularly because it allows for higher order relations, but AFAIK (I might really be mistaken :)) is based on intuitionist logic and therefore lack the excluded-middle principle; that's generally a disatvantage for me.. I would also welcome any suggestions about modern logical programming systems which are less popular but more expressive/powerful. I guess, this question will need refactoring, but thank you in advance! :)

    Read the article

  • Separation of business logic

    - by bruno
    When I was optimizing my architecture of our applications in our website, I came to a problem that I don't know the best solution for. Now at the moment we have a small dll based on this structure: Database <-> DAL <-> BLL the Dal uses Business Objects to pass to the BLL that will pass it to the applications that uses this dll. Only the BLL is public so any application that includes this dll, can see the bll. In the beginning, this was a good solution for our company. But when we are adding more and more applications on that Dll, the bigger the Bll is getting. Now we dont want that some applications can see Bll-logic from other applications. Now I don't know what the best solution is for that. The first thing I thought was, move and separate the bll to other dll's which i can include in my application. But then must the Dal be public, so the other dll's can get the data... and that I seems like a good solution. My other solution, is just to separate the bll in different namespaces, and just include only the namespaces you need in the applications. But in this solution, you can get directly access to other bll's if you want. So I'm asking for your opinions.

    Read the article

  • Help with a logic problem

    - by Stradigos
    I'm having a great deal of difficulty trying to figure out the logic behind this problem. I have developed everything else, but I really could use some help, any sort of help, on the part I'm stuck on. Back story: *A group of actors waits in a circle. They "count off" by various amounts. The last few to audition are thought to have the best chance of getting the parts and becoming stars. Instead of actors having names, they are identified by numbers. The "Audition Order" in the table tells, reading left-to-right, the "names" of the actors who will be auditioned in the order they will perform.* Sample output: etc, all the way up to 10. What I have so far: using System; using System.Collections; using System.Text; namespace The_Last_Survivor { class Program { static void Main(string[] args) { //Declare Variables int NumOfActors = 0; System.DateTime dt = System.DateTime.Now; int interval = 3; ArrayList Ring = new ArrayList(10); //Header Console.Out.WriteLine("Actors\tNumber\tOrder"); //Add Actors for (int x = 1; x < 11; x++) { NumOfActors++; Ring.Insert((x - 1), new Actor(x)); foreach (Actor i in Ring) { Console.Out.WriteLine("{0}\t{1}\t{2}", NumOfActors, i, i.Order(interval, x)); } Console.Out.WriteLine("\n"); } Console.In.Read(); } public class Actor { //Variables protected int Number; //Constructor public Actor(int num) { Number = num; } //Order in circle public string Order(int inter, int num) { //Variable string result = ""; ArrayList myArray = new ArrayList(num); //Filling Array for (int i = 0; i < num; i++) myArray.Add(i + 1); //Formula foreach (int element in myArray) { if (element == inter) { result += String.Format(" {0}", element); myArray.RemoveAt(element); } } return result; } //String override public override string ToString() { return String.Format("{0}", Number); } } } } The part I'm stuck on is getting some math going that does this: Can anyone offer some guidance and/or sample code?

    Read the article

  • ActiveRecord Logic Challenge - Smart Ways to Use AR Timestamp

    - by keruilin
    My question is somewhat specific to my app's issue, but the answer should be instructive in terms of use cases for association logic and the record timestamp. I have an NBA pick 'em game where I want to award badges for picking x number of games in a row correctly -- 10, 20, 30. Here are the models, attributes, and associations in-play: User id Pick id result # (values can be 'W', 'L', 'T', or nil. nil means hasn't resolved yet.) resolved # (values can be true, false, or nil.) game_time created_at *Note: There are cases where a pick's result field and resolved field will always be nil. Perhaps the game was cancelled. Badge id Award id user_id badge_id created_at User has many awards. User has many picks. Pick belongs to user. Badge has many awards. Award belongs to user. Award belongs to badge. One of the important rules here to capture in the code is that while a user can be awarded multiple streak badges (e.g., a user can win multiple 10-streak badges), the user CAN'T be awarded another badge for consecutive winning picks that were previously granted an award badge. One way to think of this is that all the dates of the winning picks must come after the date that the streak badge was awarded. For example, let's pretend that a user made 13 winning picks from May 5 to May 8, with the 10th winning pick occurring on May 7, and the last 3 on May 8. The user would be awarded a 10-streak badge on May 7. Now if the user makes another winning pick on May 9, the code must recognize that the user only has a streak of 4 winning picks, not 14, because the user already received an award for the first 10. Now let's assume that the user makes 6 more winning picks. In this case, the code must recognize that all winning picks since May 5 are eligible for a 20-streak badge award, and make the award. Another important rule is that when looking at a winning streak, we don't care about the game time, but rather when the pick was made (created_at). For example, let's say that Team A plays Team B on Sat. And Team C plays Team D on Sun. If the user picks Team C to beat Team D on Thurs, and Team A to beat Team C on Fri, and Team A wins on Sat, but Team C loses on Sun, then the user has a losing streak of 1. So when must the streak-check kick-in? As soon as a pick is a win. If it's a loss or tie, no point in checking. One more note: if the pick is not resolved (false) and the result is nil, that means the game was postponed and must be factored out. With all that said, what is the most efficient, effective and lean way to determine whether a user has a 10-, 20- or 30-win streak?

    Read the article

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