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
list
73,781,139
2
null
73,781,005
0
null
I'm usually like this, without using {} ``` import VueRouter from "vue-router"; const routes = [ { path: "/", name: "Home", component: Home, }, ]; const router = new VueRouter({ mode: "history", base: process.env.BASE_URL, routes, }); ```
null
CC BY-SA 4.0
null
2022-09-20T02:51:26.573
2022-09-20T02:52:16.480
2022-09-20T02:52:16.480
8,816,585
19,981,108
null
73,781,370
2
null
63,678,170
2
null
the reason is newer version of traitlets (5.0.0) installed by VSCode into the new virtual environment; but the ipykernel and tornado is incompatible with ipykernel and tornado; run the code in Terminal: pip install --upgrade ipykernel pip install --upgrade tornado
null
CC BY-SA 4.0
null
2022-09-20T03:33:57.667
2022-09-20T03:33:57.667
null
null
20,038,790
null
73,781,538
2
null
73,781,228
1
null
I found the reason, because when DataCompression is decompressing data, there is an exception when it adapts to Swift 5.7. Currently, I am using version 3.6.0, and I can update it to 3.7.0. [https://github.com/mw99/DataCompression](https://github.com/mw99/DataCompression)
null
CC BY-SA 4.0
null
2022-09-20T04:03:26.197
2022-09-20T04:03:26.197
null
null
9,260,947
null
73,781,591
2
null
73,770,905
11
null
After doing much exploratory work, I came to the conclusion that approach 2 is the most promising direction. Since division is very fast on the asker's platform, rational approximations are attractive. The platform's support for FMA should be exploited aggressively. Below I am showing C code that implements a fast `tanhf()` in seven operations and achieves maximum absolute error of less than 2.8e-3. I used the Remez algorithm to compute the coefficients for the rational approximation and used a heuristic search to reduce these coefficients to as few bits as feasible, which may benefit some processor architectures that are able to incorporate floating-point data into an immediate field of commonly used floating-point instructions. ``` #include <stdio.h> #include <stdlib.h> #include <math.h> /* Fast computation of hyperbolic tangent. Rational approximation with clamping. Maximum absolute errror = 2.77074604e-3 @ +/-3.29019976 */ float fast_tanhf_rat (float x) { const float n0 = -8.73291016e-1f; // -0x1.bf2000p-1 const float n1 = -2.76107788e-2f; // -0x1.c46000p-6 const float d0 = 2.79589844e+0f; // 0x1.65e000p+1 float x2 = x * x; float num = fmaf (n0, x2, n1); float den = x2 + d0; float quot = num / den; float res = fmaf (quot, x, x); res = fminf (fmaxf (res, -1.0f), 1.0f); return res; } int main (void) { double ref, err, maxerr = 0; float arg, res, maxerrloc = INFINITY; maxerr = 0; arg = 0.0f; while (arg < 0x1.0p64f) { res = fast_tanhf_rat (arg); ref = tanh ((double)arg); err = fabs ((double)res - ref); if (err > maxerr) { maxerr = err; maxerrloc = arg; } arg = nextafterf (arg, INFINITY); } arg = -0.0f; while (arg > -0x1.0p64f) { res = fast_tanhf_rat (arg); ref = tanh ((double)arg); err = fabs ((double)res - ref); if (err > maxerr) { maxerr = err; maxerrloc = arg; } arg = nextafterf (arg, -INFINITY); } printf ("maximum absolute error = %15.8e @ %15.8e\n", maxerr, maxerrloc); return EXIT_SUCCESS; } ``` Given that asker budgeted for up to ten operations, we can increase the degree of both numerator and denominator polynomials by one to achieve a fast `tanhf()` implementation comprising nine operations that has significantly lower maximum absolute error, less than 5.8e-5: ``` #include <stdio.h> #include <stdlib.h> #include <math.h> /* Fast computation of hyperbolic tangent. Rational approximation with clamping. Maximum absolute error = 5.77514052e-5 @ +/-=2.22759748 */ float fast_tanhf_rat2 (float x) { const float n0 = -9.49066162e-1f; // -0x1.e5ec00p-1 const float n1 = -2.68447266e+1f; // -0x1.ad8400p+4 const float n2 = -2.01115608e-2f; // -0x1.498200p-6 const float d0 = 3.49853516e+1f; // 0x1.17e200p+5 const float d1 = 8.07031250e+1f; // 0x1.42d000p+6 float x2 = x * x; float num = fmaf (fmaf (n0, x2, n1), x2, n2); float den = fmaf (x2 + d0, x2, d1); float quot = num / den; float res = fmaf (quot, x, x); res = fminf (fmaxf (res, -1.0f), 1.0f); return res; } int main (void) { double ref, err, maxerr = 0; float arg, res, maxerrloc = INFINITY; maxerr = 0; arg = 0.0f; while (arg < 0x1.0p32f) { res = fast_tanhf_rat2 (arg); ref = tanh ((double)arg); err = fabs ((double)res - ref); if (err > maxerr) { maxerr = err; maxerrloc = arg; } arg = nextafterf (arg, INFINITY); } arg = -0.0f; while (arg > -0x1.0p32f) { res = fast_tanhf_rat2 (arg); ref = tanh ((double)arg); err = fabs ((double)res - ref); if (err > maxerr) { maxerr = err; maxerrloc = arg; } arg = nextafterf (arg, -INFINITY); } printf ("maximum absolute error = %15.8e @ %15.8e\n", maxerr, maxerrloc); return EXIT_SUCCESS; } ``` Clamping the output of the approximation to the interval [-1, 1] is unnecessary if we can guarantee that the approximation can produces values outside this range. Single-precision implementations can be tested exhaustively, so one can show that by adjusting the coefficients of the approximation slightly this can be successfully enforces. By clamping the to a specific single-precision number for which the approximation returns the value ±1, the correct asymptotic behavior is achieved. This requires that all basic arithmetic operations and in particular the division are compliant with IEEE-754 and thus correctly rounded, all operands are IEEE-754 `binary32` operands, and that rounding to nearest-or-even is in effect. Using the maximum of 10 operations allowed by the asker, maximum absolute error of less than 2.0e-5 can be achieved: ``` #include <stdio.h> #include <stdlib.h> #include <math.h> /* Fast computation of hyperbolic tangent. Rational approximation with clamping of the argument. Maximum absolute error = 1.98537030e-5, maximum relative error = 1.98540995e-5, maximum ulp error = 333.089863. */ float fast_tanhf_rat3 (float x) // 10 operations { const float cutoff = 5.76110792f; // 0x1.70b5fep+2 const float n0 = -1.60153955e-4f; // -0x1.4fde00p-13 const float n1 = -9.34448242e-1f; // -0x1.de7000p-1 const float n2 = -2.19176636e+1f; // -0x1.5eaec0p+4 const float d0 = 2.90915985e+1f; // 0x1.d17730p+4 const float d1 = 6.57667847e+1f; // 0x1.071130p+6 float y = fminf (fmaxf (x, -cutoff), cutoff); float y2 = y * y; float num = fmaf (fmaf (n0, y2, n1), y2, n2) * y2; float den = fmaf (y2 + d0, y2, d1); float quot = num / den; float res = fmaf (quot, y, y); return res; } int main (void) { double ref, abserr, relerr, maxabserr = 0, maxrelerr = 0; float arg, res, maxabserrloc = INFINITY, maxrelerrloc = INFINITY; maxabserr = 0; maxrelerr = 0; arg = 0.0f; while (arg < INFINITY) { res = fast_tanhf_rat3 (arg); if (res > 1) { printf ("error at %15.8e: result out of bounds\n", arg); return EXIT_FAILURE; } ref = tanh ((double)arg); abserr = fabs ((double)res - ref); if (abserr > maxabserr) { maxabserr = abserr; maxabserrloc = arg; } relerr = fabs (((double)res - ref) / ref); if (relerr > maxrelerr) { maxrelerr = relerr; maxrelerrloc = arg; } arg = nextafterf (arg, INFINITY); } arg = -0.0f; while (arg > -INFINITY) { res = fast_tanhf_rat3 (arg); if (res < -1) { printf ("error at %15.8e: result out of bounds\n", arg); return EXIT_FAILURE; } ref = tanh ((double)arg); abserr = fabs ((double)res - ref); if (abserr > maxabserr) { maxabserr = abserr; maxabserrloc = arg; } relerr = fabs (((double)res - ref) / ref); if (relerr > maxrelerr) { maxrelerr = relerr; maxrelerrloc = arg; } arg = nextafterf (arg, -INFINITY); } printf ("maximum absolute error = %15.8e @ %15.8e\n", maxabserr, maxabserrloc); printf ("maximum relative error = %15.8e @ %15.8e\n", maxrelerr, maxrelerrloc); return EXIT_SUCCESS; } ```
null
CC BY-SA 4.0
null
2022-09-20T04:13:34.673
2022-10-02T04:04:57.287
2022-10-02T04:04:57.287
780,717
780,717
null
73,781,767
2
null
73,781,400
0
null
Your response.body() must be a JsonEntity. something like this ``` { key1: "value", key2: "value" } ``` So basically you have to the key that is relevant to you using `value=response.body.optString("key1")` then use the value and check if you're getting the correct value and do the rest of the operations. The response.body() gives you the whole Json.
null
CC BY-SA 4.0
null
2022-09-20T04:48:34.147
2022-09-20T04:48:34.147
null
null
13,533,028
null
73,781,876
2
null
12,037,494
0
null
You need an intercept in your loglog plot, right now it is 0. That frequency the inverse rank implies that there is a ratio K between the frequency and the inverse rank, so you need to fit:
null
CC BY-SA 4.0
null
2022-09-20T05:09:02.303
2022-09-20T05:09:02.303
null
null
11,148,296
null
73,781,928
2
null
71,747,446
0
null
``` implementation "androidx.compose.material3:material3:1.0.0-alpha16" ``` With the dependency above, you can change the DropdownMenu Background color with the `Modifier` `modifier = Modifier.background(Color.Blue),` ``` @Composable fun ListItemPopupMenu( menuItems: List<String>, onClickListeners: List<() -> Unit>, onDismiss: () -> Unit, showMenu: Boolean, ) { DropdownMenu( modifier = Modifier.background(Color.Blue), expanded = showMenu, onDismissRequest = { onDismiss() }, ) { menuItems.forEachIndexed { index, item -> DropdownMenuItem( text = { Text(text = item) }, onClick = { onDismiss() onClickListeners[index].invoke() } ) } } } ``` Here is the preview ``` @Preview @Composable fun PreviewListItemPopupMenu() { var expanded by remember { mutableStateOf(true) } ListItemPopupMenu( menuItems = listOf("Menu1", "Menu2"), onClickListeners = listOf( { // do nothing }, { // do nothing } ), onDismiss = { expanded = false }, showMenu = expanded ) } ``` [](https://i.stack.imgur.com/kWGcY.png)
null
CC BY-SA 4.0
null
2022-09-20T05:17:29.707
2022-09-20T05:17:29.707
null
null
4,593,755
null
73,782,226
2
null
23,363,073
3
null
If you are using NUnit, please make sure to add the nuget package [](https://i.stack.imgur.com/IbaV2.png) Note that use of VSIX Test adapters are deprecated in VS 2019, we recommend you to use the nuget versions of the adapter. this is from [https://marketplace.visualstudio.com/items?itemName=NUnitDevelopers.NUnit3TestAdapter](https://marketplace.visualstudio.com/items?itemName=NUnitDevelopers.NUnit3TestAdapter)
null
CC BY-SA 4.0
null
2022-09-20T06:02:56.127
2022-09-20T06:02:56.127
null
null
2,490,152
null
73,782,305
2
null
73,781,670
0
null
you can use sort method eg: ``` $collection->sortKeysDesc(); ```
null
CC BY-SA 4.0
null
2022-09-20T06:14:49.700
2022-09-20T06:14:49.700
null
null
6,546,001
null
73,782,399
2
null
39,432,960
0
null
put a column in notepad ++ [enter image description here](https://i.stack.imgur.com/Zkq0y.png) make replace, and return column to GD
null
CC BY-SA 4.0
null
2022-09-20T06:27:12.373
2022-09-20T06:27:12.373
null
null
20,039,683
null
73,782,432
2
null
60,614,786
-1
null
I met a similar problem and resolved it, there are two ways: (1) The hive lock information is stored at a mysql table called `hive.hive_locks`, so you can delete relevant rows about your sql table, or truncate that table. But this way cannot fix the problem permanently. (2) Add a configuration in `hive-site.xml`, just like this: ``` <property> <name>metastore.task.threads.always</name> <value>org.apache.hadoop.hive.metastore.events.EventCleanerTask,org.apache.hadoop.hive.metastore.RuntimeStatsCleanerTask,org.apache.hadoop.hive.metastore.repl.DumpDirCleanerTask,org.apache.hadoop.hive.metastore.txn.AcidHouseKeeperService</value> </property> ``` You can also refer to the answer on this question, i made a detailed explanation about the second way: [https://stackoverflow.com/a/73771475/9120595](https://stackoverflow.com/a/73771475/9120595)
null
CC BY-SA 4.0
null
2022-09-20T06:31:09.513
2022-09-20T09:03:23.773
2022-09-20T09:03:23.773
9,120,595
9,120,595
null
73,782,469
2
null
73,771,394
0
null
I created an Azure AD B2C application and granted API permissions like below: Make sure to grant `IdentityUserFlow.ReadWrite.All` permission: ![enter image description here](https://i.imgur.com/iz2SNLK.png) ``` https://login.microsoftonline.com/TenantID/oauth2/v2.0/token client_id=Your_client_ID client_secret=Your_client_Secret grant_type=client_credentials scope=https://graph.microsoft.com/.default ``` ![enter image description here](https://i.imgur.com/VitolCh.png) In , select Type as Bearer Token and paste the access token like below: ![enter image description here](https://i.imgur.com/HVhdC2y.png) In the Header tab, add `Content-type: application/json` and In the add like below: ``` { "id": "testuserflow", "userFlowType": "passwordReset", "userFlowTypeVersion": 3 } ``` ![enter image description here](https://i.imgur.com/BrCsiSC.png) ``` POST https://graph.microsoft.com/beta/identity/b2cUserFlows ``` ![enter image description here](https://i.imgur.com/LWCSAnJ.png) ![enter image description here](https://i.imgur.com/W7rkvdG.png)
null
CC BY-SA 4.0
null
2022-09-20T06:34:15.040
2022-09-20T06:39:35.427
2022-09-20T06:39:35.427
18,229,928
18,229,928
null
73,782,497
2
null
73,781,774
1
null
See the documentation [Customize a color scheme](https://www.jetbrains.com/help/pycharm/configuring-colors-and-fonts.html#customize-color-scheme). The color can be changed by going to `File` `>` `Settings` `>` `Editor` `>` `General` `>` `Color Sheme` `>` `XML` and adjusting the color for `Matched Tag` in that window. As shown in the screenshot: [](https://i.stack.imgur.com/ecJTA.png)
null
CC BY-SA 4.0
null
2022-09-20T06:36:31.777
2022-09-20T06:36:31.777
null
null
10,794,031
null
73,782,801
2
null
73,256,552
0
null
I observed the same issue with the locator() function in Rstudio. In my case I found that wrong coordinates are read if zoom settings in global options are different from 100%. Try this: Tools -> Global Options... -> Appearance -> Zoom: 100%
null
CC BY-SA 4.0
null
2022-09-20T07:07:39.523
2022-09-20T07:07:39.523
null
null
20,040,017
null
73,783,015
2
null
16,660,039
0
null
> After alot of searching and testing, I upgraded my gradle version and its work for me. Just goto `File -> Project Structure` or press `Ctrl + Alt + Shift + S` and then `upgrate the gradle version` as shown in the image below and then `invalidate cache and restart` the Android Studio and its working [](https://i.stack.imgur.com/h0av9.png) As shown in the image I upgrade my gradle Happy Coding With Android Studio :)
null
CC BY-SA 4.0
null
2022-09-20T07:28:16.120
2022-09-20T07:28:16.120
null
null
13,261,376
null
73,783,024
2
null
73,781,287
0
null
``` Dim cd As New ChromeDriver cd.AddArgument "--disable-print-preview" cd.Start cd.Get "https://www.google.com/" cd.Window.Maximize cd.ExecuteScript ("print()") ``` Thank @AbiSaran
null
CC BY-SA 4.0
null
2022-09-20T07:28:59.383
2022-09-20T07:28:59.383
null
null
9,047,291
null
73,783,237
2
null
73,618,953
0
null
I had it also. Upgraded and now it works with "bootstrap": "^5.2.1", But I am not sure what the problem was. If you copy sample code from the bootstrap website check the element IDs carefully. I had to adjust mine. If using vue make sure the DOM is ready: ``` // import { Carousel } from 'bootstrap' // import * as bootstrap from 'bootstrap' import Carousel from 'bootstrap/js/dist/carousel' onMounted(() => { const carousel = new Carousel('#myCarousel') }) ``` Also I changed the import statement according to this manual: [https://getbootstrap.com/docs/5.2/customize/optimize/](https://getbootstrap.com/docs/5.2/customize/optimize/) I think this error is caused by the element parameter (no element) and not by the config parameter as the error message suggests
null
CC BY-SA 4.0
null
2022-09-20T07:48:32.727
2022-09-20T11:41:50.377
2022-09-20T11:41:50.377
20,040,344
20,040,344
null
73,783,253
2
null
768,282
0
null
For `DOTNET Core`, your quotes need to be escaped, like this: ``` <Target Name="PreBuild" BeforeTargets="PreBuildEvent"> <Exec Command="del &quot;$(ProjectDir)wwwroot\_framework\*.*&quot; /q" /> </Target> <Target Name="PostBuild" AfterTargets="PostBuildEvent"> <Exec Command="copy &quot;$(ProjectDir)..\Client\bin\Debug\net5.0\wwwroot\_framework\*.*&quot; &quot;$(ProjectDir)wwwroot\_framework\&quot;" /> </Target> ```
null
CC BY-SA 4.0
null
2022-09-20T07:49:51.470
2022-09-20T07:49:51.470
null
null
550,975
null
73,783,312
2
null
73,775,787
1
null
`Tesseract` is a powerful technology with . There is also an alternative way which is [EasyOCR](https://github.com/JaidedAI/EasyOCR). It is also useful for optical character recognition. When I used your input image: [](https://i.stack.imgur.com/Y5bEQ.png) with the code: ``` import easyocr reader = easyocr.Reader(['ch_sim','en']) # this needs to run only once to load the model into memory result = reader.readtext('a.png') print(result) ``` I got the results: > [([[269, 5], [397, 5], [397, 21], [269, 21]], 'Featured Products', 0.9688797744252757), ([[25, 31], [117, 31], [117, 47], [25, 47]], 'Lorem Ipsum', 0.9251252837669294), ([[513, 29], [535, 29], [535, 45], [513, 45]], '1%', 0.994760876582135), ([[643, 27], [687, 27], [687, 47], [643, 47]], '56.33', 0.9860448082309514), ([[25, 55], [117, 55], [117, 73], [25, 73]], 'Lorem Ipsum', 0.9625669229848431), ([[505, 55], [543, 55], [543, 71], [505, 71]], '2.6%', 0.9489194720877449), ([[645, 55], [687, 55], [687, 71], [645, 71]], '59.66', 0.9955955477533281), ([[25, 81], [117, 81], [117, 97], [25, 97]], 'Lorem Ipsum', 0.9347195542297398), ([[513, 79], [537, 79], [537, 95], [513, 95]], '6%', 0.9802225419827469), ([[643, 77], [687, 77], [687, 97], [643, 97]], '53.55', 0.7060389448443978), ([[25, 105], [117, 105], [117, 123], [25, 123]], 'Lorem Ipsum', 0.9813030863539253), ([[511, 105], [535, 105], [535, 121], [511, 121]], '2%', 0.96661512341383), ([[643, 105], [687, 105], [687, 121], [643, 121]], '51.00', 0.9972174551807312), ([[25, 131], [117, 131], [117, 147], [25, 147]], 'Lorem Ipsum', 0.9332194975534566), ([[637, 129], [695, 129], [695, 147], [637, 147]], '$150.00', 0.8416723013481415), ([[23, 155], [115, 155], [115, 173], [23, 173]], 'Lorem Ipsum', 0.9628505579362404), ([[619, 155], [711, 155], [711, 171], [619, 171]], 'Out Ofstock', 0.5524501407148613), ([[269, 203], [397, 203], [397, 219], [269, 219]], 'Featured Products', 0.9892802026085218), ([[25, 227], [117, 227], [117, 245], [25, 245]], 'Lorem Ipsum', 0.9816736878173294), ([[513, 227], [535, 227], [535, 241], [513, 241]], '1%', 0.7698908738878971), ([[645, 227], [687, 227], [687, 243], [645, 243]], '56.33 ', 0.5116652994056308), ([[25, 253], [117, 253], [117, 269], [25, 269]], 'Lorem Ipsum', 0.9332997726238675), ([[505, 251], [543, 251], [543, 267], [505, 267]], '2.6%', 0.5710609510357831), ([[645, 251], [687, 251], [687, 269], [645, 269]], '59.66', 0.9995503012169746), ([[25, 277], [117, 277], [117, 295], [25, 295]], 'Lorem Ipsum', 0.9626429329615878), ([[513, 277], [537, 277], [537, 293], [513, 293]], '6%', 0.9771388793180815), ([[645, 275], [687, 275], [687, 293], [645, 293]], '53.55', 0.9578577340198124), ([[269, 313], [397, 313], [397, 329], [269, 329]], 'Featured Products', 0.9701894261249253), ([[25, 339], [117, 339], [117, 355], [25, 355]], 'Lorem Ipsum', 0.9282643141918978), ([[513, 337], [535, 337], [535, 353], [513, 353]], '1%', 0.9946674557074575), ([[643, 335], [687, 335], [687, 355], [643, 355]], '56.33', 0.9876496602335217), ([[25, 363], [117, 363], [117, 381], [25, 381]], 'Lorem Ipsum', 0.9625460796304877), ([[505, 363], [543, 363], [543, 379], [505, 379]], '2.6%', 0.9337789031658965), ([[645, 363], [687, 363], [687, 379], [645, 379]], '59.66', 0.9949654211659896), ([[25, 389], [117, 389], [117, 405], [25, 405]], 'Lorem Ipsum', 0.931966914707057), ([[513, 387], [537, 387], [537, 403], [513, 403]], '6%', 0.9784907201549085), ([[643, 385], [687, 385], [687, 405], [643, 405]], '53.55', 0.5365941290893664), ([[25, 413], [117, 413], [117, 431], [25, 431]], 'Lorem Ipsum', 0.980995831244345), ([[511, 413], [535, 413], [535, 429], [511, 429]], '2%', 0.9679939124479429), ([[645, 413], [687, 413], [687, 429], [645, 429]], '51.00', 0.9964553415038925), ([[25, 439], [117, 439], [117, 455], [25, 455]], 'Lorem Ipsum', 0.9304503001919713), ([[513, 437], [537, 437], [537, 453], [513, 453]], '6%', 0.9744585914588708), ([[635, 435], [695, 435], [695, 455], [635, 455]], '$150.00', 0.9992132520533294), ([[23, 463], [115, 463], [115, 481], [23, 481]], 'Lorem Ipsum', 0.9626652609420223), ([[619, 463], [711, 463], [711, 479], [619, 479]], 'Out Ofstock', 0.5114405533530642)] This results seems complicated because it gives the coordinates of detected texts firstly. However if you look into deeply, you will see that it is really good at detecting the texts. [This video](https://www.youtube.com/watch?v=WcTSi0ZREDA&t=335s) also can help you for installation.
null
CC BY-SA 4.0
null
2022-09-20T07:55:37.060
2022-09-20T07:58:05.453
2022-09-20T07:58:05.453
1,235,698
11,048,887
null
73,784,355
2
null
73,784,301
0
null
If you want to just find percentage based on age for varying ages, you can find the distribution of ages using Counter. Since you have not provided your DataFrame, I have assumed its column as a list on my own and carried out the procedure for you. ``` import pandas as pd from collections import Counter import matplotlib.pyplot as plt import matplotlib.ticker as mtick import seaborn as sns ages = [28,28,28,28,29,29,29,29,29,30,30,30,31,31 ,31,31,31,31,31,31,32,32,32,32,32,32,33,33,33,33,33,33,34,34,34,34] df = pd.DataFrame() df['age'] = ages distribution = dict(Counter(df['age'])) x_ax = distribution.keys() y_ax = list(distribution.values()) total = sum(y_ax) for i in range(len(y_ax)): y_ax[i] = y_ax[i] * 100 / total fig, ax = plt.subplots() plt.bar(x_ax, y_ax) plt.xlabel('Age') plt.ylabel('Percentage') ax.yaxis.set_major_formatter(mtick.PercentFormatter()) ``` This returns a blue monochrome plot, however matching the rest of your specifications. [](https://i.stack.imgur.com/nXufz.png)
null
CC BY-SA 4.0
null
2022-09-20T09:19:29.343
2022-09-20T12:27:07.467
2022-09-20T12:27:07.467
20,027,126
20,027,126
null
73,785,521
2
null
73,785,082
1
null
[Relational Division](https://www.red-gate.com/simple-talk/databases/sql-server/t-sql-programming-sql-server/divided-we-stand-the-sql-of-relational-division/) There are a number of solutions. Here is a standard one. ``` SELECT com.name, per.name FROM company as com CROSS APPLY ( SELECT cp.person_id FROM company_person as cp INNER JOIN position as pos ON pos.id = cp.position_id WHERE com.id = cp.company_id AND pos.position_name IN ('CEO', 'Owner') GROUP BY cp.person_id HAVING COUNT(*) = 2 ) as cp INNER JOIN person as per ON per.id = cp.person_id; ``` If your list of positions is more dynamic, you can put them in a table variable or TVP, then do the following ``` DECLARE @input TABLE (position_name varchar(50) PRIMARY KEY); INSERT @input .... SELECT com.name, per.name FROM company as com CROSS APPLY ( SELECT cp.person_id FROM company_person as cp INNER JOIN position as pos ON pos.id = cp.position_id INNER JOIN @input as i ON i.position_name = pos.position_name WHERE com.id = cp.company_id GROUP BY cp.person_id HAVING COUNT(*) = (SELECT COUNT(*) FROM @input) ) as cp INNER JOIN person as per ON per.id = cp.person_id; ``` There are other solutions also, such as a double `NOT EXISTS` ``` SELECT com.name, per.name FROM company as com INNER JOIN person as per ON NOT EXISTS (SELECT 1 FROM position as pos INNER JOIN @input as i ON i.position_name = pos.position_name WHERE NOT EXISTS (SELECT 1 FROM company_person as cp WHERE cp.position_id = pos.id AND cp.company_id = com.id AND cp.person_id = per.id ) ); ``` Another option is a `LEFT JOIN` then check that they were all matched ``` SELECT com.name, per.name FROM company as com CROSS APPLY ( SELECT p.id, p.name FROM person as per CROSS JOIN position as pos INNER JOIN @input as i ON i.position_name = pos.position_name LEFT JOIN company_person as cp ON cp.position_id = pos.id AND cp.company_id = com.id AND per.id = cp.person_id GROUP BY p.id, p.name HAVING COUNT(*) = COUNT(cp.person_id) ) as per; ```
null
CC BY-SA 4.0
null
2022-09-20T10:51:58.173
2022-09-20T19:41:25.663
2022-09-20T19:41:25.663
14,868,997
14,868,997
null
73,785,724
2
null
73,784,801
0
null
Crystal has no option to filter crosstab. So you need to filter the report using a record selection formula. If you can't filter the whole report because you need the blank cases in other areas of the report, place the crosstab in a filtered subreport.
null
CC BY-SA 4.0
null
2022-09-20T11:09:13.857
2022-09-20T11:09:13.857
null
null
1,734,722
null
73,785,740
2
null
60,884,824
1
null
try this: put in the TextField ``` sx={{ "& label": { "&.Mui-focused": { color: 'your color*' } } }} ```
null
CC BY-SA 4.0
null
2022-09-20T11:10:36.600
2022-09-20T11:10:36.600
null
null
16,448,272
null
73,785,955
2
null
73,785,467
0
null
i think what you want is actually a concatination or pandas.concat. heres a full example. ``` import pandas as pd import numpy as np d1 = {'exp_num': ['aw23','aw23','aw23','aw23','aw23'], 'colA': [2,2,2,2,2], 'colB': [3,3,3,3,3], 'colC': [4,4,4,4,4]} df1 = pd.DataFrame(data=d1) d2 = {'exp_num': ['aw23','aw23'], 'colD': [1,2], 'ColE': [3,4]} df2 = pd.DataFrame(data=d2) ``` to show the example dataframes ``` df1.head(5) df2.head(5) ``` here's the concat and the results ``` df3 = pd.concat([df1,df2], ignore_index=True) df3.head(10) ``` just for knowledge share. The easiest way to find what you need is probably the pandas cheat sheet [https://pandas.pydata.org/Pandas_Cheat_Sheet.pdf#](https://pandas.pydata.org/Pandas_Cheat_Sheet.pdf#) if thats the right answer pls mark it. thx :) best Faby
null
CC BY-SA 4.0
null
2022-09-20T11:27:43.877
2022-09-20T11:27:43.877
null
null
16,453,326
null
73,786,383
2
null
44,410,703
1
null
## matplotlib<3.6 As mentioned by @importanceofbeingernest, with `matplotlib<3.6`, you would have to do smth like the following: ``` import matplotlib.pyplot as plt import matplotlib plt.style.use("default") plt.figure(figsize=(4,2)) plt.plot([1,2],[2,3],label=f'Matplot version {matplotlib.__version__}') l = plt.legend(title='Some Title', loc='upper left') l._legend_box.align='left' plt.show() ``` [](https://i.stack.imgur.com/oPWD3.png) ## matplotlib==3.6 (possibly also for future versions) A nifty `alignment` kwarg has been added. See [PR](https://github.com/matplotlib/matplotlib/pull/23140) and [docs](https://matplotlib.org/3.6.0/api/legend_api.html?highlight=legend#module-matplotlib.legend). ``` import matplotlib.pyplot as plt import matplotlib plt.style.use("default") plt.figure(figsize=(4,2)) plt.plot([1,2],[2,3],label=f'Matplot version {matplotlib.__version__}') plt.legend(title='Some Title', loc='upper left', alignment='left') plt.show() ``` [](https://i.stack.imgur.com/Hdar6.png) ([Note lack of alignment kwarg in v3.4.3](https://matplotlib.org/3.4.3/api/legend_api.html?highlight=legend#module-matplotlib.legend))
null
CC BY-SA 4.0
null
2022-09-20T12:00:39.077
2022-09-20T12:00:39.077
null
null
10,177,759
null
73,786,421
2
null
73,786,032
1
null
IIUC, you could try maybe something like this: ``` x = tf.tensor1d([1, 2, 3, 4, 5, 6, 7, 8]).toInt(); y = tf.range(0, x.shape[0], 1).toInt(); x.pow(y).print(); ``` ``` "Tensor [1, 2, 9, 64, 625, 7776, 117649, 2097152]" ```
null
CC BY-SA 4.0
null
2022-09-20T12:03:47.467
2022-09-20T12:03:47.467
null
null
9,657,861
null
73,786,459
2
null
58,336,354
2
null
Just create a folder at Home. Inside folder and it's gonna work correctly.
null
CC BY-SA 4.0
null
2022-09-20T12:07:33.820
2022-09-20T12:10:53.427
2022-09-20T12:10:53.427
6,100,705
6,100,705
null
73,787,191
2
null
73,784,990
0
null
Is it possible for you to modify the object class you are working with? You could try to pass a user-defined array class which owns a counter. Using operator overloading you could modify the assigment operator and increment the counter everytime `myarray[i]= newvalue` is called.
null
CC BY-SA 4.0
null
2022-09-20T13:04:01.267
2022-09-20T13:04:01.267
null
null
19,939,738
null
73,787,247
2
null
73,786,315
0
null
try: ``` =COUNTA(IFNA(FILTER(A:A; B:B>="01/01/2022"; B:B<="07/01/2022"; C:C=""))) ```
null
CC BY-SA 4.0
null
2022-09-20T13:08:55.520
2022-09-20T13:08:55.520
null
null
5,632,629
null
73,787,427
2
null
30,906,807
0
null
I had a similar assignment. This is what I did: Assignment : Clean the following text and find the most frequent word (hint, use replace and regular expressions). ``` const sentence = '%I $am@% a %tea@cher%, &and& I lo%#ve %te@a@ching%;. The@re $is no@th@ing; &as& mo@re rewarding as educa@ting &and& @emp%o@weri@ng peo@ple. ;I found tea@ching m%o@re interesting tha@n any ot#her %jo@bs. %Do@es thi%s mo@tiv#ate yo@u to be a tea@cher!? %Th#is 30#Days&OfJavaScript &is al@so $the $resu@lt of &love& of tea&ching' console.log(`\n\n 03.Clean the following text and find the most frequent word (hint, use replace and regular expressions) \n\n ${sentence} \n\n`) console.log(`Cleared sentence : ${sentence.replace(/[.,\/#!$%\^&\*;:{}=\-_`~()@]/g, "")}`) console.log(mostFrequentWord(sentence)) function mostFrequentWord(sentence) { sentence = sentence.replace(/[.,\/#!$%\^&\*;:{}=\-_`~()@]/g, "").trim().toLowerCase() let sentenceArray = sentence.split(" ") let word = null let count = 0 for (i = 0; i < sentenceArray.length; i++) { word = sentenceArray[i] count = sentence.match(RegExp(sentenceArray[i], 'gi')).length if (count > count) { count = count word = word } } return `\n Count of most frequent word "${word}" is ${count}` } ```
null
CC BY-SA 4.0
null
2022-09-20T13:21:59.693
2022-09-20T13:21:59.693
null
null
13,913,410
null
73,787,740
2
null
73,703,332
0
null
So here is how I finally did it. ``` function createTaskFn(label, messageId) { var task_value = document.getElementById(messageId).value; var task_label = document.getElementById(label).textContent; if (task_value) { final_task.innerHTML += `<span class="task_box">${task_label}: ${task_value} <a onclick="clearTask(this)"><img src="cross.png"></a></span>`; } } function clearTask(e) { e.parentElement.remove(); } ``` ``` body { display: flex; flex-direction: column; align-items: center; padding-top: 50px; } div.input_fields { display: flex; justify-content: space-between; align-items: center; width: 80%; border: 1px solid #17375e; border-radius: 15px; padding: 10px 15px; margin-bottom: 10px; } .input_fields label { width: 50%; } .input_fields select { width: 30%; padding: 3px 5px; border-radius: 10px; margin-right: 10px; } #final_task { display: flex; flex-wrap: wrap; } .task_window { display: flex; justify-content: space-between; align-items: center; width: 80%; border: 1px solid #17375e; border-radius: 15px; margin-top: 100px; padding: 10px 15px; } .task_box { border: 1px solid #17375e; padding: 3px 8px 3px 8px; border-radius: 10px; margin: 5px 5px; } span.task_box img { padding-left: 10px; cursor: pointer; } button.task_btn { background-color: #17375e; color: #fff; padding: 5px 15px; border: 0px; border-radius: 10px; } ``` ``` <body> <div class="input_fields"> <label for="goto" id="goto_label">Go to</label> <select id="goto"> <option value="" selected disabled hidden>Select</option> <option value="Place 1">Place 1</option> <option value="Place 2">Place 2</option> <option value="Place 3">Place 3</option> <option value="Place 4">Place 4</option> </select> <button type="button" onclick="createTaskFn('goto_label', 'goto')" class="task_btn"> OK </button> </div> <div class="input_fields"> <label for="wait" id="wait_label">Wait for</label> <select id="wait"> <option value="" selected disabled hidden>Select</option> <option value="Place 1">Place 1</option> <option value="Place 2">Place 2</option> <option value="Place 3">Place 3</option> <option value="Place 4">Place 4</option> </select> <button type="button" onclick="createTaskFn('wait_label', 'wait')" class="task_btn"> OK </button> </div> <div class="input_fields"> <label for="pickup" id="pickup_label">Pick-up load</label> <select id="pickup"> <option value="" selected disabled hidden>Select</option> <option value="Place 1">Place 1</option> <option value="Place 2">Place 2</option> <option value="Place 3">Place 3</option> <option value="Place 4">Place 4</option> </select> <button type="button" onclick="createTaskFn('pickup_label', 'pickup')" class="task_btn"> OK </button> </div> <div class="input_fields"> <label for="wait" id="dropoff_label">Dropp-off load</label> <select id="dropoff"> <option value="" selected disabled hidden>Select</option> <option value="Place 1">Place 1</option> <option value="Place 2">Place 2</option> <option value="Place 3">Place 3</option> <option value="Place 4">Place 4</option> </select> <button type="button" onclick="createTaskFn('dropoff_label','dropoff')" class="task_btn"> OK </button> </div> <div class="input_fields"> <label for="charge" id="charge_label">Charge</label> <select id="charge"> <option value="" selected disabled hidden>Select</option> <option value="Place 1">Place 1</option> <option value="Place 2">Place 2</option> <option value="Place 3">Place 3</option> <option value="Place 4">Place 4</option> </select> <button type="button" onclick="createTaskFn('charge_label', 'charge')" class="task_btn"> OK </button> </div> <div class="input_fields"> <label for="repeat" id="repeat_label">Repeat</label> <select id="repeat"> <option value="" selected disabled hidden>Select</option> <option value="Place 1">Place 1</option> <option value="Place 2">Place 2</option> <option value="Place 3">Place 3</option> <option value="Place 4">Place 4</option> </select> <button type="button" onclick="createTaskFn('repeat_label', 'repeat')" class="task_btn"> OK </button> </div> <div class="input_fields"> <label for="stop" id="stop_label">Stop</label> <select id="stop"> <option value="" selected disabled hidden>Select</option> <option value="Place 1">Place 1</option> <option value="Place 2">Place 2</option> <option value="Place 3">Place 3</option> <option value="Place 4">Place 4</option> </select> <button type="button" onclick="createTaskFn('stop_label', 'stop')" class="task_btn"> OK </button> </div> <div class="task_window"> Task: <div id="final_task"></div> <button type="submit" onclick="pushTask()" class="task_btn">OK</button> </div> </body> ```
null
CC BY-SA 4.0
null
2022-09-20T13:44:14.270
2022-09-20T13:50:41.237
2022-09-20T13:50:41.237
19,985,836
19,985,836
null
73,788,233
2
null
73,768,789
0
null
Try to add this property in your spring-boot configuration file:
null
CC BY-SA 4.0
null
2022-09-20T14:18:43.547
2022-09-20T14:18:43.547
null
null
20,039,741
null
73,788,251
2
null
73,768,917
2
null
I ran into a similar issue when upgrading to Dolphin. I was able to solve this by changing the preview's theme from App.Starting [default] to my app's theme. [](https://i.stack.imgur.com/cnwoH.png)
null
CC BY-SA 4.0
null
2022-09-20T14:20:02.637
2022-09-20T14:20:02.637
null
null
1,228,788
null
73,788,864
2
null
73,788,340
1
null
The answer returned here by `dsolve` is correct and so is the one given by Wolfram Alpha as well. There is not a unique form for the general solution of an ODE because there are different ways to define the arbitrary constants. Here the difference between `log(t - C1)` and `log(C1 - t)` is just `I*pi` which can be absorbed into the arbitrary constant `C2`. The two different forms for the general solution are both correct but would have different values for `C2` in order to satisfy the same initial conditions. If you expected everything to be real (rather than complex) then `log(C1 - t)` will be defined only for `t < C1` and `log(t - C1)` will be defined only for `t > C1`. It isn't necessary to return different forms for `t < C1` and `t > C1` though because both general solutions given hold for all (complex) `t != C1` provided you understand that the constant `C2` is not constrained to be real.
null
CC BY-SA 4.0
null
2022-09-20T15:05:13.277
2022-09-20T15:05:13.277
null
null
9,450,991
null
73,788,949
2
null
30,684,613
2
null
As this just happened to me, working with Android Studio Chipmunk Patch 2. and nothing of the above answers worked so ``` defaultConfig { targetSdkVersion = 30 compileSdkVersion = 30 } ```
null
CC BY-SA 4.0
null
2022-09-20T15:12:32.627
2022-09-24T14:11:50.427
2022-09-24T14:11:50.427
7,837,772
7,837,772
null
73,789,360
2
null
64,818,969
0
null
When debugging, the compiler will stop and Visual Studio will break on the error that occurred, even though it has a catch. Don't worry, this will never happen when running the application normally. > Note: If the exception thrown inside your `try` block is not handled in the `catch` block, the application will crash, so it'd be great if you add a `catch(Exception)` block, so if a non-prevented exception occurs, you treat it accordingly.
null
CC BY-SA 4.0
null
2022-09-20T15:42:10.737
2022-09-20T15:42:10.737
null
null
15,111,846
null
73,789,735
2
null
73,785,152
0
null
You can change the config before using anything related to stripe or on your model you can create a static function to override the defaults but this way you will need to use stripe through the model ``` public static function stripe(array $options = []) { return Cashier::stripe(array_merge([ 'api_key' => $this->getStripeKey(), ], $options)); } ``` or update the config ``` config(['cashier.secret' => $key]) ```
null
CC BY-SA 4.0
null
2022-09-20T16:15:56.383
2022-09-20T16:15:56.383
null
null
10,917,416
null
73,789,958
2
null
73,788,316
0
null
``` =ARRAY_CONSTRAIN(MAP(G3:G,H3:H,I3:I,LAMBDA(g,h,i,SUM(FILTER(E3:E,g=A3:A,h=B3:B,i=C3:C,D3:D="Yes")))),COUNTA(I:I),1) ``` `MAP` the values from `User Input` and `FILTER` the `Data` by each value.
null
CC BY-SA 4.0
null
2022-09-20T16:35:11.887
2022-09-20T16:35:11.887
null
null
8,404,453
null
73,790,322
2
null
73,788,558
0
null
The coordinates `p` and `q` can be obtained through [numpy.fft.fftfreq](https://numpy.org/doc/stable/reference/generated/numpy.fft.fftfreq.html) if `FFT(f(x,y))` is obtained through `np.fft.fft`. I'd have to read the paper to make sure I understand their definition of `p` and `q`. Here I assume they are integer values (because of how they are used, I think this is correct, but I might be wrong!). I'm also assuming that `N` is the size of the image `f(x,y)` along both axes. If these assumptions are correct, then you need to set ``` f = np.fft.fftfreq(N, 1/N) p = f[:,None] q = f[None,:] ``` (The indexing operations to obtain `p` and `q` there create 2D arrays where the values run along the one row or one column, respectively.) Now Broadcasting then allows the operations to produce the right results: ``` tmp = (p**2 + q**2) * np.fft.fft2(f) out = -(2 * np.pi / N)**2 * np.fft.ifft2(tmp) ``` (and similarly for the 2nd expression.)
null
CC BY-SA 4.0
null
2022-09-20T17:09:48.243
2022-09-20T17:09:48.243
null
null
7,328,782
null
73,790,428
2
null
64,809,766
0
null
**For Adding Button inside background notification ** ``` void showFlutterNotification(RemoteMessage message) { RemoteNotification? notification = message.notification; AndroidNotification? android = message.notification?.android; if (notification != null && android != null && !kIsWeb) { flutterLocalNotificationsPlugin.show( notification.hashCode, notification.title, notification.body, NotificationDetails( android: AndroidNotificationDetails( channel.id, channel.name, channelDescription: channel.description, // TODO add a proper drawable resource to android, for now using // one that already exists in example app. icon: 'launch_background', actions: <AndroidNotificationAction>[ AndroidNotificationAction('id_1', 'Action 1'), AndroidNotificationAction('id_2', 'Action 2'), AndroidNotificationAction('id_3', 'Action 3'), ], ), ), ); } } ```
null
CC BY-SA 4.0
null
2022-09-20T17:18:43.360
2022-09-20T17:18:43.360
null
null
10,199,457
null
73,790,556
2
null
71,176,461
0
null
Sorry this is so late. I noticed it's been answered already on Github, so I just [commented there](https://github.com/react-hook-form/react-hook-form/discussions/7852#discussioncomment-3692813) with an additional two cents. Essentially, I think `useController` is much easier to use and maybe in some cases necessary when you need to use a variable in an external handler that you cannot otherwise retrieve within the scoped `<Controller />`-rendered element. (See example in Github comment.)
null
CC BY-SA 4.0
null
2022-09-20T17:29:39.000
2022-09-20T17:29:39.000
null
null
5,940,856
null
73,791,366
2
null
72,957,110
0
null
I had the same issue and think it's because PBI is trying to display all the categories from the Legend on the Y axis, which show up as "hidden" or blank bars in between your other bars and make it look like the spacing is random. I was able to fix this by switching from a Clustered Bar to a Stacked Bar chart. Couldn't figure out how to suppress those other legend categories from the Y axis in a Clustered Bar. Hope that helps.
null
CC BY-SA 4.0
null
2022-09-20T18:48:33.307
2022-09-20T18:48:33.307
null
null
20,045,687
null
73,791,626
2
null
73,791,601
1
null
Sure, just remove the class from the active one first: ``` item.addEventListener("click", (event) => { // get active, and if it exists, remove active document.querySelector(".block-filter__dropdown_state_active")?.classList.remove("block-filter__dropdown_state_active"); item.querySelector(".block-filter__dropdown").classList.toggle( "block-filter__dropdown_state_active" ); item.querySelector(".block-filter__icon").classList.toggle( "block-filter__icon_state_active" ); if (event.target.classList.contains("block-filter__item")) { item.querySelector(".block-filter__value").textContent = event.target.textContent; } }); ``` We use [?.](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining) here to prevent us from going further (and causing an error) if there is no active dropdown already.
null
CC BY-SA 4.0
null
2022-09-20T19:16:31.947
2022-09-20T19:17:49.513
2022-09-20T19:17:49.513
18,244,921
18,244,921
null
73,791,698
2
null
57,890,199
0
null
recyclerViewHorizontal.setMinimumHeight(maxItemHeight) has worked well for me.
null
CC BY-SA 4.0
null
2022-09-20T19:25:38.197
2022-09-20T19:25:38.197
null
null
15,147,676
null
73,791,798
2
null
37,583,875
0
null
Just update your libraries in build.gradle(Project folder) and try again
null
CC BY-SA 4.0
null
2022-09-20T19:36:17.610
2022-09-20T19:36:17.610
null
null
6,078,825
null
73,792,559
2
null
72,876,514
0
null
person_name = input('') person_age = int(input(''))
null
CC BY-SA 4.0
null
2022-09-20T20:57:15.870
2022-09-20T20:57:28.647
2022-09-20T20:57:28.647
20,046,509
20,046,509
null
73,792,843
2
null
33,836,344
0
null
105 Error is you are doing a "Console Output" in a GUI App! Also note: Alexandria v11.2 has the same stupid bug! [](https://i.stack.imgur.com/ndCZU.png) FASTMM4.PAS is doing a Writeln() - So you should not feel bad, when the developers of the compiler do the same Delphi 101 Error!!
null
CC BY-SA 4.0
null
2022-09-20T21:29:11.340
2022-09-20T21:29:11.340
null
null
2,112,065
null
73,793,123
2
null
72,840,693
0
null
i was having the same problem. I solved the problem as described below. 1. Modify the styles.xml file: <style name="MainTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="android:forceDarkAllowed">false</item> 2. Modify the mainactivity.cs file: Theme = "@style/MainTheme" to Theme = "@style/MainTheme.Base" 3. OnCreate method starts like this protected override void OnCreate(Bundle savedInstanceState) { AppCompatDelegate.DefaultNightMode = AppCompatDelegate.ModeNightNo; base.OnCreate(savedInstanceState);
null
CC BY-SA 4.0
null
2022-09-20T22:07:51.190
2022-09-20T22:07:51.190
null
null
16,665,711
null
73,793,119
2
null
17,415,096
0
null
I just made this by Kotlin, perhaps someone likes it. [check this gif](https://i.stack.imgur.com/zuCAS.gif) Create class with any name to customize seek bar like this: ``` class CustomSeekBar( context: Context, attrs: AttributeSet ) : AppCompatSeekBar(context, attrs) { private var rect: Rect = Rect() private var paint: Paint = Paint() private var seekbarHeight: Int = 6 @Synchronized override fun onDraw(canvas: Canvas) { // for seek bar line rect[0, height / 2 - seekbarHeight / 2, width] = height / 2 + seekbarHeight / 2 paint.color = ContextCompat.getColor(context, R.color.black_30) canvas.drawRect(rect, paint) //for right side if (this.progress > 0) { rect[width / 2, height / 2 - seekbarHeight / 2, width / 2 + width / 200 * (progress)] = height / 2 + seekbarHeight / 2 paint.color = ContextCompat.getColor(context, R.color.green) canvas.drawRect(rect, paint) } //for left side if (this.progress < 0) { rect[width / 2 - width / 200 * (-progress), height / 2 - seekbarHeight / 2, width / 2] = height / 2 + seekbarHeight / 2 paint.color = ContextCompat.getColor(context, R.color.red) canvas.drawRect(rect, paint) } super.onDraw(canvas) } } ``` Go to the xml and put this tag ``` <com.YOUR_PACKAGE.CustomSeekBar android:id="@+id/seek_habit_point" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="@dimen/spacing_medium" android:max="100" android:min="-100" android:paddingStart="@dimen/spacing_small" android:paddingEnd="@dimen/spacing_small android:progressDrawable="@android:color/transparent" android:thumb="@drawable/seek_bar_custom_thumb" app:layout_constraintEnd_toEndOf="@+id/text_seek_bar_point" app:layout_constraintStart_toStartOf="@+id/text_point_part" app:layout_constraintTop_toBottomOf="@+id/text_point_part" tools:targetApi="o" /> ``` and that is.
null
CC BY-SA 4.0
null
2022-09-20T22:07:37.070
2022-09-20T22:07:37.070
null
null
16,292,763
null
73,793,170
2
null
73,791,601
0
null
What you need to do is look for a currently active item first and "de-activate" them. You should also check that the currently active item is not the clicked item as you already have logic defined for that. I've expanded on your snippet to create a solution. NOTE: It might be useful creating a separate function/s for handling to "activate" and "de-activate" code where you pass in a `.block-filter` element. ``` const burgerBtn = document.querySelector(".header__burger"), menu = document.querySelector(".menu"), body = document.querySelector(".body"), filter = document.querySelector(".filter"), blockFilter = document.querySelectorAll(".block-filter"), dropdown = document.querySelectorAll(".block-filter__dropdown"); if (filter) { blockFilter.forEach(item => { item.addEventListener("click", event => { const active_dropdown = document.querySelector(".block-filter__dropdown_state_active"); if(active_dropdown !== null){ // get parent until we find ".block-filter" const active_item = active_dropdown.closest(".block-filter"); // check it's not the current item if(active_item !== null && active_item !== item){ // apply same logic as below to remove active state active_item.querySelector(".block-filter__dropdown").classList.remove("block-filter__dropdown_state_active"); active_item.querySelector(".block-filter__icon").classList.remove("block-filter__icon_state_active"); } } // your original logic item.querySelector(".block-filter__dropdown").classList.toggle("block-filter__dropdown_state_active"); item.querySelector(".block-filter__icon").classList.toggle("block-filter__icon_state_active"); if (event.target.classList.contains("block-filter__item")) { item.querySelector(".block-filter__value").textContent = event.target.textContent; } }) }) } ``` ``` /* base styles */ * { box-sizing: border-box; } html { font-family: sans-serif; background-color: #f3f3f3; } .filter.hero__filter { width:600px; margin:auto; border: 2px solid #eee; background-color: #fff; } .filter__form { display:flex; } .filter__block { flex: 1; padding: 5px; position: relative; } .block-filter__header { font-weight:600; font-size:12px; color: #555; } .block-filter__dropdown { display:none; position:absolute; top:100%; left:0; right:0; background-color:#fff; border: 1px solid #ccc; box-shadow: 0 2px 4px rgb(0 0 0 / 10%); border-radius:4px; } .block-filter__dropdown_state_active { display: block; } .block-filter__item { padding: 5px 10px; display:block; border-bottom: 1px solid #eee; } .block-filter__item:last-child { border-bottom: none; } ``` ``` <div class="filter hero__filter"> <form class="filter__form"> <div class="filter__block block-filter"> <div class="block-filter__button"> <div class="block-filter__header"> <span class="block-filter__type">Purpose</span> <div class="block-filter__icon"></div> </div> <span class="block-filter__value">Buy</span> </div> <div class="block-filter__dropdown"> <span class="block-filter__item">Buy</span> <span class="block-filter__item">Sell</span> </div> </div> <div class="filter__block block-filter"> <div class="block-filter__button"> <div class="block-filter__header"> <span class="block-filter__type">Second</span> <div class="block-filter__icon"></div> </div> <span class="block-filter__value">Alpha</span> </div> <div class="block-filter__dropdown"> <span class="block-filter__item">Bravo</span> <span class="block-filter__item">Charlie</span> <span class="block-filter__item">Delta</span> </div> </div> </form> </div> ```
null
CC BY-SA 4.0
null
2022-09-20T22:15:46.650
2022-09-20T22:15:46.650
null
null
10,086,352
null
73,793,284
2
null
5,465,555
1
null
I think you cannot exactly get the grayscale image which you have shown from the binary image. What you can do is convert the image into grayscale and then do gaussian noising to spread the edge and then you can also add random noise to the whole image. So, now your new grayscale image will look a lot different than binary image.
null
CC BY-SA 4.0
null
2022-09-20T22:34:16.283
2022-09-20T22:34:16.283
null
null
18,272,737
null
73,793,334
2
null
73,793,269
0
null
The following JavaScript code solves your problem: ``` var link = document.querySelector('.aaa').getAttribute('href'); console.log(link); ``` Good luck!
null
CC BY-SA 4.0
null
2022-09-20T22:43:43.953
2022-09-20T22:43:43.953
null
null
13,219,863
null
73,793,380
2
null
73,793,269
0
null
You can use [querySelctor()](https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector) (or [querySelectorAll()](https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelectorAll) if you have multiple link elements) to get references to the DOM elements that contain the link(s). Then use [getAttribute("href")](https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttribute) to get the actual link value e.g. `https://www.wikipedia.org/` and finally [redirect](https://www.w3schools.com/howto/howto_js_redirect_webpage.asp) using `window.location.replace("https://www.wikipedia.org/")`. Here a small working example which should give you an idea how this could work. ``` const linkElement = document.querySelector(".aaa"); // only return the first element with that class const link = linkElement.getAttribute("href") console.log("Doing some other stuff...") console.log("You will be redirected in 2 seconds...") setTimeout(() => window.location.replace(link), 2000); ``` ``` <a class="aaa" href="https://www.wikipedia.org/"> <div>Something inside</div> </a> ```
null
CC BY-SA 4.0
null
2022-09-20T22:51:45.603
2022-09-20T22:51:45.603
null
null
17,487,348
null
73,793,727
2
null
30,987,358
0
null
Stop some servers if you have multiple servers running ▪ sudo service mysqld stop /* this stops mysql server */ ▪ sudo service mongod stop stop mysqld when you are running Hadoop hdfs, due to lack of main memory Run: ``` hdfs dfs -ls / ```
null
CC BY-SA 4.0
null
2022-09-21T00:01:22.477
2022-09-21T00:01:22.477
null
null
11,956,116
null
73,793,770
2
null
73,792,875
0
null
You can get rid of the many-to-many by using a proper date table. In Power Pivot add a new date table, and add columns for FiscalYear, and IsLastTwelveMonths, with DAX calculated columns.
null
CC BY-SA 4.0
null
2022-09-21T00:10:21.790
2022-09-21T00:10:21.790
null
null
7,297,700
null
73,795,105
2
null
73,786,940
0
null
I already got it. Instead of doing this: ``` UPDATE `fresh-ocean-357202.Cyclistic.Cyclistic_yearly` SET duration_s = SUM((EXTRACT(HOUR FROM ride_length)*3600)+(EXTRACT(MINUTE FROM ride_length)*60)+EXTRACT(SECOND FROM ride_length)) WHERE TRUE ``` I did this: ``` UPDATE `fresh-ocean-357202.Cyclistic.Cyclistic_yearly` SET duration_s = (EXTRACT(HOUR FROM ride_length)*3600)+(EXTRACT(MINUTE FROM ride_length)*60)+EXTRACT(SECOND FROM ride_length) WHERE TRUE ``` I just removed the SUM function into the SET function
null
CC BY-SA 4.0
null
2022-09-21T03:39:19.980
2022-09-21T03:39:19.980
null
null
20,025,995
null
73,795,228
2
null
73,783,314
0
null
The `authStateChanges` is not a property but a function. Try updating it to ``` Stream<Bro?> get user { return _auth.authStateChanges().map(_userfromFirebaseUser); } ``` Also the return doesn't seems to be right to me. You are mapping via method thats accepting wrong argument. You want to have `User?` as a parameter of your method `_userfromFirebaseUser`
null
CC BY-SA 4.0
null
2022-09-21T04:02:41.680
2022-09-21T04:02:41.680
null
null
8,392,119
null
73,795,497
2
null
73,439,815
0
null
Yes, you are correct in your guess. In Postman, if you click "Cookies" under the send button, you will see there are already some cookies saved. Disney is using a service like Akamai to prevent bots / scrapers from overwhelming their server. When you make a request, they will respond with a few required parameters e.g. _abck, ak_bmsc, bm_sz, etc. Without these parameters, your request is blocked (hence, what you see when you cURL the page).
null
CC BY-SA 4.0
null
2022-09-21T04:52:30.800
2022-09-21T04:52:30.800
null
null
2,142,573
null
73,795,505
2
null
16,186,818
0
null
First set a custom theme for alert dialog in theme.xml ``` <style name="YourThemeName" parent="Theme.AppCompat.Light.Dialog.Alert"> <item name="colorAccent">#CC8800</item> <item name="android:windowBackground">@android:color/transparent</item> </style> ``` after this set this theme on your AlertDialog ``` AlertDialog.Builder alertDialog = new AlertDialog.Builder(requireActivity(),R.style.YourThemeName; alertDialog.setView(R.layout.your_custom_view); alertDialog.setCancelable(false); alertDialog.create(); alertDialog.show(); ```
null
CC BY-SA 4.0
null
2022-09-21T04:53:26.703
2022-09-21T04:53:26.703
null
null
17,013,565
null
73,795,565
2
null
73,779,832
0
null
It looks like you have a mistake in you formula expression: ``` return np.cos(np.pi*u/w) * np.sin(alpha*u)*np.sin(2*np.pi*x*u/(wavelength*f)) ``` Should be: ``` return np.cos(np.pi*u/w) * np.sin(alpha*u)*np.exp(2*np.pi*x*u/(wavelength*f)) ``` Notice the `np.exp` instead of `np.sin`. Now, if it was a copy mistake when you inserted your code here, please let me know.
null
CC BY-SA 4.0
null
2022-09-21T05:01:23.667
2022-09-21T05:01:23.667
null
null
2,938,526
null
73,795,592
2
null
73,768,917
3
null
![Repair IDE](https://i.stack.imgur.com/6xCrh.png) Have you try to using Repair IDE? It works for me
null
CC BY-SA 4.0
null
2022-09-21T05:05:53.083
2022-09-21T09:24:30.930
2022-09-21T09:24:30.930
5,529,263
16,124,502
null
73,796,071
2
null
73,527,763
0
null
This is a bug that exists in Visual Studio and you just need to update it to solve it. [https://developercommunity.visualstudio.com/t/cannot-create-proto-file-language-must-be-specifie/1552266](https://developercommunity.visualstudio.com/t/cannot-create-proto-file-language-must-be-specifie/1552266)
null
CC BY-SA 4.0
null
2022-09-21T06:12:16.953
2022-09-21T06:12:16.953
null
null
12,257,279
null
73,796,149
2
null
73,465,452
0
null
``` stps to deoply laravel project on heroku server download cli https://devcenter.heroku.com/articles/heroku-cli#download-and-install Prepare your Heroku CLI Download and install Heroku installer base on your operating system. heroku login Create Procfile inside your main Laravel project directory and push your project into Heroku and past the below code web: vendor/bin/heroku-php-apache2 public/ run the following git commands git init heroku create appname git add . git commit -m “Initial Commit” git push heroku master now try to open your laravel project you will find 500 error Step 4 — Adding some configuration in Heroku base on .env file read complete about them here https://devcenter.heroku.com/articles/config-vars you can check the image as well https://miro.medium.com/max/700/1*1uv-JEb3CNByEwC68vWGtg.png Step 5 — Database configuration First, click “Resources” menu, then in the “Add-ons” side, click “Find more add-ons”. You’ll redirect into Heroku Add-ons page.In the Heroku Add-ons page, we click Heroku Postgres. and install it its complete free . then set database properties check the link below https://miro.medium.com/max/700/1*9jLE08DL6gHyYTP89MuZtg.png https://miro.medium.com/max/700/1*eMqch3Bz2J6BLGhZ6Himmw.png https://miro.medium.com/max/700/1*u7gxP2fMnm3yScq1D0qlNQ.png to update your project Ok, now we need to commit and push our config/database.php update into Heroku repository. Back into terminal and running this git add . git commit -m “Update database connection” git push heroku master Successful, now you are ready to running your Laravel App with Heroku. Hopefully this tutorial is useful and help you all guys :) Thanks ```
null
CC BY-SA 4.0
null
2022-09-21T06:20:58.077
2022-09-21T06:20:58.077
null
null
19,907,088
null
73,796,184
2
null
73,796,157
0
null
From [Docs](https://laravel.com/docs/9.x/migrations#column-method-foreignIdFor): Which basically means, it is creating `BIGINT` column in database not `char` like uuid. It is better to use: ``` $table->foreignUuid('degreeId'); ``` in migration.
null
CC BY-SA 4.0
null
2022-09-21T06:24:34.970
2022-09-21T07:51:25.420
2022-09-21T07:51:25.420
12,530,661
12,530,661
null
73,796,429
2
null
28,802,840
0
null
Steps to find DYSM folder: - - - -
null
CC BY-SA 4.0
null
2022-09-21T06:48:33.920
2022-09-27T20:16:24.593
2022-09-27T20:16:24.593
1,988,084
11,814,358
null
73,796,540
2
null
73,796,508
0
null
To do something after a delay, you can use [setTimeout](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout)/[clearTimeout](https://developer.mozilla.org/en-US/docs/Web/API/clearTimeout) or [setInterval](https://developer.mozilla.org/en-US/docs/Web/API/setInterval)/[clearInterval](https://developer.mozilla.org/en-US/docs/Web/API/clearInterval). For example, to do it with timeouts, you could try something like this: ``` // data const a = ['a', 'b', 'c', 'd']; const b = [1, 2, 3, 4, 5, 6]; // array indices that will increment let indexA = 0; let indexB = 0; // this function sets up a timeout to print an item from A after 2 seconds const setATimeout = () => { setTimeout(() => { // print the item console.log(a[indexA]); // increment the index indexA += 1; // if array B is not done, set up a timeout for array B if(indexB < b.length) { setBTimeout(); } else if (indexA < a.length) { setATimeout(); } }, 2000); } // this function sets up a timeout to print an item from B after 3 seconds const setBTimeout = () => { setTimeout(() => { // print the item console.log(b[indexB]); // increment the index indexB += 1; // if array A is not done, set up a timeout for array A if(indexA < a.length) { setATimeout(); } else if (indexB < b.length) { setBTimeout(); } }, 3000) }; // start the initial timeout setATimeout(); ```
null
CC BY-SA 4.0
null
2022-09-21T06:59:13.813
2022-09-21T20:44:20.623
2022-09-21T20:44:20.623
4,476,484
4,476,484
null
73,796,660
2
null
73,796,508
1
null
Since you know the two arrays' combined timeout per loop/repeat is 5000ms, and array B begins 3000ms after A, you could simply do something like this: ``` const a = ['a', 'b', 'c', 'd']; const b = [1, 2, 3, 4]; a.forEach((v, i) => setTimeout(() => console.log(v), 5000 * i)); b.forEach((v, i) => setTimeout(() => console.log(v), 5000 * i + 3000)); ``` Otherwise you can implement a promise or async/await version of sleep/wait: [What is the JavaScript version of sleep()?](https://stackoverflow.com/questions/951021/what-is-the-javascript-version-of-sleep)
null
CC BY-SA 4.0
null
2022-09-21T07:09:10.957
2022-09-21T07:19:14.153
2022-09-21T07:19:14.153
584,192
584,192
null
73,796,854
2
null
73,724,974
0
null
As @Nick said, you can use `groupby` `.sum` to make a unique index Transaction. ``` new_txns = txns.groupby('Transaction').sum() ``` Then change it back to one hot encoding for basket analysis. ``` def onehot_encode(x): if x <= 0: return 0 if x >= 1: return 1 new_txns = new_txns.applymap(onehot_encode) ``` --- Note: If you want one hot as True False. ``` new_txns = new_txns.astype('bool') ```
null
CC BY-SA 4.0
null
2022-09-21T07:25:07.437
2022-09-21T07:25:07.437
null
null
15,164,497
null
73,797,190
2
null
73,797,016
1
null
You can divide your value by : `COUNTIF([range];TRUE)` In your example, it'll be : `COUNTIF(E2:I2;TRUE)` So in `D2` you'll have : `=1000/COUNTIF(E2:I2;TRUE)`
null
CC BY-SA 4.0
null
2022-09-21T07:54:54.257
2022-09-21T08:07:15.080
2022-09-21T08:07:15.080
5,632,629
19,075,135
null
73,797,247
2
null
73,796,508
0
null
So here you can use setTimeout which is inbuilt in javascript ``` window.setTimeout(function(){ // do something },delaytime) ``` nodejs ``` setTimeout(function(){ // do something },delaytime) ``` ``` let array1 = ['a','b','c','d'] let array2 = [1,2,3,4] var i = 0; (function loopwithdeley() { if (++i < array1.length+1) { setTimeout(()=>{ console.log(array1[i-1]) setTimeout(()=>{ console.log(array2[i-1]) loopwithdeley() }, 3000); }, 2000); } })(); ```
null
CC BY-SA 4.0
null
2022-09-21T07:59:33.457
2022-09-21T08:32:39.973
2022-09-21T08:32:39.973
8,737,769
8,737,769
null
73,797,275
2
null
73,797,205
2
null
You can add `width: fit-content` on `p` ``` #testBox { display: flex; flex-direction: column; width: 100%; max-width: 200px; overflow-x: auto; } p { background: red; width: fit-content; } ``` ``` <div id="testBox"> <p> hihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihihi </p> <p> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa </p> </div> ```
null
CC BY-SA 4.0
null
2022-09-21T08:02:10.200
2022-09-21T08:02:10.200
null
null
9,201,587
null
73,797,431
2
null
73,796,991
0
null
Please, test the next code. You did not answer my clarification questions and it assumes that the mentioned "tables" are the ranges we can see in your picture and there may be more occurrences of the same row content of the first range in the second one. If only one occurrence is possible and ranges to be compared are large, the code becomes faster if after `arrMtch(j, 1) = i` will be placed `:Exit For`, to exit the second loop: ``` Sub MatchingRangesRows() Dim sh As Worksheet, lastR As Long, arr1, arr2, arrMtch, i As Long, j As Long Set sh = ActiveSheet lastR = sh.Range("B" & sh.rows.count).End(xlUp).row arr1 = sh.Range("B2:D" & lastR).Value2 'place the range in an array for faster iteration/processing arr2 = sh.Range("G2:I" & lastR).Value2 ReDim arrMtch(1 To UBound(arr2), 1 To 1) 'redim the matching array ass arr1 number of rows For i = 1 To UBound(arr1) For j = 1 To UBound(arr2) If arr1(i, 1) & arr1(i, 2) & arr1(i, 3) = _ arr2(j, 1) & arr2(j, 2) & arr2(j, 3) Then arrMtch(j, 1) = i End If Next j Next i sh.Range("J2").Resize(UBound(arrMtch), 1).Value2 = arrMtch End Sub ``` Please send some feedback after testing it.
null
CC BY-SA 4.0
null
2022-09-21T08:15:04.777
2022-09-21T08:15:04.777
null
null
2,233,308
null
73,797,556
2
null
27,164,507
0
null
You can check the login session and include it to if else. example: ``` <?php if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] == true) { echo "My Account"; } else { echo "<ul><li>Login</li><li>Register</li></ul>"; } ?> ```
null
CC BY-SA 4.0
null
2022-09-21T08:24:19.230
2022-09-21T08:24:19.230
null
null
20,050,217
null
73,798,078
2
null
73,797,823
1
null
use pandas ``` import pandas as pd dataframe2['day'] = pd.to_datetime(dataframe2["Year_week"],format="%Y_%w") dataframe2.drop(columns="Year_week") ```
null
CC BY-SA 4.0
null
2022-09-21T09:00:49.463
2022-09-21T09:05:13.453
2022-09-21T09:05:13.453
1,235,698
20,050,628
null
73,798,279
2
null
40,132,631
0
null
Try to start apache tomcat, after starting tomcat your issue should be resolve.
null
CC BY-SA 4.0
null
2022-09-21T09:16:51.573
2022-09-21T09:16:51.573
null
null
20,050,870
null
73,798,827
2
null
67,705,738
0
null
In my case Kafka didn't start in the first place, I reassigned a different logs folder to server.properties files and provided necessary rights to the folder, and restarted both the zookeeper and Kafka services, and then they seem to work.
null
CC BY-SA 4.0
null
2022-09-21T09:58:50.210
2022-09-21T09:58:50.210
null
null
14,292,128
null
73,798,881
2
null
21,384,040
3
null
If it's under a docker container, run `/bin/bash` . This helped me solve the problem.
null
CC BY-SA 4.0
null
2022-09-21T10:03:19.980
2022-09-21T10:03:19.980
null
null
7,614,157
null
73,799,264
2
null
25,074,017
0
null
I have a similar case but both command `javac --version` show the old version of sdk. It shows "javac 11.0.8" even it should be "javac 19" which is the new version just be installed. 1. Go to search bar > type > env 2. click menu "Edit the system environment variables" 3. Advanced tab > click on button "Environment Variables..." 4. Under "System Variable" > select "Path" > click "Edit" 5. Looking for Java path such as "C:\Program Files\Java\jdk-19\bin" 6. Move the path using "Move Up" or "Move Down" button to the position before "%SystemRoot%\system32" Path 7. OK > OK Try the command agian. Hope this may help you guys.
null
CC BY-SA 4.0
null
2022-09-21T10:32:32.593
2022-09-21T10:33:25.480
2022-09-21T10:33:25.480
13,540,055
13,540,055
null
73,799,300
2
null
73,768,917
6
null
In my case, I have upgraded the project AGP (Android Gradle Plugin) and then restart the android studio. Problem Solved.
null
CC BY-SA 4.0
null
2022-09-21T10:35:25.117
2022-09-21T10:35:25.117
null
null
14,036,911
null
73,799,422
2
null
43,979,449
0
null
I don't think that it is a drop out layer problem. I think that it is more related to the number of images in your dataset. The point here is that you are working on a large training Set and a too small validation/test set so that this latter is way too easy to computed. Try [data augmentation](https://www.tensorflow.org/tutorials/images/data_augmentation) and other technique to get your dataset bigger!
null
CC BY-SA 4.0
null
2022-09-21T10:44:59.643
2022-09-21T10:44:59.643
null
null
17,420,892
null
73,799,684
2
null
69,250,893
0
null
I know this is an old topic now, but I came across this question while trying to deal with the similar problem myself. I was using custom class (extended) and had to override method to be able to put additional shapes to the plot list. To make graph more readable, I wanted to show every second tick on the X axis. In the end, I solved this problem by iterating tick marks and making every second mark invisible. Here is the snippet of the code: ``` public class MyLineChart extends LineChart<String, Double> { public MyLineChart ( @NamedArg("xAxis") final Axis<String> xAxis, @NamedArg("yAxis") final Axis<Double> yAxis) { super(xAxis, yAxis); } ... @Override protected void layoutPlotChildren() { super.layoutPlotChildren(); ... ObservableList<Axis.TickMark<String>> tickMarks = getXAxis().getTickMarks(); for (int i = 0; i < tickMarks.size(); i++) { tickMarks.get(i).setTextVisible(i % 2 == 0); } } ``` Hope this helps...
null
CC BY-SA 4.0
null
2022-09-21T11:04:11.630
2022-09-21T11:04:11.630
null
null
4,734,187
null
73,799,787
2
null
72,975,062
0
null
A basic version trying to reduce the number of `multicolumn`s used may be: ``` \documentclass{article} \begin{document} \begin{tabular}{*{5}{c|}} \multicolumn{1}{c}{ } & \multicolumn{1}{c}{1} & \multicolumn{1}{c}{2} & \multicolumn{1}{c}{3} & \multicolumn{1}{c}{4}\\\cline{2-5} 1 & 0 & & -2 & \\\cline{2-5} 2 & & 0 & & \\\cline{2-5} 3 & & & 0 & \\\cline{2-5} 4 & & & & 0 \\\cline{2-5} \end{tabular} \end{document} ``` [](https://i.stack.imgur.com/KCDOI.png)
null
CC BY-SA 4.0
null
2022-09-21T11:13:05.697
2022-09-21T11:13:05.697
null
null
3,543,233
null
73,799,803
2
null
73,799,334
2
null
You need to go to [google developer console](https://console.cloud.google.com/apis/credentials) for your project and add the redirect uri to the project you must set it to this exactly ``` http://localhost:8080/ ``` Credentials on the left -> edit your client add the redirect uri above. [](https://i.stack.imgur.com/lOroB.png) See: [Google OAuth2: How the fix redirect_uri_mismatch error. Part 2 server sided web applications.](https://www.youtube.com/watch?v=QHz1Rs6lZHQ)
null
CC BY-SA 4.0
null
2022-09-21T11:14:30.280
2022-09-21T11:14:30.280
null
null
1,841,839
null
73,799,818
2
null
73,799,587
0
null
It returns all persons with same score which the score is the max: ``` WITH CTE AS ( SELECT *, ROW_NUMBER() OVER(ORDER BY score desc) RN FROM scores ) SELECT * FROM CTE WHERE CTE.RN = 1 ```
null
CC BY-SA 4.0
null
2022-09-21T11:15:24.937
2022-09-21T11:15:24.937
null
null
6,203,211
null
73,799,854
2
null
73,799,587
0
null
Here's what your queries return ``` DROP table if exists t; create table t (id int,score int); insert into t values (1,10),(2,20),(3,20); SELECT s1.id,s1.score FROM t s1 JOIN ( SELECT id, MAX(score) score FROM t GROUP BY id ) s2 ON s1.score = s2.score ; +------+-------+ | id | score | +------+-------+ | 1 | 10 | | 2 | 20 | | 2 | 20 | | 3 | 20 | | 3 | 20 | +------+-------+ 5 rows in set (0.001 sec) SELECT id, score,max(score) FROM t GROUP BY id HAVING MAX(score) = score +------+-------+------------+ | id | score | max(score) | +------+-------+------------+ | 1 | 10 | 10 | | 2 | 20 | 20 | | 3 | 20 | 20 | +------+-------+------------+ 3 rows in set (0.001 sec) ``` Neither result seems to be what you are looking for. You could clarify by posting sample data and desired outcome.
null
CC BY-SA 4.0
null
2022-09-21T11:18:05.850
2022-09-21T11:18:05.850
null
null
6,152,400
null
73,799,943
2
null
73,796,157
0
null
I would suggest revisiting your approach of using UUID. I believe you have missed some steps on your way while implementing UUID. Add this to Semester Model ``` public $incrementing = false; ``` Create a trait ``` namespace App; use Illuminate\Support\Str; trait Uuids { /** * Boot function from laravel. */ protected static function boot() { parent::boot(); static::creating(function ($model) { $model->{$model->getKeyName()} = Str::uuid()->toString(); }); } } ``` Use this trait in the semester Model Follow this brilliant article from medium and if the problem persists post it here again to ask your questions [https://medium.com/@steveazz/setting-up-uuids-in-laravel-5-552412db2088](https://medium.com/@steveazz/setting-up-uuids-in-laravel-5-552412db2088)
null
CC BY-SA 4.0
null
2022-09-21T11:25:20.340
2022-09-21T11:25:20.340
null
null
17,025,740
null
73,800,047
2
null
73,798,632
1
null
FFT is complex and without a logarithm, Fourier transform would be so much brighter than all the other points that everything else will appear black. see for details: [https://homepages.inf.ed.ac.uk/rbf/HIPR2/fourier.htm](https://homepages.inf.ed.ac.uk/rbf/HIPR2/fourier.htm) ``` import cv2 import numpy as np img=cv2.imread('inputfolder/yourimage.jpg',0) def fft_image_inv(image): f = np.fft.fft2(image) fshift = np.fft.fftshift(f) magnitude_spectrum = 15*np.log(np.abs(fshift)) return magnitude_spectrum fft= fft_image_inv(img) cv2.imwrite('outputfolder/yourimage.jpg',fft) ``` output:[](https://i.stack.imgur.com/YkNVr.jpg)
null
CC BY-SA 4.0
null
2022-09-21T11:34:26.437
2022-09-21T11:34:26.437
null
null
14,492,150
null
73,800,178
2
null
73,800,078
0
null
Your `img` is positioned `relative` to the . That means it is being placed -10px beneath the body, because `.box` does not have any `position` set.
null
CC BY-SA 4.0
null
2022-09-21T11:46:06.177
2022-09-21T11:46:06.177
null
null
14,793,796
null
73,800,174
2
null
73,799,587
0
null
The problem in your second query is the fact that the `GROUP BY` clause requires all non-aggregated fields within its context. In your case you are dealing with three fields (namely "", "" and "") and you're referencing only one (namely "") inside the `GROUP BY` clause. Fixing that would require you to add the non-aggregated "" field inside your `GROUP BY` clause, as follows: ``` SELECT id, score FROM scores GROUP BY id, score HAVING MAX(score) = score ``` Though this would lead to a wrong aggregation and output, because it would attempt to get the maximum score for each combination of (id, score). And if you'd attempt to remove the "" field from both the `SELECT` and `GROUP BY` clauses, to solve the non-aggregated columns issue, as follows: ``` SELECT id FROM scores GROUP BY id HAVING MAX(score) = score ``` Then the `HAVING` clause would complain as long it references the "" field but it is found neither within the `SELECT` clause nor within the `GROUP BY` clause. There's really no way for you to use that kind of notation, as it either violates the full `GROUP_BY` mode, or it just returns the wrong output.
null
CC BY-SA 4.0
null
2022-09-21T11:45:46.083
2022-09-21T11:45:46.083
null
null
12,492,890
null
73,800,248
2
null
73,800,126
0
null
If you want to avoid SingleChildScrollView and still be able to scroll over a list, you can use ListView.builder link: - [ListView.builder flutter.dev](https://docs.flutter.dev/cookbook/lists/long-lists)
null
CC BY-SA 4.0
null
2022-09-21T11:52:21.800
2022-09-21T11:52:21.800
null
null
15,222,200
null
73,800,299
2
null
73,800,078
1
null
At "body" part of css, try "min-height" instead of "height". ``` /*your code*/ body{ display: flex; justify-content: center; height: 100vh; align-items: center; } .box{ background: lightblue; width: 300px; height: 500px; min-height: 300px; } /*try this one instead ("min-height" instead of "height") and (added "margin-top: 5vh" to ".box")*/ body{ display: flex; justify-content: center; min-height: 100vh; align-items: center; } .box{ margin-top: 5vh; background: lightblue; width: 300px; height: 500px; min-height: 300px; } ```
null
CC BY-SA 4.0
null
2022-09-21T11:56:17.650
2022-09-21T12:25:45.170
2022-09-21T12:25:45.170
20,051,109
20,051,109
null
73,800,391
2
null
73,541,662
0
null
Try to add css property: user-select: all; to "Dialog Content" paragraph.
null
CC BY-SA 4.0
null
2022-09-21T12:03:44.433
2022-09-21T12:03:44.433
null
null
11,507,197
null
73,800,437
2
null
73,793,803
0
null
The key is how you pass the panda dataframe into the query. I used string format to parameterized source, target and relationship type. ``` from py2neo import Graph df = pd.DataFrame([['Kimbal','sibling', 'Elon'], ['Boring', 'owned_by', 'Elon']], columns=['source', 'relation_type', 'target']) query = """ MERGE (s:Source {{name: '{source}'}}) MERGE (t:Target {{name: '{target}'}}) MERGE (s)-[r:{relation_type}]->(t) RETURN s.name,t.name,type(r) as relation_type;""" graph = Graph("bolt://localhost:7687", auth=("neo4j", "awesome_password")) for d in df.values: result = graph.run(query.format(source=d[0], relation_type=d[1], target=d[2])) d = result.data() print(d) ``` Result: ``` [{'s.name': 'Kimbal', 't.name': 'Elon', 'relation_type': 'sibling'}] [{'s.name': 'Boring', 't.name': 'Elon', 'relation_type': 'owned_by'}] ```
null
CC BY-SA 4.0
null
2022-09-21T12:06:49.433
2023-02-28T21:38:29.657
2023-02-28T21:38:29.657
13,302
7,371,893
null
73,800,649
2
null
23,409,138
0
null
I just wanted to post an update regarding the current state of the `WebView` of JavaFX 18, because we went with the suggested solution (setting the cookie manager before calling the web view) but still had issues. The reason for this is the way the `HTTP2Loader` class, that is used to make request in the `WebEngine`, works: ``` // Use singleton instance of HttpClient to get the maximum benefits @SuppressWarnings("removal") private final static HttpClient HTTP_CLIENT = AccessController.doPrivileged((PrivilegedAction<HttpClient>) () -> HttpClient.newBuilder() .version(Version.HTTP_2) // this is the default .followRedirects(Redirect.NEVER) // WebCore handles redirection .connectTimeout(Duration.ofSeconds(30)) // FIXME: Add a property to control the timeout .cookieHandler(CookieHandler.getDefault()) .build()); ``` Because the `HTTP_CLIENT` field is `static` and used to execute the request, only the first time a `HTTP2Loader` instance is created, will the current default `CookieHandler` be referenced. So if you just set a new `CookieHandler` every time before you load a page via the `WebView`, then this will only work once. After that the `HTTP_CLIENT` singleton will always use the `CookieHandler` that is referenced when it was created. IMHO this is a design issue in the `HTTP2Loader` class. Instead of having a `static` field, the field should be none static. The `HTTP2Loader` class is effectively an immutable one time use instance anyway, so there is no need to make use of a singleton to execute a request. I have no idea why they went with that solution, really. Even the javadoc does not make much sense, because what are the "benefits"? So there are two solutions now: 1. Access the current cookie handler an put an empty map for the URI that you will be accessing. E.g. CookieHandler.getDefault().put(someUri, Collections.emptyMap()) Though this will be a problem if you access a side and a lot of redirects happen in the process, in which case there is no way to know about which URIs cookies to empty. 2. Create a new CookieHandler before the first time a page in any WebView is loaded and keep track of it. Then before you load a WebView again, clear the CookieStore of the handler that you kept track of. Now that being said, the afore mentioned methods will fail if another piece of code that you do not have control over does the following: - `CookieHandler`- `CookieHandler`- `WebView`- `CookieHandler` In that case you will never be able to gain access to the `CookieHandler` again that is from there on out being used in the `WebView`.
null
CC BY-SA 4.0
null
2022-09-21T12:20:33.003
2022-09-21T12:20:33.003
null
null
1,607,599
null
73,801,037
2
null
73,800,126
0
null
Try removing `type: MaterialType.transparency,` ``` class MyList extends StatelessWidget { const MyList({Key? key}) : super(key: key); @override Widget build(BuildContext context) { return Drawer( child: SingleChildScrollView( child: Column( children: [ for (int i = 0; i < 2; i++) items(), ], ), ), ); } Widget items() { return Wrap( children: [ menu(), const ListTile( title: Text('title'), tileColor: Colors.grey, ), const ListTile(title: Text('title')), ], ); } Widget menu() { return Material( clipBehavior: Clip.antiAlias, // type: MaterialType.transparency, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)), child: const ExpansionTile( leading: Icon(Icons.group), title: Text('title'), children: [ ListTile(title: Text('title')), ListTile(title: Text('title')), ], ), ); } } ```
null
CC BY-SA 4.0
null
2022-09-21T12:50:19.340
2022-09-21T12:50:19.340
null
null
10,157,127
null
73,801,241
2
null
14,609,722
0
null
In Provar(2.8.0), Issue got resolved after adding the jar file(commons-io-2.11.0.jar) to the project. Steps: 1.Download the latest JAR file from [https://commons.apache.org/proper/commons-io/download_io.cgi](https://commons.apache.org/proper/commons-io/download_io.cgi) 1. Added jar file under lib folder in project. 2.Project--> Properties --> Java build path --> Libraries--Add Jars from lib folder.
null
CC BY-SA 4.0
null
2022-09-21T13:04:47.717
2022-09-21T13:04:47.717
null
null
20,052,536
null
73,801,323
2
null
73,791,773
0
null
Let´s use a reproducible dataset, `mpg`, that comes with `ggplot2`. 1. Build the plot with geom_smooth(); 2. Extract data from the created layer with ggplot_build(); 3. Modify the data of step 2; 4. Recreate the plot with new layers (I´m dividing it in geom_line() and geom_ribbon()). ``` library(tidyverse) # generate a first plot g <- ggplot() + geom_smooth(data = mpg, aes(x = displ, y = hwy)) # extract the inner results of the previous plot d1 <- ggplot_build(g)$data[[1]] # make three different ranges of data d2 <- d1 |> filter(x <= 3) d3 <- d1 |> filter(x >= 3 & x <= 5) d4 <- d1 |> filter(x >= 5) # plot again new layers ggplot() + geom_point(data = mpg, aes(x = displ, y = hwy)) + geom_line(data = d1, aes(x = x, y = y)) + geom_ribbon(data = d2, aes(x = x, ymin = ymin, ymax = ymax), alpha = .3, fill = "red") + geom_ribbon(data = d3, aes(x = x, ymin = ymin, ymax = ymax), alpha = .3, fill = "green") + geom_ribbon(data = d4, aes(x = x, ymin = ymin, ymax = ymax), alpha = .3, fill = "blue") + theme_bw() ``` [](https://i.stack.imgur.com/QGpOZ.png) Now, the inner workings of `geom_ribbon()` makes the start and end of the ribbon don't touch each other... the following is amending that (it is ugly, sorry, maybe someone will have a better ideia on this...) ``` padding <- 0.035 # make three diferent ranges of data d2 <- d1 |> filter(x <= (3 + padding)) d3 <- d1 |> filter(x >= (3 - padding) & x <= (5 + padding)) d4 <- d1 |> filter(x >= (5 - padding)) # plot again new layers ggplot() + geom_point(data = mpg, aes(x = displ, y = hwy)) + geom_line(data = d1, aes(x = x, y = y)) + geom_ribbon(data = d2, aes(x = x, ymin = ymin, ymax = ymax), alpha = .3, fill = "red") + geom_ribbon(data = d3, aes(x = x, ymin = ymin, ymax = ymax), alpha = .3, fill = "green") + geom_ribbon(data = d4, aes(x = x, ymin = ymin, ymax = ymax), alpha = .3, fill = "blue") + theme_bw() ``` [](https://i.stack.imgur.com/SMCGK.png) You should be able to apply this method in your own data.
null
CC BY-SA 4.0
null
2022-09-21T13:09:49.413
2022-09-21T15:08:18.547
2022-09-21T15:08:18.547
11,628,460
11,628,460
null
73,801,477
2
null
73,801,374
0
null
Please try this: ``` const dropdown = document.querySelector('.container'); track = 0; dropdown.addEventListener('click', () => { const container = document.querySelector('.item-container'); if (track === 0) { container.style.maxHeight = '700px'; track++; } else { container.style.maxHeight = '0px'; track--; } }) ``` ``` html, body { margin: 0; padding: 0; height: 100%; font-family: 'Lato', sans-serif; } .space { height: 20%; } .layout { display: flex; flex-direction: column; align-items: center; background: rgb(236, 236, 236); height: 60%; min-height: fit-content; } .container .item-container { max-height: 0; transition: max-height 0.3s; overflow: hidden; } .container { margin-top: 25px; text-align: center; background: rgb(223, 223, 223); border-radius: 5px; border: 1px solid white; max-width: 300px; min-width: 300px; box-shadow: 0px 0px 5px black; } .container:hover { background: rgb(212, 212, 212); } .dropdown-title { margin: 15px 0px 15px 0px; min-height: 10px; font-weight: 900; font-size: 1.3rem; } .item-container { background: rgb(255, 255, 255); font-size: 1rem; border-radius: 0px 0px 3px 3px; } .item-text { margin: 0px 0px 0px 0px; padding: 15px 10px 15px 10px; font-weight: 900; } .item-text:hover { background: rgb(231, 231, 231); } ``` ``` <div class="space"></div> <div class="layout"> <div class="container"> <p class="dropdown-title">Sample Title</p> <div class="item-container"> <p class="item-text">Sample Item</p> <p class="item-text">Sample Item</p> <p class="item-text">Sample Item</p> <p class="item-text">Sample Item</p> <p class="item-text">Sample Item</p> </div> </div> </div> ```
null
CC BY-SA 4.0
null
2022-09-21T13:21:19.130
2022-09-21T14:49:06.537
2022-09-21T14:49:06.537
1,264,804
19,931,722
null
73,801,929
2
null
73,801,821
-1
null
`http.get` is generic and lets you pass in the expected type of data, so you could use `{ [key: string]: string }` as the type: ``` return this.http.get<{ [key: string]: string }>('../../data/properties.json').pipe( ```
null
CC BY-SA 4.0
null
2022-09-21T13:50:56.847
2022-09-21T13:50:56.847
null
null
18,244,921
null
73,802,114
2
null
45,309,447
0
null
``` function median(arr) { let n = arr.length; let med = Math.floor(n/2); if(n % 2 != 0){ return arr[med]; } else{ return (arr[med -1] + arr[med])/ 2.0 } } console.log(median[1,2,3,4,5,6]); ```
null
CC BY-SA 4.0
null
2022-09-21T14:04:05.643
2022-09-26T05:46:34.680
2022-09-26T05:46:34.680
6,630,012
20,044,161
null