Search Results

Search found 8083 results on 324 pages for 'total newbie'.

Page 53/324 | < Previous Page | 49 50 51 52 53 54 55 56 57 58 59 60  | Next Page >

  • Problem with anchor tags in Django after using lighttpd + fastcgi

    - by Drew A
    I just started using lighttpd and fastcgi for my django site, but I've noticed my anchor links are no longer working. I used the anchor links for sorting links on the page, for example I use an anchor to sort links by the number of points (or votes) they have received. For example: the code in the html template: ... {% load sorting_tags %} ... {% ifequal sort_order "points" %} {% trans "total points" %} {% trans "or" %} {% anchor "date" "date posted" %} {% order_by_votes links request.direction %} {% else %} {% anchor "points" "total points" %} {% trans "or" %} {% trans "date posted" %} ... The anchor link on "www.mysite.com/my_app/" for total points will be directed to "my_app/?sort=points" But the correct URL should be "www.mysite.com/my_app/?sort=points" All my other links work, the problem is specific to anchor links. The {% anchor %} tag is taken from django-sorting, the code can be found at http://github.com/directeur/django-sorting Specifically in django-sorting/templatetags/sorting_tags.py Thanks in advance.

    Read the article

  • Why would bytesTotal increase in a AS3 preloader?

    - by justkevin
    I'm creating a custom preloader for a Flex app and have noticed the following behavior: when loading, the progress bar goes to 100%, then down then back up, and so on until the app is finished loading. When I put a trace in the dowloadprogress listener, I see that while the app is loading, both bytesLoaded and bytesTotal increase, but not necessarily at the same time. Code: private function onDownloadProgress(event:ProgressEvent):void { var loaded:int = event.bytesLoaded; var total:int = event.bytesTotal; trace(event.target,loaded,total); _starfield.progress = loaded/total; } Output: [object Preloader] 134276 134276 [object Preloader] 265348 285007 [object Preloader] 285007 285007 [object Preloader] 678223 1322116 [object Preloader] 809295 1322116 [object Preloader] 1322116 1322116 [object Preloader] 1322116 1322116 [object Preloader] 1387652 1584342 [object Preloader] 1791882 1791882 [object Preloader] 2293133 2293133 [object Preloader] 2362938 2362938 [object Preloader] 2362938 2362938 [object Preloader] 2362938 2362938 Why does bytesTotal change during load?

    Read the article

  • Crystal Report with mutliple row columns.

    - by Jack
    I'm not sure if the title properly explains what I'm trying to do. I'm trying to move from using SQL Reporting Services to a Crystal Reports Web App. I've gotten some reports to design properly because they are simple cross-tab reports that require nothing special. I'm running into a little problem of a user matrix report. Here's how the report looks on SQL Reporting Services: group1 group2 group3 username1 first1 last1 title1 X X username2 first2 last2 title2 X X 2 1 1 Normally in VS2008 with a SQL rdl, I would right click on the row and Insert Column. However, i don't see a way to do this in Crystal Reports. I've tried setting up multiple row groups, but that adds mutliple groupings like: group1 Total ... Username Total ... first Total ... last ...

    Read the article

  • Pre approve expenditure batch in oracle apps project module

    - by nil
    hi to all i have to crete one pre approve expence batch when i crete batch and then go to india local payble (MHE) but when i run the request Expense Report Import Report then i got following out put hear some error Rejection Reason = no location so my problem is that where i have to define location please give me guidance for that Total Functional Currency Invoice Amount: 100.00 Elecon Engineering Co. Ltd. Expense Report Import Report 17-MAY-10 16:57 Page: 2 Source: Oracle Projects Exceptions Report Supplier Supplier Invoice Invoice Invoice Invoice Name Number Name Number Number Date Currency Amount Rejection Reason ------------ Megha, Nilesh M. 90054 XSAM R17-MAY-1 31-MAY-10 INR 400.00 No Location Megha, Nilesh M. 90054 XT2 R17-MAY-10 31-MAY-10 INR 100.00 No Location Total Expense Reports Rejected: 2 Total Functional Currency Invoice Amount: 500.00 Edited by: user12921822 on May 17, 2010 9:00 PM

    Read the article

  • refreshing javascript by renaming src attribute

    - by Eric Fortis
    I want to refresh the output of the script below. Is this json? Do I need to add a crossdomain policy in my site? <div id="nowplaying"> <script src="http://s4.total-streaming.com/xml.php?station=1269&get=js"></script> </div> Edit: This is what I'm trying based on @alexn advise, but still doesn't refresh. <div id="nowplaying"> <script id="nowplaying-script" src="http://s4.total-streaming.com/xml.php?station=1269&get=js"></script> <script> setInterval(function () { $('#nowplaying-script').attr('src', 'http://s4.total-streaming.com/xml.php?station=1269&get=js'); }, 1000); </script> </div> Note Firebug: Resource interpreted as script but transferred with MIME type text/html. xml.php:-1

    Read the article

  • Generator speed in python 3

    - by Will
    Hello all, I am going through a link about generators that someone posted. In the beginning he compares the two functions below. On his setup he showed a speed increase of 5% with the generator. I'm running windows XP, python 3.1.1, and cannot seem to duplicate the results. I keep showing the "old way"(logs1) as being slightly faster when tested with the provided logs and up to 1GB of duplicated data. Can someone help me understand whats happening differently? Thanks! def logs1(): wwwlog = open("big-access-log") total = 0 for line in wwwlog: bytestr = line.rsplit(None,1)[1] if bytestr != '-': total += int(bytestr) return total def logs2(): wwwlog = open("big-access-log") bytecolumn = (line.rsplit(None,1)[1] for line in wwwlog) getbytes = (int(x) for x in bytecolumn if x != '-') return sum(getbytes)

    Read the article

  • In MongoDB, how can I replicate this simple query using map/reduce in ruby?

    - by Matthew Rathbone
    Hi, So using the regular MongoDB library in Ruby I have the following query to find average filesize across a set of 5001 documents: avg = 0 total = collection.count() Rails.logger.info "#{total} asset creation stats in the system" collection.find().each {|row| avg += (row["filesize"] * (1/total.to_f)) if row["filesize"]} Its pretty simple, so I'm trying to do the same using map/reduce as a learning exercise. This is what I came up with: map = 'function(){emit("filesizes", {size: this.filesize, num: 1});}' reduce = 'function(k, vals){ var result = {size: 0, num: 0}; for(var x in vals) { var new_total = result.num + vals[x].num; result.num = new_total result.size = result.size + (vals[x].size * (vals[x].num / new_total)); } return result; }' @results = collection.map_reduce(map, reduce) However the two queries come back with two different results! What am I doing wrong?

    Read the article

  • Can this loop be sped up in pure Python?

    - by Noctis Skytower
    I was trying out an experiment with Python, trying to find out how many times it could add one to an integer in one minute's time. Assuming two computers are the same except for the speed of the CPUs, this should give an estimate of how fast some CPU operations may take for the computer in question. The code below is an example of a test designed to fulfill the requirements given above. This version is about 20% faster than the first attempt and 150% faster than the third attempt. Can anyone make any suggestions as to how to get the most additions in a minute's time span? Higher numbers are desireable. EDIT: This experiment is being written in Python 3.1 and is 15% faster than the fourth speed-up attempt. def start(seconds): import time, _thread def stop(seconds, signal): time.sleep(seconds) signal.pop() total, signal = 0, [None] _thread.start_new_thread(stop, (seconds, signal)) while signal: total += 1 return total if __name__ == '__main__': print('Testing the CPU speed ...') print('Relative speed:', start(60))

    Read the article

  • How do I introduce row names to a function in R

    - by Tahnoon Pasha
    Hi I have a utility function I've put together to insert rows into a dataframe below. If I was writing out the formula by hand I would put something like newframe=rbind(oldframe[1:rownum,],row_to_insert=row_to_insert,oldframe[(rownum+1:nrow(oldframe),] to name row_to_insert. Could someone tell me how to do this in a function? Thanks insertrows=function (x, y, rownum) { newframe = rbind(y[1:rownum, ], x, y[(rownum + 1):nrow(y), ]) return(data.frame(newframe)) } MWE of some underlying data added below financials=data.frame(sales=c(100,150,200,250),some.direct.costs=c(25,30,35,40),other.direct.costs=c(15,25,25,35),indirect.costs=c(40,45,45,50)) oldframe=t(financials) colnames(oldframe)=make.names(seq(2000,2003,1)) total.direct.costs=oldframe['some.direct.costs',]+oldframe['other.direct.costs',] newframe=total.direct.costs n=rownum=3 oldframe=insertrows(total.direct.costs=newframe,oldframe,n)

    Read the article

  • Sending url params and POST body to a MVC 2 Controller

    - by Luiggi
    Hi, I'm having some issues trying to make a HTTP PUT (or POST) using WebClient against a MVC 2 controller. The exception is: The parameters dictionary contains a null entry for parameter 'total' of non-nullable type 'System.Int32' for method 'System.Web.Mvc.ActionResult Company(System.Guid, Int32, Int32, System.String)' The controller action is: [HttpPut] public ActionResult Company(Guid uid, int id, int total, string url) The route is: routes.MapRoute( "CompanySet", "job/active/{uid}/company/{id}", new { controller = "Job", action = "Company" } ); As you may see, what I want is to send the 'uid' and 'id' parameters via url, but the 'total' and 'url' parameters as part of the PUT or POST body. I've also tried to merge the latter parameters into a class (i.e., CompanySetMessage), doing it no longer raises an exception but I dont receive the values on the server side. Any ideas? Thank you!

    Read the article

  • Adding Postgres table cells based on same value

    - by russell kinch
    I have a table called expenses. There are numerous columns but the ones involved in my php page are date, spplierinv, amount. I have created a page that lists all the expenses in a given month and totals it at the end. However, each row has a value, but many rows might be on the same supplier invoice.This means adding each row with the same supplierinv to get a total as per my bank statement. Is there anyway I can get a total for the rows based on the supplierinv. I mean say I have 10 rows. 5 on supplierinv 4, two on supplierinv 5 and 3 on supplierinv 12, how can a get 3 figures (inv 4, 5 and 12) and the grand total at the bottom. Many thanks

    Read the article

  • Saving a 'Date' using DataMapper on AppEngine+JRuby

    - by Ryan Montgomery
    I have a a model as follows: class Total include DataMapper::Resource property :id, Serial property :amount, Float, :default => 0.00 property :day, Date belongs_to :calendar end I am trying to select a specific Total from the data-store. class Calendar include DataMapper::Resource property :id, Serial property :name, String has n, :totals def get_total_for(date) return Total.first(:day => date, :calendar => self) end end When I call get_total_for(DateTime.now) I receive the following error on the call to the data-store. java.lang.IllegalArgumentException: day: org.jruby.RubyObject is not a supported property type. Is Date not allowed for usage in AppEngine? Is this a DataMapper issue? I have tried changing the name of the :day property to something else (hoping it was just a name conflict) but it doesn't seem to matter. Thanks for any help you can provide.

    Read the article

  • NP-complete problem in Prolog

    - by Ashley
    I saw this ECLiPSe solution to the problem mentioned in this XKCD comic. I tried to convert this to pure Prolog. go:- Total = 1505, Prices = [215, 275, 335, 355, 420, 580], length(Prices, N), length(Amounts, N), totalCost(Prices, Amounts, 0, Total), writeln(Total). totalCost([], [], TotalSoFar, TotalSoFar). totalCost([P|Prices], [A|Amounts], TotalSoFar, EndTotal):- between(0, 10, A), Cost is P*A, TotalSoFar1 is TotalSoFar + Cost, totalCost(Prices, Amounts, TotalSoFar1, EndTotal). I don't think that this is the best / most declarative solution that one can come up with. Does anyone have any suggestions for improvement? Thanks in advance!

    Read the article

  • PHP: find 2 or more numbers from a list of N numbers that can add up towards a given ammount

    - by Splash
    Hi Guys, I am trying to create a little php script that can make my life a bit easier. Basically, I am going to have 21 text fields on a page where I am going to input 20 different numbers. In the last field I will enter a number let's call it the TOTAL AMMOUNT. All I want the script to do is to point out which numbers from the 20 fields added up will come up to TOTAL AMMOUNT. Example: field1= 25.23 field2= 34.45 field3= 56.67 field4= 63.54 field5= 87.54 .... field20= 4.2 Total Ammount= 81.90 Output: field1+fields3=81.90 Some of the fields might have 0 as value because sometimes I only need to enter 5-15 fields and the maximum will be 20. If someone can help me out with the php code for this, will be greatly appreciated.

    Read the article

  • In this program(Java) I'm trying to make a dice roller. How do I make it so it rolls a bunch of times and adds the rolls?

    - by Mac
    import java.util.Random; public class dice { private int times; private int roll; private int side; Random roller = new Random(); public void setTimes(int sides) { times = sides; } public void setSides(int die) { side = die; } public int getRoll() //this is where the "rolling" happens { int total = 0; int c = 0; while (c <= times) { c = c + 1; int rol = 0; roll = roller.nextInt(side) + 1; rol = rol + roll; total = rol; } return total; } } If you need the GUIWindow and the main, just ask

    Read the article

  • Items are being replace by another in the Datagridview

    - by stephanie
    When I add the first item in the datagridview its ok but when i add the second one it replace the last item being added. here's my code Private Sub add() Dim i As Integer For i = 0 To DataGridView1.Rows.Count - 1 'DataGridView1.Rows.Add() DataGridView1.Rows(DataGridView1.RowCount - 1).Cells("TransID").Value = txttrans.Text DataGridView1.Rows(DataGridView1.RowCount - 1).Cells("ProductCode").Value = txtprodcode.Text DataGridView1.Rows(DataGridView1.RowCount - 1).Cells("ProductName").Value = cmbprodname.Text DataGridView1.Rows(DataGridView1.RowCount - 1).Cells("Quantity").Value = txtqty.Text DataGridView1.Rows(DataGridView1.RowCount - 1).Cells("Price").Value = txtprc.Text DataGridView1.Rows(DataGridView1.RowCount - 1).Cells("Amount").Value = txtat.Text DataGridView1.Rows(DataGridView1.RowCount - 1).Cells("CustomerName").Value = txtcust.Text DataGridView1.Rows(DataGridView1.RowCount - 1).Cells("Date1").Value = txtdate.Text Next i End Sub And this is in my ADDbutton: Private Sub btnadd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnadd.Click Try add() Catch ex As Exception MessageBox.Show(ex.Message) End Try Dim total As Integer For Each row As DataGridViewRow In DataGridView1.Rows total += row.Cells("Amount").Value Next txtamt.Text = total

    Read the article

  • What is an algorithm for minimizing some D distances between N items?

    - by Ross
    A classmate printed out a diagram of a database for class, the kind with lines representing relationships between tables. However, his lines crossed all over the place and it looked ugly. So I got to thinking about a way to move the tables to minimize the total line distance, and I couldn't think of a way to do it, other than just moving them all on top of each other. So basically: Given N items on some 2d coordinate space and some amount of connections between pairs of those items, how do you move the items so that the total distance between pairs is minimal, but that no distance is smaller than S? (so that the tables would not be too close together) Is there some algorithm for this? (I realize that smallest total distance won't necessarily make the layout less ugly; lines might still cross. But the table layout is just what got me thinking)

    Read the article

  • Number distribution

    - by Carra
    Problem: We have x checkboxes and we want to check y of them evenly. Example 1: select 50 checkboxes of 100 total. [-] [x] [-] [x] ... Example 2: select 33 checkboxes of 100 total. [-] [-] [x] [-] [-] [x] ... Example 3: select 66 checkboxes of 100 total: [-] [x] [x] [-] [x] [x] ... But we're having trouble to come up with a formula to check them in code, especially once you go 11/111 or something similar. Anyone has an idea?

    Read the article

  • adding two variables together

    - by James Trusler
    I have been trying for... about 4 hours now lmao. currentCalc returns 50 currentSum returns 0 when i alert them. Yet I cannot add them together with parseInt???? what am i doing wrong :'( var identRow = $('tr.identRow'); identRow.each( function(){ var getIdentClass = $(this).attr('class').split(' ').slice(1); $('tr.ohp' + getIdentClass + ' td.EURm').each( function(index){ var currentCalc = parseInt($(this).text().replace('.',''), 10); var currentSum = $('tr.' + getIdentClass + ' td.totalEURm', this).text().replace('.',''); total = parseInt(currentCalc, 10) + parseInt(currentSum, 10); $('tr.' + getIdentClass + ' td.totalEURm').text(total); if (index==6){ alert(total); } } ); } );

    Read the article

  • pyschool is wrong ?

    - by geekkid
    I'm currently learning python and trying to do exercises at pyschools (if anyone knows what it is). Anyway, i have an exercise that asks me to do the following : Write a function percent(value, total) that takes in two numbers as arguments, and returns the percentage value as an integer. Here's my code: def percent(value, total): percent = value / total * 100 return int(percent) It works great in my Python Idle and it gives all the correct answers. however, when i run it in the pyschools website, it says that , for example , when the function is called with parameters 46 and 90 , the function returns 0. However, in my python idle , it correctly returns 51. What might be the problem ? Thank you very much for your help!

    Read the article

  • Using pow() for large number

    - by g4ur4v
    I am trying to solve a problem, a part of which requires me to calculate (2^n)%1000000007 , where n<=10^9. But my following code gives me output "0" even for input like n=99. Is there anyway other than having a loop which multilplies the output by 2 every time and finding the modulo every time (this is not I am looking for as this will be very slow for large numbers). #include<stdio.h> #include<math.h> #include<iostream> using namespace std; int main() { unsigned long long gaps,total; while(1) { cin>>gaps; total=(unsigned long long)powf(2,gaps)%1000000007; cout<<total<<endl; } }

    Read the article

  • SUM of column with Left Outer Join

    - by Matt
    I am trying to get the Count of all records that have at least on person who is authorized on the record. Basically, a Record can have more than one person associated with it. I want to return the count of Total Records, a count of total Authorized Records where at least 1 person is authorized, and a count of total NotAuthorized records where no person associated with record is authorized. It doesn't matter if one person is authorized per Record or if 3 people are authorized for that record, that should add 1 to the Authorized counter. The current query is incrementing Auth and Non auth for each person added per record rather, than one per record. If no people are assigned to the record that should also count towards Not Auth. SELECT Count(DISTINCT Record.RecordID) AS TotalRecords, SUM(CASE WHEN People.PersonLevel = 1 THEN 1 ELSE 0 END) AS Authorized, SUM(CASE WHEN People.PersonLevel <> 1 THEN 1 ELSE 0 END) AS NotAuthorized FROM Record LEFT OUTER JOIN RecordPeople ON Record.RecordID = RecordPeople.RecordID LEFT OUTER JOIN People ON RecordPeople.PersonID = People.PersonID

    Read the article

  • otal Number of records required in paged grid

    - by sumitchauhan
    I am using a data grid and has bound a data source with it. I am trying to get the total number of records in the grid in overriden InitializePager method from pagedDataSource DataSourceCount. I thought DataSourceCount returns number of records from SelectCountMethod of ObjectDataSource. But DataSourceCount is giving me the page size and not the total number of records, whereas when I debug and see in SelectCountMethod it is returning correct number of total Records. I am not sure how to get the data from SelectCountMethod in DataGrid.

    Read the article

  • Creating DB views in Ruby on Rails

    - by Zigu
    Hey guys, I'm building a "reports" functionality to a project. 3 roles here: 1) Volunteers (they report what hours they volunteered) 2) Supervisors (they look at the reported stuff, note: one supervisor can view all projects) 3) Projects (Represents a work project that some collection of volunteers work on) To explain what it does: A report will be specified by the supervisor to generate based on a query of what he needs. These could be plausible reports: 1) The total number of volunteers, and the total amount of volunteer hours on this project 2) All the volunteer's names and emails associated with a project 3) The number of active projects vs. the total number of projects I was thinking maybe that creating a view in rails and storing the name of that view so Rails will just check the view whenever a supervisor wants to pull up the "report". Is a view really the answer or is it better to just save a query? Can Rails do this or is there an even better or more simple way of achieving this functionality? Cheers, -Jeremiah Tantongco

    Read the article

  • How to get REALLY fast python over a simple loop

    - by totallymike
    I'm working on a spoj problem, INTEST. The goal is to specify the number of test cases (n) and a divisor (k), then feed your program n numbers. The program will accept each number on a newline of stdin and after receiving the nth number, will tell you how many were divisible by k. The only challenge in this problem is getting your code to be FAST because it k can be anything up to 10^7 and the test cases can be as high as 10^9. I'm trying to write it in python and having trouble speeding it up. Any ideas? import sys first_in = raw_input() thing = first_in.split() n = int(thing[0]) k = int(thing[1]) total = 0 i = 0 for line in sys.stdin: t = int(line) if t % k == 0: total += 1 print total

    Read the article

< Previous Page | 49 50 51 52 53 54 55 56 57 58 59 60  | Next Page >