Search Results

Search found 5942 results on 238 pages for 'total starnger'.

Page 155/238 | < Previous Page | 151 152 153 154 155 156 157 158 159 160 161 162  | Next Page >

  • MySQL Group Results by day using timestamp

    - by Webnet
    I need to take the following query and pull the total order counts and sum of the orders grouped by day. I'm storing everything using timestamps. SELECT COUNT(id) as order_count, SUM(price + shipping_price) as order_sum, DAY(FROM_UNIXTIME(created)) as day FROM `order` WHERE '.implode(' AND ', $where).' I need to group by DAY but when I do for this past weekend's sales it takes my order_count and makes it 1 instead of 3. How can I pull the above values grouped by day? NOTE: The implode is used ONLY to define the time period (WHERE created = TIMESTAMP AND <= TIMESTAMP)

    Read the article

  • EF Linq Product Sum when no records returned

    - by user1622713
    I’ve seen variations of this question all over the place but none of the answers work for me. Most of them are just trying to sum a single column too – nothing more complex such as the sum of a product as below: public double Total { get { return _Context.Sales.Where(t => t.Quantity > 0) .DefaultIfEmpty() .Sum(t => t.Quantity * t.Price); } } If no rows are returned I want to return zero. However if no rows are returned the .Sum() fails. There are various options of trying to insert Convert.ToDouble and using null coalesce operators, but they all still gave me errors. I’m sure I am missing a simple way to do this – any help greatly appreciated after too long banging head against google brick wall!

    Read the article

  • discrepancy in google analytics pageview totals when tracking subdomains

    - by frabjousB
    We are using the old urchin.js and are tracking 2 subdomains under the same profile. We have a “track subdomains” advanced filter defined (as per http://www.google.com/support/googleanalytics/bin/answer.py?hl=en&answer=55524) as well as 2 segments for presenting data in the reports: hostname matches exactly subdomain1.domain-name.com and hostname matches exactly subdomain2.domain-name.com When I apply these segments to our Top Content Overview report, the All Visits total for PageViews does not correspond to the # of visits reported for each subdomain. For example: All Visits = 53 subdomain1 = 24 subdomain2 = 32 Is there any reason as to why we would be seeing this discrepancy in numbers?

    Read the article

  • Counting builds

    - by moz
    I have a dozen of build plans managed by a unique build agent. What I want to do, is to get the total number of triggered/scheduled builds (without counting them manually from the interface). So, question is, is there a kind of counter on the server? UPDATE #1: I'm using the v2.2.1. UPDATE #2: On the server interface (Administration - System - System Information), there are some statistics including how many builds the server performed. But, this number is reinitialized when the server goes down.

    Read the article

  • SQL Server 2005 Reporting Services: How to count rows that are not null? Any hints for calculating t

    - by user329266
    Is there a way to count only records that are not null; similar to "COUNTA" in Excel? I would think this would be very simple process, but nothing I have tried has worked. If necessary, I can try to work this into my SQL query, but the query is already incredibly complicated. Also, I've found very little documentation for how to calculate report totals, and how to total from groups. Would anyone have any recommendations on what to use as a reference?

    Read the article

  • MySQL query with JOINS and GROUP BY

    - by user1854049
    I'm building a MySQL query but I can't seem to get it right. I have four tables: - customers - orders - sales_rates - purchase_rates There is a 1:n relation 'customernr' between customers and orders. There is a 1:n relation 'ordernr' between orders and sales_rates. There is a 1:n relation 'ordernr' between orders and purchase_rates. What I would like to do is produce an output of all customers with their total purchase and sales amounts. So far I have the following query. SELECT c.customernr, c.customer_name, SUM(sr.sales_price) AS sales_price, SUM(pr.purchase_price) AS purchase_price FROM orders o, customers c, sales_rates sr, purchase_rates pr WHERE o.customernr = c.customernr AND o.ordernr = sr.ordernr AND o.ordernr = pr.ordernr GROUP BY k.bedrijfsnaam The result of the sales_price and purchase_price is far too high. I seem to be getting double counts. What am I doing wrong? Is it possible to perform this in a single query? Thank for your response!

    Read the article

  • Play/pause HTML 5 video using JQuery

    - by Barny83
    I am trying to control HTML5 videos using JQuery. I have two clips in a tabbed interface, there are six tabs in total, the others just have images. I am trying to make the video clips play when their tab is clicked and then stop when any of the others are clicked. This must be a simple thing to do but I cant seem to get it to work, the code I am using to play the video is: $('#playMovie1').click(function(){ $('#movie1').play(); }); I have read that the video element needs to be exposed in a function to be able to control it but can't find an example. I am able to make it work using JS: document.getElementById('movie1').play(); Any advice would be great. Thanks

    Read the article

  • Difference between local and instance variables in ruby

    - by fflyer05
    I am working on a script that creates several fairly complex nested hash datastructures and then iterates through them conditionally creating database records. This is a standalone script using active record. After several minutes of running I noticed a significant lag in server responsiveness and discovered that the script, while being set to be nice +19, was enjoying a steady %85 - %90 total server memory. In this case I am using instance variables simply for readability. It helps knowing what is going to be re-used outside of the loop vs. what won't. Is there a reason to not use instance variables when they are not needed? Are there differences in memory allocation and management between local and instance variables? Would it help setting @variable = nil when its no longer needed?

    Read the article

  • How do I exclude outliers from an aggregate query?

    - by Margaret
    I'm creating a report comparing total time and volume across units. Here a simplification of the query I'm using at the moment: SELECT m.Unit, COUNT(*) AS Count, SUM(m.TimeInMinutes) AS TotalTime FROM main_table m WHERE m.unit <> '' AND m.TimeInMinutes > 0 GROUP BY m.Unit HAVING COUNT(*) > 15 However, I have been told that I need to exclude cases where the row's time is in the highest or lowest 5% to try and get rid of a few wacky outliers. (As in, remove the rows before the aggregates are applied.) How do I do that?

    Read the article

  • How to place some text over the DIV without breaking hover area of this DIV?

    - by Andr
    I'm total noob with CSS and it looks like hell =/ I have absolute positioned DIV and I handle mouse events over this DIV with JS like this: <div style='position: absolute; left: 0px; width:50px; height: 50px;' onmouseover='this.style.border="2px solid red"' onmouseout='this.style.border="1px solid black"'> </div> <div style='position: absolute;'>SOME TEXT</div> I need to place some text over this DIV and over the few same DIVs, but if I place any element over this DIV onMouseOut event is firing when mouse cursor switch to text. Tag with text can't be inside the DIV. Playing with z-index didn`t help. My browser is IE8.

    Read the article

  • Some websites to learn about MySQL tables and creating databases (The Do's and Don'ts)

    - by redsoxmaniac
    I am venturing on making a website with a database for baseball games for an intramural league. I have made databases before, but this project seems to have many fields that will require at least 3 tables. I want to make the tables correct, so that I can sort and gather information from multiple fields properly ( such as the team table querying total goals scored ). Is there a website where there is a MySQL tutorial on do's and don'ts for making somewhat complex databases? Not intro tutorials, but more around where you get into combining multiple pieces of information correctly. Any source would be helpful, thanks!

    Read the article

  • PHP String to Float

    - by John
    I am not familiar with PHP at all and had a quick question. I have 2 variables @pricePerUnit and @invoicedUnits. Here's the code that is setting these to values: $InvoicedUnits = ((string) $InvoiceLineItem->InvoicedUnits); $pricePerUnit = ((string) $InvoiceLineItem->PricePerUnit); If I output this, I get the correct values. Lets say 5000 invoiced units and 1.00 for price. Now, I need to show the total amount spent. When I multiply these two together it doesn't work (as expected, these are strings). But I have no clue how to parse/cast/convert variables in PHP. What should I do?

    Read the article

  • javascript timer fires up on the first key press

    - by pedrag
    I have a html page with a timer in it. I'm starting the timer with the keypress event, but i want it to execute only for the first key. I'm using a variable to catch the total keys in an other function which there were pressed and i have something like that: if(totaAttempts==1) start the timer, but with this solution the timer starts correctly, but is stomps when a key is pressed again. Any better ideas? Thanks in advance function setTime() { if (totalAttempts == 1) { ++totalSeconds; secondsLabel.innerHTML = pad(totalSeconds % 60); minutesLabel.innerHTML = pad(parseInt(totalSeconds / 60)); } } function pad(val) { var valString = val + ""; if (valString.length < 2) { return "0" + valString; } else { return valString; } }

    Read the article

  • C# chart control Performance with large amounts of data

    - by user3642115
    I am using a chart control with a range bar graph to basically make a gantt chart for lots of people and lots of projects, say about 1000 total series. The issue that I am running in to is that once I have all my data added to the chart, which takes some time but that is to be expected, and I go to scroll down on my graph it freezes the whole application and takes a while before it unfreezes and scrolls down. Is there any way to improve the performance of this? I tried adding the graph to a panel and growing the graph size dynamically and then scrolling down from the panel but that cause a whole plethora of other issues. Any tips for speeding this up? I don't think it is my code as it has already finished running when this issue happens. Thanks.

    Read the article

  • including a string as a parameter to a function in a header file? c++

    - by Nara
    hello everyone, total newbie is here :) i have this header file, zeeheader.h, and i wrote some classes in it, i'm having problems giving a string as a parameter to one of the functions: class DeliTest { public: void DeliCheck(Stack*,string); void ComCheck (unsigned,string); bool EofCheck (unsigned,string); }; as i was implementinng it in the cpp file, i added #include to it, it seemed to be working, for example : as i was writing the "data." i got the "length()" appear by the intellisense, so i thought that it was working, but it wasn't. i got errors like: syntax error : identifier 'string' overloaded member function not found in 'DeliTest' this is one of the fucntions in the cpp file: bool DeliTest::EofCheck(unsigned i, string data) { if (i == data.length()-1) return 1; return 0; } am i supposed to be adding something to the header file??

    Read the article

  • Optimal ASP.Net cache duration for a large site?

    - by HeroicLife
    I've read lots of material on how to do ASP.Net caching but little on the optimal duration that pages should be cached for. Let's say that I have a popular site with 50,000 pages. The content does not change frequently, so I could cache pages for up to an hour if I wanted. The server has 16 GB of RAM, but database connections are limited. How long should pages be cached for? My thinking is that if I set the cache duration too high (let's say 60 minutes), I will fill up memory with a fraction of the total content, which will continually be shuffled in and out of memory. Furthermore, let's say that 10% of the pages are responsible for 90% of traffic. If the popular pages are hit every second, and the unpopular ones every hour, then a 60 second cache would only keep the load-intensive content cached without sacrificing freshness. Should numerous but rarely-accessed content be cached at all?

    Read the article

  • How do I count list elements that are not hidden?

    - by Baloneysammitch
    Starting with a simple list: <ul> <li>Item 1</li> <li style="display: none;">Item 2</li> <li>Item 3</li> </ul> I know that I can subtract the hidden elements from the list total $('ul li').size() - $('ul li:hidden').size() But I thought there might be a more elegant way to achieve this with jquery: $('ul li:hidden:not').size() That doesn't work. Any ideas?

    Read the article

  • Removing words from a file

    - by user1765792
    I'm trying to take a regular text file and remove words identified in a separate file (stopwords) containing the words to be removed separated by carriage returns ("\n"). Right now I'm converting both files into lists so that the elements of each list can be compared. I got this function to work, but it doesn't remove all of the words I have specified in the stopwords file. Any help is greatly appreciated. def elimstops(file_str): #takes as input a string for the stopwords file location stop_f = open(file_str, 'r') stopw = stop_f.read() stopw = stopw.split('\n') text_file = open('sample.txt') #Opens the file whose stop words will be eliminated prime = text_file.read() prime = prime.split(' ') #Splits the string into a list separated by a space tot_str = "" #total string i = 0 while i < (len(stopw)): if stopw[i] in prime: prime.remove(stopw[i]) #removes the stopword from the text else: pass i += 1 # Creates a new string from the compilation of list elements # with the stop words removed for v in prime: tot_str = tot_str + str(v) + " " return tot_str

    Read the article

  • Varnish waits for the complete page load before sending response to browser.

    - by Track
    I've setup varnish to sit in front of a tomcat server. What I've noticed is that Varnish seems to wait for the complete page to load (all css, js, etc) before it sends any response to the browser. This causes a huge lag before the user sees anything. If I bypass Varnish and go directly to the site, it responds immediately. While the total page load time might be similar, the perception is that the site is slow. Has anyone faced this?

    Read the article

  • Best way to convert Stream (of unknown length) to byte array, in .NET?

    - by Frank Hamming
    Hello, I have the following code to read data from a Stream (in this case, from a named pipe) and into a byte array: // NPSS is an instance of NamedPipeServerStream int BytesRead; byte[] StreamBuffer = new byte[BUFFER_SIZE]; // defined elsewhere (less than total possible message size, though) MemoryStream MessageStream = new MemoryStream(); do { BytesRead = NPSS.Read(StreamBuffer, 0, StreamBuffer.Length); MessageStream.Write(StreamBuffer, 0, BytesRead); } while (!NPSS.IsMessageComplete); byte[] Message = MessageStream.ToArray(); // final data Could you please take a look and let me know if it can be done more efficiently or neatly? Seems a bit messy as it is, using a MemoryStream. Thanks!

    Read the article

  • putting data from a for loop into a table using matlab and fprintf

    - by user2928537
    I am trying to put the following data from my for loop into a table formatted so that there are 11 values of F in each column, with a total of 4 columns. but I am always ending up with one long column of my data instead of the four columns I want. I was wondering if there is some way to put the data into a matrix and then reshape it, but I am having trouble. Any help greatly appreciated. fprintf ('Electrostatic Forces:\n') for r = 1:4; q2 = 0: 1*10^-19: 1*10^-18; for F = coulomb(q2,r); fprintf ('%d\n',F) end end Where the code for the function coulomb is function F = coulomb (q2,r); k = 8.98*10^9; q1 = 1.6*10^-19; F = k*abs(q1*q2)/r^2; end

    Read the article

  • If statements Evaluations

    - by user2464795
    Using the code below I get this result even though I put in a number that is greater than 18. run: How old are you? 21 You have not reached the age of Majority yet! BUILD SUCCESSFUL (total time: 3 seconds) I am new to java and trying to self learn can anybody help? import java.util.Scanner; public class Chapter8 { /** * @param args the command line arguments */ public static void main(String[] args) { Scanner reader = new Scanner (System.in); // TODO code application logic here //Excercise 15 System.out.print("How old are you? "); int x = Integer.parseInt(reader.nextLine()); if (x > 18){ System.out.println("You have not reached the age of Majority yet!"); }else { System.out.println("You have reached the age of Majority!"); }

    Read the article

  • How to manage memory for ios with large csv files?

    - by Pell000
    I'm new to ios development, and I'm running into issues relating to memory management and my approaches to dealing with large datasets. Right now, I am loading the csv files and storing the relevant data as objects in memory at app initialization. Some of the csv files are larger than 1MB, and in total, my app uses about 180MB of memory. This is obviously way too high of a number (unless the info I found is wrong and this is an acceptable number, then please let me know). I feel as though there is a fundamental flaw in my approach: is there a way I can avoid storing the csv files in the project itself? Or, is there a kind of "lazy" loading I can do so that I can simply look up info in the csv file, as opposed to loading all of the data from it at once? Any help would do. I think that I need a new perspective in how to manage this more efficiently.

    Read the article

  • algorithm to find the three majority elements in an array

    - by Qiang Li
    Let's say there are three elements in a non-sorted array all of which appear more than one-fourth times of the total number of elements. What is the most efficient way to find these elements? Both for non-online and online versions of this question. Thank you! Edit The non-online version I was referring to is: this array is specified in full. The online version means the array elements are coming one at a time. I require the space in addition to time complexity to be tight. disclaimer: THIS IS NOT HOMEWORK! I consider this as research-level question.

    Read the article

  • Recursive solution to finding patterns

    - by user2997162
    I was solving a problem on recursion which is to count the total number of consecutive 8's in a number. For example: input: 8801 output: 2 input: 801 output: 0 input: 888 output: 3 input: 88088018 output:4 I am unable to figure out the logic of passing the information to the next recursive call about whether the previous digit was an 8. I do not want the code but I need help with the logic. For an iterative solution, I could have used a flag variable, but in recursion how do I do the work which flag variable does in an iterative solution. Also, it is not a part of any assignment. This just came to my mind because I am trying to practice coding using recursion.

    Read the article

< Previous Page | 151 152 153 154 155 156 157 158 159 160 161 162  | Next Page >