Search Results

Search found 3403 results on 137 pages for 'monthly statements'.

Page 4/137 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Daily, Weekly and Monthly Page View Counter

    - by Jens Fahnenbruck
    I'm building a website with user generated content. On the home page I want to show a list of all created items, and I want to be able to sort them by a view counter. That's sound easy, but I want multiple counters. I want to know which was the most visited item in the last day, last week or last months or overall. My first Idea was to create 4 counter columns in the item's DB-Table. One for each of daily, weekly, monthly and overall, and the create a cron job, that clears the daily counter every 24 hours, the weekly counter every 7 days and so on. But my problem with this is, what happens if I want to know which was the most viewed item of the week, just after the weekly counter got cleared? What I need is an efficient way to create a continous counter, which got reduced for every page view that is too old, and increased for every new page view. Right now I'm thinking of a solution with the redis server, but I have no solution yet. I'm just looking for a general idea here, but FYI I'm developing this application in Ruby on Rails.

    Read the article

  • Where do DQL statements live in an application that is using Zend Framework and Doctrine

    - by Dewayne
    In an application that is using Zend Framework 1.10 and Doctrine 1.2, where should the DQL statements live if our application is built such that it has a Service Layer and a Gateway(aka Doctrine_Table) layer. It seems that our possibilities include: 1) Placing the DQL statements in the Service layer which seems to be a bit too high in our application hierarchy to store DQL. 2) Placing the DQL statements within each model's Table/Gateway which seems a bit redundant because we also need to expose the DQL statements that do things such as getAllUsers() through the Service layer. Which of these is a preferable design? We intend to make use of the Service layer as much as possible so that other projects might consume various parts of our application.

    Read the article

  • JavaScript: 2 window.opener.location.href statements with alert() in between not functioning

    - by vastbeyond
    I need to make a little JS app to scroll automatically through a list of URLs. I've chosen to have the functionality in a pop-up, for various reasons. The syntax to change the opening window's URL is: window.opener.location.href = "http://www.example.com"; This works fine with one URL, but if two statements are called, only one is executed. I experimented with an alert statement between two of the above statements, and the alert event made the second statement function properly: window.opener.location.href = "http://www.example1.com"; alert("hello world"); window.opener.location.href = "http://www.example2.com"; Question is: does anyone know how to get the first and second window.opener statements to work, without the intervening alert();? Also, how can I add a pause between the two statements, so that the second executes a couple of seconds after the first? Thanks so much!

    Read the article

  • MySQL 5.1 / phpMyAdmin - logging CREATE/ALTER statements

    - by pako
    Is it possible to log CREATE / ALTER statements issued on a MySQL server through phpMyAdmin? I heard that it could be done with a trigger, but I can't seem to find suitable code anywhere. I would like to log these statements to a table, preferably with the timestamp of when they were issued. Can someone provide me with a sample trigger that would enable me to accomplish this? I would like to log these statements so I can easily synchronize the changes with another MySQL server.

    Read the article

  • MySQL 5.1 - logging CREATE/ALTER statements

    - by pako
    Is it possible to log CREATE / ALTER statements issued on a MySQL server? I heard that it could be done with a trigger, but I can't seem to find suitable code anywhere. I would like to log these statements to a table, preferably with the timestamp of when they were issued. Can someone provide me with a sample trigger that would enable me to accomplish this? I would like to log these statements so I can easily synchronize the changes with another MySQL server.

    Read the article

  • Understanding PHP's way of reading if statements

    - by Masi
    How does PHP read if statements? I have the following if statements in this order if ( $number_of_figures_in_email < 6) { -- cut: gives false } if($number_of_emails > 0) { -- cut: gives false } if ( $number_of_emails == 0) { -- cut: gives true } The code behaves randomly. It sometimes goes to the third if clause and gives me a success, while sometimes to the one of the first two if clauses when the input variables are constant. This suggests me that I cannot code only with if statements.

    Read the article

  • Quickbooks 2009 2010

    - by Bronwyn
    I have configured my bank account within quickbooks to import bank statements. I have wxported the bank statement. Then used the convert process available within QB to convert. The file name shows the bsb then some other figures and then the account number. However it will not import. I am wondering how ot make this work. Can I change the file name to match my QB account details and thus enable the importing. This is a technical question. Many thanks Bronwyn

    Read the article

  • Data truncation when retrieving data from MySQL database with prepared statements

    - by KSiimson
    I have a script that retrieves multiple products using prepared statements. Like putting loops into loops, I have prepared statements in prepared statements - so there is a prepared statement for retrieving all products, a prepared statement to retrieve all images for that product, a prepared statement to get all attributes for that products, and so on. This does not work with one MySQLi instance, so I use multiple MySQLi objects that are opened and closed when needed. It usually works fine, but sometimes, especially when displaying multiple products, some data is truncated. For example - MicoLoans becomes MicoLoa. There was an actual spelling mistake here - now when I changed MicoLoans to MicroLoans, the same page displayed MicroLoa... So the same number of characters was truncated from the end. It is sort of consistent where it appears - for example there can be descriptions for 8 products, and description of 1 product is heavily truncated. When I add 9th product, the short description is still truncated for that same product as before. Any ideas?

    Read the article

  • WordPress Monthly Archive by Year

    - by PaulDavis
    WordPress extraordinaires, I need your help! I need to be able to list the archives, but in a slightly different way than the WP codex, or an hour of Googling will show me. I need the months of the year, as the generic archive function, but only for one year at a time. So, list all the months in 2007. I'll need to be able to use this multiple times in the same template too, for different years. I've got a feeling query_posts might be the way, but I'm not too sure. Anyone got some ideas?

    Read the article

  • Java-Recursion: When does statements after a recursive method call executes

    - by Ruru Morlano
    When are statements after the method call itself going to execute? private void inorderHelper(TreeNode node) { if ( node==null ) return; inorderHelper(node.leftNode); System.out.printf("%d", node.data); inorderHelper(node.rigthNode); } All I can see is that the line of codes inorderHelper(node.leftNode) will continue to iterate until node == null and the method terminates immediately before node.data is printed. I think that I didn't get well recursion but all examples I can find doesn't have statements after the recursive call. All I want to know is when are statements like System.out.printf("%d",node.data) going to execute before the method return?

    Read the article

  • Select Statements in Jobs

    - by Andrew Vogel
    I have inherited a few jobs and I am trying to understand why select statements would be in their steps. I would think that select statements would be pointless in an automated job that displays nothing for an end user.

    Read the article

  • FLEX components: updating import statements to move the component into another folder

    - by Patrick
    hi, I've just imported a Flex component into my project. I have a theory question about importing. all the imports statements in the component source files started with "com.subFolder.etc", but I have preferred to move the component folders into "componentName" and to replace all import statements as "componentName.com.subFolder.etc" Is this ok ? Everything works perfectly, but I was wondering if the method is correct. thanks

    Read the article

  • Using R to Analyze Balance Sheets and Income Statements

    - by Ramnath
    I am interested in analyzing balance sheets and income statements using R. I have seen that there are R packages that pull information from Yahoo and Google Finance, but all the examples I have seen concern historical stock price information. Is there a way I can pull historical information from balance sheets and income statements using R?

    Read the article

  • explain these select statements!

    - by user329820
    Hi, I can not get the difference betwwn these statements? would you please help me,I have read some sample of select statements but I did not get these ones. SELECT 'B' FROM T WHERE A = (SELECT NULL); SELECT 'C' FROM T WHERE A = ANY (SELECT NULL); SELECT 'D' FROM T WHERE A = A; I use MySQL

    Read the article

  • Dealing with big IF statements in PHP

    - by Industrial
    Hi everyone, Is there any good alternative for the plain if statements in PHP? I know about switch, but I'll guess that there's some more refined alternative out there that comes handy when working with really big if statements. Thanks a lot,

    Read the article

  • Nginx Multiple If Statements Cause Memory Usage to Jump

    - by Justin Kulesza
    We need to block a large number of requests by IP address with nginx. The requests are proxied by a CDN, and so we cannot block with the actual client IP address (it would be the IP address of the CDN, not the actual client). So, we have $http_x_forwarded_for which contains the IP which we need to block for a given request. Similarly, we cannot use IP tables, as blocking the IP address of the proxied client will have no effect. We need to use nginx to block the requested based on the value of $http_x_forwarded_for. Initially, we tried multiple, simple if statements: http://pastie.org/5110910 However, this caused our nginx memory usage to jump considerably. We went from somewhere around a 40MB resident size to over a 200MB resident size. If we changed things up, and created one large regex that matched the necessary IP addresses, memory usage was fairly normal: http://pastie.org/5110923 Keep in mind that we're trying to block many more than 3 or 4 IP addresses... more like 50 to 100, which may be included in several (20+) nginx server configuration blocks. Thoughts? Suggestions? I'm interested both in why memory usage would spike so greatly using multiple if blocks, and also if there are any better ways to achieve our goal.

    Read the article

  • Parsing some particular statements with antlr3 in C target

    - by JCD
    Hello all! I have some questions about antlr3 with tree grammar in C target. I have almost done my interpretor (functions, variables, boolean and math expressions ok) and i have kept the most difficult statements for the end (like if, switch, etc.) 1) I would like interpreting a simple loop statement: repeat: ^(REPEAT DIGIT stmt); I've seen many examples but nothing about the tree walker (only a topic here with the macros MARK() / REWIND(m) + @init / @after but not working (i've antlr errors: "unexpected node at offset 0")). How can i interpret this statement in C? 2) Same question with a simple if statement: if: ^(IF condition stmt elseifstmt* elsestmt?); The problem is to skip the statement if the condition is false and test the other elseif/else statements. 3) I have some statements which can stop the script (like "break" or "exit"). How can i interrupt the tree walker and skip the following tokens? 4) When a lexer or parser error is detected, antlr returns an error. But i would like to make my homemade error messages. How can i have the line number where parser crashed? Ask me if you want more details. Thanks you very much (and i apologize for my poor english)

    Read the article

  • Using prepared statements with JDBCTemplate

    - by Bernhard V
    Hi. I'm using the Jdbc template and want to read from the database using prepared statements. I iterate over many lines in a csv file and on every line I execute some sql select queries with it's values. Now I want to speed up my reading from the database but I just can't get the Jdbc template to work with prepared statements. Actually I even don't know how to do it. There is the PreparedStatementCreator and the PreparedStatementCreator. As in this example both of them are created with anonymous inner classes. But inside the PreparedStatementCreator class I don't have access to the values I want to set in the prepared statement. Since I'm iterating through a csv file I can't hard code them as a String because I don't know them. I also can't pass them to the PreparedStatementCreator because there are no arguments for the constructor. I was used to the creation of prepared statements being fairly simple. Something like PreparedStatement updateSales = con.prepareStatement( "UPDATE COFFEES SET SALES = ? WHERE COF_NAME LIKE ? "); updateSales.setInt(1, 75); updateSales.setString(2, "Colombian"); updateSales.executeUpdate(): as in the Java tutorial. Your help would be very appreciated.

    Read the article

  • sql-server performance optimization by removing print statements

    - by AG
    We're going through a round of sql-server stored procedure optimizations. The one recommendation we've found that clearly applies for us is 'SET NOCOUNT ON' at the top of each procedure. (Yes, I've seen the posts that point out issues with this depending on what client objects you run the stored procedures from but these are not issues for us.) So now I'm just trying to add in a bit of common sense. If the benefit of SET NOCOUNT ON is simply to reduce network traffic by some small amount every time, wouldn't it also make sense to turn off all the PRINT statements we have in the stored procedures that we only use for debugging? I can't see how it can hurt performance. OTOH, it's a bit of a hassle to implement due to the fact that some of the print statements are the only thing within else clauses, so you can't just always comment out the one line and be done. The change carries some amount of risk so I don't want to do it if it isn't going to actually help. But I don't see eliminating print statements mentioned anywhere in articles on optimization. Is that because it is so obvious no one bothers to mention it?

    Read the article

  • Recursion in prepared statements

    - by Rob
    I've been using PDO and preparing all my statements primarily for security reasons. However, I have a part of my code that does execute the same statement many times with different parameters, and I thought this would be where the prepared statements really shine. But they actually break the code... The basic logic of the code is this. function someFunction($something) { global $pdo; $array = array(); static $handle = null; if (!$handle) { $handle = $pdo->prepare("A STATEMENT WITH :a_param"); } $handle->bindValue(":a_param", $something); if ($handle->execute()) { while ($row = $handle->fetch()) { $array[] = someFunction($row['blah']); } } return $array; } It looked fine to me, but it was missing out a lot of rows. Eventually I realised that the statement handle was being changed (executed with different param), which means the call to fetch in the while loop will only ever work once, then the function calls itself again, and the result set is changed. So I am wondering what's the best way of using PDO prepared statements in a recursive way. One way could be to use fetchAll(), but it says in the manual that has a substantial overhead. The whole point of this is to make it more efficient. The other thing I could do is not reuse a static handle, and instead make a new one every time. I believe that since the query string is the same, internally the MySQL driver will be using a prepared statement anyway, so there is just the small overhead of creating a new handle on each recursive call. Personally I think that defeats the point. Or is there some way of rewriting this?

    Read the article

  • Recording SELECT statements in PostgreSQL 8.4

    - by David Anniwell
    Hi All I've got a table which contains sensitive data and according to data protection policy we have to keep a record of every read/write of the data including a row identifier and the user who accessed the table. The writing is no issue using triggers but obviously triggers aren't supported for SELECT statements. What's the best method of doing this? I've looked at rules but I can't get them to INSERT into a table, and I've tried logging every query but this doesn't seem to log SELECT statements. Ideally for security I'd like to keep the log within a table on the database but logging to a file is fine too. Thanks David

    Read the article

  • GoTo statements, and alternatives (help me please im new) (VB.net)

    - by qais
    Basically I posted a code snippet on a forum asking for help and people pointed out to me that using GoTo statements is very bad programming practise so I'm just wondering, why is it bad? And also what alternative is there to use, like for example in this program ive done for homework the user has to input their date of birth and if the month/date/year are invalid or unrealistic(using if statements checking the integer inputs size, if theres any better way to do this i'd appreciate if you could tell me that also :D) then how would i be able to loop back to ask them again? heres a little extract of my code retryday: Console.WriteLine("Please enter the day you were born : ") day = Console.ReadLine If day > 31 Or day < 1 Then Console.WriteLine("Please enter a valid day") GoTo retryday End If

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >