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
75,240,925
2
null
21,294,829
0
null
Wanted to share with you my solution as a function. It's been tested and works pretty good for N Pareto-fronts. Set to `fronts = Inf` to calculate all fronts. ``` pareto_front <- function(x, y, fronts = 1, sort = TRUE) { stopifnot(length(x) == length(y)) d <- data.frame(x, y) Dtemp <- D <- d[order(d$x, d$y, decreasing = FALSE), ] df <- data.frame() i <- 1 while (nrow(Dtemp) >= 1 & i <= max(fronts)) { these <- Dtemp[which(!duplicated(cummin(Dtemp$y))), ] these$pareto_front <- i df <- rbind(df, these) Dtemp <- Dtemp[!row.names(Dtemp) %in% row.names(these), ] i <- i + 1 } ret <- merge(x = d, y = df, by = c("x", "y"), all.x = TRUE, sort = sort) return(ret) } ``` [](https://i.stack.imgur.com/G7LCb.png)
null
CC BY-SA 4.0
null
2023-01-25T23:21:55.830
2023-01-25T23:21:55.830
null
null
7,227,825
null
75,241,205
2
null
75,228,202
0
null
I fixed it by using apt-get install ``` sudo apt-get install clang-format clang-tidy clang-tools clang clangd libc++-dev libc++1 libc++abi-dev libc++abi1 libclang-dev libclang1 liblldb-dev libllvm-ocaml-dev libomp-dev libomp5 lld lldb llvm-dev llvm-runtime llvm python3-clang ``` It did install an older version, but it was fine for my needs
null
CC BY-SA 4.0
null
2023-01-26T00:15:14.033
2023-01-26T00:15:14.033
null
null
12,809,738
null
75,241,258
2
null
74,274,130
0
null
The default `GITHUB_TOKEN` doesn't have admin rights. You need to change it with a custom token of the user with admin rights. Example: ``` jobs: Merge_PR_Example: runs-on: ubuntu-latest permissions: contents: write pull-requests: write repository-projects: write env: GH_TOKEN: ${{ secrets.ADMIN_RIGHTS_TOKEN }} steps: - uses: actions/checkout@v3 - name: Merge PR run: gh pr merge ${{ github.event.issue.number }} --admin --squash env: GH_TOKEN: ${{ secrets.ADMIN_RIGHTS_TOKEN }} ``` Select all `repo` and `wrokflow` scopes for the token. These are enough. [](https://i.stack.imgur.com/qvGxm.png)
null
CC BY-SA 4.0
null
2023-01-26T00:24:43.160
2023-01-26T00:24:43.160
null
null
7,785,706
null
75,241,780
2
null
20,575,595
0
null
I was having the same issue, but I realized I was working in R 4.1 and ignored the warning that knitr was created using R 4.2. However after updating my R version, I was also just getting a .tex file but when I read the .log file I found the error "sh: pdflatex: command not found." I used this suggestion with success: > Have you installed a LaTeX distribution in your system? For rmarkdown, tinytex is recommended, you would need to install the R package and then the TinyTex distribution. ``` install.packages('tinytex') tinytex::install_tinytex() ``` Make sure you not only install the package but also run that second command tinytex::install_tinytex() as I made that mistake also before finally getting the program to create a pdf file. Here is the link to the site where I found this method. [https://community.rstudio.com/t/knitting-error-pdflatex-command-not-found/139965/3](https://community.rstudio.com/t/knitting-error-pdflatex-command-not-found/139965/3)
null
CC BY-SA 4.0
null
2023-01-26T02:23:12.980
2023-01-26T02:23:12.980
null
null
14,031,129
null
75,242,049
2
null
75,239,905
1
null
Issue one, let's the [API document](https://learn.microsoft.com/en-us/graph/api/administrativeunit-post-members?view=graph-rest-1.0&tabs=csharp#request), it should be code below to add group. ``` await graphClient.Directory.AdministrativeUnits["{administrativeUnit-id}"].Members.References .Request() .AddAsync(directoryObject); ``` For Issue 2, let see the API permission section, you need `group ReadWrite` permission and `Directory ReadWrite` permission to add group to Administrative Units. That's why you get `insufficient privileges` error with `Directory.Read.All`. You only have `Read permission`. [](https://i.stack.imgur.com/X2JsE.png) Then you mentioned you add `GroupAdministrator role` to your service principal. It only allow to create Group, but not add group to Administrative Units. [](https://i.stack.imgur.com/V7MIT.png)
null
CC BY-SA 4.0
null
2023-01-26T03:31:02.650
2023-01-26T03:31:02.650
null
null
14,574,199
null
75,242,100
2
null
38,070,307
0
null
You can use AuthMethodPickerLayout and provide a Layout as below ``` val authUILayout = AuthMethodPickerLayout.Builder(R.layout.auth_ui) .setGoogleButtonId(R.id.btn_gmail) .setEmailButtonId(R.id.btn_email) .setFacebookButtonId(R.id.btn_facebook) .build() ``` And than pass it in your intent as below ``` val intent = AuthUI.getInstance().createSignInIntentBuilder() .setAvailableProviders( listOf( AuthUI.IdpConfig.EmailBuilder().build(), AuthUI.IdpConfig.GoogleBuilder().setScopes(googleScopes).build(), AuthUI.IdpConfig.FacebookBuilder().build() ) ) .enableAnonymousUsersAutoUpgrade() .setLogo(R.mipmap.ic_launcher) .setAuthMethodPickerLayout(authUILayout) .build() ```
null
CC BY-SA 4.0
null
2023-01-26T03:44:19.550
2023-01-26T03:44:19.550
null
null
16,422,192
null
75,242,198
2
null
75,236,359
0
null
I think you are using Tableau Public, you can easily get the connector in Tableau Desktop [](https://i.stack.imgur.com/ZsqD7.png) Now, if you are a student or Know someone you can get a Tableau desktop License from here : [https://www.tableau.com/academic/students](https://www.tableau.com/academic/students)
null
CC BY-SA 4.0
null
2023-01-26T04:13:53.687
2023-01-26T04:13:53.687
null
null
14,146,580
null
75,242,194
2
null
75,235,482
5
null
Many path-based drawing libraries have a path operator specifically designed to make drawing a rounded corner easier. `UIBezierPath` does not, but there is a version of `addArc` on both the lower-level [CGMutablePath](https://developer.apple.com/documentation/coregraphics/cgmutablepath/2427124-addarc#) and the [SwiftUI Path](https://developer.apple.com/documentation/swiftui/path/addarc(tangent1end:tangent2end:radius:transform:)#). But it'll be easier to understand what the operator does if you look at Mozilla's documentation of the web canvas method [CanvasRenderingContext2D.arcTo()](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/arcTo), which has nice examples with pictures. However, there are still a couple of problems: - `addArc`- [this Mozilla example](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/arcTo#result_of_a_large_radius) This seemed like a fun problem to solve, so I wrote a little Swift package that can round the corners of a `CGPath`, a `UIBezierPath`, or a SwiftUI `Path`. Here's a demo: [](https://i.stack.imgur.com/b4N5b.gif) The package is available in my [RoundedPath repo on github](https://github.com/mayoff/RoundedPath). I will also paste the code here for posterity: ``` import CoreGraphics /// One segment of a `CGPath`. A segment is an actual drawing command, not just a move command. fileprivate enum Segment { /// A straight line segment with the given start and end points. case line(start: CGPoint, end: CGPoint) /// A quadratic BΓ©zier segment ending at the last given point. case quad(CGPoint, end: CGPoint) /// A cubic BΓ©zier segment ending at the last given point. case cubic(CGPoint, CGPoint, end: CGPoint) var end: CGPoint { switch self { case .line(start: _, end: let end), .quad(_, let end), .cubic(_, _, let end): return end } } } /// A complete subpath of a `CGPath`, with at least one segment and no moves or closePaths in the middle. fileprivate struct Subpath { /// The point at which `segments[0]` starts. Note that a `Segment` doesn't store its own start point. var firstPoint: CGPoint /// All my segments. Non-empty. If I'm closed, this ends with `.line(firstPoint)`. var segments: [Segment] = [] /// True the subpath ended with .closeSubpath. var isClosed: Bool = false } extension CGPath { /// Create a copy of myself in which sharp corners are rounded. /// /// - parameter radius: A radius to apply to sharp corners, which are corners between two straight-line segments. If a corner is an endpoint of a curve, it is not rounded. /// - returns: A path in which each meeting of two straight-line segments has been rounded with a radius of `radius`, if possible. A smaller radius is used in corners where the line segments are too short to use the full `radius`. public func copy(roundingCornersToRadius radius: CGFloat) -> CGPath { guard radius > 0 else { return self } let copy = CGMutablePath() var currentSubpath: Subpath? = nil var currentPoint = CGPoint.zero func append(_ segment: Segment) { switch currentSubpath { case nil: currentSubpath = .init(firstPoint: .zero, segments: [segment]) case .some(var subpath): currentSubpath = nil subpath.segments.append(segment) currentSubpath = .some(subpath) } } self.applyWithBlock { let points = $0.pointee.points switch $0.pointee.type { case .moveToPoint: if let currentSubpath, !currentSubpath.segments.isEmpty { copy.append(currentSubpath, withCornerRadius: radius) } currentSubpath = .init(firstPoint: points[0]) currentPoint = points[0] case .addLineToPoint: append(.line(start: currentPoint, end: points[0])) currentPoint = points[0] case .addQuadCurveToPoint: append(.quad(points[0], end: points[1])) currentPoint = points[1] case .addCurveToPoint: append(.cubic(points[0], points[1], end: points[2])) currentPoint = points[2] case .closeSubpath: if var currentSubpath { currentSubpath.segments.append(.line(start: currentPoint, end: currentSubpath.firstPoint)) currentSubpath.isClosed = true copy.append(currentSubpath, withCornerRadius: radius) currentPoint = currentSubpath.firstPoint } currentSubpath = nil @unknown default: break } } if let currentSubpath, !currentSubpath.segments.isEmpty { copy.append(currentSubpath, withCornerRadius: radius) } return copy } } extension CGMutablePath { fileprivate func append(_ subpath: Subpath, withCornerRadius radius: CGFloat) { var priorSegment: Optional<Segment> // The overall strategy: // // - I don't draw the straight part of a line segment while processing the line segment itself. // - When I process a line segment, if the prior segment was also a line, I draw the straight part of the prior segment and the rounded corner where the segments meet. // - When I process a non-line segment, if the prior segment was a line, I draw the straight part of the prior segment. // // At each rounded corner, I clamp the radius such that the curve consumes no more than half of each segment. if subpath.isClosed, case .line(start: let lastStart, end: let lastEnd) = subpath.segments.last!, case .line(start: _, end: _) = subpath.segments.first! { // The subpath is closed, and the first and last segments are both lines. That means I need to round the corner between them when I process the first segment. I need to initialize currentPoint and priorSegment such that my normal line segment handling will draw the correct corner. if subpath.segments.count < 3 { // There are only one or two segments in this closed subpath. Since it's closed, there are two possibilities: // // - there is only one segment of zero length, or // - the second (and last) segment is just the first segment with the endpoints reversed. // // Either way, the path cannot have a visible corner to be rounded, so I don't need to do any special initialization. move(to: subpath.firstPoint) priorSegment = nil } else { // There is indeed a roundable corner between the last and first segments. Since I'll clamp the radius to consume no more than half of each of those segments, the midpoint of the last segment is a safe value for currentPoint. move(to: .midpoint(lastStart, lastEnd)) priorSegment = subpath.segments.last! } } else { // It's not a closed subpath, or the first or last segment isn't a line, so there's no roundable corner at the start. move(to: subpath.firstPoint) priorSegment = nil } /// Call this when starting to process a non-line segment, to draw the straight part of priorSegment if needed. func finishPriorLineIfNeeded() { if case .some(.line(start: _, end: let end)) = priorSegment, end != currentPoint { addLine(to: end) } } for currentSegment in subpath.segments { // Invariants: // - If priorSegment is nil, currentPoint is subpath.firstPoint. // - If priorSegment is a line, currentPoint is somewhere on that segment, and priorSegment is only drawn up to currentPoint. // - If priorSegment is non-nil and not a line, currentPoint is the end point of priorSegment and prior is fully drawn. switch currentSegment { case .line(start: let t1, end: let t2): if case .some(.line(start: let t0, end: _)) = priorSegment { // At least part of priorSegment is undrawn. This addArc draws any undrawn part of priorSegment, and draws the circular arc at the corner, but doesn't draw any of currentSegment after the arc. It leaves currentPoint at the endpoint of the arc, which is somewhere on currentSegment. let cr = clampedRadius( forCorner: t1, priorTangent: .midpoint(t0, t1), nextTangent: .midpoint(t1, t2), proposedRadius: radius ) addArc(tangent1End: t1, tangent2End: t2, radius: cr) } // I don't draw the rest of currentSegment here because some part of it may need to be replaced by an arc. case .quad(let c, end: let end): finishPriorLineIfNeeded() addQuadCurve(to: end, control: c) case .cubic(let c1, let c2, end: let end): finishPriorLineIfNeeded() addCurve(to: end, control1: c1, control2: c2) } priorSegment = currentSegment } if subpath.isClosed { closeSubpath() } else if case .some(.line(start: _, end: let end)) = priorSegment, end != currentPoint { addLine(to: end) } } } extension CGPoint { fileprivate static func midpoint(_ p0: Self, _ p1: Self) -> Self { return .init(x: 0.5 * p0.x + 0.5 * p1.x, y: 0.5 * p0.y + 0.5 * p1.y) } } func clampedRadius(forCorner corner: CGPoint, priorTangent: CGPoint, nextTangent: CGPoint, proposedRadius: CGFloat) -> CGFloat { guard let transform = CGAffineTransform.standardizing(origin: corner, unit: priorTangent) else { return 0 } /// `transform` is a conformal transform that transforms `corner` to the origin and `priorTangent` to (1, 0), which is the construction required by `clamp(r:under:)`. let scale = hypot(transform.a, transform.c) let p = nextTangent.applying(transform) let rScaled = proposedRadius * scale let rScaledClamped = clamp(r: rScaled, under: p) return rScaledClamped / scale } extension CGAffineTransform { /// - parameter origin: A point to be transformed to `.zero`. /// - parameter unit: A point to be transformed to `(1, 0)`. /// - returns: The unique conformal transform that transforms `origin` to `.zero` and transforms `unit` to `(1, 0)`, if it exists. fileprivate static func standardizing(origin: CGPoint, unit: CGPoint) -> Self? { let v = CGPoint(x: unit.x - origin.x, y: unit.y - origin.y) let q = v.x * v.x + v.y * v.y guard q != 0 else { return nil } let a = v.x / q let c = v.y / q return Self( a, -c, c, a, -(a * origin.x + c * origin.y), c * origin.x - a * origin.y ) } } /// Consider this construction: /// /// p /// β€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ–ž /// β€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ–ž /// β€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ–ž /// β€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ–ž /// β€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ–ž /// β€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ–ž /// β€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ–ž /// β€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ–žβ–š /// β€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ–žβ€ƒβ€ƒβ–š /// β€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ–žβ€ƒβ€ƒβ€ƒβ€ƒβ–š c = (d, r) /// β€ƒβ€ƒβ€ƒβ€ƒβ–žβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ–Œ /// β€ƒβ€ƒβ€ƒβ–žβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ–Œ /// β€ƒβ€ƒβ–žβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ–Œ /// β€ƒβ–žβ€ƒ β€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ€ƒβ–Œ /// β–Ÿβ–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–™β–„β–„β–„ /// 0 d (1,0) /// /// `c` is distance `r` from the x axis and also distance `r` from the line to `p`. The coordinates of `c` are `(d, r)`. /// /// I am given `p` and `r`, with `p.y β‰  0`. Note that `p` could be less than 1 unit from the origin; it is not required to be far away as in the diagram. /// /// My job is to compute `d`. If `abs(d)` is in the range 0 ... min(1, length(p), I return `r`. Otherwise, I compute the closest value to `r` /// that would put `abs(d)` in the required range, and return that closest value. fileprivate func clamp(r: CGFloat, under p: CGPoint) -> CGFloat { // Since `r` is given, let pLength = hypot(Double(p.x), Double(p.y)) /// Let theta be the angle between the x axis and vector `p`. /// /// Therefore `c`, being equidistant from the x axis and the line through `p`, is at angle theta/2 from the x axis. /// /// So `d` = `r` / tan theta/2. /// /// Trig identity: tan theta/2 = (1 - cos theta) / sin theta. /// /// cos theta = p.x / pLength /// sin theta = p.y / pLength /// tan theta/2 = (1 - cos theta) / sin theta /// = (pLength - p.x) / p.y /// /// d = r * p.y / (pLength - p.x) /// /// Note that if `pLength == p.x`, `d` is undefined. But that only happens if `p.y == 0`, which violates my precondition. let d = r * p.y / (pLength - p.x) let dLimit = min(1, pLength) if abs(d) <= dLimit { return r } return abs(dLimit * (pLength - p.x) / p.y) } ```
null
CC BY-SA 4.0
null
2023-01-26T04:13:16.293
2023-01-26T04:13:16.293
null
null
77,567
null
75,242,324
2
null
75,232,328
0
null
For sequelize doesn't needs a type definition in an array or JSON object. You can define only column types. (JSONB allows only for Postgress) ``` products: { type: JSONB, required: true} ```
null
CC BY-SA 4.0
null
2023-01-26T04:42:11.990
2023-01-26T04:42:11.990
null
null
10,609,219
null
75,242,417
2
null
58,386,640
0
null
Reference: [https://github.com/microsoft/vscode-cpptools/issues/5588#issuecomment-662116156](https://github.com/microsoft/vscode-cpptools/issues/5588#issuecomment-662116156) Using the following snippet (with updates to the version numbers) solved all my errors: ``` { "configurations": [ { "name": "driver", "defines": [ "__KERNEL__", "MODULE" ], "compilerPath": "/usr/bin/gcc", "cStandard": "c11", "cppStandard": "c++14", "intelliSenseMode": "gcc-x64", "includePath": [ "/usr/src/linux-headers-5.4.0-39-generic/arch/x86/include", "/usr/src/linux-headers-5.4.0-39-generic/arch/x86/include/generated", "/usr/src/linux-headers-5.4.0-39-generic/include", "/usr/src/linux-headers-5.4.0-39-generic/arch/x86/include/uapi", "/usr/src/linux-headers-5.4.0-39-generic/arch/x86/include/generated/uapi", "/usr/src/linux-headers-5.4.0-39-generic/include/uapi", "/usr/src/linux-headers-5.4.0-39-generic/include/generated/uapi", "/usr/src/linux-headers-5.4.0-39-generic/ubuntu/include", "/usr/lib/gcc/x86_64-linux-gnu/9/include" ], "compilerArgs": [ "-nostdinc", "-include", "/usr/src/linux-headers-5.4.0-39-generic/include/linux/kconfig.h", "-include", "/usr/src/linux-headers-5.4.0-39-generic/include/linux/compiler_types.h" ] } ], "version": 4 } ```
null
CC BY-SA 4.0
null
2023-01-26T05:00:56.947
2023-01-26T05:00:56.947
null
null
14,681,493
null
75,242,467
2
null
43,933,106
0
null
I tried recording a macro while using the spin button you highlighted, but this indicates that VBA can't control the spin button... So it seems the only way to change the index of a lookup table entry by VBA is to first delete the entry then add it back, for example moving entry at index=4 up to index=2 (after saving the name and description of entry index=4): ``` Dim lteName As String Dim lteDesc As String lteName = Application.CustomFieldValueListGetItem(pjCustomResourceOutlineCode2, pjValueListValue, 4) lteDesc = Application.CustomFieldValueListGetItem(pjCustomResourceOutlineCode2, pjValueListDescription, 4) Application.CustomFieldValueListDelete FieldID:=pjCustomResourceOutlineCode2, Index:=4 Application.CustomFieldValueListAdd FieldID:=pjCustomResourceOutlineCode2, Value:=lteName, Description:=lteDesc, Index:=2 ``` Two caveats: 1: It appears you can't do the above in the same macro that you are adding the lookup table entries. It only works in another macro run after adding the entries. 2: At least in my version of MS Project, the index number is flaky (it should be consecutive but sometimes index numbers repeat or there are gaps but then it corrects itself!), no doubt due to deleting and adding entries like I am suggesting. The code won't work if the index numbers that VBA is looking for don't match what is displayed in the lookuptable window. Oh dear... wish MSProject was perfect! Noted same behaviour on another SO thread [here](https://stackoverflow.com/questions/75179536/apart-from-adding-entries-via-lookuptableaddex-can-vba-do-more-to-the-lookup).
null
CC BY-SA 4.0
null
2023-01-26T05:16:44.513
2023-01-26T05:16:44.513
null
null
2,994,868
null
75,242,631
2
null
75,233,110
0
null
vscode uses the currently opened folder as the workspace, so first you need to use vscode to open your project folder, and then the java extension will automatically recognize the java project and display it in the panel. Click `Referenced Libraries` under the project's name to see the added reference, and click the plus sign on the right to add a reference. [](https://i.stack.imgur.com/FIEHk.png) See [here](https://code.visualstudio.com/docs/java/java-project#_dependency-management) for more information.
null
CC BY-SA 4.0
null
2023-01-26T05:52:01.467
2023-01-26T05:52:01.467
null
null
19,133,920
null
75,242,726
2
null
75,158,014
0
null
I have converted the hexadecimal files into images by using numpy array and Pillow. Now I am getting different images. ``` import numpy as np import binascii import os from PIL import Image as im from tkinter import * from tkinter import filedialog # Hide the root window that comes by default root = Tk() root.withdraw() # Browse and select txt files dir = [] dir = filedialog.askopenfilenames( initialdir="C:\Binaries\Folder_3", title="Open Text file", filetypes=(("Text Files", "*.txt"),) ) # Reading data in txt files and decoding hexadecimal characters for temp in dir: tf = open(temp) # Open file data = tf.read() # Read data in file data= data.replace('\'','') #Remove label data = data.replace(' ', '') # Remove whitespaces data = data.replace('\n', '') # Remove breaks in lines data = binascii.a2b_hex(data) tf.close() #Converting bytes array to numpy array a = np.frombuffer(data, dtype='uint8') #print(a) //Display array #Finding optimal factor pair for size of image x = len(a) val1=0 val2=0 for i in range(1, int(pow(x, 1 / 2))+1): if x % i == 0: val1=i val2=int(x / i) #Converting 1-D to 2-D numpy array a = np.reshape(a, (val1, val2)) #print(a) #Display 2-D array #Writing array to image data = im.fromarray(a) # Split path into filename and extenion pathname, extension = os.path.splitext(f"{temp}") filename = pathname.split('/') # Get filename without txt extension # Defining name of image file same as txt file filepath = f"C:\Binaries\Images_3\{filename[-1]}.png" #Resize image data=data.resize((500,500)) #Saving image into path data.save(filepath) ``` [](https://i.stack.imgur.com/fvlKr.png) [](https://i.stack.imgur.com/LNG51.png)
null
CC BY-SA 4.0
null
2023-01-26T06:09:08.687
2023-01-26T06:09:08.687
null
null
10,826,985
null
75,242,788
2
null
63,301,646
0
null
If you still want to use `numpydoc`, you can! [The documentation](https://numpydoc.readthedocs.io/en/latest/install.html#configuration) lists configuration options to set in `conf.py`. Setting the following options to `False` eliminates the redundant entries in the autosummary. ``` numpydoc_show_class_members numpydoc_show_inherited_class_members ``` So here is what your `conf.py` should look like. ``` # conf.py extensions = ['sphinx.ext.autodoc', 'sphinx.ext.autosummary', 'numpydoc', 'sphinx.ext.doctest', 'sphinx.ext.intersphinx', 'sphinx.ext.imgconverter'] numpydoc_class_members_toctree = False # Add these lines. numpydoc_show_class_members = False numpydoc_show_inherited_class_members = False ``` Bonus: if you are using [Jupyter Book](https://jupyterbook.org/en/stable/advanced/developers.html), these go under the `sphinx: config:` block in `_config.yml` ``` # _config.yml sphinx: extra_extensions: - numpydoc - sphinx.ext.autodoc - sphinx.ext.autosummary - sphinx.ext.doctest - sphinx.ext.intersphinx - sphinx.ext.imgconverter config: numpydoc_show_class_members: false numpydoc_show_inherited_class_members: false numpydoc_class_members_toctree: false ```
null
CC BY-SA 4.0
null
2023-01-26T06:20:36.730
2023-01-26T06:20:36.730
null
null
7,407,967
null
75,243,042
2
null
75,242,488
1
null
As suggested, you can use `groupby`. One more thing you need to take care of is finding the overlapping time. Ideally you'd use datetime which are easy to work with. However you used a different format so we need to convert it first to make the solution easier. Since you did not provide a workable example, I will just write the gist here: ``` # convert current format to datetime df['start_datetime'] = pd.to_datetime(df.start_date) + df.start_time.astype('timedelta64[h]') df['end_datetime'] = pd.to_datetime(df.end_date) + df.end_time.astype('timedelta64[h]') df = df.sort_values(['start_datetime', 'end_datetime'], ascending=[True, False]) gb = df.groupby('r_id') for g, g_df in gb: g_df['overlap_group'] = (g_df['end_datetime'].cummax().shift() <= g_df['start_datetime']).cumsum() print(g_df) ``` This is a tentative example, and you might need to tweak the datetime conversion and some other minor things, but this is the gist. The `cummax()` detects where there is an overlap between the intervals, and `cumsum()` counts the number of overlapping groups, since it's a counter we can use it as a unique identifier. I used the following threads: [Group rows by overlapping ranges](https://stackoverflow.com/questions/48243507/group-rows-by-overlapping-ranges) [python/pandas - converting date and hour integers to datetime](https://stackoverflow.com/questions/36416725/python-pandas-converting-date-and-hour-integers-to-datetime) ### Edit After discussing it with OP the idea is to take each patient's df and sort it by the date of the event. The first one will be the start_time and the last one would be the end_time. The unification of the time and date are not necessary for detecting the start and end time as they can sort by date and by the time to get the same order they would have gotten if they did unify the columns. However for the overlap detection it does make life easier when it's in one column. ``` gb_patient = df.groupby('id') patients_data_list = [] for patient_id, patient_df in gb_patient: patient_df = patient_df.sort_values(by=['Date', 'Time']) patient_data = { "patient_id": patient_id, "start_time": patient_df.Date.values[0] + patient_df.Time.values[0], "end_time": patient_df.Date.values[-1] + patient_df.Time.values[-1] } patients_data_list.append(patient_data) new_df = pd.DataFrame(patients_data_list) ``` After that they can use the above code for the overlaps.
null
CC BY-SA 4.0
null
2023-01-26T07:10:08.067
2023-01-26T16:14:07.277
2023-01-26T16:14:07.277
6,729,591
6,729,591
null
75,243,110
2
null
75,225,614
0
null
I agree with @erik258. I am sharing this [article](https://aws.amazon.com/premiumsupport/knowledge-center/account-transfer-rds/) that says you can't transfer resources between accounts. However, you can migrate Amazon RDS resources to another account. To migrate Amazon RDS resources to another account, follow these instructions: 1. Create a DB snapshot. 2. Share the snapshot with the target account. 3. Create a new DB instance in the target account by restoring the DB snapshot.
null
CC BY-SA 4.0
null
2023-01-26T07:18:46.897
2023-01-26T07:18:46.897
null
null
9,119,769
null
75,243,142
2
null
75,235,787
0
null
Since there are those who switch from front-end to back-end like me and can be novice while learning, instead of removing the post, I answer it myself; when accessing another view from one view `href="/Category/AddCategory"` Specify the href like this, do not write the .cshtml part.
null
CC BY-SA 4.0
null
2023-01-26T07:24:14.230
2023-01-26T07:24:14.230
null
null
20,814,898
null
75,243,346
2
null
75,232,558
-1
null
Try this: Dim varStudent as String . varStudent = cbStudent . In SQL String: VALUES ( '" & varStudent & "', '" & varTxtScore & "' '" = SingleQuote DoubleQuote
null
CC BY-SA 4.0
null
2023-01-26T07:48:43.177
2023-01-26T07:48:43.177
null
null
21,084,100
null
75,243,463
2
null
71,391,862
0
null
Add ``` hoverlabel = dict(namelength = -1) ``` or a number of characters, on each trace. See the [original post](https://community.plotly.com/t/re-size-hover-info-box/955/11) The documentation for the Hoverlabel namelength property : [here](https://plotly.com/python-api-reference/generated/plotly.graph_objects.treemap.html#plotly.graph_objects.treemap.Hoverlabel)
null
CC BY-SA 4.0
null
2023-01-26T08:03:13.560
2023-01-26T14:42:22.637
2023-01-26T14:42:22.637
12,965,643
12,965,643
null
75,243,860
2
null
73,661,418
0
null
I posted this question on [Debezium Google Group](https://groups.google.com/g/debezium/c/aUO9X5uGRF0) as well and you can see answer there. To quote it here: > Most of those you showed are related to either String-based or String Array-based types, and AFAIK these are not supported in Prometheus. The driving factor for expressing these as String values is because in high volume or older Oracle databases, the SCN values have likely extended beyond Long.MAX_VALUE and therefore cannot be represented by a simple Long.
null
CC BY-SA 4.0
null
2023-01-26T08:47:19.300
2023-01-26T08:47:19.300
null
null
759,126
null
75,243,871
2
null
75,242,459
0
null
> I show this exception on the page but data is inserted in database successfully. My database datatype and model class datatypes both are the same, but I still get this "Conversion Error" on the page Well, at the beginning I was thinking you are doing something silly. Out of my curiosity, I get into it and got to know issue is not within your code its `Dapper-Extensions` issue. I have investigate quite a long while with their document and seems its older version and currently they are not supporting it. [I have gone through this official document.](https://github.com/tmsmith/Dapper-Extensions) I have have reproduced the issue which has been thrown from `Dapper-Extensions` method as can be seen below: Dapper Extension Method: [](https://i.stack.imgur.com/8xAya.png) Exception: [](https://i.stack.imgur.com/b4haO.gif) Stacktrace: ``` at System.RuntimeType.TryChangeType(Object value, Binder binder, CultureInfo culture, Boolean needsSpecialCast) at System.Reflection.MethodBase.CheckArguments(Object[] parameters, Binder binder, BindingFlags invokeAttr, CultureInfo culture, Signature sig) at System.Reflection.RuntimeMethodInfo.InvokeArgumentsCheck(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture) at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, Object[] index) at DapperExtensions.DapperImplementor.InternalInsert[T](IDbConnection connection, T entity, IDbTransaction transaction, Nullable`1 commandTimeout, IClassMapper classMap, IList`1 nonIdentityKeyProperties, IMemberMap identityColumn, IMemberMap triggerIdentityColumn, IList`1 sequenceIdentityColumn) at DapperExtensions.DapperImplementor.Insert[T](IDbConnection connection, T entity, IDbTransaction transaction, Nullable`1 commandTimeout) at MVCApps.Controllers.UserLogController.Add() in D:\MyComputer\MsPartnerSupport\MVCApps\Controllers\UserLogController.cs:line 1371 at Microsoft.Extensions.Internal.ObjectMethodExecutor.Execute(Object target, Object[] parameters) at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.SyncObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeActionMethodAsync>d__12.MoveNext() ``` While debugging and reproduce the issue, I have tried to use data type both `int` in both side as well as other data type for instance, `bigint` but still that conversion error taken place and I found this issue is known in regards of `Dapper-Extensions`. Thus, one data-type works out accordingly that is `GUID`. I still not sure, how these `Object value, Binder binder, CultureInfo culture, Boolean needsSpecialCast` are Intervening here. As of now, `int`, `bigint` always throws `'Object of type 'System.Int64' cannot be converted to type 'System.Int32'.'` hence, the reason is not clear which coming from `DapperExtensions.DapperExtensions.Insert()` method. Furthermore, to avoid above error, we can do as following: POCO Model: ``` public class Employee { public Guid Id { get; set; } public string Name { get; set; } public string Emailid { get; set; } public string Department { get; set; } public int Salary { get; set; } } ``` Other than `Guid` currently not working, I am not sure the reason behind this. So if you would like to stick to your implementation, you could consider `Guid`. Database Schema: ``` CREATE TABLE Employee(       [Id] UNIQUEIDENTIFIER PRIMARY KEY DEFAULT NEWID(),       [Name] [varchar](25) NULL,       [Emailid] [varchar](100) NULL,       [Department] [varchar](25) NULL,       [Salary] [int] NULL, ) ``` [](https://i.stack.imgur.com/cTpAG.png) Asp.Net Core Controller/Repository Method: ``` public int Add() { int count = 0; Employee employee = new Employee(); employee.Name = "Kudiya"; employee.Emailid = "[email protected]"; employee.Department = "Dapper"; employee.Salary = 500; using (SqlConnection conn = new SqlConnection(_connectionString)) { conn.Insert(employee); Guid Id = employee.Id; if (Id != null) { count++; } } return count; } ``` Please update the code snippet based on your scenario and context. [](https://i.stack.imgur.com/SfgBr.gif) Moreover, based on the stacktrace, if someone has the exact explnation or findings, please do let me know. I wound happy to update my answer.
null
CC BY-SA 4.0
null
2023-01-26T08:48:09.467
2023-01-31T01:43:44.403
2023-01-31T01:43:44.403
9,663,070
9,663,070
null
75,243,950
2
null
75,234,311
1
null
The reason is that this is in various Look and Feel implementations (See [here](http://dev.cs.ovgu.de/java/Books/SwingBook/Chapter6html/index.html), section 6.2.1): > [...] selecting a tab that is not in the frontmost row or column . This does not occur in a JTabbedPane using the default Metal L&F as can be seen in the TabbedPaneDemo example above. However, this does occur when using the Windows, Motif, and Basic L&Fs. This in the Metal L&F [...] The responsible method is shouldRotateTabRuns(...) and returns true or false in various TabbedUI implementations (see [Metal L&F](https://github.com/openjdk/jdk16/blob/4de3a6be9e60b9676f2199cd18eadb54a9d6e3fe/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalTabbedPaneUI.java#L1268) vs. [Basic L&F](https://github.com/openjdk/jdk16/blob/4de3a6be9e60b9676f2199cd18eadb54a9d6e3fe/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java#L1938)). To prevent tab rotation, you could overwrite like this: ``` public class TabExample extends JFrame { public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { public void run() { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (InstantiationException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (UnsupportedLookAndFeelException e) { e.printStackTrace(); } TabExample app = new TabExample(); app.setVisible(true); } }); } private TabExample() { setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setSize(800, 500); setLocationRelativeTo(null); setVisible(true); JPanel UpperPanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.RIGHT, JTabbedPane.WRAP_TAB_LAYOUT); // Check if TabbedPaneUI is instance of WindowsTabbedPaneUI // You may add checks for other L&F if (tabbedPane.getUI() instanceof com.sun.java.swing.plaf.windows.WindowsTabbedPaneUI) { tabbedPane.setUI(new MyWindowsTabbedPaneUI()); } tabbedPane.addTab("Calculation", new JLabel()); tabbedPane.addTab("Store", new JLabel()); tabbedPane.addTab("Settings", new JLabel()); UpperPanel.add(tabbedPane); add(tabbedPane, BorderLayout.NORTH); } // Class that overwrites WindowsTabbedPaneUI and returns false class MyWindowsTabbedPaneUI extends com.sun.java.swing.plaf.windows.WindowsTabbedPaneUI{ @Override protected boolean shouldRotateTabRuns(int tabPlacement) { return false; } } } ```
null
CC BY-SA 4.0
null
2023-01-26T08:55:19.320
2023-01-26T08:55:19.320
null
null
1,246,600
null
75,244,424
2
null
75,243,932
1
null
Convert the date/time column to datetime data type, then use `x_compat = True` to enforce Python datetime compatibility, which in turn allows to use mdates formatter correctly. Given ``` df Date and Time Temperature 0 7/1/2022 0:00 25.4 1 7/1/2022 0:15 23.2 2 7/1/2022 0:30 22.5 3 7/1/2022 0:45 23.0 4 7/1/2022 1:00 22.3 5 7/1/2022 1:15 22.0 ``` that can look like ``` df['Date and Time'] = pd.to_datetime(df['Date and Time'], format="%m/%d/%Y %H:%M") fig, ax = plt.subplots(figsize=(25, 10)) df.plot(kind='line', x='Date and Time', y='Temperature', ax=ax, label='Week 1', x_compat=True) plt.xlabel('Date and Time of the month - July') plt.ylabel('Temperature') ax.xaxis.set_major_formatter(mdates.DateFormatter("%m.%d.%Y")) ax.xaxis.set_major_locator(mdates.DayLocator(interval=1)) plt.show() ``` [](https://i.stack.imgur.com/n8ILa.png)
null
CC BY-SA 4.0
null
2023-01-26T09:43:20.707
2023-01-26T09:52:54.520
2023-01-26T09:52:54.520
10,197,418
10,197,418
null
75,244,603
2
null
22,767,098
0
null
Swift UI: to change active item color you only have to add ``` TabView().accentColor(you_Color_here) ``` to change inactive item color ``` .onAppear{ Β Β Β Β Β Β Β Β Β Β UITabBar.appearance().unselectedItemTintColor = UIColor(theme.colors.secondary) Β Β Β Β Β Β Β Β } ```
null
CC BY-SA 4.0
null
2023-01-26T10:01:23.040
2023-01-26T10:01:23.040
null
null
10,669,847
null
75,244,601
2
null
75,242,660
0
null
What I would do is convert your RGB and Depth image to 3D mesh (surface with bumps) using your camera settings (FOVs,focal length) something like this: - [Align already captured rgb and depth images](https://stackoverflow.com/a/35914008/2521214) and then project it onto ground plane (perpendicul to camera view direction in the middle of screen). To obtain ground plane simply take 3 3D positions of the ground `p0,p1,p2` (forming triangle) and using cross product to compute the ground normal: ``` n = normalize(cross(p1-p0,p2-p1)) ``` now you plane is defined by `p0,n` so just each 3D coordinate convert like this: [](https://i.stack.imgur.com/81jdq.png) by simply adding normal vector (towards ground) multiplied by distance to ground, if I see it right something like this: ``` p' = p + n * dot(p-p0,n) ``` That should eliminate the problem with visible sides on edges of FOV however you should also take into account that by showing side some part of top is also hidden so to remedy that you might also find axis of symmetry, and use just half of top side (that is not hidden partially) and just multiply the measured half area by 2 ...
null
CC BY-SA 4.0
null
2023-01-26T10:00:55.720
2023-01-27T08:49:00.627
2023-01-27T08:49:00.627
2,521,214
2,521,214
null
75,244,788
2
null
75,244,097
0
null
We don't have your data, so I created some data (see below). First you should transform your data to a longer format using `pivot_longer` after that you can use `geom_col` with `position_dodge` to create a dodged barplot like this: ``` library(tidyr) library(dplyr) library(ggplot2) library(ggthemes) # excel theme df %>% pivot_longer(cols = -class) %>% ggplot(aes(x = name, y = value, fill = class)) + geom_col(position = position_dodge(width = 0.6), width = 0.5) + theme_excel_new() + theme(legend.position = "bottom") ``` ![](https://i.imgur.com/Jo5FJYl.png) [reprex v2.0.2](https://reprex.tidyverse.org) --- Data used: ``` df <- data.frame(class = c("CD I", "CD II", "CD III", "No compl."), DP = c(3,3,4,13), PD = c(1,5,2,10), DPPHR = c(1,0,0,9), SP = c(0,0,0,0), TP = c(0,2,1,0)) ```
null
CC BY-SA 4.0
null
2023-01-26T10:20:00.847
2023-01-26T10:20:00.847
null
null
14,282,714
null
75,244,874
2
null
75,234,052
0
null
This is the code which got me to my required result: ``` SELECT product_name, 0 price1, 0 price2, 0 price3, (CASE WHEN SUM(price)>100 THEN 'yes' ELSE 'no' END) AS price4, '' price5 FROM sales_1 GROUP BY product_name,price UNION ALL SELECT product_name, 0 price1, 0 price2, 0 price3, '' price4, (CASE WHEN SUM(price)<100 THEN 'yes' ELSE 'no' END) AS price5 FROM sales_1 GROUP BY product_name, price ``` And this is the result I got from upper query: ![enter image description here](https://i.stack.imgur.com/k2hcZ.png)
null
CC BY-SA 4.0
null
2023-01-26T10:28:24.803
2023-01-28T01:51:38.613
2023-01-28T01:51:38.613
12,492,890
21,079,769
null
75,244,968
2
null
75,244,746
1
null
You can use `offsets` to aggregate your data: ``` HM_DD = pd.crosstab(df['time'].dt.normalize(), df['Hit/Miss']) HM_MM = pd.crosstab(df['time'].dt.date+pd.offsets.MonthBegin(-1), df['Hit/Miss']) HM_YYMM = pd.crosstab(df['time'].dt.date+pd.offsets.YearBegin(-1), df['Hit/Miss']) ``` Output: ``` >>> HM_DD.reset_index().rename_axis(columns=None) time FN FP TP 0 2016-09-29 2 0 1 1 2016-10-05 0 1 0 >>> HM_MM.reset_index().rename_axis(columns=None) time FN FP TP 0 2016-09-01 2 0 1 1 2016-10-01 0 1 0 >>> HM_YYMM.reset_index().rename_axis(columns=None) time FN FP TP 0 2016-01-01 2 1 1 ```
null
CC BY-SA 4.0
null
2023-01-26T10:37:00.107
2023-01-26T10:37:00.107
null
null
15,239,951
null
75,245,208
2
null
75,244,144
0
null
This 'Answer' is an attempt at #. The OP . PS: The `groupby` returns grouping as 'expected'. @TANNU, It appears your '`NaN`' might have come from your data cleansing. Kindly show your relevant code. NB: The ['Amazon Top 50 Bestselling Books 2009 - 2019' dataset](https://www.kaggle.com/datasets/sootersaalu/amazon-top-50-bestselling-books-2009-2019) has #550 rows {`data.shape`:`(550, 7)`} [For noting] Your `book_review` groupby has a whopping `269010 rows`. My reproduction of your `book_review` yielded `351 rows Γ— 5 columns` PS: Updated based on @Siva Shanmugam's edit. ``` ## import libraries import pandas as pd import numpy as np ## read dataset data = pd.read_csv('https://raw.githubusercontent.com/dphi-official/Datasets/master/Amazon%20Top%2050%20Bestselling%20Books%202009%20-%202019.csv') data.head(2) ''' [out] Name Author User Rating Reviews Price Year Genre 0 10-Day Green Smoothie Cleanse JJ Smith 4.7 17350 8 2016 Non Fiction 1 11/22/63: A Novel Stephen King 4.6 2052 22 2011 Fiction ''' ## check shape data.shape ''' [out] (550, 7) ''' ## check dataset data.describe() ''' [out] User Rating Reviews Price Year count 550.000000 550.000000 550.000000 550.000000 mean 4.618364 11953.281818 13.100000 2014.000000 std 0.226980 11731.132017 10.842262 3.165156 min 3.300000 37.000000 0.000000 2009.000000 25% 4.500000 4058.000000 7.000000 2011.000000 50% 4.700000 8580.000000 11.000000 2014.000000 75% 4.800000 17253.250000 16.000000 2017.000000 max 4.900000 87841.000000 105.000000 2019.000000 ''' ## check NaN data.Reviews.isnull().any().any() ''' [out] False ''' ## mean of reviews mean_reviews = np.math.ceil(data.Reviews.mean()) mean_reviews ''' [out] 11954 ''' ## group by mean of `User Rating` and `Reviews` book_review = data.groupby(['Name', 'Author', 'Genre'], as_index=False)[['User Rating', 'Reviews']].mean() book_review ''' [out] Name Author Genre User Rating Reviews 0 10-Day Green Smoothie Cleanse JJ Smith Non Fiction 4.7 17350.0 2 12 Rules for Life: An Antidote to Chaos Jordan B. Peterson Non Fiction 4.7 18979.0 3 1984 (Signet Classics) George Orwell Fiction 4.7 21424.0 5 A Dance with Dragons (A Song of Ice and Fire) George R. R. Martin Fiction 4.4 12643.0 6 A Game of Thrones / A Clash of Kings / A Storm... George R. R. Martin Fiction 4.7 19735.0 ... ... ... ... ... ... 341 When Breath Becomes Air Paul Kalanithi Non Fiction 4.8 13779.0 342 Where the Crawdads Sing Delia Owens Fiction 4.8 87841.0 345 Wild: From Lost to Found on the Pacific Crest ... Cheryl Strayed Non Fiction 4.4 17044.0 348 Wonder R. J. Palacio Fiction 4.8 21625.0 350 You Are a Badass: How to Stop Doubting Your Gr... Jen Sincero Non Fiction 4.7 14331.0 83 rows Γ— 5 columns ''' ## get book reviews that are less than the mean(reviews) book_review[book_review.Reviews < mean_reviews] ''' [out] Name Author Genre User Rating Reviews ​ ''' ``` ![reproduction of book_review groupby](https://i.stack.imgur.com/WCzYl.png)
null
CC BY-SA 4.0
null
2023-01-26T10:59:33.877
2023-01-26T11:20:24.600
2023-01-26T11:20:24.600
20,107,918
20,107,918
null
75,245,374
2
null
75,243,020
0
null
Here is an example that I tried on my side. This batch file can create a shortcut on `SendTo` Folder and may be can do the trick for you too , just change the path of QRCP on your side : --- ``` @echo off Title QRCP Batch File REM Create a shortcut on SendTo Folder REM "Call :CreateShortcut_SendTo" - This command calls the CreateShortcut_SendTo subroutine, REM which creates a shortcut in the SendTo folder that can be used to easily execute the script. Call :CreateShortcut_SendTo REM This command sets the QRCP_Path variable to the location of the QRCP.exe file in the same directory as the batch file. Set QRCP_Path="%~dp0QRCP.exe" Set FilePath=%1 If "%FilePath%" == "" ( Color 0C & echo No File was passed throw this Program, Exiting ... & Timeout /T 5 /NoBreak>nul & Exit ) %QRCP_Path% %1 echo File %1 passed to QRCP Exit /B ::--------------------------------------------------------------------------------------------------- :CreateShortcut_SendTo Powershell -Command "If (Test-Path '%Appdata%\Microsoft\Windows\SendTo\%~n0.lnk') { Remove-Item '%Appdata%\Microsoft\Windows\SendTo\%~n0.lnk' }" Powershell ^ "$s=(New-Object -COM WScript.Shell).CreateShortcut('%Appdata%\Microsoft\Windows\SendTo\%~n0.lnk'); ^ $s.TargetPath='%~dpnx0'; ^ $s.WorkingDirectory='%~dp0'; ^ $s.IconLocation='%QRCP_Path%,0'; ^ $s.Save()" Exit /B ::--------------------------------------------------------------------------------------------------- ```
null
CC BY-SA 4.0
null
2023-01-26T11:17:09.693
2023-01-26T11:36:21.773
2023-01-26T11:36:21.773
3,080,770
3,080,770
null
75,245,455
2
null
75,243,774
1
null
``` Option Explicit Sub downloadFile() Const FOLDER = "D:\SF\" Dim fso As Object, ws As Worksheet, wb As Workbook Set fso = CreateObject("Scripting.FileSystemObject") If Not (fso.FolderExists(FOLDER)) Then MkDir FOLDER Dim oWinHttp As Object, oStream Dim URL As String, FilePath As String Dim n As Long, r As Long, ext As String Set wb = ThisWorkbook Set ws = wb.Sheets("Tabelle1") Set oWinHttp = CreateObject("WinHttp.WinHttpRequest.5.1") r = 7 FilePath = ws.Cells(r, "A") Do While Len(FilePath) > 0 If Right(FilePath, 1) <> "\" Then FilePath = FilePath & "\" ' check folder exists If Not fso.FolderExists(FOLDER & FilePath) Then 'Debug.Print FOLDER & FilePath MkDir FOLDER & FilePath End If URL = ws.Cells(r, "D").Value oWinHttp.Open "GET", URL, False oWinHttp.Send If oWinHttp.Status = 200 Then Set oStream = CreateObject("ADODB.Stream") With oStream .Open .Type = 1 .Write oWinHttp.ResponseBody ' determine pdf or png .Position = 1 If StrConv(.read(3), vbUnicode) = "PNG" Then ext = ".png" Else ext = ".pdf" End If .SaveToFile FOLDER & FilePath & "File " & r & ext, 2 ' 1 = no overwrite, 2 = overwrite .Close End With n = n + 1 Else MsgBox URL, vbExclamation, "Status " & oWinHttp.Status End If r = r + 1 FilePath = ws.Cells(r, "A") Loop MsgBox n & " files created", vbInformation End Sub ```
null
CC BY-SA 4.0
null
2023-01-26T11:24:55.540
2023-01-28T11:54:07.680
2023-01-28T11:54:07.680
12,704,593
12,704,593
null
75,245,905
2
null
75,245,752
1
null
With `add_row`: ``` library(dplyr) library(tibble) df %>% group_by(group, cu = cumsum(is.na(value))) %>% group_modify(~ add_row(.x, date1 = max(.$date2), date2 = max(.$date2), value = max(.$value, na.rm = TRUE))) %>% ungroup() %>% select(-cu) # A tibble: 12 x 4 group date1 date2 value <chr> <chr> <chr> <dbl> 1 A 2022-01-01 2022-01-03 3 2 A 2022-01-03 2022-01-03 3 3 A 2022-01-03 2022-01-06 NA 4 A 2022-01-06 2022-01-07 2 5 A 2022-01-07 2022-01-10 2 6 A 2022-01-10 2022-01-10 2 7 B 2022-01-01 2022-01-02 NA 8 B 2022-01-02 2022-01-04 1 9 B 2022-01-04 2022-01-04 1 10 B 2022-01-04 2022-01-06 NA 11 B 2022-01-06 2022-01-09 4 12 B 2022-01-09 2022-01-09 4 ``` [](https://i.stack.imgur.com/Gsdoj.png)
null
CC BY-SA 4.0
null
2023-01-26T12:05:50.253
2023-01-26T12:12:06.380
2023-01-26T12:12:06.380
13,460,602
13,460,602
null
75,245,952
2
null
75,244,591
0
null
Change the `get` method to `post`. to create new data in the server the `post` method is used. and also add the `await` keyword before the `newuser.save()`, here is a example. ``` const router = require("express").Router(); const User = require("../models/User"); const bcrypt = require("bcrypt"); //for register; router.post("/register", async (req, res) => { try { const newuser = new User({ username: "herovinay", password: "herovinay" }); await newuser.save((err)=> { if (err) { res.status(500).json({ msg: "internal error is here"}); } else { res.status(200).json({ msg: "Data saved successfully..." }); } }); } catch (err) { res.send("second error is here"); } }) module.exports = router; ```
null
CC BY-SA 4.0
null
2023-01-26T12:09:40.440
2023-01-26T12:09:40.440
null
null
14,003,858
null
75,246,110
2
null
75,246,056
0
null
Modify your code to: ``` ax = grouped_dataframe.plot(kind='bar', figsize=(10,5)) for x, val in enumerate(grouped_dataframe['count']): ax.text(x, val, val, va='bottom', ha='center') ``` [](https://i.stack.imgur.com/gkuFg.png)
null
CC BY-SA 4.0
null
2023-01-26T12:26:20.077
2023-01-26T12:26:20.077
null
null
16,343,464
null
75,246,142
2
null
75,244,126
0
null
The key of the solution is: ``` plot 'DATA.dat' with vectors head size 0.08,20,60 filled lc palette ``` [](https://i.stack.imgur.com/Ifp9Q.png) you can play with the vector's head size parameters, borders, colors etc.
null
CC BY-SA 4.0
null
2023-01-26T12:29:04.200
2023-01-26T12:29:04.200
null
null
6,113,363
null
75,246,270
2
null
75,222,565
1
null
The usual method of fitting (such as in Python) involves an iterative process starting from "guessed" values of the parameters which must be not too far from the unknown exact values. An unusual method exists not iterative and not requiring initial values to start the calculus. The application to the case of the sine function is shown below with a numerical example (Computaion with MathCad). [](https://i.stack.imgur.com/w1dwX.jpg) [](https://i.stack.imgur.com/qIOIb.jpg) [](https://i.stack.imgur.com/yynxW.gif) The above method consists in a linear fitting of an integral equation to which the sine function is solution. For general explanation see [https://fr.scribd.com/doc/14674814/Regressions-et-equations-integrales](https://fr.scribd.com/doc/14674814/Regressions-et-equations-integrales) . Note : If some particular criteria of fitting is specified ( MLSE, MLSAE, MLSRE or other) one cannot avoid nonlinear regression. Then the approximate values of the parameters found above are very good values to start the iterative process in expecting a better reliability with an usual non-linear regression software.
null
CC BY-SA 4.0
null
2023-01-26T12:40:42.750
2023-01-26T12:40:42.750
null
null
6,819,132
null
75,246,366
2
null
75,245,752
0
null
As a suggestion, here's another way of showing the data. Adding points to show data that is not connected with anything, maybe a cleaner way to represent the original data. In total there are 3 data points for group and 2 for group . ``` ggplot(df %>% mutate(Date = paste(date1, date2)), aes(x = Date, y = value, color = group, group = group)) + geom_step() + geom_point(aes(Date, value, color = group)) + theme(axis.text.x = element_text(angle = 65, vjust = 1, hjust=1)) Warning messages: 1: Removed 1 row containing missing values (`geom_step()`). 2: Removed 3 rows containing missing values (`geom_point()`). ``` [](https://i.stack.imgur.com/uxenv.png)
null
CC BY-SA 4.0
null
2023-01-26T12:49:24.267
2023-01-26T12:49:24.267
null
null
9,462,095
null
75,246,701
2
null
75,219,549
0
null
I see a couple of problems with your custom class: 1. As Frank pointed out in a comment, nStudents and nTeachers won't map correctly due to case sensitivity. 2. It seems like your class has no empty constructor (or default arguments) which is required for the database to properly deserialize the data, as detailed in the Firebase docs. 3. The data types don't seem to match: You've declared nstudents and nteachers as String, but I see it as numbers in your database, so you should probably use an Int or Long. With all that said, your updated class should look like this: ``` class Branch( var id: String? = null, var nstudents: Int = 0, var nteachers: Int = 0, var name: String = "" ) { // ... } ``` And if the only purpose of this class is to hold data, you can turn it into a [data class](https://kotlinlang.org/docs/data-classes.html): ``` data class Branch( var id: String? = null, var nstudents: Int = 0, var nteachers: Int = 0, var name: String = "" ) ```
null
CC BY-SA 4.0
null
2023-01-26T13:20:03.097
2023-01-26T13:20:03.097
null
null
5,861,618
null
75,246,898
2
null
75,242,660
0
null
Accurate computation is virtually hopeless, because you don't see all sides. Assuming your depth information is available as a range image, you can consider the points inside the segmentation mask of a single chicken, estimate the vertical direction at that point, rotate and project the points to obtain the silhouette. But as a part of the surface is occluded, you may have to reconstruct it using symmetry.
null
CC BY-SA 4.0
null
2023-01-26T13:38:32.837
2023-01-26T13:38:32.837
null
null
null
null
75,247,129
2
null
75,243,343
1
null
This formula will do the trick: ``` =LET( data,I12:AM12, subset,FILTER(data,NOT(ISERROR(FIND("P",data)))), num,VALUE(LEFT(subset,LEN(subset)-2)), SUM(num-8) ) ``` This solution requires the Office365 version of Excel. Note, with the expression `LEN(subset)-2` within the formula, it assumes that the number is always seperated from the "P" by one character, e.g. a space. That means, the formula only works this way if values featuring a "P" appear in the form "5 P" or "11 P", but not in the form "11P". --- For earlier versions of excel where the functions `LET()` and `FILTER()` are not available, the formula here below can be used instead ``` =SUM(IFERROR(FIND("P",I12:AM12)^0*VALUE(LEFT(I12:AM12,2))-8,0)) ``` This is still an array formula and has to be entered with the key combination ++
null
CC BY-SA 4.0
null
2023-01-26T13:59:16.173
2023-01-27T09:48:39.513
2023-01-27T09:48:39.513
17,158,703
17,158,703
null
75,247,341
2
null
75,246,946
2
null
``` dt$names_X <- strsplit(dt$names_X, ", ") dt$names_Y <- strsplit(dt$names_Y, ", ") dt$count <- mapply(\(x, y) sum(x %in% y), dt$names_X, dt$names_Y) dt$matching_names <- mapply( \(x, y) if (any(x %in% y)) toString(x[x %in% y]) else NA, dt$names_X, dt$names_Y ) # group names_X names_Y count matching_names # 1 A James, Robert, Phill Robert, Peter 1 Robert # 2 A James, Blake, Paul Robert, Peter 0 <NA> # 3 B Lucy, Macy Macy, Lucy 2 Lucy, Macy # 4 B Lucy, Caty Caty, Jess, Carla 1 Caty ```
null
CC BY-SA 4.0
null
2023-01-26T14:16:04.370
2023-01-26T14:16:04.370
null
null
4,552,295
null
75,247,444
2
null
75,238,246
1
null
Looks like the interpolation in GetPointAtDistance in the epoly code is not as accurate as (or at least consistent with) the code in the Google Maps JavaScript API v3 geometry library. If I replace the existing interpolation: ``` return new google.maps.LatLng(p1.lat() + (p2.lat() - p1.lat()) * m, p1.lng() + (p2.lng() - p1.lng()) * m); ``` with the `google.maps.geometry.spherical.interpolate` method: ``` return google.maps.geometry.spherical.interpolate(p1, p2, m); ``` The marker ends up on the line (when the line is `geodesic: true`). [proof of concept fiddle](https://jsfiddle.net/geocodezip/4dmxyt3j/3/) [](https://i.stack.imgur.com/HPFTk.png) ``` // initialise map function initMap() { var options = { center: { lat: 51.69869842676892, lng: 8.188009802432369 }, zoom: 14, mapId: '1ab596deb8cb9da8', mapTypeControl: false, streetViewControl: false, fullscreenControlOptions: { position: google.maps.ControlPosition.RIGHT_BOTTOM }, } var map = new google.maps.Map(document.getElementById('map'), options); google.maps.LatLng.prototype.distanceFrom = function(newLatLng) { var EarthRadiusMeters = 6378137.0; // meters var lat1 = this.lat(); var lon1 = this.lng(); var lat2 = newLatLng.lat(); var lon2 = newLatLng.lng(); var dLat = (lat2 - lat1) * Math.PI / 180; var dLon = (lon2 - lon1) * Math.PI / 180; var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.cos(lat1 * Math.PI / 180) * Math.cos(lat2 * Math.PI / 180) * Math.sin(dLon / 2) * Math.sin(dLon / 2); var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)); var d = EarthRadiusMeters * c; return d; } google.maps.Polyline.prototype.GetPointAtDistance = function(metres) { // some awkward special cases if (metres == 0) return this.getPath().getAt(0); if (metres < 0) return null; if (this.getPath().getLength() < 2) return null; var dist = 0; var olddist = 0; for (var i = 1; (i < this.getPath().getLength() && dist < metres); i++) { olddist = dist; dist += this.getPath().getAt(i).distanceFrom(this.getPath().getAt(i - 1)); } if (dist < metres) { return null; } var p1 = this.getPath().getAt(i - 2); var p2 = this.getPath().getAt(i - 1); var m = (metres - olddist) / (dist - olddist); // updated to use the geometry library function return google.maps.geometry.spherical.interpolate(p1, p2, m); } // Define a symbol using SVG path notation, with an opacity of 1. const dashedLine = { path: "M 0,-1 0,1", strokeOpacity: 1, scale: 8, }; var markerCoordinates = [{ lat: 51.17230192226146, lng: 7.005455256203302 }, { lat: 52.017106436819546, lng: 8.903316299753124 }, { lat: 52.1521613855702, lng: 9.972045956234473 }, { lat: 52.12123086563482, lng: 11.627830412053509 }, { lat: 53.6301544474316, lng: 11.415718027446243 }, { lat: 54.08291262244958, lng: 12.191652169789096 }, { lat: 54.3141629859056, lng: 13.097095856304708 } ] // create markers for (i = 0; i < markerCoordinates.length; i++) { marker = new google.maps.Marker({ position: new google.maps.LatLng(markerCoordinates[i]['lat'], markerCoordinates[i]['lng']), map: map, optimized: true, }); } // create polylines const stepsRoute = new google.maps.Polyline({ path: markerCoordinates, geodesic: true, strokeColor: "#c5d899", strokeOpacity: 0.2, icons: [{ icon: dashedLine, offset: "0", repeat: "35px", }, ] }); stepsRoute.setMap(map); var polylineLength = google.maps.geometry.spherical.computeLength(stepsRoute.getPath()); var groupPosition = stepsRoute.GetPointAtDistance(100600); // add marker at position of the group var positionMarker = new google.maps.Marker({ map: map, position: groupPosition, icon: { path: google.maps.SymbolPath.CIRCLE, scale: 10, fillOpacity: 1, strokeWeight: 2, fillColor: '#5384ED', strokeColor: '#ffffff', }, }); var positionMarker = new google.maps.Marker({ map: map, position: groupPosition, }); }; ``` ``` /* * Always set the map height explicitly to define the size of the div element * that contains the map. */ #map { height: 100%; } /* * Optional: Makes the sample page fill the window. */ html, body { height: 100%; margin: 0; padding: 0; } ``` ``` <!DOCTYPE html> <html> <head> <title>Directions Service</title> <script src="https://polyfill.io/v3/polyfill.min.js?features=default"></script> <!-- jsFiddle will insert css and js --> </head> <body> <div id="map"></div> <!-- The `defer` attribute causes the callback to execute after the full HTML document has been parsed. For non-blocking uses, avoiding race conditions, and consistent behavior across browsers, consider loading using Promises with https://www.npmjs.com/package/@googlemaps/js-api-loader. --> <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCkUOdZ5y7hMm0yrcCQoCvLwzdM6M8s5qk&callback=initMap&libraries=geometry" defer></script> </body> </html> ```
null
CC BY-SA 4.0
null
2023-01-26T14:25:30.847
2023-01-26T14:25:30.847
null
null
1,210,329
null
75,247,507
2
null
75,226,120
0
null
The `sign_name_and_signature` widget will load the [xmlDependencies](https://github.com/odoo/odoo/blob/15.0/addons/web/static/src/legacy/js/widgets/name_and_signature.js#L18) files in its `willStart` method, so the template will be ready when the rendering is performed. The template will be loaded just after initializing the widget, you can't use the template inheritance mechanism to alter the template but you can define a new template and inherit the [NameAndSignature](https://github.com/odoo/odoo/blob/15.0/addons/web/static/src/legacy/js/widgets/name_and_signature.js#L16) widget and change the XML dependencies to the new template file path ``` /** @odoo-module alias=MODULE_NAME.signature_dialog **/ import { NameAndSignature } from 'web.name_and_signature'; NameAndSignature.include({ template: 'MODULE_NAME.sign_name_and_signature', xmlDependencies: ['/MODULE_NAME/static/src/xml/sign_name_and_signature.xml'], }); ```
null
CC BY-SA 4.0
null
2023-01-26T14:30:34.880
2023-01-30T09:32:10.157
2023-01-30T09:32:10.157
5,471,709
5,471,709
null
75,247,523
2
null
74,866,692
0
null
I ended up getting on a call with our customer and worked out a simple solution. They were able to add another end point in Azure, and sent me the configuration URL. I just created a second identity provider entry for their other email domain, imported the config, and it worked. In the Keycloak IDP configuration, other than the alias and redirect URI, everything is identical to the other domain configuration. The validating X509 Certificates does have some extra data, but that's it.
null
CC BY-SA 4.0
null
2023-01-26T14:31:46.503
2023-01-26T14:31:46.503
null
null
1,367,798
null
75,247,629
2
null
75,246,946
1
null
Was partway through writing a `tidyverse` answer when other answer was posted, which is an excellent and clear solution. For completeness, if you want to do in tidyverse this could be a helpful start: ``` library(tidyverse) dt |> mutate(names_Y = str_split(names_Y, ", "), names_X = str_split(names_X, ", ")) |> rowwise() |> mutate( count = sum(names_X %in% names_Y), names_match = paste(intersect(names_X, names_Y), collapse = ", ") ) #> # A tibble: 4 Γ— 5 #> # Rowwise: #> group names_X names_Y count names_match #> <chr> <list> <list> <int> <chr> #> 1 A <chr [3]> <chr [2]> 1 "Robert" #> 2 A <chr [3]> <chr [2]> 0 "" #> 3 B <chr [2]> <chr [2]> 2 "Lucy, Macy" #> 4 B <chr [2]> <chr [3]> 1 "Caty" ```
null
CC BY-SA 4.0
null
2023-01-26T14:41:04.817
2023-01-26T14:41:04.817
null
null
10,744,082
null
75,248,051
2
null
44,656,299
1
null
This turned out to be an astonishingly common question and I'd like to add an answer/comment to myself with a suggestion of a - what I now think - much, much better visualisation: . I originally intended to show paired data and visually guide the eye between the two comparisons. The problem with this visualisation is evident: Every subject is visualised . This leads to a quite crowded graphic. Also, the two dimensions of the data (measurement before, and after) are forced into one dimension (y), and the connection by ID is awkwardly forced onto your x axis. The scatter plot naturally represents the ID by only showing one point per subject, but showing both dimensions more naturally on x and y. The only step needed is to make your data wider (yes, this is also sometimes necessary, ggplot not always requires long data). As rightly pointed out by user AllanCameron, another option would be to plot the difference of the paired values directly, for example as a . This is a nice visualisation of the appropriate paired t-test where the mean of the differences is tested against 0. It will require the same data shaping to "wide format". I personally like to show the actual values as well (if there are not too many). ``` library(tidyr) library(dplyr) library(ggplot2) ## first reshape the data wider (one column for each measurement) df %>% pivot_wider(names_from = "measure", values_from = "value", names_prefix = "time_" ) %>% ## now use the new columns for your scatter plot ggplot() + geom_point(aes(time_a, time_b, color = group)) + ## you can add a line of equality to make it even more intuitive geom_abline(intercept = 0, slope = 1, lty = 2, linewidth = .2) + coord_equal() ``` ![](https://i.imgur.com/jntPg72.png) to show differences of paired values ``` df %>% pivot_wider(names_from = "measure", values_from = "value", names_prefix = "time_" ) %>% ggplot(aes(x = "", y = time_a - time_b)) + geom_boxplot() + # optional, if you want to show the actual values geom_point(position = position_jitter(width = .1)) ``` ![](https://i.imgur.com/FgHmDMe.png)
null
CC BY-SA 4.0
null
2023-01-26T15:13:11.383
2023-02-14T08:01:08.123
2023-02-14T08:01:08.123
7,941,188
7,941,188
null
75,248,121
2
null
74,285,946
1
null
This is an issue with the bundled version of `pydev.debugger`. You can fix it by adding `-Xfrozen_modules=off` in the "Interpreter options:" field of the Run/Debug window. [Screenshot](https://user-images.githubusercontent.com/76797/209395685-59224895-92a3-4aa3-8d46-3cee7fbeab64.png) For more background, check out the [GitHub issue](https://github.com/fabioz/PyDev.Debugger/issues/213).
null
CC BY-SA 4.0
null
2023-01-26T15:18:24.193
2023-01-26T15:18:24.193
null
null
496,097
null
75,248,294
2
null
75,248,160
1
null
A "normal" git repository (a "non-bare" one, but feel free to ignore that phrase for now) is basically two parts: - `.git`- (There's also the "staging area" or "cache" which in some sense exists in both of those at the same time, but that's not relevant for this question). When you check out a given commit, git will update the workspace to the version of each file in the latest commit of that branch. I.e. if you check out your `main` branch, then the workspace will contain those files. Similarly when you check out the `Dev` branch, the changes made in that branch will be visible. Note that "which branch is checked out" and "what does the workspace" look like are persistent states that can easily be seen in the file system. In other words: if you use different IDEs or git clients or whatnot to inspect the same git repository, then they will all see the same state. If you switch to the `Dev` branch in VS Code then Spyder will of course see the new branch. If you use Spyder to switch back to the `main` branch, then VS Code will also see that change.
null
CC BY-SA 4.0
null
2023-01-26T15:31:53.303
2023-01-26T15:31:53.303
null
null
40,342
null
75,248,462
2
null
75,248,357
0
null
Increase the z-index of your overlay clas ``` z-index:9999999; ```
null
CC BY-SA 4.0
null
2023-01-26T15:44:34.773
2023-01-26T15:44:34.773
null
null
13,694,051
null
75,248,857
2
null
75,248,775
1
null
You can sort the output array with a custom key function. Here `keyFunc` converts a permutaiton (list of characters) into a single string to perform lexicographic sorting. ``` from pprint import pprint # insert your function here def keyFunc(char_list): return ''.join(char_list) chars = list('dog') permutation = permutations(chars) permutation.sort(key=keyFunc) pprint(permutation) ``` Output: ``` [['d', 'g', 'o'], ['d', 'o', 'g'], ['g', 'd', 'o'], ['g', 'o', 'd'], ['o', 'd', 'g'], ['o', 'g', 'd']] ```
null
CC BY-SA 4.0
null
2023-01-26T16:20:04.137
2023-01-26T16:28:09.703
2023-01-26T16:28:09.703
20,103,413
20,103,413
null
75,248,929
2
null
23,989,232
0
null
One easier way I found is to use ASCII Tree Generator online free tool [https://ascii-tree-generator.com/](https://ascii-tree-generator.com/). Once you create your directory tree with this nice tool, you can paste the tree into your Markdown file surrounded by backticks (```). And here is the result: ``` my-app/ β”œβ”€ node_modules/ β”œβ”€ public/ β”‚ β”œβ”€ favicon.ico β”‚ β”œβ”€ index.html β”‚ β”œβ”€ robots.txt β”œβ”€ src/ β”‚ β”œβ”€ index.css β”‚ β”œβ”€ index.js β”œβ”€ .gitignore β”œβ”€ package.json β”œβ”€ README.md ``` If you need more info about `code` syntax in Markdown, please check out this page [https://www.markdownguide.org/basic-syntax/#code](https://www.markdownguide.org/basic-syntax/#code). Hope that helps !
null
CC BY-SA 4.0
null
2023-01-26T16:25:22.573
2023-01-26T16:25:22.573
null
null
4,925,868
null
75,249,165
2
null
17,639,289
0
null
To solve convex optimization problems in java you can use the following library [https://github.com/erikerlandson/gibbous](https://github.com/erikerlandson/gibbous)
null
CC BY-SA 4.0
null
2023-01-26T16:43:43.847
2023-01-26T16:43:43.847
null
null
590,437
null
75,249,185
2
null
75,249,005
-1
null
The error message "AWS multiple items have the key" typically occurs when you are trying to access an AWS resource, such as an S3 bucket or an EC2 instance, that has multiple items with the same key. This can happen if you have multiple copies of the same resource, or if there are multiple resources with the same name. 1 To resolve this issue, you can try the following steps: 2 Check if you have multiple copies of the same resource. If you do, delete the extra copies. 3 Check if there are multiple resources with the same name. If there are, rename the resources to make them unique. 4 Make sure that your AWS CLI and SDK credentials are set up correctly. Go to the AWS Management Console and check if you are logged in with the right credentials. 5 Check if you have the correct permissions to access the resource. Make sure that your IAM role or user has the necessary permissions to access the resource. 6 Try to access the resource using the AWS CLI or SDK. If you are still getting the error, try to access the resource using the AWS Management Console to see if the issue is with your code or with the resource itself.
null
CC BY-SA 4.0
null
2023-01-26T16:45:49.070
2023-01-26T16:45:49.070
null
null
21,078,573
null
75,249,354
2
null
75,249,141
0
null
There is a good section of this on the matplotlib documentation, and with some modifications you can get something close-ish: [https://matplotlib.org/stable/gallery/lines_bars_and_markers/scatter_hist.html#sphx-glr-gallery-lines-bars-and-markers-scatter-hist-py](https://matplotlib.org/stable/gallery/lines_bars_and_markers/scatter_hist.html#sphx-glr-gallery-lines-bars-and-markers-scatter-hist-py) The main component that I personally think is a great learning point is matplotlib's gridspec. It allows control of where the graphs are located which allows for stronger customization. ``` import numpy as np import matplotlib.pyplot as plt # Fixing random state for reproducibility np.random.seed(19680801) # some random data x = np.random.randn(1000) y = np.random.randn(1000) def scatter_hist(x, y, ax, ax_histx, ax_histy): # no labels ax_histx.tick_params(axis="x", labelbottom=False) ax_histy.tick_params(axis="y", labelleft=False) # the scatter plot: ax.scatter(x, y) # now determine nice limits by hand: binwidth = 0.25 xymax = max(np.max(np.abs(x)), np.max(np.abs(y))) lim = (int(xymax/binwidth) + 1) * binwidth bins = np.arange(-lim, lim + binwidth, binwidth) ax_histx.hist(x, bins=bins) ax_histy.hist(y, bins=bins, orientation='horizontal') # Start with a square Figure. fig = plt.figure(figsize=(6, 6)) # Add a gridspec with two rows and two columns and a ratio of 1 to 4 between # the size of the marginal axes and the main axes in both directions. # Also adjust the subplot parameters for a square plot. gs = fig.add_gridspec(2, 2, width_ratios=(4, 1), height_ratios=(1, 4), left=0.1, right=0.9, bottom=0.1, top=0.9, wspace=0.00, hspace=0.00) # Create the Axes. ax = fig.add_subplot(gs[1, 0]) ax_histx = fig.add_subplot(gs[0, 0], sharex=ax) ax_histy = fig.add_subplot(gs[1, 1], sharey=ax) # Remove Axis Lines ax_histy.spines[['right', 'top', 'bottom']].set_visible(False) ax_histx.spines[['right', 'top', 'left']].set_visible(False) # Remove Ticks ax_histy.set_xticks([]) ax_histx.set_yticks([]) # Draw the scatter plot and marginals. scatter_hist(x, y, ax, ax_histx, ax_histy) ``` [](https://i.stack.imgur.com/Kr1Gd.png)
null
CC BY-SA 4.0
null
2023-01-26T16:59:06.267
2023-01-26T17:05:42.083
2023-01-26T17:05:42.083
10,508,988
10,508,988
null
75,249,494
2
null
75,249,403
0
null
As the images are arrays, if we have the image in np.Array format, we can index the rows and columns and then calculate the maximum and minimum value of the crop. EDIT: to select the last 50 columns, use the indexer [-50:] on colum index as follows: ``` import cv2 import numpy as np image = cv2.cvtColor(cv2.imread("image/path"), cv2.COLOR_BGR2RGB) crop = image[:, -50:, :] print(np.max(crop), np.min(crop)) ```
null
CC BY-SA 4.0
null
2023-01-26T17:10:13.077
2023-01-28T00:28:54.477
2023-01-28T00:28:54.477
17,901,307
17,901,307
null
75,249,624
2
null
75,246,762
1
null
A list comprehension version of your loop: ``` In [15]: np.array([func(h,n) for n in nos]) Out[15]: array([-0.74378734-1.45446975j, -0.94989022+3.54991188j, 5.45190245+2.16854975j, 2.91801616-4.28579526j]) ``` `vectorize` - excluding the first argument (by position, not name), and scalar iteration on second. ``` In [16]: f=np.vectorize(func, excluded=[0]) In [17]: f(h,nos) Out[17]: array([-0.74378734-1.45446975j, -0.94989022+3.54991188j, 5.45190245+2.16854975j, 2.91801616-4.28579526j]) ``` No need to use `signature`. With true numpy vectorization (not the pseudo `np.vectorize`): ``` In [23]: np.sum(h * np.exp(-1j * nos[:,None] * np.arange(len(h))), axis=1) Out[23]: array([-0.74378734-1.45446975j, -0.94989022+3.54991188j, 5.45190245+2.16854975j, 2.91801616-4.28579526j]) ```
null
CC BY-SA 4.0
null
2023-01-26T17:22:58.583
2023-01-26T17:22:58.583
null
null
901,925
null
75,249,946
2
null
75,153,839
0
null
-
null
CC BY-SA 4.0
null
2023-01-26T17:57:02.497
2023-01-26T17:57:02.497
null
null
20,296,770
null
75,250,469
2
null
75,250,038
0
null
From what I read, the width of a column is by default the width of its widest element; in your case, the culprit is the logo with its width of 100 that makes column 1 wider than it should be. To fix this, just add a columnspan of 2 in your logo placement (in addition, the logo will be nicely centered): ``` ... canvas.create_image(100, 100, image=img_lock) canvas.grid(column=1, row=0, columnspan=2) ... ```
null
CC BY-SA 4.0
null
2023-01-26T18:53:46.040
2023-01-26T18:53:46.040
null
null
20,267,366
null
75,250,608
2
null
75,248,775
0
null
Here's a way to order the permutations differently: for each item in the input array, take it out of the array, find all permutations of the remaining subarray, then prepend this item to each permutation of this subarray. This has the effect of placing permutations with similar prefixes together. ``` from pprint import pprint def permutations2(chars): if len(chars) <= 1: return [chars] all_perms = [] for idx, char in enumerate(chars): subarr = chars[:idx] + chars[idx+1:] subperms = permutations2(subarr) for subperm in subperms: new_perm = [char] + subperm all_perms.append(new_perm) return all_perms chars = list('dog') pprint(permutations2(chars)) ``` Result: ``` [['d', 'o', 'g'], ['d', 'g', 'o'], ['o', 'd', 'g'], ['o', 'g', 'd'], ['g', 'd', 'o'], ['g', 'o', 'd']] ```
null
CC BY-SA 4.0
null
2023-01-26T19:06:36.867
2023-01-26T19:06:36.867
null
null
20,103,413
null
75,250,725
2
null
75,234,831
1
null
I think that you're overcomplicating things. Computed properties are used when you need to combine multiple reactive properties. In this case it would be the message output on selected plan + period. Here is a [working example in CodeSandbox](https://codesandbox.io/p/sandbox/great-banzai-lhhns0?file=%2Fsrc%2FApp.vue&selection=%5B%7B%22endColumn%22%3A9%2C%22endLineNumber%22%3A15%2C%22startColumn%22%3A9%2C%22startLineNumber%22%3A15%7D%5D). Also, you are not using conditional rendering properly, which may be why your data isn't updating correctly. ``` v-if="logical expression" v-else-if="logical expression" v-else ``` References: - [Computed properties](https://vuejs.org/guide/essentials/computed.html)- [Conditional rendering](https://vuejs.org/guide/essentials/conditional.html)
null
CC BY-SA 4.0
null
2023-01-26T19:18:45.537
2023-01-26T19:18:45.537
null
null
19,656,174
null
75,250,856
2
null
20,041,136
0
null
As other answers have pointed out, ggplot wants you to specify a variable as a factor if you don't want it to presume the order to display things in. Using the `readr` library is the easiest way to do this if you're working with data that has already been ordered. Instead of the `read.table` function, use `read_table` and as part of the `col_types` argument, specify the column with the labels (`V1` in this case) as a factor. For small datasets like this a simple format string is often the easiest way ``` dat <- read_table("http://dpaste.com/1469904/plain/", col_types = "fd") ``` The string `"fd"` tells `read_table` that the first column is a factor and the second column is a double. The help file for the function includes a character mapping for other types of data.
null
CC BY-SA 4.0
null
2023-01-26T19:35:58.100
2023-01-26T19:35:58.100
null
null
1,155,632
null
75,251,252
2
null
30,074,085
0
null
[](https://i.stack.imgur.com/uEK2Z.png)
null
CC BY-SA 4.0
null
2023-01-26T20:22:24.747
2023-01-27T14:27:16.827
2023-01-27T14:27:16.827
11,102,299
11,102,299
null
75,251,300
2
null
75,232,914
0
null
Thanks to the comments. I looked into the webGL Renderer parameters and figured out the issue. It has to do with the precision shader parameter. From the Threejs documentation: precision - Shader precision. Can be "highp", "mediump" or "lowp". Defaults to "highp" if supported by the device. Some devices, if not specified in the WebGL class, will set it to lowp. Specifying high hp fixed the issue.
null
CC BY-SA 4.0
null
2023-01-26T20:27:52.607
2023-01-26T20:28:07.243
2023-01-26T20:28:07.243
20,692,441
20,692,441
null
75,251,577
2
null
23,609,291
0
null
``` <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item><layer-list> <item> <shape> <solid android:color="@color/white"> </solid> <corners android:radius="3dp" /> <padding android:bottom="10dp" android:left="10dp" android:right="10dp" android:top="10dp" /> </shape> </item> <item android:drawable="@drawable/arrow_drop_down_icon" android:gravity="center_vertical|right"/> </layer-list></item> </selector> [![Spinner Image][1]][1] [1]: https://i.stack.imgur.com/GD3T5.png ```
null
CC BY-SA 4.0
null
2023-01-26T21:01:26.197
2023-01-26T21:01:26.197
null
null
15,614,129
null
75,251,690
2
null
71,525,774
0
null
I faced a similar issue. I was working on my reports, closed VS2022 and trying to re-open the project, it was shown as "incompatible". Go to Extensions -> Manage Extension -> Installed In my case the 'Microsoft Reporting Services Projects' was disabled. Re-enable it, then close and re-open VS2022. If the project is still shown as "incompatible", reload it and it should solve the issue.
null
CC BY-SA 4.0
null
2023-01-26T21:12:45.157
2023-01-26T21:12:45.157
null
null
18,079,562
null
75,251,756
2
null
75,250,454
0
null
You’ll need to implement some code to turn on the leds in the loop like: digitalWrite(pinNumber, HIGH)
null
CC BY-SA 4.0
null
2023-01-26T21:20:07.057
2023-01-26T21:20:32.410
2023-01-26T21:20:32.410
21,089,480
21,089,480
null
75,251,897
2
null
75,234,512
1
null
Not exactly what you are looking for, but consider another possibility. You can put Unicode characters in the menu label. For example, you can use [](https://www.fileformat.info/info/unicode/char/1f4be/index.htm) for the Save All menu label, and [](https://www.fileformat.info/info/unicode/char/1f5d8/index.htm) for the Reload All from Disk menu label. The trick is finding an appropriate image for other menu labels which can require a bit of creativity.
null
CC BY-SA 4.0
null
2023-01-26T21:39:18.257
2023-01-26T21:39:18.257
null
null
95,014
null
75,252,018
2
null
230,831
0
null
A height balanced tree is many ways best! For every subtree, it has children of heights that differ by 1 or 0, where no children is a height of zero, so a leaf has height 1. It is the simplest balanced tree, with the lowest overhead to balance: a maximum of 2n rotations for an insert or delete in a tree area of height n, and often much less. A rotation is writing 3 pointers, and so is very cheap. The worst case of the height balanced tree, even though of about 42% greater maximum height, is about one comparison less efficient than a perfectly balanced full binary tree of 2^n-1 values. A perfectly balanced full binary tree is far more expensive to achieve, tends to need, on average, n-1 comparisons for a find and exactly n comparisons always for a not-found. For the tree worst case insertion order, ordered data, when 2^n-1 items are inserted, the height balanced tree that results is a perfectly balanced full binary tree! (Rotation is a great way to balance, but comes with a catch: if the heavy grandchild is on the inside of the heavy child, a single rotate just moves it to the inside of the opposite side, with no improvement. So, if it is 1 unit higher, even though nominally balanced, you rotate that child to lighten it first. Hence a max of 2n rotations for an n level insert or delete, worst case and unlikely.)
null
CC BY-SA 4.0
null
2023-01-26T21:53:14.267
2023-01-26T21:58:36.097
2023-01-26T21:58:36.097
10,012,796
10,012,796
null
75,252,152
2
null
75,251,155
1
null
You get the lines because you have missing values. The full range is not represented in your data. Here's one way to fill in the missing values using `tidyr` ``` library(dplyr) library(tidyr) full_range <- function(x) seq(min(x), max(x)) data %>% as.data.frame() %>% tibble::rownames_to_column("Var1") %>% pivot_longer(-Var1, names_to="Var2") %>% mutate(across(Var1:Var2, as.numeric)) %>% { d <- . expand_grid(Var1=full_range(d$Var1), Var2=full_range(d$Var2)) %>% left_join(d) %>% replace_na(list(value=0)) } %>% ggplot() + theme_bw() + geom_tile(aes(x = Var1, y = Var2, fill = value)) + scale_fill_viridis_c(name = "") + labs(x = "k2", y = "k1") ``` that looks like this [](https://i.stack.imgur.com/0r1hX.png)
null
CC BY-SA 4.0
null
2023-01-26T22:06:59.660
2023-01-26T22:06:59.660
null
null
2,372,064
null
75,252,217
2
null
20,188,229
0
null
Before initiating the command "git add file.txt", enter: > echo file > file.txt Then initiate the command: > git add file.txt This worked for me.
null
CC BY-SA 4.0
null
2023-01-26T22:18:30.190
2023-01-26T22:18:30.190
null
null
17,361,990
null
75,252,255
2
null
14,529,009
0
null
Just to also mention the font size of the "[render preview](https://blog.jetbrains.com/idea/2020/03/intellij-idea-2020-1-eap8/#in_editor_javadocs_rendering)", which displays comments as formatted text. Unfortunately this is not affected by the global font size. But it's possible to change it with the of the rendered comment: ![screenshot](https://blog.jetbrains.com/wp-content/uploads/2020/03/idea-adjust_font_size.png) An issue is to enhance the font change to "Make rendered JavaDoc font size bigger/smaller when zooming in/out on code" is already opened: [IDEA-238153](https://youtrack.jetbrains.com/issue/IDEA-238153/Make-rendered-JavaDoc-font-size-bigger-smaller-when-zooming-in-out-on-code)
null
CC BY-SA 4.0
null
2023-01-26T22:23:22.177
2023-01-26T22:23:22.177
null
null
4,198,170
null
75,252,271
2
null
68,719,842
0
null
You can use regular expressions to get the year number, which is usually 4 digits. but findall() will return years like this: `[1998]`,`[2001]`. You can apply the lambda function to unsqueeze your data. ``` df=pd.DataFrame({"t":["te,1723(hd k)","683, 7939(jod ls)"]}) df["year"]= df["t"].str.findall("\d{4}").apply(lambda x: x[0]) ``` [](https://i.stack.imgur.com/xVPZE.png)
null
CC BY-SA 4.0
null
2023-01-26T22:25:12.083
2023-01-26T22:25:12.083
null
null
7,583,614
null
75,252,363
2
null
75,252,198
0
null
This simplified example shows how you could use groupby - ``` import pandas as pd df = pd.DataFrame({'country': ['Nigeria', 'Nigeria', 'Nigeria', 'Mali'], 'year': [2000, 2000, 2001, 2000], 'events1': [ 3, 4, 5, 2], 'events2': [1, 6, 3, 4] }) df2 = df.groupby(['country', 'year'])[['events1', 'events2']].sum() print(df2) ``` which gives the total of each type of event by country and by year ``` events1 events2 country year Mali 2000 2 4 Nigeria 2000 7 7 2001 5 3 ```
null
CC BY-SA 4.0
null
2023-01-26T22:39:05.457
2023-01-27T00:18:34.390
2023-01-27T00:18:34.390
19,077,881
19,077,881
null
75,252,366
2
null
75,252,156
3
null
For your first question. The issue is that last obs. in `df1` for year 2019 is December 1st, hence that's the max. value displayed on the x axis for this panel. In contrast for your df1 it's December 31st. As a consequence the axis labels overlap and the lines do not connect. Actually the lines do not connect either in your second plot. It only looks like this. One fix for both issues would be to add a helper observation to your df dataset which extends the scale and at the same time "connects" the line to the year 2020: Note: While adding spaces might work an alternative approach to shift your labels would be to adjust the horizontal alignment. ``` library(tidyverse) df <- add_row(df, date = as.Date("2019-12-31"), year = 2019, month = "Dec", sales = 100) ggplot(df, aes(x = date, y = sales)) + geom_line() + scale_x_date( date_labels = "%b", date_breaks = "month", expand = c(0, 0) ) + facet_grid(~ year(date), space = "free_x", scales = "free_x", switch = "x") + theme_bw() + theme( strip.placement = "outside", strip.background = element_rect(fill = NA, colour = "grey50"), panel.spacing = unit(0, "lines"), axis.line = element_line(colour = "black"), panel.grid.major = element_blank(), panel.grid.minor = element_blank(), panel.border = element_blank(), panel.background = element_blank(), panel.margin.x = unit(0, "cm"), axis.text.x = element_text(hjust = -.1) ) ``` [](https://i.stack.imgur.com/FS7qL.png) For your second question. To get rid of the border and the line between years set the color for the strip background to NA: ``` ggplot(df1, aes(Date, value)) + geom_line() + scale_x_date( date_labels = "%b", date_breaks = "month", expand = c(0, 0) ) + facet_grid(~ year(Date), space = "free_x", scales = "free_x", switch = "x") + theme_bw() + theme( strip.placement = "outside", strip.background = element_rect(fill = NA, colour = NA), panel.spacing = unit(0, "cm"), axis.line = element_line(colour = "black"), panel.grid.major = element_blank(), panel.grid.minor = element_blank(), panel.border = element_blank(), panel.background = element_blank(), axis.text.x = element_text(hjust = -.1) ) ``` [](https://i.stack.imgur.com/Q17lK.png)
null
CC BY-SA 4.0
null
2023-01-26T22:39:25.307
2023-01-26T22:47:54.373
2023-01-26T22:47:54.373
12,993,861
12,993,861
null
75,252,641
2
null
75,252,577
1
null
Perhaps like this ..., i.e. simply switch the order of `fill` and `alpha` to change the grouping: ``` library(tibble) library(ggplot2) set.seed(1) tibble( y = runif(20), x = letters[rep(1:2, times = 10)], f = factor(LETTERS[rep(1:2, each = 10)], levels = LETTERS[1:2], ordered = TRUE), a = factor(rep(1:5, times = 4), levels = 1:5, ordered = TRUE) ) %>% ggplot(aes(x, y, alpha = a, fill = f)) + geom_col(position = position_dodge2(1)) + scale_alpha_discrete(range = c(.5, 1)) #> Warning: Using alpha for a discrete variable is not advised. ``` ![](https://i.imgur.com/YbD1S73.png)
null
CC BY-SA 4.0
null
2023-01-26T23:20:13.517
2023-01-26T23:20:13.517
null
null
12,993,861
null
75,252,895
2
null
75,221,358
0
null
Rather than potentially messing with the edit page, have you considered using a simple screen Flow and an action to achieve this? For example, an action to 'Edit Rent Details' added to the page header, and then when clicked it presents the individual fields on a screen flow for editing? Once saved, the page would refresh and update the formula field as required.
null
CC BY-SA 4.0
null
2023-01-27T00:09:26.533
2023-01-27T00:09:26.533
null
null
1,517,566
null
75,252,974
2
null
11,964,466
0
null
I know it can be trivial, but be sure to have libtool-dev installed, too: ``` sudo apt-get install libtool sudo apt-get install libtool-dev ```
null
CC BY-SA 4.0
null
2023-01-27T00:22:56.853
2023-01-27T00:22:56.853
null
null
15,030,204
null
75,252,962
2
null
50,547,730
1
null
The idea here is the `label` element which can create amazing things. Playing with it can generate you a bunch of great effects. You just need to hide the radios or checkboxes and work with its labels, and you need to know three important `css selectors` for this effect: 1. The general next sibling: element ~ sibling{ style } which select all the sibling found after the element 2. The direct next sibling: element + sibling{ style } which select only the first sibling after the element 3. The checked input selector: input:checked{ style } which selects the input if it's checked only. --- And this effect can be done with these steps: - `input``label`- `input``label``for``id`- `display: none`- - `input:checked + lebel{ style }` --- Now we can apply it: ``` nav{ width: fit-content; border: 1px solid #666; border-radius: 4px; overflow: hidden; display: flex; flex-direction: row; flex-wrap: no-wrap; } nav input{ display: none; } nav label{ font-family: sans-serif; padding: 10px 16px; border-right: 1px solid #ccc; cursor: pointer; transition: all 0.3s; } nav label:last-of-type{ border-right: 0; } nav label:hover{ background: #eee; } nav input:checked + label{ background: #becbff; } ``` ``` <nav> <input type="radio" id="x1" name="x"/> <label for="x1">Choice 1</label> <input type="radio" id="x2" name="x"/> <label for="x2">Choice 2</label> <input type="radio" id="x3" name="x"/> <label for="x3">Choice 3</label> <input type="radio" id="x4" name="x"/> <label for="x4">Choice 4</label> <!-- as many choices as you like --> </nav> ``` And it's done now. --- You can search for many many ideas on `codepen` and you can see this great navigation bar using only `css` and navigates throw the different pages: [Nav Bar Using Only CSS](https://codepen.io/ahmdmznaty/pen/bGLmNQJ) Or See this collapsed nav bar that can be opened or closed using only css too: [Open & Close Nav Bar Using CSS](https://codepen.io/ahmdmznaty/pen/rNJqKxj?editors=1100)
null
CC BY-SA 4.0
null
2023-01-27T00:21:06.787
2023-01-27T00:21:06.787
null
null
20,708,566
null
75,252,975
2
null
15,215,326
0
null
Using fragments of the idea from @David Celi, I create my own solution. This is my solution. I hope it help. Thanks for @David Celi ``` private static class ConsolePanel { public static void main(String[] args) { fullPanel(21, 5, 3, 3, "myTitcccle", "myBoxxxdy", "myBvvy2", "myBvvy2" ); } public static void simplePanel( int scale, int margin, int upSpace, int downSpace, String... titleAndOthers) { fullPanel( 21, 5, 1, 1, titleAndOthers ); } public static void simplePanelWithSize( int scale, int margin, int upSpace, int downSpace, String... titleAndOthers) { fullPanel( scale, 5, 1, 1, titleAndOthers ); } public static void fullPanel( int scale, int margin, int upSpace, int downSpace, String... titleAndOthers) { var marginLimitedBySize = Math.min(margin, scale); // scale + margin discrepacies eliminated if (marginLimitedBySize % 2 != 0) -- marginLimitedBySize; if (scale % 2 != 0) ++ scale; int fullSize = (scale * 2) - marginLimitedBySize; if (fullSize % 2 == 0) ++ fullSize; else -- fullSize; var internalTextSpace = String.valueOf(fullSize); var marginAsString = " ".repeat(marginLimitedBySize); var upperSpace = "\n".repeat(upSpace); var lowerSpace = "\n".repeat(downSpace); var baseline = "_".repeat(scale) .replace('_', myFont.BASE_LINE.code); var divider = "_".repeat(scale) .replace('_', myFont.BASE_LINE_BOLD.code); var upperLineString = myFont.UPPER_LEFT_CORNER.code + baseline + myFont.MIDDLE_CENTER.code + baseline + myFont.UPPER_RIGHT_CORNER.code + "\n"; var middleLineString = myFont.MIDDLE_LEFT.code + divider + myFont.MIDDLE_CENTER.code + divider + myFont.MIDDLE_RIGHT.code + "\n"; var bottonLineString = myFont.LOWER_LEFT_CORNER.code + baseline + myFont.MIDDLE_CENTER.code + baseline + myFont.LOWER_RIGHT_CORNER.code + "\n"; var textBuilder = new StringBuilder(); textBuilder .append(upperSpace) .append(upperLineString) .append(myFont.MIDDLE_FACE.code ) .append("%s%%-%ss".formatted(marginAsString, internalTextSpace)) .append(myFont.MIDDLE_FACE.code ) .append("\n" ) .append(middleLineString) ; // "-1" Because the first element in the Array was used as title for (int i = titleAndOthers.length - 1; i > 0; i--) textBuilder.append( simpleLineStyle( "|%s%%-%ss|\n".formatted(marginAsString, internalTextSpace))); textBuilder .append(bottonLineString) .append(lowerSpace); System.out.printf(textBuilder.toString(), (Object[]) titleAndOthers); } private enum myFont { MIDDLE_CENTER('\u2501'), BASE_LINE('\u2500'), BASE_LINE_BOLD('\u2501'), UPPER_LEFT_CORNER('\u250F'), UPPER_RIGHT_CORNER('\u2513'), MIDDLE_LEFT('\u2523'), MIDDLE_RIGHT('\u252B'), MIDDLE_FACE('\u2502'), LOWER_LEFT_CORNER('\u2517'), LOWER_RIGHT_CORNER('\u251B'); private final char code; myFont(char code) { this.code = code; } } ``` }
null
CC BY-SA 4.0
null
2023-01-27T00:23:02.240
2023-01-27T00:23:02.240
null
null
7,681,696
null
75,253,083
2
null
26,838,005
0
null
if it is a continuous scale use ``` scale_x_continuous(position = "top") + ``` if it is a discrete scale use ``` scale_x_discrete(position = "top") + ```
null
CC BY-SA 4.0
null
2023-01-27T00:43:45.087
2023-01-27T00:43:45.087
null
null
21,090,269
null
75,254,065
2
null
18,394,433
0
null
There are several step to you have check, 1. check the rewrite_module enable, if it is disabled enable it. you can check whether the module is enabled or not run this code creating a PHP file > ``` <?php print_r(apache_get_modules()); ?> ``` if you got more details without error, it seems already enabled 1. if you using existing project, Go to Prestashop and again create new another key and try again,
null
CC BY-SA 4.0
null
2023-01-27T04:23:56.060
2023-01-27T04:23:56.060
null
null
12,039,811
null
75,254,350
2
null
75,254,017
0
null
When the system has a globally installed CRA (create-react-app) and we try to create a new app with `npx` it fails due to the conflict. In order to fix this, we need to remove the global installation and then use `npx` to install a new app. We can uninstall with: ``` sudo npm uninstall -g create-react-app ``` and then clear the `npx` cache ``` npx clear-npx-cache ``` There is an error with the command to create react app, the following is the correct one: ``` npx create-react-app my-app --template typescript ```
null
CC BY-SA 4.0
null
2023-01-27T05:21:24.883
2023-01-27T05:21:24.883
null
null
10,162,015
null
75,254,356
2
null
20,875,823
0
null
For future readers:- iOS 13, Swift 5 I set initial view controller programmatically from , I got this as warning and the view controller is set perfectly. So I delete from and the warning is gone forever. > Info.plist > Application Scene Manifest > Scene Configuration > Application Session Role > Storyboard Name > Delete this one
null
CC BY-SA 4.0
null
2023-01-27T05:22:28.697
2023-01-27T05:22:28.697
null
null
6,666,942
null
75,254,455
2
null
75,254,017
1
null
## Installation To start a new Create React App project with TypeScript, you can run: ``` npx create-react-app my-app --template typescript ``` or ``` yarn create react-app my-app --template typescript ``` > If you've previously installed create-react-app globally via `npm install -g create-react-app`, we recommend you uninstall the package using `npm uninstall -g create-react-app` or `yarn global remove create-react-app` to ensure that `npx` always uses the `latest version`.Global installs of create-react-app are no longer supported. ## Troubleshooting If your project is not created with TypeScript enabled, npx may be using a cached version of create-react-app. Remove previously installed versions with `npm uninstall -g create-react-app` or `yarn global remove create-react-app` (see [#6119](https://github.com/facebook/create-react-app/issues/6119#issuecomment-451614035)). If you are currently using [create-react-app-typescript](https://github.com/wmonk/create-react-app-typescript/), see [this blog post](https://vincenttunru.com/migrate-create-react-app-typescript-to-create-react-app/) for instructions on how to migrate to Create React App. Constant enums and namespaces are not supported, you can learn about the constraints of [using Babel with TypeScript here.](https://babeljs.io/docs/en/babel-plugin-transform-typescript#caveats) See [here](https://create-react-app.dev/docs/adding-typescript/) for full details: [https://create-react-app.dev/docs/adding-typescript/](https://create-react-app.dev/docs/adding-typescript/)
null
CC BY-SA 4.0
null
2023-01-27T05:39:40.267
2023-01-27T05:39:40.267
null
null
20,851,740
null
75,254,633
2
null
15,812,984
0
null
[[NSArray alloc] initWithObjects:@"Leaderboard", nil];
null
CC BY-SA 4.0
null
2023-01-27T06:12:25.603
2023-01-27T06:12:25.603
null
null
11,412,421
null
75,254,783
2
null
75,249,403
0
null
You can do the following: ``` bb = img[:,-50:, :] # gets the red bouding box max_value = bb.max() min_value = bb.min() ```
null
CC BY-SA 4.0
null
2023-01-27T06:37:52.033
2023-01-27T06:37:52.033
null
null
5,462,372
null
75,254,815
2
null
75,254,773
0
null
No semicolon after `if else` or other keywords of the nature. ``` if (oper == "+") { int ans = int1 + int2; Console.WriteLine("Answer = " + ans); } else if (oper == "-") { int ans = int1 - int2; Console.WriteLine("Answer = " + ans); } else if (oper == "*") { int ans = int1 * int2; Console.WriteLine("Answer = " + ans); } else if (oper == "/") { int ans = int1 / int2; Console.WriteLine("Answer = " + ans); } else { Console.WriteLine("Error."); } ```
null
CC BY-SA 4.0
null
2023-01-27T06:43:48.367
2023-01-27T09:28:39.867
2023-01-27T09:28:39.867
982,149
18,122,876
null
75,254,926
2
null
75,254,614
0
null
here is the exact coding , I used in my project, it might help u... change according to your design.. ``` class HomeScreen_Coffee extends StatefulWidget { const HomeScreen_Coffee({Key? key}) : super(key: key); @override State<HomeScreen_Coffee> createState() => _HomeScreen_CoffeeState(); } class _HomeScreen_CoffeeState extends State<HomeScreen_Coffee> { List<String> titles=['All','Fav','Popular','Trending' ]; int selectedindex=0; @override Widget build(BuildContext context) { return Scaffold( body: Container( height: 40, child: ListView.builder( scrollDirection: Axis.horizontal, itemCount: titles.length, itemBuilder: (context,index){ return CoffeeTile(name: titles[index], ontap: (){ selectedindex=index; setState(() { }); },isselected: selectedindex==index,); }), ), )); } } ``` ``` class CoffeeTile extends StatelessWidget { final String name; final bool isselected; final VoidCallback ontap; const CoffeeTile({Key? key,required this.name,this.isselected=false,required this.ontap}) : super(key: key); @override Widget build(BuildContext context) { return Padding( padding: const EdgeInsets.only(left: 12.0), child: GestureDetector( onTap: ontap, child: Container( decoration: BoxDecoration( color: Colors.white12, borderRadius: BorderRadius.circular(20), ), padding: EdgeInsets.symmetric(horizontal: 20), child: Center( child: Text(name.toString(),style: TextStyle( fontSize: 18,color: isselected?Colors.orange:Colors.grey,fontWeight: FontWeight.bold ),), ), ), ), ); } } ```
null
CC BY-SA 4.0
null
2023-01-27T07:01:06.500
2023-01-27T07:01:06.500
null
null
18,817,235
null
75,255,003
2
null
75,253,728
1
null
You are treating a as if it was a instead of ``` aimargetInstantiate.transform.position = cameraHolderObj.transform.forward * 10; ``` you rather want to use ``` aimargetInstantiate.transform.position = cameraHolderObj.transform.position + cameraHolderObj.transform.forward * 10; ``` --- Btw side note: To make your code a bit shorter and easier to maintain you can use ``` aimLayerAnimator.SetBool("IsAiming", isAiming); ``` and same in ``` isAiming = Input.GetKey(aimingKey); ``` ;)
null
CC BY-SA 4.0
null
2023-01-27T07:11:33.010
2023-01-27T07:11:33.010
null
null
7,111,561
null
75,255,067
2
null
75,254,614
0
null
[](https://i.stack.imgur.com/thbzj.png) define variable for selected Index. ``` int selectedIndex = 0; ``` Just Put in your widget ``` SizedBox( height: 40, child: ListView.builder( itemCount: 20, scrollDirection: Axis.horizontal, shrinkWrap: true, physics: BouncingScrollPhysics(), itemBuilder: (context, index) { return InkWell( onTap: () { selectedIndex = index; setState(() {}); }, child: Container( margin: EdgeInsets.symmetric(horizontal: 5), decoration: BoxDecoration( color: selectedIndex == index ? Colors.blueAccent.shade100 : Colors.white, borderRadius: BorderRadius.circular(30), ), padding: EdgeInsets.symmetric(vertical: selectedIndex == index ? 12 : 10, horizontal: selectedIndex == index ? 18 : 15), child: Text("Text $index", style: TextStyle(color: selectedIndex == index ? Colors.white : Colors.grey, fontSize: selectedIndex == index ? 15 : 12)), ), ); }, ), ) ```
null
CC BY-SA 4.0
null
2023-01-27T07:17:58.520
2023-01-27T07:17:58.520
null
null
20,853,233
null
75,255,111
2
null
75,252,909
0
null
Yeah, I couldn't able to see Microsoft Service bus api permissions as below: ![enter image description here](https://i.imgur.com/63BQqV5.png) But check the similar functionality by giving `azure service bus data owner` role which has the similar functionality using below process: Firstly, go to your Resource group and then click on Access Control: ![enter image description here](https://i.imgur.com/KvWTcP4.png) Next click on Add+: ![enter image description here](https://i.imgur.com/svKINzy.png) Then type Service Bus: ![enter image description here](https://i.imgur.com/hITgySi.png) Then Select your required App Registration and then click on select: ![enter image description here](https://i.imgur.com/Q0glVy8.png) Now Click ON Access Control and check you have got your required permission On Service Bus: ![enter image description here](https://i.imgur.com/5m8FSue.png) Now click on it: ![enter image description here](https://i.imgur.com/sGBRjrz.png) If you your access is denied adding role assignment, then you need to ask you admin to provide you the access. And also check [reference](https://learn.microsoft.com/en-us/azure/service-bus-messaging/disable-local-authentication).
null
CC BY-SA 4.0
null
2023-01-27T07:23:31.723
2023-01-27T12:27:47.317
2023-01-27T12:27:47.317
17,623,802
17,623,802
null
75,255,121
2
null
75,234,512
0
null
It's complex to add icons to menu items. Here, add icons to menu items one by one by tkinter code. ``` import PySimpleGUI as sg sg.theme('LightGreen') menu_def = [ ['&File', ['&Open Ctrl-O', '&Save Ctrl-S', '&Properties', 'E&xit']], ['&Edit', ['&Paste', ['Special', 'Normal', ], 'Undo', 'Options::this_is_a_menu_key'], ], ['&Toolbar', ['---', 'Command &1', 'Command &2', '---', 'Command &3', 'Command &4']], ['&Help', ['&About...']] ] layout = [ [sg.Menu(menu_def, key='-MENUBAR-')], [sg.Output(size=(60, 10))], ] window = sg.Window("Title", layout, finalize=True) images = [] # Menu 1 - File for i in range(4): image = sg.tk.PhotoImage(data=sg.EMOJI_BASE64_HAPPY_LIST[0:4][i]) images.append(image) window['-MENUBAR-'].widget.children['!menu'].entryconfigure(i, image=image, compound='left') # Menu 2 - Edit for i in range(3): image = sg.tk.PhotoImage(data=sg.EMOJI_BASE64_HAPPY_LIST[4:7][i]) images.append(image) window['-MENUBAR-'].widget.children['!menu2'].entryconfigure(i, image=image, compound='left') # Menu 2 - Edit - Paste for i in range(2): image = sg.tk.PhotoImage(data=sg.EMOJI_BASE64_HAPPY_LIST[7:9][i]) images.append(image) window['-MENUBAR-'].widget.children['!menu2'].children['!menu'].entryconfigure(i, image=image, compound='left') # Menu 3 - Toolbar for i, j in enumerate((1, 2, 4, 5)): image = sg.tk.PhotoImage(data=sg.EMOJI_BASE64_HAPPY_LIST[9:13][i]) images.append(image) window['-MENUBAR-'].widget.children['!menu3'].entryconfigure(j, image=image, compound='left') # Menu 4 - Help for i in range(1): image = sg.tk.PhotoImage(data=sg.EMOJI_BASE64_HAPPY_LIST[13]) images.append(image) window['-MENUBAR-'].widget.children['!menu4'].entryconfigure(i, image=image, compound='left') while True: event, values = window.read() if event in (sg.WIN_CLOSED, 'Exit'): break print(event, values) window.close() ``` [](https://i.stack.imgur.com/b5cqO.png)
null
CC BY-SA 4.0
null
2023-01-27T07:24:39.490
2023-01-27T07:24:39.490
null
null
11,936,135
null
75,255,379
2
null
70,511,031
2
null
``` df = df.rename(columns={'id_prod': 'no_sales', 'price': 'revenue'}, level=0) ``` The `level=0` indicates where in the multi-index the keys to be renamed can be found.
null
CC BY-SA 4.0
null
2023-01-27T08:02:19.350
2023-01-27T08:02:19.350
null
null
3,473,186
null
75,255,837
2
null
43,424,597
0
null
In nested DIVs I had very strange layout distortions in most browsers. I solved it by adding: ``` .myDivClass { box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; width: (..original with + border-width); height: (..original height+ border-height); } ``` This sets the border of the Div INSIDE. Dont forget to add the now missing pixels to width and height of the DIV. Solved the problem, no layout messing up anymore... :)
null
CC BY-SA 4.0
null
2023-01-27T08:53:07.520
2023-01-27T08:53:07.520
null
null
21,092,103
null
75,255,957
2
null
75,255,834
0
null
`For Each cell In rng` already loops trough specific cell, no need to specify later `Range("a1")`. Furthermore, you are looping only trough A1, I think yoi mean `cell` Also, `Range("b:b").NumberFormat` will change the format of the column. I think you want `cell.Offset(0,1).NumberFormat` or `Range("B" & cell.row)` Probably you want something like this: ``` Sub LoopRange() Dim rng As Range Dim cell As Range Set rng = Range("A1:A100") For Each cell In rng If cell.Value = "IDR" Then cell.Offset(0, 1).NumberFormat = "#,##0" ElseIf cell.Value = "JPY" Then cell.Offset(0, 1).NumberFormat = "#,##0.00" Else cell.Offset(0, 1).NumberFormat = "#,##0.0000" End If Next cell Set rng = Nothing End Sub ```
null
CC BY-SA 4.0
null
2023-01-27T09:06:11.153
2023-01-27T09:06:11.153
null
null
9,199,828
null
75,255,997
2
null
75,254,614
1
null
Ok, writing Chips with Containers like other answers suggest is not necessary. Because you actually have chips widgets in Flutter. Please check them out, they are well documented and have examples provided. [https://api.flutter.dev/flutter/material/FilterChip-class.html](https://api.flutter.dev/flutter/material/FilterChip-class.html) [https://api.flutter.dev/flutter/material/ChoiceChip-class.html](https://api.flutter.dev/flutter/material/ChoiceChip-class.html) [https://api.flutter.dev/flutter/material/InputChip-class.html](https://api.flutter.dev/flutter/material/InputChip-class.html)
null
CC BY-SA 4.0
null
2023-01-27T09:09:48.373
2023-01-27T09:09:48.373
null
null
13,474,354
null
75,256,104
2
null
75,228,202
0
null
The names without version numbers are controlled by the `llvm-defaults` package on your distribution. It picks a specific version to make the default, and only that one has un-versioned symlinks installed into the system `PATH`. As a consequence, on Debian based systems only one version (controlled by the distro) is going to be available there and it may not be the one from `https://apt.llvm.org/`. On these systems, the recommended way to use a specific version is to add the suffix. If you can't do that, you should install the distro-provided version using the normal process rather than the versions on `https://apt.llvm.org/`. To read more details about how all of this works, you can check out the documentation for the `llvm-defaults` package set here: [https://salsa.debian.org/pkg-llvm-team/llvm-defaults/-/blob/experimental/debian/README.Debian](https://salsa.debian.org/pkg-llvm-team/llvm-defaults/-/blob/experimental/debian/README.Debian)
null
CC BY-SA 4.0
null
2023-01-27T09:20:30.723
2023-01-27T09:20:30.723
null
null
552,038
null
75,256,297
2
null
75,255,834
0
null
You can use conditional formatting as well: [](https://i.stack.imgur.com/NMLzq.png)
null
CC BY-SA 4.0
null
2023-01-27T09:40:05.677
2023-01-27T09:40:05.677
null
null
16,578,424
null
75,256,328
2
null
50,746,420
0
null
If you installed the [@next/mdx](https://nextjs.org/docs/advanced-features/using-mdx#nextmdx) package you can use the [<Image />](https://nextjs.org/docs/basic-features/image-optimization#local-images) component Next.js provides: ``` // pages/cute-cat.mdx import Image from "next/image"; import cuteCat from "./cute-cat.jpg"; # Cute cat This is a picture of a cute cat <Image src={cuteCat} /> ```
null
CC BY-SA 4.0
null
2023-01-27T09:42:38.240
2023-01-27T09:42:38.240
null
null
8,100,509
null
75,256,343
2
null
75,252,130
1
null
As documented in the [jOOQ code generation manual](https://www.jooq.org/doc/latest/manual/code-generation/codegen-advanced/codegen-config-database/codegen-database-catalog-and-schema-mapping/) and also throughout the [third party plugin documentation](https://github.com/etiennestuder/gradle-jooq-plugin), you have to specify an `inputSchema` if you don't want the code generator to generate schemas. Specifically: ``` database.apply { name = "org.jooq.meta.h2.H2Database" inputSchema = "PUBLIC" ... } ```
null
CC BY-SA 4.0
null
2023-01-27T09:44:15.887
2023-01-27T09:44:15.887
null
null
521,799
null