Search Results

Search found 3666 results on 147 pages for 'mr myo min hein'.

Page 73/147 | < Previous Page | 69 70 71 72 73 74 75 76 77 78 79 80  | Next Page >

  • Symfony : ajax call cause server to queue next queries

    - by Remiz
    Hello, I've a problem with my application when an ajax call on the server takes too much time : it queue all the others queries from the user until it's done server side (I realized that canceling the call client side has no effect and the user still have to wait). Here is my test case : <script type="text/javascript" src="jquery-1.4.1.min.js"></script> <a href="another-page.php">Go to another page on the same server</a> <script type="text/javascript"> url = 'http://localserver/some-very-long-complex-query'; $.get(url); </script> So when the get is fired and then after I click on the link, the server finish serving the first call before bringing me to the other page. My problem is that I want to avoid this behavior. I'm on a LAMP server and I'm looking in a way to inform the server that the user aborted the query with function like connection_aborted(), do you think that's the way to go ? Also, I know that the longest part of this PHP script is a MySQL query, so even if I know that connection_aborted() can detect that the user cancel the call, I still need to check this during the MySQL query... I'm not really sure that PHP can handle this kind of "event". So if you have any better idea, I can't wait to hear it. Thank you. Update : After further investigation, I found that the problem happen only with the Symfony framework (that I omitted to precise, my bad). It seems that an Ajax call lock any other future call. It maybe related to the controller or the routing system, I'm looking into it. Also for those interested by the problem here is my new test case : -new project with Symfony 1.4.3, default configuration, I just created an app and a default module. -jquery 1.4 for the ajax query. Here is my actions.class.php (in my unique module) : class defaultActions extends sfActions { public function executeIndex(sfWebRequest $request) { //Do nothing } public function executeNewpage() { //Do also nothing } public function executeWaitingaction(){ // Wait sleep(30); return false; } } Here is my indexSuccess.php template file : <script type="text/javascript" src="jquery-1.4.1.min.js"></script> <a href="<?php echo url_for('default/newpage');?>">Go to another symfony action</a> <script type="text/javascript"> url = '<?php echo url_for('default/waitingaction');?>'; $.get(url); </script> For the new page template, it's not very relevant... But with this, I'm able to reproduce the lock problem I've on my real application. Is somebody else having the same issue ? Thanks.

    Read the article

  • How to redirect to a page using a button tag in html?

    - by Vlad Radulescu
    When I Click a button I want to get redirected to a page. The problem is...if I use the normal sintax , the button works fine, but If I apply some css to id by ussing # and .(classes) ,the button it`s not working any more ?! How can I keep my css and functionality at the same time ?! This is my code: <body> <input id="buttonrain" class="classname" type="button" onClick="window.location.href='rain.html'" value="Rain" /> <!--or <a href="rain.html" id="buttonrain" class="classname">Rain</a> still not working--> </body> CSS FILE html { min-width: 100%; min-height: 100%; } body{ width: 1024px; height:600px; background:white; margin:0px; padding:0px 0px; display:block; overflow:hidden; } .classname { -moz-box-shadow:inset 0px 1px 0px 0px #ffffff; -webkit-box-shadow:inset 0px 1px 0px 0px #ffffff; box-shadow:inset 0px 1px 0px 0px #ffffff; background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #f0ea3c), color-stop(1, #dfdfdf) ); background:-moz-linear-gradient( center top, #f0ea3c 5%, #dfdfdf 100% ); filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f0ea3c', endColorstr='#dfdfdf'); background-color:#f0ea3c; -moz-border-radius:6px; -webkit-border-radius:6px; border-radius:6px; border:1px solid #dcdcdc; display:inline-block; color:#0f000f; font-family:Verdana; font-size:15px; font-weight:bold; padding:18px 9px; text-decoration:none; text-shadow:1px 1px 0px #ffffff; position:relative; bottom:250px; }.classname:active { position:relative; top:1px; } #buttonrain{ left:80px; }

    Read the article

  • How do I classify using SVM Classifier?

    - by Gomathi
    I'm doing a project in liver tumor classification. Actually I initially used Region Growing method for liver segmentation and from that I segmented tumor using FCM. I,then, obtained the texture features using Gray Level Co-occurence Matrix. My output for that was stats = autoc: [1.857855266614132e+000 1.857955341199538e+000] contr: [5.103143332457753e-002 5.030548650257343e-002] corrm: [9.512661919561399e-001 9.519459060378332e-001] corrp: [9.512661919561385e-001 9.519459060378338e-001] cprom: [7.885631654779597e+001 7.905268525471267e+001] Now how should I give this as an input to the SVM program. function [itr] = multisvm( T,C,tst ) %MULTISVM(2.0) classifies the class of given training vector according to the % given group and gives us result that which class it belongs. % We have also to input the testing matrix %Inputs: T=Training Matrix, C=Group, tst=Testing matrix %Outputs: itr=Resultant class(Group,USE ROW VECTOR MATRIX) to which tst set belongs %----------------------------------------------------------------------% % IMPORTANT: DON'T USE THIS PROGRAM FOR CLASS LESS THAN 3, % % OTHERWISE USE svmtrain,svmclassify DIRECTLY or % % add an else condition also for that case in this program. % % Modify required data to use Kernel Functions and Plot also% %----------------------------------------------------------------------% % Date:11-08-2011(DD-MM-YYYY) % % This function for multiclass Support Vector Machine is written by % ANAND MISHRA (Machine Vision Lab. CEERI, Pilani, India) % and this is free to use. email: [email protected] % Updated version 2.0 Date:14-10-2011(DD-MM-YYYY) u=unique(C); N=length(u); c4=[]; c3=[]; j=1; k=1; if(N>2) itr=1; classes=0; cond=max(C)-min(C); while((classes~=1)&&(itr<=length(u))&& size(C,2)>1 && cond>0) %This while loop is the multiclass SVM Trick c1=(C==u(itr)); newClass=c1; svmStruct = svmtrain(T,newClass); classes = svmclassify(svmStruct,tst); % This is the loop for Reduction of Training Set for i=1:size(newClass,2) if newClass(1,i)==0; c3(k,:)=T(i,:); k=k+1; end end T=c3; c3=[]; k=1; % This is the loop for reduction of group for i=1:size(newClass,2) if newClass(1,i)==0; c4(1,j)=C(1,i); j=j+1; end end C=c4; c4=[]; j=1; cond=max(C)-min(C); % Condition for avoiding group %to contain similar type of values %and the reduce them to process % This condition can select the particular value of iteration % base on classes if classes~=1 itr=itr+1; end end end end Kindly guide me. Images:

    Read the article

  • Scripty2 : how to close dialog

    - by nicolas_o
    Heya, I am looking for a way to close a scripty2 dialog like this : http://mir.aculo.us/stuff/scripty2-ui/test/functional/controls_dialog.html From outside of the dialog (i.e. with firebug command line) but my javascript mojo is a bit limited and after 30 min of going around the DOM I cannot find a way. Any hints ? NB : scripty2 is a rewrite of script.aculo.us which uses bits of Jquery UI.

    Read the article

  • Jquery Slider functionality

    - by Sandeep
    Hi all, Please go to : http://gati.simptome-remedii.ro/ . As you can see there is a carousel effect in the header and it goes forward and backwards once you click on the arrows or press left/right key. But i want to display 1st panel along with 2 and 3 but it displaying 2nd panel along with 3 and 4 on load This carousel effect uses jquery-1.3.1.min.js and slider.js

    Read the article

  • how can i program this ui box

    - by silverkid
    in what way can this be programmed. a UI box that displays random number between min and max value for 2 seconds then shows blank for 2 seconds then shows another random numer for 2 seconds then shows blank for 10 seonds and then repeats the cycle infitely until form closed. Font of the text to be configurable. any help at all will be appreciated.

    Read the article

  • How to handle choice field with JPA 2, Hibernate 3.5

    - by phmr
    I have an entity with Integer attributes that looks like this in proto code: class MyEntity: String name Integer frequency Integer type def getFrequency() def getType() get* accessors return strings according to this table. value(type) HumanReadableString(type) 1 BSD 2 Apache 3 GPL min frequency max frequency HumanReadableString(frequency) 0 1000 rare 1000 2000 frequent 2001 3000 sexy It should be possible to get all possible values that an attribute can take, example: getChoices(MyEntity, "type") returns ("rare", "frequent", "sexy") It should be possible to get the bound value from the string: getValue(MyEntity, "frequency", "sexy") returns (2000,3000)

    Read the article

  • Longest Common Subsequence

    - by tsudot
    Consider 2 sequences X[1..m] and Y[1..n]. The memoization algorithm would compute the LCS in time O(m*n). Is there any better algorithm to find out LCS wrt time? I guess memoization done diagonally can give us O(min(m,n)) time complexity.

    Read the article

  • Why am I getting an IndexOutOfBoundsException here?

    - by Berzerker
    I'm getting an index out of bounds exception thrown and I don't know why, within my replaceValue method below. [null, (10,4), (52,3), (39,9), (78,7), (63,8), (42,2), (50,411)] replacement value test:411 size=7 [null, (10,4), (52,3), (39,9), (78,7), (63,8), (42,2), (50,101)] removal test of :(10,4) [null, (39,9), (52,3), (42,2), (78,7), (63,8), (50,101)] size=6 I try to replace the value again here and get an error... package heappriorityqueue; import java.util.*; public class HeapPriorityQueue<K,V> { protected ArrayList<Entry<K,V>> heap; protected Comparator<K> comp; int size = 0; protected static class MyEntry<K,V> implements Entry<K,V> { protected K key; protected V value; protected int loc; public MyEntry(K k, V v,int i) {key = k; value = v;loc =i;} public K getKey() {return key;} public V getValue() {return value;} public int getLoc(){return loc;} public String toString() {return "(" + key + "," + value + ")";} void setKey(K k1) {key = k1;} void setValue(V v1) {value = v1;} public void setLoc(int i) {loc = i;} } public HeapPriorityQueue() { heap = new ArrayList<Entry<K,V>>(); heap.add(0,null); comp = new DefaultComparator<K>(); } public HeapPriorityQueue(Comparator<K> c) { heap = new ArrayList<Entry<K,V>>(); heap.add(0,null); comp = c; } public int size() {return size;} public boolean isEmpty() {return size == 0; } public Entry<K,V> min() throws EmptyPriorityQueueException { if (isEmpty()) throw new EmptyPriorityQueueException("Priority Queue is Empty"); return heap.get(1); } public Entry<K,V> insert(K k, V v) { size++; Entry<K,V> entry = new MyEntry<K,V>(k,v,size); heap.add(size,entry); upHeap(size); return entry; } public Entry<K,V> removeMin() throws EmptyPriorityQueueException { if (isEmpty()) throw new EmptyPriorityQueueException("Priority Queue is Empty"); if (size == 1) return heap.remove(1); Entry<K,V> min = heap.get(1); heap.set(1, heap.remove(size)); size--; downHeap(1); return min; } public V replaceValue(Entry<K,V> e, V v) throws InvalidEntryException, EmptyPriorityQueueException { // replace the value field of entry e in the priority // queue with the given value v, and return the old value This is where I am getting the IndexOutOfBounds exception, on heap.get(i); if (isEmpty()){ throw new EmptyPriorityQueueException("Priority Queue is Empty."); } checkEntry(e); int i = e.getLoc(); Entry<K,V> entry=heap.get(((i))); V oldVal = entry.getValue(); K key=entry.getKey(); Entry<K,V> insert = new MyEntry<K,V>(key,v,i); heap.set(i, insert); return oldVal; } public K replaceKey(Entry<K,V> e, K k) throws InvalidEntryException, EmptyPriorityQueueException, InvalidKeyException { // replace the key field of entry e in the priority // queue with the given key k, and return the old key if (isEmpty()){ throw new EmptyPriorityQueueException("Priority Queue is Empty."); } checkKey(k); checkEntry(e); K oldKey=e.getKey(); int i = e.getLoc(); Entry<K,V> entry = new MyEntry<K,V>(k,e.getValue(),i); heap.set(i,entry); downHeap(i); upHeap(i); return oldKey; } public Entry<K,V> remove(Entry<K,V> e) throws InvalidEntryException, EmptyPriorityQueueException{ // remove entry e from priority queue and return it if (isEmpty()){ throw new EmptyPriorityQueueException("Priority Queue is Empty."); } MyEntry<K,V> entry = checkEntry(e); if (size==1){ return heap.remove(size--); } int i = e.getLoc(); heap.set(i, heap.remove(size--)); downHeap(i); return entry; } protected void upHeap(int i) { while (i > 1) { if (comp.compare(heap.get(i/2).getKey(), heap.get(i).getKey()) <= 0) break; swap(i/2,i); i = i/2; } } protected void downHeap(int i) { int smallerChild; while (size >= 2*i) { smallerChild = 2*i; if ( size >= 2*i + 1) if (comp.compare(heap.get(2*i + 1).getKey(), heap.get(2*i).getKey()) < 0) smallerChild = 2*i+1; if (comp.compare(heap.get(i).getKey(), heap.get(smallerChild).getKey()) <= 0) break; swap(i, smallerChild); i = smallerChild; } } protected void swap(int j, int i) { heap.get(j).setLoc(i); heap.get(i).setLoc(j); Entry<K,V> temp; temp = heap.get(j); heap.set(j, heap.get(i)); heap.set(i, temp); } public String toString() { return heap.toString(); } protected MyEntry<K,V> checkEntry(Entry<K,V> ent) throws InvalidEntryException { if(ent == null || !(ent instanceof MyEntry)) throw new InvalidEntryException("Invalid entry."); return (MyEntry)ent; } protected void checkKey(K key) throws InvalidKeyException{ try{comp.compare(key,key);} catch(Exception e){throw new InvalidKeyException("Invalid key.");} } }

    Read the article

  • Load test results VSTS 2008

    - by Julia
    Can anybody explain why load test result on Graph are different form load test result on Table Page. If compare Min and Avg page response time they are the same. But if we compare figures in Max column they are different for the same page and the same load rest run. see linked images for more details. http://cid-ee8b34c203174724.skydrive.live.com/self.aspx/.Public/3.png

    Read the article

  • SQL ORDER BY thing1 ASC, thing2 DESC not working

    - by William
    it puts item1 down as DESC for some reason. edit: $sql_result = mysql_query("SELECT post, name, trip, Thread, sticky FROM (SELECT MIN(ID) AS min_id, MAX(ID) AS max_id, MAX(Date) AS max_date FROM test_posts GROUP BY Thread ) t_min_max INNER JOIN test_posts ON test_posts.ID = t_min_max.min_id WHERE Board=".$board." ORDER BY sticky ASC, max_date DESC", $db); http://prime.programming-designs.com/test_forum/viewboard.php?board=0&page=3

    Read the article

  • Where can I find a good guide to writing C Collections?

    - by Mike Axiak
    I remember having read a very good guide to writing collections. By that I mean, it described using macros to generate types with type parameters, kind of like C++ templates. I'm not sure if it was written by Rusty Russell, but it was someone I recognized. It was posted on hackernews or proggit... I wanted to write a new C library and has searched google for the past 30 min for this guide to no avail. Anybody remember?

    Read the article

  • How to Load Dependent Files on Demand + Check if They're Loaded or Not?

    - by br4inwash3r
    I'm trying to implement an assets/dependency loader that i've found from an old article at 24Ways.org. most of you might be familiar with it. it's from this article by Christian Heilmann: http://24ways.org/2007/keeping-javascript-dependencies-at-bay i've modified the script to load CSS files as well. and it's now quite close to what i want. but i still need to do some checking to see wether an asset have been completely loaded or not. just wondering if you guys have any ideas :) here's what my script currently looked like: var assetLoader = { assets: { products: { js: 'products.js', css: 'products.css', loaded: false }, articles: { js: 'articles.js', css: 'articles.css', loaded: false }, [...] cycle: { js: 'jquery.cycle.min.js', loaded: false }, swfobject: { js: 'jquery.swfobject.min.js', loaded: false } }, add: function(asset) { var comp = assetLoader.assets[asset]; var path = '/path/to/assets/'; if (comp && comp.loaded == false) { if (comp.js) { // load js var js = document.createElement('script'); js.src = path + 'js/' + comp.js; js.type = 'text/javascript'; js.charset = 'utf-8'; // append to document document.getElementsByTagName('body')[0].appendChild(js); } if (comp.css) { // load css var css = document.createElement('link'); css.rel = 'stylesheet'; css.href = path + 'css/' + comp.css; css.type = 'text/css'; css.media = 'screen, projection'; css.charset = 'utf-8'; // append to document document.getElementsByTagName('head')[0].appendChild(css); } } }, check: function(asset) { assetLoader.assets[asset].loaded = true; } } Christian explains this method in his article in great detail. I don't want to confuse you guys anymore with my bad english :P and here's an example of how i run the script: ... // load jquery cycle plugin if (page=='tvc' || page=='products') { if (!assetLoader.assets.cycle.loaded) { assetLoader.add('cycle'); } } // load products page assets if (!assetLoader.assets.products.loaded) { assetLoader.add('products'); } ... this kind of approach is very problematic though. coz assets loads asynchronously, which means some of the code inside products.js that depends on jquery.cycle.js might continue running before jquery.cycle.js is even loaded resulting in errors. while i'm quite aware that scripts can be attached with an onload event, i'm just not really sure how to implement it to my script. anyone care to help me? please... :P

    Read the article

  • Server Error Message: No File Access

    - by iMayne
    Hello. Im having an issues but dont know where to solve it. My template works great in xampp but not on the host server. I get this message: Warning: file_get_contents() [function.file-get-contents]: URL file-access is disables in the server configuration in homepage/......./twitter.php. The error is on line 64. <?php /* For use in the "Parse Twitter Feeds" code below */ define("SECOND", 1); define("MINUTE", 60 * SECOND); define("HOUR", 60 * MINUTE); define("DAY", 24 * HOUR); define("MONTH", 30 * DAY); function relativeTime($time) { $delta = time() - $time; if ($delta < 2 * MINUTE) { return "1 min ago"; } if ($delta < 45 * MINUTE) { return floor($delta / MINUTE) . " min ago"; } if ($delta < 90 * MINUTE) { return "1 hour ago"; } if ($delta < 24 * HOUR) { return floor($delta / HOUR) . " hours ago"; } if ($delta < 48 * HOUR) { return "yesterday"; } if ($delta < 30 * DAY) { return floor($delta / DAY) . " days ago"; } if ($delta < 12 * MONTH) { $months = floor($delta / DAY / 30); return $months <= 1 ? "1 month ago" : $months . " months ago"; } else { $years = floor($delta / DAY / 365); return $years <= 1 ? "1 year ago" : $years . " years ago"; } } /* Parse Twitter Feeds */ function parse_cache_feed($usernames, $limit, $type) { $username_for_feed = str_replace(" ", "+OR+from%3A", $usernames); $feed = "http://twitter.com/statuses/user_timeline.atom?screen_name=" . $username_for_feed . "&count=" . $limit; $usernames_for_file = str_replace(" ", "-", $usernames); $cache_file = dirname(__FILE__).'/cache/' . $usernames_for_file . '-twitter-cache-' . $type; if (file_exists($cache_file)) { $last = filemtime($cache_file); } $now = time(); $interval = 600; // ten minutes // check the cache file if ( !$last || (( $now - $last ) > $interval) ) { // cache file doesn't exist, or is old, so refresh it $cache_rss = file_get_contents($feed); (this is line 64) Any help on how to give this access on my host server?

    Read the article

  • How to enable iPhone auto lock during MPMoviePlayer playback?

    - by obiwahn
    When I play a video with MPMoviePlayerController in my app my iPhone does not auto lock (tested OS 3.0 & 3.1.2). However, the application.idleTimerDisabled = NO, so this setting is not affected by MPMoviePlayerController. How can I get my iPhone to sleep normally (e.g. after 3 min screen dims, then goes dark) when my app is running and playing a video?

    Read the article

  • Loading Modules in Angular

    - by SL Dev
    I'm new to AngularJS. In my efforts to learn, I've relied on the AngularJS tutorials. Now, I'm trying to build an app using the AngularSeed project template. I'm trying to make my project as modular as possible. For that reason, my controllers are broken out into several files. Currently, I have the following: /app index.html login.html home.html javascript app.js loginCtrl.js homeCtrl.js my app.js file has the following: 'use strict'; var app = angular.module('site', ['ngRoute']); app.config(function($routeProvider, $locationProvider) { $locationProvider.html5Mode(true); $routeProvider.when('/login', {templateUrl: 'app/login.html', controller:'loginCtrl'}); $routeProvider.when('/home', {templateUrl: 'app/home.html', controller:'homeCtrl'}); $routeProvider.otherwise({redirectTo: '/login'}); }); my loginCtrl.js file is very basic at the moment. It only has: 'use strict'; app.controller('loginCtrl', function loginCtrl($scope) { } ); My homeCtrl.js is almost the same, except for the name. It looks like the following: 'use strict'; app.controller('homeCtrl', function homeCtrl($scope) { } ); My index.html file is the angularSeed index-async.html file. However, when I load the dependencies, I have the following: // load all of the dependencies asynchronously. $script([ 'http://ajax.googleapis.com/ajax/libs/angularjs/1.2.0-rc.3/angular.min.js', 'http://ajax.googleapis.com/ajax/libs/angularjs/1.2.0-rc.3/angular-route.min.js', 'javascript/app.js', 'javascript/loginCtrl.js', 'javascript/homeCtrl.js' ], function() { // when all is done, execute bootstrap angular application angular.bootstrap(document, ['site']); }); My problem is, sometimes my app works and sometimes it doesn't. It's almost like something gets loaded before something else. Occasionally, I receive this error. Other times, I get an error in the console window that says: 'Uncaught ReferenceError: app is not defined' in loginCtrl.js. Sometimes it happens with homeCtrl.js. What am I doing wrong? It feels like I need to have my controllers in a module and pass that module in my app.config in the app.js file. However, a) I'm not sure if that allowed and b) I'm not sure how to do it.

    Read the article

  • Need help with jquery ui slider

    - by Gandalf StormCrow
    I'm trying to create this slider http://jqueryui.com/demos/slider/#rangemax Is it possible to parametrize the max value? For ex: $("#slider-range-max").slider({ range: "max", min: 1, max: maxValue, value: 2, slide: function(event, ui) { $("#amount").val(ui.value); } }); Is it possible to pass maxValue value, when I click on something ?After its been initialized? not on document ready function, after that?

    Read the article

  • Flex chart zooms out on series visibility change

    - by asawilliams
    I have a chart that the user is able to zoom into an area by setting the min and max of LinearAxis for the vertical and horizontal axis. When you are zoomed in and you want to view or hide one of the series the chart zooms out to the max and then back in. How do I get the chart to not zoom out when setting the visibility of the series?

    Read the article

  • jquery use of :last and val()

    - by dole doug
    I'm trying to run the code from http://jsfiddle.net/ddole/AC5mP/13/ on my machine and the approach I've use is below or here. Do you know why that code doesn't work on my machine. Firebug doesn't help me and I can't solve the problem. I think that I need another pair of eyes :((( <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>jQuery UI Dialog - Modal form</title> <link type="text/css" href="css/ui-lightness/jquery-ui-1.8.21.custom.css" rel="stylesheet" /> <script type="text/javascript" src="js/jquery-1.7.2.min.js"></script> <script type="text/javascript" src="js/jquery-ui-1.8.21.custom.min.js"></script> <script type="text/javascript" > jQuery(function($) { $('.helpDialog').hide(); $('.helpButton').each(function() { $.data(this, 'dialog', $(this).next('.helpDialog').dialog({ autoOpen: false, modal: true, width: 300, height: 250, buttons: { "Save": function() { alert($('.helpText:last').val()); $(this).dialog( "close" ); }, Cancel: function() { $(this).dialog( "close" ); } } }) ); }).click(function() { $.data(this, 'dialog').dialog('open'); return false; }); }); </script> </head> <body> <span class="helpButton">Button</span> <div class="helpDialog"> <input type="text" class="helpText" /> </div> <span class="helpButton">Button 2</span> <div class="helpDialog"> <input type="text" class="helpText" /> </div> <span class="helpButton">Button 3</span> <div class="helpDialog"> <input type="text" class="helpText" /> </div> <span class="helpButton">Button 4</span> <div class="helpDialog"> <input type="text" class="helpText" /> </div> <span class="helpButton">Button 5</span> <div class="helpDialog"> <input type="text" class="helpText" /> </div> </body>

    Read the article

< Previous Page | 69 70 71 72 73 74 75 76 77 78 79 80  | Next Page >