label

Is it possible to exit a for before time in C++, if an ending condition is reached?

和自甴很熟 提交于 2019-12-18 02:58:14
问题 I want to know if it is possible to end a for loop in C++ when an ending condition (different from the reacheing right number of iterations) is verified. For instance: for (int i = 0; i < maxi; ++i) for (int j = 0; j < maxj; ++j) // But if i == 4 < maxi AND j == 3 < maxj, // then jump out of the two nested loops. I know that this is possible in Perl with the next LABEL or last LABEL calls and labeled blocks, is it possible to do it in C++ or I should use a while loop? Thank you. 回答1: You can

Label minimum and maximum of scale fill gradient legend with text: ggplot2

邮差的信 提交于 2019-12-17 23:42:39
问题 I have a plot created in ggplot2 that uses scale_fill_gradientn . I'd like to add text at the minimum and maximum of the scale legend. For example, at the legend minimum display "Minimum" and at the legend maximum display "Maximum". There are posts using discrete fills and adding labels with numbers instead of text (e.g. here), but I am unsure how to use the labels feature with scale_fill_gradientn to only insert text at the min and max. At the present I am apt to getting errors: Error in

How to get the Tkinter Label text?

狂风中的少年 提交于 2019-12-17 23:37:29
问题 Im making a list of addresses that the user will select from, and the address text will be returned. I need to use Tkinter.Label because the Tkinter.Listbox will not allow for newlines. The kicker is there is no .get() -like method in the Label class... I know I can do something like: v = StringVar() Label(master, textvariable=v).pack() v.set("New Text!") ... print v.get() However, I have a list of 5-20 address' keeping a seperate array of StringVar() 's will be difficult b/c I have no way of

Javascript how to change radio button label text?

寵の児 提交于 2019-12-17 21:23:11
问题 I want to change the text of the label which is associated with the radiobutton id="male". I have tried various ways to do it, but i can't make it work. I want to change the text "Male" in the label associated to the radio button. <input type="radio" name="sex" id="male" value="male"> <label for="male">Male</label> </input> <input type="button" value="Submit" onclick = test()> <script> function test() { var r = document.getElementById("male"); r.nextSibling.data = "adaS"; // r.nextSibling

Adding label to the links in D3 force directed graph

点点圈 提交于 2019-12-17 20:34:32
问题 I have created a force directed graph but I'm unable to add text to the links created. How can I do so? Following is my code link I have used the following line to append the titles on the link's, but its not coming. link.append("title") .text(function (d) { return d.value; }); What am I doing wrong with this ? 回答1: This link contains the solution that you need. The key point here is that "title" adds tooltip. For label, you must provide slightly more complex (but not overly complicated) code

How to translate form labels in Zend Framework 2?

白昼怎懂夜的黑 提交于 2019-12-17 19:36:17
问题 I'm not getting it!.. Can please someone explain, how to translate form labels? A simple example would be great. Thank you in advance! class Search\Form\CourseSearchForm ... class CourseSearchForm extends Form { ... public function __construct(array $cities) { parent::__construct('courseSearch'); ... $this->add(array( 'name' => 'city', 'type' => 'Zend\Form\Element\Select', 'options' => array( 'label' => 'Stadt', 'value_options' => $this->cities, 'id' => 'searchFormCity', ), )); ... } } view

Label doesn't display “_” character

落爺英雄遲暮 提交于 2019-12-17 19:17:30
问题 My Label.Content in WPF doesn't display the first occurrence of "_" character. Why? <Window x:Class="WpfApplication3.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="148" Width="211"> <Grid> <Label Content="L_abel" Height="28" HorizontalAlignment="Left" Margin="37,31,0,0" Name="label1" VerticalAlignment="Top" /> </Grid> </Window> When set Label.Content ="L__abel" : There is no

Swift Update Label (with HTML content) takes 1min

这一生的挚爱 提交于 2019-12-17 18:48:52
问题 I got a small problem, let me start with the code class ViewController: UIViewController { @IBOutlet weak var LBoutput: UILabel! @IBAction func BTclick(sender: AnyObject) { var url = NSURL(string: "http://google.com") println("test0") let getdata = NSURLSession.sharedSession().dataTaskWithURL(url){(data ,response , error) in var htmlContent = NSString(data: data, encoding: NSUTF8StringEncoding) println("test1") println("test2") self.LBoutput.text = "test6" } println("test3") getdata.resume()

Matplotlib Python Barplot: Position of xtick labels have irregular spaces between eachother

浪子不回头ぞ 提交于 2019-12-17 18:42:06
问题 I'm trying to do a bar plot for many countries and i want the names displayed a bit rotated underneath the bars. The problem is that the spaces between the labels are irregular. Here's the relevant code: plt.bar(i, bar_height, align='center', label=country ,color=cm.jet(1.*counter/float( len(play_list)))) xticks_pos = scipy.arange( len( country_list)) +1 plt.xticks(xticks_pos ,country_list, rotation=45 ) Does anyone know a solution? Thanks! For your Help. Christian 回答1: I think the problem is

d3.js: Align text labels between ticks on the axis

无人久伴 提交于 2019-12-17 17:41:44
问题 Is there an easy way to align text labels between ticks? Here is my time axis with labels above the ticks: I would like to place these labels like here: 回答1: I ended up with one of the Lars Kotthoff's advices. Every time when I call(axis) I also adjust text labels. Here is simplified code: function renderAxis() { axisContainer .transition().duration(300) .call(axis) // draw the standart d3 axis .call(adjustTextLabels); // adjusts text labels on the axis } function adjustTextLabels(selection)