line

Delete to end of line after a match, keep lines not matched

隐身守侯 提交于 2019-12-08 16:25:40
问题 I have a file of the following form: interesting text-MIB blah blah blah VERY INTERESTING TEXT interesting text-MIB blah blah blah In each line containing the "-MIB" string, I would like to delete the text following this string, until the end of the line. The following command seems to work as intended: sed -i -n -e 's/-MIB.*$/-MIB/p' ./myfile My problem is that it also deletes the lines where my pattern is not found. Here, the line "VERY INTERESTING TEXT" would be deleted. I am not really

How to capitalize first line with CSS? ::first-line pseudo-element not working

不打扰是莪最后的温柔 提交于 2019-12-08 16:03:14
问题 Right now I've got a paragraph and I'd like to capitalize the entire first line. I've set the first paragraph to an ID "firstp" and tried: #firstp::first-line { text-transform: uppercase; } I've tried it with text-transform: capitalize but that doesn't work either. It's strange because I've managed to change the first letter (changed font size) using #firstp:first-letter . 回答1: text-transform on :first-line is really buggy right now, see the reference here http://reference.sitepoint.com/css

Java SWT show Line numbers for StyledText

独自空忆成欢 提交于 2019-12-08 15:58:12
问题 I was wondering if there is a straightforward way to display line numbers with StyledText text field - even if lines are wrapped. I'm using it in my application and if content gets to big, some line numbers would be nice. Thank you. 回答1: The key is org.eclipse.swt.custom.Bullet . It's basically a symbol (or in our case a number) you can add to the beginning of a line. //text is your StyledText text.addLineStyleListener(new LineStyleListener() { public void lineGetStyle(LineStyleEvent e) { /

add x=y line to scatterplot

最后都变了- 提交于 2019-12-08 15:27:16
问题 I am using the scatterplot function from the car package to generate a scatterplot. I want to be able to generate a reference line in the plot that should be x=y. I tried using abline and it does add a line but it is not the x=y line. Can someone help? My code is as follows: scatterplot(phenos$P1~pheno$P0, data=pheno,spread=FALSE,ylab="6 month timepoint", xlab="Baseline Timepoint", jitter=list(x=1, y=1)) abline(0,1) Thanks. 回答1: This is actually fairly difficult/hackish, because scatterplot()

How to make an SVG “line” with a border around it?

☆樱花仙子☆ 提交于 2019-12-08 15:00:39
问题 I have a little svg widget whose purpose is to display a list of angles (see image). Right now, the angles are line elements, which only have a stroke and no fill. But now I'd like to have an "inside fill" color and a "stroke/border" around it. I'm guessing the line element can't handle this, so what should I use instead? Notice that the line-endcap of the line's stroke is rounded. I'd like to maintain this effect in the solution. <svg height="160" version="1.1" viewBox="-0.6 -0.6 1.2 1.2"

read from file only from one specific line to another C++

寵の児 提交于 2019-12-08 14:05:00
问题 Is there any way how to read data from file from line to another line ? For example : In file are these lines: Line1: empty line Line2: empty line Line3: robert wa Line4: frank le Line5: silvia op Line6: empty line Line7: empty line Line8: andy sf . . And I need to only read everything from Line3 to Line6 So output will be : robert wa frank le silvia op And my file have 300 lines that I want print. Do you have any idea how to do it, or can you paste me some pseudocode Thanks 回答1: This should

opencv error: assertion failed (size.width>0 && size.height>0) in unknown function line 261

筅森魡賤 提交于 2019-12-08 13:34:41
问题 This is my code: #include<opencv\cv.h> #include<opencv\highgui.h> using namespace cv; int main(){ //create matrix to store image Mat image; //initialize capture VideoCapture cap(0); cap.open(0); //create window to show image namedWindow("window",1); while(1){ //copy webcam stream to image cap>>image; //print image to screen imshow("window",image); //Error line //delay 33ms waitKey(33); } } The error I get: opencv error: assertion failed (size.width>0 && size.height>0) in unknown function file

Getting the text of a particular line on UITextView

为君一笑 提交于 2019-12-08 13:09:05
问题 Ultimately, I would like to know the position of the last character in a UITextView. I was able to find out the y position by using the following: CGSize size = [textView.text sizeWithFont:textView.font constrainedToSize:CGSizeMake(textView.frame.size.width-16, 10000) lineBreakMode:UILineBreakModeClip]; However in order to get the x position I need to get the text from the last line in the textview. I tried removing a character at a time from textView.text until size.height changes to achieve

JSON.NET Line serialization winrt

守給你的承諾、 提交于 2019-12-08 13:04:27
问题 I'm having some trouble with serializing a ObservableCollection of Lines (Shape). I'm developing for Windows RT and I'm using JSON.NET v5.02. I'm getting the following exception for the code below: ObservableCollection<Line> lines; //some code string linesString = JsonConvert.SerializeObjectAsync(lines); // problem An exception of type Newtonsoft.Json.JsonSerializationException occurred in mscorlib.dll but was not handled in user code Additional information: Error getting value from 'X1' on

Echo to a file without trailing a line break (batch) [duplicate]

不打扰是莪最后的温柔 提交于 2019-12-08 11:55:59
问题 This question already has answers here : Windows batch: echo without new line (15 answers) Closed 4 years ago . I am having a problem with my life creator program. It simply chooses random numbers that stand for something and puts it together. (I have tried combining variables) here is the code: @set num=1 @SET /A a=%RANDOM% * 10 / 32768 + 1 @if %a% == 10 set life%num%= ---- @if %a% == 9 set life%num%=O @if %a% == 8 set life%num%=^ @if %a% == 7 set life%num%=% @if %a% == 6 set life%num%=# @if