Search Results

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

Page 152/238 | < Previous Page | 148 149 150 151 152 153 154 155 156 157 158 159  | Next Page >

  • how to create a progress bar using php output buffering and jquery?

    - by avien
    how to create a progress bar using php output buffering and jquery? i been searching this for weeks, i am desperate to learn this, this is a very big help for me, is someone the here share some codes? i know the this will need to script. i have tried sereval code for my client side script: var request = new XMLHttpRequest(); request.addEventListener("progress", updateProgress, false); function updateProgress(e) { var percent = (e.loaded / e.total) * 100; /** update the with of the progress bar **/ } and to my server side, i dont know how. but actually i want to use this for a mysql query so that i can see the progress of my query and another thing is i dont know how to use output buffering. somebody help me on this please.

    Read the article

  • Open another application from your own (intent)

    - by AndersWid
    I know how to update my own programs, and I know how to open programs using the a predefined Uri (for sms or email for example) I need to know how I can create an Intent to open MyTracks or any other application that I don't know what intents they listen to. I got this info from DDMS, but I havn't been succesful in turning this to an Intent I can use. This is taken from when opening MyTracks manually. Thanks for your help 05-06 11:22:24.945: INFO/ActivityManager(76): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.google.android.maps.mytracks/com.google.android.apps.mytracks.MyTracks bnds=[243,338][317,417] } 05-06 11:22:25.005: INFO/ActivityManager(76): Start proc com.google.android.maps.mytracks for activity com.google.android.maps.mytracks/com.google.android.apps.mytracks.MyTracks: pid=1176 uid=10063 gids={3003, 1015} 05-06 11:22:26.995: INFO/ActivityManager(76): Displayed activity com.google.android.maps.mytracks/com.google.android.apps.mytracks.MyTracks: 1996 ms (total 1996 ms)

    Read the article

  • How can I find out how much memory an object of a C++ class consumes?

    - by Shadow
    Hi, I am developing a Graph-class, based on boost-graph-library. A Graph-object contains a boost-graph, so to say an adjacency_list, and a map. When monitoring the total memory usage of my program, it consumes quite a lot (checked with pmap). Now, I would like to know, how much of the memory is exactly consumed by a filled object of this Graph-class? With filled I mean when the adjacency_list is full of vertices and edges. I found out, that using sizeof() doesn't bring me far. Using valgrind is also not an alternative as there is quite some memory allocation done previously and this makes the usage of valgrind impractical for this purpose. I'm also not interested in what other parts of the program cost in memory, I want to focus on one single object. Thank you.

    Read the article

  • sqlite COUNT in flex returning [object Object]

    - by Adam
    I'm sure this is an easy questions and I'm just doing something stupid but I'm really new to all this code. I'm trying to run a sqlite query in flex to count the total number of records I believe its working fine but I just can't figure out how to display the results - all I get back is [object Object]. private function overviewOne():void{ var stmt:SQLStatement = new SQLStatement(); stmt.sqlConnection = sqlConn; stmt.text = "SELECT COUNT(user_id) FROM tbl_user WHERE status_status ='Away'"; stmt.execute(); var result:SQLResult = stmt.getResult(); acoverviewOne = new Array(result.data); trace (result.data[0]); }

    Read the article

  • Group by clause return latest row information

    - by I Like PHP
    below is my table structure table_movie_info i_movie_id |movie_actor_id |movie_actress_id |movie_director_id | movie_producer_id 48 | 5 | 9 | 66 | 21 48 | 6 | 15 | 88 | 22 48 | 7 | 12 | 77 | 23 one more table is table_movie movie_id | movie_year | movie_genre_id |movie_rating 1 | 2009 | 6 | 8 2 | 2001 | 5 | 7.5 48 | 2007 | 3 | 6.8 now i need total movie information using both table,i write below query SELECT * FROM table_movie_info LEFT JOIN table_movie ON movie_id = i_movie_id WHERE i_movie_id=48 GROUP BY i_movie_id above query return only one row , but i need such type of information movie_id=48, actors_id list=5,6,7 acttress_id list=9,15,12 etc.. please tell me the optimized query which h return complete information i need. thanks for helping me always.

    Read the article

  • Make a <div> square when there is a dynamically changing width based on percentage

    - by Nate
    I am working on a web app that will generate an NxN grid based on the user's selection of N. I want the total width of the grid to be relative (ie 100% of the available space) so that users can print on various paper sizes. I can easily calculate the width of the squares in the grid by % (ie: 100%/N), but I am having issues calculating the height. The height of a web page is always going to be infinite unless I artificially limit it which, like I said, I don't want to do. How can I make the squares in my grid be square versus rectangular when the height and width constraints of my grid are dynamic and not square? Thanks in advance!

    Read the article

  • Confused with objects in Ruby

    - by David
    Ruby Newbie here, I understand that everything is an object in Ruby, one thing that I wasn't sure about was understanding Variables. Variables basically give reference to objects (correct me if I'm wrong). During an instructional video, the teacher did a demonstration which went as below: (irb) a = 100 ==> 100 b = a ==> 100 b ==> 100 This part I get, makes total sense. Then he did a = 50 ==> 50 b ==> 100 If B is supposed to point to what a was set which was a 100, why does b still point to 100 if a has now been set as 50?

    Read the article

  • fetch some data from two tables

    - by user1753971
    i have site like imdb and we provide movie information sin site..and our website have option to rate all movies for every users. I have two tables 1 . imdb (its for store movie details) id,name,actors,vote 2. ratings (its for store users rating details) id,rating_id(its same as id from first table),rating_num,IP now what am doing is..when anyone rating a movie take the avg of that movie rating by using rating tables (total ratings/number of ratings) and insert that value into "vote" column in first table..my demands this..thats why done like this.. Now my problem is..i want to fetch top rated movies..i mean in vote column which movie have top rating which want to list and one more condition is that that movie should rated by 10 users(use ratings table for that) thanks in advance

    Read the article

  • Tallying records using annotate() not working as should.

    - by 47
    I have two classes: Vehicle and Issues....a Vehicle object can have several issues recorded in the Issues class. What I want to do is to have a list of all issues, with each vehicle appearing only once and the total number of issues shown, plus other details....clicking on the record will then take the user to another page with all those issues for a selected vehicle shown in detail now. I tried this out using annotate, but I could only access the count and vehicle foreign key, but none of the other fields in the Vehicle class. class Issues(models.Model): vehicle = models.ForeignKey(Vehicle) description = models.CharField('Issue Description', max_length=30,) type = models.CharField(max_length=10, default='Other') status = models.CharField(max_length=12, default='Pending') priority = models.IntegerField(default='8', editable=False) date_time_added = models.DateTimeField(default=datetime.today, editable=False) last_updated = models.DateTimeField(default=datetime.today, editable=False) def __unicode__(self): return self.description The code I was using to annotate is: issues = Issues.objects.all().values('vehicle').annotate(count=Count('id')) What could be the problem?

    Read the article

  • I need to count the lines from matching config file entries, preferably with 'grep'.

    - by Chris
    I have a configuration file that has entries for various devices, with each entry separated by a blank line. I need to search the file for all instances of a given device type, and count the number of non-blank lines following the occurrence, stopping at the first blank. For example: Server=foo config line 1 config line 2 config line 3 Server=bar config line 1 config line 2 Server=foo config line 1 If I wanted to know how many total "config lines" were associated with server "foo", I should get four. Can you please help?

    Read the article

  • Pagination using Ajax in jquery Datatables

    - by kshtjsnghl
    I am using dataTables plugin for a table on a page I am working on. Its basically fetching rows through an ajax call and in this ajax call, I send the search params that the user selects and the page number required. I need the Next, Previous, First and Last buttons to also fire the same ajax call, but with different page numbers, as the back-end interceptor depends on the page number. This api call would return total no. of rows(say 1000) belonging for these search params and the rows with the page size( say 50). Is there any way, I can use data table to do this?

    Read the article

  • Results from two queries at once in sqlite?

    - by SF.
    I'm currently trying to optimize the sluggish process of retrieving a page of log entries from the SQLite database. I noticed I almost always retrieve next entries along with count of available entries: SELECT time, level, type, text FROM Logs WHERE level IN (%s) ORDER BY time DESC, id DESC LIMIT LOG_REQ_LINES OFFSET %d* LOG_REQ_LINES ; together with total count of records that can match current query: SELECT count(*) FROM Logs WHERE level IN (%s); (for a display "page n of m") I wonder, if I could concatenate the two queries, and ask them both in one sqlite3_exec() simply concatenating the query string. How should my callback function look then? Can I distinguish between the different types of data by argc? What other optimizations would you suggest?

    Read the article

  • mysql stored routine vs. mysql-alternative?

    - by user522962
    We are using a mysql database w/ about 150,000 records (names) total. Our searches on the 'names' field is done through an autocomplete function in php. We have the table indexed but still feel that the searching is a bit sluggish (a few full seconds vs. something like Google Finance w/ near-instant response). We came up w/ 2 possibilities, but wanted to get more insight: Can we create a bunch (many thousands or more) of stored procedures to speed up searches, or will creating that many stored procedures bog-down the db? Is there a faster alternative to mysql for "select" statements (speed on inserting & updating rows isn't too important so we can sacrifice that, if necessary). I've vaguely heard of BigTable & others that don't support JOIN statements....we need JOIN statements for some of our other queries we do. thx

    Read the article

  • C Newbie, ascii control function

    - by user570607
    Hey there, I have written a program that works well in C that converts non-readable ASCII to their character values. I would appreciate if a C master? would show me a better way of doing it that I have currently done, mainly this section: if (isascii(ch)) { switch (ch) { case 0: printControl("NUL"); break; case 1: printControl("SOH"); break; .. etc (32 in total) case default: putchar(ch); break; } } Is it normal to make a switch that big? Or should I be using some other method (input from an ascii table?)

    Read the article

  • php script to generate checksum from md5

    - by sumit
    In order to calculate the checksum i need following things. these parameters are concatenated in a constant (no spaces) string made up of the values of the following parameters in the exact order listed below: o Secret Key o Merchant id o Currency o Total amount o Item list (item_name_1, Item_amount_1, item_quantity_1 to item_name_N, Item_amount_N, item_quantity_N) o Timestamp e.g In that case the string befor hash will be: pLAZdfhdfdNh57583USD69.99Tier2 item69.9912010-06-14.14:34:33 And using the MD5 hash function the result is: ghvsaf764t3w784tbjkegbjhdbgf i want to know how can i create a php script that will call md5 hash function with the inputs given above and based on that it will generate the hash function value that will be the checksum value for my coding..

    Read the article

  • find users that are following other users

    - by Jakob
    Hi I'm wondering how I can go about this problem I have a DB with a Users Table, and a Followers table. The Followers table contains 2 Columns "FollowerID" and "FollowedID" I have a 1 - * relation in my datamodel between Users.ID -> Followers.FollowerID and Users.ID -> FollowedID How do I in LINQ get a set of users that are following a specific user? I'll express what I'm trying to achieve programatically I can get this far: ctx.Followers.Where(f => f.FollowedID == CurrentUser.ID) so now i have a Followers set where I have the ID of the users that follow the CurrentUser, and I could iterate through this collection and then add users after each iteration to a collection that would be a total USER collection that followed CurrentUser, but isn't there a smarter, or LINQ'er way to do this? Much appreciated Thx

    Read the article

  • Strange profiler behavior: same functions, different performances

    - by arthurprs
    I was learning to use gprof and then i got weird results for this code: int one(int a, int b) { return a / (b + 1); } int two(int a, int b) { return a / (b + 1); } int main() { for (int i = 1; i < 30000000; i++) { two(i, i * 2); one(i, i * 2); } return 0; } and this is the profiler output % cumulative self self total time seconds seconds calls ns/call ns/call name 48.39 0.90 0.90 29999999 30.00 30.00 one(int, int) 40.86 1.66 0.76 29999999 25.33 25.33 two(int, int) 10.75 1.86 0.20 main If i call one then two the result is the inverse, two takes more time than one both are the same functions, but the first calls always take less time then the second Why is that? Note: The assembly code is exactly the same and code is being compiled with no optimizations

    Read the article

  • How much RAM used by Python dict or list?

    - by Who8MyLunch
    My problem: I am writing a simple Python tool to help me visualize my data as a function of many parameters. Each change in parameters involves a non-trivial amount of time, so I would like to cache each step's resulting imagery and supporting data in a dictionary. But then I worry that this dictionary could grow too large over time. Most of my data is in the form of Numpy arrays. My question: How would one go about computing the total number of bytes used by a Python dictionary. The dictionary itself may contain lists and other dictionaries, each of which contain data stored in Numpy arrays. Ideas?

    Read the article

  • Refreshing a echoed PHP variable after jQuery AJAX success?

    - by Matt
    Hello, I have a shopping cart in Codeigniter in which products are added to the cart using (jQuery) Ajax. In the header of each page it displays the number of contents in the cart using <?php echo $this->cart->total_items(); ?> How can I update/refresh this variable when a product is added to the cart, as I am using AJAX to add products to the cart and thus the page isn't being reloaded when products are added. It seems pointless to use AJAX to do asyncronous stuff if I have to reload the page to get the new number of total items from the server. Many thanks.

    Read the article

  • Passing a multi-line string as an argument to a script in Windows

    - by Zack Mulgrew
    I have a simple python script like so: import sys lines = sys.argv[1] for line in lines.splitlines(): print line I want to call it from the command line (or a .bat file) but the first argument may (and probably will) be a string with multiple lines in it. How does one do this? Of course, this works: import sys lines = """This is a string It has multiple lines there are three total""" for line in lines.splitlines(): print line But I need to be able to process an argument line-by-line. EDIT: This is probably more of a Windows command-line problem than a Python problem. EDIT 2: Thanks for all of the good suggestions. It doesn't look like it's possible. I can't use another shell because I'm actually trying to invoke the script from another program which seems to use the Windows command-line behind the scenes.

    Read the article

  • from JS to iphone dev - what's the best language to start with?

    - by Enkai
    I am a total beginner and would like to eventually learn to develop for the iphone. I have just done a beginner's CS course where the language we learned was JavaScript. We studied basic concepts like: variables, arrays, loops (for,while,if,if..else..), properties and functions. I'm wondering if I am starting in the right/wrong place by following this book: Learn C on the Mac by Dave Mark? I have read a few chapters and am finding it a bit hard to get my head around the way that C works, for example the way that Strings are printed seems overly complicated as compared to JS. Do you think that JS was the wrong language to start off with and would I be better to go from JS straight to Objective-C rather than to C? I have tried to read up on previous threads on the merits/demerits of learning C first but haven't found any that relate JS to learning C/Obj C/ Cocoa. Any advice appreciated as I am very new to this. Thanks

    Read the article

  • Elegant way to aggregate multi-dimensional array by index key

    - by Stephen J. Fuhry
    How can I recursively find the total value of all children of an array that looks something like this? [0] => Array ( [value] => ? // 8590.25 + 200.5 + 22.4 [children] => Array ( [0] => Array ( [value] => ? // 8590.25 + 200.5 [children] => Array ( [0] => Array ( [value] => 8590.25 // leaf node ) [1] => Array ( [value] => 200.05 // leaf node ) ) ) [1] => Array ( [value] => 22.4 // leaf node ) ) )

    Read the article

  • app engine's back referencing is too slow. How can I make it faster?

    - by Ray Yun
    Google app engine has smart feature named back references and I usually iterate them where the traditional SQL's computed column need to be used. Just imagine that need to accumulate specific force's total hp. class Force(db.Model): hp = db.IntegerProperty() class UnitGroup(db.Model): force = db.ReferenceProperty(reference_class=Force,collection_name="groups") hp = db.IntegerProperty() class Unit(db.Model): group = db.ReferenceProperty(reference_class=UnitGroup,collection_name="units") hp = db.IntegerProperty() When I code like following, it was horribly slow (almost 3s) with 20 forces with single group - single unit. (I guess back-referencing force reload sub entities. Am I right?) def get_hp(self): hp = 0 for group in self.groups: group_hp = 0 for unit in group.units: group_hp += unit.hp hp += group_hp return hp How can I optimize this code? Please consider that there are more properties should be computed for each force/unit-groups and I don't want to save these collective properties to each entities. :)

    Read the article

  • Importing data from a text file using python

    - by Will
    I have a text file containing data in rows and columns (~17000 rows in total). Each column is a uniform number of characters long, with the 'unused' characters filled in by spaces. For example, the first column is 11 characters long, but the last four characters in that column are always spaces (so that it appears to be a nice column when viewed with a text editor). Sometimes it's more than four if the entry is less than 7 characters. The columns are not otherwise separated by commas, tabs, or spaces. They are also not all the same number of characters (the first two are 11, the next two are 8 and the last one is 5 - but again, some are spaces). What I want to do is import the entires (which are numbers) in the last two columns if the second column contains the string 'OW' somewhere in it. Any help would be greatly appreciated.

    Read the article

  • question on find value in array

    - by davit-datuashvili
    i have seen a few days ago such problem there is given two array find elements which are common of these array one of the solution was sort big array and then use binary search algorithm and also there is another algorithm- brute-force algorithm for (int i=0;i<array1.length;i++){ for (int j=0;j<array2.length;j++){ if (array1[i]==array2[j]){ //code here } } it's complexity is O(array1.length*array2.length); and i am interested the first method's complexity is also same yes? because we should sort array first and then use search method binary search algorithm's complexity is log_2(n) so it means that total time will be array.length*log_2(n) and about sort? please explain me which is better

    Read the article

< Previous Page | 148 149 150 151 152 153 154 155 156 157 158 159  | Next Page >