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,480,741
2
null
58,120,009
-1
null
``` const titleRow4 = worksheet.addRow([mainheading]); titleRow4.font = { family: 4, size: 10, bold: true }; titleRow4.alignment = { horizontal: 'center' } worksheet.mergeCells('A5:D5'); ```
null
CC BY-SA 4.0
null
2023-02-17T05:59:26.810
2023-02-17T05:59:26.810
null
null
21,231,605
null
75,480,898
2
null
75,480,412
0
null
``` const platforms = [ { "id": 1, "name": "KF", "bankAccounts": [ { "id": 22, "balance": -100, "lendingPlatformId": 3 }, { "id": 27, "balance": 500, "lendingPlatformId": 4 } ] }, { "id": 3, "name": "CC", "bankAccounts": [ { "id": 23, "balance": 100, "lendingPlatformId": 1 } ] }, { "id": 4, "name": "DD", "bankAccounts": [ { "id": 28, "balance": 0, "lendingPlatformId": 1 } ] } ]; const emptyArrayInit = Array.from(new Array(4), ()=>[0,0,0,0]) platforms.forEach(platform=>{ const {id, bankAccounts}=platform; const index = id-1; bankAccounts.forEach(bankAccount=>{ const {balance,lendingPlatformId } =bankAccount; const lendingPlatformIdIndex = lendingPlatformId-1; if(balance>0){ emptyArrayInit[index][lendingPlatformIdIndex] += balance; }else{ emptyArrayInit[lendingPlatformIdIndex][index] += balance } }) }) console.log(emptyArrayInit,'emptyArrayInit'); ``` /// [ [ 0, 0, 0, 500 ], [ 0, 0, 0, 0 ], [ 0, 0, 0, 0 ], [ 0, 0, 0, 0 ] ] it's simple to reach your goal.
null
CC BY-SA 4.0
null
2023-02-17T06:30:04.283
2023-02-17T06:30:04.283
null
null
7,207,566
null
75,480,987
2
null
75,480,412
0
null
``` const res=[] //to save result platforms.map(platform=>{ //first loop platform.bankAccounts.map(bank=>{ // inner loop bankaccounts // to get lendingPlatforms const lendPlatforms=platforms.find(p=>p.id==bank.lendingPlatformId); //compare balance if((lendPlatforms.bankAccounts[0].balance+bank.balance)==0) res.push(true) // if combined balance is equal to zero else res.push(false) })}) console.log(res) ```
null
CC BY-SA 4.0
null
2023-02-17T06:45:24.373
2023-02-17T06:45:24.373
null
null
21,231,605
null
75,481,462
2
null
70,540,788
0
null
I guess we have to run superset_init again to make the change appear on Superset.
null
CC BY-SA 4.0
null
2023-02-17T07:48:38.690
2023-02-17T08:11:21.647
2023-02-17T08:11:21.647
7,733,418
19,253,094
null
75,481,596
2
null
75,477,454
0
null
> Go to azure active directory -> Inside mange go to app registration(if you not created a app registration create it ) -> Go to registered app -> Certificate & Secretes. ![enter image description here](https://i.imgur.com/xDaaxyB.png) > Managed identities are a way to simplify the authentication process for applications running in Azure, but they do not apply to all scenarios when calling external APIs that require authentication. In these cases, you need to obtain an access token from Azure AD using a client secret. ![enter image description here](https://i.imgur.com/aU1MxMj.png) :`https://login.microsoftonline.com/<tenant_id>/oauth2/v2.0/token` : `https://cosmos.azure.com/.default` `grant_type=client_credentials&client_id=<client_id>&client_secret=<client_secret>&scope=scope : https://cosmos.azure.com/.default` After execution of web1 activity you will get like this bearer token: ![enter image description here](https://i.imgur.com/v3xf7N5.png) Inside Web2 activity provide valid URL as per below syntax: ``` https://{databaseaccount}.documents.azure.com/dbs/{db-id}/colls/{coll-id}/docs/{doc-id} ``` Authorization: `Bearer @{activity('Web1').output.access_token}` ![enter image description here](https://i.imgur.com/BM9c6ki.png)
null
CC BY-SA 4.0
null
2023-02-17T08:03:48.300
2023-02-17T08:03:48.300
null
null
18,229,980
null
75,482,119
2
null
75,481,427
0
null
If you're using `AnyView`, you're probably doing it wrong. Try an array of enums representing each view (`about`, `education`, `gallery`, etc), then `ForEach` on the array, switch on their enum, and return the relevant View. ``` enum ButtonType: Identifiable, CaseIterable { var id: Self { self } case about, education, gallery var title: String { switch self { case .about: return "About" case .education: return "Education" case .gallery: return "Gallery" } } } struct ContentView: View { let columns = [ GridItem(.flexible()), GridItem(.flexible()) ] var body: some View { NavigationStack{ LazyVGrid(columns: columns) { ForEach(ButtonType.allCases) { type in NavigationLink(type.title) { switch type { case .about: Text("AboutView") case .education: Text("EducationView") case .gallery: Text("GalleryViewView") } } .frame(height: 50) .frame(minWidth: 100) .foregroundColor(.red) .padding() .background(Color.black) .cornerRadius(5) } } } } } ``` [](https://i.stack.imgur.com/bzyIpl.gif)
null
CC BY-SA 4.0
null
2023-02-17T08:58:46.953
2023-02-17T09:13:01.000
2023-02-17T09:13:01.000
123,632
123,632
null
75,482,686
2
null
75,477,553
0
null
Move the camera back 10 units on the z. Cameras have a view frustum, where elements outside it won't render. This is what is happening here. With the near plane set to 0.3, you need to move the camera away from an object by 0.3 units. The default z value is -10 on the camera. [https://docs.unity3d.com/ScriptReference/Camera-nearClipPlane.html](https://docs.unity3d.com/ScriptReference/Camera-nearClipPlane.html)
null
CC BY-SA 4.0
null
2023-02-17T09:56:15.627
2023-02-17T09:56:15.627
null
null
16,690,008
null
75,482,819
2
null
67,946,696
0
null
This feature isn't implemented yet. [https://github.com/dotnet/roslyn/issues/1515](https://github.com/dotnet/roslyn/issues/1515) For now you can duplicate this info into summary tag.
null
CC BY-SA 4.0
null
2023-02-17T10:08:14.843
2023-02-17T10:08:14.843
null
null
12,007,032
null
75,482,860
2
null
75,482,525
0
null
1. You are sending 'category_id' => 0 I don’t believe that it exists in your database. You have to change it to 'category_id' => 1 2. And also you have to follow this answer too.
null
CC BY-SA 4.0
null
2023-02-17T10:11:17.413
2023-02-17T10:32:21.263
2023-02-17T10:32:21.263
11,287,544
11,287,544
null
75,482,894
2
null
75,482,525
1
null
you are passing your `chapters` data as array of object in your POSTMAN, ``` "chapters": [ { "id": 1, .. .. }, { "id": 3, .. .. } ] ``` then its a plain object in your Laravel HTTP request, which throwing an error because you are looping through `id`, `name` and `count` and not through an object containing those key which your loop expects to have ``` "chapters": { "id": 3, .. .. } ``` you need this part to be a list of objects ``` 'chapters' => [ 'id' => 3, .. ], ``` should be ``` 'chapters' => [ [ 'id' => 3, .. ] ], ```
null
CC BY-SA 4.0
null
2023-02-17T10:13:48.470
2023-02-17T10:19:52.840
2023-02-17T10:19:52.840
1,319,623
1,319,623
null
75,482,991
2
null
30,960,690
0
null
I solved the problem inserting `ApplicationDelegate.shared.application(application,didFinishLaunchingWithOptions: launchOptions)` in AppDelegate's didFinishLaunchingWithOptions
null
CC BY-SA 4.0
null
2023-02-17T10:22:49.817
2023-02-17T10:22:49.817
null
null
6,309,705
null
75,483,001
2
null
75,482,570
-1
null
To create a download link for a zipped file, you can use the tag with the href attribute pointing to the location of the zipped file, like this: Download file
null
CC BY-SA 4.0
null
2023-02-17T10:23:39.280
2023-02-17T10:23:39.280
null
null
21,233,130
null
75,483,293
2
null
75,480,335
0
null
I appreciate the review, due to fatigue I did not notice that the name of the function did not match a letter and that is why it gave me an error, I will take the recommendation to copy and paste the names of the functions in the future, I consider this question closed. Thank you so much.
null
CC BY-SA 4.0
null
2023-02-17T10:49:17.333
2023-02-17T10:49:17.333
null
null
16,875,328
null
75,483,962
2
null
27,750,608
1
null
I was also facing same problem. Initially I was using broadband(Jio fiber) which might restrict me to download the file(due to security) but then I used mobile internet(through sim card) and it got downloaded and my issue got resolved. Try the code below to download stopwords or change accordingly : ``` import nltk nltk.download('stopwords') from nltk.corpus import stopwords stopwords.words('english') ```
null
CC BY-SA 4.0
null
2023-02-17T11:54:14.713
2023-02-23T15:59:40.063
2023-02-23T15:59:40.063
13,944,524
21,233,635
null
75,484,019
2
null
75,465,071
0
null
I found an answer! I was using the `<a>` html tag to navigate to the admin page and the data was preloaded for some reason. In my launched app I don't need to navigate to the admin page using the `<a>` tag.
null
CC BY-SA 4.0
null
2023-02-17T11:59:34.797
2023-02-17T12:00:18.747
2023-02-17T12:00:18.747
21,203,786
21,203,786
null
75,484,261
2
null
75,484,190
-1
null
You can try to download the video and, instead of importing the video from youtube, import it from you local storage. `<video src="video.mp4" width="420" height="240"></video>`
null
CC BY-SA 4.0
null
2023-02-17T12:24:51.653
2023-02-17T12:25:56.077
2023-02-17T12:25:56.077
20,813,105
20,813,105
null
75,484,382
2
null
75,478,091
0
null
This is what your `IFS()` looks like: ``` IFS(((F13-0)*G13)<H13,(F13-0)*G13, ((F13-1)*G13)<H13,(F13-1)*G13, ((F13-2)*G13)<H13,, ((F13-3)*G13)<H13,, ((F13-4)*G13)<H13,, ((F13-5)*G13)<H13,, ((F13-6)*G13)<H13,(F13-6)*G13, ((F13-7)*G13)<H13,(F13-7)*G13, ((F13-8)*G13)<H13,(F13-8)*G13, ((F13-9)*G13)<H13,(F13-9)*G13, ((F13-10)*G13)<H13,(F13-10)*G13, ((F13-11)*G13)<H13,(F13-11)*G13, ((F13-12)*G13)<H13,(F13-12)*G13, ((F13-13)*G13)<H13,(F13-13)*G13, ((F13-14)*G13)<H13,(F13-14)*G13, ((F13-15)*G13)<H13,(F13-15)*G13, ((F13-16)*G13)<H13,(F13-16)*G13, ((F13-17)*G13)<H13,(F13-17)*G13, ((F13-18)*G13)<H13,(F13-18)*G13) ``` I see three issues: - - `IF ((F13-x)*G13)<H13 THEN (F13-x)*G13`-
null
CC BY-SA 4.0
null
2023-02-17T12:36:09.960
2023-02-17T12:36:09.960
null
null
4,279,155
null
75,484,543
2
null
38,001,105
0
null
Another possibility is to take advantage of default mutable parameters in Python: ``` def print_once(string, bucket=[]): """ Print only one time >>> print_once("foo") foo >>> print_once("foo") """ if string not in bucket: print(string) bucket.append(string) ```
null
CC BY-SA 4.0
null
2023-02-17T12:51:14.623
2023-02-17T12:51:14.623
null
null
4,986,615
null
75,484,728
2
null
75,484,532
1
null
We don't have your actual data to demonstrate an answer, but I have constructed a very similar set with the same names, range and approximate shape as your own (see footnote). Using this, we see that your code produces much the same set of problems: ``` library(tidyverse) cut_offs %>% ggplot(aes(IL6, RhoTSHT3_in_less)) + geom_line(color = "blue")+ geom_point(col = ifelse(cut_offs$pvalTSHT3_in_less < 0.05, "red", "black"))+ ylim(0.1, 0.7) + geom_text(aes(label = n_more)) ``` [](https://i.stack.imgur.com/z4nMQ.png) To label, say, only every 25th measurement along the x axis, we can do: ``` cut_offs %>% ggplot(aes(IL6, RhoTSHT3_in_less)) + geom_line(color = "blue")+ geom_point(col = ifelse(cut_offs$pvalTSHT3_in_less < 0.05, "red", "black"))+ ylim(0.1, 0.7) + geom_text(data = . %>% filter(row_number() %% 25 == 1), aes(label = n_more), nudge_y = 0.05) ``` ## ``` set.seed(1) cut_offs <- data.frame(IL6 = seq(0, 500, len = 251), RhoTSHT3_in_less = c(seq(0.45, 0.22, len = 20) + rnorm(20, 0, 0.02), runif(231, .2, .25)), n_more = sample(300, 251), pvalTSHT3_in_less = runif(251, 0, 0.2)) ```
null
CC BY-SA 4.0
null
2023-02-17T13:07:56.817
2023-02-17T13:07:56.817
null
null
12,500,315
null
75,485,956
2
null
75,485,570
1
null
There seems to be a gray-filled `rectGrob` under the gradient fill on the finished plot, and you can just see the edges of it. If you set `fill = NA` this disappears. ``` library(tidyverse) library(ggpattern) tibble( id = c("a", "b"), xmin = c(-1, -1), xmax = c(1, 1), ymin = c(-1, 0), ymax = c(0, 1) ) |> ggplot() + geom_rect_pattern( aes(xmin = xmin, xmax = xmax, ymin = ymin, ymax = ymax, pattern_fill2 = id), pattern_fill = "white", pattern = "gradient", fill = NA, pattern_orientation = "horizontal", ) + theme_classic() + coord_fixed(xlim = c(-1.1,1.1), ylim = c(-1.1,1.1), ratio = 1) ``` [](https://i.stack.imgur.com/g2uiB.png)
null
CC BY-SA 4.0
null
2023-02-17T15:05:03.053
2023-02-17T15:05:03.053
null
null
12,500,315
null
75,486,278
2
null
63,968,285
0
null
You can update the layout ``` fig.update_layout(coloraxis_colorbar_title_text = 'Colorbar Title') ``` I found the answer [here](https://stackoverflow.com/questions/69909540/plotly-express-update-the-colorbar-title).
null
CC BY-SA 4.0
null
2023-02-17T15:33:16.023
2023-02-17T15:33:16.023
null
null
550,155
null
75,486,628
2
null
27,472,813
0
null
For what it is worth, in 2023, this works for me, on macOS, with GLEW, GLFW, and CMake installed using Homebrew: ``` cmake_minimum_required(VERSION 3.10) project(Project) add_executable(Project main.cpp) find_package(glfw3 REQUIRED) find_package(GLEW REQUIRED) target_link_libraries(Project glfw GLEW::glew) ```
null
CC BY-SA 4.0
null
2023-02-17T16:05:27.750
2023-02-17T16:05:27.750
null
null
1,991,373
null
75,486,834
2
null
30,738,073
0
null
I know this is too late, but: VirtualizingPanel.ScrollUnit="Pixel"
null
CC BY-SA 4.0
null
2023-02-17T16:24:04.283
2023-02-17T16:24:04.283
null
null
12,069,986
null
75,487,317
2
null
71,560,341
0
null
A tool that allows you to add elements on new context menu [https://github.com/ikas-mc/ContextMenuForWindows11](https://github.com/ikas-mc/ContextMenuForWindows11)
null
CC BY-SA 4.0
null
2023-02-17T17:12:14.343
2023-02-17T17:12:14.343
null
null
13,845,688
null
75,487,517
2
null
75,487,032
1
null
Got it, thanks to the [GitHub community](https://github.com/sveltejs/kit/issues/9092). > Vite uses dotenv-expand to expand variables out of the box.Note that if you want to use `$` inside your environment value, you have to escape it with `\`. [https://vitejs.dev/guide/env-and-mode.html#env-files](https://vitejs.dev/guide/env-and-mode.html#env-files)
null
CC BY-SA 4.0
null
2023-02-17T17:34:17.077
2023-02-17T17:54:18.793
2023-02-17T17:54:18.793
546,730
10,834,613
null
75,488,184
2
null
1,109,536
0
null
To inflate a polygon, one can implement the algorithm from "Polygon Offsetting by Computing Winding Numbers" [article](https://mcmains.me.berkeley.edu/pubs/DAC05OffsetPolygon.pdf). The steps of the algorithm are as follows: 1. Construct outer offset curve by taking every edge from input polygon and shifting it outside, then connecting shifted edged with circular arches in convex vertices of input polygon and two line segments in concave vertices of input polygon. An example. Here input polygon is dashed blue, and red on the left - shifted edges, on the right - after connecting them in continuous self-intersecting curve: [](https://i.stack.imgur.com/ufEdc.png) 1. The curve divides the plane on a number of connected components, and one has to compute the winding number in each of them, then take the boundary of all connected components with positive winding numbers: [](https://i.stack.imgur.com/mr9f9.png) The article proofs that the algorithm is very fast compared to competitors and robust at the same time. To avoid implementing winding number computation, one can pass self-intersecting offset curve to OpenGL Utility library (GLU) [tessellator](https://registry.khronos.org/OpenGL-Refpages/gl2.1/xhtml/gluTessProperty.xml) and activate the settings `GLU_TESS_BOUNDARY_ONLY=GL_TRUE` (to skip triangulation) and `GLU_TESS_WINDING_RULE=GLU_TESS_WINDING_POSITIVE` (to output the boundary of positive winding number components).
null
CC BY-SA 4.0
null
2023-02-17T18:42:23.937
2023-02-17T18:42:23.937
null
null
7,325,599
null
75,488,302
2
null
65,559,610
0
null
You should set the `oarea` argument of `affine` to constrain the box. Try for example `oarea=(0,0,target_width,target_height)`.
null
CC BY-SA 4.0
null
2023-02-17T18:58:25.713
2023-02-17T18:58:25.713
null
null
5,745,441
null
75,488,406
2
null
75,488,271
1
null
Because both `app.py` and `lang.py` are in the same directory try to import like this : ``` from .lang import Language ``` or you can use `from app.lang import Language` from another file located outside app folder
null
CC BY-SA 4.0
null
2023-02-17T19:13:35.043
2023-02-17T19:22:28.353
2023-02-17T19:22:28.353
8,990,846
8,990,846
null
75,488,677
2
null
75,460,890
0
null
The way to communicate between different objects (sprites) is to broadcast a message (as suggested in another answer here, and as you are already doing in your code). BUT creating 26 different messages (`showc`, `showd`, etc.) is not practical. The idiomatic way of doing it in Scratch is to use a global variable, for example `Letter` and broadcasting a generic message like `ShowLetter`. Then the target sprite can read that `Letter` while processing this message. Also, having 26 sprites that are doing very similar thing is wrong. I would suggest to have ONE sprite with 26 costumes (for each letter of the alphabet) and clone that sprite for each letter. That way you would need to write `When I receive "message"` only once. To change a color of a letter, I suggest using `set "color" effect to <number>`. You can play with different numbers to get wht you like.
null
CC BY-SA 4.0
null
2023-02-17T19:51:04.370
2023-02-17T19:51:04.370
null
null
4,394,169
null
75,489,140
2
null
75,489,049
0
null
Try this: ``` SELECT pprecord FROM YourTable WHERE id = (SELECT MAX(id) FROM YourTable WHERE asms = '188660') ``` Explanation: First line select pprecord, second line select the id I'll improve the answer if any additional question. Upvotes and acceptions are appreciated~
null
CC BY-SA 4.0
null
2023-02-17T20:50:38.167
2023-02-17T21:43:44.333
2023-02-17T21:43:44.333
10,852,370
10,852,370
null
75,489,159
2
null
30,715,983
-1
null
The real reason is probably you are not forwarding the proxy ssl connection.
null
CC BY-SA 4.0
null
2023-02-17T20:54:27.070
2023-02-17T20:54:27.070
null
null
2,097,742
null
75,489,246
2
null
75,489,189
0
null
one way to this is by filtring your dataframe each time on a specific value for the column Forces: ``` column = df['Forces'].unique() dict_of_column_value = {} for col in column: dict_of_column_value[col] = list(df[df['Forces'] == col].Values) pd.DataFrame(dict_of_column_value) ```
null
CC BY-SA 4.0
null
2023-02-17T21:10:53.103
2023-02-19T13:46:33.193
2023-02-19T13:46:33.193
12,986,294
12,986,294
null
75,489,285
2
null
14,299,944
0
null
Android XML: z-index - Try this in a RelativeLayout: example XML: ``` <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:contentDescription="@string/todo" app:srcCompat="@drawable/ic_offer_close_outline" app:tint="@color/colorWhite" android:translationZ="999dp" /> ``` example java: ``` ImageView image = new ImageView(this); image.SetZ(float z); ```
null
CC BY-SA 4.0
null
2023-02-17T21:15:37.567
2023-02-17T21:15:37.567
null
null
7,446,693
null
75,489,349
2
null
75,484,505
0
null
for using `figma` `rgba color` in flutter , you can use `Color.fromARGB(int a, int r, int g, int b)` . in your case : `Color.fromARGB(1, 0, 82, 204)`
null
CC BY-SA 4.0
null
2023-02-17T21:22:20.710
2023-02-17T21:22:20.710
null
null
9,854,260
null
75,489,433
2
null
75,488,910
0
null
Looks like a bug. Can you raise it on GitHub? Here is a workaround. [](https://i.stack.imgur.com/N2Nxa.png) ``` { "data": {"name": "data-eb2eb4918524c908955f7797d7245a00"}, "facet": { "column": { "field": "f", "header": {"labelOrient": "bottom", "labelFontSize": 20, "title": ""} } }, "spec": { "layer": [ { "mark": {"type": "arc", "outerRadius": 100}, "encoding": { "color": { "field": "k", "legend": {"title": ""}, "sort": {"field": "n"}, "type": "nominal" }, "theta": {"field": "v", "stack": true, "type": "quantitative"} } }, { "mark": {"type": "text", "fill": "black", "radius": 115}, "encoding": { "color": { "field": "k", "legend": {"title": ""}, "sort": {"field": "n"}, "type": "nominal" }, "text": {"field": "v", "format": ",.1f", "type": "quantitative"}, "theta": {"field": "v", "stack": true, "type": "quantitative"} } } ] }, "resolve": {"scale": {"theta": "independent"}}, "$schema": "https://vega.github.io/schema/vega-lite/v5.2.0.json", "datasets": { "data-eb2eb4918524c908955f7797d7245a00": [ {"n": 1, "f": "Non Forest", "k": "N", "v": 32.20114689016321}, {"n": 2, "f": "Non Forest", "k": "E", "v": 22.30554330245552}, {"n": 3, "f": "Non Forest", "k": "S", "v": 14.350830760182326}, {"n": 4, "f": "Non Forest", "k": "W", "v": 31.14247904719894}, {"n": 5, "f": "Forest", "k": "N", "v": 24.525745257452574}, {"n": 6, "f": "Forest", "k": "E", "v": 20.460704607046072}, {"n": 7, "f": "Forest", "k": "S", "v": 21.00271002710027}, {"n": 8, "f": "Forest", "k": "W", "v": 34.010840108401084}, {"n": 9, "f": "Unclassified", "k": "N", "v": 29.437706725468576}, {"n": 10, "f": "Unclassified", "k": "E", "v": 32.08379272326351}, {"n": 11, "f": "Unclassified", "k": "S", "v": 16.427783902976845}, {"n": 12, "f": "Unclassified", "k": "W", "v": 22.05071664829107} ] } } ```
null
CC BY-SA 4.0
null
2023-02-17T21:35:30.750
2023-02-17T21:35:30.750
null
null
18,345,037
null
75,489,638
2
null
7,548,255
0
null
As of 2023, this is still happening in Firefox. This is my solution using SASS, but you can see how to make it bare CSS: ``` txt-brand { display:inline-block; } ///Firefox only /// @-moz-document url-prefix() { margin-right: .1em; white-space: nowrap; &::after { content: '\00a0'; } } } .txt-brand::first-letter { letter-spacing: -.11em; } ```
null
CC BY-SA 4.0
null
2023-02-17T22:06:53.413
2023-02-25T09:39:47.833
2023-02-25T09:39:47.833
7,855,321
21,236,817
null
75,489,646
2
null
60,284,332
0
null
Add a plus sign so it takes it as one query e.g. &$expand=..&$select=..+$filter=...
null
CC BY-SA 4.0
null
2023-02-17T22:08:30.007
2023-02-17T22:08:30.007
null
null
8,166,488
null
75,489,743
2
null
75,487,683
0
null
you can add this line in the main function ``` SystemChrome.setEnabledSystemUIMode( SystemUiMode.manual, overlays: [ SystemUiOverlay.top, // Shows Status bar and hides Navigation bar ], ); ``` like this : ``` import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; void main() { WidgetsFlutterBinding.ensureInitialized(); SystemChrome.setEnabledSystemUIMode( SystemUiMode.manual, overlays: [ SystemUiOverlay.top, // Shows Status bar and hides Navigation bar ], ); runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @override Widget build(BuildContext context) { return MaterialApp( home: Scaffold( bottomNavigationBar: Padding( padding: EdgeInsets.zero, child: Container(height: 56, color: Colors.red), ), ), ); } } ```
null
CC BY-SA 4.0
null
2023-02-17T22:20:24.087
2023-02-22T00:09:42.267
2023-02-22T00:09:42.267
9,670,227
9,670,227
null
75,489,822
2
null
66,971,288
0
null
Don't use System.getenv(), directly enter your sid and auth token as string.
null
CC BY-SA 4.0
null
2023-02-17T22:35:28.543
2023-02-17T22:35:28.543
null
null
21,236,906
null
75,489,893
2
null
41,126,943
0
null
I do not want to modify my folder permissions on my system device files like the accepted answer, but I was able to get permissions by opening Wireshark like this: ``` sudo /Applications/Wireshark.app/Contents/MacOS/Wireshark ``` Bonus, you can add an alias to your `~/.zshrc`: ``` alias ws="sudo /Applications/Wireshark.app/Contents/MacOS/Wireshark" ``` Now execute the file: (or you can open a new terminal window) ``` source ~/.zshrc ``` Open wireshark with super user permissions: ``` ws ```
null
CC BY-SA 4.0
null
2023-02-17T22:46:53.280
2023-02-17T22:46:53.280
null
null
3,499,115
null
75,489,898
2
null
75,144,740
0
null
I found official example for WalletConnect v2 integration with Ethers.js See [https://github.com/WalletConnect/web-examples/blob/main/dapps/react-dapp-v2-with-ethers/src/contexts/ClientContext.tsx](https://github.com/WalletConnect/web-examples/blob/main/dapps/react-dapp-v2-with-ethers/src/contexts/ClientContext.tsx) Bad thing is that it's more complex than one with `Wagmi`. You have to connect lot of WalletConnect events to keep session info up to date, or to reset connection state. Also official example (`ClientContext.tsx`) is IMO overusing React state which is not ideal. Would be nice to have official Ethers wrapper (not React, or other UI library dependent). But it is definitely useful example to make Ethers integration work.
null
CC BY-SA 4.0
null
2023-02-17T22:47:47.353
2023-02-17T22:47:47.353
null
null
1,571,491
null
75,490,046
2
null
72,574,484
0
null
getting stuck at getting `{slug : null}` after api call in strapi? ok, this is what I did I made a variable before POST request based on one of my form fields (eg:name field) my formValues is an object with values of form fields like this `formValues = {name:"whatever" , decsription:"whatever"}` make a variable: `const slug = formValues.name.split(" ").join("-") + "-" + Math.random();` now we might have same names, so that's why I used a random value (you might want to use uuid or something like that) then you send it like this ``` const res = await axios.post(`${API_URL}/api/events`,{...formValues, slug }); // you may not need to send an object with the shape like this // but the point is you concat your custom slug to the object you want to send ``` I'm adding a custom slug from frontend which is somehow random but based off of one of the fields, but it doesn't really matter, right now strapi does not have any documentation about this common problem, it seems like the best solution might be using`strapi-plugin-slugify` but if that didn't work for you feel free to use my solution
null
CC BY-SA 4.0
null
2023-02-17T23:17:19.627
2023-02-17T23:31:44.903
2023-02-17T23:31:44.903
21,236,798
21,236,798
null
75,490,087
2
null
75,489,422
3
null
The line version can be implemented using [vlines](https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.vlines.html), but note that your reference figure can be better reproduced using [fill_between](https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.fill_between.html). --- ## Line version Instead of `axvline`, use [vlines](https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.vlines.html) which supports `ymin` and `ymax` bounds. Change your `y` into a lambda `f(x, mu, sd)` and use that to define the `ymax` bounds: ``` # define y as a lambda f(x, mu, sd) f = lambda x, mu, sd: (1 / (sd * (2*np.pi)**0.5)) * np.exp((-(x-mu)**2) / (2*sd**2)) fig, ax = plt.subplots(figsize=(8, 3)) x = np.linspace(148, 200, 200) mu = 178 sd = 5 ax.plot(x, f(x, mu, sd)) # define 68/95/99 locations and colors xs = mu + sd*np.arange(-3, 4) colors = [*'yrbgbry'] # draw lines at 68/95/99 points from 0 to the curve ax.vlines(xs, ymin=0, ymax=[f(x, mu, sd) for x in xs], color=colors) # relabel x ticks plt.xticks(xs, [f'${n}\sigma$' if n else '0' for n in range(-3, 4)]) ``` ![line version](https://i.stack.imgur.com/ZnsCN.png) --- ## Shaded version Use [fill_between](https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.fill_between.html) to better recreate the sample figure. Define the shaded bounds using the `where` parameter: ``` fig, ax = plt.subplots(figsize=(8, 3)) x = np.linspace(148, 200, 200) mu = 178 sd = 5 y = (1 / (sd * (2*np.pi)**0.5)) * np.exp((-(x-mu)**2) / (2*sd**2)) ax.plot(x, y) # use `where` condition to shade bounded regions bounds = mu + sd*np.array([-np.inf] + list(range(-3, 4)) + [np.inf]) alphas = [0.1, 0.2, 0.5, 0.8, 0.8, 0.5, 0.2, 0.1] for left, right, alpha in zip(bounds, bounds[1:], alphas): ax.fill_between(x, y, where=(x >= left) & (x < right), color='b', alpha=alpha) # relabel x ticks plt.xticks(bounds[1:-1], [f'${n}\sigma$' if n else '0' for n in range(-3, 4)]) ``` ![shaded version](https://i.stack.imgur.com/gezSI.png) To label the region percentages, add [text](https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html) objects at the midpoints of the bounded regions: ``` midpoints = mu + sd*np.arange(-3.5, 4) percents = [0.1, 2.1, 13.6, 34.1, 34.1, 13.6, 2.1, 0.1] colors = [*'kkwwwwkk'] for m, p, c in zip( midpoints, # midpoints of bounded regions percents, # percents captured by bounded regions colors, # colors of text labels ): ax.text(m, 0.01, f'{p}%', color=c, ha='center', va='bottom') ``` ![shaded version labeled](https://i.stack.imgur.com/Eogre.png)
null
CC BY-SA 4.0
null
2023-02-17T23:24:54.523
2023-02-18T07:32:43.147
2023-02-18T07:32:43.147
13,138,364
13,138,364
null
75,490,154
2
null
16,426,987
1
null
An older question. But since I was looking for this functionality recently I thought I'd flag the package, which adds guides for [truncating axes](https://teunbrand.github.io/ggh4x/articles/PositionGuides.html#truncated-axes). ``` library(ggh4x) #> Loading required package: ggplot2 ggplot(data.frame(x=0:10, y=0:10), aes(x, y)) + geom_point() + theme_classic() + guides(x = "axis_truncated", y = "axis_truncated") ``` ![](https://i.imgur.com/T7nNv74.png) [reprex v2.0.2](https://reprex.tidyverse.org) Apart from convenience, two nice things about the option are that 1) it is stable across more complex plot compositions like faceting and 2) its dependencies are a subset of those belonging to , so you aren't introducing a bunch of additional imports. P.S. There's an [open GitHub issue](https://github.com/tidyverse/ggplot2/issues/4907) to bring this kind of "floating axes" functionality to the main library. It looks like it will eventually be incorporated.
null
CC BY-SA 4.0
null
2023-02-17T23:36:40.097
2023-02-17T23:36:40.097
null
null
4,115,816
null
75,490,367
2
null
75,484,505
0
null
you can use ``` Color.fromARGB(int opacity, int red, int green, int blue) ``` with opacity value 1 being not transparent and 0 fully transparent!
null
CC BY-SA 4.0
null
2023-02-18T00:27:12.533
2023-02-18T00:27:12.533
null
null
11,308,517
null
75,490,574
2
null
75,490,064
0
null
You could use VLOOKUP. It looks in the first column of the range and returns the value in the second one: ``` =VLOOKUP(D1,A:B,2,0) ``` [](https://i.stack.imgur.com/bjkFA.jpg)
null
CC BY-SA 4.0
null
2023-02-18T01:17:13.630
2023-02-18T01:17:13.630
null
null
20,363,318
null
75,490,572
2
null
75,478,091
0
null
You can simplify it as follows: ``` =LET(A, A2, B, B2, C, C2, seq, SEQUENCE(19,,0), out, IF((seq > 1) * (seq < 6), 0, (A - seq)*B), ROUND(@FILTER(out, (A - seq)*B < C, NA()), -2) + 200) ``` and extend it down, or use the array version as follow in cell `D2`: ``` =LET(A, A2:A3, B, B2:B3, C, C2:C3, seq, SEQUENCE(19,,0), MAP(A,B,C, LAMBDA(x,y,z, LET(out, IF((seq > 1) * (seq < 6), 0, (x - seq)*y), ROUND(@FILTER(out, (x - seq)*y < z, NA()), -2) + 200)))) ``` Here is the output: [](https://i.stack.imgur.com/JKrCA.png) The [implicit intersection operator](https://support.microsoft.com/en-us/office/implicit-intersection-operator-ce3be07b-0101-4450-a24e-c1c999be2b34) (`@`) ensures to get the first element of `FILTER` result, which is equivalent to get the first condition that matches. If no condition matches, then it returns `NA()`. The name `out`, has the result in the same order it should be tested via `IFS`. Using `SEQUENCE` allows to simplify the process.
null
CC BY-SA 4.0
null
2023-02-18T01:16:29.660
2023-02-18T01:48:45.887
2023-02-18T01:48:45.887
6,237,093
6,237,093
null
75,490,687
2
null
75,490,483
0
null
replace `ax.plot(0, y)` with replace `ax.plot(0, y, marker='o')` Since (0, 2.5) is an infinitely small point, you need to give it a marker so it's visible.
null
CC BY-SA 4.0
null
2023-02-18T01:50:11.103
2023-02-18T01:50:11.103
null
null
16,531,802
null
75,490,750
2
null
67,397,432
0
null
Move the caret to the desired anchor point for the rectangular selection, then, while holding + (windows/linux) or + (macos), click the other corner of the desired rectangular selection. See also [the dedicated VS Code user docs for "Clumn (box) selection"](https://code.visualstudio.com/docs/editor/codebasics#_column-box-selection) and this post on superuser.com: [Selecting columns in Visual Studio Code](https://superuser.com/q/1052795/1749748).
null
CC BY-SA 4.0
null
2023-02-18T02:09:14.843
2023-02-18T02:09:14.843
null
null
11,107,541
null
75,490,884
2
null
66,869,725
0
null
The problem was solved in the comments: [Daantje](/users/536590): > It looks like VSCode cant connect to the download server, did you try disabling your firewall and check if it works? It could be that you block a download host? Here is a list of common hosts used by Code: [code.visualstudio.com/docs/setup/network](https://code.visualstudio.com/docs/setup/network) [Brandon Ivander](/users/15513319): > Solved, i disabled my firewall and it works, thanks @Daantje
null
CC BY-SA 4.0
null
2023-02-18T02:52:11.007
2023-02-18T02:52:11.007
null
null
11,107,541
null
75,490,948
2
null
75,488,791
0
null
You have two processes. The second process is a simple counter with an asynchronous reset -- no issues here. But let's look at the first. ``` process(clk) begin if rising_edge(clk) then if button = '1' and prev_debounced_button = '0' then debounced_button <= '1'; else debounced_button <= '0'; end if; prev_debounced_button <= debounced_button; end if; end process; ``` You have three signals, which I'll call `button`, `debounced` and `prev`. Note that they're , declared at the architecture level, and not within the process. Signals and variables are fundamentally different, as we'll see. You also declare in the process' sensitivity list that it is sensitive only to `clk`. The simulator will only run this process whenever `clk` changes. On the first rising edge of the clock, this process checks if the button is pressed, and if `prev` is zero. If so, it sets `debounced` to 1, else, it's set to 0. But `debounced` is a signal, which in this process is both being and . In a real system, this is called a , and it's indeterminate which operation happens first. Your simulator handles this by always using the value of the signal in the previous time step. At time , `debounced` was 0, so any statement that uses `debounced` at time will use 0. Even if `debounced` is being changed to 1. In other words, you have `button` high, `debounced` was just set high, and `prev` stays low. On the second rising edge of the clock, it's likely `button`is still high as button presses last on the order of a million clock cycles. Since `prev` is still 0, `debounced` stays at 1, but this time the last `debounced` was 1 so `prev` is now set to 1. Third rising edge, `debounced` goes to 0, since `prev` is now 1. `prev` stays 1. Fourth rising edge, `prev` is still reading as 1, so `debounced` stays 0. `prev` now reads the old `debounced` and is now set to zero. Fifth rising edge, `prev` reads as zero, so `debounced` goes to 1. But `prev` stays at 0 until the next tick. This pattern continues as long as `button` is pressed. Once `button` goes to 0, then `debounced` is guaranteed to go to 0 on the next rising edge, and `prev` will go to 0 on the following tick. In other words, `debounced` goes 1-1-0-0-1-1-0-0... oscillating at half the clock frequency for as long as the button is pressed. This isn't a debouncer. It's just using a button to turn on an oscillator. Any time `button` is 1, `debounced_button` will toggle; any time `button` is 0, `debounced` stays 0. It's worth noting at this time that the second process uses `debounced_button`. --- On to the simulation. Your system starts with `previous` at 0. At 40 ns, `button` goes high. What happens? Nothing, at first -- you need a rising edge, which comes at 45 ns. , two processes run. The debouncer sees a button press, and sets `debounced` to 1. The counter of `debounced`, and does nothing. `prev` of `debounced`, and stays 0. Next rising edge (55 ns), `button` is still high and `prev` is still low, so `debounced` stays at '1'. `prev` now goes to 1. Since `debounced` was high, the counter uses the old value, and now it increments. 65 ns: `prev` reads as 1, so `debounced` goes low. But since it was high a moment ago, the count increments again. 75 ns: `debounced` reads low, the counter doesn't increment. 85-115 ns: `button` is low, so `debounced` stays low, and the counter doesn't increment. 125 ns: `button` is high, so `debounced` goes high, but as should be obvious by now, the count won't increment. Finally, note `counter_value` and `count`: `count` isn't being set inside a process with a sensitivity list, so it just changes immediately after `counter_value`, i.e. on the next simulator time step. If you were using variables instead of signals, those are changed immediately and used identically to how sequential logic works in a standard programming language like C. In reality, if you synthesize this design, you'll find that the behaviour is indeterminate. Your specific FPGA chip and the results of place and route will determine whether a signal is read before or after it's written. When you have logic that a value and it at the same time, the behaviour is indeterminate. You don't know which will happen first. I recommend having all outputs change on one clock edge (e.g. rising), and latch your inputs on the other clock edge (e.g. falling), to ensure that your inputs are stable before you try to use them. --- Finally, debugging's a lot easier if you look at the internal signals. I simulated your code for 200 ns and got this: [](https://i.stack.imgur.com/kiHEq.png) Here, you can see exactly what's happening with `prev` and `debounced`, and immediately understand that there's a one-clock delay in the signal propagation. Also, you can immediately see that your simulation's different from mine. It helps if you actually run the code you post here.
null
CC BY-SA 4.0
null
2023-02-18T03:12:28.620
2023-02-18T19:18:37.097
2023-02-18T19:18:37.097
3,958,282
3,958,282
null
75,491,217
2
null
75,491,093
1
null
Could you please try the below code ``` data %>% group_by(Year) %>% mutate(su=Sales/sum(Sales)) ``` [reprex v2.0.2](https://reprex.tidyverse.org) ``` # A tibble: 10 × 4 # Groups: Year [2] Year Name Sales su <dbl> <chr> <dbl> <dbl> 1 1980 Atari 4 0.789 2 1980 Activision 1.07 0.211 3 1981 Activision 4.21 0.308 4 1981 Parker Bros. 2.06 0.151 5 1981 Imagic 1.99 0.145 6 1981 Atari 1.84 0.135 7 1981 Coleco 1.36 0.0994 8 1981 Mystique 0.76 0.0556 9 1981 Fox 0.74 0.0541 10 1981 Men 0.72 0.0526 ```
null
CC BY-SA 4.0
null
2023-02-18T04:36:43.867
2023-02-18T04:36:43.867
null
null
14,454,397
null
75,491,242
2
null
75,491,234
0
null
Use the flexbox on the parent, not on the div you want to center: ``` .parent { display: flex; justify-content: center; align-items: center; } .card { width: 200px; height: 200px; background-color: black; } ``` ``` <div class="parent"> <div class="card"> <img src="images/image-equilibrium.jpg" alt=""> </div> </div> ``` If you want to keep the HTML structure (not inserting parent), you could just use the horizontal margin auto like this: ``` .card { width: 200px; height: 200px; background-color: black; margin: 0 auto; } ``` ``` <div class="card"> <img src="images/image-equilibrium.jpg" alt=""> </div> ``` If you want to do that, you need to modify the most top parent as well (the `<body>` tag) and make its height 100%, like this: ``` body { height: 100vh; margin: 0; } .parent { height: 100%; display: flex; justify-content: center; align-items: center; } .card { width: 200px; height: 200px; background-color: black; } ``` ``` <div class="parent"> <div class="card"> <img src="images/image-equilibrium.jpg" alt=""> </div> </div> ```
null
CC BY-SA 4.0
null
2023-02-18T04:44:15.520
2023-02-18T04:57:29.527
2023-02-18T04:57:29.527
7,552,340
7,552,340
null
75,491,288
2
null
75,491,234
-1
null
The properties `justify-content` and `align-items` were applied for the children of `.card`. If you want to the `.card` you will have to set the display property to flex for the parent of .card. or if the `.card` has a fixed width which in your case it has, you can also set the `margin-x:auto` on the `.card`, by doing so it will be aligned at the of it's parent container. Hope I was able to make you understand.
null
CC BY-SA 4.0
null
2023-02-18T04:57:19.293
2023-02-18T04:57:19.293
null
null
19,873,439
null
75,491,421
2
null
75,486,462
0
null
[You will probably find the answer to your question here. (I don't know if this will be your answer. Because I have never come across such a problem).](https://stackoverflow.com/questions/73993450/android-sdk-is-unavailable-upon-first-startup-of-android-studio)
null
CC BY-SA 4.0
null
2023-02-18T05:34:43.347
2023-02-18T05:34:43.347
null
null
19,610,655
null
75,491,437
2
null
75,491,093
2
null
Base R: We could use `ave()`. Here we can apply function `x/sum(x)` to each group `Year`, where `x` is defined by `sales$Sales`: ``` sales$su <- ave(sales$Sales, sales$Year, FUN = function(x) x/sum(x)) ``` ``` Year Name Sales su 1 1980 Atari 4.00 0.78895464 2 1980 Activision 1.07 0.21104536 3 1981 Activision 4.21 0.30774854 4 1981 ParkerBros. 2.06 0.15058480 5 1981 Imagic 1.99 0.14546784 6 1981 Atari 1.84 0.13450292 7 1981 Coleco 1.36 0.09941520 8 1981 Mystique 0.76 0.05555556 9 1981 Fox 0.74 0.05409357 10 1981 Men 0.72 0.05263158 ```
null
CC BY-SA 4.0
null
2023-02-18T05:41:22.923
2023-02-18T05:41:22.923
null
null
13,321,647
null
75,491,441
2
null
66,162,222
0
null
As mentioned in the comments, this is coming from the gitlens extension. Set the following in your settings.json: ``` "gitlens.codeLens.enabled": false, "gitlens.currentLine.enabled": false, "gitlens.statusBar.enabled": false, ```
null
CC BY-SA 4.0
null
2023-02-18T05:42:26.363
2023-02-18T05:42:26.363
null
null
11,107,541
null
75,491,671
2
null
75,491,474
0
null
That area of the UI is called the explorer. What you're seeing is generally called a "tooltip" in UI terminology. Looking through the available settings at the time of this writing, I do not see a setting to disable tooltips for the explorer listitems. I looked through settings containing "tooltip" and ones starting with `explorer.` and `workbench.list.` and didn't find such a configuration point. If you open the developer tools with the `Developer: Toggle Developer Tools` command, you'll see that that particular tooltip is just implmeneted with [the HTML title attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/title). The way that it is rendered is up to the browser, which in this case is [chromium](https://en.wikipedia.org/wiki/Chromium_(web_browser)), and the particular style it appears in differs by platform / OS. I don't think it's possible to write an extension that removes those title attributes. See [https://code.visualstudio.com/api/extension-capabilities/overview](https://code.visualstudio.com/api/extension-capabilities/overview), which states: > However, we also impose [restrictions](https://code.visualstudio.com/api/extension-capabilities/overview#restrictions) upon extensions to ensure the stability and performance of VS Code. For example, extensions cannot access the DOM of VS Code UI. What you can do is write a feature-request [issue ticket to the VS Code GitHub repo](https://github.com/microsoft/vscode/issues) asking for such a setting to be created to disable these and explaining why you think that would be a desirable thing to have. Bear in mind that for feature-requests to make it into their backlog, it needs to get enough thumbs-up reactions from the rest of the community. If you do create such an issue ticket, add a link to it here for posterity.
null
CC BY-SA 4.0
null
2023-02-18T06:46:30.710
2023-02-22T03:05:19.433
2023-02-22T03:05:19.433
11,107,541
11,107,541
null
75,491,689
2
null
75,489,425
1
null
set the `contentWidth` and `contentHeight` of the Dialog to `"100%"`. and set the `width` and `height` properties of the Table to `"100%"` that let Table expand to fill the available space inside the Dialog.
null
CC BY-SA 4.0
null
2023-02-18T06:51:15.717
2023-02-18T06:51:15.717
null
null
21,157,729
null
75,492,138
2
null
20,545,145
0
null
You can create a virtual device that supports some of the Google services.[](https://i.stack.imgur.com/SDvDB.png)
null
CC BY-SA 4.0
null
2023-02-18T08:36:43.160
2023-02-18T08:36:43.160
null
null
19,055,767
null
75,492,531
2
null
75,492,326
0
null
You could convert your data to a longer format using `pivot_longer` from `tidyr` to make sure you can plot two graphs for Obs1 and Obs2 using `facet_wrap` like this: ``` library(ggplot2) library(dplyr) library(tidyr) test.df %>% pivot_longer(cols = Obs1:Obs2) %>% ggplot(aes(x='', y= value, fill = Variable)) + geom_bar(width = 1, stat = 'identity') + coord_polar("y", start = 0) + facet_wrap(~name) ``` ![](https://i.imgur.com/lFag0xx.png) [reprex v2.0.2](https://reprex.tidyverse.org)
null
CC BY-SA 4.0
null
2023-02-18T09:59:05.060
2023-02-18T09:59:05.060
null
null
14,282,714
null
75,493,115
2
null
48,341,078
0
null
So after trying everything literally, clearing the cache, and changing SMTP details, the only solution that worked for me was reinstalling the swift mailer package (downgraded the version) and it worked like a charm ``` composer require "swiftmailer/swiftmailer:^6.0" ```
null
CC BY-SA 4.0
null
2023-02-18T11:47:11.193
2023-02-18T11:47:11.193
null
null
4,361,298
null
75,493,141
2
null
75,490,332
0
null
Intend (`text-indent`) only applies to the first line, for multiple lines use `padding-left`, e.g. ``` countrypops %>% filter(country_code_2 %in% c( Australasia, Melanesia, Micronesia, Polynesia) ) %>% filter(year %in% c(1995, 2005, 2015)) %>% mutate(region = case_when( country_code_2 %in% Australasia ~ "Australasia", country_code_2 %in% Melanesia ~ "Melanesia", country_code_2 %in% Micronesia ~ "Micronesia", country_code_2 %in% Polynesia ~ "Polynesia", )) %>% pivot_wider(names_from = year, values_from = population) %>% arrange(region, desc(`2015`)) %>% select(-starts_with("country_code")) %>% gt( rowname_col = "country_name", groupname_col = "region" ) %>% tab_style( style = "padding-left:30px;", locations = cells_stub() ) %>% cols_width(country_name ~ 150) ``` [](https://i.stack.imgur.com/knxjb.png)
null
CC BY-SA 4.0
null
2023-02-18T11:51:39.057
2023-02-18T11:51:39.057
null
null
14,137,004
null
75,493,195
2
null
75,492,909
0
null
Arrows are used to sort the displayed portion of the dataframe. But please note that the `display` function shows at max 1000 records, and won't load the whole dataset. The `display` function isn't included into PySpark documentation because it's specific to Databricks. Similar function also exist in Jupyter that you can use with PySpark, but it's not part of the PySpark. (you can use `df.show()` function to display as text table - it's a part of the PySpark's DataFrame API)
null
CC BY-SA 4.0
null
2023-02-18T12:00:34.717
2023-02-18T12:00:34.717
null
null
18,627
null
75,493,196
2
null
75,491,489
0
null
There is a problem in the `mergeSort` function: you compute the `mid` index incorrectly, for a slice of 2 elements, `mid` will be equal to `right` and the call `mergeSort(a, mid + 1, right)` will have undefined behavior because `mid + 1 > right`, a condition the function cannot handle. You should use `int mid = (left + right) / 2;` or better: ``` int mid = left + (right - left) / 2; // prevent potential overflow ``` There is also a problem in the `merge` function: the test `elementsMoved < r` is incorrect as `r` is the index of the last element and `elementsMoved` the number of iterations. It does not make sense to iterate more than `r - l + 1` times, but the test does not implement that. You use 2 different conventions in your code: - `endPos``void rightCircularShift(int *a, int startPos, int endPos)`- `right``void mergeSort(int *a, int left, int right)` It would be less confusing to always use the first convention, which is customary in C, where array indexes start at `0`. Also not that you must use `<=` in `if (a[leftCounter] <= a[rightCounter])` to make the sort stable. Here is a modified version: ``` #include <stdio.h> #include <stdlib.h> void rightCircularShift(int *a, int startPos, int endPos) { if (startPos < endPos) { int temp = a[endPos - 1]; for (int j = endPos - 1; j > startPos; j--) { a[j] = a[j - 1]; } a[startPos] = temp; } } void merge(int *a, int left, int mid, int right) { int leftCounter = left; int rightCounter = mid; while (leftCounter < mid && rightCounter < right) { if (a[leftCounter] <= a[rightCounter]) { leftCounter++; } else { rightCircularShift(a, leftCounter, rightCounter + 1); leftCounter++; rightCounter++; mid++; } } } void mergeSort(int *a, int left, int right) { if (right - left > 1) { // mid is the index of the first element of the second slice int mid = left + (right - left) / 2; mergeSort(a, left, mid); mergeSort(a, mid, right); merge(a, left, mid, right); } } int main() { int n, i, *array; system("clear"); printf("\nEnter number of elements: "); if (scanf("%d", &n) != 1 || n <= 0) return 1; array = malloc(sizeof(*array) * n); if (array == NULL) return 1; printf("Enter value of elements:\n"); for (i = 0; i < n; i++) { if (scanf("%d", &array[i]) != 1) return 1; } printf("\n"); mergeSort(array, 0, n); printf("\n"); for (i = 0; i < n; i++) { printf("%d\t", array[i]); } printf("\n"); free(array); return 0; } ``` Note however that implementing merge sort this way is very inefficient: the space needed is limited to , corresponding to the recursion depth, but the average time complexity explodes to or worse, especially for the very example tested: an array sorted in decreasing order. There are ways to implement merge sort with limited amount of memory while limiting this downside, but they are more complicated than this simple approach.
null
CC BY-SA 4.0
null
2023-02-18T12:00:55.083
2023-02-18T15:29:04.330
2023-02-18T15:29:04.330
4,593,267
4,593,267
null
75,493,314
2
null
75,484,505
0
null
Just use this function `Color.fromRGBO(0, 82, 204, 1)`.
null
CC BY-SA 4.0
null
2023-02-18T12:24:26.683
2023-02-18T12:24:26.683
null
null
19,314,203
null
75,493,374
2
null
75,492,907
2
null
It's a bit hard to guess without a sample structure of your input array, but maybe try replacing ``` {% for key in item.infoCity.announce|keys %} {{key|length }} {% endfor %} ``` with simply `{{ item.infoCity.announce|length }}`
null
CC BY-SA 4.0
null
2023-02-18T12:35:17.230
2023-02-18T12:35:17.230
null
null
1,084,265
null
75,493,424
2
null
62,573,268
0
null
From the screenshot, it appears you want to ["Bring your own Function."](https://learn.microsoft.com/en-us/azure/static-web-apps/functions-bring-your-own) First, make sure your Static Web App is running in the "Standard Plan" - not the "Free" plan. The free plan does not allow Bring your own Function. Second, all of your Azure Functions should be marked as Anonymous as the Static Web App will control access to the Azure Function using the routes parameter in the staticwebapp.config.json file. Finally, you need to link the Azure Function to the Static Web App. This is explained in the Bring your own Function documentation. You will need to update the workflow definition file (ends in .yml) and set the api_location to blank which is api_location: "" Your Azure Function will look like this when linked: [](https://i.stack.imgur.com/B9gDK.jpg) What I did to get started was to follow the Microsoft instructions for the Managed Api to get familiar with the resources and then later split off to a Bring your own Function. Hopefully this helps!
null
CC BY-SA 4.0
null
2023-02-18T12:43:54.190
2023-02-18T12:43:54.190
null
null
4,276,983
null
75,493,435
2
null
75,249,529
0
null
try to declare the model like this `let dialog = ref(false)` and during event try `const eventDialog = () => { dialog.value = false; }`
null
CC BY-SA 4.0
null
2023-02-18T12:45:15.703
2023-02-18T12:45:15.703
null
null
10,887,712
null
75,493,649
2
null
75,491,093
1
null
Another option using `prop.table` like this: ``` library(dplyr) sales %>% group_by(Year) %>% mutate(su = prop.table(Sales)) #> # A tibble: 10 × 4 #> # Groups: Year [2] #> Year Name Sales su #> <int> <chr> <dbl> <dbl> #> 1 1980 Atari 4 0.789 #> 2 1980 Activision 1.07 0.211 #> 3 1981 Activision 4.21 0.308 #> 4 1981 ParkerBros. 2.06 0.151 #> 5 1981 Imagic 1.99 0.145 #> 6 1981 Atari 1.84 0.135 #> 7 1981 Coleco 1.36 0.0994 #> 8 1981 Mystique 0.76 0.0556 #> 9 1981 Fox 0.74 0.0541 #> 10 1981 Men 0.72 0.0526 ``` [reprex v2.0.2](https://reprex.tidyverse.org)
null
CC BY-SA 4.0
null
2023-02-18T13:26:07.293
2023-02-18T13:26:07.293
null
null
14,282,714
null
75,494,316
2
null
60,276,886
0
null
Strongly suggest DO NOT draw xor join which only cause confusion, add no value.
null
CC BY-SA 4.0
null
2023-02-18T15:21:59.213
2023-02-18T15:21:59.213
null
null
21,240,314
null
75,494,346
2
null
75,493,743
0
null
Found a way to go around this. It seems like Abaqus only like the `getSequenceFromMask()` method when it comes to defining set. Selecting vertices by `findAt()` method works fine in other cases but not in defining set. So the workaround is to convert the coordinates of the vertices of interest into a series of "click" (i.e. just like how it was defined in Abaqus GUI) at the exact location of the vertices. Below is the snippet that will do the job. There are 8 vertices grouped in 1 set. `v` select the vertex, `vi` (where `i = 1, 2, 3, ...`) "click" the vertex selected in `v` to add it to the set. ``` myInstances = mdb.models['Model-8'].rootAssembly.instances v=myInstances[myModule+'_'+myRigidBeamName+'-'+'1'].vertices.getClosest(coordinates=(((75, 125, 0)),)) v1=myInstances[myModule+'_'+myRigidBeamName+'-'+'1'].vertices.findAt((((v[0][1])),)) v=myInstances[myModule+'_'+myRigidBeamName+'-'+'2'].vertices.getClosest(coordinates=(((75, 125, 35)),)) v2=myInstances[myModule+'_'+myRigidBeamName+'-'+'2'].vertices.findAt((((v[0][1])),)) v=myInstances[myModule+'_'+myRigidBeamName+'-'+'3'].vertices.getClosest(coordinates=(((75, 125, 30)),)) v3=myInstances[myModule+'_'+myRigidBeamName+'-'+'3'].vertices.findAt((((v[0][1])),)) v=myInstances[myModule+'_'+myRigidBeamName+'-'+'4'].vertices.getClosest(coordinates=(((75, 125, 25)),)) v4=myInstances[myModule+'_'+myRigidBeamName+'-'+'4'].vertices.findAt((((v[0][1])),)) v=myInstances[myModule+'_'+myRigidBeamName+'-'+'5'].vertices.getClosest(coordinates=(((75, 125, 20)),)) v5=myInstances[myModule+'_'+myRigidBeamName+'-'+'5'].vertices.findAt((((v[0][1])),)) v=myInstances[myModule+'_'+myRigidBeamName+'-'+'6'].vertices.getClosest(coordinates=(((75, 125, 15)),)) v6=myInstances[myModule+'_'+myRigidBeamName+'-'+'6'].vertices.findAt((((v[0][1])),)) v=myInstances[myModule+'_'+myRigidBeamName+'-'+'7'].vertices.getClosest(coordinates=(((75, 125, 10)),)) v7=myInstances[myModule+'_'+myRigidBeamName+'-'+'7'].vertices.findAt((((v[0][1])),)) v=myInstances[myModule+'_'+myRigidBeamName+'-'+'8'].vertices.getClosest(coordinates=(((75, 125, 5)),)) v8=myInstances[myModule+'_'+myRigidBeamName+'-'+'8'].vertices.findAt((((v[0][1])),)) mdb.models['Model-8'].rootAssembly.Set(name='Set-4', vertices=v1+v2+v3+v4+v5+v6+v7+v8) ```
null
CC BY-SA 4.0
null
2023-02-18T15:25:41.227
2023-02-18T15:25:41.227
null
null
21,239,808
null
75,494,920
2
null
68,153,209
0
null
If you're okay with using dependencies, here's a solution using [SwiftUI-Introspect](https://github.com/siteline/swiftui-introspect) ``` struct SearchView: View { @State var searchText = "" let names: [String] = ["Joe", "Dylan", "Jim", "Andy"] var body: some View { NavigationView { List { ForEach(names, id: \.self) { name in Text(name) } } .navigationBarTitle("Search") .searchable(text: $searchText, placement: .navigationBarDrawer(displayMode: .always)) .introspectNavigationController { navigationController in navigationController.navigationBar.sizeToFit() } } } } ``` Basically, I found the original UIKit answer from [here](https://stackoverflow.com/questions/58727139/show-search-bar-in-navigation-bar-and-large-title-also-without-scrolling-on-ios/61449368#61449368) and found that asking the navigationController to call `sizeToFit()` fixed the issue (in my testing). From the [documentation](https://developer.apple.com/documentation/uikit/uiview/1622630-sizetofit), sizeToFit tells the navigation bar to resize itself to its own needs which is to have a large title. I believe this was a SwiftUI bug in iOS 15 which is now fixed in iOS 16+ since this behavior no longer happens when using `.navigationBarDrawer(displayMode: .always)` with searchable.
null
CC BY-SA 4.0
null
2023-02-18T17:00:58.140
2023-02-18T17:00:58.140
null
null
17,525,181
null
75,495,107
2
null
75,494,982
0
null
I found the mistake. This permission shouldn't request these page permissions using FB Login. As long as they are approved at app and page level, I should be able to use it.
null
CC BY-SA 4.0
null
2023-02-18T17:28:35.173
2023-02-18T17:28:35.173
null
null
15,227,157
null
75,495,193
2
null
75,495,118
1
null
``` .input_box { display: flex; align-items: center; } ``` You may add the above style to your input box's outer div so that it will behave as a flexbox container vertically aligning its items. To align items horizontally you can add `justify-content: center;`.
null
CC BY-SA 4.0
null
2023-02-18T17:40:12.027
2023-02-20T09:50:33.037
2023-02-20T09:50:33.037
1,221,208
21,119,879
null
75,495,274
2
null
19,972,313
0
null
The answer is right, but I thought I'd add a note for people struggling with this. If you `binding.pry` into your Rails controller, you can use ``` request.headers.to_h ``` This will get you a complete list of all of the headers. This makes it easier to track down that, for example, your header `authentication_token` has been translated into `HTTP_AUTHENTICATION_TOKEN`.
null
CC BY-SA 4.0
null
2023-02-18T17:51:49.753
2023-02-18T17:51:49.753
null
null
6,562,066
null
75,495,554
2
null
75,494,746
0
null
you can use regular `get_attribute()` function ``` select = Select(driver.find_element(By.CSS_SELECTOR, "yout_selector")) select.select_by_visible_text("visible_text") selected_option = select.first_selected_option option_value = selected_option.get_attribute("value") print("Value of selected option is:" + option_value ) ``` `first_selected_option` propert convert item into Webelement. so, you can use regular Webelement functions to do any operation you want.
null
CC BY-SA 4.0
null
2023-02-18T18:39:42.270
2023-02-18T18:39:42.270
null
null
5,295,657
null
75,495,632
2
null
75,495,396
1
null
``` unsigned long long upow(unsigned x) { unsigned long long result = 1; while(x--) result *= 10; return result; } unsigned long long getID(unsigned sNum, unsigned yStart, unsigned yEnd, unsigned programe) { return (yEnd - yStart) * upow(4) + sNum + (programe % 100) * upow(6) + (yStart % 10000) * upow(8); } unsigned long long extract(unsigned long long num, unsigned start, unsigned end) { num /= upow(start - 1); num %= upow(end - start + 1); return num; } int main(void) { unsigned long long id = getID(1234, 2020, 2024, 78); printf("%llu\n", id); printf("%llu\n", extract(id, 4, 7)); } ``` You need to add some parameter checks (to see if they are valid)
null
CC BY-SA 4.0
null
2023-02-18T18:50:19.633
2023-02-18T18:50:19.633
null
null
6,110,094
null
75,495,919
2
null
26,724,658
0
null
### Simple and responsive solution using grid: ``` .index-item { display: grid; justify-content: space-between; align-items: baseline; grid-template-columns: auto 1fr auto; gap: .5rem; padding-block: .5rem; } .index-line { height: 3px; min-width: 15px; background: linear-gradient(90deg, #888 2.5%, #fff 2.5%, #fff 47.5%, #888 47.5%, #888 52.5%, #fff 52.5%, #fff 97.5%, #888 97.5%); background-size: 10px 10px; background-position: 50px 50px; } ``` ``` <div class="index-item"> <div class="index-title">Page Title</div> <span class="index-line"></span> <div class="index-number">200</div> </div> <div class="index-item"> <div class="index-title">Page Title (long title)</div> <span class="index-line"></span> <div class="index-number">230</div> </div> ```
null
CC BY-SA 4.0
null
2023-02-18T19:36:09.027
2023-02-18T19:36:09.027
null
null
2,269,902
null
75,495,937
2
null
75,495,579
0
null
If you want to write multiple values under the new child, you can do: ``` ref .child('Database') .push() .set({ 'Title': _titleController.text, 'land': 'Germany', 'stadt': 'Berlin' }) ``` Also see the example in the Firebase documentation on [writing data](https://firebase.google.com/docs/database/flutter/read-and-write#write_data).
null
CC BY-SA 4.0
null
2023-02-18T19:39:39.243
2023-02-18T19:39:39.243
null
null
209,103
null
75,496,323
2
null
75,494,746
1
null
The [first_selected_option](https://www.selenium.dev/selenium/docs/api/py/webdriver_support/selenium.webdriver.support.select.html#selenium.webdriver.support.select.Select.first_selected_option) attribute returns the first selected option in this select tag (or the currently selected option in a normal select). --- ## Solution To print the value of the attribute of the selected option you can use the `get_attribute()` method as follows: ``` select = Select(driver.find_element(By.XPATH, "//select[@id='client.select.communication'])) select.select_by_value("1") print(select.first_selected_option.get_attribute("value")) # prints -> 1 ``` : You have to add the following imports : ``` from selenium.webdriver.common.by import By ```
null
CC BY-SA 4.0
null
2023-02-18T20:52:29.280
2023-02-18T20:52:29.280
null
null
7,429,447
null
75,496,639
2
null
75,467,875
0
null
For what I can see the model is not learning, it's returning the same predictions for all inputs. - `model.add(Dense(6, activation = 'softmax'))`- - `val_accuracy``val_loss`- `categorical_crossentropy``sparse_categorical_crossentropy`
null
CC BY-SA 4.0
null
2023-02-18T21:56:49.110
2023-02-18T21:56:49.110
null
null
17,298,473
null
75,496,712
2
null
74,894,455
0
null
I had the same problem. What I did was to install Python on my computer and not forget to mark the "PATH" option: ![enter image description here](https://i.stack.imgur.com/puQmD.png)
null
CC BY-SA 4.0
null
2023-02-18T22:13:34.750
2023-02-22T19:49:58.060
2023-02-22T19:49:58.060
10,871,073
21,241,834
null
75,496,942
2
null
75,495,118
0
null
``` .input_box { box-sizing: border-box; width: 519px; height: 26px; margin: 0 auto; float : none;} ```
null
CC BY-SA 4.0
null
2023-02-18T23:07:40.300
2023-02-18T23:07:40.300
null
null
11,887,641
null
75,497,070
2
null
26,090,873
0
null
I know its an old Question But the answer is really simple, make the client create a request: Client UDP ----- data Request ----> to server the server is receiving with `DatagramPacket`, after a client make a request, you can send the data using client's address and port, Example: ``` byte[] buff = new byte[20]; DatagramPacket receive = new DatagramPacket(buff, buff.length, InetAddress.getByName(ADDRESS), PORT); socket.receive(receive); // the server will wait to a client to connect ``` lets say the client sent `Hello server` after that you could just do (the endpoint is for the client): ``` DatagramPacket sendData = new DatagramPacket(buff, buff.length, receive.getAddress(), receive.getPort()); socket.send(sendData) ```
null
CC BY-SA 4.0
null
2023-02-18T23:37:15.353
2023-02-18T23:37:15.353
null
null
12,249,422
null
75,497,088
2
null
57,242,208
0
null
Had the same problem and revolved it by importing umap as something other than "umap" ``` import umap as mp reducer = mp.UMAP() ```
null
CC BY-SA 4.0
null
2023-02-18T23:40:40.537
2023-02-18T23:40:40.537
null
null
21,242,066
null
75,497,200
2
null
10,865,957
0
null
Here’s a generic way of doing it. ``` #include <string> #include <stdio.h> auto print_helper(auto const & t){ return t; } auto print_helper(std::string const & s){ return s.c_str(); } std::string four(){ return "four"; } template<class ... Args> void print(char const * fmt, Args&& ...args){ printf(fmt, print_helper(args) ...); } int main(){ std::string one {"one"}; char const * three = "three"; print("%c %d %s %s, %s five", 'c', 3+4, one + " two", three, four()); } ```
null
CC BY-SA 4.0
null
2023-02-19T00:08:50.597
2023-02-19T00:08:50.597
null
null
832,009
null
75,497,402
2
null
75,495,966
0
null
You should [install Terraform](https://developer.hashicorp.com/terraform/downloads) on your machine before, then install [Hashicorp's official Terraform](https://marketplace.visualstudio.com/items?itemName=HashiCorp.terraform) extension, if it's already installed upgrade it (seems that [their bug](https://github.com/hashicorp/terraform-ls/issues/768) is fixed now) Then, on your VS Code press `CMD+Shift+X` And make sure that your extension is enabled. Also, try reloading your extension by reloading your window as their documentation states: > You can reload the Terraform extension by opening the command palette and starting to type Reload. A list of commands will appear, select Reload Window. This will reload the Visual Studio Code window without closing down the entire editor, and without losing any work currently open in the editor. --- After you install Terraform and the extension, you should have VS Code open in the same directory where you ran `terraform init` as it will load your locally installed modules and loads your providers' configuration. For example, if you are pulling modules from a private registry the module documentation may not detect your schemas and then it won't offer autocompletion capabilities. If you still have issues refer to these links: [https://marketplace.visualstudio.com/items?itemName=HashiCorp.terraform#troubleshooting](https://marketplace.visualstudio.com/items?itemName=HashiCorp.terraform#troubleshooting)
null
CC BY-SA 4.0
null
2023-02-19T01:10:56.780
2023-02-19T02:20:57.323
2023-02-19T02:20:57.323
5,078,746
5,078,746
null
75,497,596
2
null
75,496,792
0
null
First of all, check your syntax. JavaScript follows the core syntax of the C language. The `if` construct requires that you enclose the whole expression to be evaluated between `()`. And when you need to conditionally execute several lines, you must enclose them between `{}`. You may compare this code with yours. ``` let num1 = 176 let num2 = 345 let num3 = 1037 let num4 = 3421 let num5 = 2289 let num6 = 3044 rdoOddEven.onclick=function() { if (Number($"input[name=rdoOddEven]:checked").prop("value")%2==0) { lblOddEven.className='' lblOddEven.style.color='black' lblOddEven.value = `Mary, the number ${$("input[name=rdoOddEven]:checked").prop("value")} is even` } else if (Number($"input[name=rdoOddEven]:checked").prop("value")%2==1) { lblOddEven.className='' lblOddEven.style.color='black' lblOddEven.value = `Mary, the number ${$("input[name=rdoOddEven]:checked").prop("value")} is odd` } } ```
null
CC BY-SA 4.0
null
2023-02-19T02:15:55.933
2023-02-19T02:15:55.933
null
null
5,447,035
null
75,497,637
2
null
75,497,515
1
null
AWS provides [documentation](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/example-function-redirect-url.html) on how to redirect with CloudFront and that are Viewer Request Functions. S3 also has [documentation](https://docs.aws.amazon.com/AmazonS3/latest/userguide/how-to-page-redirect.html) on how to do redirects based on different hosts - - [example](https://docs.aws.amazon.com/AmazonS3/latest/userguide/how-to-page-redirect.html#advanced-conditional-redirects)
null
CC BY-SA 4.0
null
2023-02-19T02:27:05.343
2023-02-19T02:27:05.343
null
null
127,400
null
75,497,854
2
null
57,940,613
-2
null
Tried using Git Bash Here & it worked. Thanks
null
CC BY-SA 4.0
null
2023-02-19T03:44:33.757
2023-02-19T03:44:33.757
null
null
3,660,500
null
75,497,954
2
null
75,497,929
1
null
It's very likely that you have blank spaces in the name of your columns. Try removing those spaces doing this... ``` import pandas as pd df = pd.read_csv("30mindata.csv") df.columns = [col.strip() for col in df.columns] ``` Then try to drop the columns as before
null
CC BY-SA 4.0
null
2023-02-19T04:16:55.767
2023-02-19T04:16:55.767
null
null
17,749,677
null
75,498,003
2
null
75,492,141
1
null
You have a circular dependency between [the module exporting CarObj and re-export Text (index.ts)](https://github.com/Bug-Duck/newcar/blob/ef27a6a9d559d6bd1d02f612a5d046fc9b064ccb/packages/objects/src/index.ts) and [the module importing CarObj and exporting Text (text.ts)](https://github.com/Bug-Duck/newcar/blob/ef27a6a9d559d6bd1d02f612a5d046fc9b064ccb/packages/objects/src/lib/text.ts). When you attempt to import anything from (like your entrypoint does) - it doesn't matter whether that's `CarObj` or `Text` or nothing - then it will first load , then load its dependencies, including , which in turn loads its dependencies that were not already loaded. After all variables are declared and imports/exports are set up, when all of ' dependencies are met - again excluding which is already in the process of being imported - it is executed, attempting to initialise the `class Text`, and runs into an error because the `CarObj` it attempts to extend is still in the [temporal dead zone](https://stackoverflow.com/q/33198849/1048572). If it had finished, the module could have been executed after all its dependencies were met, and so on, back until the entry point. So this is not a problem of rollup, it just bundles the code in the same order, with the same scopes, as it would have been executed with individual modules. Which leads to the same exception. The fix is simple: put the `class CarObj` into a separate module, and import only that in , not the that imports . ``` // index.ts export { CarObj } from "./lib/obj"; export { Text } from "./lib/text"; ``` ``` // lib/obj.ts export class CarObj { … } ``` ``` // lib/text.ts import { CarObj } from "./obj"; // ^^^^^^^ - not "../index"! export class Text extends CarObj { … } ```
null
CC BY-SA 4.0
null
2023-02-19T04:31:04.837
2023-02-19T07:07:56.983
2023-02-19T07:07:56.983
1,048,572
1,048,572
null
75,498,053
2
null
75,497,977
0
null
How about modifying your script using [this sample script](https://stackoverflow.com/a/44563639)? ### Modified script: ``` // Ref: https://stackoverflow.com/a/44563639 Object.prototype.get1stNonEmptyRowFromBottom = function (columnNumber, offsetRow = 1) { const search = this.getRange(offsetRow, columnNumber, this.getMaxRows()).createTextFinder(".").useRegularExpression(true).findPrevious(); return search ? search.getRow() : offsetRow; }; function processForm(input1, input2, input3) { var sheet = SpreadsheetApp.getActiveSheet(); var row = sheet.get1stNonEmptyRowFromBottom(2) + 1; // Last row of column "B". // sheet.insertRowAfter(row); // If you want to use this line, please enable this. sheet.getRange(row, 2, 1, 3).setValues([[input1, input2, input3]]); return true; } function processForm1(input4, input5, input6) { var sheet = SpreadsheetApp.getActiveSheet(); var row = sheet.get1stNonEmptyRowFromBottom(7) + 1; // Last row of column "G". // sheet.insertRowAfter(row); // If you want to use this line, please enable this. sheet.getRange(row, 7, 1, 3).setValues([[input4, input5, input6]]); return true; } ``` - `processForm``processForm1` ### Reference: - - [Determining the last row in a single column](https://stackoverflow.com/q/17632165)
null
CC BY-SA 4.0
null
2023-02-19T04:44:14.020
2023-02-19T04:44:14.020
null
null
7,108,653
null
75,498,070
2
null
75,498,046
1
null
You need pivoting logic here, e.g. ``` SELECT parent_id, MAX(CASE WHEN properties_field_name = 'Status' THEN properties_field_value_name END) AS REQ_STATUS, MAX(CASE WHEN properties_field_name = 'Type' THEN properties_field_value_name END) AS REQ_TYPE, MAX(CASE WHEN properties_field_name = 'Description' THEN properties_field_value_name END) AS REQ_DESC FROM yourTable GROUP BY parent_id ORDER BY parent_id; ```
null
CC BY-SA 4.0
null
2023-02-19T04:50:00.413
2023-02-19T04:50:00.413
null
null
1,863,229
null
75,498,130
2
null
75,498,046
0
null
You can do it with MAX like Tim shows or you can do it with joins like this: ``` SELECT parent_id, status.properties_field_value_name as status, type.properties_field_value_name as type, desc.properties_field_value_name as desc FROM ( SELECT distinct partent_id FROM thetableyoudidnotname ) as base LEFT JOIN thetableyoudidnotname as status on base.parent_id = status.parent_id and status.properties_field_name = 'Status' LEFT JOIN thetableyoudidnotname as type on base.parent_id = type.parent_id and type.properties_field_name = 'Type' LEFT JOIN thetableyoudidnotname as desc on base.parent_id = desc.parent_id and desc.properties_field_name = 'Description' ```
null
CC BY-SA 4.0
null
2023-02-19T05:08:53.120
2023-02-19T05:08:53.120
null
null
215,752
null
75,498,134
2
null
75,498,046
0
null
Simple pivot problem I think. ``` data = [ [7024549, 'Status', 'Approved'], [7024549, 'Type', 'Jama Design'], [7024549, 'Description', 'null'] ] df = spark.createDataFrame(data, ['parent_id', 'properties_field_name', 'properties_field_value_name']) df.withColumn('id', f.expr('uuid()')) \ .withColumn('properties_field_name', f.concat(f.lit('REQ_'), f.upper(f.col('properties_field_name')))) \ .groupBy('id', 'parent_id') \ .pivot('properties_field_name') \ .agg(f.first('properties_field_value_name')) \ .drop('id') \ .show() +---------+---------------+----------+-----------+ |parent_id|REQ_DESCRIPTION|REQ_STATUS| REQ_TYPE| +---------+---------------+----------+-----------+ | 7024549| null| Approved| null| | 7024549| null| null|Jama Design| | 7024549| null| null| null| +---------+---------------+----------+-----------+ ```
null
CC BY-SA 4.0
null
2023-02-19T05:12:19.523
2023-02-19T05:12:19.523
null
null
11,841,571
null
75,498,151
2
null
34,697,559
1
null
One problems that many of the existing answers run into is that `Qt` seems to have an undocumented implicit assumption that by default image lines need to start on a 32 bit boundary. For images with alpha channel that is automatically the case, but for `RGB` images that have sizes that are not divisible by 4 it is not, and the resulting `QImage` typically looks grey and skewed, or it could crash. The easiest solution is to use the `bytesPerLine` parameter of the `QImage` constructor to explicitly tell it to start the next line at the right position and `RGB` works fine (no clue why it doesn't do that automatically): ``` im = im.convert("RGB") data = im.tobytes("raw", "RGB") qi = QImage(data, im.size[0], im.size[1], im.size[0]*3, QImage.Format.Format_RGB888) pix = QPixmap.fromImage(qi) ``` Another possible reason for crashes is the `data` retention. `QImage` does not make a copy of or add a reference to the data, it assumes the `data` is valid until the `QImage` is destroyed. For this specific answer which immediately transforms the `QImage` into a `QPixmap` it shouldn't matter, as the `QPixmap` keeps a copy of the data, but if for whatever reason you hang on to the `QImage`, you also need to keep a reference to the `data` around.
null
CC BY-SA 4.0
null
2023-02-19T05:17:47.077
2023-02-19T05:17:47.077
null
null
1,091,935
null
75,498,266
2
null
75,486,935
0
null
This is because you are passing 0 and 1 values () to the plotting function. The ROC curve can only be figured out, when you provide floats in a range of 0.0 to 1.0 () such that the ROC curve can consider multiple cutoff values and appears more "smooth" as a result. Whatever classifier you are using, make sure y_train_pred contains float values in the range [0.0,1.0]. If you have a scoring classifier with values in the range [-∞,+∞] you can apply a [sigmoid function](https://en.wikipedia.org/wiki/Sigmoid_function) to remap the values to this range.
null
CC BY-SA 4.0
null
2023-02-19T05:54:52.833
2023-02-19T06:00:19.543
2023-02-19T06:00:19.543
12,403,534
12,403,534
null
75,498,287
2
null
75,495,396
2
null
- Make certain the right-hand side of the `=` uses wide enough math. OP's code, as is, may risk `int` overflow. `int` is not certainly wide enough for 12 decimal digit math. `long long` good for at least 18 decimal digits.- Assign the result to a wide enough type too. Use `long long` constants to coax the math into `long long`. ``` // int id_num = start_year * 100000000 + program_num * 1000000 + prog_years * 10000 + uniq_id; long long id_num = start_year*100000000LL + program_num*1000000LL + prog_years*10000LL + uniq_id; ... // int desired_digits = (id_num / div) % (int) pow(10, loc_diff + 1); long long desired_digits = (id_num / div) % (long long) pow(10, loc_diff + 1); ``` - `pow()``pow()` ``` // I assert this code also fulfills // "Any use of logical operators, relational operators, bool variables, ... is prohibited" // It may/may not also fulfill "or selection constructs". Unclear what OP means by that. // If `"selection" means `if, switch, _Generic`, then code does not use those. long long ipowll(int base, unsigned exponent) { long long ibase = base; long long ipower = 1; while (exponent) { // This abbreviated code here does not check or prevent overflow. // Added tests needed for that. ipower *= (long long[2]) {1, ibase}[exponent % 2]; ibase *= ibase; exponent /= 2; } return ipower; } ``` - `unsigned``unsigned long long`
null
CC BY-SA 4.0
null
2023-02-19T06:00:04.523
2023-02-19T06:50:54.490
2023-02-19T06:50:54.490
2,410,359
2,410,359
null