Search Results

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

Page 199/238 | < Previous Page | 195 196 197 198 199 200 201 202 203 204 205 206  | Next Page >

  • drawing graphs in php

    - by user434885
    i am using php to generate graphs from arrays. I wish to create multiple graphs on the same page as i need to design a summary report from answers extracted from a database. Currently i am using this code and am only able to get one single graph. what additions to the code do i need to make to get multiple graphs? <?php function draw_graph($values) { // Get the total number of columns we are going to plot $columns = count($values); // Get the height and width of the final image $width = 300; $height = 200; // Set the amount of space between each column $padding = 5; // Get the width of 1 column $column_width = $width / $columns ; // Generate the image variables $im = imagecreate($width,$height); $gray = imagecolorallocate ($im,0xcc,0xcc,0xcc); $gray_lite = imagecolorallocate ($im,0xee,0xee,0xee); $gray_dark = imagecolorallocate ($im,0x7f,0x7f,0x7f); $white = imagecolorallocate ($im,0xff,0xff,0xff); // Fill in the background of the image imagefilledrectangle($im,0,0,$width,$height,$white); $maxv = 0; // Calculate the maximum value we are going to plot for($i=0;$i<$columns;$i++)$maxv = max($values[$i],$maxv); // Now plot each column for($i=0;$i<$columns;$i++) { $column_height = ($height / 100) * (( $values[$i] / $maxv) *100); $x1 = $i*$column_width; $y1 = $height-$column_height; $x2 = (($i+1)*$column_width)-$padding; $y2 = $height; imagefilledrectangle($im,$x1,$y1,$x2,$y2,$gray_dark); } header ("Content-type: image/png"); imagepng($im); imagedestroy($im); } $values = array("23","32","35","57","12"); $values2 = array("123","232","335","157","102"); draw_graph($values2); draw_graph($values);//no output is coming draw_graph($values2);//no output is coming draw_graph($values);//no output is coming ?>

    Read the article

  • Memory mapping of files and system cache behavior in WinXP

    - by Canopus
    Our application is memory intensive and deals with reading a large number of disk files. The total load can be more than 3 GB. There is a custom memory manager that uses memory mapped files to achieve reading of such a huge data. The files are mapped into the process memory space only when needed and with this the process memory is well under control. But what is observed is, with memory mapping, the system cache keeps on increasing until it occupies the available physical memory. This leads to the slowing down of the entire system. My question is how to prevent system cache from hogging the physical memory? I attempted to remove the file buffering (by using FILE_FLAG_NO_BUFFERING ), but with this, the read operations take considerable amount of time and slows down the application performance. How to achieve the scalability without sacrificing much on performance. What are the common techniques used in such cases? I dont have a good understanding of the WinXP OS caching behavior. Any good links explaining the same would also be helpful.

    Read the article

  • Please Help to locate the error

    - by jagdeep
    using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; public partial class expt2 : System.Web.UI.Page { double result ; protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) result = 0.0; protected void Chkbxbd_CheckedChanged(object sender, EventArgs e) { if (Chkbxbd.Checked) { txtbxttl.Text = "" + 10000; result += double.Parse(txtbxttl.Text); } else result = result - 10000; } protected void Chkbxsfa_CheckedChanged(object sender, EventArgs e) { if (Chkbxsfa.Checked) { txtbxttl.Text = "" + 15000; result += double.Parse(txtbxttl.Text); } else result = result - 15000; } protected void btnttl_Click(object sender, EventArgs e) { txtbxttl.Text = "" + result; } } In this code the individual value for checkbox is ok but when the total is made it becomes 0. Please help me to fix it.

    Read the article

  • jQuery/Ajax IE7 - Long requests fail

    - by iQ
    Hi guys, I have a problem with IE7 regarding an ajax call that is made by jQuery.load function. Basically the request works in cases where the URL string is not too long, but as soon as the URL gets very large it fails. Doing some debugging on the Ajax call I found this error: URL: <blanked out security reasons but it's very long> Content Type: Headers size (bytes): 0 Data size (bytes): 0 Total size (bytes): 0 Transferred data size (bytes): 0 Cached data: No Error result: 0x800c0005 Error constant: INET_E_RESOURCE_NOT_FOUND Error description: The server or proxy was not found Extended error result: 0x7a Extended error description: The data area passed to a system call is too small. As you can see, it looks like nothing is being sent. Now this only happens on IE7 but not other browsers, with IE8 there is a small delay but still works. The same request works fine when the URL string is relatively small. Now I need this working on IE7 for compatibility reasons and I cannot find workarounds for this so any help is greatly appreciated. The actual ajax call is like this: $("ID").load("url?lotsofparams",callbac func(){}); "lotsofparams" can vary, sometimes being small or very large. It's when the string is very large that I get the above error for IE7 only.

    Read the article

  • Quickly accessing files in a 'project'

    - by bbbscarter
    Hi all. I'm looking for a way to quickly open files in my project's source tree. What I've been doing so far is adding files to the file-name-cache like so: (file-cache-add-directory-recursively (concat project-root "some/sub/folder") ".*\\.\\(py\\)$") after which I can use anything-for-files to access any file in the source tree with about 4 keystrokes. Unfortunately, this solution started falling over today. I've added another folder to the cache and emacs has started running out of memory. What's weird is that this folder contains less than 25% of files I'm adding, and yet emacs memory use goes up from 20mb to 400mb on adding just this folder. The total number of files is around 2000, so this memory use seems very high. Presumably I'm abusing the file cache. Anyway, what do other people do for this? I like this solution for its simplicity and speed; I've looked at some of the many, many project management packages for emacs and none of them really grabbed me... Thanks in advance! Simon

    Read the article

  • Further filter SQL results

    - by eric
    I've got a query that returns a proper result set, using SQL 2005. It is as follows: select case when convert(varchar(4),datepart(yyyy,bug.datecreated),101)+ ' Q' +convert(varchar(2),datepart(qq,bug.datecreated),101) = '1969 Q4' then '2009 Q2' else convert(varchar(4),datepart(yyyy,bug.datecreated),101)+ ' Q' +convert(varchar(2),datepart(qq,bug.datecreated),101) end as [Quarter], bugtypes.bugtypename, count(bug.bugid) as [Total] from bug left outer join bugtypes on bug.crntbugtypeid = bugtypes.bugtypeid and bug.projectid = bugtypes.projectid where (bug.projectid = 44 and bug.currentowner in (-1000000031,-1000000045) and bug.crntplatformid in (42,37,25,14)) or (bug.projectid = 44 and bug.currentowner in (select memberid from groupmembers where projectid = 44 and groupid in (87,88)) and bug.crntplatformid in (42,37,25,14)) group by case when convert(varchar(4),datepart(yyyy,bug.datecreated),101)+ ' Q' +convert(varchar(2),datepart(qq,bug.datecreated),101) = '1969 Q4' then '2009 Q2' else convert(varchar(4),datepart(yyyy,bug.datecreated),101)+ ' Q' +convert(varchar(2),datepart(qq,bug.datecreated),101) end, bugtypes.bugtypename order by 1,3 desc It produces a nicely grouped list of years and quarters, an associated descriptor, and a count of incidents in descending count order. What I'd like to do is further filter this so it shows only the 10 most submitted incidents per quarter. What I'm struggling with is how to take this result set and achieve that.

    Read the article

  • Reading input files in FORTRAN

    - by lollygagger
    Purpose: Create a program that takes two separate files, opens and reads them, assigns their contents to arrays, do some math with those arrays, create a new array with product numbers, print to a new file. Simple enough right? My input files have comment characters at the beginning. One trouble is, they are '#' which are comment characters for most plotting programs, but not FORTRAN. What is a simple way to tell the computer not to look at these characters? Since I have no previous FORTRAN experience, I am plowing through this with two test files. Here is what I have so far: PROGRAM gain IMPLICIT NONE REAL, DIMENSION (1:4, 1:8) :: X, Y, Z OPEN(1, FILE='test.out', & STATUS='OLD', ACTION='READ') ! opens the first file READ(1,*), X OPEN(2, FILE='test2.out', & STATUS='OLD', ACTION='READ') ! opens the second file READ(2,*), Y PRINT*, X, Y Z = X*Y ! PRINT*, Z OPEN(3, FILE='test3.out', STATUS='NEW', ACTION='WRITE') !creates a new file WRITE(3,*), Z CLOSE(1) CLOSE(2) CLOSE(3) END PROGRAM PS. Please do not overwhelm me with a bunch of code monkey gobblety gook. I am a total programming novice. I do not understand all the lingo, that is why I came here instead of searching for help in existing websites. Thanks.

    Read the article

  • How to calculate the current index?

    - by niko
    Hi, I have written an algorithm which iteratively solves the problem. The first iteration consists of 6 steps and all the following iterations consist of 5 steps (first step is skipped). What I want to calculate is the current (local) step in the iteration from current global step. For example if there are 41 steps in total which means there are 8 iterations: indices from 1 to 6 belong to 1st iteration indices from 7 to 11 belong to second iteration ... For calculating the current iteration I have written the following code: if(currentStep <= 6) iteration = 1; else iteration = floor((currentStep - 7)/5) + 2; end The problem remains in calculating local steps. in first iteration the performed steps are: 1, 2, 3, 4, 5, 6 in all the following iterations the performing steps are 2, 3, 4, 5, 6 So what has to be done is to transform the array of global steps [1 2 3 4 5 6 7 8 9 10 11 12 13 ... 41] into array of local steps [1 2 3 4 5 6 2 3 4 5 6 2 3 ... 6]. I would appreciate if anyone could help in finding the solution to a given problem. Thank you!

    Read the article

  • NULL pointer dereference in swiotlb_unmap_sg_attrs() on disk IO

    - by Inductiveload
    I'm getting an error I really don't understand when reading or writing files using a PCIe block device driver. I seem to be hitting an issue in swiotlb_unmap_sg_attrs(), which appears to be doing a NULL dereference of the sg pointer, but I don't know where this is coming from, as the only scatterlist I use myself is allocated as part of the device info structure and persists as long as the driver does. There is a stacktrace to go with the problem. It tends to vary a bit in exact details, but it always crashes in swiotlb_unmap_sq_attrs(). I think it's likely I have a locking issue, as I am not sure how to handle the locks around the IO functions. The lock is already held when the request function is called, I release it before the IO functions themselves are called, as they need an (MSI) IRQ to complete. The IRQ handler updates a "status" value, which the IO function is waiting for. When the IO function returns, I then take the lock back up and return to request queue handling. The crash happens in blk_fetch_request() during the following: if (!__blk_end_request(req, res, bytes)){ printk(KERN_ERR "%s next request\n", DRIVER_NAME); req = blk_fetch_request(q); } else { printk(KERN_ERR "%s same request\n", DRIVER_NAME); } where bytes is updated by the request handler to be the total length of IO (summed length of each scatter-gather segment).

    Read the article

  • Paging using Linq-To-Sql based on two parameters in asp.net mvc...

    - by Pandiya Chendur
    As two parameters i say currentPage and pagesize .....I thus far used sql server stored procedures and implemented paging like this, GO ALTER PROCEDURE [dbo].[GetMaterialsInView] -- Add the parameters for the stored procedure here @CurrentPage INT, @PageSize INT AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; SELECT *,ROW_NUMBER() OVER (ORDER BY Id) AS Row FROM ( SELECT *,ROW_NUMBER() OVER (ORDER BY Id) AS Row FROM InTimePagingView ) AS InTimePages WHERE Row >= (@CurrentPage - 1) * @PageSize + 1 AND Row <= @CurrentPage*@PageSize SELECT COUNT(*) as TotalCount FROM InTimePagingView SELECT CEILING(COUNT(*) / CAST(@PageSize AS FLOAT)) NumberOfPages FROM InTimePagingView END Now i am using Linq-to-sql and i use this, public IQueryable<MaterialsObj> FindAllMaterials() { var materials = from m in db.Materials join Mt in db.MeasurementTypes on m.MeasurementTypeId equals Mt.Id where m.Is_Deleted == 0 select new MaterialsObj() { Id = Convert.ToInt64(m.Mat_id), Mat_Name = m.Mat_Name, Mes_Name = Mt.Name, }; return materials; } Now i want to return the records,TotalCount where i use Total count to generate pagenumbers..... Is this possible... Any suggestion... EDIT: Just found this... NorthWindDataContext db = new NorthWindDataContext(); var query = from c in db.Customers select c.CompanyName; //Assuming Page Number = 2, Page Size = 10 int iPageNum = 2; int iPageSize = 10; var PagedData = query.Skip((iPageNum - 1) * iPageSize).Take(iPageSize); ObjectDumper.Write(PagedData);

    Read the article

  • (How) Can I approximate a "dynamic" index (key extractor) for Boost MultiIndex?

    - by Sarah
    I have a MultiIndex container of boost::shared_ptrs to members of class Host. These members contain private arrays bool infections[NUM_SEROTYPES] revealing Hosts' infection statuses with respect to each of 1,...,NUM_SEROTYPES serotypes. I want to be able to determine at any time in the simulation the number of people infected with a given serotype, but I'm not sure how: Ideally, Boost MultiIndex would allow me to sort, for example, by Host::isInfected( int s ), where s is the serotype of interest. From what I understand, MultiIndex key extractors aren't allowed to take arguments. An alternative would be to define an index for each serotype, but I don't see how to write the MultiIndex container typedef ... in such an extensible way. I will be changing the number of serotypes between simulations. (Do experienced programmers think this should be possible? I'll attempt it if so.) There are 2^(NUM_SEROTYPES) possible infection statuses. For small numbers of serotypes, I could use a single index based on this number (or a binary string) and come up with some mapping from this key to actual infection status. Counting is still darn slow. I could maintain a separate structure counting the total numbers of infecteds with each serotype. The synchrony is a bit of a pain, but the memory is fine. I would prefer a slicker option, since I would like to do further sorts on other host attributes (e.g., after counting the number infected with serotype s, count the number of those infected who are also in a particular household and have a particular age). Thanks in advance.

    Read the article

  • Twitter friends timeline not returning full history

    - by twofivesevenzero
    I am using twitter4J to get a user's friends timeline, but it is not returning the full available history. I know there are pagination limits (200 per request and 3200 total as per http://bit.ly/ck8ysq) and I am well within those. I make a request like so: private static final int MAX_COUNT = 200; private List<Status> getAllStatuses(long sinceID) throws TwitterException { Twitter twitter = new Twitter(username, password); List<Status> friendsTimelineList = new ArrayList<Status>(); List<Status> tempList; int page = 0; do { page++; tempList = twitter.getFriendsTimeline( new Paging(page, MAX_COUNT, sinceID)); if(tempList == null ) break; friendsTimelineList.addAll(tempList); } while(true); return friendsTimelineList; } This results in only 423 statuses being returned across 3 pages. Any idea why this might be happening?

    Read the article

  • I want to build a Google-friendly web app, where should I start?

    - by ronii
    I have only very basic experience with HTML/CSS and have quite a bit of experience with testing software and web apps from a consumer perspective. I'd love to launch a web application that plays nicely with Google services, similar to some of the apps you'd find on the Google Apps Marketplace, such as ManyMoon, time to note, Socialwok, etc. I'm a huge Google fan and would like to build something that's well integrated with other Google services. If you were a total beginner and wanted to build a complex app like one of examples above (project management, CRM, etc), where would you start? If you worked your ass off 18 hours a day, 24/7, how fast could you do it? I've dabbled into various languages and development frameworks, and read about which apps are using what languages but it's hard to figure out what would be most beneficial to jump into. Ruby on Rails, PHP, Google Web Toolkit, AppEngine. The list goes on and on. I want to be able to build and launch my own scalable web app. Thanks.

    Read the article

  • Simple aggregating query very slow in PostgreSql, any way to improve?

    - by Ash
    HI I have a table which holds files and their types such as CREATE TABLE files ( id SERIAL PRIMARY KEY, name VARCHAR(255), filetype VARCHAR(255), ... ); and another table for holding file properties such as CREATE TABLE properties ( id SERIAL PRIMARY KEY, file_id INTEGER CONSTRAINT fk_files REFERENCES files(id), size INTEGER, ... // other property fields ); The file_id field has an index. The file table has around 800k lines, and the properties table around 200k (not all files necessarily have/need a properties). I want to do aggregating queries, for example find the average size and standard deviation for all file types. But it's very slow - around 70 seconds for the latter query. I understand it needs a sequential scan, but still it seems too much. Here's the query SELECT f.filetype, avg(size), stddev(size) FROM files as f, properties as pr WHERE f.id = pr.file_id GROUP BY f.filetype; and the explain HashAggregate (cost=140292.20..140293.94 rows=116 width=13) (actual time=74013.621..74013.954 rows=110 loops=1) -> Hash Join (cost=6780.19..138945.47 rows=179564 width=13) (actual time=1520.104..73156.531 rows=179499 loops=1) Hash Cond: (f.id = pr.file_id) -> Seq Scan on files f (cost=0.00..108365.41 rows=1140941 width=9) (actual time=0.998..62569.628 rows=805270 loops=1) -> Hash (cost=3658.64..3658.64 rows=179564 width=12) (actual time=1131.053..1131.053 rows=179499 loops=1) -> Seq Scan on properties pr (cost=0.00..3658.64 rows=179564 width=12) (actual time=0.753..557.171 rows=179574 loops=1) Total runtime: 74014.520 ms Any ideas why it is so slow/how to make it faster?

    Read the article

  • How to add or remove a value inside a table cell on selection / de-selection of checkbox of that row, trying to submit the value via Jquery?

    - by Raul
    Here is the table: <%= form_tag '', :id => "costs" do %> <table class="table table-bordered" id="service_cost"> <% @services.each do |service| %> <tbody> <tr> <td><%= check_box_tag :open_service, {}, false, :class => 'checkable' %></td> <td><%= service.phone %></td> <td><%= service.internet %></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td><%= service.house_keeping %> </td> <td>0.0 </td> <td><%= service.laundry %></td> <td><%= text_field_tag "service_cost", service.total, :class => "input-small" %></td> </tr> <% end %> when the form gets submitted, the javascript gets into action: $("#costs").submit(function(){ formData=$("#costs").serializeArray(); processFormData(formData) return false; }); This ensures form submission on selecting the checkbox: $('.checkable').live('change', function() { $(this).parents('form:first').submit(); }); But, what I am looking for is adding or removing a cell value based on checkbox selection/de-selection and submitting it, kindly suggest a way to do it.

    Read the article

  • Get info from multiple files, match it and then display to end user, what is fastest?

    - by Patrick
    Hi, I need to build a website where we display data that is refreshed every 5minutes in a text file with a | separator. I currently use Java to do this. What I do now: I grab the textfile for every request through the website and process it and then display the data to the end user, this works fine, since Java can go through like 5000 lines of data fast, and when I filter it it is still extremely fast. However now the management wants the following: They added 3 textfiles with the | separator to it, and now want me to also read those files and match the information on certain fields, and if there is a match also display that information to the end user. I think soon enough, although Java is fast, I will run into trouble when 10 people want that information and I have to run through 4 total files matching the information. What can I do to make this process super fast? My Creative solutions so far: -Leave it this way, since Java is fast and end users can wait (probably less then 1second) -Have a background process that dumps new data into a MySQL database every 5minutes, since databases are extremely good at getting the same data from multiple tables. Thank you!

    Read the article

  • Is it possible to create multi-tiered WHERE statements in mySQL

    - by Brendan
    I'm currently developing a program that will generate reports based upon lead data. My issue is that I'm running 3 queries for something that I would like to only have to run one query for. For instance, I want to gather data for leads generated in the past day submission_date > (NOW() - INTERVAL 1 DAY) and I would like to find out how many total leads there were, and how many sold leads there were in that timeframe. (sold=1 / sold=0). The issue comes with the fact that this query is currently being done with 2 queries, one with WHEREsold= 1 and one with WHEREsold= 0. This is all well and good, but when I want to generate this data for the past day,week,month,year,and all time I will have to run 10 queries to obtain this data. I feel like there HAS to be a more efficient way of doing this. I know I can create a mySQL function for this, but I don't see how this could solve the problem. Thanks!!

    Read the article

  • Why does this code leak? (simple codesnippet)

    - by Ela782
    Visual Studio shows me several leaks (a few hundred lines), in total more than a few MB. I traced it down to the following "helloWorld example". The leak disappears if I comment out the H5::DataSet.getSpace() line. #include "stdafx.h" #include <iostream> #include "cpp/H5Cpp.h" int main(int argc, char *argv[]) { _CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF ); // dump leaks at return H5::H5File myfile; try { myfile = H5::H5File("C:\\Users\\yyy\\myfile.h5", H5F_ACC_RDONLY); } catch (H5::Exception& e) { std::string msg( std::string( "Could not open HDF5 file.\n" ) + e.getCDetailMsg() ); throw msg; } H5::Group myGroup = myfile.openGroup("/so/me/group"); H5::DataSet myDS = myGroup.openDataSet("./myfloatvec"); hsize_t dims[1]; //myDS.getSpace().getSimpleExtentDims(dims, NULL); // <-- here's the leak H5::DataSpace dsp = myDS.getSpace(); // The H5::DataSpace seems to leak dsp.getSimpleExtentDims(dims, NULL); //dsp.close(); // <-- doesn't help either std::cout << "Dims: " << dims[0] << std::endl; // <-- Works as expected return 0; } Any help would be appreciated. I've been on this for hours, I hate unclean code...

    Read the article

  • Isotope.js help: Changing item image after sorting

    - by user3643081
    This is a general question on how to go about building a project I have in mind, and the best way to set off on the right foot. I am fairly new to JS, please be gentle. I want to use isotope.js (or a similar script) to display a page with multiple items (about 30 different plants found in a garden) and the ability to sort them by seasons of the year + "what is most beautiful now" + and "view all" (a total of 6 categories) . On load, or when sorted by either "what is beautiful now" or "view all", I need each item to reflect the image of the current season we are in. When sorted by season, I need those "current" images to switch over to a designated seasonal image of that plant. Therefore, each sortable item will ultimately have 4 different versions with 4 different images in the background ready to surface when plants are sorted. (perhaps 5 if it makes more sense to have a "current" version besides the 4 seasonal versions.) My question: what approach can I take to achieve this effect in a manageable way? Can isotope apply a class to items sorted? Assuming it can: Should each item have 4 inline images, each with a css class, that I then control by using display:inline; and display:none; properties from my stylesheets? (I worry that this approach would significantly increase load times) Would it make more sense to create a blank dummy div who's background I control similarly to the example above -relying mostly on CSS. Or is there some other way involving JS I am overlooking? Any help would be appreciated. Examples of what you suggest would be immensely helpful.

    Read the article

  • multiple inheritance

    - by hitech
    when we say "a member declated as protected is accessible to any class imediately derived from it" what does this mean. in the follwing example get_number function can be accessible by the result class , as per the statement it sould only be accessile to test class. class student { protected: int roll_number; public: void get_number(int){ cout<< "hello"; } void put_number(void) {cout<< "hello"; } }; class test : public student { protected : float sub1; float sub2; public: void get_marks(float, float) {cout<< "hello"; roll_number = 10; } void put_marks(void) {cout<< "hello"; cout << "roll_number = " << roll_number ; } }; class result :public test { float total; public: void display(){cout<< "hello"; roll_number = 10; } }; int main() { result student; student.get_marks(2.2, 2.2); student.put_marks(); return 0; } i changed the code as per the first statement the protected variable roll_number not be accessible upto the result class ?

    Read the article

  • Randomizing Div tags using Java Script

    - by Andrew McNeil
    I've looked around and have been able to find a piece of code that does the job but it doesn't work for all of my tags. I have a total of 8 Div tags that I want to randomize and this piece of code only allows me to randomize 7 of them. If I replace the 7 with an 8 it just shows everything in order. I don't work with Javascript very often and have hit a road block. Any help is greatly appreciated. <script type="text/javascript"> $(document).ready(function() { $(".workPiece").hide(); var elements = $(".workPiece"); var elementCount = elements.size(); var elementsToShow = 7; var alreadyChoosen = ","; var i = 0; while (i < elementsToShow) { var rand = Math.floor(Math.random() * elementCount); if (alreadyChoosen.indexOf("," + rand + ",") < 0) { alreadyChoosen += rand + ","; elements.eq(rand).show(); ++i; } } }); </script>

    Read the article

  • Retrieve POST data without knowing exact number of fields

    - by James
    Hi all! I'm creating an online poll from scratch which will be held in a database. I'm working on getting a system set up so someone can create a new poll. I will be having the user fill out a simple HTML form with the Questions and Answers (there may be several answers). The user will be able to add multiple questions and multiple answers for each question. As the total number of questions and answers will be decided by the user, I need to create some clever PHP to cater for this - however many there are. When dealing with a static number of questions, it's simple. But I'm having trouble thinking of a way to get all the POST data into individual PHP variables so I can process them. I was thinking of using a foreach loop, anyone got any ideas? Sorry for the long winded description! If anyone needs anything clarified, I'd be happy to do so. My problem is that I can't get my head around how to deal with the POST values when I don't know exactly which element of the array will contain what. If things were static with a set number of questions and answers, I'd know $_POST[0] was Question1, etc Thank you! =)

    Read the article

  • Problem with mysql query in paging

    - by jasmine
    I have a very simple paging and mysql query. Im not sure that my query is right: $perPage =4; $page= (isset($GET['page']) && is_numeric($GET['page'])) ? $_GET['page'] : 1; $start = ($page * $perPage ) - $perPage ; if (is_numeric($_GET['cID'])){$cid = $_GET['cID'];} $totalCount = sprintf("SELECT COUNT(*) as 'Total' FROM content WHERE catID = %d", $cid ) ; $count = mysql_query($totalCount); $rowCount = mysql_fetch_array($count); $sql = sprintf("SELECT id, title, abstract, content_image FROM content WHERE catID = %d ORDER BY id DESC LIMIT %d, %d", $cid, $start, $perPage ); $query = mysql_query($sql) or die(mysql_error()); while($row = mysql_fetch_array($query)){ echo $row['id'].' : '. $row['title'] .'<br>'; } with /categories.php?cID=1&page=2 and /categories.php?cID=1&page=1 The output is: 95 : titlev 94 : titlex 93 : titlec 92 : titleb and not changed. What is wrong in my query? Thanks in advance

    Read the article

  • Custom Cell over lapping.

    - by user338322
    I am trying to use a custom cell, My custom cell is of size 320*220 pixels. My table size is 320* by 1500 which is large enough I have set custom cell's view in scale to fill mode. But when i fill the table using custom cell all i see is first row. i have total four rows to be filld in a custom way. but they gets overlapped and i can not see any of the table.. They do look, but overlapped, Any hints .. about why its happening Do i need to make changes into nib? -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ static NSString *CellIdentifier = @"CustomCell"; CustomCell *cell = (CustomCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"CustomCell" owner:self options:nil]; for (id oneObject in nib) if ([oneObject isKindOfClass:[CustomCell class]]) cell = (CustomCell *)oneObject; } cell.iconImage.image = [UIImage imageNamed:[NSString stringWithFormat:@"beach%d.jpg",indexPath.row+1]]; cell.title.text=[[RArrray objectAtIndex:indexPath.row] objectForKey:@"Beach"]; return cell; }

    Read the article

  • Web Crawler C# .Net

    - by sora0419
    I'm not sure if this is actually called the web crawler, but this is what I'm trying to do. I'm building a program in visual studio 2010 using C# .Net. I want to find all the urls that has the same first part. Say I have a homepage: www.mywebsite.com, and there are several subpage: /tab1, /tab2, /tab3, etc. Is there a way to get a list of all urls that begins with www.mywebsite.com? So by providing www.mywebsite.com, the program returns www.mywebsite.com/tab1, www.mywebsite.com/tab2, www.mywebsite.com/tab3, etc. ps. I do not know how many total sub pages there are. --edit at 12:04pm-- sorry for the lack of explanation. I want to know how to write a crawler in C# that do the above task. All I know is the main url www.mywebsite.com, and the goal is to find all its sub pages. -- edit at 12:16pm-- Also, there is no links on the main page, the html is basically blank. I just know that the subpages exist, but have no way to link to it except for providing the exact urls.

    Read the article

< Previous Page | 195 196 197 198 199 200 201 202 203 204 205 206  | Next Page >