Search Results

Search found 18766 results on 751 pages for 'me again'.

Page 45/751 | < Previous Page | 41 42 43 44 45 46 47 48 49 50 51 52  | Next Page >

  • How to remove Modules from a Intellij Maven Project permanently?

    - by herpnderpn
    I am currently working on a larger scale Maven-based project in IntelliJIdea 12.1.6 Ultimate. I have been working with IntelliJIdea since about 5 months. An included module has dependencies on another module. The dependent module's source was also part of my project until recently. Since I removed the dependent module from my project, I get compile errors whenever I am trying to compile the source without maven. The pom.xml of removed modules in Intellij seem to be placed onto the Settings-Maven-Ignored Files. I cant seem to remove it from there, only check or uncheck it. It's not possible to include the module again since IntelliJ will say its still under Ignored Files. 2 ways allow me to compile again: Uncheck the pom from Ignored files, which will include the module again in my project. Or delete the source of the dependent project, so my project will load the dependent module from the maven repository. But whenever I update my project from svn, the source of the dependent module is restored (I don't know why this even happens since its not part my project) and the cycle begins anew. I googled this for a while since it gets really annoying. It became a problem with several excluded modules. I could rebuild the intellij-project but since a lot of IntelliJ settings were made (not related to the problem) I would rather solve this. Any help is appreciated, I guess I must be missing something

    Read the article

  • C++ interpreter conceptual problem

    - by Jan Wilkins
    I've built an interpreter in C++ for a language created by me. One main problem in the design was that I had two different types in the language: number and string. So I have to pass around a struct like: class myInterpreterValue { myInterpreterType type; int intValue; string strValue; } Objects of this class are passed around million times a second during e.g.: a countdown loop in my language. Profiling pointed out: 85% of the performance is eaten by the allocation function of the string template. This is pretty clear to me: My interpreter has bad design and doesn't use pointers enough. Yet, I don't have an option: I can't use pointers in most cases as I just have to make copies. How to do something against this? Is a class like this a better idea? vector<string> strTable; vector<int> intTable; class myInterpreterValue { myInterpreterType type; int locationInTable; } So the class only knows what type it represents and the position in the table This however again has disadvantages: I'd have to add temporary values to the string/int vector table and then remove them again, this would eat a lot of performance again. Help, how do interpreters of languages like Python or Ruby do that? They somehow need a struct that represents a value in the language like something that can either be int or string.

    Read the article

  • Persistence of texture parameters

    - by fen
    I use glBindTexture() to bind a previously created texture. After the glBindTexture() call I use glTexParameteri() to set MIN and MAG filter. No problem so far. Are those parameters I set using glTexParameteri() bound to the texture itself or are they lost if I bind another texture. Do i have to set them again? glGenTexture(1, &tex1); glGenTexture(1, &tex2); /* bind tex1 and set params */ glBindtexture(GL_TEXTURE_RECTANGLE_ARB, tex1); glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, ...); glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAG_FILTER, GL_LINEAR); /* do something */ /* bind tex2 and set params */ glBindtexture(GL_TEXTURE_RECTANGLE_ARB, tex2); glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, ...); glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAG_FILTER, GL_LINEAR); /* do something */ /* bind tex1 again */ glBindtexture(GL_TEXTURE_RECTANGLE_ARB, tex1); /* do i have to set the parameters from above again or are they stored with tex1? */

    Read the article

  • jQuery event "looping"

    - by Deryck
    Hi I´m trying to code a tooltip (Yes I know, I have my reasons to avoid plugins in this case) in jQuery. Whe I show the tooltip and leave the mouse in the same place the show and hide repeats forever. It´s like the element triggers the hover event again and again and again. I try unbind for the event but it does not work neither. $("td.with-tooltip").mouseover( function() { var offset = $(this).offset(); var baseX = offset.left; var baseY = offset.top; var inputWidth = $(this).width(); var baseX = baseX + 50; var baseY = baseY - $(".desc").height(); $(".desc div").html($(this).attr("title")); $(".desc").css({"position":"absolute", "left": baseX, "top": baseY }).fadeIn(); $(this).unbind("mouseover"); }).mouseleave( function() { $(".desc").fadeOut(); }); What can I do? thanks.

    Read the article

  • One big executable or many small DLL's?

    - by Patrick
    Over the years my application has grown from 1MB to 25MB and I expect it to grow further to 40, 50 MB. I don't use DLL's, but put everything in this one big executable. Having one big executable has certain advantages: Installing my application at the customer is really: copy and run. Upgrades can be easily zipped and sent to the customer There is no risk of having conflicting DLL's (where the customer has version X of the EXE, but version Y of the DLL) The big disadvantage of the big EXE is that linking times seem to grow exponentially. Additional problem is that a part of the code (let's say about 40%) is shared with another application. Again, the advantages are that: There is no risk on having a mix of incorrect DLL versions Every developer can make changes on the common code which speeds up developments. But again, this has a serious impact on compilation times (everyone compiles the common code again on his PC) and on linking times. The question http://stackoverflow.com/questions/2387908/grouping-dlls-for-use-in-executable mentions the possibility of mixing DLL's in one executable, but it looks like this still requires you to link all functions manually in your application (using LoadLibrary, GetProcAddress, ...). What is your opinion on executable sizes, the use of DLL's and the best 'balance' between easy deployment and easy/fast development?

    Read the article

  • reactivating or binding a hover function in jquery??

    - by mathiregister
    hi guys, with the following three lines: $( ".thumb" ).bind( "mousedown", function() { $('.thumb').not(this).unbind('mouseenter mouseleave'); }); i'm unbinding this hover-function: $(".thumb").hover( function () { $(this).not('.text, .file, .video, .audio').stop().animate({"height": full}, "fast"); $(this).css('z-index', z); z++; }, function () { $(this).stop().animate({"height": small}, "fast"); } ); i wonder how i can re-bind the exact same hover function again on mouseup? the follwoing three lines arent't working! $( ".thumb" ).bind( "mouseup", function() { $('.thumb').bind('mouseenter mouseleave'); }); to get what i wanna do here's a small explanation. I want to kind of deactivate the hover function for ALL .thumbs-elements when i click on one. So all (but not this) should not have the hover function assigned while i'm clicking on an object. If i release the mouse again, the hover function should work again like before. Is that even possible to do? thank you for your help!

    Read the article

  • wxPython: How to handle event binding and Show() properly.

    - by Gopal
    Hi all, I'm just starting out with wxPython and this is what I would like to do: a) Show a Frame (with Panel inside it) and a button on that panel. b) When I press the button, a dialog box pops up (where I can select from a choice). c) When I press ok on dialog box, the dialog box should disappear (destroyed), but the original Frame+Panel+button are still there. d) If I press that button again, the dialog box will reappear. My code is given below. Unfortunately, I get the reverse effect. That is, a) The Selection-Dialog box shows up first (i.e., without clicking on any button since the TopLevelframe+button is never shown). b) When I click ok on dialog box, then the frame with button appears. c) Clicking on button again has no effect (i.e., dialog box does not show up again). What am I doing wrong ? It seems that as soon as the frame is initialized (even before the .Show() is called), the dialog box is initialized and shown automatically. I am doing this using Eclipse+Pydev on WindowsXP with Python 2.6 ============File:MainFile.py=============== import wx import MyDialog #This is implemented in another file: MyDialog.py class TopLevelFrame(wx.Frame): def __init__(self,parent,id): wx.Frame.__init__(self,parent,id,"Test",size=(300,200)) panel=wx.Panel(self) button=wx.Button(panel, label='Show Dialog', pos=(130,20), size=(60,20)) # Bind EVENTS --> HANDLERS. button.Bind(wx.EVT_BUTTON, MyDialog.start(self)) # Run the main loop to start program. if __name__=='__main__': app=wx.PySimpleApp() TopLevelFrame(parent=None, id=-1).Show() app.MainLoop() ============File:MyDialog.py=============== import wx def start(parent): inputbox = wx.SingleChoiceDialog(None,'Choose Fruit', 'Selection Title', ['apple','banana','orange','papaya']) if inputbox.ShowModal()==wx.ID_OK: answer = inputbox.GetStringSelection() inputbox.Destroy()

    Read the article

  • Boost Asio UDP retrieve last packet in socket buffer

    - by Alberto Toglia
    I have been messing around Boost Asio for some days now but I got stuck with this weird behavior. Please let me explain. Computer A is sending continuos udp packets every 500 ms to computer B, computer B desires to read A's packets with it own velocity but only wants A's last packet, obviously the most updated one. It has come to my attention that when I do a: mSocket.receive_from(boost::asio::buffer(mBuffer), mEndPoint); I can get OLD packets that were not processed (almost everytime). Does this make any sense? A friend of mine told me that sockets maintain a buffer of packets and therefore If I read with a lower frequency than the sender this could happen. ¡? So, the first question is how is it possible to receive the last packet and discard the ones I missed? Later I tried using the async example of the Boost documentation but found it did not do what I wanted. http://www.boost.org/doc/libs/1_36_0/doc/html/boost_asio/tutorial/tutdaytime6.html From what I could tell the async_receive_from should call the method "handle_receive" when a packet arrives, and that works for the first packet after the service was "run". If I wanted to keep listening the port I should call the async_receive_from again in the handle code. right? BUT what I found is that I start an infinite loop, it doesn't wait till the next packet, it just enters "handle_receive" again and again. I'm not doing a server application, a lot of things are going on (its a game), so my second question is, do I have to use threads to use the async receive method properly, is there some example with threads and async receive? Thanks for you attention.

    Read the article

  • How to avoid user keep trying login using Ruby on Rails?

    - by Tattat
    I want to create a login page, it can easy implement using Ruby on Rails. But the login is very simple, but I want more security. I want to stop the user keep trying the password. So, I have some ideas on that. First, stop login feature if the user keep trying the password for 15 mins. After the user login fail 5 times in 15 mins, the system should not allow the user login again in next 15 mins, ever his/her password is correct. Second, I want to add a human verification, after the user tried 5 times. After the user wait for 15 mins to login, I want to add an addition verification to the user. I want the user click the password, and the CAPTCHA image. If one of them is failed, they still can't login the system. He/She have 5 times to try, if he / she failed again, he/she need to want another 15 mins. Third, After the user tried 15 times, and still can't get into the system. I want to lock the user account, the user will receive an email, with a link to assign the password again. So, the question is "Is there any library to implement such authorization easily?" I know it can be implemented using code, but using library is much convenient. Also, I want to ask is there any security suggestion for that? thank u.

    Read the article

  • iOS - Passing variable to view controller

    - by gj15987
    I have a view with a view controller and when I show this view on screen, I want to be able to pass variables to it from the calling class, so that I can set the values of labels etc. First, I just tried creating a property for one of the labels, and calling that from the calling class. For example: SetTeamsViewController *vc = [[SetTeamsViewController alloc] init]; vc.myLabel.text = self.teamCount; [self presentModalViewController:vc animated:YES]; [vc release]; However, this didn't work. So I tried creating a convenience initializer. SetTeamsViewController *vc = [[SetTeamsViewController alloc] initWithTeamCount:self.teamCount]; And then in the SetTeamsViewController I had - (id)initWithTeamCount:(int)teamCount { self = [super initWithNibName:nil bundle:nil]; if (self) { // Custom initialization self.teamCountLabel.text = [NSString stringWithFormat:@"%d",teamCount]; } return self; } However, this didn't work either. It's just loading whatever value I've given the label in the nib file. I've littered the code with NSLog()s and it is passing the correct variable values around, it's just not setting the label. Any help would be greatly appreciated. EDIT: I've just tried setting an instance variable in my designated initializer, and then setting the label in viewDidLoad and that works! Is this the best way to do this? Also, when dismissing this modal view controller, I update the text of a button in the view of the calling ViewController too. However, if I press this button again (to show the modal view again) whilst the other view is animating on screen, the button temporarily has it's original value again (from the nib). Does anyone know why this is?

    Read the article

  • Using Loops for prompts with If/Else/Esif

    - by Dante
    I started with: puts "Hello there, and what's your favorite number?" favnum = gets.to_i puts "Your favorite number is #{favnum}?" " A better favorite number is #{favnum + 1}!" puts "Now, what's your favorite number greater than 10?" favnumOverTen = gets.to_i if favnumOverTen < 10 puts "Hey! I said GREATER than 10! Try again buddy." else puts "Your favorite number great than 10 is #{favnumOverTen}?" puts "A bigger and better number over 10 is #{favnumOverTen * 10}!" puts "It's literally 10 times better!" end That worked fine, but if the user entered a number less than 10 the program ended. I want the user to be prompted to try again until they enter a number greater than 10. Am I supposed to do that with a loop? Here's what I took a swing at, but clearly it's wrong: puts "Hello there, and what's your favorite number?" favnum = gets.to_i puts "Your favorite number is #{favnum}?" " A better favorite number is #{favnum + 1}!" puts "Now, what's your favorite number greater than 10?" favnumOverTen = gets.to_i if favnumOverTen < 10 loop.do puts "Hey! I said GREATER than 10! Try again buddy." favnumOverTen = gets.to_i until favnumOverTen > 10 else puts "Your favorite number great than 10 is #{favnumOverTen}?" puts "A bigger and better number over 10 is #{favnumOverTen * 10}!" puts "It's literally 10 times better!" end

    Read the article

  • Large ListView containing images in Android

    - by Marco W.
    For various Android applications, I need large ListViews, i.e. such views with 100-300 entries. All entries must be loaded in bulk when the application is started, as some sorting and processing is necessary and the application cannot know which items to display first, otherwise. So far, I've been loading the images for all items in bulk as well, which are then saved in an ArrayList<CustomType> together with the rest of the data for each entry. But of course, this is not a good practice, as you're very likely to have an OutOfMemoryException then: The references to all images in the ArrayList prevent the garbage collector from working. So the best solution is, obviously, to load only the text data in bulk whereas the images are then loaded as needed, right? The Google Play application does this, for example: You can see that images are loaded as you scroll to them, i.e. they are probably loaded in the adapter's getView() method. But with Google Play, this is a different problem, anyway, as the images must be loaded from the Internet, which is not the case for me. My problem is not that loading the images takes too long, but storing them requires too much memory. So what should I do with the images? Load in getView(), when they are really needed? Would make scrolling sluggish. So calling an AsyncTask then? Or just a normal Thread? Parametrize it? I could save the images that are already loaded into a HashMap<String,Bitmap>, so that they don't need to be loaded again in getView(). But if this is done, you have the memory problem again: The HashMap stores references to all images, so in the end, you could have the OutOfMemoryException again. I know that there are already lots of questions here that discuss "Lazy loading" of images. But they mainly cover the problem of slow loading, not too much memory consumption.

    Read the article

  • Website. VoteUp or VoteDown Videos. How to restrict users voting multiple times?

    - by DJDonaL3000
    Im working on a website (html,css,javascript, ajax, php,mysql), and I want to restrict the number of times a particular user votes for a particular video. Its similar to the YouTube system where you can voteUp or voteDown a particular video. Each vote involves adding a row to the video.votes table, which logs the time, vote direction(up or down), the client IPaddress( using PHP: $ip = $_SERVER['REMOTE_ADDR']; ), and of course the ID of the video in question. Adding votes is as simple as; (pseudocode): Javascript:onClick( vote( a,b,c,d ) ), which passes variables to PHP insertion script via ajax, and finally we replace the voteing buttons with a "Thank You For Voting" message. THE PROBLEM: If you reload/refresh the page after voting, you can vote again, and again, and again, you get the point. MY QUESTION: How do you limit the amount of times a particular user votes for a particular video?? MY THOUGHTS: Do you use cookies, and add a new cookie with the id of the video. And check for a cookie before you insert a new vote.? OR Before you insert the vote, do you use the IPaddress and the videoID to see if this same user(IP) has voted for this same video(vidID) in the past 24hrs(mktime), and either allow or dissallow the voteInsertion based on this query? OR Do you just not care? Take the assumption that most users are sane, and have better things to do than refresh pages and vote repeatedly.?? Any suggestions or ideas welcome.

    Read the article

  • How can I debug PEAR auth?

    - by croceldon
    I have a directory on my site that I've implemented PEAR's Auth to run my authentication. It is working great. However, I've tried to make a copy of my site (it's going to be translated to a different language), and on this new site, the Auth process doesn't seem to be working correctly. I can login properly, but every time I try to go to a different page in the same directory, and use Auth to authorize, it forces me to login again. Here's my logic: $auth_options = array( 'dsn' => mysql://user:password@server/db', 'table' => 'users', 'usernamecol' => 'username', 'passwordcol' => 'password', 'db_fields' => '*' ); $auth = new Auth("DB", $auth_options, "login_function"); $auth->setFailedLoginCallback('bad_login'); $auth->start(); if (!$auth->checkAuth()) { die('cannot succeed in checkAuth') exit; } else { include("nocache.php"); } This is part of a file that's included in every php page I that I desire to require authentication. I can login properly once, but whenever I then try to go to a different page that requires authentication, it makes me login again (and I see the 'cannot succeed' die message at the bottom of the page). Again, this solution works fine on my original site, I copied all the files, and only changed the db server/password - it still doesn't work. And I'm using the same webhost for both. What am I doing wrong here? Or how can I debug this further?

    Read the article

  • rehabilitating a button

    - by Michele Petraroli
    if($('.click').one('click')){ $('.click').click(function(){ $('.mainContent').animate( {"height":"+=620px"}, 800, 'easeInBack'); $('.eneButton').animate( { "top":"+=310px"}, 1500, 'easeInOutExpo'); $('.eneButton').animate( {"left":"-=310px"}, 1500, 'easeInOutExpo') $('.giardButton').animate( {"top":"+=620px"}, 2000, 'easeInOutExpo') $('.giardButton').animate( {"left":"-=620px"}, 2000, 'easeInOutExpo'); $('.click').off('click'); }) } if ($('.close').one('click')){ $('.close').click(function(){ $('.content, .sec').fadeOut(250); $('.eneButton').animate( {"left":"+=310px"}, 1500, 'easeInOutExpo') $('.eneButton').animate( { "top":"-=310px"}, 1500, 'easeInOutExpo'); $('.giardButton').animate( {"left":"+=620px"}, 2000, 'easeInOutExpo'); $('.giardButton').animate( {"top":"-=620px"}, 2000, 'easeInOutExpo'); $('.mainContent').animate( {"height":"-=620px"}, 3500, 'easeInBack'); $('.click').on('click'); }) } the animation is working fine in both ways but I need that users may restart the animation again when its closed. as you can see from the code you do one click and an animation starts, then you select a list of categories which you can close with a click on a "X" like in windows, when you do that the animation start again till all look like as the begin. Now if I click again on it the animation doesnt start no more. any clue?

    Read the article

  • JQuery: Live <a> tag partially working second time around.

    - by BPotocki
    I have the following jquery code: $("a[id*='Add_']").live('click', function() { //Get parentID to add to. var parentID = $(this).attr('id').substring(4); //Get div. var div = $("#CreateList"); //Ajax call to refresh "CreateList" div with new XML. div.load("/AddUnit?ParentID=" + parentID); }); Basically, contained within the div is a nested unordered list with several "Add_#" links. Clicking the links uses an ajax call to recreate the list with a new node. It clears all the add links, but they are added again by the ajax call. This is why I used the .live method so newly added "Add_#" links still have the binding. This works in most cases. If I click "Add_1", the div refreshes with the new info. If I then click "Add_2", it works again as expected. The problem I'm having happens when I click "Add_1", then the page refreshes (and creates a new "Add_1" link), then I click the re-rendered "Add_1" again. It's the same link, but it was refreshed during the ajax call. When I do that, the javascript function still gets called, but the .load method doesn't work. Any ideas why this might be happening? Thanks.

    Read the article

  • Terminate function on System.in .. possible?

    - by Ronald
    I am currently working on a project where I have to make an agent to interact with a server. Each 50ms, the server will receive the last thing I outputted to System.out and send me a new set of lines as a 'state' through the System.in printstream to analyze and send my next message to System.out. Also, if the server receives multiple outputs from me, it only regards the most recent one. .. As for my question: My program originally constructed a tree and then analyzed each leaf node to see which would be optimal, and then waited around for the next input, but I can recursively do a deeper tree search that would make my output 'better' (and again and again to keep returning a better result). Using this and the fact that if the server receives multiple outputs, it only takes the most recent one, I could do each level, print my result and start the next level. But here comes my problem... I can't be stuck in some complex algorithm while I am supposed to receiving the next input as I will then miss it. So I was wondering if there is a way to cancel anything else I am doing when I receive something via System.in and then go back to the beginning of the function and start the search again with the new set of input (and rinse and repeat..) I hope this all makes sense, Thank ye all

    Read the article

  • Hide elements for current visit only

    - by deanloh
    I need to display a banner that sticks to the bottom of the browser. So I used these codes: $(document).ready(function(){ $('#footie').css('display','block'); $('#footie').hide().slideDown('slow'); $('#footie_close').click(function(){ $('#footie_close').hide(); $('#footie').slideUp('slow'); }); }); And here's the HTML: <div id="footie"> {banner here} <a id="footie_close">Close</a> </div> I added the close link there to let user have the option to close the banner. How ever, when user navigates to next page, the banner shows up again. What can I do to set the banner to remained hidden just for this visit? In other words, as long as the browser remained open, the banner will not show up again. But if user returns to the same website another time, the banner should load again. Thanks in advance for any help!

    Read the article

  • md5_file() not working with IP addresses?

    - by Rob
    Here is my code relating to the question: $theurl = trim($_POST['url']); $md5file = md5_file($theurl); if ($md5file != '96a0cec80eb773687ca28840ecc67ca1') { echo 'Hash doesn\'t match. Incorrect file. Reupload it and try again'; When I run this script, it doesn't even output an error. It just stops. It loads for a bit, and then it just stops. Further down the script I implement it again, and it fails here, too: while($row=mysql_fetch_array($execquery, MYSQL_ASSOC)){ $hash = @md5_file($row['url']); $url = $row['url']; mysql_query("UPDATE urls SET hash='" . $hash . "' WHERE url='" . $url . "'") or die("MYSQL is indeed gay: ".mysql_error()); if ($hash != '96a0cec80eb773687ca28840ecc67ca1'){ $status = 'down'; }else{ $status = 'up'; } mysql_query("UPDATE urls SET status='" . $status . "' WHERE url='" . $url . "'") or die("MYSQL is indeed gay: ".mysql_error()); } And it checks all the URL's just fine, until it gets to one with an IP instead of a domain, such as: http://188.72.215.195/config.php In which, again, the script then just loads for a bit, and then stops. Any help would be much appreciated, if you need any more information just ask.

    Read the article

  • .NET Best Way to move many files to and from various directories??

    - by Dan
    I've created a program that moves files to and from various directories. An issue I've come across is when you're trying to move a file and some other program is still using it. And you get an error. Leaving it there isn't an option, so I can only think of having to keep trying to move it over and over again. This though slows the entire program down, so I create a new thread and let it deal with the problem file and move on to the next. The bigger problem is when you have too many of these problem files and the program now has so many threads trying to move these files, that it just crashes with some kernel.dll error. Here's a sample of the code I use to move the files: Public Sub MoveIt() Try File.Move(_FileName, _CopyToFileName) Catch ex As Exception Threading.Thread.Sleep(5000) MoveIt() End Try End Sub As you can see.. I try to move the file, and if it errors, I wait and move it again.. over and over again.. I've tried using FileInfo as well, but that crashes WAY sooner than just using the File object. So has anyone found a fool proof way of moving files without it ever erroring? Note: it takes a lot of files to make it crash. It'll be fine on the weekend, but by the end of the day on monday, it's done.

    Read the article

  • Handling text menu in Python

    - by PulpFiction
    Hi all. I am trying to create a text based menu in Python. Here is the code: #!/usr/bin/env python def testcaseOutput(): print '1. Add. 2. Subtract. 3. Divide. 4. Multiply' try: answer = int(raw_input('Enter a value (1 - 4) >. ')) except ValueError: print 'Invalid input. Enter a value between 1 -4 .' testcaseOutput() if answer in range(1, 5): return answer else: print 'Invalid input. Enter a value between 1 - 4.' testcaseOutput() My question: When the user enters an invalid input, i.e. not a number, I want this function to get called again. So I used the recursive approach which I think is bad design. I use that approach again in the if answer in range(1, 5). Is there any other way to handle this? I need the prompt called again when there is an invalid input. Also, is there any way I can club the two constraints: check whether input is a number and check whether the number is in the range(1,5) together? As you can see, I am checking that individually.

    Read the article

  • Rails - Beginner wants feedback on how they've modeled their app and how to do it better.

    - by adam
    I think the way I've modelled my app is a bit fishy and i need to rejig things, im just not sure how. I've already re-jigged and refactored before. It took a long time ( I'm a beginner ) and I'm hesitant to it again in case i head off in the wrong direction again. Basic Idea, user can submit an answer, another user can mark it correct or incorrect. If incorrect they have to write the correct answer. Users can view their and everybody else's correct and incorrect answers. So I did it this way class Answer has_one: correction end class Correction belongs_to :answer end when a user marks an answer as correct, I set checked_at:DateTime and checked_by_id:integer on the Answer object to keep track of who checked the answer and when. For incorrect answers I create a correction object which holds the correct answer and again checked_by and checked_at details. I don't like this because I have checked_by and checked_at in both models. It just doesn't sit right. Possible solutions are: Create a third model such as VerifiedAnswer and move the checked_by/at attributes to that. It will handle the situtation where an answer is marked correct. Or are these models thin enough (they dont have any other attributes) that I can just have one model ( Answer ) that has all the attributes to store all this information?

    Read the article

  • Saving information in the IO System

    - by djTeller
    Hi Kernel Gurus, I need to write a kernel module that simulate a "multicaster" Using the /proc file system. Basically it need to support the following scenarios: 1) allow one write access to the /proc file and many read accesses to the /proc file. 2) The module should have a buffer of the contents last successful write. Each write should be matched by a read from all reader. Consider scenario 2, a writer wrote something and there are two readers (A and B), A read the content of the buffer, and then A tried to read again, in this case it should go into a wait_queue and wait for the next message, it should not get the same buffer again. I need to keep a map of all the pid's that already read the current buffer, and in case they try to read again and the buffer was not changed, they should be blocked until there is a new buffer. I'm trying to figure it there is a way i can save that info without a map. I heard there are some redundant fields inside the I/O system the I can use to flag a process if it already read the current buffer. Can someone give me a tip where should i look for that field ? how can i save info on the current process without keeping a "map" of pid's and buffers ? Thanks!

    Read the article

  • How can I remove all users in an Active Directory group?

    - by Beavis
    I'm trying to remove all users from an AD group with the following code: private void RemoveStudents() { foreach (DirectoryEntry childDir in rootRefreshDir.Children) { DirectoryEntry groupDE = new DirectoryEntry(childDir.Path); for (int counter = 0; counter < groupDE.Properties["member"].Count; counter++) { groupDE.Properties["member"].Remove(groupDE.Properties["member"][counter]); groupDE.CommitChanges(); groupDE.Close(); } } } The rootRefreshDir is the directory that contains all the AD groups (childDir). What I'm finding here is that this code does not behave correctly. It removes users, but it doesn't do it after the first run. It does "some". Then I run it again, and again, and again - depending on how many users need to be deleted in a group. I'm not sure why it's functioning this way. Can someone help fix this code or provide an alternative method to delete all users in a group? Thanks!

    Read the article

  • '<=' operator is not working in sql server 2000

    - by Lalit
    Hello, Scenario is, database is in the maintenance phase. this database is not developed by ours developer. it is an existing database developed by the 'xyz' company in sql server 2000. This is real time database, where i am working now. I wanted to write the stored procedure which will retrieve me the records From date1 to date 2.so query is : Select * from MyTableName Where colDate>= '3-May-2010' and colDate<= '5-Oct-2010' and colName='xyzName' whereas my understanding I must get data including upper bound date as well as lower bound date. but somehow I am getting records from '3-May-2010' (which is fine but) to '10-Oct-2010' As i observe in table design , for ColDate, developer had used 'varchar' to store the date. i know this is wrong remedy by them. so in my stored procedure I have also used varchar parameters as @FromDate1 and @ToDate to get inputs for SP. this is giving me result which i have explained. i tried to take the parameter type as 'Datetime' but it is showing error while saving/altering the stored procedure that "@FromDate1 has invalid datatype", same for "@ToDate". situation is that, I can not change the table design at all. what i have to do here ? i know we can use user defined table in sql server 2008 , but there is version sql server 2000. which does not support the same. Please guide me for this scenario. **Edited** I am trying to write like this SP: CREATE PROCEDURE USP_Data (@Location varchar(100), @FromDate DATETIME, @ToDate DATETIME) AS SELECT * FROM dbo.TableName Where CAST(Dt AS DATETIME) >=@fromDate and CAST(Dt AS DATETIME)<=@ToDate and Location=@Location GO but getting Error: Arithmetic overflow error converting expression to data type datetime. in sql server 2000 What should be that ? is i am wrong some where ? also (202 row(s) affected) is changes every time in circular manner means first time sayin (122 row(s) affected) run again saying (80 row(s) affected) if again (202 row(s) affected) if again (122 row(s) affected) I can not understand what is going on ?

    Read the article

< Previous Page | 41 42 43 44 45 46 47 48 49 50 51 52  | Next Page >