Search Results

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

Page 26/352 | < Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >

  • authentication question (security code generation logic)

    - by Stick it to THE MAN
    I have a security number generator device, small enough to go on a key-ring, which has a six digit LCD display and a button. After I have entered my account name and password on an online form, I press the button on the security device and enter the security code number which is displayed. I get a different number every time I press the button and the number generator has a serial number on the back which I had to input during the account set-up procedure. I would like to incorporate similar functionality in my website. As far as I understand, these are the main components: Generate a unique N digit aplha-numeric sequence during registration and assign to user (permanently) Allow user to generate an N (or M?) digit aplha-numeric sequence remotely For now, I dont care about the hardware side, I am only interested in knowing how I may choose a suitable algorithm that will allow the user to generate an N (or M?) long aplha-numeric sequence - presumably, using his unique ID as a seed Identify the user from the number generated in step 2 (which decryption method is the most robust to do this?) I have the following questions: Have I identified all the steps required in such an authentication system?, if not please point out what I have missed and why it is important What are the most robust encryption/decryption algorithms I can use for steps 1 through 3 (preferably using 64bits)?

    Read the article

  • declaring constraint to consider prog logic

    - by shantanuo
    I can open a trip only once but can close it multiple times. I can not declare the Trip_no + status as primary key since there can be multiple entries while closing the trip. Is there any way that will assure me that a trip number is opened only once? For e.g. there should not be the second row with "Open" status for trip No. 3 since it is already there in the following table. Trip No | Status 1 Open 1 Close 1 Close 2 Open 2 Close 3 Open 3 Close 3 Close 3 Close 3 Close

    Read the article

  • A PHP object server for business logic

    - by Matthieu
    I wonder if such a thing is possible or even exist : In the MVC pattern, I would like to have the Model part to be persistant in memory, instead of reloading my instances at each execution. So I want only the Controller and View part to be executed. Is there any solution of server that would provide PHP objects (just like a Mysql server provides data records), and that keeps these objects in memory ? A problem would be also : how to have a constructed query to get objects ? Maybe PHP Linq ?

    Read the article

  • T-SQL Syntax Issue Else if style logic

    - by Yoda
    Hi guys, two questions today, I'm a busy bee and luckily I have an awesome community at my disposal! My issue here is this: I have a field i need to update based on existing field data. If Gender = F then foo = 1 If Gender = M then foo = 2 If Gender = Male then foo = 2 If Gender = Female then foo = 1 If Gender is not above then foo = 3 Here is what I have: update EmailAddresses set Priority1 = '1' where GENDER__C = 'Female' update EmailAddresses set Priority1 = '2' where GENDER__C = 'Male' update EmailAddresses set Priority1 = '1' where GENDER__C = 'F' update EmailAddresses set Priority1 = '2' where GENDER__C = 'M' update EmailAddresses set Priority1 = '3' where GENDER__C not in (select 'Female', 'Male', 'F', 'M') Any help much appreciated! And its Friday!! Whoo hoo

    Read the article

  • Logic for family tree program

    - by david robers
    Hi All, I am creating a family tree program in Java, or at least trying to. I have developed several classes: Person - getters and setter for name gender age etc FamilyMember - extends Person getters and setters for setting arents and children Family - which consists of multiple family members and methods for adding removing members FamilyTree which is the main class for setting relationships. I have two main problems: 1) I need to set the relationships between people. Currently I am doing: FamilyMember A, FamilyMember B B.setMother(A); A.setChild(B); The example above is for setting a mother child relationship. This seems very clunky. Its getting very long winded to implement all relationships. Any ideas on how to implement multiple relationships in a less prodcedural way? 2) I have to be able to display the family tree. How can I do this? Are there any custom classes out there to make life easier? Thanks for your time...

    Read the article

  • AI opponenet car logic in car race game.

    - by ashok patidar
    hello i want to develop AI car(opponent) in car race game what should be my direction to develop them with less complexity because i don't have any idea. because the player car is moving on the scrolling track plz suggest me should i have to use relative motion or way point concept but that should also be change on the scrolling track (i.e. player car movement)

    Read the article

  • Users Hierarchy Logic

    - by user342944
    Hi guys, I am writing a user security module using SQLServer 2008 so threfore need to design a database accordingly. Formally I had Userinfo table with UserID, Username and ParentID to build a recursion and populated tree to represent hierarchy but now I have following criteria which I need to develop. I have now USERS, ADMINISTRATORS and GROUPS. Each node in the user hierarchy is either a user, administrator or group. User Someone who has login access to my application Administrator A user who may also manage all their child user accounts (and their children etc) This may include creating new users and assigning permissions to those users. There is no limit to the number of administrators in user structure. The higher up in the hierarchy that I go administrators have more child accounts to manage which include other child administrators. Group A user account can be designated as a group. This will be an account which is used to group one or more users together so that they can be manage as a unit. But no one can login to my application using a group account. This is how I want to create structure Super Administrator administrator ------------------------------------------------------------- | | | Manager A Manager B Manager C (adminstrator) (administrator) (administrator) | ----------------------------------------- | | | Employee A Employee B Sales Employees (User) (User) (Group) | ------------------------ | | | Emp C Emp D Emp E (User) (User) (User) Now how to build the table structure to achieve this. Do I need to create Users table alongwith Group table or what? Please guide I would really appreciate.

    Read the article

  • Handling Application Logic in Multiple AsyncTask onPostExecute()s

    - by stormin986
    I have three simultaneous instances of an AsyncTask for download three files. When two particular ones finish, at the end of onPostExecute() I check a flag set by each, and if both are true, I call startActivity() for the next Activity. I am currently seeing the activity called twice, or something that resembles this type of behavior. Since the screen does that 'swipe left' kind of transition to the next activity, it sometimes does it twice (and when I hit back, it goes back to the same activity). It's obvious two versions of the activity that SHOULD only get called once are being put on the Activity stack. The only way I can find that this is possible is if both AsyncTasks' onPostExecute() executed SO simultaneously that they were virtually running the same lines at the same time, since I set the 'itemXdownloaded' flag to true right before I check for both and call startActivity(). But this is happening enough that it's very hard for me to believe that both downloads are finishing precisely at the same time and having their onPostExecute()s so close together... Any thoughts on what could be going on here? General gist of code (details removed, ignore any syntactical errors I may have edited in): // In onPostExecute() switch (downloadID) { case DL1: dl1complete = true; break; case DL2: dl2complete = true; break; case DL3: dl3complete = true; break; } // If 1 and 2 are done, move on (DL3 still going in background) if ( downloadID != DL3 && dl1complete && dl2complete) { ParentClass.this.startActivity(new Intent(ParentClass.this, NextActivity.class)); }

    Read the article

  • creative way for implementing Data object with its corresponding business logic class in java

    - by ekeren
    I have a class that need to be serialized (for both persistentcy and client-server communication) for simplicity's sake let's call the classes Business a BusinessData and I prefix for their Interfaces. All the getter and setter are delegated from Business class to BusinessData class. I thought about implementing IBusinessData interface that will contain all the getter and setters and IBusiness interface that will extend it. I can either make Business extend BuisnessData so I will not need to implement all getter and setter delegates, or make some abstract class ForwardingBusinessData that will only delegate getter and setters. Any of the above option I lose my hierarchy freedom, do any of you have any creative solutions for this problem... I also reviewed DAO pattern: http://java.sun.com/blueprints/patterns/DAO.html

    Read the article

  • Drupal 7 Forms API Conditional Logic not working in IE

    - by Francis Yaconiello
    I have a drupal 7 form with a bunch of fields: $form['account_type'] = array( '#title' => t('Utility Account Type'), '#type' => 'select', '#options' => necp_enrollment_administration_portal_account_type_options(), '#required' => TRUE, '#default_value' => isset($form_state['values']['account_type']) ? $form_state['values']['account_type'] : '', ); // Should show if account_type = 1 $form['home_wrapper'] = array( '#type' => 'fieldset', '#states' => array( 'visible' => array( ':input[name="account_type"]' => array('value' => 1), ), ), ); $form['home_wrapper']['first_name_1'] = array( '#title' => t('Primary Account First Name'), '#type' => 'textfield', '#default_value' => isset($form_state['values']['first_name_1']) ? $form_state['values']['first_name_1'] : '', '#states' => array( 'required' => array( ':input[name="account_type"]' => array('value' => 1), ), ), ); $form['home_wrapper']['last_name_1'] = array( '#title' => t('Primary Account Last Name'), '#type' => 'textfield', '#default_value' => isset($form_state['values']['last_name_1']) ? $form_state['values']['last_name_1'] : '', '#states' => array( 'required' => array( ':input[name="account_type"]' => array('value' => 1), ), ), ); // Should show if account_type = 2 $form['business_wrapper'] = array( '#type' => 'fieldset', '#states' => array( 'visible' => array( ':input[name="account_type"]' => array('value' => 2), ), ), ); $form['business_wrapper']['company_name'] = array( '#title' => t('Company/Organization'), '#type' => 'textfield', '#default_value' => isset($form_state['values']['company_name']) ? $form_state['values']['company_name'] : '', '#states' => array( 'required' => array( ':input[name="account_type"]' => array('value' => 2), ), ), ); In Firefox/Chrome/Opera all versions this form behaves as it should. However in all versions of IE the form initializes with display:none; style on all of the conditional fields regardless of what the value in account_type is. Changing the selected option of account_type does not effect the hidden status. Any tips on debugging this form would be awesome. Notes: I am not much of a Drupal developer, I inherited this site. Just trying to iron out the last couple bugs so we can go live there are more fields than are listed above, I just gave you some of the applicable ones so that you could get the gist of how my forms were setup current url for the form in development: https://northeastcleanpower.com/enroll_new I'm using http://www.browserstack.com/ to debug IE 7 - 10pp4 (I think we only have to support 8 and up though) I've also tried: ':select[name="account_type"]' => array('value' => 1), '#edit-account-type' => array('value' => 1),

    Read the article

  • Help with method logic in Java, hw

    - by Crystal
    I have a Loan class that in its printPayment method, it prints the amortization table of a loan for a hw assignment. We are also to implement a print first payment method, and a print last payment method. Since my calculation is done in the printPayment method, I didn't know how I could get the value in the first or last iteration of the loop and print that amount out. One way I can think of is to write a new method that might return that value, but I wasn't sure if there was a better way. Here is my code: public abstract class Loan { public void setClient(Person client) { this.client = client; } public Person getClient() { return client; } public void setLoanId() { loanId = nextId; nextId++; } public int getLoanId() { return loanId; } public void setInterestRate(double interestRate) { this.interestRate = interestRate; } public double getInterestRate() { return interestRate; } public void setLoanLength(int loanLength) { this.loanLength = loanLength; } public int getLoanLength() { return loanLength; } public void setLoanAmount(double loanAmount) { this.loanAmount = loanAmount; } public double getLoanAmount() { return loanAmount; } public void printPayments() { double monthlyInterest; double monthlyPrincipalPaid; double newPrincipal; int paymentNumber = 1; double monthlyInterestRate = interestRate / 1200; double monthlyPayment = loanAmount * (monthlyInterestRate) / (1 - Math.pow((1 + monthlyInterestRate),( -1 * loanLength))); System.out.println("Payment Number | Interest | Principal | Loan Balance"); // amortization table while (loanAmount >= 0) { monthlyInterest = loanAmount * monthlyInterestRate; monthlyPrincipalPaid = monthlyPayment - monthlyInterest; newPrincipal = loanAmount - monthlyPrincipalPaid; loanAmount = newPrincipal; System.out.printf("%d, %.2f, %.2f, %.2f", paymentNumber++, monthlyInterest, monthlyPrincipalPaid, loanAmount); } } /* //method to print first payment public double getFirstPayment() { } method to print last payment public double getLastPayment() { }*/ private Person client; private int loanId; private double interestRate; private int loanLength; private double loanAmount; private static int nextId = 1; } Thanks!

    Read the article

  • Prolog for beginners about logic and syntax

    - by lnotik
    Hello everybody. I have this question : I need to create a paradict "rightGuesses" which will get 3 arguments , each one of them is a list of letters : 1) The list of guessed letters 2) The word i have to guess 3) The letters that where guessed so far . for example : rightGuesses([n,o,p,q], [p,r,o,l,o,g], Ans). will give us Ans = [p, -, o, -, o, -]. i made: rightGuesses([],T2,[ANS]) rightGuesses([A|T1],T2,[ANS]):- (member(A,T2))=\=true , rightGuesses(T1,T2,[ _ |'-']). rightGuesses([A|T1],T2,[ANS]):- member(A,T2), rightGuesses(T1,T2,[ _ |A]). but i get : ERROR: c:/users/leonid/desktop/file3.pl:5:0: Syntax error: Operator expected Warning: c:/users/leonid/desktop/file3.pl:6: when i trying to compile it what is my problem , and is there is a better way to do it ? thanks in advance.

    Read the article

  • C# - Bug in Code Logic

    - by Matthew
    I have some code which keeps track of the number of times a button has been clicked. As a matter of fact, when the page first loads, a counter is set to 0. On every postback, the counter is incremented by 1. I have only one button on the page. The main idea behind this is to allow the user to enter some details 4 times. If he enters invalid details for 4 times, he is redirected to an error page. Otherwise, he is redirected to a confirmation page. This is my code: if (!this.IsPostBack) { Session["Count"] = 0; } else { if (Session["Count"] == null) { Session.Abandon(); Response.Redirect("CheckOutErrorPage.htm"); } else { int count = (int)Session["Count"]; if (count == 3) { Session.Abandon(); Response.Redirect("CheckOutFailure.aspx"); } else { count++; Session["Count"] = count; } } } Everything works as it should except that if the user enter invalid details for 3 times and then he enters VALID details on the 4th time, the user is redirected to the Error Page (because he has tried 4 times) instead of the confirmation page. How can I solve this please?

    Read the article

  • Android game logic problem

    - by semajhan
    I'm currently creating a game and have a problem which I think I know why it is occurring but not entirely sure and even if I knew, don't know how to solve. I have a 2D array 10 x 10 and have a "player" class that takes up a tile. Now, I have created 2 instances of the player and move them around via swiping. Around the edges I have put "walls" that the player cannot walk through and everything works fine, until I remove a wall. Once I remove a wall and move the character/player to the edge of the screen, the player cannot go any further. The problem occurs here, where the second instance of the player is not at the edge of the screen but say 2 tiles from the first instance of "player" who is at the edge. If I try moving them further into the direction of the edge, I understand that the first instance of player wouldn't move or do anything but the second instance of player should still move, but it won't. This is the code that executed when the user swipes: if (player.getArrayX() - 1 != player2.getArrayX()) { player.moveLeft(); } else if (player.getArrayX() - 1 == player2.getArrayX() && player.getArrayY() != player2.getArrayY()) { player.moveLeft(); } if (player2.getArrayX() - 1 != player.getArrayX()) { player2.moveLeft(); } else if (player2.getArrayX() - 1 == player.getArrayX() && player2.getArrayY() != player.getArrayY()) { player2.moveLeft(); } In the player class I have: public void moveLeft() { if (alive) { switch (levelMaster.getLevel1(getArrayX() - 1, getArrayY())) { case 0: break; case 1: subX(); // basically moves player left setArrayX(getArrayX() - 1); // shifts x coord of player 1 within tilemap Log.d("semajhan", "x: " + getArrayX()); break; case 9: subX(); setArrayX(getArrayX() - 1); setAlive(false); break; } } } Any help on the matter or further insight would be greatly appreciated, thanks.

    Read the article

  • Parsing string logic issue c#

    - by N0xus
    This is a follow on from this question My program is taking in a string that is comprised of two parts: a distance value and an id number respectively. I've split these up and stored them in local variables inside my program. All of the id numbers are stored in a dictionary and are used check the incoming distance value. Though I should note that each string that gets sent into my program from the device is passed along on a single string. The next time my program receives that a signal from a device, it overrides the previous data that was there before. Should the id key coming into my program match one inside my dictionary, then a variable held next to my dictionaries key, should be updated. However, when I run my program, I don't get 6 different values, I only get the same value and they all update at the same time. This is all the code I have written trying to do this: Dictionary<string, string> myDictonary = new Dictionary<string, string>(); string Value1 = ""; string Value2 = ""; string Value3 = ""; string Value4 = ""; string Value5 = ""; string Value6 = ""; void Start() { myDictonary.Add("11111111", Value1); myDictonary.Add("22222222", Value2); myDictonary.Add("33333333", Value3); myDictonary.Add("44444444", Value4); myDictonary.Add("55555555", Value5); myDictonary.Add("66666666", Value6); } private void AppendString(string message) { testMessage = message; string[] messages = message.Split(','); foreach(string w in messages) { if(!message.StartsWith(" ")) outputContent.text += w + "\n"; } messageCount = "RSSI number " + messages[0]; uuidString = "UUID number " + messages[1]; if(myDictonary.ContainsKey(messages[1])) { Value1 = messageCount; Value2 = messageCount; Value3 = messageCount; Value4 = messageCount; Value5 = messageCount; Value6 = messageCount; } } How can I get it so that when programs recives the first key, for example 1111111, it only updates Value1? The information that comes through can be dynamic, so I'd like to avoid harding as much information as I possibly can.

    Read the article

  • logic before dispatcher + controller?

    - by Spoonface
    I believe for a typical MVC web application the router / dispatcher routine is used to decide which controller is loaded based primarily on the area requested in the url by the user. However, in addition to checking the url query string, I also like to use the dispatcher to check whether the user is currently logged in or not to decide which controller is loaded. For example if they are logged in and request the login page, the dispatcher would load their account instead. But is this a fairly non-standard design? Would it violate MVC in any way? I only ask as the examples I've read through this weekend have had no major calculations performed before the dispatcher routine, and commonly check whether the user is logged in or not per controller, and then redirect where necessary. But to me it seems odd to redirect a logged in user from the login area to account area if you could just load the account controller in the first place? I hope I've explained my consternation well enough, but could anyone offer some details on how they handle logged in users, and similar session data?

    Read the article

  • Help regarding database and logic layer for my ASP.NET MVC application

    - by Ismail S
    I'm going to start a new project which is going to be small initially but may grow to big over the years. I'm strongly convinced that I'm going to use ASP.NET MVC with jQuery for UI. I want to go for MySQL as database for some reasons but worried on few things. I've a good years of experience working on SQL Server databases and on one project I've had a bad experience creating and managing stored procedures on MySQL database. I'm totally new to Linq but I see that it is easier to use once you are familiar with it. First thing is that accessing data should be easy. So I thought I should use MySQL to Linq but somewhere I read that it is not directly supported but MySQL .NET connector adds support for EntityFramework. I don't know what are the pros and cons of it. I would love if I can implement repository pattern. Will it be possible if I use Entity Framework? I'm not clear on how I should go about all this or I should just forget every thing and directly use SQL to Linq on SQL Server. I'm also concerned about the performance. Someone told me that if we use Entity framework it fetches lot of data and then filter it. Is that right?

    Read the article

  • Custom sort logic in OrderBy using LINQ

    - by Bala R
    What would be the right way to sort a list of strings where I want items starting with an underscore '_', to be at the bottom of the list, otherwise everything is alphabetical. Right now I'm doing something like this, autoList.OrderBy(a => a.StartsWith("_") ? "ZZZZZZ"+a : a ) EDIT: I ended up using something like this; optimization suggestions welcome! private class AutoCompleteComparer : IComparer<String> { public int Compare(string x, string y) { if (x.StartsWith("_") && y.StartsWith("_") || (!x.StartsWith("_") && !y.StartsWith("_"))) { return x.CompareTo(y); } else if (x.StartsWith("_")) { return 1; } else if (y.StartsWith("_")) { return -1; } return 0; } }

    Read the article

  • Wrong logic in If Statement?

    - by Charles
    $repeat_times = mysql_real_escape_string($repeat_times); $result = mysql_query("SELECT `code`,`datetime` FROM `fc` ORDER by datetime desc LIMIT 25") or die(mysql_error()); $output .=""; $seconds = time() - strtotime($fetch_array["datetime"]); if($seconds < 60) $interval = "$seconds seconds"; else if($seconds < 3600) $interval = floor($seconds / 60) . " minutes"; else if($seconds < 86400) $interval = floor($seconds / 3600) . " hours"; else $interval = floor($seconds / 86400) . " days"; while ($fetch_array = mysql_fetch_array($result)) { $fetch_array["code"] = htmlentities($fetch_array["code"]); $output .= "<li><a href=\"http://www.***.com/code=" . htmlspecialchars(urlencode($fetch_array["code"])) . "\" target=\"_blank\">" . htmlspecialchars($fetch_array["code"]) . "</a> (" . $interval . ") ago.</li>"; } $output .=""; return $output; Why is this returning janice (14461 days) instead of janice (15 minutes ago) The datetime function table has the DATETIME type in my table so it's returning a full string for the date.

    Read the article

  • Breadcrumbs logic in MVC applications

    - by shazarre
    Hi, where, in your opinnion, should a breadcrumbs path be declared (in other words, in which letter of MVC)? So far I've been declaring it in Controllers, but I've recently started to work with CakePHP, where it is all made in Views and it surprised me. I'm just curious of your opinions.

    Read the article

< Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >