检查wheter语句的条件是错误的(Condition that checks wheter statement is false)
我有点挣扎这种语言。 我试图创造一个条件,只有当它是假的时才执行。 我有一个返回false的函数,但我不知道该怎么做。 见下面的代码:
(define p (make-queue)) (enqueue! p 1) (enqueue! p 1) (enqueue! p 2) (enqueue! p 3) (memq 5 (queue->list p)) (cond [(false? (memq 4 (queue->list p))) "yaay"] )
基本上我正在创建一个队列,然后我问memq,如果列表中有所需的值,在我的情况下返回false。 现在我需要执行“yaay”部分。 我怎样才能做到这一点? 我试过要求假,我试过
(= (#f) (memq 4 (queue->list p)))
或一些简单的ifs,但这也不起作用I am kind of struggling with this language. I am trying to make a condition, that executes only, when it is false. I have a function that returns false, but I have no idea how to do it. See code below:
(define p (make-queue)) (enqueue! p 1) (enqueue! p 1) (enqueue! p 2) (enqueue! p 3) (memq 5 (queue->list p)) (cond [(false? (memq 4 (queue->list p))) "yaay"] )
Basically I am creating a queue, then I am asking with memq, if there is a desired value in the list, which in my case returns false. And now I need to execute the "yaay" part. How can I achieve that? I tried asking for false, I tried
(= (#f) (memq 4 (queue->list p)))
or some simple ifs, but that does not work either
原文:https://stackoverflow.com/questions/37774629
最满意答案
尝试这个;
foreach (Control c in this.Controls) { if (c is Label) c.Font = usefontgrid; }
要么
foreach (var c in this.Controls.OfType<Label>()) { c.Font = usefontgrid; }
Try this;
foreach (Control c in this.Controls) { if (c is Label) c.Font = usefontgrid; }
Or
foreach (var c in this.Controls.OfType<Label>()) { c.Font = usefontgrid; }
相关问答
更多-
设置标签集合的字体(Setting font for collection of labels)[2023-07-25]
如果要更改应用程序中从xib或storyboard创建的所有标签的字体,可以使用 UILabel.appearance().font = UIFont(name: "Georgia-bold", size: 18) 但如果您只想更改collectionNameLabels字体,正如@Sivajee Battina所说,我认为您必须使用循环来更改每个标签的字体。 for label in self.collectionNameLabels { label.font = UIFont(name: "G ... -
您可以更改“轴”的每个“轴”实例的标签。 “get_label”返回的文本实例提供了修改字体大小的方法,还提供了标签的其他属性: from matplotlib import pylab as plt import numpy fig = plt.figure() ax = fig.add_subplot(111) ax.grid() # set labels and font size ax.set_xlabel('X axis', fontsize = 12) ax.set_ylabel('Y ax ...
-
没关系,我刚才意识到我可以用这种方式为这些图添加修饰符: plot "data" using 1:2:2 smooth frequency w labels rotate by 90 font "8" Nevermind, I just realized I can add modifiers to the plots in this way: plot "data" using 1:2:2 smooth frequency w labels rotate by 90 font "8"
-
如何在Matplotlib中设置图形标题和轴标签字体大小?(How do I set the figure title and axes labels font size in Matplotlib?)[2023-09-28]
处理label , title等文本的函数接受与matplotlib.text.Text相同的参数。 对于字体大小,您可以使用size/fontsize : from matplotlib import pyplot as plt fig = plt.figure() plt.plot(data) fig.suptitle('test title', fontsize=20) plt.xlabel('xlabel', fontsize=18) plt.ylabel('ylabel', fontsi ... -
尝试这个; foreach (Control c in this.Controls) { if (c is Label) c.Font = usefontgrid; } 要么 foreach (var c in this.Controls.OfType
-
您可以使用IBOutletCollection。 在IB中创建一个集合并将所有标签连接到它。 然后在代码中使用setValue forKey。 不知道它是否更高效,但你不必循环浏览子视图。 .h IBOutletCollection(UILabel) NSArray *labels; .m UIFont *newFont = [UIFont fontWithName:@"HelveticaNeue-CondensedBold" size:14]; [labels setValue:newFont forK ...
-
将font.lab移动到对par的调用 example= matrix(c(1,2,7,4,1,5,5,2,4,5), ncol=2) op = par(mai = c(1.7,1.6,0.7,0.7), mgp = c(5.5, 1.5, 0), font.lab = 2) b = boxplot(example, names = c("1", "2"), cex.names=2.1, cex.axis=2.1, cex.lab=2.3, ylab= "Percent") par(op) Mo ...
-
快速枚举.. for( UIView *view in self.subviews) { if([view isKindOfClass:[UILabel Class]]) { [(UILabel *)view setFont:[UIFont fontWithName:@"Times New Roman" size:22]]; } } do fast enumeration.. for( UIView *view in self.subviews) ...
-
要删除样式,请始终使用基本样式,然后仅添加已检查的样式: private void btnGo_Click(object sender, EventArgs e) { // start with the base font, then add in each selected style Font fnt = new Font(lblFontSample.Font.FontFamily, lblFontSample.Font.Size, FontStyle.R ...
-
在表单编辑器中调整其字体大小后调整Delphi表单大小(Resizing Delphi form after resizing its font in form editor)[2023-06-22]
在设计时,您可以通过手动编辑.dfm文件来实现更改。 确保在Scaled属性设置为True情况下保存表单。 然后,在Delphi中关闭您的项目,或者完全关闭Delphi。 接下来,在文本编辑器中打开.dfm文件,然后调整表单TextHeight属性。 例如,如果要从7pt缩放到8pt,并且TextHeight设置为13 ,则应将其更改为11 。 然后重新加载项目并在设计器中打开表单,您的表单将被缩放。 这不是一个完美的缩放,因为TextHeight不允许浮点值。 但它可能已经足够好了。 在运行时,您可以调用 ...