w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to add text field like in sms (a label count the number of charterer left below ).in jquery mobile
You can use this logic to display no of characters left after entering some text. HTML: <textarea id="field"></textarea> <div id="charNum">500</div> JS: $(document).ready(function() { $('#field').keydown(function() { var len = $(this).val().length; if (len >= 500) { $(this).val() = $(this).substring(0, 500); } else { $('#charNum').text(500 - len); } }); }); Find the working demo here: Demo

Categories : Jquery

How to make a text in a label as url, to move to webpage / make a call by click on a text in a label
It's pretty much all the same idea, all applications in iOS can be opened with using the format appShortName://whatyouwantToHandle, for websites its just http://myurl To make a call, it's tel: NSURL *phoneURL = [NSURL URLWithString:@"tel:+123456789"]; [[UIApplication sharedApplication] openURL:phoneURL]; To start composing an email, it's mailto:, and it supports GET parameters to fill-out the email. const NSString* mailFormat = @"mailto:%@?subject=%@&body=%@"; const NSString* mailEmails = @"person1@gmail.com,person2@gmail.com"; const NSString* mailBody = @"This is the mail body Hi!"); const NSString* mailSubject = @"This is the mail Subject!"; NSString *urlString = [NSString stringWithFormat:(NSString*)mailFormat,[mailEmails stringByAddingPercentEscapesUsingEncoding:NSUTF8S

Categories : Iphone

Highcharts x axis label text wrapping lost on setting label step
It's a bit of a hack, but you could replace each space in the name with <br /> by using the formatter: labels: { step: 1, formatter: function () { return this.value.replace(/ /g, '<br />'); } } It's not exactly what you want as it doesn't split the name according to the space available between ticks, but maybe you can improve the formatter to better suit your needs (splitting by a given n characters for example instead of by space). See it running here.

Categories : Highcharts

css position label text in the true center (vertical and horizontal) without moving the label
You can use line-height: 30px; to center a single line of text instead. The 30px needs to be the same value as the height of the element you wish to vertically center text in. Note: The fiddle has height:40px whereas the code in question has height:30px. Just choose the line-height to match the height. vertical-align would actually moving the entire <label> (and text) down but only applies to inline-level and table-cell elements. It is not applying in your case as the <label> is floated.

Categories : HTML

If input box is empty show label, if there is text, hide label
yes there is, use keyup() function.. $('#name').keyup(function(){ if($(this).val() == ''){ $(this).prev().show(); }else{ $(this).prev().hide(); } }); this is considering your label is always the previous element of textbox else you can use.. $('#name').keyup(function(){ if($(this).val() == ''){ $('label[for="name"]').show(); }else{ $('label[for="name"]').hide(); } }); this gets that particular label whose attribute for is name.

Categories : Jquery

How can you drag and drop a list item to a label so it's the label's text in C#?
Test for correct type and then grab it: private void posLB_DragDrop(object sender, DragEventArgs e) { if (e.Data.GetDataPresent(DataFormats.Text)) { String s = e.Data.GetData(DataFormats.Text) as String; if (!String.IsNullOrEmpty(s)) posLB.Text = s; } }

Categories : C#

allow user to tap label and then tap buttons to edit label.text?
To know which UILabel has been touched add a tap gesture to each label which triggers an action. In that actions store which label has been touched in e.g. a property. For the buttons, just connect them to action methods (could also be a single one), inside these methods do your calculation and updated the label indicated by the property described above.

Categories : IOS

Show text box text length on status label
Set a textbox's textchanged event. and write this code in it: label1.text = textbox1.Text.Length.ToString(); Complete code: textBox1.TextChanged +=textBox1_TextChanged; private void textBox1_TextChanged(object sender, EventArgs e) { label1.text = textbox1.Text.Length.ToString(); }

Categories : C#

How to avoid text wrapping in a td with text and a right-floated label
You need to define a min-width property for your with the class nowrap, like so: td.nowrap { min-width: 129px; } The 129px value was calculated for your fiddle example. Since content inside the table might change, the best way (maybe not the "cleanest" one though) to do this is calculating the required min width of the td at page load and set the min-width value then. In your example Bootstrap makes the first 's width at 300px, so it's quite complex to calculate. I will try to get a jQuery example ready for you later today.

Categories : HTML

Two text colors in one UITableViewCell text label
This question addresses getting part of a string, which you would need to do. Instead of modifying the text with BOLD though, you can use this question to get an idea of how to change the color.

Categories : IOS

