Search Results

Search found 29133 results on 1166 pages for 'week number'.

Page 9/1166 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • Total Average Week using a Parameter

    - by Jose
    I have a crystal report that shows sales volumes called week to date volume. It shows current week, previous week, and average week. The report prompts for a date parameter and I extract the week number to get current week and previous week volumes. Did it this way because Mngmt wants to be able to run report whenever. My problem is for Average Week I cant figure out how to get the number of weeks to divide by for my average. Report originates from June 1st, 2010. Right now I have: DATEPART("ww", {?date}) - DATEPART("ww", DATE(2010, 6, 1)) This returns 2 right now which is perfect, so i divide my total by 2. This code will work until the end of the year then I'm hooped. Any idea how I can make this a little more dynamic. I was thinking a counter somehow, just can't get the logic down because the date parameter will keep changing, meaning I cant increase my counter by 1 after each week??? Cheers.

    Read the article

  • Calculating week of specified date.

    - by Louis W
    Does PHP calculate weeks as being Sunday - Saturday? For a given date I am trying to determine the beginning and ending date of it's week as well as the beginning date of the next/previous weeks. Everything works fine unless I pass in a Sunday and it thinks the date is in a previous week. $start = $_GET['start']; $year = date('Y', strtotime($start)); $week = date('W', strtotime($start)); $sunday = strtotime($year.'W'.$week.'0'); $next = strtotime('+7 Days', $sunday); $prev = strtotime('-7 Days', $sunday); echo '<p>week: ' . $week . '</p>'; echo '<p>sunday: ' . date('Y-m-d', $sunday) . '</p>'; echo '<p>next:' . date('Y-m-d', $next) . '</p>'; echo '<p>prev: ' . date('Y-m-d', $prev) . '</p>'; Outcome: 2011-01-09 (Sunday) Week: 01 WRONG 2011-01-10 (Monday) Week: 02 RIGHT 2011-01-15 (Saturday) Week: 02 RIGHT

    Read the article

  • determine week when pick a day

    - by derikluv
    I'm trying to accomplish the following task. I'm developing a custom calendar with three views (day,week and month), there may be something out there already but I'm rewriting this as part of learning tool for me as well. So user will face with Day view when they first visit, with arrows to go back and forth to next day or previous day of course. If they click on Week View, it will give them a 7 days overview with today date as default, and once again they can go back and forth to next week or previous week. The last view is the full month calendar, once they click on the day, it will give them the detail of the day and at the same time reset the default as the day they pick. So if they go back to week view, they will see the detail for the week contain the day that they picked. This is where I have trouble wrapping my head around with, I know there are PHP functions that determine the day of the week but I can't seem to think about how to pass in the date and get the full week starting from Sunday for the day that passed in. For example, if I passed in 10/12/2012, I'd like to start the week at 10/07/12 - 10/13/12. Thank you kindly for your help or pointing to the right direction. Please excuse my grammar/spelling mistakes as well.

    Read the article

  • Python: Socket set source port number

    - by beratch
    Hi all, I'd like to send a specific UDP broadcast packet.. unfortunatly i need to send the udp packet from a very specific port for all packet I send. Let say I broadcast via UDP "BLABLAH", the server will only answer if my incoming packet source port was 1444, if not the packet is discarded. My broadcast socket setup look like this : s = socket(AF_INET,SOCK_DGRAM) s.setsockopt(SOL_SOCKET, SO_BROADCAST, 1) How can i do that (set the source port) in python ? Thanks!

    Read the article

  • Quantis Quantum Random Number Generator (QRNG) - any reviews?

    - by Tim Post
    I am thinking about getting one of these (PCI) to set up an internal entropy pool similar to this service who incidentally brought us fun captcha challenges. Prior to lightening my wallet, I'm hoping to gather feedback from people who may be using this device. As there is no possible 'correct' answer, I am making this CW and tagging it as subjective. I'm undertaking a project to help write Monte Carlo simulations for a non profit that distributes mosquito nets in Malaria stricken areas. The idea is to model areas to determine the best place to distribute mosquito nets. During development, I expect to consume gigs if not more of the RNG output. We really need our own source. Is this device reliable? Does it have to be re-started often? Is its bandwidth really as advertised? It passes all tests, as far as randomness goes (i.e. NIST/DIEHARD). What I don't want is something in deadlock due to some ioctl in disk sleep that does nothing but radiate heat. This is not a spamvertisement, I'm helping out of pocket and I really, really want to know if such a large purchase will bear fruit. I can't afford to build a HRNG based on radioactive decay, this looks like the next best thing. Any comments are appreciated. I will earn zero rep for this, please do not vote to close. This is no different than questions regarding the utilization of some branded GPU for some odd purpose. Answers pointing to other solutions will be gladly accepted, I'm not married to this idea.

    Read the article

  • Attend MySQL Webinars This Week

    - by Bertrand Matthelié
    Interested in learning more about MySQL as embedded database? In building highly available MySQL applications with MySQL and DRBD? Join our webinars this week! All information below. Tuesday next week (November 20) we will provide an update about what's new in MySQL Enterprise Edition. We have live Q&A during the webinars so you'll get the chance to ask all your questions. Top 10 Reasons to Use MySQL as an Embedded Database Tuesday, November 13 9:00 a.m. PT Review the top 10 reasons why MySQL is technically well-suited for embedded use, as well as the related business reasons vendors choose MySQL initially, over time, and across product-lines. Register for the Webcast. MySQL High Availability with Distributed Replicated Block Device Thursday, November 15 9:00 a.m. PT Learn how to build highly available services with MySQL and distributed replicated block device (DRBD). The DRBD high-availability solution comprises a complete stack of open source software that delivers high-availability database clusters on commodity hardware, with the option of 24/7 support from Oracle. Register for the Webcast. Technology Update: What's New in MySQL Enterprise Edition Tuesday, November 20 9:00 a.m. PT Find out what's new in MySQL Enterprise Edition. Register for the Webcast.

    Read the article

  • SQL Random number not working

    - by JMSA
    declare @fieldForceCounter as int declare @SaleDate as dateTime declare @RandomNoSeed as decimal set @fieldForceCounter = 1 set @SaleDate = '1 Jan 2009' set @RandomNoSeed = 0.0 WHILE @fieldForceCounter <= 3 BEGIN while @SaleDate <= '1 Dec 2009' begin INSERT INTO MonthlySales(FFCode, SaleDate, SaleValue) VALUES(@fieldForceCounter, @SaleDate, RAND(@RandomNoSeed)) set @saleDate = @saleDate + 1 set @RandomNoSeed = Rand(@RandomNoSeed) + 1 end set @SaleDate = '1 Jan 2009' set @fieldForceCounter = @fieldForceCounter + 1 END GO This T-SQL command was supposed to insert random values in the 'SaleValue'-column in the 'MonthlySales'-table. But it is inserting '1' every time . What can be the problem?

    Read the article

  • Random number generation

    - by Chandan Shetty SP
    I am using below code to generate random numbers in range... int randomNumberWithinRange(int min,int max) { int snowSize = 0; do { snowSize = rand()%max; } while( snowSize < min || snowSize > max ); return snowSize; } for(int i = 0; i < 10 ; i++) NSlog("@"%d",\t", randomNumberWithinRange(1,100)); If I quit my application and restart, same set of numbers are generated. How to generate different set of random numbers for every launching.

    Read the article

  • Quickly determine if a number is prime in Python for numbers < 1 billion

    - by Frór
    Hi, My current algorithm to check the primality of numbers in python is way to slow for numbers between 10 million and 1 billion. I want it to be improved knowing that I will never get numbers bigger than 1 billion. The context is that I can't get an implementation that is quick enough for solving problem 60 of project Euler: I'm getting the answer to the problem in 75 seconds where I need it in 60 seconds. http://projecteuler.net/index.php?section=problems&id=60 I have very few memory at my disposal so I can't store all the prime numbers below 1 billion. I'm currently using the standard trial division tuned with 6k±1. Is there anything better than this? Do I already need to get the Rabin-Miller method for numbers that are this large. primes_under_100 = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97] def isprime(n): if n <= 100: return n in primes_under_100 if n % 2 == 0 or n % 3 == 0: return False for f in range(5, int(n ** .5), 6): if n % f == 0 or n % (f + 2) == 0: return False return True How can I improve this algorithm?

    Read the article

  • Need to devise a number crunching algorithm

    - by Ravi Gupta
    I stumbled upon this question: 7 power 7 is 823543. Which higher power of 7 ends with 823543 ? How should I go about it ? The one I came up with is very slow, it keeps on multiplying by 7 and checks last 6 digits of the result for a match. I tried with Lou's code: int x=1; for (int i=3;i<=100000000;i=i+4){ x=(x*7)%1000000; System.out.println("i="+ i+" x= "+x); if (x==823543){ System.out.println("Ans "+i);} } And CPU sounds like a pressure cooker but couldn't get the answer :(

    Read the article

  • C: Random Number Generation - What (If Anything) Is Wrong With This

    - by raoulcousins
    For a simple simulation in C, I need to generate exponential random variables. I remember reading somewhere (but I can't find it now, and I don't remember why) that using the rand() function to generate random integers in a fixed range would generate non-uniformly distributed integers. Because of this, I'm wondering if this code might have a similar problem: //generate u ~ U[0,1] u = ( (double)rand() / ((double)(RAND_MAX)); //inverse of exponential CDF to get exponential random variable expon = -log(1-u) * mean; Thank you!

    Read the article

  • Don't miss Virtual Developer Day - All about ADF next week

    - by Shay Shmeltzer
    In case you haven't heard we are holding a free online virtual developer day next week - July 10th that you should attend - even if you think you already know ADF. First the registration link - http://bit.ly/fusiondev. While one of the tracks is aimed at developer who are relatively new to ADF - and cover ADF Faces, ADF Controller and a comparison of productivity with Forms and other tools - the two other tracks have great content on some topics that you might not be familiar with even if you already work with ADF. This include sessions about the upcoming ADF Mobile, The new ADF support in Eclipse and information about Application Life Cycle Management with ADF and JDeveloper. As well as sessions that will open your mind to the areas where ADF integrates with other Fusion Middleware Solutions such as ADF integration with BI, WebCenter and SOA. Most of the sessions are quite heavy on demos and you'll get a chance to interact with the presenters and ask questions during the live event. You should register even if you can't attend the live event - this way you'll get an email pointing you to the recorded sessions for on demand viewing. See you next week.

    Read the article

  • True random number generator

    - by goldenmean
    Sorry for this not being a "real" question, but Sometime back i remember seeing a post here about randomizing a randomizer randomly to generate truly random numbers, not just pseudo random. I dont see it if i search for it. Does anybody know about that article?

    Read the article

  • sed: search and replace string with line number

    - by tigerstyle
    Hi volks, I have a XML file with a lot of empty tag attributes. For instance: <mytag id=""> <ontent>aaa</content> </mytag> <mytag id=""> <ontent>bbb</content> </mytag> <mytag id=""> <ontent>ccc</content> </mytag> Now I want to replace id="" with e.g. id="2443" (id="[linenumber]") I tried to do this with sed, but I did not get a successful result. I hope someone here can help me :-)

    Read the article

  • URL losing port number in every page load

    - by MarceloRamires
    I'm currently taking care of a certain local website. The default port has been changed, and can no longer be not included in the URL due to technical reasons, so now i'm using a certain port in the end of the IP at the URL, for example 100.100.100.100/website.asp no longer works 100.100.100.100:10/website.asp with the port, works. Works, though I can't click in any link or anything and the port vanishes (new page doesn't load). Then I keep the same URL and just include the port at the end of the IP and it works again, until I click in another link inside of it. I have access to changing each link, but I guess that would not be the right approach. How should I procceed ?

    Read the article

  • Implementing a Clock Drift random number generator in PHP

    - by Excl
    Hi, I wrote the following code: function create_rand($time) { $counter = 0; $stop = microtime(true) + $time; while(microtime(true) < $stop) $counter++; return $counter; } function create_rand_max($time, $a, $b = false) { $rand_a = create_rand($time); $rand_b = create_rand($time); $rand_c = create_rand($time); $max = max($rand_a, $rand_b, $rand_c); $min = min($rand_a, $rand_b, $rand_c); if($max === $min) return create_rand_max($time, $a, $b); $middle = $rand_a + $rand_b + $rand_c - $max - $min; if($b !== false) return min($a, $b) + ($middle - $min) * (max($a, $b) - min($a, $b)) / ($max - $min); return ($middle - $min) * $a / ($max - $min); } $stop = 1000; $sum = 0; for($i = 0; $i < $stop; $i++) { $sum += create_rand_max(0.001, 100, 200); } echo $sum / $stop; The average is usually between 157 to 161, instead of ~150. Any ideas?

    Read the article

  • XNA: Networking, what is a good bytes per second sent/received number

    - by SimpleRookie
    I am working with XNA networking, on the XBOX. I was wondering what is a safe number to stay under in the bytes sent and received when it comes to the xbox. Obviously various factors will effect the number, and you want as little packet data as possible to keep things smooth, but what is a good number for that? (Using : networksession.bytespersecondsent and networksession.bytespersecondreceived to measure the number.)

    Read the article

  • Interesting links week #24 and #25

    - by erwin21
    Below a list of interesting links that I found this week: Interaction: Design Usability and All About It Frontend: CSS Lint – CSS Cleaning Tool 10 HTML Entity Crimes You Really Shouldn’t Commit Development: OWASP Top 10 for .NET developers part 7: Insecure Cryptographic Storage C#/.NET Fundamentals: Choosing the Right Collection Class Mobile: Tips to Design a Website for Mobile Marketing: 30 (New) Google Ranking Factors You May Over- or Underestimate Other: 5 Little-Known Web Files That Can Enhance Your Website Interested in more interesting links follow me at twitter http://twitter.com/erwingriekspoor

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >