Search Results

Search found 59278 results on 2372 pages for 'time estimation'.

Page 97/2372 | < Previous Page | 93 94 95 96 97 98 99 100 101 102 103 104  | Next Page >

  • Compile time string hashing

    - by Caspin
    I have read in few different places that using c++0x's new string literals it might be possible to compute a string's hash at compile time. However, no one seems to be ready to come out and say that it will be possible or how it would be done. Is this possible? What would the operator look like? I'm particularly interested use cases like this. void foo( const std::string& value ) { switch( std::hash(value) ) { case "one"_hash: one(); break; case "two"_hash: two(); break; /*many more cases*/ default: other(); break; } } Note: the compile time hash function doesn't have to look exactly as I've written it. I did my best to guess what the final solution would look like, but meta_hash<"string"_meta>::value could also be a viable solution.

    Read the article

  • Detecting first time login of user into application (Google Appengine)

    - by Jake
    My app requires users to login using their google account. I have this set in my App.yamp file: url: /user/.* script: user.py login: required Now when any user tries to access files under /user/secret.py he will need to authenticate via google, which will redirect the user back to /user/secret.py after successful authentication. Now the problem I am facing is when the user is redirected back to the app, I cannot be sure if this is the first time the user has logged in or is it a regular user to my site who has come back again from just the user object which google passes using users.get_current_user() . I thus need to maintain state in the datastore to check if the user already exists or not everytime. If he does not exist i need to create a new entry with other application specific settings. My question is: Is there some easier way to handle this? without having to query the datastore to figure if this is a first time user or a regular one?

    Read the article

  • time required in java

    - by Amol
    i would like to know how much time is required to execute the conditional loops individually. Like if i had an option to use "if else", "while","for", or "foreach" loop then which loop would get executed faster.I know the difference would be very small and most would say that it would not matter but if i were to have a program which would access thousands of data then this point would come into picture. I would like to know if i declare a variable in the beginning in java and if i were to declare it just before i use it will it make any difference. will the total time required be reduced? if yes then which is practically used (the one in which variables are declared in the beginning or where they are just declared b4 they are used)?

    Read the article

  • UdpClient receiving and sending at the same time

    - by SoMoS
    Hello, I am maintaining other's code and its using the class UdpClient. The code declares one instance of UdpClient and receives data continuosly using the UdpClient.Receive(). When data is received it is processed in another thread and the UdpClient calls Receive() again. At the same time when the data is processed the same client is sending a response back. Question: Is this a bug? I think so because UdpClient is not thread safe so you can not call two methods at the same time. Anyways code is working fine but ...

    Read the article

  • Wifi and 3G same time

    - by Skolleus
    For my App I need Data from both, a local Network and the Internet. The local Network (Wifi) has no connection to the internet so I have to use the mobile connection (3G for Example). But whenever I connect to the local Network, 3G stopps. After asking the Samsung Service, there is no way to change that in the UI. But they couldn't tell me, if there is a programmable Interface for that. There is a mobile access point inside, so there is a way to connect a Wifi device to the Internet (which means that both, a wifi and a 3G connection is possible the same time in that way). But for my App the phone/tab has to connect to the existing Network and use the 3G for Internet. So this is my question here. Is there a way to connect to an existing Network and using 3G for Internet the same time?

    Read the article

  • Getting clusters of rows close together in time

    - by Mike
    I have a table basically like so ID | ItemID | Start | End | --------------------------------------------------------------- 1 234 10/20/09 8:34:22 10/20/09 8:35:10 2 274 10/20/09 8:35:30 10/20/09 8:36:27 3 272 10/21/09 12:15:00 10/21/09 12:17:00 4 112 10/21/09 12:20:14 10/21/09 12:21:21 5 15 10/21/09 12:22:39 10/21/09 12:24:15 There are two "clusters" of entries here, 1-2 and 3-5 separated by a gap in time, specifically 30 minutes is what I'm interested in. What I would like is the first and last rows of the cluster of entries. This is fairly easy to achieve by retrieving all the rows and looping through them in order of start time, but I'd like to have it in SQL if possible. I'm using SQL Server 2008, thanks.

    Read the article

  • Classes missing if application runs for a long time

    - by Rogach
    I have a funny problem - if my application runs for a long time ( 20h), then sometimes I get NoClassDefFound error - seems like JVM decided that the class is not going to be used anyway and GCd it. To be a bit more specific, here's an example case: object ErrorHandler extends PartialFunction[Throwable,Unit] { def isDefinedAt(t: Throwable) = true def apply(e: Throwable) =e match { // ... handle errors } } // somewhere else in the code... try { // ... long running code, can take more than 20 hours to complete } catch (ErrorHandler) And I get the following exception: Exception in thread "main" java.lang.NoClassDefFoundError: org/rogach/avalanche/ErrorHandler$ If that try/catch block runs for smaller amounts of time, everything works as expected. If anyone is interested, here is the codebase in question: Avalanche I need to note that I saw this and similar problems only on Cent OS 5 machines, using JRE 6u26 and Scala 2.9.1 / 2.9.2. What could be the cause of this problem?

    Read the article

  • ASP.Net Web Site Project - Errors Not Caught at Compile time

    - by 5arx
    For the first time in my career, I'm working on an ASP.Net (v3.5) project that has been set up as a Visual Studio 2008/10 Web Site Project. I'm not keen on this way of working this way for various reasons but for the moment and until such time as the company sees the virtue in working in an environment with namespaces, designer and project files etc., I have to continue with the existing codebase. I've run into some odd issues since I began this but perhaps the oddest one of all is that althought VS lets me build the code, it doesn't reliably pick up compilation errors so these are not noticed until runtime. I know the website model allows dynamic/hot compilation when a request is made for a specific but I can't see why it wouldn't do this when I manually (F5) build/rebuild the project. Its immensely annoying as you can imagine and I can't find a workaround. Could any StackOverflow person help with suome suggestions to make things better?

    Read the article

  • Why javascript IF only works one time?

    - by Emily
    I have javascript code which copy the value of input file and past it in the text box in real time. <script> function copyit(){ var thephoto=document.getElementById('thephoto').value; var fileonchange=document.getElementById('fileonchange').value; if(!thephoto==fileonchange){ document.getElementById('fileonchange').value=thephoto; } } window.setInterval("copyit()", 500); </script> Choose File : <input type="file" id="thephoto"><br> Here Is the file name : <input type="text" id="fileonchange"> Sadly this only works one time and then stops pasting the value when changing the file again. ( i mean you should reload the page to works again) Is IF has a cache or something? you can try the code by yourself to see. Thank you all

    Read the article

  • Finding the time to program in your spare time?

    - by Omar Kooheji
    I've got about a dozen programming projects bouncing about my head, and I'd love to contribute to some open source projects, the problem I have is that having spent the entire day staring at Visual Studio and or Eclipse (Sometimes both at the same time...) the last thing I feel like doing when I go home is program. How do you build up the motivation/time to work on your own projects after work? I'm not saying that I don't enjoy programming, it's just that I enjoy other things to and it can be hard to even do something you enjoy if you've spent all day already doing it. I think that if I worked at a chocolate factory the last thing I'd want to see when I got home was a Wonka bar.... Related: How do you keep a balance between working, training, health and family?

    Read the article

  • Measuring execution time of a system call in C++

    - by jm1234567890
    I have found some code on measuring execution time here http://www.dreamincode.net/forums/index.php?showtopic=24685 However, it does not seem to work for system calls. I imagine this is because the execution jumps out of the current process. clock_t begin=clock(); system(something); clock_t end=clock(); cout<<"Execution time: "<<diffclock(end,begin)<<" s."<<endl; Then double diffclock(clock_t clock1,clock_t clock2) { double diffticks=clock1-clock2; double diffms=(diffticks)/(CLOCKS_PER_SEC); return diffms; } However this always returns 0 seconds... Is there another method that will work? Also, this is in Linux. Thanks!

    Read the article

  • Daylight saving time of current tz

    - by spam2
    Hi, in my c++ software I've used Boost in some parts and also for the local time. OK, now my problem is to make a check if in my machine is active or not the DST. With the follow part of code I can know only the difference from the UTC time. In my case the difference is 2 hours because is active the DST ptime tLoc = second_clock::local_time(); ptime tUTC = second_clock::universal_time(); time_duration tDiff = tUTC - tLoc; local_time_zone = tDiff.hours(); I think that the boolean funcion has_dst() can help, right? My system is Debian GNU/Linux. Thanks

    Read the article

  • Setting amount of time to pass when sending emails in a loop

    - by Obay
    Forgive me for this noob question, but is there such a setting that sets a certain amount of time (e.g. milli/seconds) that has to pass in between sending emails through a script? How is that setting called and where do I change that setting? I'll give an example: I used to have a PHP script that sends emails like so: for ($i=0; $i<count($emails); $i++) { mail($email[$i],'test','test'); } It turned out that not all emails were sent successfully because the script ran so fast that there was not enough time in between sending emails that was required by the server. Did I make sense?

    Read the article

  • Simple time profiling - strange times

    - by Gacek
    I'm trying to profile my code to check how long it takes to execute some parts of my code. I've wrapped my most time-consuming part of the code in something like that: DateTime start = DateTime.Now; ... ... // Here comes the time-consuming part ... Console.WriteLine((DateTime.Now - start).Miliseconds); The program is executing this part of code for couple of seconds (about 20 s) but in console I get the result of something about 800 miliseconds. Why is that so? What am I doing wrong?

    Read the article

  • Does Android support near real time push notification

    - by j pimmel
    I recently learned about the ability of iPhone apps to receive nearly instantaneous notifications to apps. This is provided in the form of push notifications, a bespoke protocol which keeps an always on data connection to the iPhone and messages binary packets to the app, which pops up alerts incredibly quickly, between 0.5 - 5 seconds from server app send to phone app response time. This is sent as data - rather than SMS - in very very small packets charged as part of the data plan not as incoming messages. I would like to know if using Android there is either a similar facility, or whether it's possible to implement something close to this using Android APIs. To clarify I define similar as: Not an SMS message, but some data driven solution As real time as is possible Is scalable - ie: as the server part of a mobile app, I could notify thousands of app instances in seconds I appreciate the app could be pull based, HTTP request/response style, but ideally I don't want to to be polling that heavily just to check for notification .. besides which it's like drip draining the data plan.

    Read the article

  • show loading gif of image only if it is really loading it for the first time

    - by Y.G.J
    i have 2 img elements. 2 id's for them: rimg and limg. limg is the loading gif and rimg is the reloaded full vertsion of the image. the is the code to show the loading before image finish to load: $("#limg").fadeIn("fast"); $("#rimg").attr("src",$(that).attr("bsrc")).load(function(){ $("#limg").fadeOut("fast",function () { $("#rimg").attr("alt",$(that).attr("alt")); $("#rimg").fadeIn("normal"); }); }); if i log into the site for the first time, it shows me the loading gif. if it is not my first time it is still showing that but i need the loading to be smooth without that loading how can i check if the image is loaded and cached before showing the loading gif?

    Read the article

  • Eclipse RCP Application Fails to launch second time

    - by ibuck
    I have an Eclipse RCP application that will launch properly after a clean install (right after build). The issue is that if I try to launch the application a second time the application throws an exception. I have narrowed the issue down to this file being created after the first run: ~install_dir/configuration/org.eclipse.osgi/.state Has anyone run into a similar issue where the .state file prevents the application from being launched anytime after that first run? I'm hesitant to look at the exception as this does not happen the first time, so I suspect org.eclipse.osgi is more to blame. The details of the exception are: "Error creating bean with name 'luceneRawQueryComposer' defined in class path resource [spring/dataaccess/daoCMClient.xml]: Cannot resolve reference to bean 'indexUtility' while setting bean property 'indexUtility'; NoSuchBeanDefinitionException

    Read the article

  • Listing time every second as a Bash script

    - by Caleb
    Hello all, first time here as I've finally started to learn programming. Anyway, I'm just trying to print the time in nanoseconds every second here, and I have this: #!/usr/bin/env bash while true; do date=(date +%N) ; echo $date ; sleep 1 ; done Now, that simply yields a string of date's, which isn't what I want. My learning has been rather messy, so I hope you'll excuse me for this if it's really simple. Also, I did manage to fine this, that worked on the prompt: while true ; do date +%N ; sleep 1 ; done But that obviously doesn't work as a script.

    Read the article

< Previous Page | 93 94 95 96 97 98 99 100 101 102 103 104  | Next Page >