Search Results

Search found 2396 results on 96 pages for 'alex nauda'.

Page 78/96 | < Previous Page | 74 75 76 77 78 79 80 81 82 83 84 85  | Next Page >

  • How to exit a process run with Ruby if it takes more than 5 seconds?

    - by Alex
    I'm implementing a checking system in Ruby. It runs executables with different tests. If the solution is not correct, it can take forever for it to finish with certain hard tests. That's why I want to limit the execution time to 5 seconds. I'm using system() function to run executables: system("./solution"); .NET has a great WaitForExit() method, what about Ruby?. Is there a way to limit external process' execution time to 5 seconds? Thanks

    Read the article

  • Can someone explain Kohana 3's routing system?

    - by alex
    In bootstrap.php, where you set routes, I'm having a hard time getting them to work. I read some documentation a while ago that I can't seem to find again that explains them. Here is one of my examples Route::set('products', 'products/(type)', array('type' => '.+')) ->defaults(array( 'controller' => 'articles', 'action' => 'view_product', 'page' => 'shock-absorbers', )); I thought that would mean a request like products/something would load up the articles controller, and the action_view_product method. But I can't get it to work. Can someone please explain to me exactly how they work, and what all the method parameters are?

    Read the article

  • Why 10675199.02:48:05.4775807 TimeSpan Maximum for CompilationSection?

    - by Alex
    I was looking at the metadata for System.Web.Configuration.CompilationSection, and noticed the following attribute on the TimeSpan BatchTimeout property: [TimeSpanValidator(MinValueString = "00:00:00", MaxValueString = "10675199.02:48:05.4775807")] Could someone explain why this is the allowed max value? TimeSpan itself has an upper limit, so why would there be another value validation, and why this number?

    Read the article

  • C++: Chr() and unichr() equivalent?

    - by alex
    I could have sworn I used a chr() function 40 minutes ago but can't find the file. I know it can go up to 256 so I use this: std::string chars = ""; chars += (char) 42; //etc So that's alright, but I really want to access unicode characters. Can I do (w_char) 512? Or maybe something just like the unichr() function in python, I just can't find a way to access any of those characters.

    Read the article

  • Sending floating point values between processes with pipes in C

    - by Alex
    Is there a standard way of sending floating point values from a child process to a parent process in C. I have a some calculations where I want to fork a process, then have the child do some busy work, the parent do something else, and then the child send its values (which are doubles) back to the parent (presumably through a pipe). Clearly the parent could parse the stream, but I'm just wondering if there's a cleaner way?

    Read the article

  • C# - Wait to finish before doing the next task

    - by Alex Ogden
    i have a server application with a richtextbox as the console text basically. The problem is, i have start, restart and stop buttons - But my restart button doesn't work. Heres my code for the restart button: consoletxt("RESTART", "Restarting Server..."); statuslabel1.Text = "Restarting"; statuslabel1.ForeColor = Color.Orange; statuslabel2.Text = "Restarting"; statuslabel2.ForeColor = Color.Orange; command("stop"); //The performclick just starts the server startbtn.PerformClick(); statuslabel1.Text = "Online"; statuslabel1.ForeColor = Color.DarkGreen; statuslabel2.Text = "Online"; statuslabel2.ForeColor = Color.DarkGreen; consoletxt("RESTART", "Restart completed, server online!"); However, the output is this: 2012-04-01 11:32:12 [RESTART] Restarting Server... 2012-04-01 11:32:12 [RESTART] Restart completed, server online! 2012-04-01 11:32:12 [INFO] CONSOLE: Stopping the server.. 2012-04-01 11:32:12 [INFO] Stopping server So, it says that the restart has finished in the text - but it hasn't - all it has done is stop the server. Please can sombody explain to me how to do this properly? Thanks!

    Read the article

  • How to provide warnings during validation in ASP.NET MVC?

    - by Alex
    Sometimes user input is not strictly invalid but can be considered problematic. For example: A user enters a long sentence in a single-line Name field. He probably should have used the Description field instead. A user enters a Name that is very similar to that of an existing entity. Perhaps he's inputting the same entity but didn't realize it already exists, or some concurrent user has just entered it. Some of these can easily be checked client-side, some require server-side checks. What's the best way, perhaps something similar to DataAnnotations validation, to provide warnings to the user in such cases? The key here is that the user has to be able to override the warning and still submit the form (or re-submit the form, depending on the implementation). The most viable solution that comes to mind is to create some attribute, similar to a CustomValidationAttribute, that may make an AJAX call and would display some warning text but doesn't affect the ModelState. The intended usage is this: [WarningOnFieldLength(MaxLength = 150)] [WarningOnPossibleDuplicate()] public string Name { get; set; } In the view: @Html.EditorFor(model => model.Name) @Html.WarningMessageFor(model => model.Name) @Html.ValidationMessageFor(model => model.Name) So, any ideas?

    Read the article

  • Would this Jquery selector work?

    - by Alex
    Hi all, would the following Jquery selector get all of the 4th td elements of all the tables on the current page, and return their text as an array?: var isbn = $.makeArray($("table tr td:nth-child(4)").text());

    Read the article

  • Can one extract model fit parameters after a ggplot stat_smooth call?

    - by Alex Holcombe
    Using stat_smooth, I can fit models to data. E.g. g=ggplot(tips,aes(x=tip,y=as.numeric(unclass(factor(tips$sex))-1))) +facet_grid(time~.) g=g+ stat_summary(fun.y=mean,geom="point") g=g+ stat_smooth(method="glm", family="binomial") I would like to know the coefficients of the glm binomial fits. I could re-do the fit with dlply and get the coefficients with ldply, but I'd like to avoid such duplication. Calling str(g) reveals the hierarchy of objects that ggplot creates, perhaps there's some way to get to the coefficients through that?

    Read the article

  • Using SimpleDB (with SimpleSavant) with POCO / existing entities, not attributes on my classes

    - by alex
    I'm trying to use Simple Savant within my application, to use SimpleDB I currently have (for example) public class Person { public Guid Id { get; set; } public string Name { get; set; } public string Description { get; set; } public DateTime DateOfBirth { get; set; } } To use this with Simple Savant, i'd have to put attributes above the class declaration, and property - [DomainName("Person")] above the class, and [ItemName] above the Id property. I have all my entities in a seperate assembly. I also have my Data access classes an a seperate assembly, and a class factory selects, based on config, the IRepository (in this case, IRepository I want to be able to use my existing simple class - without having attributes on the properties etc.. In case I switch out of simple db, to something else - then I only need to create a different implementation of IRepository. Should I create a "DTO" type class to map the two together? Is there a better way?

    Read the article

  • Can somebody tell me why this Jquery tooltip is not showing up?

    - by alex
    <link rel="stylesheet" type="text/css" href="jquery-tooltip/jquery.tooltip.css"/> <script type="text/javascript" src="jquery-tooltip/jquery.tooltip.js"></script> <div id="baby" title="My tootip">The text</div> <script type="text/javascript"> $(function(){ $('#baby').tooltip({ track: true, delay: 0, showURL: false, showBody: " - ", extraClass: "pretty", fixPNG: true, opacity: 0.95, left: -120 }); }); </script> The files are found, and they are not 404.

    Read the article

  • How to customize preferences screen theme to look like that ?

    - by Alex
    Ok, I have a Preferences activity set with an XML layout. Here I have a couple of Preferences that open some dialogs. On these preferences I want to have an arrow on the right of them like in the screenshot. How I do this, is something related to the theme ? First screenshot is how I want to look, second is what I have now. http://img545.imageshack.us/i/screenshot1zlk.png/ http://img405.imageshack.us/i/tsc3.png/

    Read the article

  • Have a div cling to top of screen if scrolled down past it

    - by Alex
    I have a div which, when my page is first loaded, is about 100px from the top (it holds some buttons etc. for the page). When a user scrolls past it, I would like the div to "follow" the user in that it attaches to the top of the screen. When the user returns to the top of the page, I want it back in its original position. Visualization - xxxxx is the div: Default (page load) User vertically scrolled well past it --------- --------- | | |xxxxxxx| < after div reaches top of screen when |xxxxxxx| | | page is scrolled vertically, it stays | | | | there --------- ---------

    Read the article

  • How to Check Authenticity of an AJAX Request

    - by Alex Reisner
    I am designing a web site in which users solve puzzles as quickly as they can. JavaScript is used to time each puzzle, and the number of milliseconds is sent to the server via AJAX when the puzzle is completed. How can I ensure that the time received by the server was not forged by the user? I don't think a session-based authenticity token (the kind used for forms in Rails) is sufficient because I need to authenticate the source of a value, not just the legitimacy of the request. Is there a way to cryptographically sign the request? I can't think of anything that couldn't be duplicated by a hacker. Is any JavaScript, by its exposed, client-side nature, subject to tampering? Am I going to have to use something that gets compiled, like Flash? (Yikes.) Or is there some way to hide a secret key? Or something else I haven't thought of? Update: To clarify, I don't want to penalize people with slow network connections (and network speed should be considered inconsistent), so the timing needs to be 100% client-side (the timer starts only when we know the user can see the puzzle). Also, there is money involved so no amount of "trusting the user" is acceptable.

    Read the article

  • Ant Junit tests are running much slower via ant than via IDE - what to look at?

    - by Alex B
    I am running my junit tests via ant and they are running substantially slower than via the IDE. My ant call is: <junit fork="yes" forkmode="once" printsummary="off"> <classpath refid="test.classpath"/> <formatter type="brief" usefile="false"/> <batchtest todir="${test.results.dir}/xml"> <formatter type="xml"/> <fileset dir="src" includes="**/*Test.java" /> </batchtest> </junit> The same test that runs in near instantaneously in my IDE (0.067s) takes 4.632s when run through Ant. In the past, I've been able to speed up test problems like this by using the junit fork parameter but this doesn't seem to be helping in this case. What properties or parameters can I look at to speed up these tests? More info: I am using the reported time from the IDE vs. the time that the junit task outputs. This is not the sum total time reported at the end of the ant run. So, bizarrely, this problem has resolved itself. What could have caused this problem? The system runs on a local disk so that is not the problem.

    Read the article

  • stm monad problem

    - by Alex
    This is just a hypothetical scenario to illustrate my question. Suppose that there are two threads and one TVar shared between them. In one thread there is an atomically block that reads the TVar and takes 10s to complete. In another thread is an atomically block that modifies the TVar every second. Will the first atomically block ever complete? Surely it will just keep going back to the beginning, because the log is in an inconsistent state?

    Read the article

  • Is there any way I can use two monitors in the console in Linux?

    - by Alex
    I have recently become the proud owner of two monitors in my workspace. (Ok not owner, but you know what I mean) and I'd like to use both of them at once. Problem is, I much much prefer to use a Linux Server console over a desktop environment. The graphics card on the machine is a GTX295 (don't ask why, it's a long story.) so I essentially have two graphics cards. Each has a DVI output. Is there any way I can get the console to stretch across two screens? Or will I have to install a desktop Ubuntu for this to work?

    Read the article

  • How to use the Zend_Log instance that was created using the Zend_Application_Resource_Log in a model

    - by Alex
    Our Zend_Log is initialized by only adding the following lines to application.ini resources.log.stream.writerName = "Stream" resources.log.stream.writerParams.mode = "a" So Zend_Application_Resource_Log will create the instance for us. We are already able to access this instance in controllers via the following: public function getLog() { $bootstrap = $this->getInvokeArg('bootstrap'); //if (is_null($bootstrap)) return false; if (!$bootstrap->hasPluginResource('Log')) { return false; } $log = $bootstrap->getResource('Log'); return $log; } So far, so good. Now we want to use the same log instance in model classes, where we can not access the bootstrap. Our first idea was to register the very same Log instance in Zend_Registry to be able to use Zend_Registry::get('Zend_Log') everywhere we want: in our Bootstrap class: protected function _initLog() { if (!$this->hasPluginResource('Log')) { throw new Zend_Exception('Log not enabled'); } $log = $this->getResource('Log'); assert( $log != null); Zend_Registry::set('Zend_Log', $log); } Unfortunately this assertion fails == $log IS NULL --- but why?? It is clear that we could just initialize the Zend_Log manually during bootstrapping without using the automatism of Zend_Application_Resource_Log, so this kind of answers will not be accepted.

    Read the article

  • jQuery $.getJSON: "Failed to load resource: cancelled"

    - by Alex
    I'm having problem loading a json resource from a local rails app with jQuery 1.4.4 The json is valid (based on jsonlint.com) and I can download it properly if I'm requesting it from other sources. In webkit (Safari), I got this error: Failed to load resource: cancelled Response Header on Firebug: Content-Type application/json; charset=utf-8 Set-Cookie geoloc=toulouse; path=/; Connection close Server thin 1.2.7 codename No Hup jQuery code to load json: $.getJSON("http://127.0.0.1/search_agenda", {'edition': edition, 'categories': categories}, function(data){ console.log(data); } });

    Read the article

  • Is there a way to transfer windows license to a different machine?

    - by Alex Khvatov
    I purchased a license and used Windows 7 Home Premium 32 bit OS for a while. But recently I bought a 64 bit version to take advantage of the larger RAM the machine had and hence reinstalled the OS and activated a new license for the 64-bit version. Now, I am in a need to install the 32 bit version on another machine. How do I go about reactivating a license on another machine? (again the license currently is not used) Am I going to have issues with Microsoft not letting me reactivate that license on a different machine? Thank you.

    Read the article

< Previous Page | 74 75 76 77 78 79 80 81 82 83 84 85  | Next Page >