Can I increase number of SVM training label in OpenCV?
libSVM uses "one vs all" technique to represent multi-class problem using the binary SVM classifier. It means, that if you have N (>2) labels, libSVM will generate N distinct classifiers, each with different data labeling (so it expresses the "one vs all" scheme). This can lead to the memory problems that you are experiencing. Some other models like for example neural networks or knn can represent the multi-class classification without such overhead. So if your data is to large to treat it the way libsvm does you have at least three possible options: Change SVM to some other model, which can directly addresss mutli-label classification Try to use other, lighter implementation of the library, especially that opencv does not use the most recent implementation of libsvm (it could help, b

Categories : C++

How to display string value in label when the value is null and some number
You can make condition to check null in your string and then replace this with whatever you want. id yourValue=[youJSONDict objectForKey:@"total"];; if ([yourValue isKindOfClass:[NSNull class]]) { yourLabel.text=@"0"; } else{ yourLabel.text=[NSString stringWithFormat:@"%@",yourValue]; }

Categories : Iphone

Trying to update label phone number in Address Book
I Found a solution: The code below is working fine: - (void)displayPerson:(ABRecordRef)person { ABAddressBookRef ab = ABAddressBookCreate(); ABRecordRef record = ABAddressBookGetPersonWithRecordID(ab, ABRecordGetRecordID(person)); CFErrorRef *error = NULL; ABMultiValueRef phoneNumbers = ABRecordCopyValue(record,kABPersonPhoneProperty); ABMutableMultiValueRef phoneNumberMV = ABMultiValueCreateMutableCopy(phoneNumbers); for(CFIndex i=0; i < ABMultiValueGetCount(phoneNumberMV); i++){ NSString *phoneNumber = (__bridge NSString *)ABMultiValueCopyValueAtIndex(phoneNumberMV,i); //NSSlog(@"phoneNumber = %@", phoneNumber); if ([@"1128558994" isEqualToString:phoneNumber]) { //now delete it!!! ;-) /* NSSlog(@"phoneNumbers = %@",phoneNumbers); N

Categories : IOS

Setting UITableViewCell height and the cell's text label based on the text height
I think that the problem might be of adjusting the vertical alignment of the text in the UILabel instance. I think you should do the following inside cellForRowAtIndexPath: cell.infoLabel.text = _content[[indexPath row] * 2]; cell.infoLabel.numberOfLines = 0; [cell.infoLabel sizeToFit]; More details about it can be found in the following link: Vertical Alignment of UILabel Text Hope this helps! :)

Categories : IOS

Extracting number from the line of text if the number is not present make it null
This will get you the number following the sh-: DECLARE @string VARCHAR(255) = 'Tnsf from sh-849116 Act-13383.38 Unam-13383.38 04/12/12' SELECT SUBSTRING(@string,CHARINDEX('sh-',@string)+3,CHARINDEX(' ',@string,CHARINDEX('sh-',@string))-CHARINDEX('sh-',@string)-3) In your query I would add a CASE statement if sh- is not on every row: SELECT CASE WHEN CHARINDEX('sh-',StringField) > 0 THEN SUBSTRING(StringField,CHARINDEX('sh-',StringField)+3,CHARINDEX(' ',StringField,CHARINDEX('sh-',StringField))-CHARINDEX('sh-',StringField)-3) END FROM YourTable

Categories : SQL

In a PDF417 barcode where number of columns are fixed, how would I calculate the number of rows required for some text?
You could look at the source-code of some PDF417 implementation, such as ZXing. The text encoding isn't just two characters per code-word. If you use any other character than uppercase letters and space, the encoder will add extra characters to switch character-sets etc. You really have to encode the text to see how many code-words it will become. public class Test { public static void main(String[] args) { String msg = "Hello, world!"; int columns = 7; int sourceCodeWords = calculateSourceCodeWords(msg); int errorCorrectionCodeWords = getErrorCorrectionCodewordCount(0); int rows = calculateNumberOfRows(sourceCodeWords, errorCorrectionCodeWords, columns); System.out.printf(""%s" requires %d code-words, and %d error correction code-w

Categories : Algorithm

Table view cell's label won't center align unless number of lines is 1
Of course, right after I post the question, I figure it out. If the "Autoshrink" has "Tighten Letter Spacing" selected in IB, it snaps it to the left alignment. Uncheck this to have it stay centered.

Categories : IOS

How to put a text label below the div?
Just add your div below your codes, <div class="box photo lefttooltip" title="Sample Text" > <div id="leftimage"><img id="orn<%=j%>" class="drag ornthumb1" align="center" src="<%=itms[j]%>" alt="" /></div> <span id="leftzoom" onClick="zoominProduct('<%=itms[j]%>')"> <img class="zoomin" src="jqe13/image/left_zoom_hover.png" title="Zoomin"></span> </div> --------------- add here --------------------------- <div style="clear:both;"></div> <div class=""> Your label contnet here</div>

Categories : HTML

Generate List for label with barcode printing from tablem with number quantity of rows
Use LEVEL to get a "table" that counts from 1 to the maximum number of rows: SELECT LEVEL AS LabelNum FROM DUAL CONNECT BY LEVEL <= (SELECT MAX(Q_Rows) FROM Labels) This will give you the following table: LabelNum -------- 1 2 3 4 Next, join this to your LABELS table where LabelNum <= Q_Rows. Here's the whole query: WITH Mult AS ( SELECT LEVEL AS LabelNum FROM DUAL CONNECT BY LEVEL <= (SELECT MAX(Q_Rows) FROM Labels) ) SELECT Product FROM Labels INNER JOIN Mult ON LabelNum <= Q_Rows ORDER BY Product, LabelNum There's a working SQLFiddle here. Finally, good job including the create/populate scripts :)

Categories : Oracle

How to set the text in a label to a name in database using log-in as key?
The problem is you can't use one method for all possibilities. In your example for one, you have no way to send a parameter to your dal, that means you'd have to create a method in your dal for such a thing. I have a class that does more or less what you want. It's not a proper repository but for beginners it may have what you need. http://pastebin.com/xYhsSeXW

Categories : C#

Using "isEqualToString" to set label text
The most immediate problem I see is that it looks like you're using this code for a UITableViewCell, or similar in which case you need to be sure to unhide the label that may have been hidden by a previous load of the cell. For example: NSString *itemOnSpecial = [object objectForKey:@"isItemOnSpecial"]; if ([itemOnSpecial caseInsensitiveCompare:@"yes"] == NSOrderedSame) { UILabel *specialLabel = (UILabel*) [cell viewWithTag:5]; specialLabel.text = [object objectForKey:@"specialPrice"]; [specialLabel setHidden:NO]; // Notice this line }else{ UILabel *specialLabel = (UILabel*) [cell viewWithTag:5]; [specialLabel setHidden:YES]; }

Categories : IOS

text field to label with CSS
No CSS but rather HTML attribute: <input type="text" class="txtToLbl" readonly="readonly" /> If using ASP.NET control: <asp:TextBox ID="Textbox1" runat="server" CssClass="txtToLbl" ReadOnly="true" />

Categories : C#

Label Text is Limited
Either make your label control larger to fit the entire text, or set AutoSize property to True to let it automatically adjust to the content size. Also make sure there's no other control hiding part of your label.

Categories : C#

Ggplot: How to reduce x label text
Try the abbreviate function: qplot(Species, Sepal.Length, data=iris, geom="boxplot") + scale_x_discrete(label=abbreviate) If the defaults won't do in your case, you can define your own function: qplot(Species, Sepal.Length, data=iris, geom="boxplot") + scale_x_discrete(label=function(x) abbreviate(x, minlength=7)) You can also try rotating the labels.

Categories : R

Setting text of a label in javascript
If you just have to use the label to display error messages from JavaScript, i.e. the control has no server side relevance, you may use <span id="DetailsError">. Or You may use the <%=DetailsError.ClientID%> everywhere in the HTML / JS code where you want to use DetailsError. For e.g.: document.getElementById("<%=DetailsError.ClientID%>").innerHTML = errId; Please take this as a starting point and not as a copy-paste solution.

Categories : Javascript

How to glow label text using Jquery
Did you missed open script tag before the scripts? <script type="text/javascript" src="../Scripts/jquery-1.7.1.js"></script> // this one <script type="text/javascript"> function changeColor(id) {...} </script>

Categories : C#

Set Text to the lowest right edge of a label?
Here is what you need, a custom label: public class CustomLabel : Label { public CustomLabel() { TopLeftText = BottomRightText = ""; AutoSize = false; } public string TopLeftText {get;set;} public string BottomRightText {get;set;} protected override void OnPaint(PaintEventArgs e) { using (StringFormat sf = new StringFormat() { LineAlignment = StringAlignment.Near}) { using(SolidBrush brush = new SolidBrush(ForeColor)){ e.Graphics.DrawString(TopLeftText, Font, brush, ClientRectangle, sf); sf.LineAlignment = StringAlignment.Far; sf.Alignment = StringAlignment.Far; e.Graphics.DrawString(BottomRightText, Font, brush, ClientRectangle, sf);

Categories : C#

GWT - Label not wrapping text properly?
I actually don't think there's a good solution to this; either you only allow breaking at normal points (white spaces) or you can break inside words, but then there's no way to prevent breaking of short words with just CSS. The best suggestion I can give, since links are causing problems, is to shorten links somehow, maybe only display a finite number of characters; if the links are clickable, this shouldn't be a huge problem. Alternatively, you could set a fixed size for the labels or the cells (can still be in %) and use overflow-x to hide any bits of text poking out if there's a really long word that cannot be broken.

Categories : Java

How To Get Label Text Value On CheckChange Event
Try this CheckBox chk = (CheckBox)sender; GridViewRow gr = (GridViewRow)chk.Parent.Parent; var lbl = (Label) gr.FindControl("lblTitle"); if(lbl !=null) { var lblText = lbl.Text; }

Categories : C#

How to access a particular label text in Gridview
use this, protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e) { Label label = (Label)this.GridView1.Rows[e.NewEditIndex].FindControl("Label4"); string value = label.Text; }

Categories : C#

text label is not a member of 'Ui::Dialog' Qt
Actually you are making a basic mistake, in your UI fle you have: <widget class="QLabel" name="lblOrignal"> and your trying to reference as: ui->lblOriginal->setPixmap(QPixmap::fromImage(qimgOriginal)); So have you checked the difference ? if not lblOrignal is not equals to lblOriginal.

Categories : Image

Getting the text after a label with Selenium WebDriver
Something like (I use Java syntax) public String getNodeTextContent(WebElement node) { String nodeContent = node.getAttribute("textContent"); List<WebElement> childs = node.findElements(By.xpath("*")); if (childs.size() == 0) { return allContent; } for (WebElement child : childs) { nodeContent = nodeContent.replace(child.getAttribute("textContent"), ""); } return nodeContent; } it basically just removes the text contents of all direct children of the node from the node contents, which should leave only the real contents of the node.

Categories : C#

Get Label text value into javascript variable
var grossSales = $('#<%= MtdLBL.ClientID %>').text(); Note parentheses; text is a function, not a simple value. The next() is out of place unless you want the following control, which doesn't seem right.

Categories : Javascript

GWT Label with HTML CSS For Text Padding
I don't think having the HTML in GWT is effecting the alignment. See: How do I vertically align text next to an image with CSS? i.e. add style="vertical-align:middle" to your img element.

Categories : Java

No errors, label seems like it should change to the indicated text but its not
In these lines void StatTransfer() { // This is a new instance of MainForm, not the original one MainForm Mform = new MainForm(); MainForm.VariableLabel1 = "Bob"; Mform.SetInfo(); } you create a new instance of MainForm and this instance is never displayed. This hidden instance contains the label that you are trying to change, but you cant't see it. The simplest workaround to the problem is to pass the calling instance of MainForm to CharStats form when you initialize it void ChClassButtClick(object sender, EventArgs e) { CharStats form = new CharStats(this); form.Show(); } Now you should change the constructor of CharStats to receive the passed instance and save it in a global variable inside the CharStats class public partial class CharStats : Form { pr

Categories : C#

Fit Label size to drawn text
It seems that there is no other way to do it. So I have to use the above solution: using (Graphics g = lbl.CreateGraphics()) { SizeF size = g.MeasureString(lbl.Text, lbl.Font); // Change size of label if too small }

Categories : C#

How to click on label element text
I'm assuming by "select", you need to click on the "Stores" label. As others have pointed out, selecting an item using a new Select() will not work, because its expecting the element to be a element. You can "select" the "Stores" label by using: IWebElement element = driver.findElement(By.xpath("//label[text()='Stores'])")); element.click();

Categories : Java

How to embed an html tag within asp.net label text?
The code you had was almost correct, it just seems that you are missing some quotes: <asp:Label ID="lblContent" runat="server" Text='<%# String.Format("{0}", Eval("New_Content").ToString().Length > 150 ? "<a href='" + Eval("Link_Href") + Eval("New_Content").ToString().PadRight(150).Substring(0, 150).TrimEnd() + "'>...</a>" : Eval("New_Content")) %>' > </asp:Label> The text in an ASP Label is output raw to the response stream, so you can just write standard HTML, but it does need to be in quotes as you are building a new string object.

Categories : C#

Update a Label daily with new text
Try this code for any comparison between dates... You should not compare date in the form of string. Compare the dates before conversion to string. Convert the self.serverDate into date format using dateFromString function of the formatter by specifying the exact date format as that of the dateString. Then compare the dates using following function. -(void) callAfterSixtySecond:(NSTimer*) t { NSDate *today = [NSDate date]; // current date NSDate *newDate = self.serverDate; // other date NSDateFormatter *formatter = [[NSDateFormatter alloc]init]; [formatter setDateFormat:@"HH:mm"]; NSDate *todayTime = [formatter dateFromString:[formatter stringFromDate:today]]; NSDate *requiredTime = [formatter dateFromString:[formatter stringFromDate:newDate]]; NSComparisonResult result; result = [

Categories : Misc

Change label text in Tkinter
self.labelText = 'change the value' Above sentence make labelText to reference 'change the value', but not change depositLabel's text. To change depositLabel's text, use one of following setences: self.depositLabel['text'] = 'change the value' OR self.depositLabel.config(text='change the value')

Categories : Python



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.