multiline

displaying line number in rich text box c#

旧巷老猫 提交于 2019-11-29 03:51:54
I have a Multiline richtextbox control into which i want to integrate the feature of adding a line number. i have considered many approaches Add a label and updating the line numbers as the line count changes Add a picturebox along with to draw string on it. Add another textbox along with and show line numbers on it Add listbox along and display line numbers in it. I got two doubts. The richtextbox which i'm using is a custom made control and derieves from RichTextBox class. How can i add multiple controls to it. What is the best approach to show line numbers for the multiline text in c# My

How to Export a Multi-line Environment Variable in Bash/Terminal e.g: RSA Private Key

岁酱吖の 提交于 2019-11-29 02:35:54
问题 One of our Apps github-backup requires the use of an RSA Private Key as an Environment Variable. Simply attempting to export the key it in the terminal e.g: text export PRIVATE_KEY=-----BEGIN RSA PRIVATE KEY----- MIIEpAIBAAKCAQEA04up8hoqzS1+ ... l48DlnUtMdMrWvBlRFPzU+hU9wDhb3F0CATQdvYo2mhzyUs8B1ZSQz2Vy== -----END RSA PRIVATE KEY----- Does not work ... because of the line breaks. I did a bit of googling but did not find a workable solution ... e.g: How to set multiline RSA private key

How to implement Multiline EditText with ActionDone button (without Enter button)

我们两清 提交于 2019-11-29 02:21:11
问题 I have EditText which is used for entering contents on messages (emails, sms). I want message to be immediately posted on ActionDone button click. I use following code for this: message.setOnEditorActionListener((textView, i, keyEvent) -> { switch (i) { case EditorInfo.IME_ACTION_DONE: if (messageCanBePosted()) { SoftKeyboard.hide(message); postMessage(); return true; } else { return false; } default: return false; } }); But also I want this message field to be multiline, like in any other

Cannot get regular expression work correctly with multiline

[亡魂溺海] 提交于 2019-11-29 01:30:36
I have a quite big XML output from an application. I need to process it with my program and then feed it back to the original program. There are pieces in this XML which needs to be filled out our replaced. The interesting part looks like this: <sys:customtag sys:sid="1" sys:type="Processtart" /> <sys:tag>value</sys:tag> here are some other tags <sys:tag>value</sys.tag> <sys:customtag sys:sid="1" sys:type="Procesend" /> and the document contains several pieces like this. I need to get all XML pieces inside these tags to be able to make modifications on it. I wrote a regular expression to get

Multiline Textbox with automatic vertical scroll

心不动则不痛 提交于 2019-11-28 21:03:30
There are a lot of similiar questions over internet, on SO included, but proposed solutions doesn't work in my case. Scenario : there is a log textbox in xaml <TextBox Name="Status" Margin="5" Grid.Column="1" Grid.Row="5" HorizontalAlignment="Left" VerticalAlignment="Top" Width="600" Height="310"/> There are methods in code-behind that do some work and add some multiline (maybe that's the problem?) messages into this textbox: private static void DoSomeThings(TextBox textBox) { // do work textBox.AppendText("Work finished\r\n"); // better way than Text += according to msdn // do more textBox

Issue warning for missing comma between list items bug

萝らか妹 提交于 2019-11-28 20:14:11
The Story: When a list of strings is defined on multiple lines, it is often easy to forget a comma between list items, like in this example case: test = [ "item1" "item2" ] The list test would now have a single item "item1item2" . Quite often the problem appears after rearranging the items in a list. Sample Stack Overflow questions having this issue: Why do I get a KeyError? Python - Syntax error on colon in list The Question: Is there a way to, preferably using static code analysis , issue a warning in cases like this in order to spot the problem as early as possible? Jim Fasarakis Hilliard

How to process multiline log entry with logstash filter?

橙三吉。 提交于 2019-11-28 19:13:23
Background: I have a custom generated log file that has the following pattern : [2014-03-02 17:34:20] - 127.0.0.1|ERROR| E:\xampp\htdocs\test.php|123|subject|The error message goes here ; array ( 'create' => array ( 'key1' => 'value1', 'key2' => 'value2', 'key3' => 'value3' ), ) [2014-03-02 17:34:20] - 127.0.0.1|DEBUG| flush_multi_line The second entry [2014-03-02 17:34:20] - 127.0.0.1|DEBUG| flush_multi_line Is a dummy line, just to let logstash know that the multi line event is over, this line is dropped later on. My config file is the following : input { stdin{} } filter{ multiline{ pattern

C++ Remove new line from multiline string

自闭症网瘾萝莉.ら 提交于 2019-11-28 19:05:36
Whats the most efficient way of removing a 'newline' from a std::string? #include <algorithm> #include <string> std::string str; str.erase(std::remove(str.begin(), str.end(), '\n'), str.end()); The behavior of std::remove may not quite be what you'd expect. See an explanation of it here . If the newline is expected to be at the end of the string, then: if (!s.empty() && s[s.length()-1] == '\n') { s.erase(s.length()-1); } If the string can contain many newlines anywhere in the string: std::string::size_type i = 0; while (i < s.length()) { i = s.find('\n', i); if (i == std::string:npos) { break;

Multiline Find & Replace in Visual Studio

这一生的挚爱 提交于 2019-11-28 17:42:18
Can it be done? We're using VS2005 and VS2008 and VS2010. I don't mean regular expressions - which have their place - but plain old text find & replace. I know we can do it (at a pinch) with regular expressions using the \n tag but prefer not to get tangled up in regex escape characters, plus there's a readability issue. If it can't be done what plain and simple (free) alternative are people using? That doesn't involve knocking up our own macro. SV. I finally found it.. No need to download and load any external macro. Its working in Visual Studio 2008 with in-built macro at least. :) Steps : 1

How to remove extra indentation of Python triple quoted multi-line strings?

给你一囗甜甜゛ 提交于 2019-11-28 16:36:29
问题 I have a python editor where the user is entering a script or code, which is then put into a main method behind the scenes, while also having every line indented. The problem is that if a user has a multi line string, the indentation made to the whole script affects the string, by inserting a tab in every space. A problem script would be something so simple as: """foo bar foo2""" So when in the main method it would look like: def main(): """foo bar foo2""" and the string would now have an