Id
int64
1.68k
75.6M
PostTypeId
int64
1
2
AcceptedAnswerId
int64
1.7k
75.6M
ParentId
int64
1.68k
75.6M
Score
int64
-60
3.16k
ViewCount
int64
8
2.68M
Body
stringlengths
1
41.1k
Title
stringlengths
14
150
ContentLicense
stringclasses
3 values
FavoriteCount
int64
0
1
CreationDate
stringlengths
23
23
LastActivityDate
stringlengths
23
23
LastEditDate
stringlengths
23
23
LastEditorUserId
int64
-1
21.3M
OwnerUserId
int64
1
21.3M
Tags
sequence
74,033,572
2
null
74,031,722
0
null
In addition to what @Mads Hansen offered, the slash in "Date/Time_Stamp" must be escaped. Try this regex: `Type_of_Call\s*=\s*(?<Type_Of_Call>\w+)\s+Call\s+LOB\s*=\s*(?<LOB>\w+)\s+Date\/Time_Stamp\s*=\s*(?<Date_Time_Stamp>[0-9TZ.:-]+)\s+Policy_Number\s*=\s*(?<Policy_Number>[\w-]+)\s+Requester_Id\s*=\s*(?<Requestor_Id>\w+)\s+Last_Name\s*=\s*(\w+)\s+State\s*=\s*(?<State>\w+)`
null
CC BY-SA 4.0
null
2022-10-11T20:06:50.043
2022-10-11T20:06:50.043
null
null
2,227,420
null
74,033,654
2
null
74,033,203
0
null
I added a bit more code just for the mere example. the data i chose is probably not the best choice to display a proper timer series. I hope the features of ggplot i displayed will be benficial for you in the future ``` library(tidyverse) library(lubridate) mydat <- sample_frac(storms,.4) # setting the month of interest as the current system's month month_of_interest <- month(Sys.Date(),label = TRUE) mydat %>% group_by(year,month) %>% summarise(avg_pressure = mean(pressure)) %>% mutate(month = month(month,label = TRUE), current_month = month == month_of_interest) %>% # the mutate code is just for my example. ggplot(aes(x=year, y=avg_pressure, color=current_month, group=month, size=current_month ))+geom_line(show.legend = FALSE)+ ## From here its not really important, ## just ideas for your next plots scale_color_manual(values=c("grey","red"))+ scale_size_manual(values = c(.4,1))+ ggtitle(paste("Averge yearly pressure,\n with special interest in",month_of_interest))+ theme_minimal() ## Most important is that you notice the group argument and also, # in most cases you will want to color your different lines. # I added a logical variable so only October will be colored, # but that is not mandatory ```
null
CC BY-SA 4.0
null
2022-10-11T20:16:56.890
2022-10-11T20:16:56.890
null
null
19,110,927
null
74,033,668
2
null
74,033,631
1
null
This should work. What you did was make item 0 the last item with the first statement, then made the last item the first item which was just made the last item. You need to swap both items at the same time, or store them in a temp variable first, then swap them. ``` def swap (values_list): temp0 = values_list[0] temp1 = values_list[-1] values_list[0] = temp1 values_list[1] = temp0 return values_list values_list = input().split(',') # Program receives comma-separated values like 5,4,12,19 swap(values_list) print(values_list) ``` The syntax in the link below is used to swap 2 items in a list. It's a one liner. You should read it, it has some good examples. [https://www.geeksforgeeks.org/python-program-to-swap-two-elements-in-a-list/](https://www.geeksforgeeks.org/python-program-to-swap-two-elements-in-a-list/)
null
CC BY-SA 4.0
null
2022-10-11T20:18:07.490
2022-10-11T20:24:19.563
2022-10-11T20:24:19.563
15,147,778
15,147,778
null
74,033,693
2
null
74,033,302
0
null
You need to delegate to be allowed to have one script work on dynamically inserted elements. Also use classes since IDs need to be unique ``` $(document).ready(function() { const cambioOpciones = () => {console.log("changed") } const $tb = $("#tb"); $tb.on("click", ".add_row", function(e) { $tb.append($tb.find("tr").eq(0).clone(true)) }); $tb.on("click", ".delete_row", function(e) { const $row = $(this).closest("tr"); if ($row.prev().length>0) $row.remove() }); $tb.on("change", "[name='products[]']", cambioOpciones) }); ``` ``` <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script> <table> <tbody id="tb"> <tr> <td> <select name="products[]" class="form-control"> <option value="val">val</option> <option value="val">val</option> <option value="val">val</option> </select> </td> <td><button type="button" class="add_row">Add</button></td> <td><button type="button" class="delete_row">delete</button></td> </tr> </tbody> </table> ```
null
CC BY-SA 4.0
null
2022-10-11T20:20:45.410
2022-10-11T20:20:45.410
null
null
295,783
null
74,034,042
2
null
74,033,143
1
null
From the pandas docs you linked for the method parameter ``` When ‘table’, the only allowed interpolation methods are ‘nearest’, ‘lower’, and ‘higher’. ``` As an interpolation was not specified it uses the default `linear` Try using one of the allowed interpolation parameters and see if that works.
null
CC BY-SA 4.0
null
2022-10-11T20:57:34.170
2022-10-11T20:57:34.170
null
null
16,944,079
null
74,034,357
2
null
74,034,247
1
null
You can just keep track of the total per year. The below code also includes the null coalescing operator `??` to see if the source array has an item, and falls back to `0` if it doesn't. ``` $data = [ 2022 => [ 'Jan' => 1, 'Mar' => 2, ] ]; $allMonths = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; foreach($data as $year => $months) { $total = 0; foreach($allMonths as $monthShort) { $thisMonthCount = $months[$monthShort] ?? 0; $total += $thisMonthCount; echo $thisMonthCount, PHP_EOL; } echo 'Total:' . $total; } ``` Output: ``` 1 0 2 0 0 0 0 0 0 0 0 0 Total:3 ``` Demo here: [https://3v4l.org/ahHonY](https://3v4l.org/ahHonY)
null
CC BY-SA 4.0
null
2022-10-11T21:33:42.187
2022-10-11T21:50:59.203
2022-10-11T21:50:59.203
231,316
231,316
null
74,034,358
2
null
28,371,506
0
null
What is your filter? From the log you have, looks like you are doing a scan operation with `(RowKey ge '2015.02.05.00000000-0000-0000-0000-000000000000') and (RowKey le '2015.02.07.00000000-0000-0000-0000-000000000000')` Although `RowKey` is indexed, when you filter by a range of rowkeys with comparison like `ge` or `le`, it performs a scan instead, which can be very slow depending on the size of your table. You can try loading the whole partition `4306.www-detail-mercury-mars-skywatching-tips.html-get` in memory and do the filtering to see if it's faster. Btw, from your entity data structure, looks like you are trying log event for accessing a web page. If you are, you may want to check out Application Insights. It's more suitable for telemetry logging.
null
CC BY-SA 4.0
null
2022-10-11T21:33:42.787
2022-10-11T21:33:42.787
null
null
4,584,928
null
74,034,578
2
null
74,034,420
5
null
We can see the uneven spacing of your bars in the sample data, even without missing values: ``` library(ggplot2) ggplot(dataset_test, aes(time, gfp485)) + geom_col(size= .1, fill = "green", color = "green", alpha = 0.4) ``` ![](https://i.imgur.com/3YAfvEV.png) The reason for this is that your observations are not evenly spaced in time. If we check the difference between consecutive time values, we will see they are not all the same: ``` diff(dataset_test$time) #> [1] 2.40 2.40 2.16 2.40 2.40 2.40 2.16 2.40 2.40 2.16 2.40 2.40 2.40 2.16 #> [15] 2.40 2.40 2.40 2.16 2.40 ``` If you are prepared to change the actual data for a prettier plot, but keep the overall time equal to the original, you could do: ``` ggplot(dataset_test, aes(x = min(time) + seq(0, by = mean(diff(time)), length = length(time)), y = gfp485)) + geom_col(size= .1, fill = "green", color = "green", alpha = 0.4) + labs(x = "time") ``` [](https://i.stack.imgur.com/wcOfU.png) However, if you have unequally spaced time data and a continuous variable on the y axis, then it would be more honest (and, I would argue, more visually appealing) to use `geom_area`: ``` ggplot(dataset_test, aes(time, gfp485)) + geom_area(fill = "#90d850", color = "#266825", alpha = 0.4, size = 0.5) + theme_minimal(base_size = 16) + theme(plot.background = element_rect(fill = "#fafaf4", color = NA)) ``` [](https://i.stack.imgur.com/yesiC.png) [reprex v2.0.2](https://reprex.tidyverse.org)
null
CC BY-SA 4.0
null
2022-10-11T22:08:23.687
2022-10-11T22:20:33.967
2022-10-11T22:20:33.967
12,500,315
12,500,315
null
74,034,758
2
null
74,034,265
3
null
When the `ImageIO.read` function creates a `BufferedImage` it uses the type that it thinks is best suited. This type might not be what you expect. In particular, for a JPG image the type might not be `TYPE_INT_ARGB`. This is the case for your second image and becomes evident when you print the type of that image: ``` System.out.println(bi_in.getType()); ``` For that image, this prints `10` on my machine, which represents [TYPE_BYTE_GRAY](https://docs.oracle.com/en/java/javase/18/docs/api/constant-values.html#java.awt.image.BufferedImage.TYPE_BYTE_GRAY). So, to fix your problem you should use: ``` BufferedImage bi_out = new BufferedImage(width, height, bi_in.getType()); ```
null
CC BY-SA 4.0
null
2022-10-11T22:38:36.933
2022-10-11T22:38:36.933
null
null
7,970,787
null
74,034,998
2
null
74,034,666
0
null
I think you need to connect to the [currentRowChanged](https://doc.qt.io/qt-5/qlistwidget.html#currentRowChanged) signal of QListWidget. If your window layout is purely in code, then connecting the signals will look like this: ``` self.listwidget1.currentRowChanged.connect(self.on_listwidget1_currentRowChanged) self.listwidget2.currentRowChanged.connect(self.on_listwidget2_currentRowChanged) self.listwidget2.currentRowChanged.connect(self.on_listwidget3_currentRowChanged) ``` If you are using Qt Designer, then the connections are automatically done by pyuic. Then your methods for handling changes in your QListWidgets are: ``` def on_listwidget1_currentRowChanged(self, currentRow): <put your code here> def on_listwidget2_currentRowChanged(self, currentRow): <put your code here> def on_listwidget3_currentRowChanged(self, currentRow): <put your code here> ```
null
CC BY-SA 4.0
null
2022-10-11T23:27:56.547
2022-10-28T23:41:24.733
2022-10-28T23:41:24.733
9,705,687
9,705,687
null
74,035,032
2
null
74,018,300
0
null
(This should probably be moved to [CrossValidated](https://stats.stackexchange.com).) Based on the profile plots, it looks like the profile confidence intervals — which are determined by the intersections of the profiles with the critical thresholds (shown as horizontal dashed lines in the figure you present) — are fine; that is, any weirdness/non-monotonicity in the profile curves, such as the kink in the `.sig02` profile (top row, middle), seems to occur outside of the central range we really care about. Otherwise the curves are reasonably smooth. (In this case profiles would mean we could get away with the simpler Wald approximations — this appears to be true for some but not all of the parameters.)
null
CC BY-SA 4.0
null
2022-10-11T23:35:31.103
2022-10-11T23:35:31.103
null
null
190,277
null
74,035,128
2
null
74,034,666
1
null
You could subclass `QListWidget` and have it emit a custom signal when the selection changes that emits the instance of the the widget as the parameter. Then in the parent widget you could have a single slot that would deselect the other two list widgets that works for all three lists. --- update Based on the information provided in the comments, you actually don't need to subclass `QListWidget`, instead you can get the instance using the `currentItemChanged` signal since it emits the previously selected item and the item it has changed to as arguments. Then using the `QListWidgetItem.listWidget()` method you can get the instance of the list that emitted the signal. Here is an example: ``` class Window(QWidget): def __init__(self, parent=None): super().__init__(parent=parent) self.layout = QHBoxLayout(self) self.resize(500,500) self.lists = [QListWidget(parent=self) for _ in range(3)] for widget in self.lists: self.layout.addWidget(widget) for i in range(30): item = QListWidgetItem(type=0) item.setText(str(i)) widget.insertItem(i, item) widget.currentItemChanged.connect(self.deselect) def deselect(self, new, old): if not new: return instance = new.listWidget() for widget in self.lists: if widget != instance: widget.setCurrentRow(-1) ```
null
CC BY-SA 4.0
null
2022-10-11T23:53:15.427
2022-10-12T01:37:18.307
2022-10-12T01:37:18.307
17,829,451
17,829,451
null
74,035,417
2
null
29,450,844
0
null
It's not the most elegant solution, but you can use a panel in the Form Designer and set the BackColor property to white and cover the arrows. Of course this creates a white area where the user cannot interact with the control, so I recommend covering the NumericUpDown's borders and drawing a line on the left edge of the panel. (Looks something like this [screenshot](https://i.stack.imgur.com/NoGGr.png) in the designer). Then, add a Paint event to the panel: ``` private void panel1_Paint(object sender, PaintEventArgs e) { using (Pen pen = new Pen(Color.FromArgb(174, 173, 179), 1)) { e.Graphics.DrawLine(pen, 0, 0, 0, panel1.Height); } } ```
null
CC BY-SA 4.0
null
2022-10-12T01:00:48.160
2022-10-12T01:00:48.160
null
null
20,105,762
null
74,036,130
2
null
74,034,775
0
null
According to 7zip documentation, to install it in a silent mode you can : Use the "/S" parameter to do a silent installation and the /D="C:\Program Files\7-Zip" parameter to specify the "output directory". These options are case-sensitive. Use the /q INSTALLDIR="C:\Program Files\7-Zip" parameters. In the second case it's quite a standard for Windows.
null
CC BY-SA 4.0
null
2022-10-12T03:18:02.630
2022-10-12T03:18:02.630
null
null
608,772
null
74,036,383
2
null
63,319,465
0
null
For only Appbar ``` AppBar{ toolbarHeight: 180, } ```
null
CC BY-SA 4.0
null
2022-10-12T04:07:54.307
2022-10-12T04:07:54.307
null
null
10,227,261
null
74,036,455
2
null
63,319,465
0
null
You can do like this: ``` SliverAppBar( expandedHeight: 300, //add expand height floating: false, pinned: true, bottom: PreferredSize( // Add this code preferredSize: Size.fromHeight(60.0), // Add this code child: Text(''), // Add this code ), // Add this code flexibleSpace: Container( padding: EdgeInsets.all(10), height: 340, width: double.infinity, child: Column( mainAxisAlignment: MainAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ Container( height: 40, ), Container( height: 60, ), Expanded(child: Container()), Text('TEST'), ], ), decoration: BoxDecoration( image: DecorationImage( image: NetworkImage('https://picsum.photos/400/400'), fit: BoxFit.cover)), ), ) ```
null
CC BY-SA 4.0
null
2022-10-12T04:19:39.383
2022-10-12T04:19:39.383
null
null
8,480,069
null
74,036,510
2
null
74,036,315
1
null
Follow the below piece of VBA code; ``` Sub code() Dim lRow As Long lRow = Cells(Rows.Count, 1).End(xlUp).Row Range("B2:B" & lRow).Formula = "=($K$12-SUM($C$2:C2))/($L$13-(ROW()-2))" End Sub ``` Output; [](https://i.stack.imgur.com/FcTXj.png)
null
CC BY-SA 4.0
null
2022-10-12T04:29:35.257
2022-10-12T04:29:35.257
null
null
20,040,720
null
74,036,593
2
null
74,036,390
1
null
As mentioned [Jose Ramirez](https://stackoverflow.com/users/13886104/jos%c3%a9-ram%c3%adrez), you need to access the text node of each header element with `heading.innerText`. Then you can get the length of the content string. ``` const headings = document.querySelectorAll('h1,h2,h3') console.log(headings.length) headings.forEach(heading => { let headingLength = heading.innerText.length console.log(headingLength) }) ``` ``` <h1>Longest Heading</h1> <h2>Short Heading</h2> <h3>Min Heading</h3> ```
null
CC BY-SA 4.0
null
2022-10-12T04:45:30.757
2022-10-12T04:45:30.757
null
null
2,463,800
null
74,036,914
2
null
74,036,632
0
null
There are a couple of ways to approach this. One is to use an `OUTER APPLY` to look up at most one TestNotes record for the given SampleTests record. `OUTER APPLY` works similar to a `LEFT JOIN`, but allows joining to a subquery having more complex conditions (like `TOP 1` and `ORDER BY`) than can be expressed in the `ON` condition of a regular join. Take a look at: ``` SELECT ISNUll(TN.AuditNumber,'test'), CASE TN.AuditNumber WHEN ' ' THEN 'test' ELSE TN.AuditNumber END FROM [MATGEM2RPGROUP].[dbo].[SampleTests] ST OUTER APPLY ( SELECT TOP 1 TN1.* FROM [MATGEM2RPGROUP].[dbo].[TestNotes] TN1 WHERE TN1.TestCode = ST.TestCode ORDER BY TN1.AuditNumber DESC ) TN WHERE ST.SampleCode='2210-0084-03' AND ST.AuditFlag=0 ``` If more than one matching TestNotes record is found, the one with the largest AuditNumber is returned. If no matching TestNotes record is found, that part of the query returns nulls, but the overall query still returns one row. I'll haven't changed the SELECT expressions. Of the ones you originally posted, the first should handle the null/not-found case. I don't think the second one is going to work as you intended.
null
CC BY-SA 4.0
null
2022-10-12T05:32:40.653
2022-10-12T05:32:40.653
null
null
12,637,193
null
74,036,956
2
null
74,028,360
0
null
Try something like this: ``` NewUsers = -- get the first date from the slicer var _date1 = CALCULATE( MIN('Date Table'[Date]), ALLSELECTED('Date Table') ) var _newUsers = calculate( sum(KPI_SUMMARY[NEW_USERS]), KPI_SUMMARY[JOIN_DATE] = _date1 ) --get the new users from the first date return _newUsers -- i want to always return the newUsers from the first date of the slicer. it shouldnt change ``` I used function inside function to change variable calculation context. Also, as you can see, I would advice you to name your variables with "_" prefix. It's much easier to recognize them then.
null
CC BY-SA 4.0
null
2022-10-12T05:39:21.227
2022-10-12T05:39:21.227
null
null
18,418,625
null
74,037,282
2
null
5,356,171
1
null
You can follow any python version. But in your case Django is not installed globally. Requirement is you need to have Django installed in system. For checking the django is installed or not open CMD / terminal (Assuming that Python is already installed) ``` $ python $ import django $ django.VERSION ``` You can see the output like this. Here I am using Django 3.1 ``` (3, 1, 0, 'final', 0) ``` Then in the Preferences --> Interpreter - Python --> Click new and add the location where python.exe or Python application resides. Make sure you are naming the Interpreter appropriately for future reference. Then restart the eclipse and go to New --> Other --> PyDev --> PyDev Django Project 1. Name your project 2. Select the Interpreter that you previously created from the drop down. The above fixes your issue.
null
CC BY-SA 4.0
null
2022-10-12T06:21:09.847
2022-10-12T06:21:09.847
null
null
4,590,917
null
74,037,621
2
null
74,008,412
0
null
You may want to check this [Authenticate with Firebase on Android Using a Custom Authentication System](https://firebase.google.com/docs/auth/android/custom-auth#java_3). > After a user signs in for the first time, a new user account is created and linked to the credentials—that is, the user name and password, phone number, or auth provider information—the user signed in with. This new account is stored as part of your Firebase project, and can be used to identify a user across every app in your project, regardless of how the user signs in.
null
CC BY-SA 4.0
null
2022-10-12T06:56:22.050
2022-10-12T06:56:22.050
null
null
19,229,284
null
74,038,650
2
null
23,275,128
0
null
A good solution here is to check for possible normal inversion (fold-over) just after the edge is extracted from minimal heap and before it is contracted. If the check fails, then the edge is not penalized anyhow, but just skipped for now, and it can appear in the minimal heap later after contraction of one of its neighbors. The check can be implemented in pseudocode as follows: ``` //average normal of the mesh region around the edge being checked before contraction Vector3 beforeNormal = ... // now check all triangles to appear after contraction for ( afterTri : ... ) if ( dot( norm(afterTri), beforeNormal ) < 0 ) return //check failed return //check passed ``` This approach is implemented [MeshLib](https://github.com/MeshInspector/MeshLib#readme) having fast and high quality mesh simplification module based on the same paper. The corresponding code in MRMeshDecimate.cpp is ``` auto n = Vector3f{ sumDblArea_.normalized() }; for ( const auto da : triDblAreas_ ) if ( dot( da, n ) < 0 ) return {}; ```
null
CC BY-SA 4.0
null
2022-10-12T08:22:48.103
2022-10-12T08:22:48.103
null
null
7,325,599
null
74,038,721
2
null
25,514,802
0
null
In current version(3.9.1) i could not find `.getPointsAtEvent(event)` no more. As a workaround that worked for me I found in [Chart.js GitHub](https://github.com/chartjs/Chart.js/issues/1283#issuecomment-379471050) code sample ``` var selectedPoint; .... options: { plugins: { tooltip: { callbacks: { afterBody: function(context) { if(context && context[0]) selectedPoint = context[0]; return ['']; } } } }, ..... onClick: (e) => { console.log(selectedPoint); } } ``` Basicaly on tooltip generation you save data to variable `selectedPoint` and in `onClick` event you start using it.
null
CC BY-SA 4.0
null
2022-10-12T08:27:20.367
2022-10-12T08:27:20.367
null
null
1,278,129
null
74,038,720
2
null
53,664,034
0
null
Here is a code snippet that replaces all the occurrences of a key like `${firstName}` with its String value in an `XWPFDocument`. All the parameters to be replaced will be stored in a `Map<String, String>`. ``` private void replaceParameters(XWPFDocument document, Map<String, String> replacements) { for (Map.Entry<String, String> parameter : replacements.entrySet()) { // replaces all occurrences in the headers replaceHeadersParams(document.getHeaderList(), parameter); // replaces all occurrences in the document's body replaceParagraphsParams(document.getParagraphs(), parameter); replaceTablesParams(document.getTables(), parameter); // replaces all occurrences in the footers replaceFootersParams(document.getFooterList(), parameter); } } private void replaceHeadersParams(List<XWPFHeader> headers, Map.Entry<String, String> paramToReplace) { for (XWPFHeader header : headers) { replaceParagraphsParams(header.getParagraphs(), paramToReplace); replaceTablesParams(header.getTables(), paramToReplace); } } private void replaceFootersParams(List<XWPFFooter> footers, Map.Entry<String, String> parameter) { for (XWPFFooter footer : footers) { replaceParagraphsParams(footer.getParagraphs(), parameter); replaceTablesParams(footer.getTables(), parameter); } } private void replaceTablesParams(List<XWPFTable> tables, Map.Entry<String, String> paramToReplace) { for (XWPFTable tbl : tables) { for (XWPFTableRow row : tbl.getRows()) { for (XWPFTableCell cell : row.getTableCells()) { replaceParagraphsParams(cell.getParagraphs(), paramToReplace); } } } } ``` Replace the `startIndex` and `endIndex` with your values `$$`. Keep in mind that this implementation replaces all the occurrences ignoring the case. ``` private void replaceParagraphsParams(List<XWPFParagraph> paragraphs, Map.Entry<String, String> paramToReplace) throws POIXMLException { for (XWPFParagraph p : paragraphs) { for (XWPFRun r : p.getRuns()) { String text = r.getText(0); if (text != null && text.toLowerCase().contains(paramToReplace.getKey().toLowerCase())) { int startIndex = text.indexOf("${"); int endIndex = text.indexOf("}"); String toBeReplaced = text.substring(startIndex, endIndex + 1); text = text.replace(toBeReplaced, paramToReplace.getValue()); r.setText(text, 0); } } } } ```
null
CC BY-SA 4.0
null
2022-10-12T08:27:19.467
2022-10-12T08:27:19.467
null
null
12,355,831
null
74,038,785
2
null
74,037,162
0
null
Just add this 'text-align:center;' to .avator class. I think the reason it didnt work, was because the image wasnt centrally aligned in the first instance. This showed in the second instance when you put a smaller image. By the way, this 'margin: 0 auto;' inside the img, does nothing.
null
CC BY-SA 4.0
null
2022-10-12T08:32:50.053
2022-10-12T08:32:50.053
null
null
18,475,990
null
74,038,945
2
null
52,804,315
0
null
This functionality has been updated. It is possible to get the status badge at the job level within Azure Pipelines. This can be configured at the top of the status badge page. The only thing you need to do is make sure that the structure of the YAML pipeline corresponds with what you’re looking for in terms of context.
null
CC BY-SA 4.0
null
2022-10-12T08:44:15.893
2022-10-12T08:44:15.893
null
null
20,216,876
null
74,039,538
2
null
23,970,610
0
null
I'm guessing this wasn't the case in 2014, but now browsers respect `clip-path` when establishing the clickable area for an element. Theoretically then, the example given (prefix notwithstanding) in the question should behave as was originally desired now. Here is a codepen demonstrating this: [https://codepen.io/joshdavenport/pen/GRdPxyw](https://codepen.io/joshdavenport/pen/GRdPxyw) [](https://i.stack.imgur.com/d9jEz.gif)
null
CC BY-SA 4.0
null
2022-10-12T09:27:18.407
2022-10-12T09:27:18.407
null
null
733,347
null
74,039,923
2
null
36,391,120
0
null
``` SELECT CONCAT(NAME,"(",LEFT(OCCUPATION,1),")") FROM OCCUPATIONS ORDER BY NAME; SELECT CONCAT("There are a total of ",COUNT(OCCUPATION)," ",lower(OCCUPATION),"s.") FROM OCCUPATIONS GROUP BY OCCUPATION ORDER BY COUNT(OCCUPATION); ```
null
CC BY-SA 4.0
null
2022-10-12T09:58:19.363
2022-10-12T10:06:47.637
2022-10-12T10:06:47.637
2,294,907
2,294,907
null
74,040,180
2
null
8,747,904
0
null
I had the same issue. For me the byte array BitBank provided was correct. But instead of inserting the bytes before SOI (which results to error), I inserted before SOF and it worked! Basically what keepitrall89 is talking about the byte 2.
null
CC BY-SA 4.0
null
2022-10-12T10:16:52.843
2022-10-12T10:16:52.843
null
null
20,220,785
null
74,040,558
2
null
74,040,059
1
null
Maybe something like this. ``` #!/usr/bin/env bash shopt -s nocasematch until [[ "${risposta[0]}" = @(marzo|1879) || "${riposta[1]}" = @(marzo|1879) ]]; do echo "Risposta errata, riprova!" read -ra risposta done ```
null
CC BY-SA 4.0
null
2022-10-12T10:45:30.273
2022-10-12T10:45:30.273
null
null
4,452,265
null
74,040,730
2
null
74,038,384
0
null
Try adding 'sometimes' to the rules for your file fields. for example: ``` 'ir_number' => 'sometimes|required|integer', 'type' => 'sometimes|required|integer', 'location' => 'sometimes|required|integer', //..... 'attachment' => 'sometimes|nullable|image|mimes:jpeg,jpg,png,gif,webp', ```
null
CC BY-SA 4.0
null
2022-10-12T10:58:50.127
2022-10-12T10:58:50.127
null
null
20,221,366
null
74,040,868
2
null
74,039,054
0
null
``` InkWell( onTap: () => Navigator.of(context).push( MaterialPageRoute( builder: ((context) => const PopAnime()), ), ), child: const Text( "See all >", style: TextStyle( fontWeight: FontWeight.bold, color: Colors.white, fontSize: 15, ), ), ) ``` you can use navigator like this
null
CC BY-SA 4.0
null
2022-10-12T11:11:59.077
2022-10-12T11:11:59.077
null
null
20,201,716
null
74,041,260
2
null
74,038,683
0
null
Here's a possible approach using `ggplot` It's built up with a helper data frame based on run length encoding for the values. You may find you have to fiddle with positioning the arrow head by editing the `arr_end` variable. I've ignored the start of the arrow as this is covered by the point. ``` library(ggplot2) library(dplyr, warn.conflicts = FALSE) df <- data.frame( frame = 1:25, value = c("A", "A", "A", "B", "A","A","C","C","C","B","B","A", "A","C","B","B","B","B","D","D","D","D","C","A","A")) df_rle <- data.frame(len = rle(df$value)[[1]], val = rle(df$value)[[2]], group = 1) |> mutate(cum = cumsum(len), arr_end = lead(cum - 0.5 * len) - 0.7) ggplot(df_rle)+ geom_rect(aes(xmin = cum - len, xmax = cum, ymin = 0, ymax = 0.05, fill = val))+ geom_text(aes(label = val, x = cum - 0.5*len, y = -0.03))+ geom_segment(aes(x = cum - 0.5*len, xend = arr_end, y = -0.02, yend = -0.02), arrow = arrow(length=unit(0.25,"cm"), ends="last", type = "closed") )+ geom_point(aes(x = cum - 0.5*len, y = -0.02, fill = val, colour = val), shape = 21, size = 10, show.legend = FALSE)+ theme_void() #> Warning: Removed 1 rows containing missing values (geom_segment). ``` ![](https://i.imgur.com/DQT4NOX.png) [reprex v2.0.2](https://reprex.tidyverse.org)
null
CC BY-SA 4.0
null
2022-10-12T11:43:53.020
2022-10-12T11:48:53.513
2022-10-12T11:48:53.513
6,936,545
6,936,545
null
74,041,959
2
null
74,041,178
0
null
There are many ways to implement it. One way to do so is: If I understood correctly and you want to achieve that by using Minus & Plus buttons, you should create a global - (`int adultCounter;`) and then increment his value with each click (on the button, of course) You should set the text value to this adultCounter value (as a String). Then, you'll be able to condition this value and manipulate everything you want.
null
CC BY-SA 4.0
null
2022-10-12T12:38:11.447
2022-10-12T12:38:11.447
null
null
9,585,941
null
74,041,962
2
null
74,041,178
0
null
Basically you can implement a switch statement for choosing your buttons. Example: ``` public class CounterSystem implements OnClickListener { Button b1 = (Button) findViewById(R.id.adultPos); Button b2 = (Button) findViewById(R.id.adultNeg); b1.setOnClickListener(this); b2.setOnClickListener(this); public void onClick(View click) { switch(click.getId()) { case R.id.adultPos: // your code for counter etc. and button visibility break; case R.id.adultNeg: // your code for counter etc. and button visibility break; } } } ``` Afterwards you can implement a counter in your code and use counter++ in the switch cases on every button click. As soon as the counter reaches 9, use the Button method `setVisibility(int visibility)` (use if & else depending on the actual value of the counter). E.g. you can make the button disappear with the method: `b1.setVisibility(View.GONE)` [https://developer.android.com/reference/android/view/View#setVisibility(int)](https://developer.android.com/reference/android/view/View#setVisibility(int)) Test this simple approach in a few ways and then build up your code for more elements (will be easier for you, if you have less items in your layout).
null
CC BY-SA 4.0
null
2022-10-12T12:38:18.313
2022-10-12T12:38:18.313
null
null
14,172,469
null
74,043,049
2
null
73,999,663
0
null
You can try this. Hope this will solved your problem ``` #hero { width: 100%; height: 75vh; background-image: url("../img/hero-bannertest3.jpeg"); background-size: 100% 100%; } ```
null
CC BY-SA 4.0
null
2022-10-12T13:51:44.243
2022-10-12T13:51:44.243
null
null
5,278,291
null
74,043,113
2
null
74,042,888
1
null
I don't know if it helps but I will try to help you. First, I think it i totally possible to only use VS Code as you are just coding an API. Second, have you though about having an in-memory database like Redis? Third, I think it depends. It is possible to do that in a week at least for more experienced people, but as a "newbie" as you said, I think maybe some more time might be needed. Hope it helps ^^
null
CC BY-SA 4.0
null
2022-10-12T13:56:13.547
2022-10-12T13:56:13.547
null
null
20,220,154
null
74,043,177
2
null
74,043,014
1
null
Your lines do not reach the x, axis because the upper limit for `x_1` and `x_2` is 30: `x_1 = np.linspace(0,30,1000)`. You can extend the range and set `plt.ylim(bottom=0)` to restrict the visible area to `x_2>0`: ``` x_1 = np.linspace(0,80,1000) x_2 = np.linspace(0,80,1000) #plot fig, ax = plt.subplots() fig.set_size_inches(14.7, 8.27) # draw constraints plt.axvline(80, color='g', label=r'$x_1 \geq 80$') # constraint 1 plt.axvline(15, color='g', label=r'$x_1 \geq 15$') # constraint 2 plt.plot(x_1, (120 - x_1) / 3) # constraint 3 plt.plot(x_1, (65 - x_1) / 0.5) # constraint 4 plt.xlim((0, 120)) plt.ylabel(r'x1') plt.ylabel(r'x2') # fill in the fesaible region plt.fill_between(x_1, np.minimum((65 - x_1) / 0.5, (120 - x_1) / 3), np.minimum((65 - x_1) / 0.5, 0), x_1 >= 15, color='green', alpha=0.25) plt.ylim(bottom=0) plt.legend(bbox_to_anchor=(1, 1), loc=1, borderaxespad=0.) # Hide the right and top spines ax.spines['right'].set_visible(False) ax.spines['top'].set_visible(False) plt.show() ``` Is this what you are looking for? [](https://i.stack.imgur.com/QVqnE.png)
null
CC BY-SA 4.0
null
2022-10-12T14:00:02.690
2022-10-12T14:00:02.690
null
null
13,525,512
null
74,043,341
2
null
11,915,826
0
null
This is just to help someone who is still having issues with image rendering in README.md: If your image is named `Some Name.png` and you are trying to attach it in the README.md like `![Some Name](relative/path//res/Some Name.png)`, it won't work. The image has to be saved in the file name. So `Some_Name.png` with `![Some Name](relative/path//res/Some_Name.png)` will work.
null
CC BY-SA 4.0
null
2022-10-12T14:11:34.273
2022-10-12T14:11:34.273
null
null
2,594,331
null
74,043,363
2
null
73,318,545
1
null
Your configuration won't work, because there are 'REQUIRED' and 'ALTERNATIVE' executions in the same level. So, keycloak ignores all ALTERNATIVE s. You should add one sub flow and add all executions and flows into it except , then make this sub flow required. For more information refer [here - at the end of the page](https://github.com/keycloak/keycloak-documentation/blob/main/server_admin/topics/authentication/flows.adoc)
null
CC BY-SA 4.0
null
2022-10-12T14:13:10.307
2022-10-12T14:13:10.307
null
null
5,862,485
null
74,043,507
2
null
74,032,055
4
null
I am not sure, whether it suits your problem, but it seems to me that it is related to the [planarity of a graph.](https://en.wikipedia.org/wiki/Planar_graph) You can check whether a graph is planar with: ``` nx.is_planar(G) ``` which returns `True`, if it is. [See the documentation.](https://networkx.org/documentation/stable/reference/algorithms/generated/networkx.algorithms.planarity.is_planar.html#networkx.algorithms.planarity.is_planar)
null
CC BY-SA 4.0
null
2022-10-12T14:23:11.900
2022-10-12T14:23:11.900
null
null
16,293,191
null
74,043,602
2
null
30,697,292
0
null
In chartjs v3, there is an "offset" flag that you can set to true. This will create padding. ``` scales: { x: { offset: true, } } ``` > If true, extra space is added to the both edges and the axis is scaled to fit into the chart area. This is set to true for a bar chart by default. [Documentation](https://www.chartjs.org/docs/latest/axes/cartesian/linear.html#common-options-to-all-cartesian-axes)
null
CC BY-SA 4.0
null
2022-10-12T14:29:36.283
2022-10-12T14:29:36.283
null
null
741,657
null
74,043,638
2
null
12,066,638
0
null
When I had 32 bit preferred checked, when run on our server, it was trying to use the 32 bit db driver instead of 64 bit that we had installed, so it wasn't connecting to the db when we ran it, so queries were failing because of failure to connect.
null
CC BY-SA 4.0
null
2022-10-12T14:32:06.593
2022-10-12T14:32:06.593
null
null
1,012,914
null
74,043,796
2
null
74,043,659
2
null
You can use the `VennDiagram` package (I added a bit more to make it prettier): ``` library(VennDiagram) x = list('S1' = LETTERS[1:10],'S2' = LETTERS[5:20],'S3' = LETTERS[15:26]) venn.diagram(x, "test.png", category.names = c("S1","S2","S3"), cat.fontface = "bold", cat.default.pos = "outer", fill = c("purple", "yellow", "green"), cat.pos = c(-27, 27, 135), cat.dist = c(0.055, 0.055, 0.055)) ``` [](https://i.stack.imgur.com/oRGQK.png)
null
CC BY-SA 4.0
null
2022-10-12T14:42:39.520
2022-10-12T14:47:51.260
2022-10-12T14:47:51.260
13,460,602
13,460,602
null
74,043,906
2
null
74,043,856
0
null
Try this; ``` df_sellout.groupby("Brand")[df_sellout.columns[2:].sum() ```
null
CC BY-SA 4.0
null
2022-10-12T14:51:02.330
2022-10-12T14:51:02.330
null
null
20,040,720
null
74,043,996
2
null
73,934,002
0
null
After a few days I finally managed to resolve this issue. To better explain the environment: I managed to make a connection through a Wordpress php file with a remote SQL Server database. For this I used: - - First, I had the Wordpress store on a CloudLinux server, which didn't allow me root access over ssh. I switched the wordpress store to a VPS. In this VPS I had to install [all the PHP extensions that I had previously on the other server](https://i.stack.imgur.com/mfjIM.png), along with the [odbc drivers for sql server.](https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-ver15#redhat17) On the local machine I activated the remote environment, in which the access port was 3389. Then I had to configure the router so that the firewall does not block communication. For that I made a forward on the router where I gave access to the VPS IP to the machine with SQL Server, which in my case is a local machine, for that I had to indicate the port (3389). for the rules defined in the router to be active, it was necessary to restart! To make the connection I used the following code: ``` $serverName = "tcp:IP\DESKTOP\SQLEXPRESS,1433"; $username = "username"; $password = "password"; $database = "database"; $connectionInfo = array( "Database"=> $database, "UID"=>$username, "PWD"=>$password, "TrustServerCertificate"=>"Yes"); $conn = sqlsrv_connect($serverName, $connectionInfo); if( $conn ) { echo "Connection established."; }else{ echo "Connection could not be established."; die( print_r( sqlsrv_errors(), true)); } ``` The IP used was the public IP of the local machine. If anyone has any questions let me know, I can try to help.
null
CC BY-SA 4.0
null
2022-10-12T14:57:15.197
2022-10-13T09:07:42.360
2022-10-13T09:07:42.360
19,588,076
19,588,076
null
74,044,129
2
null
66,369,932
-1
null
I had the same issue. if there is a .pro file check in there to see if the form.h is in the same format as well as in your form.cpp I had to delete and re-add them and do a rebuild all and it worked I hope it works for you as well.
null
CC BY-SA 4.0
null
2022-10-12T15:06:05.067
2022-10-12T15:06:05.067
null
null
20,223,574
null
74,044,215
2
null
19,025,301
1
null
One reason why gravity does not work properly can be if you have `gravity` and `textAlignment` If you put it like this ``` <TextView android:id="@+id/textView1" android:layout_width="200dp" android:layout_height="wrap_content" android:gravity="center|center_horizontal" android:textAlignment="viewStart" ``` Android studio editor will give this warning: `Inconsistent alignment specification between textAlignment and gravity attributes: was center|center_horizontal, expected start (Incompatible direction here)` But if you add textAlignment inside the styles then it doesn't complain. This can be the issue why your gravity value will not work ``` <TextView android:id="@+id/textView2" style="@style/Widget.App.TextView.Label.Default" android:layout_width="200dp" android:layout_height="wrap_content" android:gravity="center|center_horizontal" ``` Check this answer for the difference between them: [Text/Layout Alignment in Android (textAlignment, gravity)](https://stackoverflow.com/questions/16196444/text-layout-alignment-in-android-textalignment-gravity)
null
CC BY-SA 4.0
null
2022-10-12T15:12:31.093
2022-10-12T15:12:31.093
null
null
2,736,039
null
74,044,279
2
null
74,044,138
0
null
Is that what you're looking for? if you share the data as a code, I'll be able to hare the result too ``` df_filtered.loc[df_filtered['protein_accession'] == 'P43098_e', 'domain_count'][:1].values[0] ``` ``` (df_filtered.loc[df_filtered['protein_accession'] == 'P43098_e', 'domain_count'] .head(1) .squeeze()) ``` OR ``` (df_filtered[df_filtered['protein_accession'] == 'P43098_e']['domain_count'] .head(1) .squeeze()) ``` OR Either you need to reset_index() on df_fitered and run above solutions OR add reset_filtered within the statement, like ``` (df_filtered.reset_index()[df_filtered.reset_index()['protein_accession'] == 'P43098_e']['domain_count'] .head(1) .squeeze()) ``` ``` ```
null
CC BY-SA 4.0
null
2022-10-12T15:17:10.227
2022-10-12T15:42:41.817
2022-10-12T15:42:41.817
3,494,754
3,494,754
null
74,044,594
2
null
74,044,550
0
null
what about setting a left margin on ".vsk_column" with the size equals to the width of the menu ? You could use a variable in css
null
CC BY-SA 4.0
null
2022-10-12T15:42:20.850
2022-10-12T15:42:20.850
null
null
12,872,586
null
74,044,675
2
null
30,075,827
0
null
I used two line of code for different status bar color If status bar color is white then use this line of code to visible the status bar icon: ``` pingAct.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); ``` If you use dark color then use this line of code to make visible the status bar icon: ``` pingAct.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE); ```
null
CC BY-SA 4.0
null
2022-10-12T15:48:41.593
2022-10-12T15:48:41.593
null
null
1,564,065
null
74,044,682
2
null
74,044,550
0
null
I assume you want to prevent the menu to be moved when scrolling on the right side? Maybe better not do set position:fixed on the left menu. Set it to height:100vh; and .vsk__column {overflow: auto;}
null
CC BY-SA 4.0
null
2022-10-12T15:49:09.623
2022-10-12T15:49:09.623
null
null
7,745,735
null
74,044,702
2
null
74,044,550
0
null
As an alternative (quite simple workaround), you can try to set the height of the dash-admin-menu and then offsetting the vsk__column div by the same amount of pixels (e.g. 100px), like in following: ``` <div class="admin_menu_wrapper> <dash-admin-menu></dash-admin-menu> </div> <div class="vsk__column"> <dash-create-activity></dash-create-activity> <dash-create-partner></dash-create-partner> <dash-create-resort></dash-create-resort> </div> ``` and then in CSS something like this: ``` .admin_menu_wrapper { height: 100px; } .vsk__column { margin-top: 100px; } ```
null
CC BY-SA 4.0
null
2022-10-12T15:50:18.927
2022-10-12T15:59:52.290
2022-10-12T15:59:52.290
14,701,509
14,701,509
null
74,044,797
2
null
74,042,929
1
null
Nothing critical here, it's a Prettier error. You can either fix that one manually or run a format via ESlint or directly via Prettier to fix it (depends of the configuration of your project). Overall, I recommend this kind of setup overall: [https://stackoverflow.com/a/68880413/8816585](https://stackoverflow.com/a/68880413/8816585)
null
CC BY-SA 4.0
null
2022-10-12T15:57:43.117
2022-10-12T15:57:43.117
null
null
8,816,585
null
74,044,980
2
null
74,044,044
1
null
There might be a bug, so I found a workaround by first specifying `cex` which is in base graphics: > character expansion factor relative to current par("cex"). Used for text, and provides the default for pt.cex. After that, you can specify a custom `legend`. The tricky thing is with the exact colors. Here is a reproducible example: ``` install.packages("remotes") remotes::install_gitlab('daagur/DAAG', build = TRUE, build_opts = c("--no-resave-data", "--no-manual"), dependencies=FALSE) #> Skipping install of 'DAAG' from a gitlab remote, the SHA1 (ecc58275) has not changed since last install. #> Use `force = TRUE` to force installation library(DAAG) CVlm(data=cars, form.lm=dist ~ speed, m=5, dots=FALSE, seed=29, legend.pos="topleft", printit=FALSE, cex = 0.5, main="Small symbols are predicted values while bigger ones are actuals.") #> Error in legend(x = legend.pos, legend = paste("Fold", 1:m, " "), pch = ptypes, : formal argument "cex" matched by multiple actual arguments legend('topleft', legend = c('Fold 1', 'Fold 2', 'Fold 3', 'Fold 4', 'Fold 5'), col = c('brown3', 'chartreuse3', 'darkviolet', 'black', 'deepskyblue3'), lty = 2:6, pch = 2:6, cex = 0.5) ``` ![](https://i.imgur.com/4JzCmyV.png) [reprex v2.0.2](https://reprex.tidyverse.org)
null
CC BY-SA 4.0
null
2022-10-12T16:14:12.007
2022-10-12T16:14:12.007
null
null
14,282,714
null
74,045,010
2
null
74,042,178
-1
null
``` // float x = 0.0 - 1.0 y = sin(x * pi) ^ 0.6 ```
null
CC BY-SA 4.0
null
2022-10-12T16:16:53.683
2022-10-12T16:16:53.683
null
null
19,909,308
null
74,045,105
2
null
74,041,820
1
null
You should use `CStr` instead and concatenate the strings correctly ``` session.FindById("wnd[1]/usr/cntlPRM_CC3000_1/shellcont/shell").SapEvent "Frame0", _ "sapbu_cl= &sapse_cl= &sapin_cl=S1F1E6~L&evtcode=ENTR&scroll_pos=0&S1F1E1L=2000" _ & "&S1F1E2L=10&S1F1E3L=" & CStr(Customer) & " S1F1E4L=&S1F1E4H=" _ & "&S1F1E5L=&S1F1E5H=&S1F1E6L=12.10.2022", _ "sapevent:S1F1" ``` Maybe the following links shed light on the topic string concatenation [How can I concatenate strings in VBA?](https://stackoverflow.com/questions/1727699/how-can-i-concatenate-strings-in-vba) [Concatenating strings containing " and & characters](https://stackoverflow.com/questions/57570006/concatenating-strings-containing-and-characters)
null
CC BY-SA 4.0
null
2022-10-12T16:24:24.090
2022-10-12T16:24:24.090
null
null
6,600,940
null
74,045,290
2
null
73,989,353
1
null
As @saranTunyasuvunakool already mentioned it is really about semi-implicit Euler being symplectic, which is preferable for Hamiltonian systems. A really good post explaining this further is: [https://scicomp.stackexchange.com/a/29154/44176](https://scicomp.stackexchange.com/a/29154/44176)
null
CC BY-SA 4.0
null
2022-10-12T16:38:57.293
2022-10-13T12:32:02.623
2022-10-13T12:32:02.623
20,185,124
20,185,124
null
74,045,342
2
null
74,032,055
6
null
My first reading was the same as [@AveragePythonEngineer's](https://stackoverflow.com/users/16293191/averagepythonenjoyer). Normally in the travelling salesman problem, and graph theory in general, we don't care too much about the positions of the vertices, only the distances between them. And I thought you might be confusing the of a graph with the graph (it's just one realization of infinite possible drawings). So while you can draw a planar graph with crossing edges if you wish (like your example), the point is that you draw it in the plane. On re-reading your question, I think you're actually introducing the 'no crossing paths' as a constraint. To put it another way using the jargon: the path must not be self-intersecting. If that's right, then I think [this question in GIS Stack Exchange](https://gis.stackexchange.com/questions/423351/identifying-self-intersections-in-linestring-using-shapely) will help you. It uses [shapely](https://shapely.readthedocs.io/en/stable/manual.html), a very useful tool for 2D geometric questions. From the first answer: > [Check out] [.is_simple](https://shapely.readthedocs.io/en/stable/manual.html#object.is_simple)> Returns True if the feature does not cross itself. ``` from shapely.wkt import loads l = loads('LINESTRING (9603380.577551289 2719693.31939431, 9602238.01822002 2719133.882441244, 9601011.900844947 2718804.012436028, 9599670.800095448 2718931.680117098, 9599567.204161201 2717889.384686942, 9600852.184025297 2721120.409265322, 9599710.80929024 2720511.270897166, 9602777.832940497 2718125.875545334)') print(l.is_simple) # False ``` If you're looking to solve the problem from scratch then [this answer](https://stackoverflow.com/a/4876249/3381305) to a similar question, but in a different framework, has some interesting leads, especially the [Bentley–Ottmann algorithm](https://en.wikipedia.org/wiki/Bentley%E2%80%93Ottmann_algorithm), which might be useful.
null
CC BY-SA 4.0
null
2022-10-12T16:43:15.967
2022-10-12T16:43:15.967
null
null
20,623,798
null
74,045,516
2
null
73,923,907
0
null
After reproduced from my end:- 1. I have created logic app as shown below: ![enter image description here](https://i.imgur.com/UyaxTRM.png) 1. Selected event type as “Microsoft.KeyVault.KeyNearExpiry” in resource event occurs trigger. This will trigger when a secret in key vault is near to expiry date. ![enter image description here](https://i.imgur.com/liPSpkf.png) 1. Next selected send email action for sending notification. ![enter image description here](https://i.imgur.com/cfDNyOm.png) 1. Logic app ran successfully and received mail. ![enter image description here](https://i.imgur.com/sOzHOb5.png) : This logic app will run automatically when secret expiration date is near to current date.
null
CC BY-SA 4.0
null
2022-10-12T16:57:18.997
2022-10-12T17:02:29.160
2022-10-12T17:02:29.160
19,785,512
19,785,512
null
74,045,570
2
null
74,039,452
0
null
the only REAL detail we need are each of the columns from a different database, or are all the columns from one database? You have lots of choices. For such a layout, we really need to know if the rows have some relation to the other rows. However, using a listview is your best bet. The only issue is as noted, are these columns of data from different tables, or do we have a row of data going accross each column. Without this information, then we are guessing. However, I would think building a listview - and creating a user control might do the trick. For example, I have a issues database, and to edit each section of the issues, then I have this screen: [](https://i.stack.imgur.com/3IVUX.png) The above is 4 listviews, but since I "knew" ahead of time that I needed to edit each choice, then I built a user control out of the listview, and thus repeated it 4 times. However, in your layout, we would drop the "edit" button for each row, and have your single save button. Such a UI is actually quite easy in web forms, but it not clear if your columns are from the same table, and it not clear if each row going accross can be assumed to be one row of data. But, 7 listboxes probably is the way to go. Since the UI, the "+" to add, and virtually all of the markup will look the same, but only having a different datasource, then as above shows, dropping in 4 user controls, reduced the markup from about 400+ lines to this: ``` <h2>Manage Portal Issues Choices</h2> <uc1:GPedit runat="server" id="GPedit3" Title="Edit Project Choices" Col1="Project" Col2="ProjectImage" Heading1="Project" Heading2="Image" DTable="Projects" /> <uc1:GPedit runat="server" id="GPedit1" Title="Edit Issue Choices" Col1="Issue" Col2="IssueImage" Heading1="Issue" Heading2="Image" DTable="Issues" /> <uc1:GPedit runat="server" id="GPedit2" Title="Edit Status Choices" Col1="Status" Col2="StatusImage" Heading1="Status" Heading2="Image" DTable="Status" /> <uc1:GPedit runat="server" id="GPedit0" Title="Edit Priorty Choices" Col1="Priority" Col2="PriorityImage" Heading1="Priority" Heading2="Image" DTable="Priority" /> ``` The above is quite much the WHOLE page of markup!! So, if each column has some kind of relatonship to the other columns (we have rows), then ONE listview would suffice. However, if this is to be 7 seperate columns, all with the same UI, but each colum is to edit seperate data, then the only change for the 7 columns is say the heading, and the data table on which it is to operate. The rest of the code would be 100% the same. As above shows, I do have 4 listviews on the page, but the UI and what I wanted to edit really is exactly the same for the 4 columns of data, just that different data is required, and thus note the settings I have for that user control - I just have to change the heading, table and set PK, and I can add more options. So since you need to "repeat" those columns, and edit those columns, and more so it looks like each column really is its own data, then I suggest the above approach. A listview looks to be the best choice here.
null
CC BY-SA 4.0
null
2022-10-12T17:02:40.613
2022-10-12T17:02:40.613
null
null
10,527
null
74,046,086
2
null
19,119,740
1
null
in VS 2022 I've been doing some C# and had the same problem with the default grid element (the form) being zoomed way out in the Designer, so it looked extremely small, and the controls were super tiny. I found the following Microsoft page that explains how to change the zoom feature (yes, Visual Studio 2022 has a zoom feature). [https://learn.microsoft.com/en-us/dotnet/desktop/winforms/controls/how-to-set-grid-options-for-all-windows-forms?view=netframeworkdesktop-4.8](https://learn.microsoft.com/en-us/dotnet/desktop/winforms/controls/how-to-set-grid-options-for-all-windows-forms?view=netframeworkdesktop-4.8) So, I went into the Tools menu, down to Options, and then in the Options window I scrolled down to the XAML Designer General option. I changed the "Zoom by using" setting to "Mouse Wheel". Using "Ctrl + Mouse Wheel" didn't work for me. And I changed the "Default Zoom Setting" to "Last Used". I closed VS and opened it again. "Last Used" didn't work for me. So, I changed the "Default Zoom Setting" back to "Fit all". Closed VS again (you need to do this for the new settings to take effect). Opened VS again. And everything worked. I am able to use the mouse wheel to zoom in and out of the form. The settings I'm using are "Mouse Wheel" and "Fit All".
null
CC BY-SA 4.0
null
2022-10-12T17:48:51.360
2022-10-12T17:48:51.360
null
null
20,224,857
null
74,046,096
2
null
74,046,063
5
null
You need to re-initialize `fact` for each number. ``` int fact=1; for (int number=1; number<=10; number++) { fact = 1; for (int i=1; i<=number; i++) fact=fact*i; cout <<"factorial of "<<number<<"="<<fact<<"\n"; } ```
null
CC BY-SA 4.0
null
2022-10-12T17:49:58.060
2022-10-12T17:49:58.060
null
null
1,288
null
74,046,182
2
null
74,046,119
1
null
use: ``` =ARRAYFORMULA(MATCH(1, (B1:B4=A1)*(C1:C4=A1), 0)) ``` [](https://i.stack.imgur.com/0tOc8.png) you are multiplying arrays so you will need ARRAYFORMULA wrapping and also do not forget on 3rd MATCH argument
null
CC BY-SA 4.0
null
2022-10-12T18:00:54.510
2022-10-12T18:00:54.510
null
null
5,632,629
null
74,047,321
2
null
46,576,831
0
null
In my example i had a df with different columns called "df_whole", one column had date time in this format: 2022-08-11 23:00:48:007. I loaded it from a Cassandra db so it was already formatted. These are the steps that I followed: . ``` df_whole['datetime'] = pd.to_datetime((df_whole['datetime'])) ``` ``` df_whole.index = df_whole['datetime'] ``` ``` df_whole.between_time('14:00', '21:00') ``` job done!
null
CC BY-SA 4.0
null
2022-10-12T19:50:37.663
2022-10-14T14:01:41.347
2022-10-14T14:01:41.347
13,592,596
13,592,596
null
74,047,561
2
null
74,009,120
0
null
I was able to get this working by creating a fresh ec2 instance on its own VPC/ACL with the same configuration as above. Not really an answer as it is a work-around - gremlins in the system.
null
CC BY-SA 4.0
null
2022-10-12T20:13:46.590
2022-10-12T20:13:46.590
null
null
2,614,458
null
74,048,048
2
null
74,013,658
3
null
The major problem is caused by blocking the main thread. You are reading from memory, which is usually taking some time. You are doing it on the main thread, which is used for all UI operations (layout, detecting inputs etc.). While you are occupying it, no rendering or input detection can happen. That is why you are seeing the ANR warning. To solve your problem, you need to put your work to a background thread. There are several ways to do so. [This](https://developer.android.com/guide/background#immediate-work) is a good starting point. Also [that one](https://developer.android.com/guide/background/threading), if you are running tasks frequently. Now to give you a quick solution to your problem, you can create a class to do your work: ``` public class ReadFile extends Worker { private File file; private BufferedReader bufferedReader; private InputStream inputStream; private FileReader fileReader; public ReadFile(@NonNull Context context, @NonNull WorkerParameters workerParams) { super(context, workerParams); } @NonNull @Override public Result doWork() { try { StringBuilder sb = new StringBuilder(); String line; if (SDK_INT >= Build.VERSION_CODES.R) { Uri uri = Uri.parse(getInputData().getString("URI")); inputStream = getApplicationContext().getContentResolver().openInputStream(uri); bufferedReader = new BufferedReader(new InputStreamReader(inputStream)); } else { fileReader = new FileReader(file); bufferedReader = new BufferedReader(fileReader); } while ((line = bufferedReader.readLine()) != null) { sb.append(line).append("\n"); } if (inputStream != null) { inputStream.close(); } else if (bufferedReader != null) { bufferedReader.close(); } else if (fileReader != null) { fileReader.close(); } Data myData = new Data.Builder() .putString("text", sb.toString()) .build(); return Result.success(myData); } catch (IOException e) { Log.e("IOException", e.getMessage()); Log.e("IOException2", e.getCause() + ""); Log.e("IOException3", "exception", e); return Result.failure(); } } } ``` If you are using an inner class of your activity, just make sure you are not using any fields in the UI thread, that you are using inside the worker as well. If you do so, you need to synchronize them. That's why I used input and output data in the example. Then finally in your activity call: ``` Data myData = new Data.Builder() .putString("URI", selectedFileURI.toString()) .build(); OneTimeWorkRequest readFile = new OneTimeWorkRequest.Builder(ReadFile.class).setInputData(myData).build(); WorkManager.getInstance(getContext()).enqueue(readFile); WorkManager.getInstance(getContext()).getWorkInfoByIdLiveData(readFile.getId()).observe(this, info -> { String myResult = info.getOutputData().getString("text"); activityMainBinding.textView.setText(myResult); }); ```
null
CC BY-SA 4.0
null
2022-10-12T21:11:00.410
2022-10-12T21:11:00.410
null
null
5,369,727
null
74,048,865
2
null
74,045,646
0
null
The quickest way would be: - - `%`- Other tools, like the or the in [ADAMS](https://adams.cms.waikato.ac.nz/), allow you that kind of conversion on the fly using the `SpreadSheetConvertCells` transformer: - - `adams.data.conversion.StringExpression -expression "substitute(X, \\\"%\\\", \\\"\\\")"`
null
CC BY-SA 4.0
null
2022-10-12T23:11:34.150
2022-10-12T23:11:34.150
null
null
4,698,227
null
74,049,184
2
null
14,571,557
0
null
The index needs to be int so I convert long to int. ``` long n = sc.nextLong(); long[] arr = new long[(int)n]; ```
null
CC BY-SA 4.0
null
2022-10-13T00:13:26.043
2022-10-13T07:28:33.080
2022-10-13T07:28:33.080
2,227,743
19,702,819
null
74,049,793
2
null
73,768,917
0
null
For anyone can not fix this issue, i'm just need to update gradle version and buildtool buildSrc/src/main/kotlin/Dependencies.kt ``` object BuildPlugins { object Versions { const val buildToolVersion = "7.3.0" //lower version seem not work ``` and change to 7.4 in gradle/wrapper/gradle-wrapper.properties ``` distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip ```
null
CC BY-SA 4.0
null
2022-10-13T02:13:33.617
2022-10-13T02:13:33.617
null
null
12,070,549
null
74,049,887
2
null
73,662,837
0
null
The developers of MUI already fixed this bug in their @mui/[email protected] build. Updating to material 5.10.8 fixed the bug.
null
CC BY-SA 4.0
null
2022-10-13T02:30:30.740
2022-10-13T02:30:30.740
null
null
19,957,936
null
74,049,905
2
null
53,916,720
2
null
The original answer is no longer correct. According to [this resolved MUI issue](https://github.com/mui/material-ui/issues/22799), labelWidth is no longer supported. Instead, set the `label` on the `<OutlinedInput>` to match the `label` on the `<InputLabel>`. Ex: ``` <InputLabel id="foo">{tag}</InputLabel> <Select input={<OutlinedInput label={tag} />} ``` Full example in [the MUI Docs](https://mui.com/material-ui/react-select/#MultipleSelectCheckmarks.js)
null
CC BY-SA 4.0
null
2022-10-13T02:34:26.810
2022-10-13T02:34:26.810
null
null
20,048,496
null
74,050,621
2
null
73,984,294
0
null
I think that answer from @mohammad esmaili should be helpful for your case. But if you still has the issue because using old flutter or sdk and not planning to migrate. You can add logic(boolean) to turn on/off AbsorbPointer. some example UX scenario: - -
null
CC BY-SA 4.0
null
2022-10-13T04:49:12.037
2022-10-13T04:49:12.037
null
null
16,363,643
null
74,050,735
2
null
14,142,378
1
null
My solution was: ``` <div style={{ display: "flex", width: "100%", height: "100%", }} > <img style={{ minWidth: "100%", minHeight: "100%", objectFit: "cover", }} alt="" src={url} /> </div> ``` The above will scale up an image in order for it to the parent container. If you just need to fit inside, then change `objectFit` to `contain`.
null
CC BY-SA 4.0
null
2022-10-13T05:08:41.083
2022-10-13T05:08:41.083
null
null
13,177,011
null
74,051,463
2
null
74,051,415
0
null
Have you tried changing the layout of the figure to tight? ``` plt.tight_layout() ``` It will not really move the label text, but it should make sure to not cut it off.
null
CC BY-SA 4.0
null
2022-10-13T06:43:02.827
2022-10-13T06:43:02.827
null
null
10,215,533
null
74,051,748
2
null
30,227,466
0
null
``` #**How to merge cropped images back to original image** images = [Image.open(x) for x in images_list] print("Length:: ", len(images)) widths, heights = zip(*(i.size for i in images)) print(widths, heights) total_width = sum(widths) max_height = sum(heights) print(total_width,max_height) new_im = Image.new('RGB', (5*384, 5*216)) x_offset = 0 y_offset = 0 img_size = [384,216] def grouped(iterable, n): return zip(*[iter(iterable)]*n) for x,y,a,b,c in grouped(images, 5): temp = [] temp.append([x,y,a,b,c]) print(temp[0]) print(len(temp[0])) for lsingle_img in temp[0]: # print(lsingle_img) print("x_y_offset: ", (x_offset, y_offset)) new_im.paste(lsingle_img, (x_offset, y_offset)) x_offset += img_size[0] temp = [] x_offset = 0 y_offset += img_size[1] new_im.save('test.jpg') ```
null
CC BY-SA 4.0
null
2022-10-13T07:10:28.300
2022-10-13T07:10:28.300
null
null
17,900,612
null
74,051,970
2
null
74,036,962
0
null
When you apply the image on the table and wall the use the `Shift` + `Q`, `W`, `E`, `A`, `S`, `D` buttons to move the camera and then enter in the room where the applied images are shown and the you are able to scan the images. Happy Coding :)
null
CC BY-SA 4.0
null
2022-10-13T07:29:03.057
2022-10-13T07:29:03.057
null
null
13,261,376
null
74,052,385
2
null
74,043,856
0
null
Put indexing by `iloc` in front of `groupby`: ``` df_sellout.iloc[:,0:4].groupby("Brand").sum() ```
null
CC BY-SA 4.0
null
2022-10-13T08:06:57.443
2022-10-13T08:06:57.443
null
null
14,909,621
null
74,053,075
2
null
74,051,616
-1
null
As is said in the [issue](https://stackoverflow.com/questions/59395036/how-to-make-vscode-always-run-main-py) you mentioned. Add this code to your `launch.json` : `"program": "${workspaceFolder}/main.py",` ``` { // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "name": "Python: Current File", "type": "python", "request": "launch", "program": "${workspaceFolder}/main.py", "console": "integratedTerminal" } ] } ``` At the same time, you should know that is effective for debug mode, so please switch the running mode and use shortcuts or .
null
CC BY-SA 4.0
null
2022-10-13T08:58:10.093
2022-10-13T08:58:10.093
null
null
18,359,438
null
74,053,104
2
null
71,737,304
1
null
The VS Code Settings are not the right place to store credentials. Instead, use `vscode.SecretStorage`, e.g. with a VS Code Command: ``` export async function activate(context: vscode.ExtensionContext) { const secretStorage: vscode.SecretStorage = context.secrets; vscode.commands.registerCommand('mynotebook.setPassword', async () => { const passwordInput: string = await vscode.window.showInputBox({ password: true, title: "Password" }) ?? ''; secretStorage.store("server_password", passwordInput); }) ... } ``` If you want the newly created command to be easily accessible from the Settings, use a link in `package.json`: ``` "server.password": { "type": "null", "scope": "application", "markdownDescription": "[Set Password](mynotebook.setPassword)" } ```
null
CC BY-SA 4.0
null
2022-10-13T09:00:05.570
2022-10-13T09:00:05.570
null
null
16,631,212
null
74,053,433
2
null
74,053,376
3
null
Add this to your second `SpanStyle` ``` baselineShift = BaselineShift.Superscript ``` Modified code ``` val spanString = buildAnnotatedString { withStyle( SpanStyle( color = Color(0xFF333333), fontSize = 32.sp ) ) { append("Jetpack") } withStyle( SpanStyle( baselineShift = BaselineShift.Superscript, // added line color = Color(0xFF999999), fontSize = 14.sp, fontWeight = FontWeight.Bold ) ) { append(" Compose") } } Text( modifier = Modifier.background(color = Color.White), text = spanString, textAlign = TextAlign.Center ) ``` [](https://i.stack.imgur.com/vW8N6.png)
null
CC BY-SA 4.0
null
2022-10-13T09:26:25.897
2022-10-14T05:20:50.217
2022-10-14T05:20:50.217
19,023,745
19,023,745
null
74,053,736
2
null
74,051,665
1
null
Given is the starting point and is the ending point then create a path as follows: 1. Add p0 to path. 2. Let p = p0. 3. Let h be hexagon at p. Then repeat: 1. If h position is the same as p1 position then add p1 to path and stop. 2. Chose p from vertices h(i) i = {0, 1, 2, 3, 4, 5}, such that dot( h(i) - p0, p1 - p0 ) is maximal. 3. Add p to path. 4. Choose the nearest hexagon h from position p using the dot product of nearby hexagon centers and actual position p and direction of p1 - p.
null
CC BY-SA 4.0
null
2022-10-13T09:50:08.143
2022-10-14T02:13:00.130
2022-10-14T02:13:00.130
59,087
2,521,214
null
74,054,013
2
null
22,375,505
-1
null
DELETE htaccess file, is the only 100% working solution.
null
CC BY-SA 4.0
null
2022-10-13T10:11:40.703
2022-10-13T10:11:40.703
null
null
20,230,350
null
74,054,027
2
null
11,552,437
1
null
This error on a norms is caused when there's a spelling mistake in the branch you're trying to pull from or if the branch name doesn't exist. It's recently that GitHub changed the default branch name from master to main. In my case, this wasn't the case. I'm using a branch name that is same as my username. I then had to first push to the branch, then make a pull request which got merged from my branch to a complete and updated branch, the pull requests I started making afterwards works fine.
null
CC BY-SA 4.0
null
2022-10-13T10:12:31.347
2022-10-13T10:12:31.347
null
null
15,321,990
null
74,054,582
2
null
74,053,582
0
null
The value for annotation needs to be a compile time constant, so I think there is no straight forward way unless you use your own implementation of Annotation which might look like: ``` @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD}) public @interface TestAnnotation { MyEnum name() default MyEnum.Enum1; } enum MyEnum { Enum1, Enum2; } ``` @JsonSubTypes.Type's name uses String for which compile time constants can only be [primitive or String](https://docs.oracle.com/javase/specs/jls/se7/html/jls-15.html#jls-15.28).
null
CC BY-SA 4.0
null
2022-10-13T10:53:34.850
2022-10-13T10:53:34.850
null
null
5,014,221
null
74,054,850
2
null
74,053,814
0
null
With some caution we can use `ax.set_fc(background_color)` to set up the default color of the axes. For the posted code I think something like this could work: ``` cmap = plt.cm.YlGnBu background_color = cmap(1.0) # the last color in cmap ax.set_fc(background_color) ```
null
CC BY-SA 4.0
null
2022-10-13T11:14:29.670
2022-10-13T12:24:38.693
2022-10-13T12:24:38.693
14,909,621
14,909,621
null
74,055,404
2
null
74,049,554
0
null
Both geoms need to have the same grouping and dodge width. This is best done when you initialise the plot using `ggplot()` I can't confirm this without a reproducible example, but my guess is: ``` ggplot(watervol.time, aes(x = Date.Order, y = water.vol.mean, ymin = LCI, ymax = UCI, group = Site)) + geom_errorbar(position = position_dodge(width = 11), colour = "black", width = 10) + geom_point(aes(fill = Site), position = position_dodge(width = 11), size = 3.5, shape = 21) ```
null
CC BY-SA 4.0
null
2022-10-13T11:59:39.947
2022-10-13T11:59:39.947
null
null
13,547,776
null
74,055,381
2
null
74,013,658
3
null
That's because you reading files on the Main UI thread which blocks it and causes ANR until is finished, you need to do this work on a background thread, I suggest to take look at the answers on [this question](https://stackoverflow.com/q/15472383/7639296) even it's old "since 10 years approximately" but it's a good place to start trying, you will find some methods to do the process in background threads like `AsyncTask`, `Callbacks` and `Executors` all this ways can help you to do the fix the issue, but I'll focus in my answer on the newest and recommended way is using ["RX Java"](https://github.com/ReactiveX/RxAndroid) I suggest to take look at this [RxJava Tutorial](https://www.tutorialspoint.com/rxjava/index.htm) you will learn more about it. let's start to fix this 1. Add Rx Java dependencies to your project in build.gradle(app) ``` implementation 'io.reactivex.rxjava3:rxandroid:3.0.0' // Because RxAndroid releases are few and far between, it is recommended you also // explicitly depend on RxJava's latest version for bug fixes and new features. // (see https://github.com/ReactiveX/RxJava/releases for latest 3.x.x version) implementation 'io.reactivex.rxjava3:rxjava:3.0.3' ``` 1. in read button onClick create a new Observable and call method readFile on it, the subscribeOn it's defines the thread that the observable will work on it I choosed Schedulers.computation() because you will not be able to determine the size of the doc/text file or How long this process will take, but you can choose other threads like Schedulers.io(), in observeOn you added the thread that observer will work on it, in your case, it's the main thread, and finally call subscribe to connect observable with the observer, I also suggest to add progressBar on your layout to show it while reading the file and hide it when finished the process ``` activityMainBinding.read.setOnClickListener(view -> { if (TextUtils.isEmpty(activityMainBinding.editTextPath.getText())) { activityMainBinding.editTextPath.setError("The file path cannot be empty"); } else { Observable.fromCallable(this::readFile) .subscribeOn(Schedulers.computation()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Observer<Object>() { @Override public void onSubscribe(Disposable d) { activityMainBinding.progressBar.setVisibility(View.VISIBLE); } @Override public void onNext(Object o) { if(o instanceof StringBuilder){ activityMainBinding.textView.setText((StringBuilder) o); } } @Override public void onError(Throwable e) { } @Override public void onComplete() { activityMainBinding.progressBar.setVisibility(View.INVISIBLE); } }); } }); ``` also, I would suggest you if the file is PDF use [AndroidPdfViewer](https://github.com/barteksc/AndroidPdfViewer) library it makes a lot easier for you and you will not need all these permissions to read PDF files, you can check these [this article](https://blog.mindorks.com/how-to-open-a-pdf-file-in-android-programmatically) to learn more about it.
null
CC BY-SA 4.0
null
2022-10-13T11:58:25.813
2022-10-13T11:58:25.813
null
null
7,639,296
null
74,055,451
2
null
74,054,832
1
null
Have a look at [cv::findContours](https://docs.opencv.org/3.4/d4/d73/tutorial_py_contours_begin.html). You should be able to extract the pins with that, maybe binarize first with cv::threshold(). Then using [center-of-mass](https://docs.opencv.org/3.4/dd/d49/tutorial_py_contour_features.html) and the moment-of-area for the contours found, you can describe the position and angle of the pins. Or just using the bounding rectangle might even be enough.
null
CC BY-SA 4.0
null
2022-10-13T12:02:48.303
2022-10-13T12:08:49.800
2022-10-13T12:08:49.800
20,213,170
20,213,170
null
74,055,578
2
null
74,054,832
1
null
Here is my approach with code and results. Steps to produce: 1. Apply median to decrease noise in the image 2. Apply threshold to get a clear image [](https://i.stack.imgur.com/TbeZs.png) 1. Check each row and get the sticks according to the thickness threshold. [](https://i.stack.imgur.com/Mbe7h.png) 1. Get mid point's y axis values of each stick and hold in an array. 2. Calculate the standard deviation of each array and choose the ones which are higher. ``` #include <string> #include <opencv2/opencv.hpp> #include <opencv2/dnn_superres.hpp> #include <numeric> #include <boost/accumulators/accumulators.hpp> #include <boost/accumulators/statistics/stats.hpp> #include <boost/accumulators/statistics/mean.hpp> #include <boost/accumulators/statistics/moment.hpp> using namespace boost::accumulators; using namespace std; using namespace boost; double stddev(std::vector<int> const & func) { double mean = std::accumulate(func.begin(), func.end(), 0.0) / func.size(); double sq_sum = std::inner_product(func.begin(), func.end(), func.begin(), 0.0, [](double const & x, double const & y) { return x + y; }, [mean](double const & x, double const & y) { return (x - mean)*(y - mean); }); return std::sqrt(sq_sum / func.size()); } int main(){ cv::Mat img = cv::imread("/home/yns/Downloads/aaa.jpg",cv::IMREAD_GRAYSCALE); cv::namedWindow("input",0); cv::namedWindow("output",0); cv::namedWindow("output2",0); cv::imshow("input",img); cv::Mat out; cv::medianBlur(img,img,3); cv::threshold(img,out,80,255,cv::THRESH_BINARY); cv::Mat out2; cv::cvtColor(out,out2,cv::COLOR_GRAY2BGR); cv::imshow("output",out); int start = 0; int cnt = 0; int refX = 0; int thresholdThickness = 5; int orderNum = 1; std::vector<int> yAxis_1; std::vector<int> yAxis_2; std::vector<int> yAxis_3; std::vector<int> yAxis_4; std::vector<int> yAxis_5; std::vector<int> yAxis_6; std::vector<int> yAxis_7; std::vector<int> yAxis_8; std::vector<int> yAxis_9; std::vector<int> yAxis_10; std::vector<int> yAxis_11; std::vector<int> yAxis_12; int annen = 0; for(int i=0; i<out.rows; i++) { orderNum = 1; annen = 0; for(int j=0; j<out.cols; j++) { if(out.at<uchar>(cv::Point(j,i))==255 && start != 1) { start = 1; refX = j; cnt = 0; } else if (out.at<uchar>(cv::Point(j,i))==255) { cnt++; } else if (out.at<uchar>(cv::Point(j,i))==0 && start == 1 && cnt>thresholdThickness) { cv::circle(out2,cv::Point((j+refX)/2,i),1,cv::Scalar(0,0,255),cv::FILLED); start = 0; annen++; if(orderNum == 1) yAxis_1.push_back(j); if(orderNum == 2) yAxis_2.push_back(j); if(orderNum == 3) yAxis_3.push_back(j); if(orderNum == 4) yAxis_4.push_back(j); if(orderNum == 5) yAxis_5.push_back(j); if(orderNum == 6) yAxis_6.push_back(j); if(orderNum == 7) yAxis_7.push_back(j); if(orderNum == 8) yAxis_8.push_back(j); if(orderNum == 9) yAxis_9.push_back(j); if(orderNum == 10) yAxis_10.push_back(j); if(orderNum == 11) yAxis_11.push_back(j); if(orderNum == 12) yAxis_12.push_back(j); orderNum++; } else if (out.at<uchar>(cv::Point(j,i))==0 && start == 1) { start = 0; } } } std::cout<<stddev(yAxis_1)<<std::endl; std::cout<<stddev(yAxis_2)<<std::endl; std::cout<<stddev(yAxis_3)<<std::endl; std::cout<<stddev(yAxis_4)<<std::endl; std::cout<<stddev(yAxis_5)<<std::endl; std::cout<<stddev(yAxis_6)<<std::endl; std::cout<<stddev(yAxis_7)<<std::endl; std::cout<<stddev(yAxis_8)<<std::endl; std::cout<<stddev(yAxis_9)<<std::endl; std::cout<<stddev(yAxis_10)<<std::endl; std::cout<<stddev(yAxis_11)<<std::endl; std::cout<<stddev(yAxis_12)<<std::endl; float average = accumulate( yAxis_6.begin(), yAxis_6.end(), 0.0)/yAxis_6.size(); float average2 = accumulate( yAxis_7.begin(), yAxis_7.end(), 0.0)/yAxis_7.size(); cv::circle(out2,cv::Point(average,out2.rows/2),25,cv::Scalar(0,255,255),5); cv::circle(out2,cv::Point(average2,out2.rows/2),25,cv::Scalar(0,255,255),5); cv::imshow("output2",out2); cv::waitKey(0); return 0; } ```
null
CC BY-SA 4.0
null
2022-10-13T12:12:09.160
2022-10-14T06:06:03.587
2022-10-14T06:06:03.587
11,048,887
11,048,887
null
74,056,528
2
null
64,660,722
0
null
I had this problem in my project and stay for a few days with this problem A solution that helped me was to make a condition in "onChanged", which was as follows: If the controller in the first dropdown is not empty and the second one is also not empty,the second controller is cleared. This condition I put in the onChanged of the two dropdowns. ``` onChanged: (value) { setState(() { if (firstController.text.isNotEmpty && secondController.text.isNotEmpty) { secondController.clear(); } secondController.text = value.toString(); }); }, ```
null
CC BY-SA 4.0
null
2022-10-13T13:23:11.913
2022-10-13T13:23:11.913
null
null
19,377,488
null
74,056,586
2
null
74,054,464
0
null
I finally succeeded. First I tried to add this to my `app.config.js` ``` "androidStatusBar": { "backgroundColor": "#ffffff", "barStyle": "dark-content", "translucent": true, "hidden": false }, ``` It did somehow worked, but the bar was grayed-out. When compiling I had a message that `androidStatusBar.backgroundColor` was conflicting with `splash.backgroundColor` My assumption is that the splash screen change the status bar style when starting the application. So all I needed to do was to update the status bar once the app is started. But now that I knew the configuration, I re-tried by removing the config above and re-adding `expo-status-bar`, but this time with the same configuration that what I had in `androidStatusBar`. ``` import React from 'react'; import {StyleSheet, SafeAreaView, View} from 'react-native'; import Constants from "expo-constants"; import {StatusBar} from "expo-status-bar"; export default function MainLayout({children}) { return ( <SafeAreaView style={[styles.screen]}> <View style={[styles.view]} > {children} </View> <StatusBar style="dark" translucent={true} hidden={false} /> </SafeAreaView> ); } const styles = StyleSheet.create({ screen: { paddingTop: Constants.statusBarHeight, flex: 1, }, view: { flex: 1, } }); ``` - `style``dark`- `translucent``true`- `hidden` As a final note: The reason the app was pushed down was specified in the [translucent](https://docs.expo.dev/versions/latest/config/app/#translucent) documentation > (boolean) - Sets android:windowTranslucentStatus in styles.xml. (similar to position: relative). (similar to position: absolute). Defaults to true to match the iOS status bar behavior (which can only float above content).
null
CC BY-SA 4.0
null
2022-10-13T13:27:53.530
2022-10-13T13:27:53.530
null
null
8,068,675
null
74,056,690
2
null
14,816,166
0
null
I was able to extend from `JavaCameraView` and hack around to allow portrait and other orientations. This is what worked for me in OpenCV 4.5.3 (com.quickbirdstudios:opencv-contrib:4.5.3.0): ``` package com.reactnativemapexplorer.opencv; import android.content.Context; import android.graphics.Bitmap; import org.opencv.android.CameraBridgeViewBase; import org.opencv.android.JavaCameraView; import org.opencv.core.Core; import org.opencv.core.Mat; import java.lang.reflect.Field; public class CustomJavaCameraView extends JavaCameraView { public enum Orientation { LANDSCAPE_LEFT, PORTRAIT, LANDSCAPE_RIGHT; boolean isLandscape() { return this == LANDSCAPE_LEFT || this == LANDSCAPE_RIGHT; } boolean isLandscapeRight() { return this == LANDSCAPE_RIGHT; } }; // scale camera by this coefficient - using mScale seems to more performant than upsizing frame Mat // orientation is immutable because every attempt to change it dynamically failed with 'null pointer dereference' and similar exceptions // tip: re-creating camera from the outside should allow changing orientation private final Orientation orientation; public CustomJavaCameraView(Context context, int cameraId, Orientation orientation) { super(context, cameraId); this.orientation = orientation; } @Override protected void AllocateCache() { if (orientation.isLandscape()) { super.AllocateCache(); return; } try { Field privateField = CameraBridgeViewBase.class.getDeclaredField("mCacheBitmap"); privateField.setAccessible(true); privateField.set(this, Bitmap.createBitmap(mFrameHeight, mFrameWidth, Bitmap.Config.ARGB_8888)); } catch (NoSuchFieldException | IllegalAccessException e) { throw new RuntimeException(e); } } private class CvCameraViewFrameImplHack implements CvCameraViewFrame { private Mat rgbMat; public CvCameraViewFrameImplHack(Mat rgbMat) { this.rgbMat = rgbMat; } @Override public Mat rgba() { return this.rgbMat; } @Override public Mat gray() { return null; } } private Mat rotateToPortrait(Mat mat) { Mat transposed = mat.t(); Mat flipped = new Mat(); Core.flip(transposed, flipped, 1); transposed.release(); return flipped; } private Mat rotateToLandscapeRight(Mat mat) { Mat flipped = new Mat(); Core.flip(mat, flipped, -1); return flipped; } @Override protected void deliverAndDrawFrame(CvCameraViewFrame frame) { Mat frameMat = frame.rgba(); Mat rotated; if (orientation.isLandscape()) { if (orientation.isLandscapeRight()) { rotated = rotateToLandscapeRight(frameMat); } else { rotated = frameMat; } mScale = (float)getWidth() / (float)frameMat.width(); } else { rotated = rotateToPortrait(frameMat); mScale = (float)getHeight() / (float)rotated.height(); } CvCameraViewFrameImplHack hackFrame = new CvCameraViewFrameImplHack(rotated); super.deliverAndDrawFrame(hackFrame); } } ```
null
CC BY-SA 4.0
null
2022-10-13T13:34:25.717
2022-10-13T13:34:25.717
null
null
741,871
null
74,057,275
2
null
74,016,043
0
null
I solved my problem as follows. I separated the user data (email, name) for a totally different collection. The data that is generated when you are logged in are in another collection. That way it manages to capture the user's id and place it as the document, doing the segregation I would like and organizing the internal information in the respective collections
null
CC BY-SA 4.0
null
2022-10-13T14:14:23.060
2022-10-13T14:14:23.060
null
null
19,770,013
null
74,057,935
2
null
74,052,466
1
null
The issue was with the PLC itself, not being compiled and downloaded to the CPU (in case this helps anyone else)
null
CC BY-SA 4.0
null
2022-10-13T14:58:04.657
2022-10-13T14:58:04.657
null
null
2,033,846
null
74,057,969
2
null
9,427,700
0
null
I did it by using GEOJSON file. My JS: ``` function initMap2() { map = new google.maps.Map(document.getElementById("map"), { zoom: 13, mapId: "", // add map id here center: {lat: 41.015137, lng: 28.979530}, //center: { lat: 20.773, lng: -156.01 }, }); map.data.loadGeoJson( "https://raw.githubusercontent.com/ozanyerli/istanbul-districts-geojson/main/istanbul-districts.json" ); map.data.setStyle({ fillColor: '#810FCB', strokeWeight: 1, fillOpacity: 0.5 }); } ``` and I get the JSON data for Istanbul by using the following JSON: `https://raw.githubusercontent.com/ozanyerli/istanbul-districts-geojson/main/istanbul-districts.json`
null
CC BY-SA 4.0
null
2022-10-13T15:00:05.967
2022-10-13T15:00:05.967
null
null
14,543,780
null
74,058,577
2
null
74,057,771
0
null
Your code detects the cycle twice. Things become a lot clearer if you print out the back edge ``` if (visited[i] && i != par) { cout << "Back edge " << cur <<" " << i << "\n"; cout << "Cycle detected! | "; cout << "Adjacent node: " << i << " | "; cout << "Parent node: " << par << "\n"; } ``` outputs ``` DFS 0 DFS 1 DFS 2 DFS 5 DFS 3 Back edge 3 1 Cycle detected! | Adjacent node: 1 | Parent node: 2 DFS 4 DFS 6 Back edge 1 3 Cycle detected! | Adjacent node: 3 | Parent node: 0 ``` The reason this happens is because you are modelling an undirected graph by storing two directed edges going in opposite directions between every connected pair of vertices. Although this doubles the amount of edge storage reuired, it is a design choice often made because it simplifies code that may be applied to both directed and undirected graphs. The snag is that a DFS will look at ever undirected edge twice. To fix, prevent the back edges from being detected twice by only checking each edge once - this can be done by looking at the index numbers of the vertices and ignoring the edge when they are in one of the two possible magnitude orders ``` // check for back edges just once if (i < cur) { // if it has been visited and it is not the parent node (detects a cycle) if (visited[i] && i != par) { cout << "Back edge " << cur << " " << i << "\n"; cout << "Cycle detected! | "; cout << "Adjacent node: " << i << " | "; cout << "Parent node: " << par << "\n"; } } ``` Complete code at [https://gist.github.com/JamesBremner/e6e3fde8bec0bbc7c22df2ce995c29f5](https://gist.github.com/JamesBremner/e6e3fde8bec0bbc7c22df2ce995c29f5) Note that I have removed the un-needed ( and dangerous ) inclusion of <bits/stdc++.h> and replaced the visited map with a vector of bools for a performance improvement.
null
CC BY-SA 4.0
null
2022-10-13T15:48:48.737
2022-10-13T17:45:24.260
2022-10-13T17:45:24.260
16,582
16,582
null
74,058,609
2
null
30,543,605
0
null
For my case I need to keep the "LogOut" item at the bottom of the "NavigationView" always if has enough space or "emulate" some scroll if don't fit. The goal was to accomplish that without big changes and of course without adding nested NavigationViews. The solution that works for me is the following: ### activity_main.xml ``` <?xml version="1.0" encoding="utf-8"?> <androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true"> <com.google.android.material.navigation.NavigationView android:id="@+id/navigation_view" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="start" android:clipToPadding="false" android:clipChildren="false" android:overScrollMode="never" android:fitsSystemWindows="true" android:maxWidth="300dp" app:headerLayout="@layout/nav_drawer_header" app:itemBackground="@drawable/bg_nav_drawer_item" app:itemHorizontalPadding="25dp" app:itemIconPadding="25dp" app:itemIconTint="@color/nav_drawer_item_icon" app:itemTextAppearance="@style/NavigationDrawerTextStyle" app:itemTextColor="@color/nav_drawer_item_text" app:menu="@menu/navigation_drawer_menu"> <LinearLayout android:id="@+id/ll_activity_main_log_out" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="bottom" android:background="?attr/selectableItemBackground" android:orientation="horizontal" android:layout_marginBottom="10dp" android:paddingStart="30dp" tools:ignore="RtlSymmetry"> <androidx.appcompat.widget.AppCompatImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:src="@drawable/ic_log_out" android:tint="@color/gray_B3BAC2" /> <TextView style="@style/TextBodyBold.Large" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingVertical="20dp" android:paddingStart="25dp" android:paddingEnd="50dp" android:text="@string/label_logout" android:textColor="@color/gray_B3BAC2" /> </LinearLayout> </com.google.android.material.navigation.NavigationView> </androidx.drawerlayout.widget.DrawerLayout> ``` ### MainActivity.kt ``` class MainActivity : AppCompatActivity() { private lateinit var mainActivityBinding: ActivityMainBinding // ... override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) mainActivityBinding = DataBindingUtil.setContentView(this, R.layout.activity_main) mainActivityBinding.apply { lifecycleOwner = this@MainActivity llActivityMainLogOut.setOnClickListener { mainViewModel.handleOnLogoutUserPress() } } } private var onScrollListener: RecyclerView.OnScrollListener? = null /** * Listener for "Logout" Drawer Menu Item that checks if should * add a scrollListener (and update bottom margin) or keep the item at the bottom of the view. */ private val navigationViewGlobalLayoutListener = object : OnGlobalLayoutListener { override fun onGlobalLayout() { // Get the NavigationView RecyclerView List Menu val drawerViewList = mainActivityBinding.navigationView.getChildAt(0) as RecyclerView if (onScrollListener == null) { val scrollExtent = drawerViewList.computeVerticalScrollExtent() val scrollRange = drawerViewList.computeVerticalScrollRange() // Check if the list has enough height space for all items if (scrollExtent < scrollRange) { // Adding NavigationView Bottom padding. Is where the logoutItem goes mainActivityBinding.navigationView.setPadding( 0, 0, 0, resources.getDimensionPixelSize(R.dimen.drawer_layout_footer_padding_bottom) ) // The first item of the list is a Header, getting the second menu item height val itemHeight = drawerViewList.getChildAt(1).measuredHeight // The first update will add enough negative bottom margin and will hide the item updateDrawerLogoutItemBottomMargin(scrollExtent, scrollRange, itemHeight) onScrollListener = object : RecyclerView.OnScrollListener() { private var totalScrollY = 0 override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) { totalScrollY += dy updateDrawerLogoutItemBottomMargin( recyclerView.computeVerticalScrollExtent(), recyclerView.computeVerticalScrollRange(), recyclerView.getChildAt(1).measuredHeight, totalScrollY ) } } // Adding scroll listener in order to update the bottom logOut item margin // while the list is being scrolled drawerViewList.addOnScrollListener(onScrollListener!!) } } else { // The listener have been already added and computed, removing drawerViewList.viewTreeObserver.removeOnGlobalLayoutListener(this) } } } /** * @param scrollExtent the current height of the list * @param scrollRange the height that needs the list for showing all items * @param itemHeight the height of a Menu Item (not header) * @param extraScroll scroll offset performed */ private fun updateDrawerLogoutItemBottomMargin( scrollExtent: Int, scrollRange: Int, itemHeight: Int, extraScroll: Int = 0 ) { mainActivityBinding.llActivityMainLogOut.updateLayoutParams { this as MarginLayoutParams bottomMargin = scrollExtent - scrollRange - itemHeight + extraScroll } } override fun onResume() { super.onResume() mainActivityBinding.navigationView.viewTreeObserver.addOnGlobalLayoutListener( navigationViewGlobalLayoutListener ) } override fun onPause() { super.onPause() if (onScrollListener != null) { (mainActivityBinding.navigationView.getChildAt(0) as RecyclerView) .removeOnScrollListener(onScrollListener!!) } } //... } ``` The `android:clipChildren="false"` and `android:clipToPadding="false"` in the `activity_main.xml` `NavigationView` are mandatory params. Each case may need different bottom padding in order to add the "extra" drawer item, in my case, the value was: `<dimen name="drawer_layout_footer_padding_bottom">70dp</dimen>` And of course don't forget to register the on `GlobalLayoutListener` in the `onResume` method and unregister the `scrollListener` in `onPause` method if has been registered.
null
CC BY-SA 4.0
null
2022-10-13T15:51:00.480
2022-10-13T15:51:00.480
null
null
7,905,172
null
74,058,800
2
null
74,057,668
0
null
``` import pandas as pd df = pd.DataFrame({'Desc':['cat is black','dog is white']}) kw = ['cat','dog'] i = 0 #iterator for k in kw: #Creates an empty column df[k + 'col'] = "" #Assigns the value in the cell based on its location in df["Desc"] df[k + 'col'][i] = df["Desc"][i] i = i+1 #iterates ```
null
CC BY-SA 4.0
null
2022-10-13T16:07:28.473
2022-10-13T16:07:28.473
null
null
20,224,248
null