Dart. Idea. How to prevent formatting from merging into single line - android-studio

I'm trying to set new formatting for me. Because of this problem.
Before auto format.
After auto format.
I checked Idea Settings. But seems there are not too many settings for Dart. I have removed all the setting with line merging. But above issue still exist. For example. This setting, which should work, but it doesn't.
Any suggestion?

End each line you don't want to be affected by formatting with "//":
[1, 2, 3]
.map((a) => 0) //
.map((a) => 1); //
var x = [
0, 1, 2, //
3, 4, 5 //
];

I have this problem too
My solution is "Select the range I want to auto format and click Ctrl+Alt+L"...
I have given up auto format all...

Related

Monaco-Editor: Activate only certain lines for editing

I would like to activate only certain lines for editing. To do this, the other lines should be lightly grayed out. Does anyone have any idea how I can do this? So far I have only found a workaround (see the code below) that does not have the other lines grayed out and can also be selected with [Ctrl] + [A]. The danger is then that the removal works.
this.editor.layoutOverlayWidget()
this.editor.onDidChangeCursorPosition((e) => {
if (e.position.lineNumber < 3 || e.position.lineNumber > 3) {
this.editor.setPosition({
lineNumber: 3,
column: 1
});
}
});

Hot to set line height in Sublime Text tab set control

I want to change the font size for a larger, but I can't change the line height, so that letters like g p q are "under cropped"
I haven't found solutions, seems than nobody has changed the labels line height on "tab set control" ¿?
I tried
"row_padding": [8, 3], // increase second value e.g. [8, 6]
"indent": 12,
and
"line_padding_bottom": 3,
"line_padding_top": 3
without success
Thanks
This is a known bug, with currently no workarounds (as at build 3126): https://github.com/SublimeTextIssues/Core/issues/694
EDIT: this has been fixed in build 3127.

Appropriate Syntax For Alternating Row Colors

I am using this code:
=IIF(RunningValue(Fields!cost_center_id.Value, CountDistinct, nothing) Mod 2, "White", "Gainsboro")
But its result is not good. I think it's because of Fields!cost_center_id.Value. Can anybody tell me the most appropriate code?
And why the footer (Total) has also shade thought I haven't put code in it? Help me.
Thanks in advance.
Screenshots:
I used this code for the 3rd picture.
= IIF(RowNumber("LCSRDBDataSet_CostCenterSummary") Mod 2 = 0, "White", "Gainsboro")
The reason your expression doesn't work is because your id values might have gaps or not be ordered correctly.
One of these following expressions should give the wanted behavior.
= IIF(RowNumber(Nothing) Mod 2 = 0, "White", "Gainsboro")
= IIF(RowNumber("YourDataSet") Mod 2 = 0, "White", "Gainsboro")
You need to define the expression for the BackgroundColorproperty of the data row. The footer row (total) should be below the data row, and thus have no expression for it's background color, unless you want it to be different to the final row.

EPPlus Barchart bars not showing colors for negative value in Excel 2013, but works fine in Excel 2007

