Search Results

Search found 14593 results on 584 pages for 'pat inside'.

Page 58/584 | < Previous Page | 54 55 56 57 58 59 60 61 62 63 64 65  | Next Page >

  • Only change img inside children li

    - by steve
    Say my code is as follows: <ul> <li><img /></li> <li> <ul> <li><img /></li> </ul> </li> </ul> I'm trying to set a default size for the first img tag, but not affect the second one. everything I do affects the other one as well. Currently I have tried: $('ul#gallery > li').find('img').css('width','650px'); $('ul#gallery > li img').css('width','650px'); among others, but nothing works.

    Read the article

  • Do I need to echo html inside included php file

    - by UmeRonaldo
    I just learned how to include php .Here's the index or main php file <!DOCTYPE HTML> <html> <head> </head> <body> <?php include 'header.php'; ?> </body> </html> now in header.php file which way is better to print html Way 1 directly use html without php <header> <h1>Header</h1> </header> Way 2 Using php and echo <?php echo ' <header> <h1>Header</h1> </header> ' ?> Another quick question. Will it work if I use .html for the base or index file ?? sorry for my bad english

    Read the article

  • date comparison inside a list returned

    - by rob
    I have a ArrayList returned from a service which contains date-timestamp as String values (with values: 2010-05-06T23:38:18,2010-05-06T23:32:52,2010-04-28T18:23:06,2010-04-27T20:34:02,2010-04-27T20:37:02) to be more specific, This is part of a parent ArrayList ObjectHistory. This list contains the datestamp and serial number. I need to pick the correct serial number. Objecthistory is the List object and I need to get the latest timestamp within this ObjectHistory. I need to pick the latest timestamp from this Arraylist in Java 6. How should I be doing this? Should I do convert these values into calendar-time? I am in panic mode as this has to be done directly in production.

    Read the article

  • PHP - Use isset inside function not working..?

    - by pnichols
    I have a PHP script that when loaded, check first if it was loaded via a POST, if not if GET['id'] is a number. Now I know I could do this like this: if(isset($_GET['id']) AND isNum($_GET['id'])) { ... } function isNum($data) { $data = sanitize($data); if ( ctype_digit($data) ) { return true; } else { return false; } } But I would like to do it this way: if(isNum($_GET['id'])) { ... } function isNum($data) { if ( isset($data) ) { $data = sanitize($data); if ( ctype_digit($data) ) { return true; } else { return false; } } else { return false; } } When I try it this way, if $_GET['id'] isn't set, I get a warning of undefined index: id... It's like as soon as I put my $_GET['id'] within my function call, it sends a warning... Even though my function will check if that var is set or not... Is there another way to do what I want to do, or am I forced to always check isset then add my other requirements..??

    Read the article

  • PHP: Remove all fcn not acting as expected, Code Inside

    - by Josh K
    I made this simple function (remove all $elem from $array): function remall($array, $elem) { for($i=0; $i < count($array); $i++) if($array[$i] == $elem) unset($array[$i]); $newarray = array_values($array); return $newarray; } But it isn't working perfectly, here are some inputs and outputs $u = array(1, 7, 2, 7, 3, 7, 4, 7, 5, 7, 6, 7); $r = remall($u, 7); Output of $r: 12345767 $n = array(7, 7, 1, 7, 3, 4, 6, 7, 2, 3, 1, -3, 10, 11, 7, 7, 7, 2, 7); $r = remall($n, 7); Output of $r: 1346231-30117727 Notice how there are still 7s in my outputs. Also, My function will only be removing numbers from an array. Let me know if you spot something, thanks.

    Read the article

  • python: creating a list inside a dictionary

    - by user1871081
    I just started using python and I'm trying to create a program that will read a file that looks like this: AAA x 111 AAB x 111 AAA x 112 AAC x 123 ... the file is 50 lines long and I'm trying to make the letters into keys in a dictionary and the numbers lists that correspond with the keys. I want the output to look like this: {AAA: ['111', '112'], AAB: ['111'], AAC: [123], ...} This is what I've tried file = open("filename.txt", "r") readline = file.readline().rstrip() while readline!= "": list = [] list = readline.split(" ") j = list.index("x") k = list[0:j] v = list[p + 1:] d = {} if k in d == False d[k] = [] d[k].append(v) else d[k].append(v) readline = file.readline().rstrip() I keep getting syntax errors on my if statement and I can't figure out what I've done wrong.

    Read the article

  • asp.net c# ToolTip with image inside of it

    - by Web Dev
    I currently have a hyperlink control as such: I am setting the logo text of it as such within my grid: HyperLink logoLink = (HyperLink)e.Item.FindControl("logoLink"); logoLink.Text = lblsub + ".gif"; What I like to do is that when a user clicks on the hyperlink, I like the gif file to show witin a tooltip. what is the easiest way of doint this? The image is in the Image folder so the path would be as such: Images/ + lblsub + ".gif"; Note that I am using ASP.NET C#. Thanks in advance

    Read the article

  • Creating NSApp inside another nsviewcontroller

    - by DesperateLearner
    I have opened my mac app in a new nsviewcontroller - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { self.masterViewController = [[MasterViewController alloc] initWithNibName:@"MasterViewController" bundle:nil]; [self.window.contentView addSubview:self.masterViewController.view]; self.masterViewController.view.frame = ((NSView*)self.window.contentView).bounds; } Masterviewcontroller has a customized view in the .xib file. When I need to create an NSApp sheet in this NSViewController for another, I'm calling [NSApp beginSheet:_newDataWindow modalForWindow:window modalDelegate:self didEndSelector:nil contextInfo:nil]; I have to use 'window' for beginSheetModalForWindow. But how do I call it from another NSViewController. I end up with compilation error.

    Read the article

  • Search box inside a div. Django

    - by Juliette Dupuis
    In my django app I display a list of elements (friends name) thanks to a loop: <div> {% for friend in group %} <p>{{ friend.name }} <p> {% endfor %} </div> I would like to create a search box on the top of my list in order to be able to find only the friends the user wants. I would like the search bar does not need to click to send the request (an example is the Airtime searchbox on top of the facebook friends list). I have absolutely no idea on how to do that, and I'm looking for hints or tips to start. Thank you very much for your help.

    Read the article

  • ruby code inside quotes

    - by chief
    I would like to embed videos and have managed to to do so by manually coding the url in where needed. If my url is stored in <%= @vid.url %, how can I use that string for the value and src parameter? <object width="480" height="385"><param name="movie" value="http://www.youtube.com/videos/abc123"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/videos/abc123" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object>

    Read the article

  • Search a List inside another with IQueryable

    - by ovini poornima
    public static IQueryable<Institution> WithFunds(this IQueryable<Institution> query, IEnumerable<Fund> allowedFunds) { return query. } I want to get the query to return all Institutions having any of the Fund given in 'allowedFunds' list in Institution.Funds. Please help. My class hierarchy goes like this. public partial class Institution { public int Id { get; set; } public virtual ICollection<Fund> Funds { get; set; } } public partial class Fund { public int Id { get; set; } public virtual Institution Institution { get; set; } }

    Read the article

  • (PHP) - Changing two substrings inside a string

    - by Imp4ct
    This is my BIG string BEGIN:VEVENT UID:xxxxxx DTSTAMP:xxxxxx STATUS:CONFIRMED CLASS:PUBLIC URL:xxxxxx SUMMARY:YYYYYYY DESCRIPTION:xxxxxx; YYYYYYY; DTSTART:xxxxxx DTEND:xxxxxx GEO:xxxxxx LOCATION:xxxxxx END:VEVENT I need to change position of the two "YYYYYYY" in SUMMARY/DESCRIPTION I have to replace them without being specific since it is implemented in a much larger function. (This string is already sliced out of a 3700 line - Calendar) pls help! :)

    Read the article

  • Check if previous clicked value is inside an array

    - by Lelly
    I have a list with different categories. All the list item are clickable. I want the user to pick between 1 and 3 items. They can toggle their choice, but maximum is alway 3. So far, so good. Where it get tricky for me, is that I have some special categories that can't be combined with any others. When a user click on one of these, all the other categories deselect and they can't add any other, (these item have only 1 category selection possible) Exemple: Let's say "Car" is a special category. If they click on Car, everything else deselect, Car is selected, and they can't select anything else. BUT they can click again on Car to deselect it, and from there the logic start over. What's missing in my code is the part in bold just above this. My code: $j('.chooseCat li').on('click',function(){ var $this = $j(this); //list item clicked var catId = $this.children("a").attr("rel"); // list item id var specialCat = ['6','36','63']; if ($this.hasClass("selected")) { $this.removeClass("selected"); $j("#categorySuggestions p.error").hide("fast") } else { if( $j.inArray(catId, specialCat) !== -1 ) { $j('.chooseCat li').removeClass("selected"); $this.addClass("selected"); } else { if ($j('.chooseCat li.selected').length <= 2){ $this.addClass("selected"); } else { $j("#categorySuggestions p.error").show("fast").html("You cannot select any more categories"); } } } }); A working jsFiddle of where Iam at: http://jsfiddle.net/nfQum/9/

    Read the article

  • removeChild on a li inside a ul inside a div with an id?

    - by Prozaker
    I have the following code on a webpage: <div id="emails"> <ul> <li>email1</li> <li>email2</li> </ul> </div> <a href="#" onClick="javascript:deleteEmail">click</a> and I want to remove the first email, i've been trying with this: function deleteEmail(){ var ul = document.getElementById('alt_emails').getElementsByTagName('ul'); ul.removeChild(ul.childNodes[0]); } im kinda new to Javascript DOM, so if there's a better way to do it, please let me know. Note: I would like to do this without any kind of js framework.

    Read the article

  • access parametrically values of variables inside environments

    - by Apostolos
    Let's say we have one or more environments and variables in them. My question is how we access the values of these variables, parametrically. rm(list = ls()) env1 <- new.env() env1$var1 <- "value1" env2 <- new.env() env2$var2 <- "value2" env <- ls.str(mode="environment") # We get the environments var <- ls.str(eval(parse(text = env[1])))# We get the variables of an environment eval(var[1]) # We fail to get the value of a variable Thank you all, in advance

    Read the article

  • Putting a variable inside a string (python)

    - by Gish
    Hi I am quite new to python and this is probably quite a basic question but the help would be much appreciated. I would like to put an int within a string. This is what I am doing at the moment.. end = smooth(data,window_len=40) plot.plot(time[0:len(end)],end) plot.savefig('hanning(40).pdf') #problem line I have to run the program for several different numbers instead of the two 40's. So I'd like to do a loop but inserting the variable like this doesn't work: plot.savefig('hanning',num,'.pdf') Thanks!

    Read the article

  • Rails 2.3: using another models named_scope inside another named_scope

    - by mustafi
    Hi Let's say I have two models like so: class Comment < ActiveRecord::Base belongs_to :user named_scope :about_x :conditions => "comments.text like '%x%')" end class User < ActiveRecord::Base has_many :comments end How can I add a named_scope to the user model like so class User < ActiveRecord::Base has_many :comments named_scope :comments_about_x, :includes => :comments, :comments_named_scope => :about_x end Which allows me to do all_user_comments_about_x = User.comments_about_x The reasoning is I often need to use the comment models about_x named scope logic but I don't want to have "comments.text like '%x%')" scattered around my code. I hope this make sense :) Thank you

    Read the article

  • Way to kill python thread from inside thread?

    - by user859434
    I have some python code that currently performs expensive computation by performing the computation in parallel through many threads. For a given time period, many threads are created and started on the fly that share the same code which is explicitly stated within the run method of the thread. My question is how do I stop/kill a thread at the end of its run method? (the run is only called once) I need to do this in order to create more threads for the next batch of computation. #Example class someThread(threading.Thread): def __init__(self): #some init code def run(self): #Explicitly Stated Code without constant loops #Something performed to stop/kill this thread

    Read the article

  • Disable a control inside a gridview

    - by saeed talaee
    Hi i want to disable link-bottoms control in a grid view with the condition of a special value . for example if the count for a row become 0 ,the link bottom for that row should be invisible . what should i do? where should i write the code? here is cod that i write in row command grid view but it works only of i push the link bottom!! but i want to apply this cod to my page before loading. please guide me int idx = Convert.ToInt32(e.CommandArgument); idx = idx - (GridView1.PageSize * GridView1.PageIndex); int ID = (int)GridView1.DataKeys[idx].Value; string connStr = ConfigurationManager.ConnectionStrings["dbconn"].ConnectionString; SqlConnection sqlconn = new SqlConnection(connStr); SqlCommand sqlcmd = new SqlCommand(); sqlcmd = new SqlCommand("SELECT count(ID) FROM ReviwerArticle where ArticleID=@ArticleID", sqlconn); sqlcmd.Parameters.AddWithValue("@ArticleID", ID); sqlconn.Open(); int count = ((int)sqlcmd.ExecuteScalar()); sqlconn.Close(); if (count == 0) { ((LinkButton)GridView1.Rows[idx].Cells[0].FindControl("LinkButton4") as LinkButton).Visible = false; }

    Read the article

< Previous Page | 54 55 56 57 58 59 60 61 62 63 64 65  | Next Page >