Id
int64
1.68k
75.6M
PostTypeId
int64
1
2
AcceptedAnswerId
int64
1.7k
75.6M
ParentId
int64
1.68k
75.6M
Score
int64
-60
3.16k
ViewCount
int64
8
2.68M
Body
stringlengths
1
41.1k
Title
stringlengths
14
150
ContentLicense
stringclasses
3 values
FavoriteCount
int64
0
1
CreationDate
stringlengths
23
23
LastActivityDate
stringlengths
23
23
LastEditDate
stringlengths
23
23
LastEditorUserId
int64
-1
21.3M
OwnerUserId
int64
1
21.3M
Tags
sequence
74,684,952
2
null
74,658,133
0
null
This answers is based on the answer on your previous [question](https://stackoverflow.com/questions/74572541/is-there-a-way-to-add-a-3rd-4th-and-5th-y-axis-using-bokeh). As it is mentioned there, the extra y-ranges are saved in a dictionary with the keyword `extra_y_ranges`. Therefor you only have to change the `js_link` using `extra_y_ranges` with a valid name. For example `range_slider_c.js_link("value", p0.extra_y_ranges["c", "start", attr_selector=0)`. ## Complete minimal example ``` from bokeh.layouts import column from bokeh.models import LinearAxis, Range1d, CustomJS, RangeSlider from bokeh.plotting import figure, show, output_notebook output_notebook() data_x = [1,2,3,4,5] data_y = [1,2,3,4,5] color = ['red', 'green', 'magenta', 'black'] p = figure(plot_width=500, plot_height=300) p.line(data_x, data_y, color='blue') range_sliders = [] for i, c in enumerate(color, start=1): name = f'extra_range_{i}' lable = f'extra range {i}' p.extra_y_ranges[name] = Range1d(start=0, end=10*i) p.add_layout(LinearAxis(axis_label=lable, y_range_name=name), 'right') p.line(data_x, data_y, color=c, y_range_name=name) range_slider = RangeSlider(start=0, end=10*i, value=(1,9*i), step=1, title=f"Slider {lable}") range_slider.js_link("value", p.extra_y_ranges[name] , "start", attr_selector=0) range_slider.js_link("value", p.extra_y_ranges[name] , "end", attr_selector=1) range_sliders.append(range_slider) show(column(range_sliders+[p])) ``` ## Output [](https://i.stack.imgur.com/r0sZY.png) ## Comment To stack the sliders and the figure i use the `column` layout, which takes a list of bokeh objects. Other layouts are [available](https://docs.bokeh.org/en/latest/docs/reference/layouts.html).
null
CC BY-SA 4.0
null
2022-12-05T08:00:24.013
2022-12-05T08:14:34.833
2022-12-05T08:14:34.833
14,058,726
14,058,726
null
74,685,064
2
null
74,682,586
0
null
Some issues: - `(SELECT * FROM S WHERE A.s = S.s)``A``WHERE`- `ON A.x = C.x``C`- - `WHERE` So, without trying to impose some execution plan, you should just do this without subqueries: ``` SELECT A.a, C.y FROM Product AS A INNER JOIN Store AS S ON A.s = S.s INNER JOIN Customer AS C ON A.x = C.x WHERE A.p > 100 AND C.z = "Q" ```
null
CC BY-SA 4.0
null
2022-12-05T08:09:19.497
2022-12-05T08:09:19.497
null
null
5,459,839
null
74,685,189
2
null
36,345,377
0
null
You also get "Unable to create requested service" when you (try to) use a JDBC driver that isn't installed. Going by your stacktrace, I don't think that's the reason in your case - I just wanted to add it to the discussion for those who come here from searching for that error message.
null
CC BY-SA 4.0
null
2022-12-05T08:22:10.473
2022-12-05T08:22:10.473
null
null
507,970
null
74,685,599
2
null
74,127,579
1
null
You can preview your codes as simple as running them like this: ``` library(DiagrammeR) DiagrammeR( " **graph LR A-->B** ") ``` You should be able to see [this](https://i.stack.imgur.com/4uQvy.png)
null
CC BY-SA 4.0
null
2022-12-05T08:59:22.440
2022-12-05T22:10:17.390
2022-12-05T22:10:17.390
20,524,021
20,524,021
null
74,685,877
2
null
18,120,088
1
null
This is what I wanted ``` id tenant 1 1 2 1 3 1 1 2 2 2 3 2 1 3 2 3 3 3 ``` My current table definition is ``` CREATE TABLE `test_trigger` ( `id` BIGINT NOT NULL, `tenant` varchar(255) NOT NULL, PRIMARY KEY (`id`,`tenant`) ); ``` I created one table for storing the current id for each tenant. ``` CREATE TABLE `get_val` ( `tenant` varchar(255) NOT NULL, `next_val` int NOT NULL, PRIMARY KEY (`tenant`,`next_val`) ) ENGINE=InnoDB ; ``` Then I created this trigger which solve my problem ``` DELIMITER $$ CREATE TRIGGER trigger_name BEFORE INSERT ON test_trigger FOR EACH ROW BEGIN UPDATE get_val SET next_val = next_val + 1 WHERE tenant = new.tenant; set new.id = (select next_val from get_val where tenant=new.tenant); END$$ DELIMITER ; ``` This approach will be thread safe also because any insertion for the same tenant will happen sequentially because of the update query in the trigger and for different tenants insertions will happen parallelly.
null
CC BY-SA 4.0
null
2022-12-05T09:22:16.173
2022-12-05T09:22:16.173
null
null
9,599,500
null
74,685,910
2
null
74,632,833
0
null
Please check the elastic search hostname using a database or may set it using the below command. php bin/magento config:set catalog/search/engine elasticsearch7 php bin/magento config:setcatalog/search/elasticsearch7_server_hostname <elasticsearch_hostname> php bin/magento config:set catalog/search/elasticsearch7_server_port <elasticsearch_port>
null
CC BY-SA 4.0
null
2022-12-05T09:25:07.870
2022-12-05T09:26:21.313
2022-12-05T09:26:21.313
16,593,531
16,593,531
null
74,686,200
2
null
74,666,053
1
null
No, this is not possible, Telegram Bot API only support a small set of urls, like `t.me` and the normal `http(s)://`, any custom format can't be passed a clickable link. Source: (Still) Can't find any source in the [Telegram docs](https://core.telegram.org/bots/api), however, I've asked this a few months ago to the [Telegram Bot Support](https://t.me/BotSupport), I wanted to send a clickable `tel:` link, they replied with: > Hi, at the moment only http/https links will be supported. --- The closest you can come to mimic this, is by using backticks to make it copy to your clipboard when you press it: [How to make that when you click on the text it was copied pytelegrambotapi](https://stackoverflow.com/questions/59713920/how-to-make-that-when-you-click-on-the-text-it-was-copied-pytelegrambotapi)
null
CC BY-SA 4.0
null
2022-12-05T09:49:31.443
2022-12-05T09:49:31.443
null
null
5,625,547
null
74,686,496
2
null
73,339,715
0
null
Try this code below. It's not perfect but it has similar elements like your example: ``` library(DiagrammeR) grViz(" digraph { graph[rankdir = LR, fontsize = 30] edge [color = 'blue', penwidth = 3.5] node[color = 'white', fontsize = 25] subgraph cluster_1 { label = 'Input' color = 'red' node [shape = circle] a; b; c; d} subgraph cluster_2 { label = 'Output' color = 'red' node [shape = circle] x; y; z} a -> x b -> y c -> y d -> z } ") ``` The final outcome looks like [this](https://i.stack.imgur.com/naeXZ.png). I may revisit this answer later once I am more proficient.
null
CC BY-SA 4.0
null
2022-12-05T10:11:20.743
2022-12-05T10:12:39.877
2022-12-05T10:12:39.877
20,524,021
20,524,021
null
74,686,678
2
null
74,637,804
0
null
Problem with your callback. Try to reorganize as below. ``` let upload = multer({ storage, limit: { fileSize: 1000000 * 100 }, }); express.post("/", upload.single("myfile"), async (req, res, error) => { // validate request // codes } ```
null
CC BY-SA 4.0
null
2022-12-05T10:27:35.307
2022-12-05T10:27:35.307
null
null
19,262,395
null
74,687,046
2
null
74,686,852
0
null
You can use filtered aggregation: ``` select s.id as societe, c.typecombustible, sum(c.quantiteconsommee) filter (where extract(YEAR from p.datedebut) = 2020) as "2020", sum(c.quantiteconsommee) filter (where extract(YEAR from p.datedebut) = 2021) as "2021", sum(c.quantiteconsommee) filter (where extract(YEAR from p.datedebut) = 2022) as "2022" from sch_consomind.consommationcombustible c join sch_referentiel.societe s on c.unite = u.id join sch_referentiel.unite u on s.id = u.societe_id join sch_referentiel.periode p on p.id = c.periode group by s.id, c.typecombustible order by s.id, c.typecombustible; ``` --- And before you ask: no, this can not be made "dynamic". A fundamental restriction of the SQL language is, that the number, names and data types of all columns of a query must be known before the database starts retrieving the data.
null
CC BY-SA 4.0
null
2022-12-05T10:56:36.020
2022-12-05T10:56:36.020
null
null
330,315
null
74,687,283
2
null
74,658,028
0
null
Hope you are not using delegated permission in your personal account , [](https://i.stack.imgur.com/trY7y.png) Looks like there is something wrong with your API call ,make sure you are using the correct API call - [https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items](https://graph.microsoft.com/v1.0/sites/%7Bsite-id%7D/lists/%7Blist-id%7D/items) You can also Try to create and Update in graph explorer- [https://learn.microsoft.com/en-us/graph/api/listitem-create?view=graph-rest-1.0&tabs=http#example](https://learn.microsoft.com/en-us/graph/api/listitem-create?view=graph-rest-1.0&tabs=http#example) . Hope this helps Thanks
null
CC BY-SA 4.0
null
2022-12-05T11:15:34.073
2022-12-05T11:15:34.073
null
null
18,106,676
null
74,687,590
2
null
70,491,774
0
null
The component where you use `useNavigate` should wrap by `<Router> ... </Router>` e.g. ``` <Router> <AuthProvider> <----- useNavigate used in this component <NavBar /> <Routes> <Route exact path="/login" element={<LoginForm />} /> <Route exact path="/register" element={<RegisterForm />} /> </Routes> </AuthProvider> </Router> <OtherComponent/> <----- if useNavigate use inside this component then error occur because useNavaigate work inside <Router> Component so it should wrap inside <Router> ``` Like this : ``` <Router> <AuthProvider> <NavBar /> <Routes> <Route exact path="/login" element={<LoginForm />} /> <Route exact path="/register" element={<RegisterForm />} /> </Routes> </AuthProvider> <OtherComponent/> </Router> ```
null
CC BY-SA 4.0
null
2022-12-05T11:40:52.880
2022-12-05T11:46:26.873
2022-12-05T11:46:26.873
14,276,118
14,276,118
null
74,687,679
2
null
74,686,845
0
null
You probably need [COUNTIFS](https://support.microsoft.com/en-us/office/countifs-function-dda3dc6e-f74e-4aee-88bc-aa8c2a866842) which -- similar to the `SUMIFS` you are already using -- allows to define multiple critera and ranges. So, if the column `R` contains the values, you want to build the average upon, and the column `H` in the respective row must equal `$B$28` to be included in the sum, the respective `COUNTIFS` looks as follows ``` =SUMIFS('ESL Info'!$R:$R,'ESL Info'!H:H,$B$28)/COUNTIFS('ESL Info'!$H:$H,$B$28, 'ESL Info'!$R:$R, "<>0") ``` ie additionally to the value in the `H`-column to equal `B28` it also requires the value `R`-column (ie the actual number you are summing up) to be different from `0` You could also add the same criteria `'ESL Info'!$R:$R, "<>0"` to your `SUMIFS`, but that isn't necessary, because a `0` doesn't provide anything to you sum, thus it doesn't matter if it's included in the sum or not ... And depending on the Excel version you are using, you may even have the [AVERAGEIFS](https://support.microsoft.com/en-us/office/averageifs-function-48910c45-1fc0-4389-a028-f7c5c3001690) function available, which does exactly what you want ``` =AVERAGEIFS('ESL Info'!$R:$R,'ESL Info'!$H:$H;$B$28,'ESL Info'!$R:$R,"<>0") ```
null
CC BY-SA 4.0
null
2022-12-05T11:46:58.923
2022-12-05T12:43:58.080
2022-12-05T12:43:58.080
3,776,927
3,776,927
null
74,688,296
2
null
74,687,343
1
null
It looks like you have created a recurring loop / Cycle. The `tools:layout` should not be reffering to the file you are in, but instead, some example layout file that you want the designer to display. From the docs: `This attribute declares which layout you want the layout preview to draw inside the fragment (because the layout preview cannot execute the activity code that normally applies the layout).` Try deleting the `tools:layout=` line. or putting something more appropriate inside it. [https://developer.android.com/studio/write/tool-attributes#toolslayout](https://developer.android.com/studio/write/tool-attributes#toolslayout)
null
CC BY-SA 4.0
null
2022-12-05T12:35:13.083
2022-12-05T12:35:13.083
null
null
940,834
null
74,688,870
2
null
5,826,592
1
null
Alternative: ``` import numpy as np import matplotlib.pyplot as plt xi = np.array([0., 0.5, 1.0]) yi = np.array([0., 0.5, 1.0]) zi = np.array([[0., 1.0, 2.0], [0., 1.0, 2.0], [-0.1, 1.0, 2.0]]) v = np.linspace(-.1, 2.0, 15, endpoint=True) fig, ax = plt.subplots() plt.contour(xi, yi, zi, v, linewidths=0.5, colors='k') ContourPlot = plt.contourf(xi, yi, zi, v, cmap=plt.cm.jet) ColorBar = fig.colorbar(ContourPlot) # Add a colorbar to a plot ColorBar.set_ticks(v) plt.show() ``` [](https://i.stack.imgur.com/8UNri.png)
null
CC BY-SA 4.0
null
2022-12-05T13:20:41.863
2022-12-05T13:20:41.863
null
null
10,456,105
null
74,689,455
2
null
74,689,346
1
null
You have to create a component from your `<Drodown />` (save it in a sepearte file i.e. `Dropdown.js`) and then pass the headline (`headline`) and the options to select (`content`) dynamically to the component. ``` const Dropdown = ({headline, content}) => { const [drop, setDrop] = useState(false); const handleDrop = () => { setDrop(!drop); }; return ( <div> <h1>{headline}</h1> <div onClick={handleDrop}> {drop ? <AiOutlineMinus /> : <BsPlus />} </div> </div> {content.map((index, entry) => { return ( <div className={drop ? "h-auto flex-col" : "fixed left-[100%]"} key={index}> <div> <h1>{entry}</h1> </div> </div> }) } </div> ) } ``` Note, the code rendering the `content` is sort of pseudocode. You have to adapt it (datastructure of `content` and function to render it) to your needs.
null
CC BY-SA 4.0
null
2022-12-05T14:06:01.680
2022-12-05T14:06:01.680
null
null
3,935,035
null
74,689,463
2
null
74,689,346
0
null
We usually call this component "Accordion", and you have multiple accordions inside your "Dropdown" component. You could create one component that would serve as THE accordion component, this component could receive the title (Hello, Um, etc..) and its content by props. This component would have his own individual state. You would have something like: ``` <Accordion title="Hello" content="Content that is hidden by default" /> ``` Or if you want to maintain them in the the same component you could create indexes for them and store the indexes in a array state, and instead of using "drop" to check if the accordion is opened, you could send to a function to check if the index is included in the state.
null
CC BY-SA 4.0
null
2022-12-05T14:06:33.313
2022-12-05T14:06:33.313
null
null
3,018,468
null
74,689,680
2
null
74,689,430
8
null
If the task to sum all columns then you shouldn't use `group by`: ``` SELECT SUM(collateral_amount) AS collateral_amount, SUM(withdraw_amount) AS withdraw_amount, SUM(total_amount_to_treasure) AS total_amount_to_treasure, SUM(id) AS id FROM loans; ```
null
CC BY-SA 4.0
null
2022-12-05T14:22:35.400
2022-12-05T14:22:35.400
null
null
20,666,497
null
74,689,878
2
null
24,952,593
0
null
For future needs, you can also consider using this simple library: [https://www.npmjs.com/package/google-maps-current-location](https://www.npmjs.com/package/google-maps-current-location) It adds the typical button to the map, it handles the geolocation, and it also adds the blue circle surrounding the marker.
null
CC BY-SA 4.0
null
2022-12-05T14:38:16.720
2022-12-05T14:38:16.720
null
null
20,692,317
null
74,689,894
2
null
60,766,214
0
null
Flexbox will help you: Here's the HTML: ``` <div class="content"> <div class="left"> Left Side </div> <div class="right"> Right Side </div> </div> ``` Here's the CSS: ``` .content{ display: flex; } .right{ margin-left: auto; } ```
null
CC BY-SA 4.0
null
2022-12-05T14:39:29.593
2022-12-05T14:39:29.593
null
null
20,692,292
null
74,690,068
2
null
29,676,757
0
null
Add this code into your viewcontroller: ``` // title color self.navigationController?.navigationBar.titleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor.black] ``` It's working for me. I hope this help for someone.
null
CC BY-SA 4.0
null
2022-12-05T14:51:21.510
2022-12-05T14:51:21.510
null
null
12,515,054
null
74,690,738
2
null
74,690,471
0
null
As I understood it correctly, you are using different deliminter among your txt file. You shoud set it as a space or a tab. Not both. Make it all the same and you might be good.
null
CC BY-SA 4.0
null
2022-12-05T15:42:42.090
2022-12-05T15:42:42.090
null
null
20,646,982
null
74,690,789
2
null
73,150,520
0
null
Because the Markdown specification varies from platform to platform, video support can be inconsistent. The simplest solution is to use an HTML video tag instead: ``` <video src='/files/recording.mp4' /> ``` This has the added benefit of allowing you to set the styling with HTML/CSS.
null
CC BY-SA 4.0
null
2022-12-05T15:46:29.033
2022-12-05T15:46:29.033
null
null
2,213,454
null
74,690,848
2
null
74,689,260
0
null
To plot several items in one graph, you can simply do: ``` plt.figure() plt.plot(x1, y1) plt.plot(x2, y2) plt.show ``` Both curve will appear on the same figure. Also, please put code rather than image so it's easier to replicate.
null
CC BY-SA 4.0
null
2022-12-05T15:51:53.847
2022-12-05T15:51:53.847
null
null
15,870,626
null
74,691,374
2
null
74,691,232
0
null
Try this code. ``` def midform(point1, point2): x = (point1[0] + point2[0])/2 y = (point1[1] + point2[1])/2 print("Midpoint X:", x, "Y:", y) ``` Error: because `point1[0]` is in your case an integer and you try indexing on int.
null
CC BY-SA 4.0
null
2022-12-05T16:28:17.747
2022-12-05T16:28:17.747
null
null
17,507,911
null
74,691,425
2
null
26,958,179
0
null
I have the same error (`Can't convert value at index 1 to color: type=0x1`) with this code: ``` <item name="colorPrimary">@color/material_dynamic_primary20</item> <item name="colorPrimaryDark">@color/design_default_color_primary_dark</item> <item name="colorAccent">@color/slidetoact_defaultAccent</item> ``` It just needs to be replaced with this ``` <item name="colorPrimary">#003549</item> <item name="colorPrimaryDark">#3700B3</item> <item name="colorAccent">#FF4081</item> ```
null
CC BY-SA 4.0
null
2022-12-05T16:31:50.720
2022-12-09T15:37:09.723
2022-12-09T15:37:09.723
7,699,617
19,052,779
null
74,692,309
2
null
66,820,206
1
null
using `rememberRipple(bounded = false)` will give a circular ripple effect around the clicked component. It can be used as -> ``` Modifier.clickable( indication = rememberRipple(bounded = false), interactionSource = remember { MutableInteractionSource() } ) { } ```
null
CC BY-SA 4.0
null
2022-12-05T17:47:11.480
2022-12-05T17:47:11.480
null
null
11,383,270
null
74,692,475
2
null
74,692,342
0
null
try: ``` =SUM(FILTER(H:H; G:G=2022; I:I="DE")) ```
null
CC BY-SA 4.0
null
2022-12-05T18:01:55.497
2022-12-05T18:01:55.497
null
null
5,632,629
null
74,692,999
2
null
74,685,652
0
null
It appears there are some special characters in your path after `C:\Users\Hadas\Desktop`. I suspect that the ActiveMQ Artemis Windows start script is choking on these characters. Try creating a new path without the special characters. That should work. Also, ensure you're using the [latest release](https://activemq.apache.org/components/artemis/download/) of ActiveMQ Artemis as it has a fix for [ARTEMIS-4057](https://issues.apache.org/jira/browse/ARTEMIS-4057) which impacts the Windows start script.
null
CC BY-SA 4.0
null
2022-12-05T18:47:42.687
2022-12-05T18:47:42.687
null
null
8,381,946
null
74,694,189
2
null
74,693,179
5
null
You can do division normalization in Python/OpenCV. - - - - - Input: [](https://i.stack.imgur.com/nwFj3.png) ``` import cv2 import numpy as np # read the image img = cv2.imread('equation.png') # convert to gray gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) # blur smooth = cv2.GaussianBlur(gray, None, sigmaX=100, sigmaY=100) # divide gray by morphology image division = cv2.divide(gray, smooth, scale=255) # save results cv2.imwrite('equation_division.jpg',division) # show results cv2.imshow('smooth', smooth) cv2.imshow('division', division) cv2.waitKey(0) cv2.destroyAllWindows() ``` Result: [](https://i.stack.imgur.com/pd4Yf.jpg)
null
CC BY-SA 4.0
null
2022-12-05T20:44:52.997
2022-12-05T20:44:52.997
null
null
7,355,741
null
74,694,204
2
null
74,693,885
2
null
`Path` environment variable returned by `GetEnvironmentVariable` consists of merged `Path` from User variables and System variables. The provided screenshot seems to show only `Path` from User variables, check System variables `Path` also (and check it for duplicate entries).
null
CC BY-SA 4.0
null
2022-12-05T20:47:01.413
2022-12-05T20:47:01.413
null
null
2,501,279
null
74,694,774
2
null
74,694,162
0
null
In the below regex I tried to match the enum cases as close as possible to avoid false positives and made use of groups for easier replacing Find Regex: ``` (\.stocks\(.)(high|low|veryHigh)(Risk)\) ``` Replace pattern ``` $1$2$3()) ```
null
CC BY-SA 4.0
null
2022-12-05T21:49:12.280
2022-12-05T21:49:12.280
null
null
9,223,839
null
74,694,824
2
null
74,643,529
0
null
I would do it with "swagger annotations" like so: ``` package com.example.springboot3openapi; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.media.Content; import io.swagger.v3.oas.annotations.media.ExampleObject; import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.responses.ApiResponse; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; @RestController public class SomeController { @Operation(summary = "Get some", responses = { @ApiResponse( description = "Successful Operation", responseCode = "200", content = { @Content( mediaType = "application/json", schema = @Schema(implementation = SomeObject.class) ), @Content( // ! mediaType = "text/csv", schema = @Schema(implementation = SomeObject.class), examples = { // !! @ExampleObject(value = "foo;bar\nstring;string\n") // <- your csv string here } ) } ), @ApiResponse(responseCode = "401", description = "Authentication Failure", content = @Content) // ,... }) @GetMapping(value = "some", produces = {"text/csv", "application/json"}) public ResponseEntity<SomeObject> somePost() { return ResponseEntity.ok(new SomeObject("Hello", "World")); } } ``` Produces UI like: [](https://i.stack.imgur.com/mk0ij.png) This is a openapi-v3 solution, for v2 please replace with the according annotations. Tested with sprin-boot:3.0.0 (-> [https://springdoc.org/v2/](https://springdoc.org/v2/)) and spring-boot:2.7.6 (-> [https://springdoc.org/](https://springdoc.org/)). #
null
CC BY-SA 4.0
null
2022-12-05T21:54:50.267
2022-12-05T21:54:50.267
null
null
592,355
null
74,694,983
2
null
74,660,272
0
null
We found more details from the progress property in the response object, and saw the error message "The user's Drive storage quota has been exceeded.", but it's not make sense at all, since we are using "Enterprise editions" google workspace, which suppose has no limit. The service account and key look good, GCP didn't complain any thing. And that's the first thing we checked during troubleshooting. Anyway, the fix is: after create a new service account then use the new key of this new service account, the system back to work.
null
CC BY-SA 4.0
null
2022-12-05T22:12:11.383
2022-12-05T22:13:58.143
2022-12-05T22:13:58.143
19,250,667
19,250,667
null
74,695,500
2
null
74,653,651
0
null
Is this what you are looking for: ``` create table test as ( select 1 as id, 'Apple' as fruit, 'Lidl' as store, 'Green' as colour, 'Germany' as country union all select 2 as id, 'Apple' as fruit, 'Lidl' as store, 'Green' as colour, 'Austria' as country union all select 3 as id, 'Orange' as fruit, 'Aldi' as store, 'Yellow' as colour, 'Austria' as country ); with has_germany as ( select fruit, store, colour, country, first_value(country) over (partition by store order by case when country = 'Germany' then 0 else 1 end ) as has_germany from test ) select fruit, store, colour, country from has_germany where (has_germany = 'Germany' and country = 'Germany' ) or has_germany <> 'Germany'; ``` The first statement just sets up your input table (next time please put you source data in a plain text format). The query just detects if 'Germany' is in the store's list of countries and then applies the WHERE logic of 'if it has Germany then it much be country Germany'. I'm not 100% sure this covers all the corner cases you need but should get you started.
null
CC BY-SA 4.0
null
2022-12-05T23:13:09.637
2022-12-05T23:13:09.637
null
null
13,350,652
null
74,695,947
2
null
74,695,859
-2
null
Lua has to be capitalized to run!
null
CC BY-SA 4.0
null
2022-12-06T00:29:26.227
2022-12-06T00:29:26.227
null
null
18,787,560
null
74,696,259
2
null
19,017,694
1
null
True one liner random string options: ``` implode('', array_rand(array_flip(str_split(str_shuffle('abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ'))), 21)); md5(microtime() . implode('', array_rand(array_flip(str_split(str_shuffle('abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ'))), 21))); sha1(microtime() . implode('', array_rand(array_flip(str_split(str_shuffle('abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ'))), 21))); ```
null
CC BY-SA 4.0
null
2022-12-06T01:27:48.693
2022-12-06T01:27:48.693
null
null
2,495,935
null
74,696,728
2
null
73,875,711
0
null
The same thing happened to me until a while ago. I fixed it by changing the way I set the color scheme I had, leaving it at `colorscheme oceanic_material`. Before I had it as `autocmd vimenter * colorscheme oceanic_material`. Here I attach a photo of how I currently have it: [](https://i.stack.imgur.com/JTXD4.png)
null
CC BY-SA 4.0
null
2022-12-06T02:51:45.090
2022-12-09T21:58:15.733
2022-12-09T21:58:15.733
2,452,869
19,260,756
null
74,696,754
2
null
74,596,968
0
null
Fix it with system installer. My Vscode now can install
null
CC BY-SA 4.0
null
2022-12-06T02:55:41.370
2022-12-06T02:55:41.370
null
null
18,846,428
null
74,696,825
2
null
21,413,664
0
null
for a short intro on how to run python macros in LibreOffice Calc, you may check [Python Macros in LibreCalc](https://www.arunkhattri.org/posts/python_macros/)
null
CC BY-SA 4.0
null
2022-12-06T03:09:53.550
2022-12-06T03:09:53.550
null
null
4,858,908
null
74,696,856
2
null
74,679,201
2
null
Having noticed the OP provided a link to raw, int data, I ran it through a moving average filter. Advantage of a moving average filter is one doesn't need to add all the samples in the buffer but just subtract the one dropping off and add in the new sample to an initial sum of buffer contents. Far less computational work and memory accesses. Here's the filtered result overlayed with the original data: And here's the code that reads in the original data as well as outputs synced original data and filtered data. ``` #include <iostream> #include <fstream> #include <vector> #include <array> #include <numeric> #include <algorithm> #include <cstdio> #include <type_traits> using std::array, std::vector, std::size_t; using sample_type = int; // data sample type, either int or double constexpr int Global_Filter_N = 41; // filter length, must be odd // moving average filter template <typename T=sample_type, int N=Global_Filter_N> class Filter_MA { public: T clk(T in) { sum += in - buf[index]; buf[index] = in; index = (index + 1) % N; if constexpr (std::is_floating_point_v<T>) return sum / N; else return (sum + (N / 2)) / N; } bool update_vectors(const vector<T>& vin, vector<T>* pvout, vector<T>* prawout = nullptr) { if (vin.size() <= N || pvout == nullptr) return false; pvout->reserve(vin.size() - N); if (prawout != nullptr) pvout->reserve(vin.size() - N); for (size_t i = 0; i < N; i++) clk(vin[i]); for (size_t i = N; i < vin.size(); i++) { pvout->push_back(clk(vin[i])); if (prawout != nullptr) prawout->push_back(vin[i - N / 2]); } return true; } private: array<T, N> buf{}; // moving average buffer T sum{}; // running sum of buffer size_t index{}; // current loc remove output, add input }; template <typename T=sample_type> std::pair<T, T> peak_detect(T y1, T y2, T y3) { // scale pk location by 100 to work with int arith T pk = 100* (y1 - y3) / (2 * (y1 - 2 * y2 + y3)); T mag = 2 * y2 - y1 - y3; return std::pair{ pk, mag }; } struct WaveInfo { sample_type w_mean{}; sample_type w_max{}; sample_type w_min{}; vector<sample_type> peaks; vector<sample_type> mags; }; inline WaveInfo get_wave_info(std::vector<sample_type> v) { constexpr int N = Global_Filter_N; static_assert(Global_Filter_N & 1, "filter must be odd number"); WaveInfo w; w.w_max = *std::max_element(v.begin(), v.end()); w.w_min = *std::min_element(v.begin(), v.end()); // "0ll + sample_type{}" Produces either a double or long long int depending on sample_type to stop overflow if > 2M samples w.w_mean = static_cast<sample_type>(std::accumulate(v.begin(), v.end(), 0ll + sample_type{}) / std::size(v)); sample_type pos_thresh = w.w_mean + (w.w_max - w.w_mean) / 10; // 10% above ave. sample_type neg_thresh = w.w_mean + (w.w_min - w.w_mean) / 10; // 10% below ave int search_polarity = 0; // if 0 prior peak polarity not determined for (int i = 0; i < int(v.size()) - N; i++) { const int center = N/2; if (v[i] > pos_thresh && v[i] > v[i + N - 1] && v[i] < v[i + center] && search_polarity >= 0) { search_polarity = -1; auto results = peak_detect(v[i], v[i + center], v[i + N - 1]); w.peaks.push_back(results.first * center / 100 + i + center); w.mags.push_back(results.second); } if (v[i] < neg_thresh && v[i] < v[i + N - 1] && v[i] > v[i + center] && search_polarity <= 0) { search_polarity = 1; auto results = peak_detect(v[i], v[i + N / 2], v[i + N - 1]); w.peaks.push_back(results.first * center / 100 + i + center); w.mags.push_back(-results.second); } } return w; } // Used to get text file int samples vector<sample_type> get_raw_data() { std::ifstream in("raw_data.txt"); vector<sample_type> v; int x; while(in >> x) v.push_back(x); return v; } int main() { Filter_MA filter; vector<sample_type> vn = get_raw_data(); vector<sample_type> vfiltered; vector<sample_type> vraw; if (!filter.update_vectors(vn, &vfiltered, &vraw)) return 1; // exit if update failed // file with aligned raw and filtered data std::ofstream out("waves.txt"); for (size_t i = 0; i < vfiltered.size(); i++) out << vraw[i] << " " << vfiltered[i] << '\n'; // get filtered file metrics WaveInfo info = get_wave_info(vfiltered); out.close(); // file with peak locs and magnitudes out.open("peaks.txt"); for (size_t i = 0; i < info.peaks.size(); i++) out << info.peaks[i] << " " << info.mags[i] << '\n'; } ``` Here's the peak info output for the first 4 peaks. First column is location, second column is a relative magnitude of the peak, ``` 116 43 344 32 577 44 812 37 ``` [](https://i.stack.imgur.com/SxFUs.jpg)
null
CC BY-SA 4.0
null
2022-12-06T03:14:26.927
2022-12-27T07:52:39.803
2022-12-27T07:52:39.803
13,302
5,282,154
null
74,697,447
2
null
7,023,140
0
null
To remove Empty Rows from DataTable: ``` dt.Rows.Cast<DataRow>().ToList().FindAll(Row => { return String.IsNullOrEmpty(String.Join("", Row.ItemArray)); }).ForEach(Row => { dt.Rows.Remove(Row); }); ```
null
CC BY-SA 4.0
null
2022-12-06T04:52:30.920
2022-12-06T04:52:30.920
null
null
13,354,603
null
74,697,466
2
null
74,696,851
0
null
Most of your `UIActivityViewController` code is wrong. 1. You should not be creating a LinkMetadataManager from the image and then using it as the item you wish to share. 2. You are trying to create an array of activities and setting those as the activity configuration. This is all wrong. Your code should look more like the following: ``` let activityVC = UIActivityViewController(activityItems: [ image ], applicationActivities: nil) activityVC.completionWithItemsHandler = { (activityType, completed, returnedItems, error) in if completed || activityType == nil { // activity view is being dismissed } } present(activityVC, animated: true) ``` If you have a need to exclude certain activities you can add a line like the following: ``` activityVC.excludedActivityTypes = [ .assignToContact ] // Optionally exclude specific activities ``` If you want a bit more control you make use of `UIActivityItemsConfiguration`. The following is an example: ``` let configuration = UIActivityItemsConfiguration(objects: [ image ]) configuration.perItemMetadataProvider = { (index, key) in switch key { case .linkPresentationMetadata: // Maybe make use of your LinkMetadataManager class here var info = LPLinkMetadata() info.title = "Some Title" return info default: return nil } } let activityVC = UIActivityViewController(activityItemsConfiguration: configuration) activityVC.completionWithItemsHandler = { (activityType, completed, returnedItems, error) in if completed || activityType == nil { // activity view is being dismissed } } present(activityVC, animated: true) ```
null
CC BY-SA 4.0
null
2022-12-06T04:55:49.800
2022-12-06T04:55:49.800
null
null
20,287,183
null
74,697,476
2
null
74,696,693
0
null
Instead of this: ``` path(r'^show_user_profile/(?P<user_id>\w+)/$', views.show_user_profile, name="show_user_profile"), ``` Try this: ``` re_path(r'^show_user_profile/(?P<user_id>\w+)/$', views.show_user_profile, name="show_user_profile"), ``` And try to navigate on browser Note: I have used re_path instead of path. you can check [here](https://docs.djangoproject.com/en/4.1/ref/urls/)
null
CC BY-SA 4.0
null
2022-12-06T04:58:04.057
2022-12-06T05:13:00.953
2022-12-06T05:13:00.953
17,808,039
17,808,039
null
74,697,497
2
null
63,997,796
0
null
You can update like this ``` UPDATE Alpha SET Comments=( SELECT Comments FROM Beta WHERE Beta.ID = Alpha.ID ); ```
null
CC BY-SA 4.0
null
2022-12-06T05:01:27.320
2022-12-06T05:01:27.320
null
null
5,783,617
null
74,697,614
2
null
74,693,130
0
null
At the beginning, be sure to [enable Visual Styles](https://learn.microsoft.com/en-us/windows/win32/controls/cookbook-overview). According to [Application Requirements for Supporting Visual Styles](https://learn.microsoft.com/en-us/windows/win32/controls/visual-styles-overview#application-requirements-for-supporting-visual-styles): > For common controls, no further action is necessary to ensure that the controls are displayed in the user's preferred visual style.If your application contains custom or owner-drawn controls, you need to use the visual styles API to retrieve information about the currently active visual style, and to draw the controls in that style. Then, because the light theme and the dark theme both refer to the [.msstyles files](https://learn.microsoft.com/en-us/windows/win32/controls/themesfileformat-overview#visual-styles-section), which is for , their appearances are the same. [In Windows 8 and later, high contrast mode has been modified to work with Visual Styles](https://learn.microsoft.com/en-us/windows/win32/controls/what-s-new-for-windows-8#windows-8-and-later). The following picture shows controls supporting High Contrast Themes in Windows 11: [](https://i.stack.imgur.com/kU9Z7.png)
null
CC BY-SA 4.0
null
2022-12-06T05:22:09.297
2022-12-08T08:40:13.180
2022-12-08T08:40:13.180
65,863
15,511,041
null
74,697,773
2
null
74,690,361
0
null
In order to give the key columns dynamically, in lookup table, a field called is added for every table_name. Below is the detailed approach. - ![enter image description here](https://i.imgur.com/zuYobDj.png) - ![enter image description here](https://i.imgur.com/RZgdHCK.png) - ![enter image description here](https://i.imgur.com/Ay1e5s9.png) - `@array(item().key_column` ![enter image description here](https://i.imgur.com/1ehcIMC.png) -
null
CC BY-SA 4.0
null
2022-12-06T05:43:55.220
2022-12-06T05:43:55.220
null
null
19,986,107
null
74,697,882
2
null
74,697,828
0
null
the expression given in the eval function should in form of a string. Like this eval("4+3"). Also keep in mind that eval function takes only one arguments(here on string)
null
CC BY-SA 4.0
null
2022-12-06T05:56:08.960
2022-12-06T05:56:08.960
null
null
14,795,072
null
74,697,924
2
null
74,697,828
0
null
`4+3` yields an `int` object ("integer"; a number). Then you're sending that into `eval()`, which does not accept `int`s; only strings (text), bytes (binary data), or code objects (functions or lambdas). So that's what's causing your error. To fix it, you could do two things: `c = eval("4+3")` or `c = 4+3`. You should choose the latter. Let me explain why: `eval()` takes some text, parses it as code, and executes it. This can sometimes be useful for running "dynamic" code, that is code that for whatever reason couldn't be part of your original program (e.g. user input). It is generally discouraged, because it's not safe for uncontrolled inputs. Just writing `c = 4+3` directly is simpler, safer, and faster. You should also remove the `eval()` around your `input()` call at the top. In fact, try entering `print(a)` or `raise Exception()` when the second "enter some values" prompt appears, and you'll see what I mean.
null
CC BY-SA 4.0
null
2022-12-06T06:00:21.687
2022-12-06T06:00:21.687
null
null
4,811,803
null
74,697,933
2
null
74,697,828
0
null
Here, the `3+4` is evaluated at compile-time (converting python code to byte codes) and replaced by `7`. Here's the byte code of this piece of code `eval(3+4)`: ``` 1 0 LOAD_NAME 0 (eval) 2 LOAD_CONST 0 (7) 4 CALL_FUNCTION 1 6 POP_TOP 8 LOAD_CONST 1 (None) 10 RETURN_VALUE ``` So you're executing `eval(7)` which does not make sense. You can give the expression as a string to the eval to make it work. ``` >>> eval("3+4") 7 ```
null
CC BY-SA 4.0
null
2022-12-06T06:01:13.407
2022-12-06T06:01:13.407
null
null
12,016,688
null
74,697,944
2
null
26,018,756
0
null
in my case on `boostrap vue` with `v-select inside inline-edit table` i solved by ... ``` <style lang="scss" scoped> ... ... .custom-yo-select >>> .vs__dropdown-menu { max-height: 13em !important; position: relative !important; font-weight: 700 !important; } .custom-yo-select::v-deep .vs__dropdown-menu { max-height: 13em !important; position: relative !important; font-weight: 700 !important; } ``` here is the code ``` <v-select v-if=" ['select'].includes(data.field.input.type) && 'columnKey' in data.field " v-model=" data.item[data.field.key.toString().split('.')[0]][ data.field.key.toString().split('.')[1] ] " class="custom-yo-select" // put the scss :disabled="data.field.input.disabled" :state=" data.field.columnKey === 'dm_master' && data.item[data.field.columnKey || data.field.key] === 0 ? false : data.field.input.options && data.field.input.boolean ? true : true " :dir="$store.state.appConfig.isRTL ? 'rtl' : 'ltr'" :options="selectModal.options" @keyup.enter.shift.exact="showSelectModal(data)" @keyup.enter.ctrl.exact="showSelectModal(data)" @input="showSelectModal(data)" @search:focus="showSelectModal(data)" @search:blur="showSelectModal(data)" > ``` ``` "bootstrap": "4.6.0", "bootstrap-vue": "2.21.1", ```
null
CC BY-SA 4.0
null
2022-12-06T06:02:04.487
2022-12-06T06:02:04.487
null
null
8,122,500
null
74,697,968
2
null
74,696,715
0
null
> Trying to load the data from my database but it seems like my configuration is not working I have reproduced your issue accordingly. This might be happend due to many reasons, if your data not in correct `json format` or if your column fields are in wrong format for instance, UpperCase, LowereCase. In your scenario, you are doing wrong here: `return Json(new { data = productList});` as per your view code, you should return like this `return Json(productList);` so your error will resolve. You can try this way: [](https://i.stack.imgur.com/Hh5bU.gif) ``` public IActionResult Index() { return View(); } public ActionResult GetAll() { var productList = new List<product>() { new product(){ Id = 1, Title = "A", ISBN = "ISBN-1", Price = 10.1}, new product(){ Id = 2, Title = "B", ISBN = "ISBN-2", Price = 10.1}, new product(){ Id = 3, Title = "C", ISBN = "ISBN-3", Price = 10.1}, new product(){ Id = 4, Title = "D", ISBN = "ISBN-4", Price = 10.1}, new product(){ Id = 5, Title = "E", ISBN = "ISBN-5", Price = 10.1}, }; return Json(productList); } ``` ``` public class product { public int Id { get; set; } public string Title { get; set; } public string ISBN { get; set; } public double Price { get; set; } } ``` ``` <table id="myTable" class="table table-striped table-bordered dt-responsive nowrap" width="100%" cellspacing="0"> <thead> <tr> <th>ID</th> <th>Title</th> <th>ISBN</th> <th>Price</th> </tr> </thead> </table> @section scripts { <script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.2.1.min.js"></script> <script src="https://cdn.datatables.net/1.11.3/js/jquery.dataTables.min.js"></script> <script> $(document).ready(function () { $.ajax({ type: "GET", url: "Admin/Product/GetAll", success: function (response) { console.log(response); $('#myTable').DataTable({ data: response, columns: [ { data: 'id' }, { data: 'title' }, { data: 'isbn' }, { data: 'price' } ] }); }, error: function (response) { alert(response.responseText); } }); }); </script> } ``` [](https://i.stack.imgur.com/XP3ud.gif)
null
CC BY-SA 4.0
null
2022-12-06T06:05:01.833
2022-12-06T06:14:13.110
2022-12-06T06:14:13.110
9,663,070
9,663,070
null
74,698,048
2
null
74,690,952
0
null
My colleagues found a solution. We had to remove import through url in `main.scss` Now my code in main.scss looks like this ``` @import './parts/_table.scss'; @import './typography.scss'; @import './helpers.scss'; @import './variables.scss'; @import './theme/colors.scss'; ``` And nesting syntax from scss is working
null
CC BY-SA 4.0
null
2022-12-06T06:14:30.673
2022-12-06T06:14:30.673
null
null
20,692,883
null
74,698,734
2
null
74,695,859
1
null
run from cmd: ``` echo %path% ``` and see, the output should contain a path like this: ``` C:\Program Files\Lua\5.1;C:\Program Files\Lua\5.1\clibs;C:\Program Files\Lua\5.1\include; ``` add if needed: ``` set PATH=%PATH%;C:\Program Files\Lua\5.1;C:\Program Files\Lua\5.1\clibs;C:\Program Files\Lua\5.1\include ```
null
CC BY-SA 4.0
null
2022-12-06T07:25:47.563
2022-12-06T07:25:47.563
null
null
7,504,558
null
74,698,790
2
null
74,698,762
1
null
When you remove first 3 element, you do not have 3th element anymore. You can just ``` list.removeAt(0); list.removeAt(0); list.removeAt(0); list.removeAt(0); list.removeAt(0); ``` or ``` list.removeAt(4); list.removeAt(3); list.removeAt(2); list.removeAt(1); list.removeAt(0); ```
null
CC BY-SA 4.0
null
2022-12-06T07:32:24.110
2022-12-06T07:32:24.110
null
null
12,040,178
null
74,698,828
2
null
74,698,762
0
null
When you remove first 3 elements you don't have 3th element anymore. To make it dynamic to the list length you can do it like so: ``` void main() { List<String> list = ['first','second','3rd','4th','5th']; int length = list.length; for (int i = 0; i < length; i++) { list.removeAt(0); } print(list); } ```
null
CC BY-SA 4.0
null
2022-12-06T07:36:54.720
2022-12-06T07:36:54.720
null
null
15,943,768
null
74,698,917
2
null
74,697,648
2
null
I registered one application and granted like below: ![enter image description here](https://i.imgur.com/Q6owREp.png) I cloned the same GitHub sample and updated `appsettings.json` file same as you like below: ![enter image description here](https://i.imgur.com/BTcwaux.png) I the above sample and got below screen: ![enter image description here](https://i.imgur.com/jU7rrW3.png) When I clicked on `Sign Up/In` button, I got same error as you like below: ![enter image description here](https://i.imgur.com/o0aJgfq.png) > that, you are giving to your Domain parameter in your `appsettings.json` file. You need to change of Domain parameter that can be found here: ![enter image description here](https://i.imgur.com/TtdCwf3.png) To the error, I changed value of Domain parameter in my `appsettings.json` file like below: ![enter image description here](https://i.imgur.com/1m5Tzac.png) When I clicked on `Sign Up/In` button now by running the sample, I got the login screen with successfully like below: ![enter image description here](https://i.imgur.com/r5965gG.png) [Configure authentication using Azure Active Directory B2C | Microsoft](https://learn.microsoft.com/en-us/azure/active-directory-b2c/configure-authentication-sample-web-app?tabs=visual-studio#step-4-configure-the-sample-web-app)
null
CC BY-SA 4.0
null
2022-12-06T07:45:04.670
2022-12-06T07:45:04.670
null
null
18,043,665
null
74,698,964
2
null
74,698,696
0
null
change your code so that `i` starts from 2, and add filling columns from A to Z in your `foreach(ListViewItem comp in listView1.Items)` loop something like this: ``` //(... skipped ...) int i = 2; int j = 1; foreach(ListViewItem comp in listView1.Items) { ws.Cells[1, j] = = ((char)('@' + j)).ToString(); ws.Cells[i, j] = comp.Text.ToString(); //... rest of your code ... ``` So, `j` variable is starting from 1 and goes to number of items in your `ListView`. In each iteration code is converting `@` character to its ASCII code (`@` is 64) and adds `j` value to it (getting 65, 66, 67 etc). Resulting value is ASCII code for `A` (65), `B` (66), `C` (67)... and that value is being set as cell's value. Code that sets column works with first row, so it's `ws.Cells[1, j]`
null
CC BY-SA 4.0
null
2022-12-06T07:48:57.897
2022-12-06T07:48:57.897
null
null
6,170,890
null
74,699,179
2
null
74,699,110
0
null
Here you comparing the same character, as i == j. ``` for(int j=i;j < x.length();j++){ char c2=x.charAt(j); ``` You can start j from i+1.
null
CC BY-SA 4.0
null
2022-12-06T08:08:20.000
2022-12-06T08:08:20.000
null
null
9,628,920
null
74,699,206
2
null
74,699,110
1
null
To do this, first split the string into chars: `x.toCharArray()`, then iterate over the chars: ``` char[] chars = x.toCharArray(); for(int i = 0; i < chars.length; i++) { char current = chars[i]; // see below } ``` Then, just iterate over the string again, from `i+1` (+1 because we already checked the char at `i`), and compare: ``` char[] chars = x.toCharArray(); for(int i = 0; i < chars.length; i++) { char current = chars[i]; int foundSimilar = 0; for(int ii = i+1; ii < chars.length; ii++) { char thatChar = chars[ii]; if (thatChar == current) foundSimilar++; } // then just print out how many chars we found System.out.println(current + ": " + foundSimilar); } ``` As you can see, this yields the same output as on the image: [](https://i.stack.imgur.com/Ield7.png)
null
CC BY-SA 4.0
null
2022-12-06T08:10:49.817
2022-12-06T08:10:49.817
null
null
13,290,159
null
74,699,495
2
null
73,657,950
1
null
First of all for most developers it is sufficient to use `safeArea` as we did before, because dynamic island does not cover it (if not in expanded state). There are currently 3 states of fynamic island: 1. Compact. In the Dynamic Island, the system uses the compact presentation when there’s only one Live Activity that’s currently active. 2. Minimal. When multiple Live Activities are active, the system uses the minimal presentation to display two of them in the Dynamic Island. One Live Activity appears attached to the Dynamic Island while the other appears detached. [](https://i.stack.imgur.com/EtQOO.png) 1. Expanded. When people touch and hold a Live Activity in a compact or minimal presentation, the system displays the content in an expanded presentation. [](https://i.stack.imgur.com/5iac8.png) You can check each state if you use dynamic island yourself as part WidgetKit. Create a new widget extension if your app doesn’t already include one. Live Activities use functionality and for their user interface. For creating new Activities, please refer to [Apple official documentation for Displaying live data with Live Activities](https://developer.apple.com/documentation/activitykit/displaying-live-data-with-live-activities). If you are not intending to use Activities, but want to somehow be aware of dynamic island available sizes, Apple provides as with Dynamic island size sheet included in [Live Activities documentation](https://developer.apple.com/design/human-interface-guidelines/components/system-experiences/live-activities/) : [](https://i.stack.imgur.com/UbT32.png) Here is an attachment of how safeArea looks implemented with dynamic island: [](https://i.stack.imgur.com/7nreG.png)
null
CC BY-SA 4.0
null
2022-12-06T08:37:59.150
2022-12-06T08:45:07.323
2022-12-06T08:45:07.323
14,559,220
14,559,220
null
74,699,693
2
null
74,698,762
0
null
When you debug it yourself with simple print statements, it will become obvious, what happens: ``` void main(){ List<String> list =['first','second','3rd','4th','5th']; print(list); list.removeAt(0); print(list); list.removeAt(1); print(list); list.removeAt(2); print(list); list.removeAt(3); print(list); list.removeAt(4); print(list); } ``` > [first, second, 3rd, 4th, 5th] Removing the first element of this list: > [second, 3rd, 4th, 5th] Removing the second element of list: > [second, 4th, 5th] Removing the third element of list: > [second, 4th] And finally, trying to remove the fourth element of a list that no longer has four elements: > Uncaught Error: RangeError: Value not in range: 3
null
CC BY-SA 4.0
null
2022-12-06T08:54:32.547
2022-12-06T08:54:32.547
null
null
2,060,725
null
74,700,037
2
null
74,699,253
1
null
I am sure it is possible to achieve what you are asking, however I would suggest a simpler alternative. Instead of using a `QLabel`, It would be much simpler to achieve similar or identical behavior using a `QLineEdit`. You can set the line edit to read only and `setFrame(False)` to make it appear identical to a QLabel, with the added bonus that maintaining the current selection when opening a context menu is the default behavior for a QLine edit. For example: In the image below, the one on the right is the QLineEdit... ``` import pyperclip import sys from PySide2.QtCore import Qt from PySide2.QtGui import QCursor from PySide2.QtWidgets import QLabel,QMenu,QAction,QHBoxLayout,QApplication,QWidget, QLineEdit QSS = ("""QMenu { border: Opx; font-size: 9pt; width:100px; background-color:white } QMenu::item:selected { background-color: #f9f9f9; } QMenu::item { width:160px; font-family: "Microsoft YaHei"; border: 0px; min-height: 15px; max-height: 26px; padding:10px 15px 10px 15px; font-size: 9pt; } QLabel{ font-size:13px; font-family:微软雅黑; color: black; background-color: #f9f9f9; }""" # Added styles below to make it look identical to label """QLineEdit{ font-size:13px; font-family:微软雅黑; color: black; background-color:#f9f9f9; }""") class Demo(QWidget): def __init__(self): super(Demo, self).__init__() self.moreinfo = QLabel("YOUJIAN") self.layout = QHBoxLayout() self.layout.addWidget(self.moreinfo) self.setLayout(self.layout) self.moreinfo.setTextInteractionFlags(Qt.TextSelectableByMouse) ######################################## self.lineedit = QLineEdit(self) # <--- added these lines self.layout.addWidget(self.lineedit) self.lineedit.setText("YOUJAIN") self.lineedit.setFrame(False) self.lineedit.setReadOnly(True) self.setStyleSheet(QSS) if __name__ == "__main__": app = QApplication() demo = Demo() demo.show() sys.exit(app.exec_()) ``` [](https://i.stack.imgur.com/dJJmv.gif)
null
CC BY-SA 4.0
null
2022-12-06T09:23:16.807
2022-12-06T19:38:07.900
2022-12-06T19:38:07.900
17,829,451
17,829,451
null
74,700,010
2
null
74,698,818
0
null
`CUBE` does what you want in a single query and was covered in [my previous answer](https://stackoverflow.com/a/74447863/1509264). You cannot use `PIVOT` to do what you want in a single query; instead you would need to use multiple queries joined together with `UNION ALL` to calculate the status, sub-total and total parts (which is likely to be much less efficient): ``` SELECT TO_CHAR(status) AS status, "1", "2", "3", "5", "1" + "2" + "3" + "5" AS total FROM table_name PIVOT ( COUNT(*) FOR user_type IN (1,2,3,5) ) UNION ALL SELECT 'SUB_TOTAL', "1", "2", "3", "5", "1" + "2" + "3" + "5" AS total FROM (SELECT user_type FROM table_name WHERE status IN (2,4,5)) PIVOT ( COUNT(*) FOR user_type IN (1,2,3,5) ) UNION ALL SELECT 'TOTAL', "1", "2", "3", "5", "1" + "2" + "3" + "5" AS total FROM (SELECT user_type FROM table_name) PIVOT ( COUNT(*) FOR user_type IN (1,2,3,5) ) ``` or: ``` SELECT TO_CHAR(status) AS status, COUNT(CASE user_type WHEN 1 THEN 1 END) AS "1", COUNT(CASE user_type WHEN 2 THEN 1 END) AS "2", COUNT(CASE user_type WHEN 3 THEN 1 END) AS "3", COUNT(CASE user_type WHEN 5 THEN 1 END) AS "5", COUNT(*) AS total FROM table_name GROUP BY status UNION ALL SELECT 'SUB_TOTAL', COUNT(CASE user_type WHEN 1 THEN 1 END) AS "1", COUNT(CASE user_type WHEN 2 THEN 1 END) AS "2", COUNT(CASE user_type WHEN 3 THEN 1 END) AS "3", COUNT(CASE user_type WHEN 5 THEN 1 END) AS "5", COUNT(*) AS total FROM table_name WHERE status IN (2,4,5) UNION ALL SELECT 'TOTAL', COUNT(CASE user_type WHEN 1 THEN 1 END) AS "1", COUNT(CASE user_type WHEN 2 THEN 1 END) AS "2", COUNT(CASE user_type WHEN 3 THEN 1 END) AS "3", COUNT(CASE user_type WHEN 5 THEN 1 END) AS "5", COUNT(*) AS total FROM table_name ``` Which, for the sample data, (also from [my previous answer](https://stackoverflow.com/a/74447863/1509264)): ``` CREATE TABLE table_name (status, user_type) AS SELECT 2, 1 FROM DUAL CONNECT BY LEVEL <= 3 UNION ALL SELECT 4, 1 FROM DUAL CONNECT BY LEVEL <= 13 UNION ALL SELECT 5, 1 FROM DUAL CONNECT BY LEVEL <= 1 UNION ALL SELECT 3, 1 FROM DUAL CONNECT BY LEVEL <= 5 UNION ALL SELECT 3, 5 FROM DUAL CONNECT BY LEVEL <= 1 UNION ALL SELECT 0, 1 FROM DUAL CONNECT BY LEVEL <= 4 UNION ALL SELECT 0, 5 FROM DUAL CONNECT BY LEVEL <= 8; ``` Both output the same as using a single query with `CUBE`: | STATUS | 1 | 2 | 3 | 5 | TOTAL | | ------ | - | - | - | - | ----- | | 2 | 3 | 0 | 0 | 0 | 3 | | 4 | 13 | 0 | 0 | 0 | 13 | | 0 | 4 | 0 | 0 | 8 | 12 | | 5 | 1 | 0 | 0 | 0 | 1 | | 3 | 5 | 0 | 0 | 1 | 6 | | SUB_TOTAL | 17 | 0 | 0 | 0 | 17 | | TOTAL | 26 | 0 | 0 | 9 | 35 | --- If you did want to do it without `CUBE` then you can generate extra rows before pivoting (however, I think `CUBE` will still be more efficient): ``` SELECT title AS status, "1", "2", "3", "5", "1" + "2" + "3" + "5" AS total FROM ( SELECT l.*, t.user_type FROM table_name t CROSS JOIN LATERAL ( SELECT t.status, TO_CHAR(t.status) AS title, 1 AS priority FROM DUAL UNION ALL SELECT NULL, 'SUB_TOTAL', 2 FROM DUAL WHERE t.status IN (2,4,5) UNION ALL SELECT NULL, 'TOTAL', 3 FROM DUAL ) l ) PIVOT ( COUNT(*) FOR user_type IN (1,2,3,5) ) ORDER BY priority, status ``` Which produces the same output. [fiddle](https://dbfiddle.uk/OBbuPqU2)
null
CC BY-SA 4.0
null
2022-12-06T09:21:19.320
2022-12-06T11:00:46.737
2022-12-06T11:00:46.737
1,509,264
1,509,264
null
74,700,156
2
null
23,947,586
0
null
change your mapping-`table="Students_Courses"` to this--> mapping-`table="Students_Course"`
null
CC BY-SA 4.0
null
2022-12-06T09:31:30.727
2022-12-11T09:54:32.923
2022-12-11T09:54:32.923
4,607,733
19,106,493
null
74,700,359
2
null
74,699,220
0
null
OK, so, it looks as though you don't have a `Profile` record associated with the `User` object. ``` def index(request): user_object = User.objects.get(username=request.user.username) user_profile = Profile.objects.get(user=user_object) ``` You need to check the value of `user_object` before looking for the profile, though pretty sure this is OK, then handle that `Profile.objects.get` if it doesn't actually find an associated `Profile` record. You could do this by ``` try: user_profile = Profile.objects.get(user=user_object) except Profile.DoesNotExist: ... handle the error here ``` Alternatively, you could use the `get_object_or_404` method, which would redirect you to your 404 page if it didn't find a record. [https://docs.djangoproject.com/en/4.1/topics/http/shortcuts/#get-object-or-404](https://docs.djangoproject.com/en/4.1/topics/http/shortcuts/#get-object-or-404)
null
CC BY-SA 4.0
null
2022-12-06T09:46:04.457
2022-12-06T09:46:04.457
null
null
8,147,165
null
74,700,882
2
null
74,700,703
1
null
There are indentation errors and structural errors in your OpenAPI YAML. Specifically, there should be just one `paths` section at the root level, with individual paths listed inside it, like so: ``` paths: # <----- /widgets/home-page: # <----- get: # <----- tags: - home Page APIs sfssf description: asd operationId: getwidgets responses: '200': ... /trending-products: # <----- get: # <----- tags: # <----- - ... description: ... ... ``` Pay attention to the structure and indentation in this example and fix your definition accordingly. See the [Paths and Operations](https://swagger.io/docs/specification/paths-and-operations/) guide on swagger.io for more details.
null
CC BY-SA 4.0
null
2022-12-06T10:25:42.980
2022-12-06T10:25:42.980
null
null
113,116
null
74,700,919
2
null
74,698,693
0
null
This question ranks high in google, so I would add a settings for Vue 3. With Webpack 5 and Vue 3, the webpack config alias changes to this: ``` resolve: { extensions: [ '.tsx', '.ts', '.js', '.vue' ], alias: { 'vue': '@vue/runtime-dom' } ``` }, Alternatively this may be the solution, if the are transpilation errors: ``` alias: { 'Vue': 'vue/dist/vue.esm-bundler.js', } ```
null
CC BY-SA 4.0
null
2022-12-06T10:28:39.160
2022-12-06T10:28:39.160
null
null
20,699,149
null
74,701,114
2
null
23,193,614
0
null
I was having some proxy configuration in my `{$HOME}/.npmrc` file. Clearing it helped.
null
CC BY-SA 4.0
null
2022-12-06T10:43:31.143
2022-12-08T18:38:08.510
2022-12-08T18:38:08.510
14,267,427
12,917,052
null
74,701,951
2
null
22,464,534
0
null
Try this code : ``` .select2-selection__rendered { max-height: 80px; overflow-y: auto !important; } ```
null
CC BY-SA 4.0
null
2022-12-06T11:44:38.793
2022-12-06T11:50:11.140
2022-12-06T11:50:11.140
16,802,153
16,802,153
null
74,702,109
2
null
74,700,649
0
null
when locate element by class name, and the name with `space`, there are several ways to lcate 1. find the name only exists in the target element 2. write like this: driver.find_element_by_css_selector(".cls1.cls2") 3. or this way: driver.find_element_by_css_selector("[class='cls1 cls2']")
null
CC BY-SA 4.0
null
2022-12-06T11:56:36.813
2022-12-06T12:07:10.340
2022-12-06T12:07:10.340
4,908,026
4,908,026
null
74,702,706
2
null
74,655,907
0
null
Unfortunately this is not possible. `oneOf` - has been added to OpenAPI 3.0, drf-yasg only supports [OpenAPI 2.0](https://drf-yasg.readthedocs.io/en/stable/readme.html#openapi-3-0-note)
null
CC BY-SA 4.0
null
2022-12-06T12:41:09.223
2022-12-06T12:41:09.223
null
null
15,355,531
null
74,702,896
2
null
69,680,168
0
null
I am under keycloak 17+, I also had troubles to make it work, The correct url to use should be like: `https://myHost.com/auth/admin/realms/myRealm/users/99999999-9999-9999-9999-999999999999/reset-password` You absolutely need the `/auth/admin/realms` keywords (some other endpoints only use `/auth/realms`) ! You will also need an access token from either a keycloak user or a keycloak client in the Authorization header. Check somewhere [else](https://stackoverflow.com/questions/49572291/keycloak-user-validation-and-getting-token) to see how to generate and use an access token. The body should be like: ``` { "type": "password", "temporary": true, "value": "myNew-password1" } ``` Check documentation: [https://www.keycloak.org/docs-api/17.0/rest-api/index.html#:~:text=Set%20up%20a%20new%20password%20for%20the%20user](https://www.keycloak.org/docs-api/17.0/rest-api/index.html#:%7E:text=Set%20up%20a%20new%20password%20for%20the%20user).
null
CC BY-SA 4.0
null
2022-12-06T12:55:11.767
2022-12-06T12:55:11.767
null
null
11,769,408
null
74,703,499
2
null
73,987,290
1
null
Try to remove alpha channel from the image before inserting it into PDFPage. Below is an example how to remove alpha channel from UIImage. Tested with iOS 16.1. ``` extension UIImage { func removeAlpha() -> UIImage { let format = UIGraphicsImageRendererFormat() format.opaque = true format.scale = scale return UIGraphicsImageRenderer(size: size, format: format).image { _ in draw(in: CGRect(origin: .zero, size: size)) } } } struct PhotoDetailView: UIViewRepresentable { let image: UIImage func makeUIView(context: Context) -> PDFView { let view = PDFView(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.size.width, height: UIScreen.main.bounds.size.height)) view.document = PDFDocument() // {{ REMOVE ALPHA BEFORE INSERTING TO PDF guard let page = PDFPage(image: image.removeAlpha()) else { return view } // }} view.document?.insert(page, at: 0) view.pageBreakMargins = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0) view.minScaleFactor = 1 view.maxScaleFactor = 10 view.autoScales = true view.backgroundColor = .clear return view } func updateUIView(_ uiView: PDFView, context: Context) { } } ```
null
CC BY-SA 4.0
null
2022-12-06T13:40:28.220
2022-12-06T13:40:28.220
null
null
2,345,931
null
74,703,552
2
null
54,853,827
0
null
I think "Query Results" is able to delimit the results by a custom character, only if all the datatype is varchar. I did what you wrote in the description and additionally I casted all the columns to varchar. ``` SELECT TOP (1000) CAST([COL_A] as varchar) as 'COL_A' ,CAST([COL_B] as varchar) as 'COL_B' ,CAST([COL_C] as varchar) as 'COL_C' FROM TABLE_NAME; ```
null
CC BY-SA 4.0
null
2022-12-06T13:43:49.067
2022-12-06T13:43:49.067
null
null
10,656,350
null
74,703,855
2
null
74,703,550
2
null
you can set completion title to access your snippets in attached image you can find where to set completion title[](https://i.stack.imgur.com/wZ3jr.png)
null
CC BY-SA 4.0
null
2022-12-06T14:04:05.917
2022-12-06T14:04:05.917
null
null
7,127,047
null
74,704,149
2
null
21,236,824
0
null
In my case, with Pycharm 2019.3, the problem was that I forgot to add the extension '.py' to the file I wanted to import. Once added, the error went away without needing to invalides caches or any other step.
null
CC BY-SA 4.0
null
2022-12-06T14:25:49.437
2022-12-06T14:25:49.437
null
null
10,402,187
null
74,704,685
2
null
74,699,253
1
null
When the menu is shown, the widget uses the `Inactive` [color group](https://doc.qt.io/qt-5/qpalette.html#ColorGroup-enum) of the palette, which is the one normally used when the widget is in a window that is not active. The simple solution is to temporarily replace the `Highlight` and `HighlightedText` [color role](https://doc.qt.io/qt-5/qpalette.html#ColorRole-enum) for that group and restore the original palette afterwards. This step is necessary for consistency, as the default `Inactive` colors should be kept in case the window is unfocused. Note that in the following example I did some changes: - `contextMenuEvent()`- - [QClipboard](https://doc.qt.io/qt-5/qclipboard.html)- `self.selectedText``self.text``self.selectedText()` ``` class MoreInfoLabel(QLabel): _defaultPalette = None def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.setTextInteractionFlags(Qt.TextSelectableByMouse|Qt.TextEditable) self.setStyleSheet(''' QMenu { border: Opx; font-size: 9pt; width:100px; background-color:white } QMenu::item { width:160px; font-family: "Microsoft YaHei"; border: 0px; min-height: 15px; max-height: 26px; padding:10px 15px 10px 15px; font-size: 9pt; } QMenu::item:selected { background-color: #f9f9f9; } QLabel{ font-size:13px; font-family:微软雅黑; } ''') def contextMenuEvent(self, event): oldPalette = self.palette() tempPalette = self.palette() tempPalette.setBrush(tempPalette.Inactive, tempPalette.Highlight, oldPalette.highlight()) tempPalette.setBrush(tempPalette.Inactive, tempPalette.HighlightedText, oldPalette.highlightedText()) self.setPalette(tempPalette) menu = QMenu(self) copyAction = menu.addAction('复制') selectAction = menu.addAction('全选') res = menu.exec_(event.globalPos()) self.setPalette(oldPalette) if res == copyAction: QApplication.clipboard().setText(self.selectedText()) elif res == selectAction: self.setSelection(0, len(self.text())) ``` That said, QLabel already provides the menu entries you're trying to replace. If you did that for localization purposes, then overriding the default menu behavior is just wrong, as the problem is elsewhere.
null
CC BY-SA 4.0
null
2022-12-06T15:02:14.300
2022-12-06T15:02:14.300
null
null
2,001,654
null
74,705,291
2
null
66,432,484
0
null
There is an add-on, CustomCSS, for Thunderbird that adds CSS to the `<head>`. I have personally tried it and it works :) There are two downsides to the add-on. a) It applies to all email accounts, cannot customize per account. b) The editor is very basic (cannot use a CSS file). Link to the add-on: [https://addons.thunderbird.net/en-US/thunderbird/addon/customcss/](https://addons.thunderbird.net/en-US/thunderbird/addon/customcss/) [Screenshot](https://i.stack.imgur.com/5NUXn.png)
null
CC BY-SA 4.0
null
2022-12-06T15:43:01.427
2022-12-06T15:45:10.020
2022-12-06T15:45:10.020
10,125,554
10,125,554
null
74,705,347
2
null
61,836,792
0
null
Personally, I would advise against using the stand alone residuals you get from a GLMM or GAMM fit (here it looks like you are using the raw residuals at least). They tend to have weird characteristics and are prone to being inaccurate when you are trying to diagnose model fit. [There is an excellent vignette on the DHARMa package](https://cran.r-project.org/web/packages/DHARMa/vignettes/DHARMa.html) that would be much more useful if you are seeking to understand your residuals. It has some specific information on beta regressions as well.
null
CC BY-SA 4.0
null
2022-12-06T15:48:16.087
2022-12-06T15:48:16.087
null
null
16,631,565
null
74,705,842
2
null
74,695,059
0
null
I fixed the problem by adding a white outline to the stick figure: [Stick figure with a small single pixel white outline](https://i.stack.imgur.com/0uZfl.png)
null
CC BY-SA 4.0
null
2022-12-06T16:20:58.927
2022-12-06T16:20:58.927
null
null
20,409,816
null
74,706,070
2
null
73,331,608
0
null
You can add config to `webpack.config.js` ``` infrastructureLogging: { level: 'none', } ``` Reference: [https://webpack.js.org/configuration/other-options/#level](https://webpack.js.org/configuration/other-options/#level)
null
CC BY-SA 4.0
null
2022-12-06T16:37:58.210
2022-12-11T08:06:35.003
2022-12-11T08:06:35.003
12,352,865
19,118,896
null
74,706,662
2
null
74,698,040
0
null
In your `data()` function add a case for the `Qt::FontRole` item data role. Then just return a `QFont` instance that looks whathever you want it to look like, depending on the item's check state. ``` if (role == Qt::FontRole && item->isChecked()) { QFont font; font.setBold(true); return font; } ```
null
CC BY-SA 4.0
null
2022-12-06T17:21:17.270
2022-12-07T09:08:23.940
2022-12-07T09:08:23.940
null
4,355,012
null
74,706,854
2
null
15,791,918
0
null
Here's an example using an inline svg. ``` const labelConfig = { text: `<svg viewBox="0 0 24 24" class="plot-line-icon"><path d="M21.8 16V14.5C21.8 13.1 20.4 12 19 12S16.2 13.1 16.2 14.5V16C15.6 16 15 16.6 15 17.2V20.7C15 21.4 15.6 22 16.2 22H21.7C22.4 22 23 21.4 23 20.8V17.3C23 16.6 22.4 16 21.8 16M20.5 16H17.5V14.5C17.5 13.7 18.2 13.2 19 13.2S20.5 13.7 20.5 14.5V16M5 3C3.9 3 3 3.9 3 5V19C3 20.11 3.9 21 5 21H13.03C13 20.9 13 20.8 13 20.7V19H5V5H19V10C19.69 10 20.37 10.16 21 10.42V5C21 3.9 20.11 3 19 3H5M13.96 12.29L11.21 15.83L9.25 13.47L6.5 17H13C13.08 16.14 13.46 15.46 13.96 14.96C14.03 14.89 14.13 14.85 14.2 14.79V14.5C14.2 13.95 14.3 13.44 14.47 12.97L13.96 12.29Z"></path></svg>`, align: 'center', textAlign: 'center', rotation: 0, useHTML: true, x: 0, y: -12, } Highcharts.AST.allowedAttributes.push('viewBox'); Highcharts.chart('container', { xAxis: { categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], plotLines: [{ color: '#FF0000', width: 2, value: 2.5, label: labelConfig }] }, series: [{ data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4] }] }); ``` ``` .plot-line-icon { background-color: #FF0000; border-radius: 4px; width: 24px; height: 24px; fill: white; } ``` ``` <script src="https://code.highcharts.com/highcharts.js"></script> <div id="container"></div> ``` In a bundler setup, you could also import svg paths like this: ``` import { mdiImageLockOutline } from '@mdi/js' const labelConfig = { text: `<svg viewBox="0 0 24 24" class="plot-line-icon"><path d="${mdiImageLockOutline}"></path></svg>`, useHTML: true, } ```
null
CC BY-SA 4.0
null
2022-12-06T17:36:59.653
2022-12-06T17:36:59.653
null
null
1,071,518
null
74,708,102
2
null
74,688,796
0
null
You can ignore filter context by using ALL to get total sales: ``` VAR _TotalSales = CALCULATE ( COUNTROWS ( 'KasseJournal' ), FILTER ( ALL ( 'KasseJournal' ), 'KasseJournal'[Hendelse] = "Bekreftet kasseekspedisjon" ) ) RETURN DIVIDE ( [Totalt antall salg], _TotalSales, 0 ) ```
null
CC BY-SA 4.0
null
2022-12-06T19:31:04.863
2022-12-06T19:31:04.863
null
null
20,703,026
null
74,708,538
2
null
74,705,385
0
null
You should use `fill` to specify `Ethanol`, not `color`. You're getting random colors because of `fill = Groups`. ``` library(tidyverse) library(ggpattern) cort_v$Ethanol <- as.factor(cort_v$Ethanol) cort_v %>% ggplot(aes(x = Groups, y = nmol_L, fill = Ethanol, pattern = MIA)) + geom_boxplot() + geom_boxplot_pattern(position = position_dodge(preserve = "single"), color = "black", pattern_fill = "black", pattern_angle = 45, pattern_density = 0.1, pattern_spacing = 0.025, pattern_key_scale_factor = 0.6) + scale_fill_manual(values = c("1" = "red", "0" = "white")) + # also scale_fill, not scale_color scale_pattern_manual(values = c(Poly_IC = "stripe", Saline = "none")) + geom_point() + theme_minimal() ``` [](https://i.stack.imgur.com/KrGHF.jpg) UPDATE2: Since you're already using colors and patterns to signal variables, I would use `separate()` on the `Groups` variable and use `facet_wrap()` for gender -- female on the left, male on the right. To remove the pattern from the legend for `Ethanol`, you can add a `override.aes` argument to remove it. ``` library(tidyverse) library(ggpattern) cort_v$Ethanol <- as.factor(cort_v$Ethanol) cort_v %>% separate(Groups, into = c("Gender", "NewGroup"), extra = "merge", sep = "_") %>% ggplot(aes(x = NewGroup, y = nmol_L, fill = Ethanol, pattern = MIA)) + geom_boxplot() + geom_boxplot_pattern(position = position_dodge(preserve = "single"), color = "black", pattern_fill = "black", pattern_angle = 45, pattern_density = 0.1, pattern_spacing = 0.025, pattern_key_scale_factor = 0.6) + scale_fill_manual(values = c("1" = "red", "0" = "white")) + # also scale_fill, not scale_color scale_pattern_manual(values = c(Poly_IC = "stripe", Saline = "none")) + geom_point() + theme_minimal() + facet_wrap(~Gender) + guides(fill = guide_legend(override.aes = list(pattern = c("none", "none")))) ``` [](https://i.stack.imgur.com/ORO6t.jpg)
null
CC BY-SA 4.0
null
2022-12-06T20:15:08.010
2022-12-08T23:04:37.190
2022-12-08T23:04:37.190
14,992,857
14,992,857
null
74,708,772
2
null
74,707,509
0
null
nice find! I would call it a bug and report the issue to google via: [](https://i.stack.imgur.com/iYVZ5.png) as this is ridiculous as their faulty documentation! --- here is an alternative: [](https://i.stack.imgur.com/EjI8o.png) ``` =INDEX(LAMBDA(B, N, IF(ISDATE_STRICT(B), TRIM(FLATTEN(QUERY(TRANSPOSE( IFERROR(LAMBDA(A, LAMBDA(X, IF(X<=0,,IF(X>1, X&A&"s", X&A))) ({DATEDIF(B, N, "Y")-IF((DAYS(N, B)<365), (IF(DAYS(N, B)<DAY(EOMONTH(N, -1)), DAYS(N, B), IF(DAY(B)>1, DAY(EOMONTH(B, ))-DAY(B)+1, 0)+DAY(N)-1)>= DAY(EOMONTH(B, ))))-(((LAMBDA(Q, Q-QUOTIENT(Q, 12)*12) (COUNTUNIQUE(EOMONTH(SEQUENCE(N-B, 1, B), ))-2+ (DAY(B)=1)+(DAY(N)=DAY(EOMONTH(N, )))))=11)*((IF(DAYS(N, B)<DAY(EOMONTH(N, -1)), DAYS(N, B), IF(DAY(B)>1, DAY(EOMONTH(B, ))-DAY(B)+1, 0)+DAY(N)-1))>30)), LAMBDA(Q, Q-QUOTIENT(Q, 12)*12)(COUNTUNIQUE(EOMONTH(SEQUENCE(N-B, 1, B), ))-2+ (DAY(B)=1)+(DAY(N)=DAY(EOMONTH(N, )))), IF(DAYS(N, B)<DAY(EOMONTH(N, -1)), DAYS(N, B), IF(DAY(B)>1, DAY(EOMONTH(B, ))-DAY(B)+1, 0)+DAY(N)-1)})) ({" year", " month", " day"}))),,9^9))), ))(B1, NOW())) ``` for array `B1:B100` it would be: ``` =INDEX(BYROW(B1:B100, LAMBDA(B, LAMBDA(B, N, IF(ISDATE_STRICT(B), TRIM(FLATTEN(QUERY(TRANSPOSE( IFERROR(LAMBDA(A, LAMBDA(X, IF(X<=0,,IF(X>1, X&A&"s", X&A))) ({DATEDIF(B, N, "Y")-IF((DAYS(N, B)<365), (IF(DAYS(N, B)<DAY(EOMONTH(N, -1)), DAYS(N, B), IF(DAY(B)>1, DAY(EOMONTH(B, ))-DAY(B)+1, 0)+DAY(N)-1)>= DAY(EOMONTH(B, ))))-(((LAMBDA(Q, Q-QUOTIENT(Q, 12)*12) (COUNTUNIQUE(EOMONTH(SEQUENCE(N-B, 1, B), ))-2+ (DAY(B)=1)+(DAY(N)=DAY(EOMONTH(N, )))))=11)*((IF(DAYS(N, B)<DAY(EOMONTH(N, -1)), DAYS(N, B), IF(DAY(B)>1, DAY(EOMONTH(B, ))-DAY(B)+1, 0)+DAY(N)-1))>30)), LAMBDA(Q, Q-QUOTIENT(Q, 12)*12)(COUNTUNIQUE(EOMONTH(SEQUENCE(N-B, 1, B), ))-2+ (DAY(B)=1)+(DAY(N)=DAY(EOMONTH(N, )))), IF(DAYS(N, B)<DAY(EOMONTH(N, -1)), DAYS(N, B), IF(DAY(B)>1, DAY(EOMONTH(B, ))-DAY(B)+1, 0)+DAY(N)-1)})) ({" year", " month", " day"}))),,9^9))), ))(B, NOW())))) ``` --- ofc, this will work only up to a particular moment in history... see: [https://stackoverflow.com/a/74006429/5632629](https://stackoverflow.com/a/74006429/5632629) otherwise, this works even with leap years --- also, note this feature... [](https://i.stack.imgur.com/HSOfH.png) how can be something old 36 days when the smallest unit of the month is 28 days and the largest unit of the month is only 31 days? [](https://i.stack.imgur.com/w1iQU.png) as it would not be fair / accurate to transfer Sep days into Dec nor Dec days into Sep to fill out the month as it would create multiple correct results: - -
null
CC BY-SA 4.0
null
2022-12-06T20:37:15.610
2022-12-09T19:30:42.067
2022-12-09T19:30:42.067
5,632,629
5,632,629
null
74,708,856
2
null
74,694,543
0
null
Well, `yerr` is the distance you should add or subtract from the bar's value, so you should have `y_errormax = y_max - y_mean` and `y_errormin = y_mean - y_min` ``` y_errormin = data_AGB - np.array([3.7e-7, 8.0e-7]) y_errormax = np.array([3.7e-5, 1.1e-5]) - data_AGB ```
null
CC BY-SA 4.0
null
2022-12-06T20:46:49.347
2022-12-09T16:21:58.177
2022-12-09T16:21:58.177
4,000,607
4,000,607
null
74,709,005
2
null
73,663,200
0
null
The Raspberry Pi 2b is unable to execute an I2C repeated Start and consequently cannot do a WriteRead sequence. A hardware solution is the NXP SC18IS604 chip which translates SPI to I2C. RPi talks to the SC18IS604 via SPI and SC18IS604 then talks to the external device with I2C. It works well for me. [https://www.nxp.com/docs/en/data-sheet/SC18IS604.pdf](https://www.nxp.com/docs/en/data-sheet/SC18IS604.pdf)
null
CC BY-SA 4.0
null
2022-12-06T21:02:13.207
2022-12-06T21:02:13.207
null
null
19,958,209
null
74,709,133
2
null
74,708,787
1
null
I think this will capture your `if`/`countif` scenario: ``` library(dplyr) CleanData %>% mutate(YesOrNo = case_when(Color != "Purple" ~ "No", is.na(LABEL1) | !nzchar(LABEL1) ~ "No", !LABEL1 %in% LABEL2 ~ "No", TRUE ~ "Yes")) # LABEL1 LABEL2 Color YesOrNo # 1 HELLO <NA> Purple Yes # 2 <NA> HELLO!!! Blue No # 3 HELLO$$ <NA> Purple Yes # 4 <NA> HELLO Blue No # 5 HELLOOO <NA> Purple Yes # 6 <NA> <NA> Purple No # 7 <NA> HELLOOO Blue No # 8 <NA> HELLO$$ Blue No # 9 <NA> HELLO Yellow No ``` --- Data ``` CleanData <- structure(list(LABEL1 = c("HELLO", NA, "HELLO$$", NA, "HELLOOO", NA, NA, NA, NA), LABEL2 = c(NA, "HELLO!!!", NA, "HELLO", NA, NA, "HELLOOO", "HELLO$$", "HELLO"), Color = c("Purple", "Blue", "Purple", "Blue", "Purple", "Purple", "Blue", "Blue", "Yellow")), class = "data.frame", row.names = c(NA, -9L)) ``` or programmatically, ``` CleanData <- data.frame(LABEL1=c("HELLO",NA,"HELLO$$",NA,"HELLOOO",NA,NA,NA,NA), LABEL2=c(NA,"HELLO!!!",NA,"HELLO",NA,NA,"HELLOOO","HELLO$$","HELLO"),Color=c("Purple","Blue","Purple","Blue","Purple","Purple","Blue","Blue","Yellow")) ```
null
CC BY-SA 4.0
null
2022-12-06T21:17:05.720
2022-12-06T21:23:02.120
2022-12-06T21:23:02.120
3,358,272
3,358,272
null
74,709,185
2
null
74,704,945
2
null
It depends on how much complexity you need. [This is a fiddle](https://jsfiddle.net/3hbLdqo8/) that does the basic pathfinding you have in the animation (without rounding the corners). It figures out what side the paths should start from, and turns that into the offset for the path start and end, by comparing the x and y distances of the two objects: ``` let startsVertical = Math.abs(dx) < Math.abs(dy); if (startsVertical) { anchorPointOffset = {x: 0, y: Math.sign(dy) * circleRadius}; } else { anchorPointOffset = {x: Math.sign(dx) * circleRadius, y: 0}; } let stationaryAnchorPoint = { x: stationaryPosition.x + anchorPointOffset.x, y: stationaryPosition.y + anchorPointOffset.y }; let movingAnchorPoint = { x: movingPosition.x - anchorPointOffset.x, y: movingPosition.y - anchorPointOffset.y }; ``` If your shapes do not have the same width and height, you will need to use two variables, instead of circleRadius. Then it calculates the center point and uses that to create the middle two points of the path. ``` if (startsVertical) { middleA = { x: stationaryAnchorPoint.x, y: centerPoint.y } middleB = { x: movingAnchorPoint.x, y: centerPoint.y } } else { middleA = { x: centerPoint.x, y: stationaryAnchorPoint.y } middleB = { x: centerPoint.x, y: movingAnchorPoint.y } } ``` Rounding the corners is a little more complicated, but there are many guides for that.
null
CC BY-SA 4.0
null
2022-12-06T21:24:44.240
2022-12-06T21:24:44.240
null
null
5,548,904
null
74,709,488
2
null
74,708,787
2
null
You don't need any extra packages, here is a solution with the base R function `ifelse`, which is a frequently very useful function you should learn. An example: ``` set.seed(7*11*13) DF <- data.frame(cond=rnorm(100), X= sample(c("Yes","No"), 100, replace=TRUE)) with(DF, sum(ifelse( (cond>0)&(X=="Yes"), 1, 0))) ```
null
CC BY-SA 4.0
null
2022-12-06T22:01:17.897
2022-12-06T22:01:17.897
null
null
469,680
null
74,710,478
2
null
55,624,343
4
null
For anyone looking for the answer in v5, it's: `options.scales.x.border.display: false;`
null
CC BY-SA 4.0
null
2022-12-07T00:27:42.723
2022-12-07T00:27:42.723
null
null
17,235,857
null
74,711,014
2
null
74,707,338
0
null
Judging from the file list, your file is a `WPF` project. First create a new `Windows1.xaml` as the startup window. Then modify `StartupUri="Mainwindow.xaml` to `StartupUri="Window1.xaml` in `App.xaml`. The key code of the login window in `windows1.xaml` is: ``` private void Button_Click(object sender, RoutedEventArgs e) { MainWindow mainWindow = new MainWindow(); this.Hide(); mainWindow.ShowDialog(); } ```
null
CC BY-SA 4.0
null
2022-12-07T02:13:41.497
2022-12-07T02:13:41.497
null
null
16,764,901
null
74,711,520
2
null
5,312,235
0
null
You can press `]s` and `[s` to cycle forward and back misspelled words in a buffer. If you are over a misspelled word in normal mode, you can press `z=` to see a list of spelling suggestions. answer suggested by [zonker](https://www.linux.com/author/zonker) on [linux.com](https://www.linux.com/training-tutorials/using-spell-checking-vim/)
null
CC BY-SA 4.0
null
2022-12-07T03:42:10.923
2022-12-07T03:51:38.200
2022-12-07T03:51:38.200
14,111,707
14,111,707
null
74,712,033
2
null
30,916,523
0
null
When you create the text layout, you cannot change the width and height to something greater afterwards. You should use max screen coords when creating the layout then change the max width and height to the desired size. You should use render_tgt->DrawText(...) method for this example or release and recreate the layout interface every time the text, font name, and a lot of other various things like typography are changed. I created an array of layout and typography events that can be reapplied to the layout interface every time it is recreated. You do not need to recreate the layout for font size, since you can resize the text or individual characters with the layout interface ``` // Set the layout to maximum screen size FLOAT maxX = (FLOAT)GetSystemMetrics(SM_CXFULLSCREEN); // * XD2D::pix_to_dips.x; FLOAT maxY = (FLOAT)GetSystemMetrics(SM_CYFULLSCREEN); // * XD2D::pix_to_dips.y; XS_DWRITE_DEV_FACTORY->CreateTextLayout ( dstring, dlength, (*pp_txt_format), maxX, maxY, pp_txt_layout ); // Resize to the requested size or minimum allowed size (*pp_txt_layout)->SetMaxWidth(max(req_xsize, (*pp_txt_layout)->GetFontSize())); (*pp_txt_layout)->SetMaxHeight(max(req_ysize, (*pp_txt_layout)->GetFontSize())); ```
null
CC BY-SA 4.0
null
2022-12-07T05:11:56.800
2022-12-07T05:11:56.800
null
null
14,466,662
null
74,712,086
2
null
27,713,747
0
null
> Swift 5+ (Back button with alert control) ``` override func viewDidLoad() { super.viewDidLoad() self.navigationItem.hidesBackButton = true let newBackButton = UIBarButtonItem(title: "<Back", style: UIBarButtonItem.Style.plain, target: self, action: #selector(PGWebViewController.back(sender:))) self.navigationItem.leftBarButtonItem = newBackButton } @objc func back(sender: UIBarButtonItem) { let alert = UIAlertController(title: "Warning!", message: "Your payment process is not completed yet. Do you want to go back?", preferredStyle: .alert) let ok = UIAlertAction(title: "OK", style: .default, handler: { action in _ = self.navigationController?.popViewController(animated: true) }) alert.addAction(ok) let cancel = UIAlertAction(title: "Cancel", style: .default, handler: { action in }) alert.addAction(cancel) DispatchQueue.main.async(execute: { self.present(alert, animated: true) })} ```
null
CC BY-SA 4.0
null
2022-12-07T05:21:16.857
2022-12-07T05:21:16.857
null
null
11,641,861
null
74,712,166
2
null
74,711,949
0
null
``` override func viewDidLayoutSubviews() { super.viewDidLayoutSubviews() self.tabBar.itemPositioning = .centered self.tabBar.itemSpacing = UIScreen.main.bounds.width / 5 } ```
null
CC BY-SA 4.0
null
2022-12-07T05:31:32.827
2022-12-07T05:31:32.827
null
null
14,260,241
null
74,712,193
2
null
43,892,348
0
null
As an update for everyone who is using [Maps Compose Library](https://developers.google.com/maps/documentation/android-sdk/maps-compose) I can recommend this extension function on `CameraPositionState` to directly get the visible radius: ``` fun CameraPositionState.visibleRadius(): Double { this.projection?.visibleRegion?.let { visibleRegion -> val distanceWidth = FloatArray(1) val distanceHeight = FloatArray(1) val farRight = visibleRegion.farRight val farLeft = visibleRegion.farLeft val nearRight = visibleRegion.nearRight val nearLeft = visibleRegion.nearLeft Location.distanceBetween( (farLeft.latitude + nearLeft.latitude) / 2, farLeft.longitude, (farRight.latitude + nearRight.latitude) / 2, farRight.longitude, distanceWidth ) Location.distanceBetween( farRight.latitude, (farRight.longitude + farLeft.longitude) / 2, nearRight.latitude, (nearRight.longitude + nearLeft.longitude) / 2, distanceHeight ) return sqrt( distanceWidth[0].toDouble().pow(2.0) + distanceHeight[0].toDouble().pow(2.0) ) / 2 } return -1.0 } ``` Later you can then use it like this in you UI code: ``` LaunchedEffect(cameraPositionState.isMoving) { if (!cameraPositionState.isMoving) { viewModel.onUpdateVisibleRadius( visibleRadius = cameraPositionState.visibleRadius(), ) } } ```
null
CC BY-SA 4.0
null
2022-12-07T05:36:27.027
2022-12-07T05:36:27.027
null
null
10,060,361
null
74,712,248
2
null
74,711,304
0
null
You can create mutliple circles and update the radius each millisecond: ``` var canvasRenderer = L.canvas(); function createWavingCircle(latlng, color, fromRadius, toRadius){ var circle = L.circle(latlng, {radius: fromRadius, color, renderer: canvasRenderer}).addTo(map); var nextCircle; var interval = setInterval(()=>{ var radius = circle.getRadius()+1; if(radius <= toRadius){ circle.setRadius(radius); if(Math.round((radius / toRadius) * 100) >= 30 && !nextCircle){ nextCircle = createWavingCircle(latlng, color, fromRadius, toRadius); } } else { if(nextCircle && nextCircle.getRadius() >= toRadius){ circle.remove(); clearInterval(interval); } } },1) return circle; } // replace this values with your custom ones createWavingCircle(map.getCenter(), 'red', 10, 400); ``` [https://plnkr.co/edit/IT5VcxokeCWpkpEx](https://plnkr.co/edit/IT5VcxokeCWpkpEx)
null
CC BY-SA 4.0
null
2022-12-07T05:43:38.087
2022-12-07T06:34:44.880
2022-12-07T06:34:44.880
8,283,938
8,283,938
null