Search Results

Search found 141 results on 6 pages for 'ankit agrawal'.

Page 3/6 | < Previous Page | 1 2 3 4 5 6  | Next Page >

  • Strange behaviour of switch case with boolean value

    - by Nikhil Agrawal
    My question is not about how to solve this error(I already solved it) but why is this error with boolean value. My function is private string NumberToString(int number, bool flag) { string str; switch(flag) { case true: str = number.ToString("00"); break; case false: str = number.ToString("0000"); break; } return str; } Error is Use of unassigned local variable 'str'. Bool can only take true or false. So it will populate str in either case. Then why this error? Moreover this error is gone if along with true and false case I add a default case, but still what can a bool hold apart from true and false? Why this strange behaviour with bool variable?

    Read the article

  • uninitialized constant OpenSSL::Digest::SHA1 in rails 3 and ubuntu

    - by Anand Agrawal
    Hi All, I am trying to integrate restful_authentication plugings into my rails 3 application. I integrated this in windows, but while trying to integrate it to ubuntu I am facing an error "uninitialized constant OpenSSL::Digest::SHA1" I googled for the solution but still unsuccessful. I am unable to load the file, "require Digest/SHA1" Now, i tried to run console screen. and tried to check the Digest file by putting print statement, this gives false, while in the irb it returns true. If anyone has come across such problem

    Read the article

  • Whats the minimum iOS version which supports OpenGL ES2.0 ?

    - by Shireesh Agrawal
    Hi, I am not sure if the question even makes sense. I am writing an iPhone game which uses Opengl ES 2.0. I know that OpenGL ES 2.0 is supported on 3gs and higher. Is there a minimum requirement for iOS version too, like the device needs to have iOS 3.1.3 or higher? Or does it solely depend on the hardware? Thanks! -shireesh p.s. I tried to search on the net but havent found much, perhaps I am not using the right keywords

    Read the article

  • Grails Domain.get() returns null for mongo's ObjectId

    - by Shashank Agrawal
    I'm using grails 2.3.5 with mongodb 3.0.1 and no hibernate installed. I've a domain class which uses mongo's ObjectId. import org.bson.types.ObjectId class Category { ObjectId id String name } And has a record in mongo database: { "_id": ObjectId("53f6c34c33a429240e2ab471"), "name": "art", "version": NumberLong("41") } When I do, Category.get(new ObjectId("53f6c34c33a429240e2ab471")) somewhere in grails app, it returns null but when I do Category.get("53f6c34c33a429240e2ab471") it then actually returns the result. Why, get() method does not process ObjectId type?

    Read the article

  • Sort multidimension array in php by more than two fields

    - by Ankita Agrawal
    I want to sort array by two fields. I mean to say I have an array like :- Array ( [0] => Array ( [name] => abc [url] => http://127.0.0.1/abc/img1.png [count] => 69 [img] => accessoire-sets_1.jpg ) [1] => Array ( [name] => abc2 [url] => http://127.0.0.1/abc/img12.png [count] => 73 [img] => ) [2] => Array ( [name] => abc45 [url] => http://127.0.0.1/abc/img122.png [count] => 15 [img] => tomahawk-kopen_1.png ) [3] => Array ( [name] => zyz [url] => http://127.0.0.1/abc/img22.png [count] => 168 [img] => ) [4] => Array ( [name] => lmn [url] => http://127.0.0.1/abc/img1222.png [count] => 10 [img] => ) [5] => Array ( [name] => qqq [url] => http://127.0.0.1/abc/img1222.png [count] => 70 [img] => ) [6] => Array ( [name] => dsa [url] => http://127.0.0.1/abc/img1112.png [count] => 43 [img] => ) [7] => Array ( [name] => wer [url] => http://127.0.0.1/abc/img172.png [count] => 228 [img] => ) [8] => Array ( [name] => hhh [url] => http://127.0.0.1/abc/img126.png [count] => 36 [img] => ) [9] => Array ( [name] => rrrt [url] => http://127.0.0.1/abc/img12.png [count] => 51 [img] => ) [10] => Array ( [name] => yyy [url] => http://127.0.0.1/abc/img12.png [count] => 22 [img] => ) [11] => Array ( [name] => cxz [url] => http://127.0.0.1/abc/img12.png [count] => 41 [img] => ) [12] => Array ( [name] => tre [url] => http://127.0.0.1/abc/img12.png [count] => 32 [img] => ) [13] => Array ( [name] => fds [url] => http://127.0.0.1/abc/img12.png [count] => 10 [img] => ) ) array WITHOUT images (field "img" )should always be placed underneath array WITH images. After this there will be sorted on the amount of products (field count) in the array. Means I have to show sort array first on the basis of img then count. I am using usort( $childLinkCats, 'sortempty' );` function sortempty( $a, $b ) { return empty( $a['img'] ); } it will show array with image value above the one who contains null value. and to sort through count Im using usort($childLinkCats, "_sortByCount"); function _sortByCount($a, $b) { return strnatcmp($a['count'], $b['count']); } It will short by count But I am facing problem that only 1 working is working at a time, but I have to use both, please help me.

    Read the article

  • Getting Undefined index errors when trying to use $_POST

    - by Apoorv Agrawal
    I'm getting the following error messages: Notice: Undefined index: name in C:\xampp\htdocs\ApoorvProject\PostMethod.php on line 7 Notice: Undefined index: email in C:\xampp\htdocs\ApoorvProject\PostMethod.php on line 9 This is what line 7 and line 9 contains: echo $_POST["name"]; echo "<br>"; echo $_POST["email"]; This is the body of my HTML documnent: <form action="PostMethod.php" method="post"> Name: <input type="text" name="name" /> Email: <input type="text" name="email" /> <input type="submit" /> </form> PostMethod.php is the name of my PHP file.

    Read the article

  • Dump output from REPL

    - by Ankit Soni
    I'm writing SML programs, and I'd like a way to quickly see the output from running a program in the REPL without actually running the REPL (to quickly see if a program has syntax errors - I plan to use this as a make program for .sml files in vim to view the output inside vim).. Currently, I have this: sml file.sml | echo -e "\004" So it runs the program, and then echoes Ctrl-D to exit the REPL. The problem is that its too quick to send the Ctrl-D key, so there is no output. I tried this too: sml file.sml | sleep 2 ; echo -e "\004" But that isn't doing it either. Any ideas on how I can get a dump of the output from the REPL?

    Read the article

  • Cannot find /Users/user/tomcat/bin/setclasspath.sh

    - by Ankit
    This file is needed to run this program. I am new to Mac OS X and its terminal. I am installing Apache Tomcat, using steps provided through this URL http://www.editrocket.com/articles/tomcat_mac.html, but when I run sh startup.sh I get the following error: Cannot find /Users/user/tomcat/bin/setclasspath.sh This file is needed to run this program. Whereas setclasspath.sh already exists at this location.

    Read the article

  • What's the best way to forward traffic on a specific port to another machine?

    - by Ankit
    The setup I have is this: [client01] <-A-> [server01] <-B-> [server02] client01 can access port 9300 on server01 (connection A). server01 can access port 9300 on server02 (connection B). What's the best way to make all traffic on port 9300 to server01 go to port 9300 on server02? I can successfully do this with an ssh tunnel from client01 to server01 to server02, but I don't want to have to run ssh on client01. When I ssh from server01 to server02 forwarding port 9300 (ssh -g -L9300:localhost:9300 server02 on server01), it doesn't work -- am I using the wrong command?

    Read the article

  • SF Bay Area Event, November 1st: SPARC 25th Anniversary at Computer History Museum

    - by Larry Wake
    For those of you in the Bay Area, there's going to be what promises to be a very interesting event at the Computer History Museum on Thursday, November 1st at 11 AM: "SPARC at 25: Past, Present and Future". The panel event will feature Sun Microsystems founders Bill Joy and Andy Bechtolsheim, SPARC luminaries such as Anant Agrawal and David Patterson, former Sun VP Bernard Lacroute, plus Oracle executives Mark Hurd, John Fowler and Rick Hetherington. For those of you who can't attend, we expect to have video of the event afterward, but if you can make it in person, this is a unique opportunity to hear from industry pioneers, as well as get insights into future SPARC innovations. Plus, you can see SPARC (and non-SPARC) related exhibits from both the Computer History Museum and the personal collections of some of the panel participants. I hope you can join us; Register today.

    Read the article

  • Jon Skeet??????? [closed]

    - by Ankit Sachan
    Hello all, I have heard the name Jon Skeet in several forums, some times in "inappropriate places". Kindly shed some light on this. Is there is really some "Jon Skeet" or its just a myth among fraternity.

    Read the article

  • Novell EDirectory | How can it help in career

    - by Ankit
    Hi, I am into microsoft technology and getting a project which is Implementation of IAM (Novell Edirectory). Does it makes sense to move from .Net as i have experience of 4 years now on it. Since i dont have any knowledge as to how this tech is and how it can help me, so any suggestion or advice will help. Thanks for your advice in advance.

    Read the article

  • Why this not working in IE ?

    - by ankit vishwakarma
    <script> FB.init({ appId : '117680911578526', status : true, // check login status cookie : true, // enable cookies to allow the server to access the session xfbml : true // parse XFBML }); //alert(FB.getSession()); /*window.fbAsyncInit = function() { FB.Canvas.setAutoResize(); }*/ </script> <script type="text/javascript"> FB.ui( { // http://www.facebook.com/connect/prompt_feed.php?action_links=%5B%7B%22text%22%3A%22Movies%22%2C%22href%22%3A%22http%3A%2F%2Fapps.facebook.com%2Fhindi_movies%2F%22%7D%5D&api_key=117680911578526&attachment=%7B%22name%22%3A%22Raavan%20%22%2C%22href%22%3A%22http%3A%2F%2Fapps.facebook.com%2Fhindi_movies%2Fmovie%2F6%22%2C%22caption%22%3A%22I%20reviewed%20Raavan%20%20movie%20on%20HindiPix%22%2C%22media%22%3A%5B%7B%22type%22%3A%22image%22%2C%22src%22%3A%22http%3A%2F%2Fmovies.kewlsocial.com%2Fmovies%2Fuploads%2Fmovies%2FRaavna_movie_small_thumb.jpg%22%2C%22href%22%3A%22http%3A%2F%2Fapps.facebook.com%2Fhindi_movies%2Fmovie%2F6%22%7D%5D%7D&callback=http%3A%2F%2Fstatic.ak.fbcdn.net%2Fconnect%2Fxd_proxy.php%23%3F%3D%26cb%3Df1630e903ba2956%26origin%3Dhttp%253A%252F%252Fmovies.kewlsocial.com%252Ff33a89873048d9c%26relation%3Dparent%26transport%3Dflash%26frame%3Df1395ad7dcd52ce%26result%3D%2522xxRESULTTOKENxx%2522&channel_url=http%3A%2F%2Fstatic.ak.fbcdn.net%2Fconnect%2Fxd_proxy.php%23%3F%3D%26cb%3Dfc544c0f809639%26origin%3Dhttp%253A%252F%252Fmovies.kewlsocial.com%252Ff33a89873048d9c%26relation%3Dparent.parent%26transport%3Dflash&display=dialog&locale=en_US&message=&method=stream.publish&sdk=joey&user_prompt_message=Share%20your%20thoughts%20about%20movie method: 'stream.publish', //auto_publish: true, display: 'dialog', message: '' , //some default msg in textbox attachment: { name: '<?=$movie['movie_title']?>', caption: 'I reviewed <?=$movie['movie_title']?> movie on HindiPix', href: 'http://apps.facebook.com/hindi_movies/movie/<?=$this->uri->segment(3)?>', media:[{ 'type':'image', 'src':'http://movies.kewlsocial.com/movies/uploads/movies/<?=$movie['movie_image']?>', 'href':'http://apps.facebook.com/hindi_movies/movie/<?=$this->uri->segment(3)?>' }] } , action_links: [{ text: 'Movies', href: 'http://apps.facebook.com/hindi_movies/' }], //user_message_prompt: 'Radhey' user_prompt_message: 'Share your thoughts about movie' }/*, function(response) { if (response && response.post_id) { alert('Post was published.'); } else { alert('Post was not published.'); } }*/ ); </script>

    Read the article

  • Django-modpython project in a directory

    - by Ankit Jaiswal
    Hi All, I am deploying a Django project on apache server with mod_python in linux. I have created a directory structure like: /var/www/html/django/demoInstall where demoInstall is my project. In the httpd.conf I have put the following code. <Location "/django/demoInstall"> SetHandler python-program PythonHandler django.core.handlers.modpython SetEnv DJANGO_SETTINGS_MODULE demoInstall.settings PythonOption django.root django/demoInstall PythonDebug On PythonPath "['/var/www/html/django'] + sys.path" </Location> It is getting me the django environment but the issue is that the urls mentioned in urls.py are not working correctly. In my url file I have mentioned the url like: (r'^$', views.index), Now, in the browser I am putting the url like : http://domainname/django/demoInstall/ and I am expecting the views.index to be invoked. But I guess it is expecting the url to be only: http://domainname/ . When I change the url mapping to: (r'^django/demoInstall$', views.index), it works fine. Please suggest as I do not want to change all the mappings in url config file. Thanks in advance.

    Read the article

  • How to make Processes Run Parallel in Erlang?

    - by Ankit S
    Hello, startTrains() -> TotalDist = 100, Trains = [trainA,trainB ], PID = spawn(fun() -> train(1,length(Trains)) end), [ PID ! {self(),TrainData,TotalDist} || TrainData <- Trains], receive {_From, Mesg} -> error_logger:info_msg("~n Mesg ~p ~n",[Mesg]) after 10500 -> refresh end. so, I created Two Processes named trainA, trainB. I want to increment these process by 5 till it gets 100. I made different processes to make each of the train (process) increments its position parallely. But I was surprised to get the output sequentially i.e process trainA ends then process trainB starts. But I want to increment themselves at simultaneously. I want to run processes like this trainA 10 trainB 0 trainA 15 trainB 5 .... trainA 100 trainB 100 but I m getting trainA 0 .... trainA 90 trainA 95 trainA 100 trainA ends trainB 0 trainB 5 trainB 10 ..... trainB 100 How to make the processes run parallel/simultaneously? Hope you get my Q's. Please help me.

    Read the article

  • Sencha Touch Nestedlist JSON format Example

    - by Ankit Shah
    Hello Friends, I'm new to sencha. Using Sencha touch. I would like to make nested listing like first of list comes, when click on one of the link it goes to another listing, when click on second list's any link it opens image like that. http://dev.sencha.com/deploy/touch/examples/nestedlist/ Above example is perfectly suitable for this one more than that below application. http://touchstyle.mobi/app/ When i'm doing any modification in http://dev.sencha.com/deploy/touch/examples/nestedlist/ it gives no error or warning i'm using Fedora 11 linux Google Chrome. Can anybody tell me what is the JSON perfect format for this nested listing. I will do it for dynamic. So if anyone help to get static nested list it would be better.

    Read the article

  • Unable to checkout log4j repository

    - by ankit
    I'm using tortoiseSVN to checkout the log4j v1.2 source from - http://svn.apache.org/repos/asf/logging/log4j/trunk But i keep getting this error: Error: OPTIONS of '': Could not Error: resolve hostname `svn.apache.org': No such host is known. The funny thing is that i can access 'svn.apache.org' from my browser but if i try to ping it from the command prompt, it says host not found. Does any body else face this problem? Is there any other way to get the source for log4j v1.2?

    Read the article

< Previous Page | 1 2 3 4 5 6  | Next Page >