I am using a BarClustered chart using EPPlus for Excel Package in C#. I am able to generate the bar chart as required. Only problem I am facing is that when I have a negative value, the bar does not show any color. It would be as if a transparent bar with only the border.
I am facing this issue with Excel 2013. However this works fine in Excel 2007.
ExcelWorksheet wsDataSource = xlPackage.Workbook.Worksheets.Add("DataSource");
wsDataSource.Hidden = eWorkSheetHidden.VeryHidden;
var namedStyle = xlPackage.Workbook.Styles.CreateNamedStyle("HyperLink");
namedStyle.Style.Font.UnderLine = true;
namedStyle.Style.Font.Color.SetColor(Color.Blue);
//Here I iterate through an array and populate the wsDataSource values as below starting from 3rd row:
Feb 2000 5000
March -2000 2770
April 4000 4643
var chart = worksheet.Drawings.AddChart("Chart", OfficeOpenXml.Drawing.Chart.eChartType.BarClustered);
//row is the offset int variable
chart.SetPosition(row + 2, 0, 0, 10);
chart.SetSize(750, 30);
chart.Title.Text = "Data Graph";
chart.Legend.Position = eLegendPosition.Top;
var barChart = chart as ExcelBarChart;
barChart.DataLabel.ShowValue = true;
var mySeries = chart.Series.Add(wsDataSource.Cells[3, 2, intDataRow - 1, 2], wsDataSource.Cells[3, 1, intDataRow - 1, 1]);
mySeries.Header = "Current Year";
//isPreviousYearDataAvailable is a boolean which indicates if previous year data for the user is available.
if (isPreviousYearDataAvailable)
{
var mySeries2 = chart.Series.Add(wsDataSource.Cells[3, 3, intDataRow, 3], wsDataSource.Cells[3, 1, intDataRow - 1, 1]);
mySeries2.Header = "Previous Year"
}
Below is the image I get for negative values when opening using Excel 2013.
It appears that EPPlus doesn't have support for the "invertIfNegative" tag for data series. You might have to contact the authors for help, or add in the feature yourself. The Open XML specs state that:
This element specifies the parent element shall invert its colors if the value is negative.
Also:
A value of on, 1, or true specifies that the property is applied. This is the default value for this attribute, and is implied when the parent element is present, but this attribute is omitted.
Since EPPlus doesn't render this tag, the default value is used, which is "true". The "parent element" in this case is the data series XML element. So this means colors will be inverted if the cell value is negative. Hence the transparent color you see.
I have found that different versions of Excel obey the Open XML specs slightly differently. Excel 2013 appears to obey more strictly to the Open XML specs, which is why you get a transparent color. Excel 2007 probably ignored the absent "invertIfNegative" tag (meaning if absent, you don't want to have anything to do with inverting colors and so on, and so Excel will just render the color). In this sense, Excel 2007 is more forgiving of mistakes, which may or may not be a good thing.
Adding <c:invertIfNegative val="0"/> to the XML manually seemed to work for me:
System.Xml.XmlNode invertIfNegativeNode = chart.ChartXml.CreateElement(
"c", "invertIfNegative", "http://schemas.openxmlformats.org/drawingml/2006/chart");
System.Xml.XmlAttribute invertIfNegativeAttribute = chart.ChartXml.CreateAttribute("val");
invertIfNegativeAttribute.Value = "0";
invertIfNegativeNode.Attributes.Append(invertIfNegativeAttribute);
chart.ChartXml.DocumentElement["c:chart"]["c:plotArea"]["c:barChart"]["ser"].AppendChild(invertIfNegativeNode);
Adding to this old post, I hit the same problem in Excel 2016 but was unable to resolve it with #Saxon Druce answer directly. When I examine chart1.xml behind the Excel, only ser contains invertIfNegative and setting it's val attribute to 0 does not apply to any bar (still remain inverted / transparent). When I open the file in Excel and uncheck Series Option/Invert if negative option and reopen chart1.xml, I found each and every bar dPt is inject with invertIfNegative node.
So I modified #Saxon Druce answer a bit, create and append invertIfNegative node to each bar's dPt (2nd arrow) instead of appending to parent node ser (1st arrow). Then the ExcelBarChart turns out ok with all bars colored (not inverted).
I banged my head for hours so hopefully this help someone with Excel 2016.
var nsuri = chartXml.DocumentElement.NamespaceURI;
var dPt = chartXml.CreateNode(XmlNodeType.Element, "dPt", nsuri);
var invertIfNegative = chartXml.CreateNode(XmlNodeType.Element, "invertIfNegative", nsuri);
var att = chartXml.CreateAttribute("val", nsuri);
att.Value = "0";
invertIfNegative.Attributes.Append(att);
dPt.AppendChild(invertIfNegative);
// Other xml changes
var idx = chartXml.CreateNode(XmlNodeType.Element, "idx", nsuri);
att = chartXml.CreateAttribute("val", nsuri);
att.Value = i.ToString();
idx.Attributes.Append(att);
dPt.AppendChild(idx);

Expand wxStaticLine only horizontally

I have a wxWidget Application. I need to make certain changes to the layout of the application. One of them being adding horizontal lines between vertically stacked slider.
Here is the code I am using:
m_BrightContLine =new wxStaticLine(this,wxID_ANY,wxPoint(-10,10),wxSize(250,1),wxLI_HORIZONTAL,wxStaticLineNameStr);
gridSizer->Add(m_DummyText[16], 0, wxALL);
m_BCLineSizer = new wxBoxSizer(wxHORIZONTAL);
m_BCLineSizer->Add(m_BrightContLine, 1, wxALL|wxALIGN_LEFT|wxEXPAND);
gridSizer->Add(m_BCLineSizer, 0, wxALL|wxEXPAND);
the problem is that the static line expands both in length and in thickness.
How do I make sure that it expands only horizontally(in length).
Take out the wxEXPAND flag.
m_BCLineSizer->Add(m_BrightContLine, 1, wxALL|wxALIGN_LEFT);
If that doesn't work, try the wwxSHAPED flag
m_BCLineSizer->Add(m_BrightContLine, 1, wxALL|wxALIGN_LEFT|wxSHAPED);

Resources