Search Results

Search found 6696 results on 268 pages for 'syntax highlighting'.

Page 50/268 | < Previous Page | 46 47 48 49 50 51 52 53 54 55 56 57  | Next Page >

  • I need objective-C syntax for calculating bmi

    - by Umaid
    Actually I am working on bmi calculator. Where I would like to calculate bmi for height in inches and weight in lbs and also in need of correct formula for height in cm and weight in kgs. I have tried but couldn't calculate actual value coming withing the range as below. It exceeds the range. BMI Categories: * Underweight = <18.5 * Normal weight = 18.5-24.9 * Overweight = 25-29.9 * Obesity = BMI of 30 or greater

    Read the article

  • jQuery Syntax Question, pretty easy I think..

    - by Fuego DeBassi
    Hi all, question: <script type="text/javascript"> $(document).ready(function() { $(".module .caption").hide(); $(".module").hover(function() { $(this).find(".caption").slideDown(); },function() { $(this).find(".caption").slideUp(); }); }); </script> This snippet works great for my purposes, the only caveat is that I need the .module hover function to simultaneously add a class of "under" to all other ".caption"'s that are not $this, and then remove them when the hover ends. So basically I don't want the "module" that is hovered to get the class, I want it to do exactly what I am showing here...sliding .caption up and down on end hover, I just want all other ".caption"s to get the under class when any ".module" is hovered. Just hitting a dead end with what I have been trying, want to do it in the same function. Any ideas?

    Read the article

  • perl - getting a value from a map where the key has a dot

    - by imerez
    I have a map in perl which has been dumped into from some legacy code the name of the key has now changed from simply reqHdrs to reqHdrs.bla $rec->{reqHdrs.bla} My problem is now I cant seem to access this field from the map any ideas ? The following is my error Download Script Output: Bareword "reqHdrs" not allowed while "strict subs" in use

    Read the article

  • Strange PHP syntax

    - by Joseph
    I've been working on php for some time but today when I saw this it came as new to me: if(preg_match('/foo.*bar/','foo is a bar')): echo 'success '; echo 'foo comes before bar'; endif; To my surprise it also runs without error. Can anyone enlighten me?

    Read the article

  • Python: for statement behavior

    - by BandGap
    Hi all. My question concerns the output of this statement: for x in range(4), y in range(4): print x print y Results in: [0, 1, 2, 3] 2 True 2 It seems there is a comparison involved, I just can't figure out why the output is structured like this.

    Read the article

  • FLEX: question about MXML syntax

    - by Patrick
    hi, I would like to know if it is the same to assign properties to my custom component in its own class, or from the parent document. Please see snippet below: Here I assign the property bottom in my custom component class: <?xml version="1.0"?> <mx:LinkButton bottom="20" > <mx:Script> ... Here I assign the property bottom when I use the component in my main MXML file <myComp:Brick bottom="10"/> Am I overriding the original one ? Thanks

    Read the article

  • accessing SQL syntax reference in mysql workbench

    - by dcompiled
    Finding it a little bit tedious migrating to the new Mysql Workbench (5.2.22) even though it has many more features than the older GUI tools. Right now I'm confused why I can't find an SQL reference when I open the Doc Library. Is there a way to access this info within the workbench, I'd prefer not to have to open a browser to access reference info on the web.

    Read the article

  • syntax error, unexpected ',', expecting ')' RoR

    - by McDoku
    I am trying to get a collection select from an another model and I keep getting the above error. Looked everywhere, got rails casts but nothing makes sense. _form.rb <%= f.label :city %><br /> <%= f.collection_select (:share ,:city_id, City.all , :id, :name ) %> It highlights 'form' on the error report <h1>New share</h1> <%= render 'form' %> <%= link_to 'Back', shares_path %> Here are my models... class Share include Mongoid::Document field :name, type: String field :type, type: String field :summary, type: String field :description, type: String field :city, type: String embedded_in :city has_many :category end class City include Mongoid::Document embedded_in :share field :name, type: String field :country, type: String attr_accessible :name, :city_id, :id end Searched everywhere and I cannot figure it out. It must be something silly.

    Read the article

  • Simple jQuery syntax help, don't know where I've gone wrong

    - by Jascination
    I'm having trouble with a jQuery code at the moment, I know WHERE the problem lies, but I don't know what the problem is exactly. Probably very basic, but I'm new to this. You can see a (non)working fiddle here: http://www.jsfiddle.net/CvZeQ/ Basically I want to set different .click function based on whatever is selected (I have 5 image maps, each with a different #mapname, and want each to pertain to a different variable (answer1, answer2, answer3...) so as to store the selected 'answer' for each map.) Here is the code I'm using for one of the maps: $(window).load(function(){ //Get cookies when page loaded var useranswers=$.cookie('survery'); useranswers= JSON.parse (useranswers); // do something with previous answers //#shape functions $('#shape area').hover( function(e){ $('#'+ this.alt).addClass('hover'); }, function(e){ $('#'+ this.alt).removeClass('hover'); } ).click( function(e){ $('img.selected-region').removeClass('selected-region'); }, function(e){ $('#'+ this.alt).addClass('selected-region'); }, function(e){ var answer1 = $(this).attr("class"); }); }); I know the problem lies somewhere with the .click function, but I'm not entirely sure what I've done wrong. Any help would be greatly appreciated.

    Read the article

  • Solr OR query for different combination of facets

    - by Ritesh M Nayak
    I have a sample Solr schema as follows isPublic = boolean source = facebook| twitter | wordpress I want to write a query which returns all documents from the index which matches either the isPublic = true or isPublic is false and source= facebook. Something like this solrUrl/?q=blah&fq=(isPublic:true OR (isPublic:false AND source:facebook)) Is such a thing possible or should I search the index two times with each of these conditions and then combine + de-duplicate the results?

    Read the article

  • C# syntax to get access to webcontrol in different file (aspx)

    - by Josh
    Within my Website project, I have some aspx pages, javascript files, and a custom C# class I called MyCustomReport. I placed a Image box with an ID of Image1 inside SelectionReport.aspx. I need to get access to that Image1 inside MyCustomReport.cs so I can turn it on and off based on conditions. What code do I need to do this? Thanks everyone

    Read the article

  • Identifying the parts of this typedef struct in C?

    - by Tommy
    Please help me identify the parts of this typdef struct and what each part does and how it can be used: typedef struct my_struct { int a; int b; int c; } struct_int, *p_s; struct_int struct_array[5]; my_struct is the...? struct_int is the...? *p_s is the...and can be used to point to what? struct_array is the...? Also, when creating the array of structs, why do we use struct_int instead of my_struct ? Thank You!

    Read the article

  • java for loop not working

    - by Steve
    I hope this isn't a stupid question but I have looked up every example I can find and it still seems like I have this code right and it still isn't working... I enter one number and it moves on to the next line of code instead of looping. I'm using this to fill an array with user input numbers. I appreciate any help, thanks. for(i=0; i<9; i++); { System.out.println ("Please enter a number:"); Num[i] = keyboard.nextDouble(); Sum += Num[i]; Product *= Num[i]; }

    Read the article

  • Acceptable to have spaces before dot?

    - by Rudy
    What is the general opinion on the 2nd indentation method below. // Normal indentation a.Value = "foobar"; ab.Checked = false; foo.Value = "foobar"; foobar.Checked = true; // Spaces before the dot to align the properties/methods a .Value = "foobar"; ab .Checked = false; foo .Value = "foobar"; foobar.Checked = true; This should probably be a wiki, but I either don't have enough privileges or don't know how to change it.

    Read the article

  • How is the syntax for stl iterators implemented?

    - by Liberalkid
    I've been working on writing a library in my spare time to familiarize myself more with c++ and singular value decomposition. I've been working on writing an Iterator class and I'm entirely capable of writing the functionality and I have already for my own currently MatrixIterator class. I'm guessing that it involves namespaces because: vector<int>::iterator Would appear to be an iterator from the namespace vector, but namespaces are another topic which I'm not familiar with. Mainly I'm asking what would it involve to implement an iterator such that it could be referenced in a similar way to the stl iterators. I'm also aware that I could use boost.iterators or something similar to save myself a lot of work, but I'm more interested in learning all of the details that go into something like this.

    Read the article

  • ANTLR C grammar, optional init_declarator_list?

    - by eisbaw
    Hello, In the ANSI C grammar for ANTLR v3 ( http://antlr.org/grammar/1153358328744/C.g ), how can init_declarator_list be optional in rule declaration ? Instead of: | declaration_specifiers init_declarator_list? ';' -I would say: | declaration_specifiers init_declarator_list ';' What part of the C standard allows statements like: int; EDIT: I just tried, it is allowed! Okay then, why is it allowed?

    Read the article

  • Proper usage of double and single quotes?

    - by Phox
    I'm talking about the performance increase here. From all I know you can echo variables in double quotes ("), like so: <?php echo "You are $yourAge years old"; ?> But single quotes will just return You are $yourAge years old. But what about performance differences? I've always gone by the rule that single quotes are faster because the PHP interpreter doesn't have to search through the string for variables. But I'm seeing more and more blog and forum posts on the web saying differently. Does anyone actually have any information on this subject? Perhaps benchmark tests or something?

    Read the article

  • Syntax error. Help with one small JS snippet :(

    - by Bogdan
    Hey guys. I don't know much JS, but I wanted to do some quick work with jQuery. But I've been staring at this for about an hour and I don't understand what I missed: <script type="text/javascript"> $('#qty_6035').change(function () { var substractedQty, stockQty, remQty; substractedQty = (int) $('#qty_6035').val(); // missing ; before statement stockQty = (int) $('#orig_qty_6035').val(); $('#rem_qty_6035').html(stockQty-substractedQty); }); </script> jQuery library is included at the beggining of the document. Thanks.

    Read the article

  • syntax for generating an objectForKey from an array

    - by Brian
    I'm having success when I use this code to get a string from an array called "fileList": cell.timeBeganLabel.text = [[[self.fileList objectAtIndex:[indexPath row]] lastPathComponent] stringByDeletingPathExtension]; so I expected the same code to generate the same string as a key for me in this: NSDictionary *stats = [thisRecordingsStats objectForKey:[[[self.fileList objectAtIndex:[indexPath row]] lastPathComponent] stringByDeletingPathExtension]]; cell.durationLabel.text = [stats objectForKey:@"duration"]; or this: NSDictionary *stats = [thisRecordingsStats objectForKey:@"%@",[[[self.fileList objectAtIndex:[indexPath row]] lastPathComponent] stringByDeletingPathExtension]]; Both build without error, and the log shows my data is there: but I'm getting a blank UILabel. Have I not written the dynamic key generator correctly?

    Read the article

< Previous Page | 46 47 48 49 50 51 52 53 54 55 56 57  | Next Page >