When I copy paste multi line strings, from one part of my code to a different part, VS suddenly marks it with all colors of the rainbow starting from the second row (specifically I am changing the functions I use to render content, but it doesn't really matter).
I am just copy pasting the string between two brackets.
This os super annoying, because it forces me to erase all the line breaks so all the text is in one line, which is a complete waste of time. This is the only thing I need to do to "solve" it, It's just an issue with VS, not my code.
Auto formatting all so doesn't work because for VS my code is not valid, so it can't format it. Anyone else ran into this issue before? Any solutions?
Sample code:
<div>
{multipleParagraphs(
[
{
body: "formed from a group
of international misfits enticed by the weird, wacky and wonderful
allure of the cultural party experience of",
items: [""]
}
],
"paragraph centered-text"
)}
</div>
Related
I have to maintain a legacy project which developed by extjs4.2. But i found the grid cannot use a store with dynamic fields. And the field contains character dash and minus that cause errors. Please just take a look the following code snippet and focus on the fields of the grid store. It will throw syntax error 'Invalid left-hand in assignment'.
Ext.create('Ext.grid.Panel',{
title:'mygrid',
store: Ext.create('Ext.data.Store'{
fields:['group','alfa=-2.0','alfa=0','alf=2.0'],
data:[
{'group':'beta', 'alfa=-2.0':1.3, 'alfa=0':1.4, 'alfa=2.0':1.5 },
{'group':'beta', 'alfa=-2.0':1.3, 'alfa=0':1.4, 'alfa=2.0':1.5 },
]
}),
columns:[
{'dataIndex':'group','header':'group'},
{'dataIndex':'alfa=-2.0','header':'alfa=-2.0'},
{'dataIndex':'alfa=0','header':'alfa=0'},
{'dataIndex':'alfa=2.0','header':'alfa=2.0'}
]
});
Your sample contains a syntax error. Ext.create('Ext.data.Store'{ there is a , missing after the first argument.
In the background Ext is calling recordDataExtractorTemplate what will try to access the record values with the dot notation. This results a code value = source.alfa=-2 && source.alfa=-2.0; what is obviously syntactically incorrect.
Any of the solutions below may work. It is up to you which one you go for.
The quickest solution to change the field names in your code if possible if those fields are not used widely in the app.
You can check if later versions of Ext fixes this problem. However the migration can be a pain.
You can create an override of Ext.data.reader.Reader and patch the failing function.
If I copy a block of code in C and paste it into Word, the syntax highlighting works well. But if I copy a single word on a line, the selection ("highlight") is also copied, meaning that the text pasted into Word is dark blue, and almost unreadable.
The fix seems to be to copy the entire line including the EOL char, then the "selection" part goes away.
I used InsideClipboard to view the RTF of each case, and the single word selection version has a "\highlight2" tag around the text. That seems to be the issue.
Is there a way of getting rid of this, while retaining the other- actually useful- syntax highlighting?
Bad: (if I copy just the selected word "FooText")
{\highlight2
{\cf0 }
{\cf0\b FooText\b0}
}
Good: (if I copy the entire selected line, including EOL)
{\cf0 FooTex}
{\cf0\ul t\ul0}
There is probably a bug in this version of Eclipse causing the highlighting to be incorrect / inconsistent
You can paste as text-only in Word using Paste-Options (Ctrl-Alt-V)
So I am working on this side project game kinda thing, and I want to put it inside of a border/box. I then want to print text constantly inside that border: adding text, removing it, changing it etc. I've looked far and wide, and cannot find anyway to print inside the box separately from the actual box.
My current implementation is to clear screen, and then reprint the entire box with new text using this:
printf("\e[1;1H\e[2J");
The issue with this is that I get this very obnoxious blinking effect, because every iteration of clearing my screen causes that portion of the screen to become black for a certain period of time.
So I am looking for a few solutions.
How to print a border separate from the print statement inside of it. I currently am implementing it like such:
printf("| | Hello There ||\n");
, and then repeating that all the way down to make a border.
How to completely overwrite the already outputted text so that this blinking effect can go away. So imagine \r removing a line, I want something like that, that removes the whole text and replaces it with a new set of text
How to change the location of where the user inputs into the console, so you can type into a box
Those are basically the only solutions I could think of, if you have any others I'd love to hear them
I also had a general question about c.
conio.h, graphics.h, windows.h and a few other headers don't work for my compilers. I use ubuntu, and they always come up with some error saying I can't use them. I appreciate someone explaining this to me.
Please let me know what you think, and if you need more info, I'll be sure to provide it
-Ryan
conio.h and windows.h are not standard Linux libraries, so they won't compile on Linux unless you install extra software. One solution would be to use a library designed for managing the screen like ncurses.
You can do that with loops and ASCII characters similar like that:
#include <stdio.h>
int main()
{
int i;
printf("\n\t\t═");
for(i=0;i<=20;i++)
{
printf("═");
}
for(i=0;i<=22;i++)
{
printf("\t\t║\n");
if(i==10)
{
printf("\t\t\tHello There \t\n");
}
printf("\t\t\t\t\t║\n");
}
printf("\t\t═");
for(i=0;i<=22;i++)
{
printf("═");
}
return 0;
}
Is there a way to stop MonoDevelop de-indenting Loop Identifiers by one step? I'm writing in D using MonoDevelop 5.0.1 with Mono-D 2.1.9 on Ubuntu 12.04 LTS.
Whenever I give a loop an identifier so it can be broken or continued in another nested loop it always de-indents the line with the loop statement by one step, breaking consistency with everything else. This probably looks much better if you but braces on newlines but I don't and I'm not about to change my entire workflow for one annoying formatting quirk.
Here's an example of what I'm talking about:
void functionName() {
dosomething();
foreach(Object o; array1) { //<- indents correctly if it doesn't have an identifier
o.dosomethng();
}
outer: foreach(Object o; array2) { //<- always indents one step back if identifier present
o.dosomething();
}
}
Is there a way to disable the behaviour? Nothing in Edit->Preferences->Code Formatting seems to say anything about it either for D or C#
This seems like a bug in Mono-D AddIn probably somewhere inside this code: https://github.com/aBothe/Mono-D/blob/master/MonoDevelop.DBinding/Formatting/Indentation/DTextEditorIndentation.cs
I suggest you to report bug on Mono-D AddIn issue tracker at https://github.com/aBothe/Mono-D/issues or checkout Mono-D AddIn source code fix bug and make pull request. ;)
I've got a FlowDocument generating a document for a client, and it's getting a line break that they don't like. Is there any way to mark a section of text that it should avoid line breaks? Something like this:
<Paragraph>Here is a paragraph where there should be <span NoLineBreak=True>no line break</span> in a certain part.</Paragraph>
Obviously, a Span doesn't have a NoLineBreak property, but I'm wondering if there's some equivilant functionality available, or if someone can get me started on a way of implementing a SpanWithNoLineBreak class or RunWithNoLineBreak class?
UPDATE
Actually, one issue I'm having is with a percent sign, where there isn't even a space:
<Paragraph>When I print and ½% I want the one-half and '%' symbols to not line break between them.</Paragraph>
The & #x00BD; is the unicode for a ½ symbol. I'm getting a line wrap between the 1/2 and the % even though there's no space between them.
The Unicode character "Word Joiner" (U+2060) is intended for just this purpose. It "does not normally produce any space but prohibits a line break on either side of it" (Wikipedia). You place it between U+00BD and '%' to prevent a line break between them.
Unfortunately, WPF (or perhaps the typical fonts supplied with Windows) don't support it properly, and instead render it as a square box. As an alternative, you could use U+FEFF; the use of this character as a zero-width non-breaking space is now deprecated (it's reserved for use as a byte-order mark), but it worked as a line-break-preventer for me.
Finally, there are some other characters that can also be used for this purpose: U+202F (narrow no-break space) also prevents breaking, but also renders as a very thin space. U+00A0 (no-break space) prevents breaking and displays as a normal space.
Try replacing the spaces with non-breaking spaces.
EDIT: Well there's always the backup plan of just putting in TextBlocks in your FlowDocument with TextWrapping=NoWrap, but I'd try to find a better way...