first

jquery apply an attribute to only the first element?

I'm trying to set an a name to the first link with a specific class, but I'm kinda unsure as to how to apply something to just the first one? So, I'm trying to find the first div with the sample class and then wrap the text within the div.title with the : <div class="sample"> <div class="title"><a name="thisone">title</a></div> <p>blah...

asp.net mvc select question

i have model, in model such method public Pages GetPage(int? id) { return _dataContext.Pages.First(p => p.id == id); } if i pass whong parameter (like 123333-no record it database), it throw exception Sequence contains no elements can you suggest correct code version, or simply use try\catch? ...

[Iphone Dev] Change the first character in each word of a string to uppercase

Hey guys, I found the function below : CFStringCapitalize "Changes the first character in each word of a string to uppercase (if it is a lowercase alphabetical character)." void CFStringCapitalize ( CFMutableStringRef theString, CFLocaleRef locale ); Does anyone know how to use it with my NSMutableString ? Thank you, Gaut...

php - get the first key for an element?

I'm trying to add an extra class tag if an element / value is the first one found in an array. The problem is, I don't really know what the key will be... A minified example of the array Array ( [0] => Array( id => 1 name = Miller ) [1] => Array( id => 4 nam...

jQuery not first selector found by attributeContains

Hello there, i have problem with selecting "not first selector" with using attributeContains jQuery('div[id*="abc"]:not(:first)').hide(); Thanks a lot for help ...

Money reservation with First Data API on client credit card

I need to know is it possible to reserve or lock money with First Data API. Actually I don't know if process I am looking for is actually called "reservation", but I am thinking of standard procedure of locking certain amount of money on client CC so that client cannot spend it but I as a merchant, can return money without any cost to ba...

jquery fail to retrieve accurate data from sibling field.

wonder what's wrong <table id=tblDomainVersion> <tr> <td>Version</td> <td>No of sites</td> </tr> <tr> <td class=clsversion>1.25</td> <td><a id=expanddomain>3 sites</a><span id=spanshowall></span></td> </tr> <tr> <td class=clsversion>1.37</td> <td><a id=expanddomain>7 sites</a><span id=spanshowall></span></td> ...

PHP - How to remove the first number in a string?

Hello. How can I remove the first number in a string? Say if I had these 48 numbers seperated with a ',' (comma): 8,5,8,10,15,20,27,25,60,31,25,39,25,31,26,28,80,28,27,31,27,29,26,35,8,5,8,10,15,20,27,25,60,31,25,39,25,31,26,28,80,28,27,31,27,29,26,35 How would I remove the "8," from the string? Thanks. ...

How can you tell a normal person about first program?

How can you tell a normal person (i.e. your mom, grand mom, your little brother) how was the first program was written? They ask this question a lot and I really can't give an answer they can understand. ...

mysql first record retrieval

While very easy to do in Perl or PHP, I cannot figure how to use mysql only to extract the first unique occurence of a record. For example, given the following table: Name Date Time Sale John 2010-09-12 10:22:22 500 Bill 2010-08-12 09:22:37 2000 John 2010-09-13 10:22:22 500 Sue 2010-09-0...

How to Check the First RadioButton in a ToolBar

I have a ToolBar that is bound to an asynchronously populated ObservableCollection. For the ToolBar's ItemTemplate I use a DataTemplate to wrap my bound items in RadioButtons. What I want to do is programmatically check the first RadioButton in the ToolBar. I have tried using the ToolBar's ItemContainerGenerator but the relevant metho...

first Occurrence Of Non Blank Cell vba

Hi, I am trying to write VBA code which works on my Excel sheet. Range("A65536").End(xlUp).Row gives me the row number of the last non blank cell. similarly i am trying to get the row number of the first non blank cell in that particular column. Thanks in advance. madhu ...

grails find first

I know this is simple question but taking more time How to find first record from table in grails . I need to get only the first record with out knowing the id number . Is there any method like find :first in grails ? thanks in advance . ...

jquery :first selector loop problem

$(".wrap table tr:first").addClass("tr-top"); it works for the first table, but i have many tables under the div .wrap. what should i do? thanks! ...

How to get first level of children by LINQ

I have such XMl <root> <list> <list> <topic></topic> <topic></topic> </list> <topic></topic> <topic></topic> </list> <topic></topic> <topic></topic> <topic></topic> </root> I need to get the first level of children: <list></list> <topic></topic> <topic></topi...

Git: How to clone the first commit?

Could anyone tell me how to clone the first commit? I don't want to delete recent commits, just make a clone copy of the initial state so I can grab some of the files. ...

Best Performance for jQuery Selector

This gets and stores the background color of a specific link: var origColor = $("ul.relatedAlbums li a").css("background-color"); But there are a lot of those links, and I get the feeling that this is ineffecient. I imagine there's a way to tell the selector query to stop after the first match, and thus save on processing time. Here'...

recursive method - not all code paths return a value!

it says not all code paths return a value private string Fisrt(string nonTerminal) { for (int j = 0; j < 6; j++) { if (Tokens[j, 0] == nonTerminal) { if (char.IsLower((char)Tokens[j, 3][0])) return (Tokens[j, 3]); else Fis...

C#: Set initial DayOfWeek as Monday not Sunday

Hello, Is there a way to set the first DayOfWeek as Monday = 0 not Sunday? (int)dateList[0].DayOfWeek == 0) // 0 = Sunday ...

jquery - select first element which doesn't have "display:none"

<td class="profile"> <% var usedColors = ViewData["usedColors"] as string[]; %> <a class="profile-color" href="#" style="background: #c00; <% if (usedColors.Contains("#c00") && Model.Color != "#c00") {%>display:none<% }%>" id="color-c00">Color1</a> <a class="profile-color" href="#" style="background: #3491c2; <% if (usedCo...