Search Results

Search found 6679 results on 268 pages for 'cube processing'.

Page 28/268 | < Previous Page | 24 25 26 27 28 29 30 31 32 33 34 35  | Next Page >

  • Dynamic form in PHP not processing correctly

    - by user1497265
    My last question regarding this suggested I incorporate AJAX with PHP. However, I really wanted to try PHP exclusively for this project, and I seem to have made it about 95% there. I just need help on this one issue. Here's a quick background. My project requires a dynamic form to be populated with a max limit of 10 questions. Each form contains one question, one question number, and a text field. Students would go on and answer the questions. This is all driven by a database table (obviously), and when a question gets answered correctly, it will close and the next question in line will appear. There will always be 10 questions on the page. Here's how the coding looks, and it works perfectly. <? $rt = mysql_query("SELECT * FROM The_Questions WHERE Status='Open' ORDER BY 'Number' LIMIT 10"); while ($row = mysql_fetch_array($rt)) { $number=$row[0]; $category = $row[1]; $question=$row[2]; $points=$row[4]; $_SESSION['number'] = $number; ?> <form action="processor.php" method="post" class="qForm"> <div class="questionCell"> <div class="question"><? echo $number; echo $question ?></div> <div class="answer">Answer: <input class="inputField" name="q1" type="text" size="40" maxlength="40" /> <input name="HHQuestion" value="Submit" type="submit" /></div> </div> </form> <? } ?> The questions appear as they should, in the correct order, and the correct limit. Everything seems to be looking fine until a question gets answered and gets processed through the processor.php action. First here's the code to the processor.php file: <?php session_start(); if(isset($_POST["HHQuestion"])){ $dbhost = 'localhost'; $dbname = 'localhost'; $dbuser = 'localhost'; $dbpass = 'localhost'; $conn = mysql_connect($dbhost, $dbuser, $dbpass); mysql_select_db($dbname, $conn); { $number1 = $_SESSION['number']; $answer=$_POST['q1']; $sql="SELECT * FROM The_Questions WHERE Number='$number1'"; $result=mysql_query($sql); $row=mysql_fetch_array($result); $question = $row[2]; echo $question .'<br>'; echo $number1.'<br>'; echo $answer; } } ?> This is NOT live yet, and for testing purposes I'm echoing the question, question number, and answer (as you can see). What's happening is that the $question and $number1 displays the last question in the array (the $answer displays correctly, meaning it displays whatever was written in the dynamic form). Can anyone tell me why that is? If I change the LIMIT number to 20, the processor.php action will display the 20th question and number, even if I was answering question 8, for example, in the dynamic form. Again, the dynamic forms are being displayed correctly, and are numbered correctly. For some unknown reason to me, the action - processor.php - is grabbing the last question in the array. Any ideas on what I'm doing wrong? I'm hoping it's a simple code change that I'm overlooking. Thanks in advance guys!

    Read the article

  • wget not completely processing the http call

    - by user578458
    Here is a wget command that executes a HTML / PHP stack report suite that is hosted by a third party - we don't have control over the PHP or HTML page wget --no-check-certificate --http-user=/myacc --http-password=mypass -O /tmp/myoutput.csv "https://myserver.mydomain.com/mymodule.php?myrepcode=9999&action=exportcsv&admin=myappuserid&password=myappuserpass&startdate=2011-01-16&enddate=2011-01-16&reportby=mypreferredview" All the elements are working perfectly: --http-user / --http-pass as offered by a browsers standard popup for username and password prompt -O /tmp/myoutput.csv - the output file of interest https://myserver.mydomain.com/mymodule.php?myrepcode=9999&action=exportcsv&admin=myappuserid&password=myappuserpass&startdate=2011-01-16&enddate=2011-01-16&reportby=mypreferredview" The file generated on the fly by the parameters myrepcode=9999 - a reference to the report in question action=exportcsv internally written in the function admin=myappuserid the third party operats SSL to access the site - then internal username and password stored in a database to access the functions of the site) password=myappuserpass startdate=2011-01-16 this and end data are parameters specific to the report 9999 enddate=2011-01-16 reportby=mypreferredview This is an option in the report that facilitates different levels of detail or aggregation The problem is that the reportby parameter is a radio button selection in a list of 5 selections (sure I enough the default is highest level of aggregation , I want the last one which is the most detailed) Here is a sample of the HTML page code for the options of reportby View by The Default My Least Preferred My Second Least Preferred My Third Least Preferred My Preferred No matter which of the reportby items I select in the wget statement - thedefault is always executed. Questions 1) Has anyone come across this notation in HTML (id=inputname[inputelement]) I spoke to a senior web developer and he has never seen this notation for inputs (id=inputname[inputelement]) - and w3schools do not appear familiar with this either based on an extensive search 2) Can a wget command select a none default radio item when executing the command ? This probably will be initially received with a "Use CURL" response- however the wget approach works very well in the limited environment I am operating in - particularly as I need to download 10000 of these such items. Thanks ahead of response

    Read the article

  • Exception during processing XSLT transformation!

    - by Artic
    I'm using this code to generate contents file. try { StreamResult result = new StreamResult(); TransformerFactory tf = TransformerFactory.newInstance(); Templates templ = tf.newTemplates(xsltSource); Transformer transf = templ.newTransformer(); for (String item: groups){ item = item.replaceAll(" ", "-").toLowerCase(); result.setOutputStream(new FileOutputStream(path+item+".html")); transf.clearParameters(); transf.setParameter("group", item); transf.transform(xmlSource, result); } } catch (TransformerConfigurationException e) { throw new SinkException(e.getMessage()); } catch (TransformerException e) { throw new SinkException(e.getMessage()); } But on second iteration I have an exception ERROR: javax.xml.transform.TransformerException: com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: Read error Cann't understand what is the reason?

    Read the article

  • Processing data from an AJAX request

    - by Josh K
    I have a PHP API I'm working with that outputs everything as JSON. I need to call one of the API methods and parse it out using an AJAX request. I am using jQuery (though it shouldn't matter). When I make the request it errors out with a "parsererror" as the textStatus and a "Syntax Error: invalid label" when I make the request. Simplified code: $.ajax ({ type: "POST", url: "http://mydomain.com/api/get/userlist/"+mid, dataType: "json", dataFilter: function(data, type) { /* Here we assume and pray */ users = eval(data); alert(users[1].id); }, success: function(data, textStatus, XMLHttpRequest) { alert(data.length); // Should be an array, yet is undefined. }, error: function(XMLHttpRequest, textStatus, errorThrown) { alert(textStatus); alert(errorThrown); }, complete: function(XMLHttpRequest, textStatus) { alert("Done"); } }); If I leave off the eval(data) then everything works fine. Well, except for data still being undefined in success. Note that I'm taking an array of objects in PHP and then passing them out through json_encode. Would that make any difference? There has been no progress made on this. I'm willing to throw more code up if someone believes they can help. Here is the PHP side of things private function _get_user_colors($id) { $u = new User(); $u->get_where(array('id' => $id)); $bar = array(); $bar['user'] = $u->stored; foreach($user->colors as $color) { $bar['colors'][] = $color; } echo(json_encode($bar)); } I have had zero issues using this with other PHP based scripts. I don't know why Javascript would take issue with it.

    Read the article

  • AngularJS - Processing $http response in service

    - by bsreekanth
    I recently posted a detailed description of the issue I am facing here at SO. As I couldn't send an actual $http request, I used timeout to simulate asynchronous behavior. Data binding from my model to view is working correct, with the help of @Gloppy Now, when I use $http instead of $timeout (tested locally), I could see the asynchronous request was successful and data is filled with json response in my service. But, my view is not updating. updated Plunkr here

    Read the article

  • XSLT processing with Qt

    - by swegi
    Hi, I like to display some (X)HTML content in a Qt application using QtWebKit. The content should be generated from XML documents via XSLT. As I am new to Qt, my questions are as follows: 1) Can QtWebKit display XML documents with the xml-stylesheet element set? 2) Can Qt apply XSLT to an XML document and return the result as a string or write it to a file?

    Read the article

  • Modal forms get in the way of processing

    - by Botax
    I’m working on an interface in VB6 to interact with a sound editor to automate certain tasks mainly using the editor’s object handles and activating them through SendMessage/PostMessage. In general it works OK, except that the editor has some dialog boxes that open in modal mode and freeze everything on the interface, including the timers. Is there a practical way to get these dialog boxes to open modeless or to interact with them from the interface after they pop up? I tried an MDI form, but it also freezes along with everything else. The only way to override the modal mode of these boxes is to launch an independent applet beforehand to address the dialog boxes with a timer, but the process is somewhat cumbersome. All I need to do with the dialog boxes is click the OK button or hit the return key.

    Read the article

  • Histrogram matching - image processing - c/c++

    - by Raj
    Hello I have two histograms. int Hist1[10] = {1,4,3,5,2,5,4,6,3,2}; int Hist1[10] = {1,4,3,15,12,15,4,6,3,2}; Hist1's distribution is of type multi-modal; Hist2's distribution is of type uni-modal with single prominent peak. My questions are Is there any way that i could determine the type of distribution programmatically? How to quantify whether these two histograms are similar/dissimilar? Thanks

    Read the article

  • Processing large (over 1 Gig) files in PHP using stream_filter_*

    - by mike
    $fp_src=fopen('file','r'); $filter = stream_filter_prepend($fp_src, 'convert.iconv.ISO-8859-1/UTF-8'); while(fread($fp_src,4096)){ ++$count; if($count%1000==0) print ftell($fp_src)."\n"; } When I run this the script ends up consuming ~ 200 MB of RAM after going through just 35MB of the file. Running it without the stream_filter zips right through with a constant memory footprint of ~10 MB. What gives?

    Read the article

  • Processing a method after the view has loaded..

    - by Susanth
    Hi ! I have implemented a subview which is supposed to load immediately when I click a button in the parent view. After loading the subview(which is basically holding an activityindicator), the program is supposed to process a method(which gets data from a server, so takes time) in it. However, I am unable to do it. What happens now is, when I click the button on the parent view, it processes the method first and only after that does the subview load on screen. Why is this so? Is there any specific functions I could use to make my method load only after the view has loaded?

    Read the article

  • regex numeric data processing: match a series of numbers greater than X

    - by Mu Mind
    Say I have some data like this: number_stream = [0,0,0,7,8,0,0,2,5,6,10,11,10,13,5,0,1,0,...] I want to process it looking for "bumps" that meet a certain pattern. Imagine I have my own customized regex language for working on numbers, where [[ =5 ]] represents any number = 5. I want to capture this case: ([[ >=5 ]]{3,})[[ <3 ]]{2,} In other words, I want to begin capturing any time I look ahead and see 3 or more values = 5 in a row, and stop capturing any time I look ahead and see 2+ values < 3. So my output should be: >>> stream_processor.process(number_stream) [[5,6,10,11,10,13,5],...] Note that the first 7,8,... is ignored because it's not long enough, and that the capture ends before the 0,1,0.... I'd also like a stream_processor object I can incrementally pass more data into in subsequent process calls, and return captured chunks as they're completed. I've written some code to do it, but it was hideous and state-machiney, and I can't help feeling like I'm missing something obvious. Any ideas to do this cleanly?

    Read the article

  • File processing in c

    - by Infinity
    Hello! I have a problem that I want to insert and delete some chars in the middle of a file. fopen() and fdopen() just allow to append at the end. Is there any simple method or existing library that allow these actions? Thanks in advance.

    Read the article

  • Processing JSON data with jQuery - strange results needing alert()

    - by James
    I have this code below. I randomly ran across that it will work if I have that alert message exactly where it is. If I take it out or move it to any other spot the tabs will not appear. What exactly is that alert doing that allows the code to work and how can I make it work without the alert? If I move the each loop into the success section it does not work even with the alert. $.ajax({ type: "GET", url: "../ajax.php", data: "action=tabs", dataType: "json", success: function(data){ Projects = data; } }); alert("yes"); $.each(Projects, function(i){ /* Sequentially creating the tabs and assigning a color from the array: */ var tmp = $('<li><a href="#" class="tab green">'+Projects[i].name+'<span class="left" /><span class="right" /></a></li>'); /* Setting the page data for each hyperlink: */ tmp.find('a').data('page','../ajax.php?action=lists&projectID='+Projects[i].project_id); /* Adding the tab to the UL container: */ $('ul.tabContainer').append(tmp); }); The ajax code is retuning json with this code $query = mysql_query("SELECT * FROM `projects` ORDER BY `position` ASC"); $projects = array(); // Filling the $projects array with new project objects: while($row = mysql_fetch_assoc($query)){ $projects[] = $row; } echo json_encode($projects); The returning data is very small and very fast so I don't think that is the problem.

    Read the article

  • Function to get a string and return same after processing in C

    - by C0de_Hard
    I am working on a code which requires a function. This function gets a string as input and returns a string. What I have planned so far is to get a str[], remove all $'s and spaces, and store this in another string which is returned later: char *getstring(char str[]) { int i=0; char rtn[255]; while (i<strlen(str)) { if (str[i] != " " || str[i] != "$" ) rtn[i] = str[i]; else rtn[i] = ''; } return str; } I dont feel like this will work. Any ideas?? :-S

    Read the article

  • Cygwin make always processing target

    - by Michael
    However it happens only on Windows 7. On Windows XP once it built and intact, no more builds. I narrowed down the issue to one prerequisite - $(jar_target_dir). Here is part of the code # The location where the JAR file will be created. jar_target_dir := $(build_dir)/chrome # The main chrome JAR file. chrome_jar_file := $(jar_target_dir)/$(extension_name).jar # The root of the JAR sources. jar_source_root := chrome # The sources for the JAR file. jar_sources := bla #... some files, doesn't matter jar_sources_no_dir := $(subst $(jar_source_root)/,,$(jar_sources)) $(chrome_jar_file): $(jar_sources) $(jar_target_dir) @echo "Creating chrome JAR file." @cd $(jar_source_root); $(ZIP) ../$(chrome_jar_file) $(jar_sources_no_dir) @echo "Creating chrome JAR file. Done!" $(jar_target_dir): $(build_dir) echo "Creating jar target dir..." if [ ! -x $(jar_target_dir) ]; \ then \ mkdir $(jar_target_dir); \ fi $(build_dir): @if [ ! -x $(build_dir) ]; \ then \ mkdir $(build_dir); \ fi so if I just remove $(jar_target_dir) from $(chrome_jar_file) rule, it works fine.

    Read the article

  • Intersection of line with cube and knowing the point of intersection.

    - by Raj
    Hello everyone, description 1.lines are originating from origin(0,0,0). 2.lines are at some random angle to the Normal of Top face of teh cube. 3.if the lines are intersecting cube , calculate the intersection point. 4.mainly i wan to know how much distance ,line traveled inside the cube. I dont know exactly which approach should i take , i will be pleased and thankful if someone could guied me to the right direction, to use OpenGL, DirectX or some other library, for C# . some example or sample will be appriciated.

    Read the article

  • how to solve error processing /usr/lib/python2.7/dist-packages/pygst.pth:?

    - by ChitKo
    Error processing line 1 of /usr/lib/python2.7/dist-packages/pygst.pth: Traceback (most recent call last): File "/usr/lib/python2.7/site.py", line 161, in addpackage if not dircase in known_paths and os.path.exists(dir): File "/usr/lib/python2.7/genericpath.py", line 18, in exists os.stat(path) TypeError: must be encoded string without NULL bytes, not str Remainder of file ignored Error processing line 1 of /usr/lib/python2.7/dist-packages/pygtk.pth: Traceback (most recent call last): File "/usr/lib/python2.7/site.py", line 161, in addpackage if not dircase in known_paths and os.path.exists(dir): File "/usr/lib/python2.7/genericpath.py", line 18, in exists os.stat(path) TypeError: must be encoded string without NULL bytes, not str Remainder of file ignored Traceback (most recent call last): File "/usr/share/apport/apport-gtk", line 16, in <module> from gi.repository import GObject File "/usr/lib/python2.7/dist-packages/gi/importer.py", line 76, in load_module dynamic_module._load() File "/usr/lib/python2.7/dist-packages/gi/module.py", line 222, in _load version) File "/usr/lib/python2.7/dist-packages/gi/module.py", line 90, in __init__ repository.require(namespace, version) gi.RepositoryError: Failed to load typelib file '/usr/lib/girepository-1.0/GLib-2.0.typelib' for namespace 'GLib': Invalid magic header

    Read the article

  • Can I use Ubuntu as a wireless media server which performs all decoding/processing server-side?

    - by AthloX
    I want to setup UBUNTU 12.04 desktop as Home media server. I have window 7 netbook and UBUNTU 12.04lts laptop even a samsun galaxy note tablet (android). Two desktop in other room with dualboot win7 and ubuntu. SHARP AQUOS Plasma Tv with Wi-Fi connected. I want to install ubuntu as media server to stream audio/video files over wi-fi. Not only this i want this media server to use its own processing power to decode ans stream so that on remote end only file can play without using their own resource. Is it possible to use ubuntu as media server to stream files without making the remote end to use there own resource. I want only bandwidth of Wi-Fi to be use in this and media center hardware resource.Remote end gadget should use only speaker and screen and not processing power of their own. Please any suggestion is it possible to do so ?

    Read the article

  • image filters for iphone sdk development

    - by plsp
    Hi All, I am planning to develop an iphone app which makes use of image filters like blurring, sharpening,etc. I noticed that there are few approaches for this one, Use openGL ES. I even found an example code on apple iphone dev site. How easy is openGL for somebody who has never used it? Can the image filters be implemented using the openGL framework? There is a Quartz demo as well posted on apple iphone dev site. Has anybody used this framework for doing image processing? How is this approach compared to openGL framework? Don't use openGL and Quartz framework. Basically access the raw pixels from the image and do the manipulation myself. Make use of any custom built image processing libraries like this one. Do you know of any other libraries like this one? Can anybody provide insights/suggestions on which option is the best? Your opinions are highly appreciated. Thanks!

    Read the article

  • GPGPU programming with OpenGL ES 2.0

    - by Albus Dumbledore
    I am trying to do some image processing on the GPU, e.g. median, blur, brightness, etc. The general idea is to do something like this framework from GPU Gems 1. I am able to write the GLSL fragment shader for processing the pixels as I've been trying out different things in an effect designer app. I am not sure however how I should do the other part of the task. That is, I'd like to be working on the image in image coords and then outputting the result to a texture. I am aware of the gl_FragCoords variable. As far as I understand it it goes like that: I need to set up a view (an orthographic one maybe?) and a quad in such a way so that the pixel shader would be applied once to each pixel in the image and so that it would be rendering to a texture or something. But how can I achieve that considering there's depth that may make things somewhat awkward to me... I'd be very grateful if anyone could help me with this rather simple task as I am really frustrated with myself. UPDATE It seems I'll have to use an FBO, getting one like this: glBindFramebuffer(...)

    Read the article

  • Projective transformation

    - by mcwehner
    Given two image buffers (assume it's an array of ints of size width * height, with each element a color value), how can I map an area defined by a quadrilateral from one image buffer into the other (always square) image buffer? I'm led to understand this is called "projective transformation". I'm also looking for a general (not language- or library-specific) way of doing this, such that it could be reasonably applied in any language without relying on "magic function X that does all the work for me". An example: I've written a short program in Java using the Processing library (processing.org) that captures video from a camera. During an initial "calibrating" step, the captured video is output directly into a window. The user then clicks on four points to define an area of the video that will be transformed, then mapped into the square window during subsequent operation of the program. If the user were to click on the four points defining the corners of a door visible at an angle in the camera's output, then this transformation would cause the subsequent video to map the transformed image of the door to the entire area of the window, albeit somewhat distorted.

    Read the article

  • How to pass dynamic parameters to .pde file

    - by Kalpana
    class Shape contains two methods drawCircle() and drawTriangle(). Each function takes different set of arguments. At present, I invoke this by calling the pde file directly. How to pass these arguments from a HTML file directly if I have to control the arguments being passed to the draw function? 1) Example.html has (current version) <script src="processing-1.0.0.min.js"></script> <canvas data-processing-sources="example.pde"></canvas> 2) Example.pde has class Shape { void drawCircle(intx, int y, int radius) { ellipse(x, y, radius, radius); } void drawTriangle(int x1, int y1, int x2, int y2, int x3, int y3) { rect(x1, y1, x2, y2, x3, y3); } } Shape shape = new Shape(); shape.drawCircle(10, 40, 70); I am looking to do something like this in my HTML file, so that I can move all the functions into a separate file and call them with different arguments to draw different shapes (much similar to how you would do it in Java) A.html <script> Shape shape = new Shape(); shape.drawCircle(10, 10, 3); </script> B.html <script> Shape shape = new Shape(); shape.drawTriangle(30, 75, 58, 20, 86, 75); </script> 2) Iam using Example2.pde has void setup() { size(200,200); background(125); fill(255); } void rectangle(int x1, int y1, int x2, int y2) { rect(x1, y1, x2, y2); } My Example2.html has var processingInstance; processingInstance.rectangle(30, 20, 55, 55); but this is not working. How to pass these parameters dynamically from html.

    Read the article

< Previous Page | 24 25 26 27 28 29 30 31 32 33 34 35  | Next Page >